🎥 Make videos programmatically with React
more tests
Jonny Burgerdccfadaecf74
diff --git a/.github/workflows/push.yml b/.github/workflows/push.ymlindex 195c281823..db7d841b46 100644--- a/.github/workflows/push.yml+++ b/.github/workflows/push.yml@@ -24,7 +24,7 @@ jobs:cache: "pnpm"- uses: oven-sh/setup-bun@v1with:- bun-version: 1.2.2+ bun-version: 1.2.3- name: Installrun: pnpm i --frozen-lockfile- name: Cache turbo build setup@@ -65,7 +65,7 @@ jobs:cache: "pnpm"- uses: oven-sh/setup-bun@v1with:- bun-version: 1.2.2+ bun-version: 1.2.3- name: Installrun: pnpm i --frozen-lockfile- name: Setup Python@@ -110,7 +110,7 @@ jobs:cache: "pnpm"- uses: oven-sh/setup-bun@v1with:- bun-version: 1.2.2+ bun-version: 1.2.3- name: Installrun: pnpm i --frozen-lockfileenv:@@ -158,7 +158,7 @@ jobs:${{ runner.os }}-turbo-- uses: oven-sh/setup-bun@v1with:- bun-version: 1.2.2+ bun-version: 1.2.3- name: Installrun: pnpm i --frozen-lockfile- name: Build & Testdiff --git a/packages/it-tests/package.json b/packages/it-tests/package.jsonindex f0ce5fc3e7..fbc46469fe 100644--- a/packages/it-tests/package.json+++ b/packages/it-tests/package.json@@ -18,6 +18,7 @@"@remotion/cli": "workspace:*","@remotion/lambda": "workspace:*","@remotion/lambda-client": "workspace:*",+ "@remotion/compositor-darwin-arm64": "workspace:*","@remotion/cloudrun": "workspace:*","@remotion/player": "workspace:*","@remotion/preload": "workspace:*",diff --git a/packages/it-tests/src/rendering/bundle-renderer.test.ts b/packages/it-tests/src/rendering/bundle-renderer.test.tsindex d62a4cdab8..2e9c227dd9 100644--- a/packages/it-tests/src/rendering/bundle-renderer.test.ts+++ b/packages/it-tests/src/rendering/bundle-renderer.test.ts@@ -7,7 +7,7 @@ import {copyFileSync, cpSync, readdirSync, rmSync} from 'node:fs';import {tmpdir} from 'node:os';import path from 'node:path';-test('Should be able to bundle the renderer', () => {+test('Should be able to bundle the renderer', async () => {const outputdir = path.join(tmpdir(), `test-${Math.random()}`);const outfile = path.join(outputdir, 'esbuild-test.js');@@ -23,6 +23,19 @@ test('Should be able to bundle the renderer', () => {expect(errors.length).toBe(0);expect(warnings.length).toBe(0);++ const outputs = await Bun.build({+ target: 'node',+ format: 'esm',+ naming: '[name].mjs',+ entrypoints: [+ `${__dirname}${path.sep}..${path.sep}..${path.sep}test-index-esm.ts`,+ ],+ });+ for (const output of outputs.outputs) {+ await Bun.write(output.path, await output.text());+ }+const binaryPath = RenderInternals.getExecutablePath({type: 'compositor',indent: false,@@ -52,7 +65,13 @@ test('Should be able to bundle the renderer', () => {const out = execSync('node ' + outfile + ' ' + exampleVideos.bigBuckBunny);expect(out.toString('utf8')).toBe('h264\n');+ const out2 = execSync(+ 'node ' + 'test-index-esm.mjs' + ' ' + exampleVideos.bigBuckBunny,+ );+ expect(out2.toString('utf8')).toBe('h264\n');+rmSync(outputdir, {recursive: true,});+ rmSync('test-index-esm.mjs');});diff --git a/packages/it-tests/test-index-esm.ts b/packages/it-tests/test-index-esm.tsnew file mode 100644index 0000000000..0f11b40e55--- /dev/null+++ b/packages/it-tests/test-index-esm.ts@@ -0,0 +1,5 @@+import {getVideoMetadata} from '@remotion/renderer';++getVideoMetadata(process.argv[2]).then((metadata) => {+ console.log(metadata.codec);+});diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 0ebd8c43f0..83baed3dd7 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1272,6 +1272,9 @@ importers:'@remotion/cloudrun':specifier: workspace:*version: link:../cloudrun+ '@remotion/compositor-darwin-arm64':+ specifier: workspace:*+ version: link:../compositor-darwin-arm64'@remotion/example-videos':specifier: workspace:*version: link:../example-videos