@remotion/cli 3.2.16 → 3.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/config/bundle-out-dir.d.ts +1 -1
- package/dist/config/bundle-out-dir.js +3 -3
- package/dist/editor/components/Button.d.ts +0 -0
- package/dist/editor/components/Button.js +0 -0
- package/dist/editor/components/PreviewZoomControls.d.ts +0 -0
- package/dist/editor/components/PreviewZoomControls.js +14 -32
- package/dist/editor/components/ResetZoomButton.d.ts +0 -0
- package/dist/editor/components/ResetZoomButton.js +0 -0
- package/dist/editor/helpers/get-effective-translation.d.ts +0 -0
- package/dist/editor/helpers/get-effective-translation.js +0 -0
- package/dist/editor/helpers/normalize-wheel.d.ts +0 -0
- package/dist/editor/helpers/normalize-wheel.js +0 -0
- package/dist/get-cli-options.d.ts +1 -1
- package/dist/get-cli-options.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/render.js +4 -4
- package/dist/setup-cache.js +12 -8
- package/dist/smooth-zoom.d.ts +0 -0
- package/dist/smooth-zoom.js +0 -0
- package/dist/webpack-cache.d.ts +12 -0
- package/dist/webpack-cache.js +66 -0
- package/package.json +7 -7
- package/web/favicon.png +0 -0
- package/dist/editor/helpers/normalize-zoom.d.ts +0 -1
- package/dist/editor/helpers/normalize-zoom.js +0 -16
package/dist/bundle.js
CHANGED
|
@@ -11,7 +11,7 @@ const bundleCommand = async (remotionRoot) => {
|
|
|
11
11
|
if (!file) {
|
|
12
12
|
log_1.Log.error('No entry point specified. Pass more arguments:');
|
|
13
13
|
log_1.Log.error(' npx remotion bundle [entry-point]');
|
|
14
|
-
log_1.Log.error('Documentation: https://www.remotion.dev/docs/
|
|
14
|
+
log_1.Log.error('Documentation: https://www.remotion.dev/docs/cli/bundle');
|
|
15
15
|
process.exit(1);
|
|
16
16
|
}
|
|
17
17
|
await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'bundle');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const getBundleOutDir: () => string | null;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const setBundleDir: (path: string) => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setBundleDir = exports.getBundleOutDir = void 0;
|
|
4
4
|
let bundleOutDir = null;
|
|
5
5
|
const getBundleOutDir = () => {
|
|
6
6
|
return bundleOutDir;
|
|
7
7
|
};
|
|
8
8
|
exports.getBundleOutDir = getBundleOutDir;
|
|
9
|
-
const
|
|
9
|
+
const setBundleDir = (path) => {
|
|
10
10
|
bundleOutDir = path;
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.setBundleDir = setBundleDir;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -20,48 +20,30 @@ const iconStyle = {
|
|
|
20
20
|
color: 'white',
|
|
21
21
|
width: 14,
|
|
22
22
|
};
|
|
23
|
-
const slider = {
|
|
24
|
-
width: 120,
|
|
25
|
-
accentColor: 'var(--blue)',
|
|
26
|
-
};
|
|
27
23
|
const PreviewZoomControls = () => {
|
|
28
24
|
const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
29
25
|
const onZoomOutClicked = (0, react_1.useCallback)(() => {
|
|
30
26
|
setSize((z) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return Math.max(preview_size_1.PREVIEW_MIN_ZOOM, newSize);
|
|
27
|
+
// TODO: Don't assume 1
|
|
28
|
+
const newSize = Number((z.size === 'auto' ? 1 : z.size - preview_size_1.ZOOM_BUTTON_STEP).toFixed(2));
|
|
29
|
+
return { ...z, size: Math.max(preview_size_1.PREVIEW_MIN_ZOOM, newSize) };
|
|
35
30
|
});
|
|
36
31
|
}, [setSize]);
|
|
37
32
|
const onZoomInClicked = (0, react_1.useCallback)(() => {
|
|
38
33
|
setSize((z) => {
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
// TODO: Don't assume 1
|
|
35
|
+
if (z.size === 'auto')
|
|
36
|
+
return {
|
|
37
|
+
size: 1 + preview_size_1.ZOOM_BUTTON_STEP,
|
|
38
|
+
translation: {
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
41
43
|
const newSize = Number((Number(z) + preview_size_1.ZOOM_BUTTON_STEP).toFixed(2));
|
|
42
|
-
return Math.min(preview_size_1.PREVIEW_MAX_ZOOM, newSize);
|
|
43
|
-
});
|
|
44
|
-
}, [setSize]);
|
|
45
|
-
const onChange = (0, react_1.useCallback)((e) => {
|
|
46
|
-
setSize(() => Number(e.target.value));
|
|
47
|
-
}, [setSize]);
|
|
48
|
-
const onWheel = (0, react_1.useCallback)((e) => {
|
|
49
|
-
setSize((z) => {
|
|
50
|
-
if (e.deltaY > 0) {
|
|
51
|
-
if (z === 'auto')
|
|
52
|
-
return 1 - preview_size_1.ZOOM_SLIDER_STEP;
|
|
53
|
-
const newSize = Number((Number(z) - preview_size_1.ZOOM_SLIDER_STEP).toFixed(2));
|
|
54
|
-
return Math.max(preview_size_1.PREVIEW_MIN_ZOOM, newSize);
|
|
55
|
-
}
|
|
56
|
-
if (e.deltaY < 0) {
|
|
57
|
-
if (z === 'auto')
|
|
58
|
-
return 1 + preview_size_1.ZOOM_SLIDER_STEP;
|
|
59
|
-
const newSize = Number((Number(z) + preview_size_1.ZOOM_SLIDER_STEP).toFixed(2));
|
|
60
|
-
return Math.min(preview_size_1.PREVIEW_MAX_ZOOM, newSize);
|
|
61
|
-
}
|
|
62
|
-
return z;
|
|
44
|
+
return { ...z, size: Math.min(preview_size_1.PREVIEW_MAX_ZOOM, newSize) };
|
|
63
45
|
});
|
|
64
46
|
}, [setSize]);
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onZoomOutClicked, style: buttonStyle, title: "Zoom out preview", role: 'ControlButton', type: "button", disabled: preview_size_1.PREVIEW_MIN_ZOOM === size, children: (0, jsx_runtime_1.jsx)(minus_1.Minus, { style: iconStyle }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onZoomOutClicked, style: buttonStyle, title: "Zoom out preview", role: 'ControlButton', type: "button", disabled: size.size !== 'auto' && preview_size_1.PREVIEW_MIN_ZOOM === size.size, children: (0, jsx_runtime_1.jsx)(minus_1.Minus, { style: iconStyle }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onZoomInClicked, style: buttonStyle, title: "Zoom in preview", role: 'button', type: "button", disabled: size.size !== 'auto' && preview_size_1.PREVIEW_MAX_ZOOM === size.size, children: (0, jsx_runtime_1.jsx)(plus_1.Plus, { style: iconStyle }) })] }));
|
|
66
48
|
};
|
|
67
49
|
exports.PreviewZoomControls = PreviewZoomControls;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ export declare const getCliOptions: (options: {
|
|
|
5
5
|
type: 'still' | 'series' | 'get-compositions';
|
|
6
6
|
}) => Promise<{
|
|
7
7
|
puppeteerTimeout: number;
|
|
8
|
-
|
|
8
|
+
concurrency: number | null;
|
|
9
9
|
frameRange: FrameRange | null;
|
|
10
10
|
shouldOutputImageSequence: boolean;
|
|
11
11
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
package/dist/get-cli-options.js
CHANGED
|
@@ -152,11 +152,11 @@ const getCliOptions = async (options) => {
|
|
|
152
152
|
};
|
|
153
153
|
const everyNthFrame = config_1.ConfigInternals.getAndValidateEveryNthFrame(codec);
|
|
154
154
|
const numberOfGifLoops = config_1.ConfigInternals.getAndValidateNumberOfGifLoops(codec);
|
|
155
|
-
const
|
|
156
|
-
renderer_1.RenderInternals.validateConcurrency(
|
|
155
|
+
const concurrency = config_1.ConfigInternals.getConcurrency();
|
|
156
|
+
renderer_1.RenderInternals.validateConcurrency(concurrency, 'concurrency');
|
|
157
157
|
return {
|
|
158
158
|
puppeteerTimeout: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
|
|
159
|
-
|
|
159
|
+
concurrency,
|
|
160
160
|
frameRange,
|
|
161
161
|
shouldOutputImageSequence,
|
|
162
162
|
codec,
|
package/dist/index.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare const CliInternals: {
|
|
|
72
72
|
type: "still" | "series" | "get-compositions";
|
|
73
73
|
}) => Promise<{
|
|
74
74
|
puppeteerTimeout: number;
|
|
75
|
-
|
|
75
|
+
concurrency: number | null;
|
|
76
76
|
frameRange: import("@remotion/renderer").FrameRange | null;
|
|
77
77
|
shouldOutputImageSequence: boolean;
|
|
78
78
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
package/dist/render.js
CHANGED
|
@@ -36,7 +36,7 @@ const render = async (remotionRoot) => {
|
|
|
36
36
|
const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
|
|
37
37
|
await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'sequence');
|
|
38
38
|
log_1.Log.verbose('Asset dirs', downloadMap.assetDir);
|
|
39
|
-
const { codec, proResProfile,
|
|
39
|
+
const { codec, proResProfile, concurrency, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, quality, browser, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, puppeteerTimeout, muted, enforceAudioTrack, publicDir, } = await (0, get_cli_options_1.getCliOptions)({
|
|
40
40
|
isLambda: false,
|
|
41
41
|
type: 'series',
|
|
42
42
|
});
|
|
@@ -129,7 +129,7 @@ const render = async (remotionRoot) => {
|
|
|
129
129
|
rendering: {
|
|
130
130
|
frames: renderedFrames,
|
|
131
131
|
totalFrames: totalFrames.length,
|
|
132
|
-
concurrency: renderer_1.RenderInternals.getActualConcurrency(
|
|
132
|
+
concurrency: renderer_1.RenderInternals.getActualConcurrency(concurrency),
|
|
133
133
|
doneIn: renderedDoneIn,
|
|
134
134
|
steps,
|
|
135
135
|
},
|
|
@@ -178,7 +178,7 @@ const render = async (remotionRoot) => {
|
|
|
178
178
|
everyNthFrame,
|
|
179
179
|
envVariables,
|
|
180
180
|
frameRange,
|
|
181
|
-
|
|
181
|
+
concurrency,
|
|
182
182
|
puppeteerInstance,
|
|
183
183
|
quality,
|
|
184
184
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
@@ -218,7 +218,7 @@ const render = async (remotionRoot) => {
|
|
|
218
218
|
},
|
|
219
219
|
puppeteerInstance,
|
|
220
220
|
overwrite,
|
|
221
|
-
|
|
221
|
+
concurrency,
|
|
222
222
|
pixelFormat,
|
|
223
223
|
proResProfile,
|
|
224
224
|
quality,
|
package/dist/setup-cache.js
CHANGED
|
@@ -40,7 +40,7 @@ const bundleOnCli = async ({ fullPath, steps, remotionRoot, publicDir, }) => {
|
|
|
40
40
|
const [hash] = bundler_1.BundlerInternals.getConfig({
|
|
41
41
|
outDir: '',
|
|
42
42
|
entryPoint: fullPath,
|
|
43
|
-
|
|
43
|
+
onProgress,
|
|
44
44
|
options,
|
|
45
45
|
resolvedRemotionRoot: remotionRoot,
|
|
46
46
|
});
|
|
@@ -55,13 +55,17 @@ const bundleOnCli = async ({ fullPath, steps, remotionRoot, publicDir, }) => {
|
|
|
55
55
|
}
|
|
56
56
|
const bundleStartTime = Date.now();
|
|
57
57
|
const bundlingProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
|
|
58
|
-
const bundled = await (0, bundler_1.bundle)(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
const bundled = await (0, bundler_1.bundle)({
|
|
59
|
+
entryPoint: fullPath,
|
|
60
|
+
onProgress: (progress) => {
|
|
61
|
+
bundlingProgress.update((0, progress_bar_1.makeBundlingProgress)({
|
|
62
|
+
progress: progress / 100,
|
|
63
|
+
steps,
|
|
64
|
+
doneIn: null,
|
|
65
|
+
}));
|
|
66
|
+
},
|
|
67
|
+
...options,
|
|
68
|
+
});
|
|
65
69
|
bundlingProgress.update((0, progress_bar_1.makeBundlingProgress)({
|
|
66
70
|
progress: 1,
|
|
67
71
|
steps,
|
package/dist/smooth-zoom.d.ts
CHANGED
|
File without changes
|
package/dist/smooth-zoom.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare type Environment = 'development' | 'production';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace NodeJS {
|
|
4
|
+
interface ProcessVersions {
|
|
5
|
+
pnp?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const clearCache: (environment: Environment, inputProps: object | null) => Promise<void>;
|
|
10
|
+
export declare const getWebpackCacheName: (environment: Environment, inputProps: object | null) => string;
|
|
11
|
+
export declare const cacheExists: (environment: Environment, inputProps: object | null) => boolean;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cacheExists = exports.getWebpackCacheName = exports.clearCache = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const remotion_1 = require("remotion");
|
|
10
|
+
// Inlined from https://github.com/webpack/webpack/blob/4c2ee7a4ddb8db2362ca83b6c4190523387ba7ee/lib/config/defaults.js#L265
|
|
11
|
+
// An algorithm to determine where Webpack will cache the depencies
|
|
12
|
+
const getWebpackCacheDir = () => {
|
|
13
|
+
const cwd = process.cwd();
|
|
14
|
+
let dir = cwd;
|
|
15
|
+
for (;;) {
|
|
16
|
+
try {
|
|
17
|
+
if (fs_1.default.statSync(path_1.default.join(dir, 'package.json')).isFile()) {
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
// eslint-disable-next-line no-empty
|
|
21
|
+
}
|
|
22
|
+
catch (e) { }
|
|
23
|
+
const parent = path_1.default.dirname(dir);
|
|
24
|
+
if (dir === parent) {
|
|
25
|
+
dir = undefined;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
dir = parent;
|
|
29
|
+
}
|
|
30
|
+
if (!dir) {
|
|
31
|
+
return path_1.default.resolve(cwd, '.cache/webpack');
|
|
32
|
+
}
|
|
33
|
+
if (process.versions.pnp === '1') {
|
|
34
|
+
return path_1.default.resolve(dir, '.pnp/.cache/webpack');
|
|
35
|
+
}
|
|
36
|
+
if (process.versions.pnp === '3') {
|
|
37
|
+
return path_1.default.resolve(dir, '.yarn/.cache/webpack');
|
|
38
|
+
}
|
|
39
|
+
return path_1.default.resolve(dir, 'node_modules/.cache/webpack');
|
|
40
|
+
};
|
|
41
|
+
const remotionCacheLocation = (environment, inputProps) => {
|
|
42
|
+
return path_1.default.join(getWebpackCacheDir(), (0, exports.getWebpackCacheName)(environment, inputProps));
|
|
43
|
+
};
|
|
44
|
+
const clearCache = (environment, inputProps) => {
|
|
45
|
+
var _a;
|
|
46
|
+
return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(environment, inputProps), {
|
|
47
|
+
recursive: true,
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.clearCache = clearCache;
|
|
51
|
+
const getWebpackCacheName = (environment, inputProps) => {
|
|
52
|
+
// In development, let's reset the cache when input props
|
|
53
|
+
// are changing, because they are injected using Webpack and if changed,
|
|
54
|
+
// it will get the cached version
|
|
55
|
+
if (environment === 'development') {
|
|
56
|
+
return `remotion-v3-${environment}-${(0, remotion_1.random)(JSON.stringify(inputProps))}`;
|
|
57
|
+
}
|
|
58
|
+
// In production, the cache is independent from input props because
|
|
59
|
+
// they are passed over URL params. Speed is mostly important in production.
|
|
60
|
+
return `remotion-v3-${environment}`;
|
|
61
|
+
};
|
|
62
|
+
exports.getWebpackCacheName = getWebpackCacheName;
|
|
63
|
+
const cacheExists = (environment, inputProps) => {
|
|
64
|
+
return fs_1.default.existsSync(remotionCacheLocation(environment, inputProps));
|
|
65
|
+
};
|
|
66
|
+
exports.cacheExists = cacheExists;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.20",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/bundler": "3.2.
|
|
27
|
-
"@remotion/media-utils": "3.2.
|
|
28
|
-
"@remotion/player": "3.2.
|
|
29
|
-
"@remotion/renderer": "3.2.
|
|
26
|
+
"@remotion/bundler": "3.2.20",
|
|
27
|
+
"@remotion/media-utils": "3.2.20",
|
|
28
|
+
"@remotion/player": "3.2.20",
|
|
29
|
+
"@remotion/renderer": "3.2.20",
|
|
30
30
|
"better-opn": "2.1.1",
|
|
31
31
|
"dotenv": "9.0.2",
|
|
32
32
|
"memfs": "3.4.3",
|
|
33
33
|
"minimist": "1.2.6",
|
|
34
|
-
"remotion": "3.2.
|
|
34
|
+
"remotion": "3.2.20",
|
|
35
35
|
"semver": "7.3.5",
|
|
36
36
|
"source-map": "0.6.1"
|
|
37
37
|
},
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "640f36c0c2d9fb1b7768925bf9d64840cbc31bc6"
|
|
75
75
|
}
|
package/web/favicon.png
CHANGED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare function normalizeWheel(event: WheelEvent): number[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Adapted from https://stackoverflow.com/a/13650579
|
|
3
|
-
function normalizeWheel(event) {
|
|
4
|
-
const { deltaY, deltaX } = event;
|
|
5
|
-
let deltaZ = 0;
|
|
6
|
-
if (event.ctrlKey || event.metaKey) {
|
|
7
|
-
const signY = Math.sign(event.deltaY);
|
|
8
|
-
const absDeltaY = Math.abs(event.deltaY);
|
|
9
|
-
let dy = deltaY;
|
|
10
|
-
if (absDeltaY > MAX_ZOOM_STEP) {
|
|
11
|
-
dy = MAX_ZOOM_STEP * signY;
|
|
12
|
-
}
|
|
13
|
-
deltaZ = dy;
|
|
14
|
-
}
|
|
15
|
-
return [deltaX, deltaY, deltaZ];
|
|
16
|
-
}
|