@remotion/cli 3.2.35 → 3.2.37
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 +8 -5
- package/dist/composition-prompts.d.ts +8 -0
- package/dist/composition-prompts.js +26 -0
- package/dist/get-composition-id.d.ts +6 -1
- package/dist/get-composition-id.js +27 -6
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/render.js +9 -13
- package/dist/select-composition.d.ts +7 -0
- package/dist/select-composition.js +51 -0
- package/dist/still.js +11 -15
- package/package.json +9 -7
package/dist/benchmark.js
CHANGED
|
@@ -14,6 +14,7 @@ const log_1 = require("./log");
|
|
|
14
14
|
const make_progress_bar_1 = require("./make-progress-bar");
|
|
15
15
|
const parse_command_line_1 = require("./parse-command-line");
|
|
16
16
|
const progress_bar_1 = require("./progress-bar");
|
|
17
|
+
const select_composition_1 = require("./select-composition");
|
|
17
18
|
const setup_cache_1 = require("./setup-cache");
|
|
18
19
|
const truthy_1 = require("./truthy");
|
|
19
20
|
const DEFAULT_RUNS = 3;
|
|
@@ -85,7 +86,7 @@ const makeBenchmarkProgressBar = ({ totalRuns, run, progress, doneIn, }) => {
|
|
|
85
86
|
].join(' ');
|
|
86
87
|
};
|
|
87
88
|
const benchmarkCommand = async (remotionRoot, args) => {
|
|
88
|
-
var _a
|
|
89
|
+
var _a;
|
|
89
90
|
const runs = (_a = parse_command_line_1.parsedCli.runs) !== null && _a !== void 0 ? _a : DEFAULT_RUNS;
|
|
90
91
|
const filePath = args[0];
|
|
91
92
|
if (!filePath) {
|
|
@@ -124,10 +125,12 @@ const benchmarkCommand = async (remotionRoot, args) => {
|
|
|
124
125
|
port,
|
|
125
126
|
puppeteerInstance,
|
|
126
127
|
});
|
|
127
|
-
const ids = (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
const ids = (args[1]
|
|
129
|
+
? args[1]
|
|
130
|
+
.split(',')
|
|
131
|
+
.map((c) => c.trim())
|
|
132
|
+
.filter(truthy_1.truthy)
|
|
133
|
+
: await (0, select_composition_1.selectCompositions)(comps));
|
|
131
134
|
const compositions = ids.map((compId) => {
|
|
132
135
|
const composition = comps.find((c) => c.id === compId);
|
|
133
136
|
if (!composition) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PromptObject } from 'prompts';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
export declare type Question<V extends string = string> = PromptObject<V> & {
|
|
4
|
+
optionsPerPage?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare type NamelessQuestion = Omit<Question<'value'>, 'name'>;
|
|
7
|
+
export default function prompt(questions: Question): Promise<prompts.Answers<string>>;
|
|
8
|
+
export declare function selectAsync(question: NamelessQuestion): Promise<string | string[]>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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.selectAsync = void 0;
|
|
7
|
+
const prompts_1 = __importDefault(require("prompts"));
|
|
8
|
+
const log_1 = require("./log");
|
|
9
|
+
function prompt(questions) {
|
|
10
|
+
return (0, prompts_1.default)([questions], {
|
|
11
|
+
onCancel() {
|
|
12
|
+
log_1.Log.error('No composition selected.');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.default = prompt;
|
|
18
|
+
async function selectAsync(question) {
|
|
19
|
+
const { value } = await prompt({
|
|
20
|
+
...question,
|
|
21
|
+
name: 'value',
|
|
22
|
+
type: question.type,
|
|
23
|
+
});
|
|
24
|
+
return value !== null && value !== void 0 ? value : null;
|
|
25
|
+
}
|
|
26
|
+
exports.selectAsync = selectAsync;
|
|
@@ -3,12 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCompositionId = void 0;
|
|
4
4
|
const log_1 = require("./log");
|
|
5
5
|
const parse_command_line_1 = require("./parse-command-line");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const select_composition_1 = require("./select-composition");
|
|
7
|
+
const getCompositionId = async (validCompositions) => {
|
|
8
|
+
if (parse_command_line_1.parsedCli._[2]) {
|
|
9
|
+
const config = validCompositions.find((c) => c.id === parse_command_line_1.parsedCli._[2]);
|
|
10
|
+
if (!config) {
|
|
11
|
+
throw new Error(`Cannot find composition with ID "${parse_command_line_1.parsedCli._[2]}". Available composition: ${validCompositions
|
|
12
|
+
.map((c) => c.id)
|
|
13
|
+
.join(', ')}`);
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
compositionId: parse_command_line_1.parsedCli._[2],
|
|
17
|
+
reason: 'Passed as argument',
|
|
18
|
+
config,
|
|
19
|
+
};
|
|
11
20
|
}
|
|
12
|
-
|
|
21
|
+
if (!process.env.CI) {
|
|
22
|
+
const { compositionId, reason } = await (0, select_composition_1.selectComposition)(validCompositions);
|
|
23
|
+
if (compositionId && typeof compositionId === 'string') {
|
|
24
|
+
return {
|
|
25
|
+
compositionId,
|
|
26
|
+
reason,
|
|
27
|
+
config: validCompositions.find((c) => c.id === compositionId),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
log_1.Log.error('Composition ID not passed.');
|
|
32
|
+
log_1.Log.error('Pass an extra argument <composition-id>.');
|
|
33
|
+
process.exit(1);
|
|
13
34
|
};
|
|
14
35
|
exports.getCompositionId = getCompositionId;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ const preview_1 = require("./preview");
|
|
|
41
41
|
const print_help_1 = require("./print-help");
|
|
42
42
|
const progress_bar_1 = require("./progress-bar");
|
|
43
43
|
const render_1 = require("./render");
|
|
44
|
+
const select_composition_1 = require("./select-composition");
|
|
44
45
|
const still_1 = require("./still");
|
|
45
46
|
const upgrade_1 = require("./upgrade");
|
|
46
47
|
const versions_1 = require("./versions");
|
|
@@ -129,4 +130,5 @@ exports.CliInternals = {
|
|
|
129
130
|
getFinalCodec: get_cli_options_1.getFinalCodec,
|
|
130
131
|
determineFinalImageFormat: determine_image_format_1.determineFinalImageFormat,
|
|
131
132
|
minimist: minimist_1.default,
|
|
133
|
+
selectComposition: select_composition_1.selectComposition,
|
|
132
134
|
};
|
package/dist/render.js
CHANGED
|
@@ -49,15 +49,6 @@ const render = async (remotionRoot) => {
|
|
|
49
49
|
type: 'series',
|
|
50
50
|
codec,
|
|
51
51
|
});
|
|
52
|
-
const relativeOutputLocation = (0, get_filename_1.getOutputFilename)({
|
|
53
|
-
codec,
|
|
54
|
-
imageSequence: shouldOutputImageSequence,
|
|
55
|
-
compositionName: (0, get_composition_id_1.getCompositionId)(),
|
|
56
|
-
defaultExtension: renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'),
|
|
57
|
-
});
|
|
58
|
-
const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
|
|
59
|
-
const compositionId = (0, get_composition_id_1.getCompositionId)();
|
|
60
|
-
log_1.Log.info(chalk_1.chalk.gray(`Composition = ${compositionId}, Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
|
|
61
52
|
const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
|
|
62
53
|
ffmpegExecutable,
|
|
63
54
|
});
|
|
@@ -109,16 +100,21 @@ const render = async (remotionRoot) => {
|
|
|
109
100
|
downloadMap,
|
|
110
101
|
port,
|
|
111
102
|
});
|
|
112
|
-
const config =
|
|
113
|
-
if (!config) {
|
|
114
|
-
throw new Error(`Cannot find composition with ID ${compositionId}`);
|
|
115
|
-
}
|
|
103
|
+
const { compositionId, config, reason } = await (0, get_composition_id_1.getCompositionId)(comps);
|
|
116
104
|
renderer_1.RenderInternals.validateEvenDimensionsWithCodec({
|
|
117
105
|
width: config.width,
|
|
118
106
|
height: config.height,
|
|
119
107
|
codec,
|
|
120
108
|
scale,
|
|
121
109
|
});
|
|
110
|
+
const relativeOutputLocation = (0, get_filename_1.getOutputFilename)({
|
|
111
|
+
codec,
|
|
112
|
+
imageSequence: shouldOutputImageSequence,
|
|
113
|
+
compositionName: compositionId,
|
|
114
|
+
defaultExtension: renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'),
|
|
115
|
+
});
|
|
116
|
+
log_1.Log.info(chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
|
|
117
|
+
const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
|
|
122
118
|
const outputDir = shouldOutputImageSequence
|
|
123
119
|
? absoluteOutputFile
|
|
124
120
|
: await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-render'));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { getCompositions } from '@remotion/renderer';
|
|
2
|
+
export declare type Await<T> = T extends PromiseLike<infer U> ? U : T;
|
|
3
|
+
export declare const selectComposition: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<{
|
|
4
|
+
compositionId: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const selectCompositions: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<string[]>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectCompositions = exports.selectComposition = void 0;
|
|
4
|
+
const composition_prompts_1 = require("./composition-prompts");
|
|
5
|
+
const chalk_1 = require("./chalk");
|
|
6
|
+
const selectComposition = async (validCompositions) => {
|
|
7
|
+
if (validCompositions.length === 1) {
|
|
8
|
+
const onlyComposition = validCompositions[0];
|
|
9
|
+
if (onlyComposition) {
|
|
10
|
+
return {
|
|
11
|
+
compositionId: onlyComposition.id,
|
|
12
|
+
reason: 'Only composition',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const selectedComposition = (await (0, composition_prompts_1.selectAsync)({
|
|
17
|
+
message: 'Select composition:',
|
|
18
|
+
optionsPerPage: 5,
|
|
19
|
+
type: 'select',
|
|
20
|
+
choices: validCompositions.map((comp) => {
|
|
21
|
+
return {
|
|
22
|
+
value: comp.id,
|
|
23
|
+
title: chalk_1.chalk.bold(comp.id),
|
|
24
|
+
};
|
|
25
|
+
}),
|
|
26
|
+
}));
|
|
27
|
+
return { compositionId: selectedComposition, reason: 'Selected' };
|
|
28
|
+
};
|
|
29
|
+
exports.selectComposition = selectComposition;
|
|
30
|
+
const selectCompositions = async (validCompositions) => {
|
|
31
|
+
if (validCompositions.length === 1) {
|
|
32
|
+
const onlyComposition = validCompositions[0];
|
|
33
|
+
if (onlyComposition) {
|
|
34
|
+
return [onlyComposition.id];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const selectedComposition = await (0, composition_prompts_1.selectAsync)({
|
|
38
|
+
message: 'Select compositions:',
|
|
39
|
+
optionsPerPage: 5,
|
|
40
|
+
type: 'multiselect',
|
|
41
|
+
min: 1,
|
|
42
|
+
choices: validCompositions.map((comp) => {
|
|
43
|
+
return {
|
|
44
|
+
value: comp.id,
|
|
45
|
+
title: chalk_1.chalk.bold(comp.id),
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
return selectedComposition;
|
|
50
|
+
};
|
|
51
|
+
exports.selectCompositions = selectCompositions;
|
package/dist/still.js
CHANGED
|
@@ -35,7 +35,6 @@ const still = async (remotionRoot) => {
|
|
|
35
35
|
codec: 'h264',
|
|
36
36
|
});
|
|
37
37
|
log_1.Log.verbose('Browser executable: ', browserExecutable);
|
|
38
|
-
const compositionId = (0, get_composition_id_1.getCompositionId)();
|
|
39
38
|
const { format: imageFormat, source } = (0, determine_image_format_1.determineFinalImageFormat)({
|
|
40
39
|
cliFlag: (_a = parse_command_line_1.parsedCli['image-format']) !== null && _a !== void 0 ? _a : null,
|
|
41
40
|
configImageFormat: (_b = config_1.ConfigInternals.getUserPreferredImageFormat()) !== null && _b !== void 0 ? _b : null,
|
|
@@ -43,21 +42,12 @@ const still = async (remotionRoot) => {
|
|
|
43
42
|
outName: (0, user_passed_output_location_1.getUserPassedOutputLocation)(),
|
|
44
43
|
isLambda: false,
|
|
45
44
|
});
|
|
46
|
-
const relativeOutputLocation = (0, user_passed_output_location_1.getOutputLocation)({
|
|
47
|
-
compositionId,
|
|
48
|
-
defaultExtension: imageFormat,
|
|
49
|
-
});
|
|
50
|
-
const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
|
|
51
|
-
log_1.Log.info(chalk_1.chalk.gray(`Output = ${relativeOutputLocation}, Format = ${imageFormat} (${source}), Composition = ${compositionId}`));
|
|
52
45
|
const browserInstance = (0, renderer_1.openBrowser)(browser, {
|
|
53
46
|
browserExecutable,
|
|
54
47
|
chromiumOptions,
|
|
55
48
|
shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
|
|
56
49
|
forceDeviceScaleFactor: scale,
|
|
57
50
|
});
|
|
58
|
-
(0, fs_1.mkdirSync)(path_1.default.join(absoluteOutputLocation, '..'), {
|
|
59
|
-
recursive: true,
|
|
60
|
-
});
|
|
61
51
|
const steps = [
|
|
62
52
|
renderer_1.RenderInternals.isServeUrl(fullPath) ? null : 'bundling',
|
|
63
53
|
'rendering',
|
|
@@ -77,10 +67,16 @@ const still = async (remotionRoot) => {
|
|
|
77
67
|
ffprobeExecutable,
|
|
78
68
|
downloadMap,
|
|
79
69
|
});
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
const { compositionId, config, reason } = await (0, get_composition_id_1.getCompositionId)(comps);
|
|
71
|
+
const relativeOutputLocation = (0, user_passed_output_location_1.getOutputLocation)({
|
|
72
|
+
compositionId,
|
|
73
|
+
defaultExtension: imageFormat,
|
|
74
|
+
});
|
|
75
|
+
const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
|
|
76
|
+
(0, fs_1.mkdirSync)(path_1.default.join(absoluteOutputLocation, '..'), {
|
|
77
|
+
recursive: true,
|
|
78
|
+
});
|
|
79
|
+
log_1.Log.info(chalk_1.chalk.gray(`Output = ${relativeOutputLocation}, Format = ${imageFormat} (${source}), Composition = ${compositionId} (${reason})`));
|
|
84
80
|
const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
|
|
85
81
|
const renderStart = Date.now();
|
|
86
82
|
const downloads = [];
|
|
@@ -117,7 +113,7 @@ const still = async (remotionRoot) => {
|
|
|
117
113
|
};
|
|
118
114
|
};
|
|
119
115
|
await (0, renderer_1.renderStill)({
|
|
120
|
-
composition,
|
|
116
|
+
composition: config,
|
|
121
117
|
frame: stillFrame,
|
|
122
118
|
output: absoluteOutputLocation,
|
|
123
119
|
serveUrl: urlOrBundle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.37",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,15 +22,16 @@
|
|
|
22
22
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@remotion/bundler": "3.2.
|
|
26
|
-
"@remotion/media-utils": "3.2.
|
|
27
|
-
"@remotion/player": "3.2.
|
|
28
|
-
"@remotion/renderer": "3.2.
|
|
25
|
+
"@remotion/bundler": "3.2.37",
|
|
26
|
+
"@remotion/media-utils": "3.2.37",
|
|
27
|
+
"@remotion/player": "3.2.37",
|
|
28
|
+
"@remotion/renderer": "3.2.37",
|
|
29
29
|
"better-opn": "2.1.1",
|
|
30
30
|
"dotenv": "9.0.2",
|
|
31
31
|
"memfs": "3.4.3",
|
|
32
32
|
"minimist": "1.2.6",
|
|
33
|
-
"
|
|
33
|
+
"prompts": "2.4.1",
|
|
34
|
+
"remotion": "3.2.37",
|
|
34
35
|
"semver": "7.3.5",
|
|
35
36
|
"source-map": "0.6.1"
|
|
36
37
|
},
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"@jonny/eslint-config": "3.0.266",
|
|
43
44
|
"@types/minimist": "^1.2.2",
|
|
44
45
|
"@types/node": "^16.7.5",
|
|
46
|
+
"@types/prompts": "^2.4.1",
|
|
45
47
|
"@types/react": "18.0.1",
|
|
46
48
|
"@types/react-dom": "18.0.0",
|
|
47
49
|
"@types/semver": "^7.3.4",
|
|
@@ -70,5 +72,5 @@
|
|
|
70
72
|
"publishConfig": {
|
|
71
73
|
"access": "public"
|
|
72
74
|
},
|
|
73
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "b4b40f35b14bac31fbee5d35b95e7fad9f464c94"
|
|
74
76
|
}
|