@remotion/cli 4.1.0-alpha1 → 4.1.0-alpha10
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 +16 -7
- package/dist/chalk/index.d.ts +2 -1
- package/dist/codemods/stringify-with-path.js +24 -19
- package/dist/compositions.js +9 -4
- package/dist/config/index.d.ts +24 -0
- package/dist/config/index.js +19 -1
- package/dist/editor/components/AssetSelector.d.ts +2 -0
- package/dist/editor/components/AssetSelector.js +30 -0
- package/dist/editor/components/AssetSelectorItem.d.ts +6 -0
- package/dist/editor/components/AssetSelectorItem.js +109 -0
- package/dist/editor/components/Canvas.js +4 -4
- package/dist/editor/components/CanvasOrLoading.js +20 -1
- package/dist/editor/components/CopyButton.js +5 -2
- package/dist/editor/components/Editor.js +1 -3
- package/dist/editor/components/ExplorerPanel.d.ts +8 -0
- package/dist/editor/components/ExplorerPanel.js +67 -0
- package/dist/editor/components/FramePersistor.d.ts +0 -2
- package/dist/editor/components/FramePersistor.js +4 -24
- package/dist/editor/components/FullscreenToggle.d.ts +2 -0
- package/dist/editor/components/FullscreenToggle.js +25 -0
- package/dist/editor/components/GlobalKeybindings.js +1 -1
- package/dist/editor/components/InitialCompositionLoader.js +1 -22
- package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
- package/dist/editor/components/NewComposition/InputDragger.js +13 -1
- 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/OpenEditorButton.js +5 -2
- package/dist/editor/components/OptionsPanel.d.ts +8 -0
- package/dist/editor/components/OptionsPanel.js +79 -0
- package/dist/editor/components/PlayPause.js +4 -4
- package/dist/editor/components/PlaybackRateSelector.js +1 -1
- package/dist/editor/components/PreviewToolbar.js +3 -1
- package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
- package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -0
- package/dist/editor/components/RenderModal/DataEditor.js +13 -10
- package/dist/editor/components/RenderModal/FrameRangeSetting.js +9 -25
- package/dist/editor/components/RenderModal/MultiRangeSlider.d.ts +12 -0
- package/dist/editor/components/RenderModal/MultiRangeSlider.js +50 -0
- package/dist/editor/components/RenderModal/RenderModal.js +7 -3
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -2
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +10 -11
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +26 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -1
- 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/SchemaEditor/ZodSwitch.js +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
- package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
- package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
- package/dist/editor/components/RenderQueue/actions.js +12 -4
- package/dist/editor/components/RightPanel.js +45 -12
- package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
- package/dist/editor/components/SidebarRenderButton.js +3 -1
- package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
- package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
- package/dist/editor/components/TimelineInOutToggle.js +82 -67
- package/dist/editor/helpers/is-composition-still.d.ts +1 -1
- package/dist/editor/helpers/is-current-selected-still.js +5 -6
- package/dist/editor/helpers/use-menu-structure.js +25 -1
- package/dist/editor/icons/keys.js +1 -0
- package/dist/editor/state/canvas-ref.d.ts +2 -0
- package/dist/editor/state/canvas-ref.js +5 -0
- package/dist/editor/state/in-out.d.ts +3 -2
- package/dist/editor/state/in-out.js +22 -5
- package/dist/editor/state/marks.d.ts +3 -2
- package/dist/editor/state/marks.js +6 -6
- package/dist/error-with-stack-frame.d.ts +19 -0
- package/dist/error-with-stack-frame.js +81 -0
- package/dist/get-composition-id.d.ts +6 -6
- package/dist/get-composition-id.js +13 -6
- package/dist/get-composition-with-dimension-override.d.ts +6 -6
- package/dist/get-composition-with-dimension-override.js +3 -3
- package/dist/handle-common-errors.js +8 -0
- package/dist/handle-javascript-error.d.ts +20 -0
- package/dist/handle-javascript-error.js +81 -0
- package/dist/index.d.ts +13 -7
- package/dist/index.js +5 -2
- package/dist/log.d.ts +6 -1
- package/dist/parse-command-line.js +1 -1
- package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
- package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
- package/dist/preview-server/render-queue/job.d.ts +2 -2
- package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
- package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
- package/dist/preview-server/render-queue/process-still.js +1 -1
- package/dist/preview-server/render-queue/process-video.js +1 -1
- package/dist/preview-server/routes/add-render.js +2 -2
- package/dist/preview-server/routes/update-default-props.js +1 -2
- package/dist/print-compositions.d.ts +2 -2
- package/dist/print-error.js +6 -3
- package/dist/progress-bar.js +2 -5
- package/dist/render-flows/render.d.ts +2 -2
- package/dist/render-flows/render.js +31 -22
- package/dist/render-flows/still.d.ts +2 -2
- package/dist/render-flows/still.js +20 -14
- package/dist/render.js +6 -1
- package/dist/setup-cache.js +1 -1
- package/dist/still.js +6 -1
- package/dist/symbolicate-error.d.ts +3 -0
- package/dist/symbolicate-error.js +24 -0
- package/dist/symbolicate-errors.d.ts +7 -0
- package/dist/symbolicate-errors.js +90 -0
- package/dist/symbolicate-stacktrace.d.ts +28 -0
- package/dist/symbolicate-stacktrace.js +135 -0
- package/dist/symbolicateable-error.d.ts +16 -0
- package/dist/symbolicateable-error.js +18 -0
- package/package.json +11 -11
- package/styles/styles.css +53 -0
|
@@ -2,18 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
outFrame: null,
|
|
8
|
-
});
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
exports.TimelineInOutContext = (0, react_1.createContext)({});
|
|
9
7
|
exports.SetTimelineInOutContext = (0, react_1.createContext)({
|
|
10
8
|
setInAndOutFrames: () => {
|
|
11
9
|
throw new Error('default');
|
|
12
10
|
},
|
|
13
11
|
});
|
|
14
12
|
const useTimelineInOutFramePosition = () => {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
15
15
|
const state = (0, react_1.useContext)(exports.TimelineInOutContext);
|
|
16
|
-
|
|
16
|
+
if (!videoConfig) {
|
|
17
|
+
return { inFrame: null, outFrame: null };
|
|
18
|
+
}
|
|
19
|
+
const maxFrame = videoConfig.durationInFrames - 1;
|
|
20
|
+
const actualInFrame = (_b = (_a = state[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.inFrame) !== null && _b !== void 0 ? _b : null;
|
|
21
|
+
const actualOutFrame = (_d = (_c = state[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.outFrame) !== null && _d !== void 0 ? _d : null;
|
|
22
|
+
return {
|
|
23
|
+
inFrame: actualInFrame === null
|
|
24
|
+
? null
|
|
25
|
+
: actualInFrame >= maxFrame
|
|
26
|
+
? null
|
|
27
|
+
: actualInFrame,
|
|
28
|
+
outFrame: actualOutFrame === null
|
|
29
|
+
? null
|
|
30
|
+
: actualOutFrame >= maxFrame
|
|
31
|
+
? null
|
|
32
|
+
: actualOutFrame,
|
|
33
|
+
};
|
|
17
34
|
};
|
|
18
35
|
exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
|
|
19
36
|
const useTimelineSetInOutFramePosition = () => {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import type { TimelineInOutContextValue } from './in-out';
|
|
2
|
+
export declare const persistMarks: (marks: TimelineInOutContextValue) => void;
|
|
3
|
+
export declare const loadMarks: () => TimelineInOutContextValue;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadMarks = exports.persistMarks = void 0;
|
|
4
|
-
const localStorageKey = (
|
|
5
|
-
const persistMarks = (
|
|
6
|
-
localStorage.setItem(localStorageKey(
|
|
4
|
+
const localStorageKey = () => `remotion.editor.marksv2`;
|
|
5
|
+
const persistMarks = (marks) => {
|
|
6
|
+
localStorage.setItem(localStorageKey(), JSON.stringify(marks));
|
|
7
7
|
};
|
|
8
8
|
exports.persistMarks = persistMarks;
|
|
9
|
-
const loadMarks = (
|
|
10
|
-
const item = localStorage.getItem(localStorageKey(
|
|
9
|
+
const loadMarks = () => {
|
|
10
|
+
const item = localStorage.getItem(localStorageKey());
|
|
11
11
|
if (item === null) {
|
|
12
|
-
return
|
|
12
|
+
return {};
|
|
13
13
|
}
|
|
14
14
|
return JSON.parse(item);
|
|
15
15
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -0,0 +1,81 @@
|
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, RemotionServer } from '@remotion/renderer';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const getCompositionId: ({ args, compositionIdFromUi,
|
|
1
|
+
import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
|
|
2
|
+
import type { VideoConfig } from 'remotion';
|
|
3
|
+
export declare const getCompositionId: ({ args, compositionIdFromUi, serializedInputPropsWithCustomSchema, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, }: {
|
|
4
4
|
args: string[];
|
|
5
5
|
compositionIdFromUi: string | null;
|
|
6
|
-
|
|
6
|
+
serializedInputPropsWithCustomSchema: string;
|
|
7
7
|
puppeteerInstance: HeadlessBrowser | undefined;
|
|
8
8
|
envVariables: Record<string, string>;
|
|
9
9
|
timeoutInMilliseconds: number;
|
|
@@ -11,12 +11,12 @@ export declare const getCompositionId: ({ args, compositionIdFromUi, inputProps,
|
|
|
11
11
|
port: number | null;
|
|
12
12
|
browserExecutable: BrowserExecutable;
|
|
13
13
|
serveUrlOrWebpackUrl: string;
|
|
14
|
-
|
|
14
|
+
logLevel: LogLevel;
|
|
15
15
|
indent: boolean;
|
|
16
16
|
server: RemotionServer;
|
|
17
17
|
}) => Promise<{
|
|
18
18
|
compositionId: string;
|
|
19
19
|
reason: string;
|
|
20
|
-
config:
|
|
20
|
+
config: VideoConfig;
|
|
21
21
|
argsAfterComposition: string[];
|
|
22
22
|
}>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompositionId = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const format_bytes_1 = require("./format-bytes");
|
|
5
6
|
const log_1 = require("./log");
|
|
6
7
|
const show_compositions_picker_1 = require("./show-compositions-picker");
|
|
7
8
|
const getCompName = ({ cliArgs, compositionIdFromUi, }) => {
|
|
@@ -15,15 +16,15 @@ const getCompName = ({ cliArgs, compositionIdFromUi, }) => {
|
|
|
15
16
|
const [compName, ...remainingArgs] = cliArgs;
|
|
16
17
|
return { compName, remainingArgs, reason: 'Passed as argument' };
|
|
17
18
|
};
|
|
18
|
-
const getCompositionId = async ({ args, compositionIdFromUi,
|
|
19
|
+
const getCompositionId = async ({ args, compositionIdFromUi, serializedInputPropsWithCustomSchema, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, }) => {
|
|
19
20
|
const { compName, remainingArgs, reason: compReason, } = getCompName({
|
|
20
21
|
cliArgs: args,
|
|
21
22
|
compositionIdFromUi,
|
|
22
23
|
});
|
|
23
24
|
if (compName) {
|
|
24
|
-
const config = await renderer_1.RenderInternals.internalSelectComposition({
|
|
25
|
+
const { metadata: config, propsSize } = await renderer_1.RenderInternals.internalSelectComposition({
|
|
25
26
|
id: compName,
|
|
26
|
-
|
|
27
|
+
serializedInputPropsWithCustomSchema,
|
|
27
28
|
puppeteerInstance,
|
|
28
29
|
envVariables,
|
|
29
30
|
timeoutInMilliseconds,
|
|
@@ -31,11 +32,17 @@ const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppete
|
|
|
31
32
|
browserExecutable,
|
|
32
33
|
chromiumOptions,
|
|
33
34
|
port,
|
|
34
|
-
|
|
35
|
+
logLevel,
|
|
35
36
|
server,
|
|
36
37
|
indent,
|
|
37
38
|
onBrowserLog: null,
|
|
38
39
|
});
|
|
40
|
+
if (propsSize > 10000000) {
|
|
41
|
+
log_1.Log.warnAdvanced({
|
|
42
|
+
indent,
|
|
43
|
+
logLevel,
|
|
44
|
+
}, `The props of your composition are large (${(0, format_bytes_1.formatBytes)(propsSize)}). This may cause slowdown.`);
|
|
45
|
+
}
|
|
39
46
|
if (!config) {
|
|
40
47
|
throw new Error(`Cannot find composition with ID "${compName}"`);
|
|
41
48
|
}
|
|
@@ -48,18 +55,18 @@ const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppete
|
|
|
48
55
|
}
|
|
49
56
|
if (!process.env.CI) {
|
|
50
57
|
const comps = await renderer_1.RenderInternals.internalGetCompositions({
|
|
51
|
-
inputProps,
|
|
52
58
|
puppeteerInstance,
|
|
53
59
|
envVariables,
|
|
54
60
|
timeoutInMilliseconds,
|
|
55
61
|
chromiumOptions,
|
|
56
62
|
port,
|
|
57
63
|
browserExecutable,
|
|
58
|
-
|
|
64
|
+
logLevel,
|
|
59
65
|
indent,
|
|
60
66
|
server,
|
|
61
67
|
serveUrlOrWebpackUrl,
|
|
62
68
|
onBrowserLog: null,
|
|
69
|
+
serializedInputPropsWithCustomSchema,
|
|
63
70
|
});
|
|
64
71
|
const { compositionId, reason } = await (0, show_compositions_picker_1.showSingleCompositionsPicker)(comps);
|
|
65
72
|
if (compositionId && typeof compositionId === 'string') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, RemotionServer } from '@remotion/renderer';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent,
|
|
1
|
+
import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
|
|
2
|
+
import type { VideoConfig } from 'remotion';
|
|
3
|
+
export declare const getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, }: {
|
|
4
4
|
height: number | null;
|
|
5
5
|
width: number | null;
|
|
6
6
|
args: string[];
|
|
@@ -13,12 +13,12 @@ export declare const getCompositionWithDimensionOverride: ({ height, width, args
|
|
|
13
13
|
browserExecutable: BrowserExecutable | null;
|
|
14
14
|
serveUrlOrWebpackUrl: string;
|
|
15
15
|
indent: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
logLevel: LogLevel;
|
|
17
|
+
serializedInputPropsWithCustomSchema: string;
|
|
18
18
|
server: RemotionServer;
|
|
19
19
|
}) => Promise<{
|
|
20
20
|
compositionId: string;
|
|
21
21
|
reason: string;
|
|
22
|
-
config:
|
|
22
|
+
config: VideoConfig;
|
|
23
23
|
argsAfterComposition: string[];
|
|
24
24
|
}>;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompositionWithDimensionOverride = void 0;
|
|
4
4
|
const get_composition_id_1 = require("./get-composition-id");
|
|
5
|
-
const getCompositionWithDimensionOverride = async ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent,
|
|
5
|
+
const getCompositionWithDimensionOverride = async ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, }) => {
|
|
6
6
|
const returnValue = await (0, get_composition_id_1.getCompositionId)({
|
|
7
7
|
args,
|
|
8
8
|
compositionIdFromUi,
|
|
9
9
|
indent,
|
|
10
10
|
serveUrlOrWebpackUrl,
|
|
11
|
-
|
|
11
|
+
logLevel,
|
|
12
12
|
browserExecutable,
|
|
13
13
|
chromiumOptions,
|
|
14
14
|
envVariables,
|
|
15
|
-
|
|
15
|
+
serializedInputPropsWithCustomSchema,
|
|
16
16
|
port,
|
|
17
17
|
puppeteerInstance,
|
|
18
18
|
timeoutInMilliseconds,
|
|
@@ -48,5 +48,13 @@ const handleCommonError = async (err, logLevel) => {
|
|
|
48
48
|
log_1.Log.info(' Oftentimes, this happens if the component is missing the `export` keyword');
|
|
49
49
|
log_1.Log.info(' or if the component was renamed and the import statement not properly adjusted.');
|
|
50
50
|
}
|
|
51
|
+
if (err.message.includes('GLIBC_')) {
|
|
52
|
+
log_1.Log.info('💡 Remotion requires at least Libc 2.35.');
|
|
53
|
+
log_1.Log.info('💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
|
|
54
|
+
}
|
|
55
|
+
if (err.message.includes('EBADF')) {
|
|
56
|
+
log_1.Log.info('💡 This error might be fixed by changing your Node version:');
|
|
57
|
+
log_1.Log.info(' https://github.com/remotion-dev/remotion/issues/2452');
|
|
58
|
+
}
|
|
51
59
|
};
|
|
52
60
|
exports.handleCommonError = handleCommonError;
|
|
@@ -0,0 +1,20 @@
|
|
|
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;
|
|
@@ -0,0 +1,81 @@
|
|
|
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;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const CliInternals: {
|
|
|
9
9
|
indent: boolean;
|
|
10
10
|
}) => import("./progress-bar").OverwriteableCliOutput;
|
|
11
11
|
chalk: {
|
|
12
|
-
enabled: boolean;
|
|
12
|
+
enabled: () => boolean;
|
|
13
13
|
visible: boolean;
|
|
14
14
|
styles: Record<string, {
|
|
15
15
|
codes: [number, number];
|
|
@@ -33,6 +33,7 @@ export declare const CliInternals: {
|
|
|
33
33
|
yellow: (str: string) => string;
|
|
34
34
|
blue: (str: string) => string;
|
|
35
35
|
magenta: (str: string) => string;
|
|
36
|
+
cyan: (str: string) => string;
|
|
36
37
|
white: (str: string) => string;
|
|
37
38
|
gray: (str: string) => string;
|
|
38
39
|
bgBlack: (str: string) => string;
|
|
@@ -65,7 +66,6 @@ export declare const CliInternals: {
|
|
|
65
66
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
66
67
|
} & {
|
|
67
68
|
tag?: string | undefined;
|
|
68
|
-
secondTag?: string | undefined;
|
|
69
69
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
70
70
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
71
71
|
infoAdvanced: (options: {
|
|
@@ -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;
|
|
@@ -202,7 +208,7 @@ export declare const CliInternals: {
|
|
|
202
208
|
codec: import("@remotion/renderer").CodecOrUndefined;
|
|
203
209
|
uiImageFormat: "png" | "jpeg" | "none" | null;
|
|
204
210
|
}) => "png" | "jpeg" | "none";
|
|
205
|
-
printCompositions: (compositions: import("remotion").
|
|
211
|
+
printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
|
|
206
212
|
getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
|
|
207
213
|
cliFlag: import("@remotion/renderer").CodecOrUndefined;
|
|
208
214
|
outName: string | null;
|
|
@@ -217,7 +223,7 @@ export declare const CliInternals: {
|
|
|
217
223
|
shouldUseNonOverlayingLogger: ({ logLevel, }: {
|
|
218
224
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
219
225
|
}) => boolean;
|
|
220
|
-
getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent,
|
|
226
|
+
getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, }: {
|
|
221
227
|
height: number | null;
|
|
222
228
|
width: number | null;
|
|
223
229
|
args: string[];
|
|
@@ -230,13 +236,13 @@ export declare const CliInternals: {
|
|
|
230
236
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
231
237
|
serveUrlOrWebpackUrl: string;
|
|
232
238
|
indent: boolean;
|
|
233
|
-
|
|
234
|
-
|
|
239
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
240
|
+
serializedInputPropsWithCustomSchema: string;
|
|
235
241
|
server: import("@remotion/renderer").RemotionServer;
|
|
236
242
|
}) => Promise<{
|
|
237
243
|
compositionId: string;
|
|
238
244
|
reason: string;
|
|
239
|
-
config: import("remotion").
|
|
245
|
+
config: import("remotion").VideoConfig;
|
|
240
246
|
argsAfterComposition: string[];
|
|
241
247
|
}>;
|
|
242
248
|
};
|
package/dist/index.js
CHANGED
|
@@ -62,14 +62,17 @@ const cli = async () => {
|
|
|
62
62
|
if (command !== versions_1.VERSIONS_COMMAND) {
|
|
63
63
|
await (0, versions_1.validateVersionsBeforeCommand)(remotionRoot);
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const isStudio = command === 'studio' || command === 'preview';
|
|
66
|
+
const errorSymbolicationLock = isStudio
|
|
67
|
+
? 0
|
|
68
|
+
: renderer_1.RenderInternals.registerErrorSymbolicationLock();
|
|
66
69
|
(0, cleanup_before_quit_1.handleCtrlC)();
|
|
67
70
|
await (0, initialize_cli_1.initializeCli)(remotionRoot);
|
|
68
71
|
try {
|
|
69
72
|
if (command === 'compositions') {
|
|
70
73
|
await (0, compositions_1.listCompositionsCommand)(remotionRoot, args);
|
|
71
74
|
}
|
|
72
|
-
else if (
|
|
75
|
+
else if (isStudio) {
|
|
73
76
|
await (0, studio_1.studioCommand)(remotionRoot, args);
|
|
74
77
|
}
|
|
75
78
|
else if (command === 'lambda') {
|
package/dist/log.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare const Log: {
|
|
|
5
5
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
6
6
|
} & {
|
|
7
7
|
tag?: string | undefined;
|
|
8
|
-
secondTag?: string | undefined;
|
|
9
8
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
10
9
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
11
10
|
infoAdvanced: (options: {
|
|
@@ -18,4 +17,10 @@ export declare const Log: {
|
|
|
18
17
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
19
18
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
20
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;
|
|
21
26
|
};
|
|
@@ -88,7 +88,7 @@ const parseCommandLine = () => {
|
|
|
88
88
|
config_1.ConfigInternals.setStillFrame(Number(exports.parsedCli.frame));
|
|
89
89
|
}
|
|
90
90
|
if (exports.parsedCli.png) {
|
|
91
|
-
throw new Error('The --png flag has been
|
|
91
|
+
throw new Error('The --png flag has been removed. Use --sequence --image-format=png from now on.');
|
|
92
92
|
}
|
|
93
93
|
if (exports.parsedCli.sequence) {
|
|
94
94
|
config_1.Config.setImageSequence(true);
|
|
@@ -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 | -2 | Ranges;
|
|
15
15
|
export {};
|
|
@@ -23,7 +23,7 @@ function setupHooks(context) {
|
|
|
23
23
|
logger.log('Compilation finished');
|
|
24
24
|
const statsOptions = {
|
|
25
25
|
preset: 'errors-warnings',
|
|
26
|
-
colors: renderer_1.RenderInternals.isColorSupported,
|
|
26
|
+
colors: renderer_1.RenderInternals.isColorSupported(),
|
|
27
27
|
};
|
|
28
28
|
const printedStats = stats.toString(statsOptions);
|
|
29
29
|
const lines = printedStats
|
|
@@ -61,7 +61,7 @@ export type RenderJob = {
|
|
|
61
61
|
cancelToken: ReturnType<typeof makeCancelSignal>;
|
|
62
62
|
chromiumOptions: RequiredChromiumOptions;
|
|
63
63
|
envVariables: Record<string, string>;
|
|
64
|
-
|
|
64
|
+
serializedInputPropsWithCustomSchema: string;
|
|
65
65
|
} & RenderJobDynamicFields;
|
|
66
66
|
export type RenderJobWithCleanup = RenderJob & {
|
|
67
67
|
cleanup: (() => void)[];
|
|
@@ -105,7 +105,7 @@ export type AddRenderRequest = {
|
|
|
105
105
|
chromiumOptions: RequiredChromiumOptions;
|
|
106
106
|
delayRenderTimeout: number;
|
|
107
107
|
envVariables: Record<string, string>;
|
|
108
|
-
|
|
108
|
+
serializedInputPropsWithCustomSchema: string;
|
|
109
109
|
} & AddRenderRequestDynamicFields;
|
|
110
110
|
export type RemoveRenderRequest = {
|
|
111
111
|
jobId: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeRetryPayload = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
4
5
|
const get_default_video_contexts_1 = require("./get-default-video-contexts");
|
|
5
6
|
const makeRetryPayload = (job) => {
|
|
6
7
|
var _a, _b, _c;
|
|
@@ -44,7 +45,7 @@ const makeRetryPayload = (job) => {
|
|
|
44
45
|
initialOpenGlRenderer: job.chromiumOptions.gl,
|
|
45
46
|
initialHeadless: job.chromiumOptions.headless,
|
|
46
47
|
initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
|
|
47
|
-
defaultProps: job.
|
|
48
|
+
defaultProps: remotion_1.Internals.deserializeJSONWithCustomFields(job.serializedInputPropsWithCustomSchema),
|
|
48
49
|
inFrameMark: null,
|
|
49
50
|
outFrameMark: null,
|
|
50
51
|
};
|
|
@@ -85,7 +86,7 @@ const makeRetryPayload = (job) => {
|
|
|
85
86
|
initialOpenGlRenderer: job.chromiumOptions.gl,
|
|
86
87
|
initialHeadless: job.chromiumOptions.headless,
|
|
87
88
|
initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
|
|
88
|
-
defaultProps: job.
|
|
89
|
+
defaultProps: remotion_1.Internals.deserializeJSONWithCustomFields(job.serializedInputPropsWithCustomSchema),
|
|
89
90
|
inFrameMark: job.startFrame,
|
|
90
91
|
outFrameMark: job.endFrame,
|
|
91
92
|
};
|
|
@@ -14,11 +14,17 @@ const openDirectoryInFinder = (dirToOpen, allowedDirectory) => {
|
|
|
14
14
|
if (relativeToProcessCwd.startsWith('..')) {
|
|
15
15
|
throw new Error(`Not allowed to open ${relativeToProcessCwd}`);
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
if ((0, node_os_1.platform)() === 'win32') {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
(0, node_child_process_1.exec)(`start ${dirToOpen}`, (error) => {
|
|
20
|
+
if (error) {
|
|
21
|
+
reject(error);
|
|
22
|
+
}
|
|
23
|
+
resolve();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const command = (0, node_os_1.platform)() === 'darwin' ? 'open' : 'xdg-open';
|
|
22
28
|
const p = (0, node_child_process_1.spawn)(command, [(0, node_os_1.platform)() === 'darwin' ? '-R' : null, dirToOpen].filter(truthy_1.truthy));
|
|
23
29
|
const stderrChunks = [];
|
|
24
30
|
p.stderr.on('data', (d) => stderrChunks.push(d));
|