Skip to content

🎥 Make videos programmatically with React

sort imports

Jonny Burgera0a40a914944
diff --git a/packages/lambda/src/api/get-compositions-on-lambda.ts b/packages/lambda/src/api/get-compositions-on-lambda.ts
index 82b275ea1d..16d5c83e3d 100644
--- a/packages/lambda/src/api/get-compositions-on-lambda.ts
+++ b/packages/lambda/src/api/get-compositions-on-lambda.ts
@@ -5,8 +5,8 @@ import type {AwsRegion} from '../client';
import {LambdaRoutines} from '../defaults';
import {callLambda} from '../shared/call-lambda';
import {
- getNeedsToUpload,
compressInputProps,
+ getNeedsToUpload,
serializeOrThrow,
} from '../shared/compress-props';
diff --git a/packages/lambda/src/api/make-lambda-payload.ts b/packages/lambda/src/api/make-lambda-payload.ts
index d62d879605..16a32b88ae 100644
--- a/packages/lambda/src/api/make-lambda-payload.ts
+++ b/packages/lambda/src/api/make-lambda-payload.ts
@@ -2,8 +2,8 @@ import {VERSION} from 'remotion/version';
import type {LambdaStartPayload, LambdaStatusPayload} from '../defaults';
import {LambdaRoutines} from '../defaults';
import {
- getNeedsToUpload,
compressInputProps,
+ getNeedsToUpload,
serializeOrThrow,
} from '../shared/compress-props';
import {validateDownloadBehavior} from '../shared/validate-download-behavior';
diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.ts
index 0df38c305d..e7fd48e517 100644
--- a/packages/lambda/src/api/render-still-on-lambda.ts
+++ b/packages/lambda/src/api/render-still-on-lambda.ts
@@ -6,15 +6,15 @@ import type {
import {VERSION} from 'remotion/version';
import type {AwsRegion} from '../pricing/aws-regions';
import {callLambda} from '../shared/call-lambda';
-import type {CostsInfo, OutNameInput, Privacy} from '../shared/constants';
-import {DEFAULT_MAX_RETRIES, LambdaRoutines} from '../shared/constants';
-import type {DownloadBehavior} from '../shared/content-disposition-header';
-import {getCloudwatchStreamUrl} from '../shared/get-aws-urls';
import {
- getNeedsToUpload,
compressInputProps,
+ getNeedsToUpload,
serializeOrThrow,
} from '../shared/compress-props';
+import type {CostsInfo, OutNameInput, Privacy} from '../shared/constants';
+import {DEFAULT_MAX_RETRIES, LambdaRoutines} from '../shared/constants';
+import type {DownloadBehavior} from '../shared/content-disposition-header';
+import {getCloudwatchStreamUrl} from '../shared/get-aws-urls';
export type RenderStillOnLambdaInput = {
region: AwsRegion;
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index 033a9b05b6..d5141cf420 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -1,6 +1,7 @@
import {CliInternals} from '@remotion/cli';
import {ConfigInternals} from '@remotion/cli/config';
import {RenderInternals} from '@remotion/renderer';
+import {Internals} from 'remotion';
import {downloadMedia} from '../../../api/download-media';
import {getRenderProgress} from '../../../api/get-render-progress';
import {renderMediaOnLambda} from '../../../api/render-media-on-lambda';
@@ -23,7 +24,6 @@ import {findFunctionName} from '../../helpers/find-function-name';
import {quit} from '../../helpers/quit';
import {Log} from '../../log';
import {makeMultiProgressFromStatus, makeProgressString} from './progress';
-import {Internals} from 'remotion';
export const RENDER_COMMAND = 'render';
diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.ts
index 8b7964b9f3..8c473399f1 100644
--- a/packages/lambda/src/cli/commands/still.ts
+++ b/packages/lambda/src/cli/commands/still.ts
@@ -1,6 +1,7 @@
import {CliInternals} from '@remotion/cli';
import {ConfigInternals} from '@remotion/cli/config';
import {RenderInternals} from '@remotion/renderer';
+import {Internals} from 'remotion';
import {downloadMedia} from '../../api/download-media';
import {renderStillOnLambda} from '../../api/render-still-on-lambda';
import {
@@ -16,7 +17,6 @@ import {getAwsRegion} from '../get-aws-region';
import {findFunctionName} from '../helpers/find-function-name';
import {quit} from '../helpers/quit';
import {Log} from '../log';
-import {Internals} from 'remotion';
export const STILL_COMMAND = 'still';
diff --git a/packages/lambda/src/cli/index.ts b/packages/lambda/src/cli/index.ts
index 2682cc80b2..a6f5b7b61e 100644
--- a/packages/lambda/src/cli/index.ts
+++ b/packages/lambda/src/cli/index.ts
@@ -1,4 +1,5 @@
import {CliInternals} from '@remotion/cli';
+import {ConfigInternals} from '@remotion/cli/config';
import {RenderInternals} from '@remotion/renderer';
import {ROLE_NAME} from '../api/iam-validation/suggested-policy';
import {BINARY_NAME} from '../defaults';
@@ -22,7 +23,6 @@ import {printHelp} from './help';
import {quit} from './helpers/quit';
import {setIsCli} from './is-cli';
import {Log} from './log';
-import {ConfigInternals} from '@remotion/cli/config';
const requiresCredentials = (args: string[]) => {
if (args[0] === POLICIES_COMMAND) {
diff --git a/packages/lambda/src/client.ts b/packages/lambda/src/client.ts
index 35de8c3ab5..aed93a53ce 100644
--- a/packages/lambda/src/client.ts
+++ b/packages/lambda/src/client.ts
@@ -1,5 +1,6 @@
import {getCompositionsOnLambda} from './api/get-compositions-on-lambda';
import {getFunctions} from './api/get-functions';
+import type {GetRenderProgressInput} from './api/get-render-progress';
import {getRenderProgress} from './api/get-render-progress';
import {getSites} from './api/get-sites';
import type {PresignUrlInput} from './api/presign-url';
@@ -16,7 +17,6 @@ import type {
RenderStillOnLambdaInput,
RenderStillOnLambdaOutput,
} from './api/render-still-on-lambda';
-import type {GetRenderProgressInput} from './api/get-render-progress';
import {renderStillOnLambda} from './api/render-still-on-lambda';
import type {SpeculateFunctionNameInput} from './api/speculate-function-name';
import {speculateFunctionName} from './api/speculate-function-name';
@@ -37,7 +37,6 @@ export {
getSites,
speculateFunctionName,
};
-
export type {
AwsRegion,
RenderProgress,
diff --git a/packages/lambda/src/functions/compositions.ts b/packages/lambda/src/functions/compositions.ts
index 78274ef06e..486c8a26aa 100644
--- a/packages/lambda/src/functions/compositions.ts
+++ b/packages/lambda/src/functions/compositions.ts
@@ -3,10 +3,10 @@ import {VERSION} from 'remotion/version';
import {getOrCreateBucket} from '../api/get-or-create-bucket';
import type {LambdaPayload} from '../defaults';
import {LambdaRoutines} from '../defaults';
+import {decompressInputProps} from '../shared/compress-props';
import {convertToServeUrl} from '../shared/convert-to-serve-url';
import {getBrowserInstance} from './helpers/get-browser-instance';
import {getCurrentRegionInFunction} from './helpers/get-current-region';
-import {decompressInputProps} from '../shared/compress-props';
type Options = {
expectedBucketOwner: string;
diff --git a/packages/lambda/src/functions/index.ts b/packages/lambda/src/functions/index.ts
index 46854272fd..1d43b50085 100644
--- a/packages/lambda/src/functions/index.ts
+++ b/packages/lambda/src/functions/index.ts
@@ -1,22 +1,22 @@
import {RenderInternals} from '@remotion/renderer';
import type {LambdaPayload} from '../shared/constants';
import {COMMAND_NOT_FOUND, LambdaRoutines} from '../shared/constants';
+import {randomHash} from '../shared/random-hash';
+import type {OrError} from '../shared/return-values';
import {compositionsHandler} from './compositions';
import {deleteTmpDir} from './helpers/clean-tmpdir';
import {getWarm, setWarm} from './helpers/is-warm';
import {printCloudwatchHelper} from './helpers/print-cloudwatch-helper';
import type {ResponseStream} from './helpers/streamify-response';
import {streamifyResponse} from './helpers/streamify-response';
+import type {StreamingPayloads} from './helpers/streaming-payloads';
+import {sendProgressEvent} from './helpers/streaming-payloads';
import {infoHandler} from './info';
import {launchHandler} from './launch';
import {progressHandler} from './progress';
import {rendererHandler} from './renderer';
import {startHandler} from './start';
import {stillHandler} from './still';
-import {randomHash} from '../shared/random-hash';
-import type {OrError} from '../shared/return-values';
-import type {StreamingPayloads} from './helpers/streaming-payloads';
-import {sendProgressEvent} from './helpers/streaming-payloads';
const innerHandler = async (
params: LambdaPayload,
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 925a8683c2..c6b0e9f702 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -3,7 +3,14 @@ import fs, {existsSync, mkdirSync, rmSync} from 'node:fs';
import {join} from 'node:path';
import {Internals} from 'remotion';
import {VERSION} from 'remotion/version';
+import {callLambda} from '../shared/call-lambda';
import {cleanupSerializedInputProps} from '../shared/cleanup-serialized-input-props';
+import {
+ compressInputProps,
+ decompressInputProps,
+ getNeedsToUpload,
+ serializeOrThrow,
+} from '../shared/compress-props';
import type {
LambdaPayload,
LambdaPayloads,
@@ -46,13 +53,6 @@ import {
writeLambdaError,
} from './helpers/write-lambda-error';
import {writePostRenderData} from './helpers/write-post-render-data';
-import {
- decompressInputProps,
- getNeedsToUpload,
- compressInputProps,
- serializeOrThrow,
-} from '../shared/compress-props';
-import {callLambda} from '../shared/call-lambda';
type Options = {
expectedBucketOwner: string;
diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.ts
index 990cb51e3e..89e50c95fe 100644
--- a/packages/lambda/src/functions/renderer.ts
+++ b/packages/lambda/src/functions/renderer.ts
@@ -3,7 +3,9 @@ import {RenderInternals} from '@remotion/renderer';
import fs from 'node:fs';
import path from 'node:path';
import {VERSION} from 'remotion/version';
+import {callLambda} from '../shared/call-lambda';
import {writeLambdaInitializedFile} from '../shared/chunk-progress';
+import {decompressInputProps} from '../shared/compress-props';
import type {LambdaPayload, LambdaPayloads} from '../shared/constants';
import {
chunkKeyForIndex,
@@ -23,8 +25,6 @@ import {
getTmpDirStateIfENoSp,
writeLambdaError,
} from './helpers/write-lambda-error';
-import {decompressInputProps} from '../shared/compress-props';
-import {callLambda} from '../shared/call-lambda';
type Options = {
expectedBucketOwner: string;
diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.ts
index 4e5dd5bf24..013607e209 100644
--- a/packages/lambda/src/functions/start.ts
+++ b/packages/lambda/src/functions/start.ts
@@ -1,12 +1,12 @@
import {VERSION} from 'remotion/version';
import {getOrCreateBucket} from '../api/get-or-create-bucket';
+import {callLambda} from '../shared/call-lambda';
import type {LambdaPayload} from '../shared/constants';
import {initalizedMetadataKey, LambdaRoutines} from '../shared/constants';
import {convertToServeUrl} from '../shared/convert-to-serve-url';
import {randomHash} from '../shared/random-hash';
import {getCurrentRegionInFunction} from './helpers/get-current-region';
import {lambdaWriteFile} from './helpers/io';
-import {callLambda} from '../shared/call-lambda';
type Options = {
expectedBucketOwner: string;
diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.ts
index 236482960c..aa09df8168 100644
--- a/packages/lambda/src/functions/still.ts
+++ b/packages/lambda/src/functions/still.ts
@@ -2,10 +2,13 @@ import type {StillImageFormat} from '@remotion/renderer';
import {RenderInternals} from '@remotion/renderer';
import fs from 'node:fs';
import path from 'node:path';
+import {Internals} from 'remotion';
import {VERSION} from 'remotion/version';
import {estimatePrice} from '../api/estimate-price';
import {getOrCreateBucket} from '../api/get-or-create-bucket';
+import {callLambda} from '../shared/call-lambda';
import {cleanupSerializedInputProps} from '../shared/cleanup-serialized-input-props';
+import {decompressInputProps} from '../shared/compress-props';
import type {
CostsInfo,
LambdaPayload,
@@ -37,9 +40,6 @@ import {
getTmpDirStateIfENoSp,
writeLambdaError,
} from './helpers/write-lambda-error';
-import {decompressInputProps} from '../shared/compress-props';
-import {Internals} from 'remotion';
-import {callLambda} from '../shared/call-lambda';
type Options = {
params: LambdaPayload;
diff --git a/packages/lambda/src/shared/call-lambda.ts b/packages/lambda/src/shared/call-lambda.ts
index b53b8e7bb7..72726f3f2c 100644
--- a/packages/lambda/src/shared/call-lambda.ts
+++ b/packages/lambda/src/shared/call-lambda.ts
@@ -1,11 +1,11 @@
import type {InvokeWithResponseStreamResponseEvent} from '@aws-sdk/client-lambda';
import {InvokeWithResponseStreamCommand} from '@aws-sdk/client-lambda';
+import type {StreamingPayloads} from '../functions/helpers/streaming-payloads';
+import {isStreamingPayload} from '../functions/helpers/streaming-payloads';
import type {AwsRegion} from '../pricing/aws-regions';
import {getLambdaClient} from './aws-clients';
import type {LambdaPayloads, LambdaRoutines} from './constants';
import type {LambdaReturnValues, OrError} from './return-values';
-import type {StreamingPayloads} from '../functions/helpers/streaming-payloads';
-import {isStreamingPayload} from '../functions/helpers/streaming-payloads';
export const callLambda = async <T extends LambdaRoutines>({
functionName,
diff --git a/packages/lambda/src/shared/compress-props.ts b/packages/lambda/src/shared/compress-props.ts
index 317ea3bd8e..7c8b82a301 100644
--- a/packages/lambda/src/shared/compress-props.ts
+++ b/packages/lambda/src/shared/compress-props.ts
@@ -4,8 +4,8 @@ import {lambdaReadFile, lambdaWriteFile} from '../functions/helpers/io';
import type {SerializedInputProps} from './constants';
import {inputPropsKey, resolvedPropsKey} from './constants';
import {randomHash} from './random-hash';
-import {streamToString} from './stream-to-string';
import {serializeJSONWithDate} from './serialize-props';
+import {streamToString} from './stream-to-string';
type PropsType = 'input-props' | 'resolved-props';
diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.ts
index 57f72189ed..40e31c921e 100644
--- a/packages/lambda/src/test/integration/renders/gif.test.ts
+++ b/packages/lambda/src/test/integration/renders/gif.test.ts
@@ -4,8 +4,8 @@ import {VERSION} from 'remotion/version';
import {afterAll, beforeAll, expect, test} from 'vitest';
import {LambdaRoutines} from '../../../defaults';
import {lambdaReadFile} from '../../../functions/helpers/io';
-import {disableLogs, enableLogs} from '../../disable-logs';
import {callLambda} from '../../../shared/call-lambda';
+import {disableLogs, enableLogs} from '../../disable-logs';
beforeAll(() => {
disableLogs();
diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.ts
index 5a710e075d..56da5cddca 100644
--- a/packages/lambda/src/test/integration/renders/old-version.test.ts
+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts
@@ -2,8 +2,8 @@ import {RenderInternals} from '@remotion/renderer';
import {VERSION} from 'remotion/version';
import {afterAll, beforeAll, expect, test} from 'vitest';
import {LambdaRoutines} from '../../../defaults';
-import {disableLogs, enableLogs} from '../../disable-logs';
import {callLambda} from '../../../shared/call-lambda';
+import {disableLogs, enableLogs} from '../../disable-logs';
beforeAll(() => {
disableLogs();
diff --git a/packages/lambda/src/test/integration/renders/other-bucket.test.ts b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
index 1bbc97a2a0..3e985c959b 100644
--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts
+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
@@ -3,8 +3,8 @@ import {VERSION} from 'remotion/version';
import {afterAll, beforeAll, expect, test} from 'vitest';
import {LambdaRoutines} from '../../../defaults';
import {lambdaReadFile} from '../../../functions/helpers/io';
-import {disableLogs, enableLogs} from '../../disable-logs';
import {callLambda} from '../../../shared/call-lambda';
+import {disableLogs, enableLogs} from '../../disable-logs';
beforeAll(() => {
disableLogs();
diff --git a/packages/lambda/src/test/integration/renders/silent-audio.test.ts b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
index acee9dcebf..b452326d60 100644
--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts
+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
@@ -3,8 +3,8 @@ import {VERSION} from 'remotion/version';
import {afterAll, beforeAll, expect, test} from 'vitest';
import {LambdaRoutines} from '../../../defaults';
import {lambdaReadFile} from '../../../functions/helpers/io';
-import {disableLogs, enableLogs} from '../../disable-logs';
import {callLambda} from '../../../shared/call-lambda';
+import {disableLogs, enableLogs} from '../../disable-logs';
beforeAll(() => {
disableLogs();
diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
index 7b65e057dc..f0b9c57a16 100644
--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
@@ -7,8 +7,8 @@ import {afterAll, beforeAll, expect, test} from 'vitest';
import {deleteRender} from '../../../api/delete-render';
import {LambdaRoutines, rendersPrefix} from '../../../defaults';
import {lambdaLs, lambdaReadFile} from '../../../functions/helpers/io';
-import {disableLogs, enableLogs} from '../../disable-logs';
import {callLambda} from '../../../shared/call-lambda';
+import {disableLogs, enableLogs} from '../../disable-logs';
beforeAll(() => {
disableLogs();
diff --git a/packages/lambda/src/test/integration/webhooks.test.ts b/packages/lambda/src/test/integration/webhooks.test.ts
index 4fb843d215..ec22689a05 100644
--- a/packages/lambda/src/test/integration/webhooks.test.ts
+++ b/packages/lambda/src/test/integration/webhooks.test.ts
@@ -11,9 +11,9 @@ import {
vi,
} from 'vitest';
import {LambdaRoutines} from '../../defaults';
+import {callLambda} from '../../shared/call-lambda';
import {mockableHttpClients} from '../../shared/invoke-webhook';
import {disableLogs, enableLogs} from '../disable-logs';
-import {callLambda} from '../../shared/call-lambda';
const originalFetch = mockableHttpClients.http;
beforeEach(() => {
diff --git a/packages/lambda/src/test/unit/handlers.test.ts b/packages/lambda/src/test/unit/handlers.test.ts
index f38a6fbd93..c34cef2b65 100644
--- a/packages/lambda/src/test/unit/handlers.test.ts
+++ b/packages/lambda/src/test/unit/handlers.test.ts
@@ -1,6 +1,6 @@
import {expect, test} from 'vitest';
-import {LambdaRoutines} from '../../shared/constants';
import {callLambda} from '../../shared/call-lambda';
+import {LambdaRoutines} from '../../shared/constants';
test('Info handler should return version', async () => {
const response = await callLambda({