@remotion/lambda 3.2.15 → 3.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,8 @@ export declare type DeploySiteInput = {
11
11
  onUploadProgress?: (upload: UploadDirProgress) => void;
12
12
  webpackOverride?: WebpackOverrideFn;
13
13
  enableCaching?: boolean;
14
+ publicDir?: string | null;
15
+ rootDir?: string;
14
16
  };
15
17
  };
16
18
  export declare type DeploySiteOutput = Promise<{
@@ -47,6 +47,8 @@ const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }
47
47
  publicPath: `/${subFolder}/`,
48
48
  webpackOverride: (_b = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _b !== void 0 ? _b : ((f) => f),
49
49
  enableCaching: (_c = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _c !== void 0 ? _c : true,
50
+ publicDir: options === null || options === void 0 ? void 0 : options.publicDir,
51
+ rootDir: options === null || options === void 0 ? void 0 : options.rootDir,
50
52
  });
51
53
  await Promise.all([
52
54
  (0, upload_dir_1.uploadDir)({
@@ -32,7 +32,10 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
32
32
  var _a;
33
33
  const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
34
34
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
35
- (0, validate_frames_per_lambda_1.validateFramesPerLambda)(framesPerLambda !== null && framesPerLambda !== void 0 ? framesPerLambda : null);
35
+ (0, validate_frames_per_lambda_1.validateFramesPerLambda)({
36
+ framesPerLambda: framesPerLambda !== null && framesPerLambda !== void 0 ? framesPerLambda : null,
37
+ durationInFrames: 1,
38
+ });
36
39
  (0, validate_download_behavior_1.validateDownloadBehavior)(downloadBehavior);
37
40
  const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
38
41
  try {
@@ -48,7 +48,7 @@ const renderCommand = async (args) => {
48
48
  const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
49
49
  (0, validate_privacy_1.validatePrivacy)(privacy);
50
50
  const framesPerLambda = (_d = args_1.parsedLambdaCli['frames-per-lambda']) !== null && _d !== void 0 ? _d : undefined;
51
- (0, validate_frames_per_lambda_1.validateFramesPerLambda)(framesPerLambda);
51
+ (0, validate_frames_per_lambda_1.validateFramesPerLambda)({ framesPerLambda, durationInFrames: 1 });
52
52
  const res = await (0, render_media_on_lambda_1.renderMediaOnLambda)({
53
53
  functionName,
54
54
  serveUrl,
File without changes
@@ -104,6 +104,9 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
104
104
  expectedBucketOwner,
105
105
  }),
106
106
  ]);
107
+ if ((renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.type) === 'still') {
108
+ throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
109
+ }
107
110
  const outputFile = renderMetadata
108
111
  ? await (0, find_output_file_in_bucket_1.findOutputFileInBucket)({
109
112
  bucketName,
@@ -99,7 +99,10 @@ const innerLaunchHandler = async (params, options) => {
99
99
  const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(comp.durationInFrames, params.frameRange);
100
100
  const frameCount = renderer_1.RenderInternals.getFramesToRender(realFrameRange, params.everyNthFrame);
101
101
  const framesPerLambda = (_a = params.framesPerLambda) !== null && _a !== void 0 ? _a : (0, best_frames_per_lambda_param_1.bestFramesPerLambdaParam)(frameCount.length);
102
- (0, validate_frames_per_lambda_1.validateFramesPerLambda)(framesPerLambda);
102
+ (0, validate_frames_per_lambda_1.validateFramesPerLambda)({
103
+ framesPerLambda,
104
+ durationInFrames: frameCount.length,
105
+ });
103
106
  const chunkCount = Math.ceil(frameCount.length / framesPerLambda);
104
107
  if (chunkCount > constants_1.MAX_FUNCTIONS_PER_RENDER) {
105
108
  throw new Error(`Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${constants_1.MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${docs_url_1.DOCS_URL}/docs/lambda/concurrency for how this parameter is calculated.`);
@@ -66,7 +66,7 @@ const renderHandler = async (params, options, logs) => {
66
66
  }
67
67
  chunkTimingData.timings[renderedFrames] = Date.now() - start;
68
68
  },
69
- parallelism: params.concurrencyPerLambda,
69
+ concurrency: params.concurrencyPerLambda,
70
70
  onStart: () => {
71
71
  (0, io_1.lambdaWriteFile)({
72
72
  privacy: 'private',
@@ -1 +1,2 @@
1
- export declare const bundleSite: (entryPoint: string, onProgressUpdate?: ((progress: number) => void) | undefined, options?: import("@remotion/bundler").BundleOptions | undefined) => Promise<string>;
1
+ import { bundle } from '@remotion/bundler';
2
+ export declare const bundleSite: typeof bundle;
File without changes
File without changes
@@ -1 +1,4 @@
1
- export declare const validateFramesPerLambda: (framesPerLambda: unknown) => void;
1
+ export declare const validateFramesPerLambda: ({ framesPerLambda, durationInFrames, }: {
2
+ framesPerLambda: unknown;
3
+ durationInFrames: number;
4
+ }) => void;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateFramesPerLambda = void 0;
4
4
  const constants_1 = require("./constants");
5
- const validateFramesPerLambda = (framesPerLambda) => {
5
+ const validateFramesPerLambda = ({ framesPerLambda, durationInFrames, }) => {
6
6
  if (framesPerLambda === null) {
7
7
  return;
8
8
  }
@@ -21,8 +21,9 @@ const validateFramesPerLambda = (framesPerLambda) => {
21
21
  if (framesPerLambda % 1 !== 0) {
22
22
  throw new TypeError(`'framesPerLambda' needs to be an integer, passed ${framesPerLambda}`);
23
23
  }
24
- if (framesPerLambda < constants_1.MINIMUM_FRAMES_PER_LAMBDA) {
25
- throw new TypeError(`The framesPerLambda needs to be at least 4, but is ${framesPerLambda}`);
24
+ const effectiveMinimum = Math.min(constants_1.MINIMUM_FRAMES_PER_LAMBDA, durationInFrames);
25
+ if (framesPerLambda < effectiveMinimum) {
26
+ throw new TypeError(`The framesPerLambda needs to be at least ${effectiveMinimum}, but is ${framesPerLambda}`);
26
27
  }
27
28
  };
28
29
  exports.validateFramesPerLambda = validateFramesPerLambda;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.2.15",
3
+ "version": "3.2.20",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -32,12 +32,12 @@
32
32
  "@aws-sdk/client-service-quotas": "3.58.0",
33
33
  "@aws-sdk/lib-storage": "3.58.0",
34
34
  "@aws-sdk/s3-request-presigner": "3.58.0",
35
- "@remotion/bundler": "3.2.15",
36
- "@remotion/cli": "3.2.15",
37
- "@remotion/renderer": "3.2.15",
35
+ "@remotion/bundler": "3.2.20",
36
+ "@remotion/cli": "3.2.20",
37
+ "@remotion/renderer": "3.2.20",
38
38
  "aws-policies": "^1.0.1",
39
39
  "mime-types": "2.1.34",
40
- "remotion": "3.2.15"
40
+ "remotion": "3.2.20"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=16.8.0",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "7346704683815d274733cb3d280157b9ff570773"
65
+ "gitHead": "640f36c0c2d9fb1b7768925bf9d64840cbc31bc6"
66
66
  }
Binary file