-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4871 from remotion-dev/remotion-lambda-client
`@remotion/lambda-client`: New package
- Loading branch information
Showing
264 changed files
with
2,712 additions
and
2,148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {existsSync} from 'node:fs'; | ||
import path from 'path'; | ||
|
||
export type Exports = Record<string, './package.json' | Record<string, string>>; | ||
|
||
export const validateExports = (exports: Exports) => { | ||
const keys = Object.keys(exports); | ||
for (const key of keys) { | ||
const value = exports[key]; | ||
if (key === './package.json' && value === './package.json') { | ||
continue; | ||
} | ||
|
||
if (typeof value === 'string') { | ||
throw new Error(`Invalid export for ${key}`); | ||
} | ||
|
||
if (!value.import || !value.require || !value.module || !value) { | ||
throw new Error(`Missing import or require for ${key}`); | ||
} | ||
const paths = Object.keys(value); | ||
for (const entry of paths) { | ||
if ( | ||
entry !== 'import' && | ||
entry !== 'require' && | ||
entry !== 'module' && | ||
entry !== 'types' | ||
) { | ||
throw new Error(`Invalid export: ${entry}: ${JSON.stringify(exports)}`); | ||
} | ||
const pathToCheck = path.join(process.cwd(), value[entry]); | ||
const exists = existsSync(pathToCheck); | ||
if (!exists) { | ||
throw new Error(`Path does not exist: ${pathToCheck}`); | ||
} | ||
} | ||
} | ||
}; |
5 changes: 2 additions & 3 deletions
5
packages/docs/components/lambda/default-frames-per-lambda.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { MINIMUM_FRAMES_PER_LAMBDA } from "@remotion/lambda/defaults"; | ||
import React from "react"; | ||
import React from 'react'; | ||
|
||
export const MinimumFramesPerLambda: React.FC = () => { | ||
return <code>{MINIMUM_FRAMES_PER_LAMBDA}</code>; | ||
return <code>4</code>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { DEFAULT_CLOUDWATCH_RETENTION_PERIOD } from "@remotion/lambda/defaults"; | ||
import React from "react"; | ||
import {DEFAULT_CLOUDWATCH_RETENTION_PERIOD} from '@remotion/lambda-client/constants'; | ||
import React from 'react'; | ||
|
||
export const DefaultLogRetention: React.FC = () => { | ||
return <span>{DEFAULT_CLOUDWATCH_RETENTION_PERIOD}</span>; | ||
return <span>{DEFAULT_CLOUDWATCH_RETENTION_PERIOD}</span>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { DEFAULT_MEMORY_SIZE } from "@remotion/lambda/defaults"; | ||
import React from "react"; | ||
import {DEFAULT_MEMORY_SIZE} from '@remotion/lambda-client/constants'; | ||
import React from 'react'; | ||
|
||
export const DefaultMemorySize: React.FC = () => { | ||
return <span>{DEFAULT_MEMORY_SIZE}</span>; | ||
return <span>{DEFAULT_MEMORY_SIZE}</span>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { DEFAULT_TIMEOUT } from "@remotion/lambda/defaults"; | ||
import React from "react"; | ||
import {DEFAULT_TIMEOUT} from '@remotion/lambda-client/constants'; | ||
import React from 'react'; | ||
|
||
export const DefaultTimeout: React.FC = () => { | ||
return <span>{DEFAULT_TIMEOUT}</span>; | ||
return <span>{DEFAULT_TIMEOUT}</span>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { AWS_REGIONS } from "@remotion/lambda/regions"; | ||
import React from "react"; | ||
import {AWS_REGIONS} from '@remotion/lambda-client/regions'; | ||
import React from 'react'; | ||
|
||
export const LambdaRegionList: React.FC = () => { | ||
return ( | ||
<ul> | ||
{AWS_REGIONS.map((region) => { | ||
return ( | ||
<li key={region}> | ||
<code>{region}</code>{" "} | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
); | ||
return ( | ||
<ul> | ||
{AWS_REGIONS.map((region) => { | ||
return ( | ||
<li key={region}> | ||
<code>{region}</code>{' '} | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { getRolePolicy } from "@remotion/lambda/policies"; | ||
import React from "react"; | ||
import {getRolePolicy} from '@remotion/lambda/policies'; | ||
import React from 'react'; | ||
|
||
export const RolePolicy: React.FC = () => { | ||
return ( | ||
<div> | ||
<pre>{getRolePolicy()}</pre> | ||
</div> | ||
); | ||
return ( | ||
<div> | ||
<pre>{getRolePolicy()}</pre> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { getUserPolicy } from "@remotion/lambda/policies"; | ||
import React from "react"; | ||
import {getUserPolicy} from '@remotion/lambda/policies'; | ||
import React from 'react'; | ||
|
||
export const UserPolicy: React.FC = () => { | ||
return ( | ||
<div> | ||
<pre>{getUserPolicy()}</pre> | ||
</div> | ||
); | ||
return ( | ||
<div> | ||
<pre>{getUserPolicy()}</pre> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ slug: /lambda/supabase | |
This page shows how to trigger a Remotion Lambda render from a Supabase Edge Function. | ||
Other than that, the steps to use Remotion Lambda are the same as described in the [Remotion Lambda setup](/docs/lambda/setup). | ||
|
||
## Invoking a Remotion Lambda render from Supabase Edge Functions<AvailableFrom v="4.0.258"/> | ||
## Invoking a Remotion Lambda render from Supabase Edge Functions<AvailableFrom v="4.0.261"/> | ||
|
||
Install the `@remotion/lambda` package in your Supabase Edge Functions project: | ||
Install the `@remotion/lambda-client` package in your Supabase Edge Functions project: | ||
|
||
```bash | ||
deno add @remotion/[email protected].258 | ||
deno add @remotion/lambda-client@4.0.261 | ||
``` | ||
|
||
Replace `4.0.258` with the version of Remotion you are using. | ||
Replace `4.0.261` with the version of Remotion you are using. | ||
|
||
Set the environment variable `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`: | ||
|
||
|
@@ -28,8 +28,8 @@ AWS_SECRET_ACCESS_KEY=xxx | |
|
||
```tsx title="supabase/functions/trigger-render.ts" | ||
import 'jsr:@supabase/functions-js/edge-runtime.d.ts'; | ||
// FIXME: Replace 4.0.258 with the version of Remotion you are using. | ||
import {renderMediaOnLambda} from 'npm:@remotion/[email protected].258/client'; | ||
// FIXME: Replace 4.0.261 with the version of Remotion you are using. | ||
import {renderMediaOnLambda} from 'npm:@remotion/lambda-client@4.0.261'; | ||
|
||
Deno.serve(async (req) => { | ||
const {props} = await req.json(); | ||
|
@@ -67,7 +67,7 @@ Create a Supabase Storage bucket and set the environment variables `SUPABASE_ACC | |
Use an [`s3OutputProvider`](/docs/lambda/custom-destination#saving-to-another-cloud) to store the rendered video in Supabase Storage: | ||
|
||
```tsx twoslash | ||
import {renderMediaOnLambda, speculateFunctionName} from '@remotion/lambda/client'; | ||
import {renderMediaOnLambda, speculateFunctionName} from '@remotion/lambda-client'; | ||
|
||
// ---cut--- | ||
const {bucketName, renderId, cloudWatchMainLogs} = await renderMediaOnLambda({ | ||
|
Oops, something went wrong.