Skip to content

🎥 Make videos programmatically with React

compile everything with bun

Jonny Burger3648c6c89595
diff --git a/package.json b/package.json
index df16e57eba..39097742da 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
"watch": "tsc -b --verbose -w",
"release-alpha": "pnpm recursive publish --tag=alpha --no-git-checks && pnpm recursive run --sequential publishprivate",
"release": "pnpm recursive publish && pnpm recursive run --sequential publishprivate && git push --tags && git push",
- "clean": "rm -rf packages/**/dist && rm -rf packages/**/node_modules && rm -rf node_modules && rm -rf .cache && rm -rf packages/**/tsconfig.tsbuildinfo && rm -rf packages/**/tsconfig-cjs.tsbuildinfo && rm -f packages/tsconfig.tsbuildinfo && rm -rf packages/**/.turbo && rm -rf .turbo && rm -rf packages/**/.rollup.cache"
+ "clean": "rm -rf packages/**/dist && rm -rf packages/**/node_modules && rm -rf node_modules && rm -rf .cache && rm -rf packages/**/tsconfig.tsbuildinfo && rm -rf packages/**/tsconfig-cjs.tsbuildinfo && rm -f packages/tsconfig.tsbuildinfo && rm -rf packages/**/.turbo && rm -rf .turbo"
},
"engines": {
"node": ">=16",
diff --git a/packages/core/.npmignore b/packages/core/.npmignore
index 66e066235c..6c654afe20 100644
--- a/packages/core/.npmignore
+++ b/packages/core/.npmignore
@@ -7,12 +7,9 @@ tsconfig.tsbuildinfo
coverage
ensure-correct-version.js
.turbo
-rollup-version.config.js
-rollup.config.js
tsconfig-cjs.json
tsconfig.json
dist/tsconfig-cjs.tsbuildinfo
-.rollup.cache
.prettierrc.js
dist/esm/**.d.ts
dist/esm/**/**.d.ts
diff --git a/packages/core/bundle.ts b/packages/core/bundle.ts
new file mode 100644
index 0000000000..412528760d
--- /dev/null
+++ b/packages/core/bundle.ts
@@ -0,0 +1,35 @@
+import {build} from 'bun';
+
+const output = await build({
+ entrypoints: ['src/index.ts'],
+ naming: '[name].mjs',
+ target: 'node',
+ external: ['remotion', 'remotion/no-react', 'react', 'react-dom'],
+});
+
+const [file] = output.outputs;
+const text = (await file.text())
+ .replace(/jsxDEV/g, 'jsx')
+ .replace(/react\/jsx-dev-runtime/g, 'react/jsx-runtime');
+
+await Bun.write('dist/esm/index.mjs', text);
+
+const versionOutput = await build({
+ entrypoints: ['src/version.ts'],
+ naming: '[name].mjs',
+ target: 'node',
+});
+
+const [versionFile] = versionOutput.outputs;
+await Bun.write('dist/esm/version.mjs', await versionFile.text());
+
+const noReactOutput = await build({
+ entrypoints: ['src/no-react.ts'],
+ naming: '[name].mjs',
+ target: 'node',
+ external: ['remotion', 'react', 'react-dom'],
+});
+const [noReactFile] = noReactOutput.outputs;
+await Bun.write('dist/esm/no-react.mjs', await noReactFile.text());
+
+export {};
diff --git a/packages/core/package.json b/packages/core/package.json
index 9bcff51f5d..6add1369dc 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -10,7 +10,7 @@
"prepublishOnly": "bun ensure-correct-version.ts && cp ../../README.md .",
"lint": "eslint src --ext ts,tsx",
"test": "vitest --run",
- "build": "rollup --failAfterWarnings --config rollup-version.config.js && rollup --failAfterWarnings --config rollup-no-react.config.js && rollup --failAfterWarnings --config rollup.config.js"
+ "build": "bun bundle.ts"
},
"repository": {
"url": "https://github.com/remotion-dev/remotion"
@@ -26,7 +26,6 @@
},
"devDependencies": {
"@jonny/eslint-config": "3.0.281",
- "@rollup/plugin-typescript": "^8.2.0",
"@testing-library/react": "14.0.0",
"@happy-dom/global-registrator": "14.5.1",
"happy-dom": "14.5.1",
@@ -41,7 +40,6 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"rimraf": "^3.0.2",
- "rollup": "^2.70.1",
"vitest": "0.31.1",
"webpack": "5.83.1",
"zod": "3.22.3"
diff --git a/packages/core/rollup-no-react.config.js b/packages/core/rollup-no-react.config.js
deleted file mode 100644
index a0385d0d70..0000000000
--- a/packages/core/rollup-no-react.config.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// rollup.config.js
-import typescript from '@rollup/plugin-typescript';
-
-export default [
- {
- input: 'src/no-react.ts',
- output: [
- {
- file: 'dist/esm/no-react.mjs',
- format: 'es',
- sourcemap: false,
- },
- ],
- plugins: [
- typescript({
- tsconfig: 'tsconfig-esm.json',
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/core/rollup-version.config.js b/packages/core/rollup-version.config.js
deleted file mode 100644
index e8db508ddd..0000000000
--- a/packages/core/rollup-version.config.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// rollup.config.js
-import typescript from '@rollup/plugin-typescript';
-
-export default [
- {
- input: 'src/version.ts',
- output: [
- {
- file: 'dist/esm/version.mjs',
- format: 'es',
- sourcemap: false,
- },
- ],
- plugins: [
- typescript({
- tsconfig: 'tsconfig-esm.json',
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js
deleted file mode 100644
index 18bb6200a8..0000000000
--- a/packages/core/rollup.config.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// rollup.config.js
-import typescript from '@rollup/plugin-typescript';
-
-export default [
- {
- input: 'src/index.ts',
- output: [
- {
- file: 'dist/esm/index.mjs',
- format: 'es',
- sourcemap: false,
- },
- ],
- external: ['react', 'react-dom', 'react/jsx-runtime', 'zod'],
- plugins: [
- typescript({
- tsconfig: 'tsconfig-esm.json',
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/core/tsconfig-esm.json b/packages/core/tsconfig-esm.json
deleted file mode 100644
index 38c57cd749..0000000000
--- a/packages/core/tsconfig-esm.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "../tsconfig-esm.settings.json",
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./dist/esm",
- "skipLibCheck": true,
- "jsx": "react-jsx",
- "moduleResolution": "node"
- },
- "include": ["./src"]
-}
diff --git a/packages/google-fonts/.gitignore b/packages/google-fonts/.gitignore
index 66ea4ab47a..a3f44b23d9 100644
--- a/packages/google-fonts/.gitignore
+++ b/packages/google-fonts/.gitignore
@@ -5,4 +5,3 @@
!ensure-generation.js
!src/index.ts
!src/base.ts
-!rollup.config.js
diff --git a/packages/player/.npmignore b/packages/player/.npmignore
index 78689082ec..67e620e186 100644
--- a/packages/player/.npmignore
+++ b/packages/player/.npmignore
@@ -11,4 +11,3 @@ dist/tsconfig.tsbuildinfo
tsconfig.json
ensure-correct-version.ts
.prettierrc.js
-rollup.config.js
diff --git a/packages/tsconfig-esm.settings.json b/packages/tsconfig-esm.settings.json
deleted file mode 100644
index a21d81cf23..0000000000
--- a/packages/tsconfig-esm.settings.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2018",
- "module": "ES2020",
- "declaration": true,
- "declarationMap": false,
- "sourceMap": false,
- "lib": ["es2019", "dom"],
- "jsx": "react-jsx",
- "noEmit": false,
- "skipLibCheck": true,
- "strict": true,
- "esModuleInterop": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "composite": true
- }
-}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8fa551e57b..9e4185dc17 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -463,9 +463,6 @@ importers:
'@jonny/eslint-config':
specifier: 3.0.281
- '@rollup/plugin-typescript':
- specifier: ^8.2.0
'@testing-library/react':
specifier: 14.0.0
@@ -505,9 +502,6 @@ importers:
rimraf:
specifier: ^3.0.2
version: 3.0.2
- rollup:
- specifier: ^2.70.1
- version: 2.76.0
vitest:
specifier: 0.31.1
@@ -8689,35 +8683,6 @@ packages:
resolution: {integrity: sha512-JzgY8aSvWbuigoJ+8x1lHW8or0syQz8hxpRdPijkCCp/GJYRPvBstYdJPbHk2nbv5+BV+8Rv4zRw96wKFVsvKQ==}
dev: false
- resolution: {integrity: sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==}
- engines: {node: '>=8.0.0'}
- peerDependencies:
- rollup: ^2.14.0
- tslib: '*'
- typescript: '>=3.7.0'
- peerDependenciesMeta:
- tslib:
- optional: true
- dependencies:
- '@rollup/pluginutils': 3.1.0([email protected])
- resolve: 1.22.1
- rollup: 2.76.0
- typescript: 5.3.3
- dev: true
-
- resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==}
- engines: {node: '>= 8.0.0'}
- peerDependencies:
- rollup: ^1.20.0||^2.0.0
- dependencies:
- '@types/estree': 0.0.39
- estree-walker: 1.0.1
- picomatch: 2.3.1
- rollup: 2.76.0
- dev: true
-
resolution: {integrity: sha512-YlDNJXTCstlOmyJxeQjaTaef8ACLuEPMDrSgEichQM3ELlWuU1HTSVbpXW2x4LbbEDPXwu/aF/16MUN8pzzcmA==}
hasBin: true
@@ -9712,10 +9677,6 @@ packages:
'@types/estree': 1.0.0
dev: false
- resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==}
- dev: true
-
resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
@@ -14027,10 +13988,6 @@ packages:
'@types/unist': 2.0.6
dev: false
- resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==}
- dev: true
-
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
dependencies:
@@ -15125,13 +15082,6 @@ packages:
engines: {node: '>=8'}
dev: false
- resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
- engines: {node: '>= 0.4.0'}
- dependencies:
- function-bind: 1.1.2
- dev: true
-
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
@@ -15783,12 +15733,6 @@ packages:
ci-info: 2.0.0
dev: false
- resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==}
- dependencies:
- has: 1.0.3
- dev: true
-
resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==}
dependencies:
@@ -20373,15 +20317,6 @@ packages:
deprecated: https://github.com/lydell/resolve-url#deprecated
dev: false
- resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
- hasBin: true
- dependencies:
- is-core-module: 2.12.1
- path-parse: 1.0.7
- supports-preserve-symlinks-flag: 1.0.0
- dev: true
-
resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==}
hasBin: true
@@ -20482,14 +20417,6 @@ packages:
dependencies:
glob: 7.2.0
- resolution: {integrity: sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA==}
- engines: {node: '>=10.0.0'}
- hasBin: true
- optionalDependencies:
- fsevents: 2.3.3
- dev: true
-
resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==}
engines: {node: '>=10.0.0'}
diff --git a/turbo.json b/turbo.json
index 9700ec3810..603e61870a 100644
--- a/turbo.json
+++ b/turbo.json
@@ -3,18 +3,13 @@
"pipeline": {
"build": {
"dependsOn": ["^build"],
- "outputs": [".rollup.cache/**", "dist/esm/**"],
+ "outputs": ["dist/esm/**"],
"outputMode": "new-only"
},
"@remotion/example#build": {
"dependsOn": ["^build"],
- "outputs": [
- ".rollup.cache/**",
- "build/**",
- "dist/esm/**",
- "./node_modules/.cache/**"
- ],
+ "outputs": ["build/**", "dist/esm/**", "./node_modules/.cache/**"],
"outputMode": "new-only"
},
"build-docs": {
@@ -40,7 +35,7 @@
"dependsOn": ["@remotion/eslint-config#build"]
},
"@remotion/google-fonts#build": {
- "outputs": ["src/**", ".cache-css/**", ".rollup.cache/**", "dist/esm/**"],
+ "outputs": ["src/**", ".cache-css/**", "dist/esm/**"],
"dependsOn": ["^build"],
"outputMode": "new-only"
},