🎥 Make videos programmatically with React
Merge branch 'main' into lambda-testing
Jonny Burger887ee6a65d2c
diff --cc packages/bundler/src/bundler.tsindex a897a0938e,eacf84ab5f..9392fd8217--- a/packages/bundler/src/bundler.ts+++ b/packages/bundler/src/bundler.ts@@@ -49,8 -40,8 +49,7 @@@ export const bundle = asyncwebpackOverride:options?.webpackOverride ?? Internals.getWebpackOverrideFn(),onProgressUpdate,- enableCaching:- options?.enableCaching ?? Internals.DEFAULT_WEBPACK_CACHE_ENABLED,+ enableCaching: options?.enableCaching ?? Internals.getWebpackCaching(),- publicPath: options?.publicPath ?? '/',maxTimelineTracks: 15,}),]);@@@ -73,7 -60,8 +72,7 @@@await copyDir(from, to);}- const html = indexHtml(publicDir, baseDir);- // TODO: Make this better in Lambda- const html = indexHtml(`/public`, null);++ const html = indexHtml(publicDir, baseDir, null);fs.writeFileSync(path.join(outDir, 'index.html'), html);return outDir;diff --cc packages/bundler/src/start-server.tsindex aa8e86e309,a73ed90d9a..defa36cc36--- a/packages/bundler/src/start-server.ts+++ b/packages/bundler/src/start-server.ts@@@ -83,9 -110,12 +110,12 @@@ export const startServer = asyncres.sendFile(path.join(__dirname, '..', 'web', 'favicon.png'));});+ const edit = await editorGuess;+ const displayName = getDisplayNameForEditor(edit[0]);+app.use('*', (_, res) => {res.set('content-type', 'text/html');- res.end(indexHtml(hash, '/'));- res.end(indexHtml(hash, displayName));++ res.end(indexHtml(hash, '/', displayName));});const desiredPort = options?.port ?? Internals.getServerPort();diff --cc packages/bundler/src/static-preview.tsindex 81c5569177,f397f612fb..7ee3f125da--- a/packages/bundler/src/static-preview.ts+++ b/packages/bundler/src/static-preview.ts@@@ -1,4 -1,4 +1,8 @@@- export const indexHtml = (staticHash: string, baseDir: string) =>-export const indexHtml = (staticHash: string, editorName: string | null) =>++export const indexHtml = (++ staticHash: string,++ baseDir: string,++ editorName: string | null++) =>`<!DOCTYPE html><html lang="en">@@@ -11,15 -11,20 +15,22 @@@</head><body><script>window.remotion_staticBase = "${staticHash}";</script>+ <div id="video-container"></div>+ <div id="explainer-container"></div>+ ${+ editorName+ ? `<script>window.remotion_editorName = "${editorName}";</script>`+ : '<script>window.remotion_editorName = null;</script>'+ }+ <div id="container"></div><div id="menuportal-0"></div><div id="menuportal-1"></div><div id="menuportal-2"></div><div id="menuportal-3"></div><div id="menuportal-4"></div><div id="menuportal-5"></div>+ <div id="remotion-error-overlay"></div>- <script src="/bundle.js"></script>+ <script src="${baseDir}bundle.js"></script></body></html>`.trim();diff --cc packages/cli/src/progress-bar.tsindex ac16a44320,813e4fb0ae..ab25a2851d--- a/packages/cli/src/progress-bar.ts+++ b/packages/cli/src/progress-bar.ts@@@ -1,35 -1,16 +1,34 @@@+import {StitchingState} from '@remotion/renderer';- // @ts-expect-error- import ansiDiff from 'ansi-diff';import chalk from 'chalk';import {Internals} from 'remotion';+ import {AnsiDiff} from './ansi/ansi-diff';+import {RenderStep} from './step';-export const createProgressBar = (): {+export const createProgressBar = (+ quiet: boolean+): {update: (str: string) => boolean;} => {- if (!Internals.Logging.isEqualOrBelowLogLevel('info')) {+ if (+ !Internals.Logging.isEqualOrBelowLogLevel(+ Internals.Logging.getLogLevel(),+ 'info'+ )+ ) {return {update: () => false};}+ return createOverwriteableCliOutput(quiet);+};++export const createOverwriteableCliOutput = (quiet: boolean) => {+ if (quiet) {+ return {+ update: () => false,+ };+ }+- const diff = ansiDiff();+ const diff = new AnsiDiff();- process.stdout.write('');return {update: (up: string): boolean => process.stdout.write(diff.update(up)),};diff --cc pnpm-lock.yamlindex 19d116d426,1cc7daa2ad..716a7d49f9--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@@ -145,10 -143,10 +147,10 @@@ importersreact-refresh: 0.9.0remotion: link:../coresemver: 7.3.4+ source-map: 0.5.7source-map-loader: [email protected]style-loader: [email protected]- webpack: 5.60.0+ webpack: [email protected]- webpack-hot-middleware: 2.25.1devDependencies:'@jonny/eslint-config': [email protected][email protected]'@types/express': 4.17.13@@@ -6293,41 -5300,6 +6309,26 @@@ packages- typescriptdev: true+ /@jonny/eslint-config/[email protected][email protected]:+ resolution: {integrity: sha512-k9ym6jUOPHQjTEK+rgjnZqSqOW2tzY5gjGKILYNQ/kKAJRZJzjpXeqZIRD2fHBJHu4Jl8ZH+a/BQdzjppH54zg==}+ dependencies:+ '@typescript-eslint/eslint-plugin': 4.33.0_cc617358c89d3f38c52462f6d809db4c+ '@typescript-eslint/parser': [email protected][email protected]+ babel-eslint: [email protected]+ eslint-config-prettier: [email protected]+ eslint-config-xo: [email protected]+ eslint-config-xo-react: 0.25.0_619fd791a30680e87cb22972fa901a6f+ eslint-plugin-10x: [email protected]+ eslint-plugin-promise: [email protected]+ eslint-plugin-react: [email protected]+ eslint-plugin-react-hooks: [email protected]+ eslint-plugin-react-native-normalized: [email protected]+ transitivePeerDependencies:+ - eslint+ - supports-color+ - typescript+ dev: true+- /@jonny/webpack-dev-middleware/[email protected]:- resolution: {integrity: sha512-zi+MkYQbA1kTWDG0GmICxwONA6KdVwh6reM/YTCljbv4XcWcyvikHMZs57I7xTg7rysBzzMdi8NEZfTss9W8Pg==}- engines: {node: '>= v10.23.3'}- peerDependencies:- webpack: ^4.0.0 || ^5.0.0- dependencies:- colorette: 1.4.0- mem: 8.1.1- memfs: 3.3.0- mime-types: 2.1.33- range-parser: 1.2.1- schema-utils: 3.1.1- webpack: [email protected]- dev: false-/@lerna/add/4.0.0:resolution: {integrity: sha512-cpmAH1iS3k8JBxNvnMqrGTTjbY/ZAiKa1ChJzFevMYY3eeqbvhsBKnBcxjRXtdrJ6bd3dCQM+ZtK+0i682Fhng==}engines: {node: '>= 10.18.0'}@@@ -10458,20 -9384,6 +10444,16 @@@resolution: {integrity: sha512-kNkVV4KFta3TYQv0bzs4xNwLaeag261pxgzGQSh4cQ1rEhYjcTJfFRP0SDlbhLONg0eSoLzrDd79PosjbltufA==}dev: false- /colorette/1.4.0:- resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==}- dev: false-+ /colors/1.0.3:+ resolution: {integrity: sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=}+ engines: {node: '>=0.1.90'}+ dev: false++ /colors/1.4.0:+ resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==}+ engines: {node: '>=0.1.90'}+ dev: false+/columnify/1.5.4:resolution: {integrity: sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=}dependencies:@@@ -16738,6 -15605,11 +16701,10 @@@resolution: {integrity: sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==}engines: {node: '>= 0.6'}+ /mime-db/1.51.0:+ resolution: {integrity: sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==}+ engines: {node: '>= 0.6'}- dev: false+/mime-types/2.1.18:resolution: {integrity: sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==}engines: {node: '>= 0.6'}@@@ -16751,6 -15623,13 +16718,12 @@@dependencies:mime-db: 1.50.0+ /mime-types/2.1.34:+ resolution: {integrity: sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==}+ engines: {node: '>= 0.6'}+ dependencies:+ mime-db: 1.51.0- dev: false+/mime/1.6.0:resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==}engines: {node: '>=4'}@@@ -23560,7 -22368,7 +23514,7 @@@graceful-fs: 4.2.8json-parse-better-errors: 1.0.2loader-runner: 4.2.0-- mime-types: 2.1.33++ mime-types: 2.1.34neo-async: 2.6.2schema-utils: 3.1.1tapable: 2.2.1