@remotion/cli 4.0.5 → 4.0.7
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.
- package/dist/benchmark.js +1 -1
- package/dist/compositions.js +1 -1
- package/dist/config/image-format.d.ts +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/log.d.ts +1 -1
- package/dist/editor/components/CanvasOrLoading.js +4 -4
- package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
- package/dist/editor/components/PlayPause.js +4 -4
- package/dist/editor/components/PlaybackRateSelector.js +1 -1
- package/dist/editor/components/RenderModal/DataEditor.js +1 -3
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -2
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +9 -10
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +7 -7
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +29 -10
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
- package/dist/editor/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/dist/editor/helpers/render-modal-sections.d.ts +1 -0
- package/dist/get-cli-options.d.ts +1 -1
- package/dist/get-composition-id.js +1 -1
- package/dist/handle-common-errors.js +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/log.d.ts +9 -3
- package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
- package/dist/preview-server/render-queue/make-retry-payload.js +1 -1
- package/dist/preview-server/routes/update-default-props.js +1 -1
- package/dist/preview-server/routes.d.ts +1 -0
- package/dist/print-error.js +6 -3
- package/dist/render-flows/render.js +1 -1
- package/dist/render-flows/still.js +1 -1
- package/package.json +9 -9
- package/dist/cloudrun-command.d.ts +0 -1
- package/dist/cloudrun-command.js +0 -27
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +0 -42
- package/dist/error-with-stack-frame.d.ts +0 -19
- package/dist/error-with-stack-frame.js +0 -81
- package/dist/handle-javascript-error.d.ts +0 -20
- package/dist/handle-javascript-error.js +0 -81
- package/dist/symbolicate-error.d.ts +0 -3
- package/dist/symbolicate-error.js +0 -24
- package/dist/symbolicate-errors.d.ts +0 -7
- package/dist/symbolicate-errors.js +0 -90
- package/dist/symbolicate-stacktrace.d.ts +0 -28
- package/dist/symbolicate-stacktrace.js +0 -135
- package/dist/symbolicateable-error.d.ts +0 -16
- package/dist/symbolicateable-error.js +0 -18
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,12 @@ export declare const CliInternals: {
|
|
|
78
78
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
79
79
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
80
80
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
81
|
+
errorAdvanced: (options: {
|
|
82
|
+
indent: boolean;
|
|
83
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
84
|
+
} & {
|
|
85
|
+
tag?: string | undefined;
|
|
86
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
81
87
|
};
|
|
82
88
|
getCliOptions: (options: {
|
|
83
89
|
isLambda: boolean;
|
|
@@ -112,7 +118,7 @@ export declare const CliInternals: {
|
|
|
112
118
|
videoBitrate: string | null;
|
|
113
119
|
height: number | null;
|
|
114
120
|
width: number | null;
|
|
115
|
-
configFileImageFormat: "
|
|
121
|
+
configFileImageFormat: "png" | "jpeg" | "none" | undefined;
|
|
116
122
|
}>;
|
|
117
123
|
loadConfig: (remotionRoot: string) => Promise<string | null>;
|
|
118
124
|
initializeCli: (remotionRoot: string) => Promise<void>;
|
|
@@ -121,7 +127,7 @@ export declare const CliInternals: {
|
|
|
121
127
|
parsedCli: {
|
|
122
128
|
"browser-executable": import("@remotion/renderer").BrowserExecutable;
|
|
123
129
|
"pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
124
|
-
"image-format": "
|
|
130
|
+
"image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
|
|
125
131
|
"prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
|
|
126
132
|
"bundle-cache": string;
|
|
127
133
|
"env-file": string;
|
|
@@ -185,7 +191,7 @@ export declare const CliInternals: {
|
|
|
185
191
|
downloadName: string | null;
|
|
186
192
|
outName: string | null;
|
|
187
193
|
configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
|
|
188
|
-
cliFlag: "
|
|
194
|
+
cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
|
|
189
195
|
isLambda: boolean;
|
|
190
196
|
fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
|
|
191
197
|
}) => {
|
|
@@ -200,8 +206,8 @@ export declare const CliInternals: {
|
|
|
200
206
|
};
|
|
201
207
|
getVideoImageFormat: ({ codec, uiImageFormat, }: {
|
|
202
208
|
codec: import("@remotion/renderer").CodecOrUndefined;
|
|
203
|
-
uiImageFormat: "
|
|
204
|
-
}) => "
|
|
209
|
+
uiImageFormat: "png" | "jpeg" | "none" | null;
|
|
210
|
+
}) => "png" | "jpeg" | "none";
|
|
205
211
|
printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
|
|
206
212
|
getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
|
|
207
213
|
cliFlag: import("@remotion/renderer").CodecOrUndefined;
|
package/dist/log.d.ts
CHANGED
|
@@ -2,19 +2,25 @@ export declare const Log: {
|
|
|
2
2
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
3
3
|
verboseAdvanced: (options: {
|
|
4
4
|
indent: boolean;
|
|
5
|
-
logLevel: "
|
|
5
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
6
6
|
} & {
|
|
7
7
|
tag?: string | undefined;
|
|
8
8
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
9
9
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
10
10
|
infoAdvanced: (options: {
|
|
11
11
|
indent: boolean;
|
|
12
|
-
logLevel: "
|
|
12
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
13
13
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
14
14
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
15
15
|
warnAdvanced: (options: {
|
|
16
16
|
indent: boolean;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
18
18
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
|
+
errorAdvanced: (options: {
|
|
21
|
+
indent: boolean;
|
|
22
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
23
|
+
} & {
|
|
24
|
+
tag?: string | undefined;
|
|
25
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
20
26
|
};
|
|
@@ -11,5 +11,5 @@ type Range = {
|
|
|
11
11
|
type Ranges = Range[] & {
|
|
12
12
|
type?: string;
|
|
13
13
|
};
|
|
14
|
-
export declare function parseRange(size: number, str: string | string[]): -1 |
|
|
14
|
+
export declare function parseRange(size: number, str: string | string[]): -1 | Ranges | -2;
|
|
15
15
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeRetryPayload = void 0;
|
|
4
|
-
const get_default_video_contexts_1 = require("./get-default-video-contexts");
|
|
5
4
|
const remotion_1 = require("remotion");
|
|
5
|
+
const get_default_video_contexts_1 = require("./get-default-video-contexts");
|
|
6
6
|
const makeRetryPayload = (job) => {
|
|
7
7
|
var _a, _b, _c;
|
|
8
8
|
const defaults = window.remotion_renderDefaults;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateDefaultPropsHandler = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
5
6
|
const update_default_props_1 = require("../../codemods/update-default-props");
|
|
6
7
|
const project_info_1 = require("../project-info");
|
|
7
8
|
const can_update_default_props_1 = require("./can-update-default-props");
|
|
8
|
-
const remotion_1 = require("remotion");
|
|
9
9
|
const updateDefaultPropsHandler = async ({ input: { compositionId, defaultProps, enumPaths }, remotionRoot }) => {
|
|
10
10
|
try {
|
|
11
11
|
const projectInfo = await (0, project_info_1.getProjectInfo)(remotionRoot);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
3
|
import type { LiveEventsServer } from './live-events';
|
|
3
4
|
export declare const handleRoutes: ({ hash, hashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, }: {
|
package/dist/print-error.js
CHANGED
|
@@ -9,13 +9,16 @@ const progress_bar_1 = require("./progress-bar");
|
|
|
9
9
|
const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
|
|
10
10
|
const printError = async (err, logLevel) => {
|
|
11
11
|
if (err instanceof renderer_1.RenderInternals.SymbolicateableError) {
|
|
12
|
+
const updatesDoOverwrite = !(0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel });
|
|
12
13
|
const output = (0, progress_bar_1.createOverwriteableCliOutput)({
|
|
13
14
|
quiet: false,
|
|
14
15
|
cancelSignal: null,
|
|
15
|
-
updatesDontOverwrite:
|
|
16
|
+
updatesDontOverwrite: !updatesDoOverwrite,
|
|
16
17
|
indent: false,
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
+
if (updatesDoOverwrite) {
|
|
20
|
+
output.update(chalk_1.chalk.red('Symbolicating minified error message...\n' + err.message), false);
|
|
21
|
+
}
|
|
19
22
|
try {
|
|
20
23
|
const symbolicated = await renderer_1.RenderInternals.symbolicateError(err);
|
|
21
24
|
if (symbolicated.frame === null) {
|
|
@@ -27,7 +30,7 @@ const printError = async (err, logLevel) => {
|
|
|
27
30
|
(0, code_frame_1.printCodeFrameAndStack)(symbolicated);
|
|
28
31
|
}
|
|
29
32
|
catch (e) {
|
|
30
|
-
output.update(chalk_1.chalk.red('
|
|
33
|
+
output.update(chalk_1.chalk.red(''), true);
|
|
31
34
|
log_1.Log.error();
|
|
32
35
|
log_1.Log.error(err.stack || err);
|
|
33
36
|
}
|
|
@@ -31,6 +31,7 @@ const renderer_1 = require("@remotion/renderer");
|
|
|
31
31
|
const node_fs_1 = __importStar(require("node:fs"));
|
|
32
32
|
const node_os_1 = __importDefault(require("node:os"));
|
|
33
33
|
const node_path_1 = __importDefault(require("node:path"));
|
|
34
|
+
const remotion_1 = require("remotion");
|
|
34
35
|
const chalk_1 = require("../chalk");
|
|
35
36
|
const config_1 = require("../config");
|
|
36
37
|
const get_cli_options_1 = require("../get-cli-options");
|
|
@@ -45,7 +46,6 @@ const setup_cache_1 = require("../setup-cache");
|
|
|
45
46
|
const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
|
|
46
47
|
const truthy_1 = require("../truthy");
|
|
47
48
|
const user_passed_output_location_1 = require("../user-passed-output-location");
|
|
48
|
-
const remotion_1 = require("remotion");
|
|
49
49
|
const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, pixelFormat, videoBitrate, numberOfGifLoops, audioCodec, serializedInputPropsWithCustomSchema, disallowParallelEncoding, }) => {
|
|
50
50
|
var _a;
|
|
51
51
|
const downloads = [];
|
|
@@ -8,6 +8,7 @@ exports.renderStillFlow = void 0;
|
|
|
8
8
|
const renderer_1 = require("@remotion/renderer");
|
|
9
9
|
const node_fs_1 = require("node:fs");
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
+
const remotion_1 = require("remotion");
|
|
11
12
|
const chalk_1 = require("../chalk");
|
|
12
13
|
const cleanup_before_quit_1 = require("../cleanup-before-quit");
|
|
13
14
|
const config_1 = require("../config");
|
|
@@ -22,7 +23,6 @@ const setup_cache_1 = require("../setup-cache");
|
|
|
22
23
|
const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
|
|
23
24
|
const truthy_1 = require("../truthy");
|
|
24
25
|
const user_passed_output_location_1 = require("../user-passed-output-location");
|
|
25
|
-
const remotion_1 = require("remotion");
|
|
26
26
|
const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indentOutput, addCleanupCallback, cancelSignal, outputLocationFromUi, }) => {
|
|
27
27
|
var _a, _b;
|
|
28
28
|
const downloads = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"prompts": "2.4.1",
|
|
36
36
|
"semver": "7.5.3",
|
|
37
37
|
"source-map": "0.6.1",
|
|
38
|
-
"@remotion/
|
|
39
|
-
"@remotion/
|
|
40
|
-
"remotion": "4.0.
|
|
41
|
-
"@remotion/
|
|
42
|
-
"@remotion/
|
|
38
|
+
"@remotion/bundler": "4.0.7",
|
|
39
|
+
"@remotion/renderer": "4.0.7",
|
|
40
|
+
"remotion": "4.0.7",
|
|
41
|
+
"@remotion/media-utils": "4.0.7",
|
|
42
|
+
"@remotion/player": "4.0.7"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.8.0",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"eslint-plugin-react": "7.32.2",
|
|
60
60
|
"eslint-plugin-react-hooks": "4.4.0",
|
|
61
61
|
"prettier": "^2.7.1",
|
|
62
|
-
"prettier-plugin-organize-imports": "^2.
|
|
62
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
63
63
|
"react": "^18.0.0",
|
|
64
64
|
"react-dom": "^18.0.0",
|
|
65
65
|
"typescript": "4.9.5",
|
|
66
66
|
"vitest": "0.31.1",
|
|
67
67
|
"zod": "^3.21.4",
|
|
68
|
-
"@remotion/zod-types": "4.0.
|
|
69
|
-
"@remotion/tailwind": "4.0.
|
|
68
|
+
"@remotion/zod-types": "4.0.7",
|
|
69
|
+
"@remotion/tailwind": "4.0.7"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [
|
|
72
72
|
"remotion",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const cloudrunCommand: (remotionRoot: string, args: string[]) => Promise<never>;
|
package/dist/cloudrun-command.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cloudrunCommand = void 0;
|
|
4
|
-
const log_1 = require("./log");
|
|
5
|
-
const get_package_manager_1 = require("./preview-server/get-package-manager");
|
|
6
|
-
const update_available_1 = require("./preview-server/update-available");
|
|
7
|
-
const cloudrunCommand = async (remotionRoot, args) => {
|
|
8
|
-
try {
|
|
9
|
-
const path = require.resolve('@remotion/cloudrun', {
|
|
10
|
-
paths: [remotionRoot],
|
|
11
|
-
});
|
|
12
|
-
const { CloudrunInternals } = require(path);
|
|
13
|
-
await CloudrunInternals.executeCommand(args, remotionRoot);
|
|
14
|
-
process.exit(0);
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
|
|
18
|
-
const installCommand = manager === 'unknown' ? 'npm i' : manager.installCommand;
|
|
19
|
-
log_1.Log.error(err);
|
|
20
|
-
log_1.Log.error('Remotion CloudRun is not installed.');
|
|
21
|
-
log_1.Log.info('');
|
|
22
|
-
log_1.Log.info('You can install it using:');
|
|
23
|
-
log_1.Log.info(`${installCommand} @remotion/cloudrun@${(0, update_available_1.getRemotionVersion)()}`);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.cloudrunCommand = cloudrunCommand;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type SerializedJSONWithCustomFields = {
|
|
2
|
-
serializedString: string;
|
|
3
|
-
customDateUsed: boolean;
|
|
4
|
-
customFileUsed: boolean;
|
|
5
|
-
mapUsed: boolean;
|
|
6
|
-
setUsed: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const FILE_TOKEN = "remotion-file:";
|
|
9
|
-
export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
|
|
10
|
-
data: unknown;
|
|
11
|
-
indent: number | undefined;
|
|
12
|
-
staticBase: string;
|
|
13
|
-
}) => SerializedJSONWithCustomFields;
|
|
14
|
-
export declare const deserializeJSONWithCustomFields: (data: string) => any;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
|
|
4
|
-
const DATE_TOKEN = 'remotion-date:';
|
|
5
|
-
exports.FILE_TOKEN = 'remotion-file:';
|
|
6
|
-
const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
7
|
-
let customDateUsed = false;
|
|
8
|
-
let customFileUsed = false;
|
|
9
|
-
let mapUsed = false;
|
|
10
|
-
let setUsed = false;
|
|
11
|
-
const serializedString = JSON.stringify(data, function (key, value) {
|
|
12
|
-
const item = this[key];
|
|
13
|
-
if (item instanceof Date) {
|
|
14
|
-
customDateUsed = true;
|
|
15
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
16
|
-
}
|
|
17
|
-
if (item instanceof Map) {
|
|
18
|
-
mapUsed = true;
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
if (item instanceof Set) {
|
|
22
|
-
setUsed = true;
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
if (typeof item === 'string' && item.startsWith(staticBase)) {
|
|
26
|
-
customFileUsed = true;
|
|
27
|
-
return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
|
|
28
|
-
}
|
|
29
|
-
return value;
|
|
30
|
-
}, indent);
|
|
31
|
-
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
32
|
-
};
|
|
33
|
-
exports.serializeJSONWithDate = serializeJSONWithDate;
|
|
34
|
-
const deserializeJSONWithCustomFields = (data) => {
|
|
35
|
-
return JSON.parse(data, (_, value) => {
|
|
36
|
-
if (typeof value === 'string' && value.startsWith(DATE_TOKEN)) {
|
|
37
|
-
return new Date(value.replace(DATE_TOKEN, ''));
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
exports.deserializeJSONWithCustomFields = deserializeJSONWithCustomFields;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Page, SymbolicatedStackFrame } from '@remotion/renderer';
|
|
2
|
-
export declare class ErrorWithStackFrame extends Error {
|
|
3
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
4
|
-
frame: number | null;
|
|
5
|
-
name: string;
|
|
6
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
7
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }: {
|
|
8
|
-
message: string;
|
|
9
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
10
|
-
frame: number | null;
|
|
11
|
-
name: string;
|
|
12
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export declare const handleJavascriptException: ({ page, onError, frame, }: {
|
|
16
|
-
page: Page;
|
|
17
|
-
frame: number | null;
|
|
18
|
-
onError: (err: Error) => void;
|
|
19
|
-
}) => () => void;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleJavascriptException = exports.ErrorWithStackFrame = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const log_1 = require("./log");
|
|
7
|
-
class ErrorWithStackFrame extends Error {
|
|
8
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.symbolicatedStackFrames = symbolicatedStackFrames;
|
|
11
|
-
this.frame = frame;
|
|
12
|
-
this.name = name;
|
|
13
|
-
this.delayRenderCall = delayRenderCall;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.ErrorWithStackFrame = ErrorWithStackFrame;
|
|
17
|
-
const cleanUpErrorMessage = (exception) => {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
|
-
let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
20
|
-
if (!errorMessage) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
24
|
-
const prefix = `${errorType}: `;
|
|
25
|
-
if (errorMessage.startsWith(prefix)) {
|
|
26
|
-
errorMessage = errorMessage.substring(prefix.length);
|
|
27
|
-
}
|
|
28
|
-
const frames = (_d = (_c = exception.exceptionDetails.stackTrace) === null || _c === void 0 ? void 0 : _c.callFrames.length) !== null && _d !== void 0 ? _d : 0;
|
|
29
|
-
const split = errorMessage.split('\n');
|
|
30
|
-
return split.slice(0, Math.max(1, split.length - frames)).join('\n');
|
|
31
|
-
};
|
|
32
|
-
const removeDelayRenderStack = (message) => {
|
|
33
|
-
const index = message.indexOf(remotion_1.Internals.DELAY_RENDER_CALLSTACK_TOKEN);
|
|
34
|
-
if (index === -1) {
|
|
35
|
-
return message;
|
|
36
|
-
}
|
|
37
|
-
return message.substring(0, index);
|
|
38
|
-
};
|
|
39
|
-
const callFrameToStackFrame = (callFrame) => {
|
|
40
|
-
return {
|
|
41
|
-
columnNumber: callFrame.columnNumber,
|
|
42
|
-
fileName: callFrame.url,
|
|
43
|
-
functionName: callFrame.functionName,
|
|
44
|
-
lineNumber: callFrame.lineNumber,
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
48
|
-
const client = page._client();
|
|
49
|
-
const handler = (exception) => {
|
|
50
|
-
var _a, _b, _c;
|
|
51
|
-
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
52
|
-
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
53
|
-
if (!cleanErrorMessage) {
|
|
54
|
-
log_1.Log.error(exception);
|
|
55
|
-
const err = new Error(rawErrorMessage);
|
|
56
|
-
err.stack = rawErrorMessage;
|
|
57
|
-
onError(err);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!exception.exceptionDetails.stackTrace) {
|
|
61
|
-
const err = new Error(removeDelayRenderStack(cleanErrorMessage));
|
|
62
|
-
err.stack = rawErrorMessage;
|
|
63
|
-
onError(err);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
67
|
-
const symbolicatedErr = new renderer_1.RenderInternals.SymbolicateableError({
|
|
68
|
-
message: removeDelayRenderStack(cleanErrorMessage),
|
|
69
|
-
stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
|
|
70
|
-
frame,
|
|
71
|
-
name: errorType,
|
|
72
|
-
stack: (_c = exception.exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
73
|
-
});
|
|
74
|
-
onError(symbolicatedErr);
|
|
75
|
-
};
|
|
76
|
-
client.on('Runtime.exceptionThrown', handler);
|
|
77
|
-
return () => {
|
|
78
|
-
client.off('Runtime.exceptionThrown', handler);
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
exports.handleJavascriptException = handleJavascriptException;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Page } from '../browser/BrowserPage';
|
|
2
|
-
import type { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
|
|
3
|
-
export declare class ErrorWithStackFrame extends Error {
|
|
4
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
5
|
-
frame: number | null;
|
|
6
|
-
name: string;
|
|
7
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
8
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }: {
|
|
9
|
-
message: string;
|
|
10
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
11
|
-
frame: number | null;
|
|
12
|
-
name: string;
|
|
13
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
export declare const handleJavascriptException: ({ page, onError, frame, }: {
|
|
17
|
-
page: Page;
|
|
18
|
-
frame: number | null;
|
|
19
|
-
onError: (err: Error) => void;
|
|
20
|
-
}) => () => void;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleJavascriptException = exports.ErrorWithStackFrame = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
|
-
const symbolicateable_error_1 = require("./symbolicateable-error");
|
|
6
|
-
const log_1 = require("./log");
|
|
7
|
-
class ErrorWithStackFrame extends Error {
|
|
8
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.symbolicatedStackFrames = symbolicatedStackFrames;
|
|
11
|
-
this.frame = frame;
|
|
12
|
-
this.name = name;
|
|
13
|
-
this.delayRenderCall = delayRenderCall;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.ErrorWithStackFrame = ErrorWithStackFrame;
|
|
17
|
-
const cleanUpErrorMessage = (exception) => {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
|
-
let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
20
|
-
if (!errorMessage) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
24
|
-
const prefix = `${errorType}: `;
|
|
25
|
-
if (errorMessage.startsWith(prefix)) {
|
|
26
|
-
errorMessage = errorMessage.substring(prefix.length);
|
|
27
|
-
}
|
|
28
|
-
const frames = (_d = (_c = exception.exceptionDetails.stackTrace) === null || _c === void 0 ? void 0 : _c.callFrames.length) !== null && _d !== void 0 ? _d : 0;
|
|
29
|
-
const split = errorMessage.split('\n');
|
|
30
|
-
return split.slice(0, Math.max(1, split.length - frames)).join('\n');
|
|
31
|
-
};
|
|
32
|
-
const removeDelayRenderStack = (message) => {
|
|
33
|
-
const index = message.indexOf(remotion_1.Internals.DELAY_RENDER_CALLSTACK_TOKEN);
|
|
34
|
-
if (index === -1) {
|
|
35
|
-
return message;
|
|
36
|
-
}
|
|
37
|
-
return message.substring(0, index);
|
|
38
|
-
};
|
|
39
|
-
const callFrameToStackFrame = (callFrame) => {
|
|
40
|
-
return {
|
|
41
|
-
columnNumber: callFrame.columnNumber,
|
|
42
|
-
fileName: callFrame.url,
|
|
43
|
-
functionName: callFrame.functionName,
|
|
44
|
-
lineNumber: callFrame.lineNumber,
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
48
|
-
const client = page._client();
|
|
49
|
-
const handler = (exception) => {
|
|
50
|
-
var _a, _b, _c;
|
|
51
|
-
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
52
|
-
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
53
|
-
if (!cleanErrorMessage) {
|
|
54
|
-
log_1.Log.error(exception);
|
|
55
|
-
const err = new Error(rawErrorMessage);
|
|
56
|
-
err.stack = rawErrorMessage;
|
|
57
|
-
onError(err);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!exception.exceptionDetails.stackTrace) {
|
|
61
|
-
const err = new Error(removeDelayRenderStack(cleanErrorMessage));
|
|
62
|
-
err.stack = rawErrorMessage;
|
|
63
|
-
onError(err);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
67
|
-
const symbolicatedErr = new symbolicateable_error_1.SymbolicateableError({
|
|
68
|
-
message: removeDelayRenderStack(cleanErrorMessage),
|
|
69
|
-
stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
|
|
70
|
-
frame,
|
|
71
|
-
name: errorType,
|
|
72
|
-
stack: (_c = exception.exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
73
|
-
});
|
|
74
|
-
onError(symbolicatedErr);
|
|
75
|
-
};
|
|
76
|
-
client.on('Runtime.exceptionThrown', handler);
|
|
77
|
-
return () => {
|
|
78
|
-
client.off('Runtime.exceptionThrown', handler);
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
exports.handleJavascriptException = handleJavascriptException;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.symbolicateError = void 0;
|
|
4
|
-
const symbolicate_stacktrace_1 = require("../symbolicate-stacktrace");
|
|
5
|
-
const handle_javascript_exception_1 = require("./handle-javascript-exception");
|
|
6
|
-
const truthy_1 = require("./truthy");
|
|
7
|
-
const symbolicateError = async (symbolicateableError) => {
|
|
8
|
-
const { delayRenderCall, stackFrame } = symbolicateableError;
|
|
9
|
-
const [mainErrorFrames, delayRenderFrames] = await Promise.all([
|
|
10
|
-
stackFrame ? (0, symbolicate_stacktrace_1.symbolicateStackTraceFromRemoteFrames)(stackFrame) : null,
|
|
11
|
-
delayRenderCall
|
|
12
|
-
? (0, symbolicate_stacktrace_1.symbolicateStackTraceFromRemoteFrames)(delayRenderCall)
|
|
13
|
-
: null,
|
|
14
|
-
].filter(truthy_1.truthy));
|
|
15
|
-
const symbolicatedErr = new handle_javascript_exception_1.ErrorWithStackFrame({
|
|
16
|
-
message: symbolicateableError.message,
|
|
17
|
-
symbolicatedStackFrames: mainErrorFrames,
|
|
18
|
-
frame: symbolicateableError.frame,
|
|
19
|
-
name: symbolicateableError.name,
|
|
20
|
-
delayRenderCall: delayRenderFrames,
|
|
21
|
-
});
|
|
22
|
-
return symbolicatedErr;
|
|
23
|
-
};
|
|
24
|
-
exports.symbolicateError = symbolicateError;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SymbolicatedStackFrame, UnsymbolicatedStackFrame } from '@remotion/renderer';
|
|
2
|
-
import type { SourceMapConsumer } from 'source-map';
|
|
3
|
-
import { ErrorWithStackFrame } from './error-with-stack-frame';
|
|
4
|
-
export declare const symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<ErrorWithStackFrame>;
|
|
5
|
-
export declare const symbolicateStackTraceFromRemoteFrames: (frames: UnsymbolicatedStackFrame[]) => Promise<SymbolicatedStackFrame[]>;
|
|
6
|
-
export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<any>;
|
|
7
|
-
export declare const symbolicateFromSources: (frames: UnsymbolicatedStackFrame[], mapValues: Record<string, SourceMapConsumer | null>) => SymbolicatedStackFrame[];
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.symbolicateFromSources = exports.getSourceMapFromRemoteFile = exports.symbolicateStackTraceFromRemoteFrames = exports.symbolicateError = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const truthy_1 = require("./truthy");
|
|
6
|
-
const error_with_stack_frame_1 = require("./error-with-stack-frame");
|
|
7
|
-
const symbolicateError = async (symbolicateableError) => {
|
|
8
|
-
const { delayRenderCall, stackFrame } = symbolicateableError;
|
|
9
|
-
const [mainErrorFrames, delayRenderFrames] = await Promise.all([
|
|
10
|
-
stackFrame ? (0, exports.symbolicateStackTraceFromRemoteFrames)(stackFrame) : null,
|
|
11
|
-
delayRenderCall
|
|
12
|
-
? (0, exports.symbolicateStackTraceFromRemoteFrames)(delayRenderCall)
|
|
13
|
-
: null,
|
|
14
|
-
].filter(truthy_1.truthy));
|
|
15
|
-
const symbolicatedErr = new error_with_stack_frame_1.ErrorWithStackFrame({
|
|
16
|
-
message: symbolicateableError.message,
|
|
17
|
-
symbolicatedStackFrames: mainErrorFrames,
|
|
18
|
-
frame: symbolicateableError.frame,
|
|
19
|
-
name: symbolicateableError.name,
|
|
20
|
-
delayRenderCall: delayRenderFrames,
|
|
21
|
-
});
|
|
22
|
-
return symbolicatedErr;
|
|
23
|
-
};
|
|
24
|
-
exports.symbolicateError = symbolicateError;
|
|
25
|
-
const symbolicateStackTraceFromRemoteFrames = async (frames) => {
|
|
26
|
-
const uniqueFileNames = [
|
|
27
|
-
...new Set(frames
|
|
28
|
-
.map((f) => f.fileName)
|
|
29
|
-
.filter((f) => f.startsWith('http://') || f.startsWith('https://'))
|
|
30
|
-
.filter(truthy_1.truthy)),
|
|
31
|
-
];
|
|
32
|
-
const maps = await Promise.all(uniqueFileNames.map((fileName) => {
|
|
33
|
-
return (0, exports.getSourceMapFromRemoteFile)(fileName);
|
|
34
|
-
}));
|
|
35
|
-
const mapValues = {};
|
|
36
|
-
for (let i = 0; i < uniqueFileNames.length; i++) {
|
|
37
|
-
mapValues[uniqueFileNames[i]] = maps[i];
|
|
38
|
-
}
|
|
39
|
-
return (0, exports.symbolicateFromSources)(frames, mapValues);
|
|
40
|
-
};
|
|
41
|
-
exports.symbolicateStackTraceFromRemoteFrames = symbolicateStackTraceFromRemoteFrames;
|
|
42
|
-
const getSourceMapFromRemoteFile = async (fileName) => {
|
|
43
|
-
const fileContents = await renderer_1.RenderInternals.fetchUrl(fileName);
|
|
44
|
-
return renderer_1.RenderInternals.getSourceMap(fileName, fileContents, 'remote');
|
|
45
|
-
};
|
|
46
|
-
exports.getSourceMapFromRemoteFile = getSourceMapFromRemoteFile;
|
|
47
|
-
const symbolicateFromSources = (frames, mapValues) => {
|
|
48
|
-
return frames
|
|
49
|
-
.map((frame) => {
|
|
50
|
-
const map = mapValues[frame.fileName];
|
|
51
|
-
if (!map) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return symbolicateStackFrame(frame, map);
|
|
55
|
-
})
|
|
56
|
-
.filter(truthy_1.truthy);
|
|
57
|
-
};
|
|
58
|
-
exports.symbolicateFromSources = symbolicateFromSources;
|
|
59
|
-
const symbolicateStackFrame = (frame, map) => {
|
|
60
|
-
const pos = getOriginalPosition(map, frame.lineNumber, frame.columnNumber);
|
|
61
|
-
const hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
|
|
62
|
-
const scriptCode = hasSource && pos.line
|
|
63
|
-
? getLinesAround(pos.line, 3, hasSource.split('\n'))
|
|
64
|
-
: null;
|
|
65
|
-
return {
|
|
66
|
-
originalColumnNumber: pos.column,
|
|
67
|
-
originalFileName: pos.source,
|
|
68
|
-
originalFunctionName: frame.functionName,
|
|
69
|
-
originalLineNumber: pos.line,
|
|
70
|
-
originalScriptCode: scriptCode,
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
const getOriginalPosition = (source_map, line, column) => {
|
|
74
|
-
const result = source_map.originalPositionFor({
|
|
75
|
-
line,
|
|
76
|
-
column,
|
|
77
|
-
});
|
|
78
|
-
return { line: result.line, column: result.column, source: result.source };
|
|
79
|
-
};
|
|
80
|
-
function getLinesAround(line, count, lines) {
|
|
81
|
-
const result = [];
|
|
82
|
-
for (let index = Math.max(0, line - 1 - count) + 1; index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
83
|
-
result.push({
|
|
84
|
-
lineNumber: index + 1,
|
|
85
|
-
content: lines[index],
|
|
86
|
-
highlight: index + 1 === line,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return result;
|
|
90
|
-
}
|