🎥 Make videos programmatically with React
pnpx -> pnpm exec
Jonny Burger6bb9add706cd
diff --git a/TESTING.md b/TESTING.mdindex e864ad80ed..4f7db6cdef 100644--- a/TESTING.md+++ b/TESTING.md@@ -11,7 +11,7 @@ For general information concerning contribution, please consult [CONTRIBUTION.md### Running tests-There are tests in each package as well as end-to-end tests in the root of the monorepo. Run `npm test` in a package, or in the root to run all tests. Run `pnpx jest` to only run unit tests and skip linting.+There are tests in each package as well as end-to-end tests in the root of the monorepo. Run `npm test` in a package, or in the root to run all tests. Run `pnpm exec jest` to only run unit tests and skip linting.### Mutation Testing@@ -39,7 +39,7 @@ To setup mutation testing in the core package, cd to the `packages/core`director}Under `"mutate"` you can specify the files you want stryker to mutate for you.-Then to run the mutation tests use `pnpx stryker run`.+Then to run the mutation tests use `pnpm exec stryker run`.In case you run into error on _Windows_ where Stryker and Jest won't run any test cases, try one of these [workarounds](https://github.com/stryker-mutator/stryker-js/issues/2122#issuecomment-605783668).After running Stryker you can find the report under `packages/core/reports/mutation` and see how many mutants have been killed by your test cases and how many have survived.diff --git a/packages/example/testlambda.sh b/packages/example/testlambda.shindex d51f103d19..f4ac9d4143 100644--- a/packages/example/testlambda.sh+++ b/packages/example/testlambda.sh@@ -3,8 +3,8 @@ cd lambdanpm run buildlambdacd ..cd example-pnpx remotion lambda policies validate-pnpx remotion lambda functions rmall -f-pnpx remotion lambda functions deploy --memory=3000-pnpx remotion lambda sites create src/index.tsx --site-name=testbed-pnpx remotion lambda render testbed react-svg --out-name=ggg.mp4 ggg.mp4 --log=verbose+pnpm exec remotion lambda policies validate+pnpm exec remotion lambda functions rmall -f+pnpm exec remotion lambda functions deploy --memory=3000+pnpm exec remotion lambda sites create src/index.tsx --site-name=testbed+pnpm exec remotion lambda render testbed react-svg --out-name=ggg.mp4 ggg.mp4 --log=verbosediff --git a/packages/it-tests/src/lambda/lambda-integration.test.ts b/packages/it-tests/src/lambda/lambda-integration.test.tsindex 410823db6e..3a76c4aeeb 100644--- a/packages/it-tests/src/lambda/lambda-integration.test.ts+++ b/packages/it-tests/src/lambda/lambda-integration.test.ts@@ -1,23 +1,31 @@import execa from "execa";import path from "path";-test("Should be able to call pnpx remotion lambda", async () => {- const task = await execa("pnpx", ["remotion", "lambda"], {+test("Should be able to call pnpm exec remotion lambda", async () => {+ const task = await execa("pnpm", ["exec", "remotion", "lambda"], {cwd: path.join(process.cwd(), "..", "example"),});expect(task.stdout).toContain("Available commands");});test("Should be able to get user policy without authentication", async () => {- const task = await execa("pnpx", ["remotion", "lambda", "policies", "user"], {- cwd: path.join(process.cwd(), "..", "example"),- });+ const task = await execa(+ "pnpm",+ ["exec", "remotion", "lambda", "policies", "user"],+ {+ cwd: path.join(process.cwd(), "..", "example"),+ }+ );expect(task.stdout).toContain("iam:GetUser");});test("Should be able to get role policy without authentication", async () => {- const task = await execa("pnpx", ["remotion", "lambda", "policies", "role"], {- cwd: path.join(process.cwd(), "..", "example"),- });+ const task = await execa(+ "pnpm",+ ["exec", "remotion", "lambda", "policies", "role"],+ {+ cwd: path.join(process.cwd(), "..", "example"),+ }+ );expect(task.stdout).toContain("s3:ListAllMyBuckets");});diff --git a/packages/it-tests/src/rendering/compositions.test.ts b/packages/it-tests/src/rendering/compositions.test.tsindex 1dbda8df1d..473962d6fb 100644--- a/packages/it-tests/src/rendering/compositions.test.ts+++ b/packages/it-tests/src/rendering/compositions.test.ts@@ -1,10 +1,10 @@import path from "path";import execa from "execa";-test("Should be able to call pnpx compositions", async () => {+test("Should be able to call pnpm exec compositions", async () => {const task = await execa(- "pnpx",- ["remotion", "compositions", "src/index.tsx"],+ "pnpm",+ ["exec", "remotion", "compositions", "src/index.tsx"],{cwd: path.join(process.cwd(), "..", "example"),}diff --git a/packages/it-tests/src/rendering/context-providing.test.ts b/packages/it-tests/src/rendering/context-providing.test.tsindex 83583c1689..eeedfc5bac 100644--- a/packages/it-tests/src/rendering/context-providing.test.ts+++ b/packages/it-tests/src/rendering/context-providing.test.ts@@ -18,8 +18,15 @@ afterEach(() => {test("Should be able to render video that was wrapped in context", async () => {await execa(- "pnpx",- ["remotion", "still", "src/index.tsx", "wrapped-in-context", outputPath],+ "pnpm",+ [+ "exec",+ "remotion",+ "still",+ "src/index.tsx",+ "wrapped-in-context",+ outputPath,+ ],{cwd: path.join(process.cwd(), "..", "example"),}diff --git a/packages/it-tests/src/rendering/frame-accuracy.test.ts b/packages/it-tests/src/rendering/frame-accuracy.test.tsindex bce6a57c7c..4dbf1f0845 100644--- a/packages/it-tests/src/rendering/frame-accuracy.test.ts+++ b/packages/it-tests/src/rendering/frame-accuracy.test.ts@@ -20,8 +20,9 @@ const getMissedFramesforCodec = async (// render the VideoTesting example (which contains the Framer composition embedded with <Video>) to an image// sequence which can be checked for accuracyawait execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",diff --git a/packages/it-tests/src/rendering/many-audio-tracks.test.ts b/packages/it-tests/src/rendering/many-audio-tracks.test.tsindex 4c59816bae..d9d5724466 100644--- a/packages/it-tests/src/rendering/many-audio-tracks.test.ts+++ b/packages/it-tests/src/rendering/many-audio-tracks.test.ts@@ -6,8 +6,8 @@ test("Should be able to render if remotion.config.ts is not provided", async ()const outputPath = path.join(process.cwd(), "packages/example/out.mp3");const task = await execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "many-audio", outputPath],+ "pnpm",+ ["exec", "remotion", "render", "src/index.tsx", "many-audio", outputPath],{cwd: path.join(process.cwd(), "..", "example"),}diff --git a/packages/it-tests/src/rendering/render-scale.test.ts b/packages/it-tests/src/rendering/render-scale.test.tsindex 833e07579f..cdbb2f4643 100644--- a/packages/it-tests/src/rendering/render-scale.test.ts+++ b/packages/it-tests/src/rendering/render-scale.test.ts@@ -12,8 +12,9 @@ beforeEach(() => {test("Should be able to render video with scale 2", async () => {const task = execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -45,8 +46,9 @@ test("Should be able to render video with scale 2", async () => {test("Should be able to render video with scale 0.1", async () => {const task = execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",diff --git a/packages/it-tests/src/rendering/rendering.test.ts b/packages/it-tests/src/rendering/rendering.test.tsindex 9b05b2c056..67108985ce 100644--- a/packages/it-tests/src/rendering/rendering.test.ts+++ b/packages/it-tests/src/rendering/rendering.test.ts@@ -13,8 +13,9 @@ beforeEach(() => {test("Should be able to render video", async () => {const task = execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -43,8 +44,9 @@ test("Should be able to render video", async () => {test("Should fail to render out of range CRF", async () => {const task = await execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -69,8 +71,9 @@ test("Should fail to render out of range frame when range is a number", async ()const out = outputPath.replace(".mp4", "");const task = await execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -92,8 +95,9 @@ test("Should fail to render out of range frame when range is a number", async ()test("Should fail to render out of range frame when range is a string", async () => {const task = await execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -113,8 +117,9 @@ test("Should fail to render out of range frame when range is a string", async ()test("Should render a ProRes video", async () => {const out = outputPath.replace(".mp4", ".mov");const task = await execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -144,8 +149,9 @@ test("Should render a still image if single frame specified", async () => {const outDir = outputPath.replace(".mp4", "");const outImg = path.join(outDir, "element-2.png");const task = await execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",@@ -173,8 +179,8 @@ test("Should render a still image if single frame specified", async () => {test("Should be able to render a WAV audio file", async () => {const out = outputPath.replace("mp4", "wav");const task = execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "audio-testing", out],+ "pnpm",+ ["exec", "remotion", "render", "src/index.tsx", "audio-testing", out],{cwd: path.join(process.cwd(), "..", "example"),}@@ -198,8 +204,8 @@ test("Should be able to render a WAV audio file", async () => {test("Should be able to render a MP3 audio file", async () => {const out = outputPath.replace("mp4", "mp3");const task = execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "audio-testing", out],+ "pnpm",+ ["exec", "remotion", "render", "src/index.tsx", "audio-testing", out],{cwd: path.join(process.cwd(), "..", "example"),}@@ -224,8 +230,8 @@ test("Should be able to render a MP3 audio file", async () => {test("Should be able to render a AAC audio file", async () => {const out = outputPath.replace("mp4", "aac");const task = execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "audio-testing", out],+ "pnpm",+ ["exec", "remotion", "render", "src/index.tsx", "audio-testing", out],{cwd: path.join(process.cwd(), "..", "example"),}@@ -249,8 +255,16 @@ test("Should be able to render a AAC audio file", async () => {test("Should render a video with GIFs", async () => {const task = await execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "gif", "--frames=0-47", outputPath],+ "pnpm",+ [+ "exec",+ "remotion",+ "render",+ "src/index.tsx",+ "gif",+ "--frames=0-47",+ outputPath,+ ],{cwd: path.join(process.cwd(), "..", "example"),reject: false,@@ -279,8 +293,15 @@ test("Should render a video with Offline Audio-context", async () => {const out = outputPath.replace(".mp4", ".mp3");const task = await execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "offline-audio-buffer", out],+ "pnpm",+ [+ "exec",+ "remotion",+ "render",+ "src/index.tsx",+ "offline-audio-buffer",+ out,+ ],{cwd: path.join(process.cwd(), "..", "example"),reject: false,@@ -299,8 +320,8 @@ test("Should render a video with Offline Audio-context", async () => {test("Should succeed to render an audio file that doesn't have any audio inputs", async () => {const out = outputPath.replace(".mp4", ".mp3");const task = await execa(- "pnpx",- ["remotion", "render", "src/index.tsx", "ten-frame-tester", out],+ "pnpm",+ ["exec", "remotion", "render", "src/index.tsx", "ten-frame-tester", out],{cwd: path.join(process.cwd(), "..", "example"),reject: false,@@ -317,8 +338,16 @@ test("Should succeed to render an audio file that doesn't have any audio inputs"test("Should render a still that uses the staticFile() API", async () => {const out = outputPath.replace(".mp4", ".png");const task = await execa(- "pnpx",- ["remotion", "still", "src/index.tsx", "static-demo", out, "--log=verbose"],+ "pnpm",+ [+ "exec",+ "remotion",+ "still",+ "src/index.tsx",+ "static-demo",+ out,+ "--log=verbose",+ ],{cwd: path.join(process.cwd(), "..", "example"),reject: false,@@ -331,8 +360,9 @@ test("Should render a still that uses the staticFile() API", async () => {test("Dynamic duration should work", async () => {const randomDuration = Math.round(Math.random() * 18 + 2);const task = await execa(- "pnpx",+ "pnpm",[+ "exec","remotion","render","src/index.tsx",