🎥 Make videos programmatically with React
formatting
Jonny Burger2eead519e1fd
diff --git a/packages/babel-loader/package.json b/packages/babel-loader/package.jsonindex 65ec86724a..c699f56099 100644--- a/packages/babel-loader/package.json+++ b/packages/babel-loader/package.json@@ -4,6 +4,7 @@"description": "babel-loader polyfill for Remotion","main": "dist/index.js","scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "tsc -d"diff --git a/packages/bundler/package.json b/packages/bundler/package.jsonindex f30accfa37..9b4eee00ca 100644--- a/packages/bundler/package.json+++ b/packages/bundler/package.json@@ -11,6 +11,7 @@"url": "https://github.com/remotion-dev/remotion/issues"},"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","build": "tsc -d","watch": "tsc -w",diff --git a/packages/cli-autocomplete/package.json b/packages/cli-autocomplete/package.jsonindex 682e1e31b6..36a62e5dea 100644--- a/packages/cli-autocomplete/package.json+++ b/packages/cli-autocomplete/package.json@@ -14,6 +14,7 @@"@remotion/renderer": "workspace:*"},"scripts": {+ "formatting": "prettier src --check","build": "ts-node src/generate.ts"}}diff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 5cc68314e7..252e88f3da 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -8,6 +8,7 @@"remotion": "remotion-cli.js"},"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","test": "vitest --run","build": "tsc -d",diff --git a/packages/cli/src/editor/components/Timeline/MaxTimelineTracks.tsx b/packages/cli/src/editor/components/Timeline/MaxTimelineTracks.tsxindex c38b89de13..c9f86b9ad3 100644--- a/packages/cli/src/editor/components/Timeline/MaxTimelineTracks.tsx+++ b/packages/cli/src/editor/components/Timeline/MaxTimelineTracks.tsx@@ -24,8 +24,8 @@ export const MaxTimelineTracksReached: React.FC = () => {<div style={container}>Limited display to {MAX_TIMELINE_TRACKS} tracks to sustain performance.{''}- You can change this by setting Config.setMaxTimelineTracks() in- your remotion.config.ts file.+ You can change this by setting Config.setMaxTimelineTracks() in your+ remotion.config.ts file.</div>);};diff --git a/packages/core/package.json b/packages/core/package.jsonindex 2e4f412712..450f03fc43 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -6,6 +6,7 @@"types": "dist/cjs/index.d.ts","module": "dist/esm/index.mjs","scripts": {+ "formatting": "prettier src --check","prepublishOnly": "node ensure-correct-version.js && cp ../../README.md .","lint": "eslint src --ext ts,tsx","test": "vitest --run",diff --git a/packages/core/src/cancel-render.ts b/packages/core/src/cancel-render.tsindex 40e6698412..bd3682adb1 100644--- a/packages/core/src/cancel-render.ts+++ b/packages/core/src/cancel-render.ts@@ -32,7 +32,7 @@ const isErrorLike = (err: unknown): boolean => {/*** @description When you invoke this function, Remotion will stop rendering all the frames without any retries- * @see [Documentation](https://www.remotion.dev/docs/cancel-render)+ * @see [Documentation](https://www.remotion.dev/docs/cancel-render)*/export function cancelRender(err: unknown): never {let error: Error;diff --git a/packages/core/src/test/spring.test.ts b/packages/core/src/test/spring.test.tsindex c21b2ddc27..6989c0477c 100644--- a/packages/core/src/test/spring.test.ts+++ b/packages/core/src/test/spring.test.ts@@ -61,7 +61,7 @@ test('Should be able to set duration for spring when in reverse', () => {fps: 30,frame: 5,durationInFrames: 5,- reverse: true+ reverse: true,})).toBeCloseTo(0);});@@ -72,7 +72,7 @@ test('Should be able to set duration for spring when in reverse', () => {fps: 30,frame: 0,durationInFrames: 5,- reverse: true+ reverse: true,})).toBeCloseTo(1);});@@ -84,8 +84,8 @@ test('Should be approxmiately the same when in reverse', () => {fps: 30,// duration - 1frame: measureSpring({fps: 30}) - 1,- reverse: true- }),+ reverse: true,+ })).toBeCloseTo(0.04941510804510185);});@@ -94,7 +94,7 @@ test('Should be close to 0 when in reverse', () => {spring({fps: 30,frame: 100,- reverse: true+ reverse: true,})).toBeCloseTo(0);});@@ -127,20 +127,22 @@ describe('Should be able to delay a spring', () => {});test('Should start calculations from the delay + 1', () => {- expect(spring({- fps: 30,- frame: 26,- delay: 25,- })).toBeGreaterThan(0)+ expect(+ spring({+ fps: 30,+ frame: 26,+ delay: 25,+ })+ ).toBeGreaterThan(0);});test('Should be close to 1', () => {expect(spring({fps: 30,- frame: 25+30,+ frame: 25 + 30,delay: 25,})).toBeCloseTo(1);});-})\ No newline at end of file+});diff --git a/packages/create-video/package.json b/packages/create-video/package.jsonindex f847b2ad6d..6aa607bb67 100644--- a/packages/create-video/package.json+++ b/packages/create-video/package.json@@ -10,6 +10,7 @@"dist"],"scripts": {+ "formatting": "prettier src --check","build": "tsc -d","watch": "tsc -w","lint": "eslint src --ext ts,tsx",diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex b960b438c6..b41b5d34e7 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -3,6 +3,7 @@"version": "3.3.94","private": true,"scripts": {+ "formatting": "prettier src --check","docusaurus": "docusaurus","start": "docusaurus start --host 0.0.0.0","start-docs": "docusaurus start",diff --git a/packages/example/package.json b/packages/example/package.jsonindex 32a5c6a61c..0bf98ee2c5 100644--- a/packages/example/package.json+++ b/packages/example/package.json@@ -10,6 +10,7 @@"dist"],"scripts": {+ "formatting": "prettier src --check","start": "remotion preview --props src/my-props.json","start-js": "remotion preview src/entry.jsx","comps": "remotion compositions",diff --git a/packages/gif/package.json b/packages/gif/package.jsonindex e22540f69e..c08f342d20 100644--- a/packages/gif/package.json+++ b/packages/gif/package.json@@ -18,6 +18,7 @@"dist"],"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","build": "node build.mjs && rollup --config rollup.config.js && tsc -d","watch": "tsc -w"diff --git a/packages/gif/src/worker/source.ts b/packages/gif/src/worker/source.tsindex b358e7c321..b60895b337 100644--- a/packages/gif/src/worker/source.ts+++ b/packages/gif/src/worker/source.ts@@ -1,4 +1,4 @@// Auto-generated by build.mjsexport const src =-// eslint-disable-next-line no-template-curly-in-string- "\"use strict\";(()=>{var P=(t,r,e={},n=e)=>{if(Array.isArray(r))r.forEach(o=>P(t,o,e,n));else if(typeof r==\"function\")r(t,e,n,P);else{let o=Object.keys(r)[0];Array.isArray(r[o])?(n[o]={},P(t,r[o],e,n[o])):n[o]=r[o](t,e,n,P)}return e},M=(t,r)=>function(e,n,o,c){let s=[],a=e.pos;for(;r(e,n,o);){let i={};if(c(e,t,n,i),e.pos===a)break;a=e.pos,s.push(i)}return s},g=(t,r)=>(e,n,o,c)=>{r(e,n,o)&&c(e,t,n,o)};var W=t=>({data:t,pos:0}),m=()=>t=>t.data[t.pos++],U=(t=0)=>r=>r.data[r.pos+t],f=t=>r=>r.data.subarray(r.pos,r.pos+=t),k=t=>r=>r.data.subarray(r.pos,r.pos+t),v=t=>r=>Array.from(f(t)(r)).map(e=>String.fromCharCode(e)).join(\"\"),b=t=>r=>{let e=f(2)(r);return t?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]},E=(t,r)=>(e,n,o)=>{let c=typeof r==\"function\"?r(e,n,o):r,s=f(t),a=new Array(c);for(let i=0;i<c;i++)a[i]=s(e);return a},$=(t,r,e)=>{let n=0;for(let o=0;o<e;o++)n+=Number(t[r+o]&&2**(e-o-1));return n},I=t=>r=>{let e=m()(r),n=new Array(8);for(let o=0;o<8;o++)n[7-o]=Boolean(e&1<<o);return Object.keys(t).reduce((o,c)=>{let s=t[c];return s.length?o[c]=$(n,s.index,s.length):o[c]=n[s.index],o},{})};var z={blocks:t=>{let e=[],n=t.data.length,o=0;for(let a=m()(t);a!==0&&a;a=m()(t)){if(t.pos+a>=n){let i=n-t.pos;e.push(f(i)(t)),o+=i;break}e.push(f(a)(t)),o+=a}let c=new Uint8Array(o),s=0;for(let a=0;a<e.length;a++)c.set(e[a],s),s+=e[a].length;return c}},q=g({gce:[{codes:f(2)},{byteSize:m()},{extras:I({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:b(!0)},{transparentColorIndex:m()},{terminator:m()}]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===249}),H=g({image:[{code:m()},{descriptor:[{left:b(!0)},{top:b(!0)},{width:b(!0)},{height:b(!0)},{lct:I({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},g({lct:E(3,(t,r,e)=>2**(e.descriptor.lct.size+1))},(t,r,e)=>e.descriptor.lct.exists),{data:[{minCodeSize:m()},z]}]},t=>U()(t)===44),J=g({text:[{codes:f(2)},{blockSize:m()},{preData:(t,r,e)=>f(e.text.blockSize)(t)},z]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===1}),Q=g({application:[{codes:f(2)},{blockSize:m()},{id:(t,r,e)=>v(e.blockSize)(t)},z]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===255}),V=g({comment:[{codes:f(2)},z]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===254}),K=[{header:[{signature:v(3)},{version:v(3)}]},{lsd:[{width:b(!0)},{height:b(!0)},{gct:I({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:m()},{pixelAspectRatio:m()}]},g({gct:E(3,(t,r)=>2**(r.lsd.gct.size+1))},(t,r)=>r.lsd.gct.exists),{frames:M([q,Q,V,H,J],t=>{let r=U()(t);return r===33||r===44})}];var X=(t,r)=>{let e=new Array(t.length),n=t.length/r,o=function(i,d){let u=t.slice(d*r,(d+1)*r);e.splice(...[i*r,r].concat(u))},c=[0,4,2,1],s=[8,8,4,2],a=0;for(let i=0;i<4;i++)for(let d=c[i];d<n;d+=s[i])o(d,a),a++;return e};var Z=(t,r,e)=>{let c=e,s,a,i,d,u;var w;let l,p;var C,S,h,_,G;let x=new Array(e),B=new Array(4096),T=new Array(4096),F=new Array(4096+1),R=t,y=1<<R,O=y+1;for(s=y+2,u=-1,i=R+1,a=(1<<i)-1,l=0;l<y;l++)B[l]=0,T[l]=l;var C,w,S,h,G,_;for(C=w=S=h=G=_=0,p=0;p<c;){if(h===0){if(w<i){C+=r[_]<<w,w+=8,_++;continue}if(l=C&a,C>>=i,w-=i,l>s||l===O)break;if(l===y){i=R+1,a=(1<<i)-1,s=y+2,u=-1;continue}if(u===-1){F[h++]=T[l],u=l,S=l;continue}for(d=l,l===s&&(F[h++]=S,l=u);l>y;)F[h++]=T[l],l=B[l];S=T[l]&255,F[h++]=S,s<4096&&(B[s]=u,T[s]=S,s++,!(s&a)&&s<4096&&(i++,a+=s)),u=d}h--,x[G++]=F[h],p++}for(p=G;p<c;p++)x[p]=0;return x};var j=t=>{let r=new Uint8Array(t);return P(W(r),K)},D=(t,r)=>{var s,a;if(!t.image){console.warn(\"gif frame does not have associated image.\");return}let{image:e}=t,n=e.descriptor.width*e.descriptor.height,o=Z(e.data.minCodeSize,e.data.blocks,n);return(s=e.descriptor.lct)!=null&&s.interlaced&&(o=X(o,e.descriptor.width)),{pixels:o,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height},colorTable:(a=e.descriptor.lct)!=null&&a.exists?e.lct:r,delay:(t.gce.delay||10)*10,disposalType:t.gce.extras.disposal,transparentIndex:t.gce.extras.transparentColorGiven?t.gce.transparentColorIndex:-1}};var L=t=>t.frames.filter(r=>!(\"application\"in r)).map(r=>r.image?D(r,t.gct):null).filter(Boolean).map(r=>r);var Y=t=>{let r=null;for(let e of t.frames)r=e.gce?e.gce:r,\"image\"in e&&!(\"gce\"in e)&&r!==null&&(e.gce=r)},N=(t,{signal:r})=>fetch(t,{signal:r}).then(e=>{var n;if(!((n=e.headers.get(\"Content-Type\"))!=null&&n.includes(\"image/gif\")))throw Error(`Wrong content type: \"${e.headers.get(\"Content-Type\")}\"`);return e.arrayBuffer()}).then(e=>j(e)).then(e=>(Y(e),e)).then(e=>Promise.all([L(e),{width:e.lsd.width,height:e.lsd.height}])).then(([e,n])=>{let o=[],c=n.width*n.height*4,s=new Uint8ClampedArray(c);for(let a=0;a<e.length;++a){let i=e[a],d=e[a].disposalType===3?s.slice():null;if(o.push(ee(s,i,n)),e[a].disposalType===2)s=new Uint8ClampedArray(c);else if(e[a].disposalType===3){if(!d)throw Error(\"Disposal type 3 without previous frame\");s=d}else s=o[a].slice()}return{...n,loaded:!0,delays:e.map(a=>a.delay),frames:o}}),ee=(t,r,e)=>{let{width:n,height:o,top:c,left:s}=r.dims,a=c*e.width+s;for(let i=0;i<o;i++)for(let d=0;d<n;d++){let u=i*n+d,l=r.pixels[u];if(l!==r.transparentIndex){let p=a+i*e.width+d,x=r.colorTable[l];t[p*4]=x[0],t[p*4+1]=x[1],t[p*4+2]=x[2],t[p*4+3]=l===r.transparentIndex?0:255}}return t};var A=new Map;self.addEventListener(\"message\",t=>{let{type:r,src:e}=t.data||t;switch(r){case\"parse\":{if(!A.has(e)){let n=new AbortController,o={signal:n.signal};A.set(e,n),N(e,o).then(c=>{self.postMessage(Object.assign(c,{src:e}),c.frames.map(s=>s.buffer))}).catch(c=>{self.postMessage({src:e,error:c,loaded:!0})}).finally(()=>{A.delete(e)})}break}case\"cancel\":{A.has(e)&&(A.get(e).abort(),A.delete(e));break}default:break}});})();\n";\ No newline at end of file+ // eslint-disable-next-line no-template-curly-in-string+ '"use strict";(()=>{var P=(t,r,e={},n=e)=>{if(Array.isArray(r))r.forEach(o=>P(t,o,e,n));else if(typeof r=="function")r(t,e,n,P);else{let o=Object.keys(r)[0];Array.isArray(r[o])?(n[o]={},P(t,r[o],e,n[o])):n[o]=r[o](t,e,n,P)}return e},M=(t,r)=>function(e,n,o,c){let s=[],a=e.pos;for(;r(e,n,o);){let i={};if(c(e,t,n,i),e.pos===a)break;a=e.pos,s.push(i)}return s},g=(t,r)=>(e,n,o,c)=>{r(e,n,o)&&c(e,t,n,o)};var W=t=>({data:t,pos:0}),m=()=>t=>t.data[t.pos++],U=(t=0)=>r=>r.data[r.pos+t],f=t=>r=>r.data.subarray(r.pos,r.pos+=t),k=t=>r=>r.data.subarray(r.pos,r.pos+t),v=t=>r=>Array.from(f(t)(r)).map(e=>String.fromCharCode(e)).join(""),b=t=>r=>{let e=f(2)(r);return t?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]},E=(t,r)=>(e,n,o)=>{let c=typeof r=="function"?r(e,n,o):r,s=f(t),a=new Array(c);for(let i=0;i<c;i++)a[i]=s(e);return a},$=(t,r,e)=>{let n=0;for(let o=0;o<e;o++)n+=Number(t[r+o]&&2**(e-o-1));return n},I=t=>r=>{let e=m()(r),n=new Array(8);for(let o=0;o<8;o++)n[7-o]=Boolean(e&1<<o);return Object.keys(t).reduce((o,c)=>{let s=t[c];return s.length?o[c]=$(n,s.index,s.length):o[c]=n[s.index],o},{})};var z={blocks:t=>{let e=[],n=t.data.length,o=0;for(let a=m()(t);a!==0&&a;a=m()(t)){if(t.pos+a>=n){let i=n-t.pos;e.push(f(i)(t)),o+=i;break}e.push(f(a)(t)),o+=a}let c=new Uint8Array(o),s=0;for(let a=0;a<e.length;a++)c.set(e[a],s),s+=e[a].length;return c}},q=g({gce:[{codes:f(2)},{byteSize:m()},{extras:I({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:b(!0)},{transparentColorIndex:m()},{terminator:m()}]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===249}),H=g({image:[{code:m()},{descriptor:[{left:b(!0)},{top:b(!0)},{width:b(!0)},{height:b(!0)},{lct:I({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},g({lct:E(3,(t,r,e)=>2**(e.descriptor.lct.size+1))},(t,r,e)=>e.descriptor.lct.exists),{data:[{minCodeSize:m()},z]}]},t=>U()(t)===44),J=g({text:[{codes:f(2)},{blockSize:m()},{preData:(t,r,e)=>f(e.text.blockSize)(t)},z]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===1}),Q=g({application:[{codes:f(2)},{blockSize:m()},{id:(t,r,e)=>v(e.blockSize)(t)},z]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===255}),V=g({comment:[{codes:f(2)},z]},t=>{let r=k(2)(t);return r[0]===33&&r[1]===254}),K=[{header:[{signature:v(3)},{version:v(3)}]},{lsd:[{width:b(!0)},{height:b(!0)},{gct:I({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:m()},{pixelAspectRatio:m()}]},g({gct:E(3,(t,r)=>2**(r.lsd.gct.size+1))},(t,r)=>r.lsd.gct.exists),{frames:M([q,Q,V,H,J],t=>{let r=U()(t);return r===33||r===44})}];var X=(t,r)=>{let e=new Array(t.length),n=t.length/r,o=function(i,d){let u=t.slice(d*r,(d+1)*r);e.splice(...[i*r,r].concat(u))},c=[0,4,2,1],s=[8,8,4,2],a=0;for(let i=0;i<4;i++)for(let d=c[i];d<n;d+=s[i])o(d,a),a++;return e};var Z=(t,r,e)=>{let c=e,s,a,i,d,u;var w;let l,p;var C,S,h,_,G;let x=new Array(e),B=new Array(4096),T=new Array(4096),F=new Array(4096+1),R=t,y=1<<R,O=y+1;for(s=y+2,u=-1,i=R+1,a=(1<<i)-1,l=0;l<y;l++)B[l]=0,T[l]=l;var C,w,S,h,G,_;for(C=w=S=h=G=_=0,p=0;p<c;){if(h===0){if(w<i){C+=r[_]<<w,w+=8,_++;continue}if(l=C&a,C>>=i,w-=i,l>s||l===O)break;if(l===y){i=R+1,a=(1<<i)-1,s=y+2,u=-1;continue}if(u===-1){F[h++]=T[l],u=l,S=l;continue}for(d=l,l===s&&(F[h++]=S,l=u);l>y;)F[h++]=T[l],l=B[l];S=T[l]&255,F[h++]=S,s<4096&&(B[s]=u,T[s]=S,s++,!(s&a)&&s<4096&&(i++,a+=s)),u=d}h--,x[G++]=F[h],p++}for(p=G;p<c;p++)x[p]=0;return x};var j=t=>{let r=new Uint8Array(t);return P(W(r),K)},D=(t,r)=>{var s,a;if(!t.image){console.warn("gif frame does not have associated image.");return}let{image:e}=t,n=e.descriptor.width*e.descriptor.height,o=Z(e.data.minCodeSize,e.data.blocks,n);return(s=e.descriptor.lct)!=null&&s.interlaced&&(o=X(o,e.descriptor.width)),{pixels:o,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height},colorTable:(a=e.descriptor.lct)!=null&&a.exists?e.lct:r,delay:(t.gce.delay||10)*10,disposalType:t.gce.extras.disposal,transparentIndex:t.gce.extras.transparentColorGiven?t.gce.transparentColorIndex:-1}};var L=t=>t.frames.filter(r=>!("application"in r)).map(r=>r.image?D(r,t.gct):null).filter(Boolean).map(r=>r);var Y=t=>{let r=null;for(let e of t.frames)r=e.gce?e.gce:r,"image"in e&&!("gce"in e)&&r!==null&&(e.gce=r)},N=(t,{signal:r})=>fetch(t,{signal:r}).then(e=>{var n;if(!((n=e.headers.get("Content-Type"))!=null&&n.includes("image/gif")))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()}).then(e=>j(e)).then(e=>(Y(e),e)).then(e=>Promise.all([L(e),{width:e.lsd.width,height:e.lsd.height}])).then(([e,n])=>{let o=[],c=n.width*n.height*4,s=new Uint8ClampedArray(c);for(let a=0;a<e.length;++a){let i=e[a],d=e[a].disposalType===3?s.slice():null;if(o.push(ee(s,i,n)),e[a].disposalType===2)s=new Uint8ClampedArray(c);else if(e[a].disposalType===3){if(!d)throw Error("Disposal type 3 without previous frame");s=d}else s=o[a].slice()}return{...n,loaded:!0,delays:e.map(a=>a.delay),frames:o}}),ee=(t,r,e)=>{let{width:n,height:o,top:c,left:s}=r.dims,a=c*e.width+s;for(let i=0;i<o;i++)for(let d=0;d<n;d++){let u=i*n+d,l=r.pixels[u];if(l!==r.transparentIndex){let p=a+i*e.width+d,x=r.colorTable[l];t[p*4]=x[0],t[p*4+1]=x[1],t[p*4+2]=x[2],t[p*4+3]=l===r.transparentIndex?0:255}}return t};var A=new Map;self.addEventListener("message",t=>{let{type:r,src:e}=t.data||t;switch(r){case"parse":{if(!A.has(e)){let n=new AbortController,o={signal:n.signal};A.set(e,n),N(e,o).then(c=>{self.postMessage(Object.assign(c,{src:e}),c.frames.map(s=>s.buffer))}).catch(c=>{self.postMessage({src:e,error:c,loaded:!0})}).finally(()=>{A.delete(e)})}break}case"cancel":{A.has(e)&&(A.get(e).abort(),A.delete(e));break}default:break}});})();\n';diff --git a/packages/lambda/package.json b/packages/lambda/package.jsonindex ab8db26628..77fffefa28 100644--- a/packages/lambda/package.json+++ b/packages/lambda/package.json@@ -8,6 +8,7 @@"remotion-lambda": "remotion-lambda-cli.js"},"scripts": {+ "formatting": "prettier src --check","testintegration": "vitest src/test/integration --run","lint": "eslint src --ext ts,tsx","test": "vitest src/test/unit --run",diff --git a/packages/lambda/src/shared/get-account-id.ts b/packages/lambda/src/shared/get-account-id.tsindex b0630c92d6..8bd04c8dd3 100644--- a/packages/lambda/src/shared/get-account-id.ts+++ b/packages/lambda/src/shared/get-account-id.ts@@ -6,7 +6,9 @@ import {validateAwsRegion} from './validate-aws-region';export const getAccountId = async (options: {region: AwsRegion}) => {validateAwsRegion(options.region);- const callerIdentity = await getStsClient(options.region).send(new GetCallerIdentityCommand({}));+ const callerIdentity = await getStsClient(options.region).send(+ new GetCallerIdentityCommand({})+ );if (!callerIdentity.Account) {throw new Error('Cannot get account ID');diff --git a/packages/lottie/package.json b/packages/lottie/package.jsonindex f013af7122..f89c2e2120 100644--- a/packages/lottie/package.json+++ b/packages/lottie/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","test": "vitest --run","build": "rollup --config rollup.config.js && tsc -d",diff --git a/packages/media-utils/package.json b/packages/media-utils/package.jsonindex a1c4f62c31..af90283e04 100644--- a/packages/media-utils/package.json+++ b/packages/media-utils/package.json@@ -5,6 +5,7 @@"main": "dist/index.js","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "tsc -d"diff --git a/packages/motion-blur/package.json b/packages/motion-blur/package.jsonindex fa7af0378b..011da05643 100644--- a/packages/motion-blur/package.json+++ b/packages/motion-blur/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "rollup --config rollup.config.js && tsc -d"diff --git a/packages/noise/package.json b/packages/noise/package.jsonindex 0a4e9ab1e3..a2fdeabeb7 100644--- a/packages/noise/package.json+++ b/packages/noise/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "rollup --config rollup.config.js && tsc -d",diff --git a/packages/paths/package.json b/packages/paths/package.jsonindex a05caf831a..92a0bb0889 100644--- a/packages/paths/package.json+++ b/packages/paths/package.json@@ -5,6 +5,7 @@"main": "dist/index.js","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "tsc -d",diff --git a/packages/paths/src/get-bounding-box.ts b/packages/paths/src/get-bounding-box.tsindex 6d258849e2..18433231aa 100644--- a/packages/paths/src/get-bounding-box.ts+++ b/packages/paths/src/get-bounding-box.ts@@ -90,7 +90,7 @@ function minmaxC(A: [number, number, number, number]): minMax {/*** @description Returns the bounding box of the given path, suitable for calculating the viewBox value that you need to pass to an SVG.- * @param {string} d+ * @param {string} d* @see [Documentation](https://www.remotion.dev/docs/paths/get-bounding-box)*/export const getBoundingBox = (d: string): BoundingBox => {diff --git a/packages/paths/src/get-length.ts b/packages/paths/src/get-length.tsindex baa1d319b9..87d8577bbd 100644--- a/packages/paths/src/get-length.ts+++ b/packages/paths/src/get-length.ts@@ -3,7 +3,7 @@import {construct} from './helpers/construct';/**- * @description Gets the length of an SVG path.+ * @description Gets the length of an SVG path.* @param {string} path A valid SVG path* @see [Documentation](https://remotion.dev/docs/paths/get-length)*/diff --git a/packages/paths/src/get-point-at-length.ts b/packages/paths/src/get-point-at-length.tsindex 1271a3875f..c2a79d7d73 100644--- a/packages/paths/src/get-point-at-length.ts+++ b/packages/paths/src/get-point-at-length.ts@@ -6,7 +6,7 @@ import {getPartAtLength} from './helpers/get-part-at-length';* @param {string} path A valid SVG path* @param {number} length The length at which the point should be sampled* @see [Documentation](https://remotion.dev/docs/paths/get-point-at-length)-*/+ */export const getPointAtLength = (path: string, length: number) => {const constructed = construct(path);const fractionPart = getPartAtLength(path, length);diff --git a/packages/paths/src/interpolate-path.ts b/packages/paths/src/interpolate-path.tsindex 768801225a..60752b7da0 100644--- a/packages/paths/src/interpolate-path.ts+++ b/packages/paths/src/interpolate-path.ts@@ -422,7 +422,7 @@ function interpolatePathCommands(* @param {number} value A number - 0 means first path, 1 means second path, any other values will be interpolated* @param {string} firstPath The first valid SVG path* @param {string} secondPath The second valid SVG path- * @see [Documentation](https://remotion.dev/docs/paths/interpolate-path)+ * @see [Documentation](https://remotion.dev/docs/paths/interpolate-path)*/export const interpolatePath = (value: number,diff --git a/packages/paths/src/reduce-instructions.ts b/packages/paths/src/reduce-instructions.tsindex bf99192173..108633c17c 100644--- a/packages/paths/src/reduce-instructions.ts+++ b/packages/paths/src/reduce-instructions.ts@@ -4,7 +4,7 @@ import {normalizeInstructions} from './normalize-path';/*** @description Takes an array of Instruction's and reduces the amount of instruction types them so the path only consists of M, L, C, Q and Z instructions.- * @param {Array} instruction+ * @param {Array} instruction* @see [Documentation](https://www.remotion.dev/docs/paths/reduce-instructions)*/export const reduceInstructions = (diff --git a/packages/paths/src/scale-path.ts b/packages/paths/src/scale-path.tsindex 333a88cddd..4a5698c0b3 100644--- a/packages/paths/src/scale-path.ts+++ b/packages/paths/src/scale-path.ts@@ -8,9 +8,9 @@ import {translateSegments} from './translate-path';/*** @description Allows you to grow or shrink the size of a path.* @param {string} path A valid SVG path- * @param {string} d- * @param {Number} scaleX- * @param {Number} scaleY+ * @param {string} d+ * @param {Number} scaleX+ * @param {Number} scaleY* @returns a new path with respect to the scale values provided* @see [Documentation](https://www.remotion.dev/docs/paths/scale-path)*/diff --git a/packages/paths/src/serialize-instructions.ts b/packages/paths/src/serialize-instructions.tsindex 77ee0448b6..58edd6eb6e 100644--- a/packages/paths/src/serialize-instructions.ts+++ b/packages/paths/src/serialize-instructions.ts@@ -2,7 +2,7 @@ import type {Instruction} from './helpers/types';/*** @description Takes an array of Instruction's and serializes it into an SVG path string.- * @param {Array} instruction+ * @param {Array} instruction* @returns a serialized SVG path string* @see [Documentation](https://www.remotion.dev/docs/paths/serialize-instructions)*/diff --git a/packages/player-example/package.json b/packages/player-example/package.jsonindex bb076cf388..4d4b7d005b 100644--- a/packages/player-example/package.json+++ b/packages/player-example/package.json@@ -28,6 +28,7 @@"prettier-plugin-organize-imports": "^2.3.4"},"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","dev": "next dev","build-site": "next build"diff --git a/packages/player/package.json b/packages/player/package.jsonindex 1f1fc7f727..43e60c6b73 100644--- a/packages/player/package.json+++ b/packages/player/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","build": "node ensure-correct-version.js && rollup --config rollup.config.js && tsc -d","watch": "tsc -w",diff --git a/packages/player/src/index.ts b/packages/player/src/index.tsindex d780981ccb..87c3d8196e 100644--- a/packages/player/src/index.ts+++ b/packages/player/src/index.ts@@ -1,19 +1,25 @@-import {calculateCanvasTransformation, calculateScale} from './calculate-scale.js';+import {+ calculateCanvasTransformation,+ calculateScale,+} from './calculate-scale.js';import {PlayerEventEmitterContext} from './emitter-context.js';import type {CallbackListener, PlayerEventTypes} from './event-emitter.js';import {PlayerEmitter} from './event-emitter.js';import {useHoverState} from './use-hover-state.js';import {usePlayback} from './use-playback.js';import {usePlayer} from './use-player.js';-import {updateAllElementsSizes, useElementSize} from './utils/use-element-size.js';+import {+ updateAllElementsSizes,+ useElementSize,+} from './utils/use-element-size.js';-export {Player, PlayerProps} from './Player.js';export {PlayerMethods,PlayerRef,ThumbnailMethods,ThumbnailRef,} from './player-methods.js';+export {Player, PlayerProps} from './Player.js';export type {RenderFullscreenButton,RenderPlayPauseButton,diff --git a/packages/preload/package.json b/packages/preload/package.jsonindex a69507e9e9..22e196dc87 100644--- a/packages/preload/package.json+++ b/packages/preload/package.json@@ -6,6 +6,7 @@"types": "dist/index.d.ts","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "tsc -d"diff --git a/packages/preload/src/preload-video.ts b/packages/preload/src/preload-video.tsindex afc584edae..d439c86feb 100644--- a/packages/preload/src/preload-video.ts+++ b/packages/preload/src/preload-video.ts@@ -3,7 +3,7 @@ import {preloadAsset} from './preload-asset';/*** @description Preloads a video in the DOM so that when a video tag is mounted, it can play immediately.* @see [Documentation](https://www.remotion.dev/docs/preload/preload-video)-*/+ */export const preloadVideo = (src: string): (() => void) => {return preloadAsset(src, 'video');};diff --git a/packages/renderer/package.json b/packages/renderer/package.jsonindex 480e2127ea..7d72b4b949 100644--- a/packages/renderer/package.json+++ b/packages/renderer/package.json@@ -6,6 +6,7 @@"types": "dist/index.d.ts","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","test": "vitest --run","watch": "tsc -w",diff --git a/packages/renderer/src/make-cancel-signal.ts b/packages/renderer/src/make-cancel-signal.tsindex 79488cc59b..362516ebf5 100644--- a/packages/renderer/src/make-cancel-signal.ts+++ b/packages/renderer/src/make-cancel-signal.ts@@ -3,7 +3,7 @@ type Callback = () => void;export type CancelSignal = (callback: Callback) => void;/**- * @description Returns a signal and a cancel function that allows to you cancel a render triggered using renderMedia(), renderStill(), renderFrames() or stitchFramesToVideo().+ * @description Returns a signal and a cancel function that allows to you cancel a render triggered using renderMedia(), renderStill(), renderFrames() or stitchFramesToVideo().* @see [Documentation](https://www.remotion.dev/docs/renderer/make-cancel-signal)*/export const makeCancelSignal = (): {diff --git a/packages/rive/package.json b/packages/rive/package.jsonindex 5003dd2ca6..188dc936da 100644--- a/packages/rive/package.json+++ b/packages/rive/package.json@@ -6,6 +6,8 @@"types": "dist/cjs/index.d.ts","module": "dist/esm/index.mjs","scripts": {+ "formatting": "prettier src --check",+ "lint": "eslint src --ext ts,tsx","build": "rollup --config rollup.config.js && tsc -d","watch": "tsc -w"},diff --git a/packages/shapes/package.json b/packages/shapes/package.jsonindex a7140d9b07..334c3145d8 100644--- a/packages/shapes/package.json+++ b/packages/shapes/package.json@@ -5,6 +5,7 @@"main": "dist/index.js","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "tsc -d",diff --git a/packages/shapes/src/test/make-rect.test.ts b/packages/shapes/src/test/make-rect.test.tsindex 0a6349efcd..573ecfa125 100644--- a/packages/shapes/src/test/make-rect.test.ts+++ b/packages/shapes/src/test/make-rect.test.ts@@ -19,9 +19,8 @@ test('Should be able to make a rect path', () => {});});-test('Should handle rectangle path with radius', () => {- const rect = makeRect({width: 100, height: 100, cornerRadius: 20})+ const rect = makeRect({width: 100, height: 100, cornerRadius: 20});expect(rect).toEqual({height: 100,@@ -30,4 +29,4 @@ test('Should handle rectangle path with radius', () => {transformOrigin: '50 50',instructions: expect.any(Array),});-});\ No newline at end of file+});diff --git a/packages/shapes/src/test/make-triangle.test.ts b/packages/shapes/src/test/make-triangle.test.tsindex ff804fce9d..36c5909ba4 100644--- a/packages/shapes/src/test/make-triangle.test.ts+++ b/packages/shapes/src/test/make-triangle.test.ts@@ -86,6 +86,4 @@ describe('with radius', () => {width: 86.60254037844386,});});-})--+});diff --git a/packages/shapes/src/utils/join-points.ts b/packages/shapes/src/utils/join-points.tsindex 99947ba7eb..580ed4cfd8 100644--- a/packages/shapes/src/utils/join-points.ts+++ b/packages/shapes/src/utils/join-points.ts@@ -62,9 +62,8 @@ export const joinPoints = (type: 'M',x: computeRadius[0] + x,y: computeRadius[1] + y,- }- ]-+ },+ ];}return [@@ -76,7 +75,6 @@ export const joinPoints = (];}-if (cornerRadius && edgeRoundness !== null) {throw new Error(`"cornerRadius" and "edgeRoundness" cannot be specified at the same time.`diff --git a/packages/skia/package.json b/packages/skia/package.jsonindex fc46105b6b..6666e09fe4 100644--- a/packages/skia/package.json+++ b/packages/skia/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "rollup --config rollup-enable.config.js && rollup --config rollup.config.js && tsc -d"diff --git a/packages/three/package.json b/packages/three/package.jsonindex 0477927194..b5c106b44d 100644--- a/packages/three/package.json+++ b/packages/three/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "rollup --config rollup.config.js && tsc -d"diff --git a/packages/zod-types/package.json b/packages/zod-types/package.jsonindex 650afeaf2c..67cf7a14e7 100644--- a/packages/zod-types/package.json+++ b/packages/zod-types/package.json@@ -7,6 +7,7 @@"module": "dist/esm/index.mjs","sideEffects": false,"scripts": {+ "formatting": "prettier src --check","lint": "eslint src --ext ts,tsx","watch": "tsc -w","build": "rollup --config rollup.config.js && tsc -d"diff --git a/turbo.json b/turbo.jsonindex 38ad48cf57..a2af4ff9b5 100644--- a/turbo.json+++ b/turbo.json@@ -13,6 +13,9 @@"lint": {"outputs": []},+ "formatting": {+ "outputs": []+ },"@remotion/example#lint": {"dependsOn": ["@remotion/eslint-config#build"]},