@remotion/cli 4.0.429 → 4.0.430

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 CHANGED
@@ -22,8 +22,11 @@ const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-
22
22
  const show_compositions_picker_1 = require("./show-compositions-picker");
23
23
  const truthy_1 = require("./truthy");
24
24
  const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, headlessOption, overwriteOption, binariesDirectoryOption, forSeamlessAacConcatenationOption, publicPathOption, publicDirOption, metadataOption, hardwareAccelerationOption, chromeModeOption, offthreadVideoThreadsOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, experimentalVisualModeOption, keyboardShortcutsOption, rspackOption, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, concurrencyOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, bundleCacheOption, runsOption, } = client_1.BrowserSafeApis.options;
25
+ const { benchmarkConcurrenciesOption } = client_1.BrowserSafeApis.options;
25
26
  const getValidConcurrency = (cliConcurrency) => {
26
- const { concurrencies } = parsed_cli_1.parsedCli;
27
+ const concurrencies = benchmarkConcurrenciesOption.getValue({
28
+ commandLine: parsed_cli_1.parsedCli,
29
+ }).value;
27
30
  if (!concurrencies) {
28
31
  return [renderer_1.RenderInternals.resolveConcurrency(cliConcurrency)];
29
32
  }
@@ -0,0 +1,36 @@
1
+ export declare const isCatalogProtocol: (version: string) => boolean;
2
+ export declare const findVersionSpecifier: (depsWithVersions: {
3
+ dependencies: Record<string, string>;
4
+ devDependencies: Record<string, string>;
5
+ optionalDependencies: Record<string, string>;
6
+ peerDependencies: Record<string, string>;
7
+ }, pkg: string) => string | null;
8
+ export declare const findWorkspaceRoot: (startDir: string) => string | null;
9
+ type CatalogSource = {
10
+ type: 'package-json';
11
+ filePath: string;
12
+ catalogKey: 'workspaces' | 'root';
13
+ } | {
14
+ type: 'pnpm-workspace';
15
+ filePath: string;
16
+ };
17
+ export declare const findCatalogSource: (workspaceRoot: string) => CatalogSource | null;
18
+ export declare const getCatalogEntries: (workspaceRoot: string) => Record<string, string>;
19
+ export declare const parsePnpmWorkspaceCatalog: (content: string) => Record<string, string>;
20
+ export declare const updateCatalogEntryInPackageJson: ({ filePath, catalogKey, pkg, newVersion, }: {
21
+ filePath: string;
22
+ catalogKey: "root" | "workspaces";
23
+ pkg: string;
24
+ newVersion: string;
25
+ }) => boolean;
26
+ export declare const updateCatalogEntryInPnpmWorkspace: ({ filePath, pkg, newVersion, }: {
27
+ filePath: string;
28
+ pkg: string;
29
+ newVersion: string;
30
+ }) => boolean;
31
+ export declare const updateCatalogEntry: ({ workspaceRoot, pkg, newVersion, }: {
32
+ workspaceRoot: string;
33
+ pkg: string;
34
+ newVersion: string;
35
+ }) => boolean;
36
+ export {};
@@ -0,0 +1,191 @@
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.updateCatalogEntry = exports.updateCatalogEntryInPnpmWorkspace = exports.updateCatalogEntryInPackageJson = exports.parsePnpmWorkspaceCatalog = exports.getCatalogEntries = exports.findCatalogSource = exports.findWorkspaceRoot = exports.findVersionSpecifier = exports.isCatalogProtocol = void 0;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const WORKSPACE_ROOT_SEARCH_LIMIT = 5;
10
+ const isCatalogProtocol = (version) => {
11
+ return version.startsWith('catalog:');
12
+ };
13
+ exports.isCatalogProtocol = isCatalogProtocol;
14
+ const findVersionSpecifier = (depsWithVersions, pkg) => {
15
+ var _a, _b, _c, _d;
16
+ return ((_d = (_c = (_b = (_a = depsWithVersions.dependencies[pkg]) !== null && _a !== void 0 ? _a : depsWithVersions.devDependencies[pkg]) !== null && _b !== void 0 ? _b : depsWithVersions.optionalDependencies[pkg]) !== null && _c !== void 0 ? _c : depsWithVersions.peerDependencies[pkg]) !== null && _d !== void 0 ? _d : null);
17
+ };
18
+ exports.findVersionSpecifier = findVersionSpecifier;
19
+ const findWorkspaceRoot = (startDir) => {
20
+ let currentDir = node_path_1.default.resolve(startDir);
21
+ for (let i = 0; i < WORKSPACE_ROOT_SEARCH_LIMIT; i++) {
22
+ const packageJsonPath = node_path_1.default.join(currentDir, 'package.json');
23
+ if (node_fs_1.default.existsSync(packageJsonPath)) {
24
+ try {
25
+ const packageJson = JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'));
26
+ if (packageJson.workspaces) {
27
+ return currentDir;
28
+ }
29
+ }
30
+ catch (_a) { }
31
+ }
32
+ const pnpmWorkspacePath = node_path_1.default.join(currentDir, 'pnpm-workspace.yaml');
33
+ if (node_fs_1.default.existsSync(pnpmWorkspacePath)) {
34
+ return currentDir;
35
+ }
36
+ const parentDir = node_path_1.default.dirname(currentDir);
37
+ if (parentDir === currentDir) {
38
+ return null;
39
+ }
40
+ currentDir = parentDir;
41
+ }
42
+ return null;
43
+ };
44
+ exports.findWorkspaceRoot = findWorkspaceRoot;
45
+ const findCatalogSource = (workspaceRoot) => {
46
+ const packageJsonPath = node_path_1.default.join(workspaceRoot, 'package.json');
47
+ if (node_fs_1.default.existsSync(packageJsonPath)) {
48
+ try {
49
+ const packageJson = JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'));
50
+ if (packageJson.workspaces &&
51
+ typeof packageJson.workspaces === 'object' &&
52
+ !Array.isArray(packageJson.workspaces) &&
53
+ packageJson.workspaces.catalog) {
54
+ return {
55
+ type: 'package-json',
56
+ filePath: packageJsonPath,
57
+ catalogKey: 'workspaces',
58
+ };
59
+ }
60
+ if (packageJson.catalog) {
61
+ return {
62
+ type: 'package-json',
63
+ filePath: packageJsonPath,
64
+ catalogKey: 'root',
65
+ };
66
+ }
67
+ }
68
+ catch (_a) { }
69
+ }
70
+ const pnpmWorkspacePath = node_path_1.default.join(workspaceRoot, 'pnpm-workspace.yaml');
71
+ if (node_fs_1.default.existsSync(pnpmWorkspacePath)) {
72
+ const content = node_fs_1.default.readFileSync(pnpmWorkspacePath, 'utf-8');
73
+ if (/^catalog:/m.test(content)) {
74
+ return { type: 'pnpm-workspace', filePath: pnpmWorkspacePath };
75
+ }
76
+ }
77
+ return null;
78
+ };
79
+ exports.findCatalogSource = findCatalogSource;
80
+ const getCatalogEntries = (workspaceRoot) => {
81
+ var _a, _b;
82
+ const source = (0, exports.findCatalogSource)(workspaceRoot);
83
+ if (!source) {
84
+ return {};
85
+ }
86
+ if (source.type === 'package-json') {
87
+ const packageJson = JSON.parse(node_fs_1.default.readFileSync(source.filePath, 'utf-8'));
88
+ if (source.catalogKey === 'workspaces') {
89
+ return ((_a = packageJson.workspaces.catalog) !== null && _a !== void 0 ? _a : {});
90
+ }
91
+ return ((_b = packageJson.catalog) !== null && _b !== void 0 ? _b : {});
92
+ }
93
+ return (0, exports.parsePnpmWorkspaceCatalog)(node_fs_1.default.readFileSync(source.filePath, 'utf-8'));
94
+ };
95
+ exports.getCatalogEntries = getCatalogEntries;
96
+ const parsePnpmWorkspaceCatalog = (content) => {
97
+ const lines = content.split('\n');
98
+ const catalog = {};
99
+ let inCatalogSection = false;
100
+ for (const line of lines) {
101
+ if (/^catalog:\s*$/.test(line)) {
102
+ inCatalogSection = true;
103
+ continue;
104
+ }
105
+ if (inCatalogSection && /^\S/.test(line) && line.trim() !== '') {
106
+ inCatalogSection = false;
107
+ continue;
108
+ }
109
+ if (inCatalogSection && line.trim() !== '') {
110
+ const match = line.match(/^\s+(['"]?)([^'":\s]+)\1:\s*['"]?([^'"#\s]+)['"]?/);
111
+ if (match && match[2] && match[3]) {
112
+ catalog[match[2]] = match[3];
113
+ }
114
+ }
115
+ }
116
+ return catalog;
117
+ };
118
+ exports.parsePnpmWorkspaceCatalog = parsePnpmWorkspaceCatalog;
119
+ const updateCatalogEntryInPackageJson = ({ filePath, catalogKey, pkg, newVersion, }) => {
120
+ var _a;
121
+ const content = node_fs_1.default.readFileSync(filePath, 'utf-8');
122
+ const packageJson = JSON.parse(content);
123
+ const catalog = catalogKey === 'workspaces'
124
+ ? (_a = packageJson.workspaces) === null || _a === void 0 ? void 0 : _a.catalog
125
+ : packageJson.catalog;
126
+ if (!catalog || !(pkg in catalog)) {
127
+ return false;
128
+ }
129
+ catalog[pkg] = newVersion;
130
+ const indentMatch = content.match(/^(\s+)"/m);
131
+ const indent = indentMatch ? indentMatch[1] : '\t';
132
+ node_fs_1.default.writeFileSync(filePath, JSON.stringify(packageJson, null, indent) + '\n');
133
+ return true;
134
+ };
135
+ exports.updateCatalogEntryInPackageJson = updateCatalogEntryInPackageJson;
136
+ const updateCatalogEntryInPnpmWorkspace = ({ filePath, pkg, newVersion, }) => {
137
+ var _a, _b, _c;
138
+ const content = node_fs_1.default.readFileSync(filePath, 'utf-8');
139
+ const lines = content.split('\n');
140
+ let inCatalogSection = false;
141
+ let updated = false;
142
+ for (let i = 0; i < lines.length; i++) {
143
+ const line = lines[i];
144
+ if (/^catalog:\s*$/.test(line)) {
145
+ inCatalogSection = true;
146
+ continue;
147
+ }
148
+ if (inCatalogSection && /^\S/.test(line) && line.trim() !== '') {
149
+ inCatalogSection = false;
150
+ continue;
151
+ }
152
+ if (inCatalogSection) {
153
+ const escapedPkg = pkg.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
154
+ const lineRegex = new RegExp(`^(\\s+(?:['"]?)${escapedPkg}(?:['"]?):\\s*)(['"]?)([^'"#\\s]+)\\2(.*)$`);
155
+ const match = line.match(lineRegex);
156
+ if (match) {
157
+ const prefix = (_a = match[1]) !== null && _a !== void 0 ? _a : '';
158
+ const quote = (_b = match[2]) !== null && _b !== void 0 ? _b : '';
159
+ const suffix = (_c = match[4]) !== null && _c !== void 0 ? _c : '';
160
+ lines[i] = `${prefix}${quote}${newVersion}${quote}${suffix}`;
161
+ updated = true;
162
+ break;
163
+ }
164
+ }
165
+ }
166
+ if (updated) {
167
+ node_fs_1.default.writeFileSync(filePath, lines.join('\n'));
168
+ }
169
+ return updated;
170
+ };
171
+ exports.updateCatalogEntryInPnpmWorkspace = updateCatalogEntryInPnpmWorkspace;
172
+ const updateCatalogEntry = ({ workspaceRoot, pkg, newVersion, }) => {
173
+ const source = (0, exports.findCatalogSource)(workspaceRoot);
174
+ if (!source) {
175
+ return false;
176
+ }
177
+ if (source.type === 'package-json') {
178
+ return (0, exports.updateCatalogEntryInPackageJson)({
179
+ filePath: source.filePath,
180
+ catalogKey: source.catalogKey,
181
+ pkg,
182
+ newVersion,
183
+ });
184
+ }
185
+ return (0, exports.updateCatalogEntryInPnpmWorkspace)({
186
+ filePath: source.filePath,
187
+ pkg,
188
+ newVersion,
189
+ });
190
+ };
191
+ exports.updateCatalogEntry = updateCatalogEntry;
@@ -0,0 +1,4 @@
1
+ export declare const setStillImageFormat: (format: "jpeg" | "pdf" | "png" | "webp") => void;
2
+ export declare const setVideoImageFormat: (format: "jpeg" | "none" | "png") => void;
3
+ export declare const getUserPreferredStillImageFormat: () => "jpeg" | "pdf" | "png" | "webp" | undefined;
4
+ export declare const getUserPreferredVideoImageFormat: () => "jpeg" | "none" | "png" | undefined;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserPreferredVideoImageFormat = exports.getUserPreferredStillImageFormat = exports.setVideoImageFormat = exports.setStillImageFormat = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ const truthy_1 = require("../truthy");
6
+ let currentStillImageFormat;
7
+ let currentVideoImageFormat;
8
+ const setStillImageFormat = (format) => {
9
+ if (typeof format === 'undefined') {
10
+ currentStillImageFormat = undefined;
11
+ return;
12
+ }
13
+ if (!renderer_1.RenderInternals.validStillImageFormats.includes(format)) {
14
+ throw new TypeError([
15
+ `Value ${format} is not valid as an image format.`,
16
+ // @ts-expect-error
17
+ format === 'jpg' ? 'Did you mean "jpeg"?' : null,
18
+ ]
19
+ .filter(truthy_1.truthy)
20
+ .join(' '));
21
+ }
22
+ currentStillImageFormat = format;
23
+ };
24
+ exports.setStillImageFormat = setStillImageFormat;
25
+ const setVideoImageFormat = (format) => {
26
+ if (typeof format === 'undefined') {
27
+ currentVideoImageFormat = undefined;
28
+ return;
29
+ }
30
+ if (!renderer_1.RenderInternals.validVideoImageFormats.includes(format)) {
31
+ throw new TypeError([
32
+ `Value ${format} is not valid as a video image format.`,
33
+ // @ts-expect-error
34
+ format === 'jpg' ? 'Did you mean "jpeg"?' : null,
35
+ ]
36
+ .filter(truthy_1.truthy)
37
+ .join(' '));
38
+ }
39
+ currentVideoImageFormat = format;
40
+ };
41
+ exports.setVideoImageFormat = setVideoImageFormat;
42
+ const getUserPreferredStillImageFormat = () => {
43
+ return currentStillImageFormat;
44
+ };
45
+ exports.getUserPreferredStillImageFormat = getUserPreferredStillImageFormat;
46
+ const getUserPreferredVideoImageFormat = () => {
47
+ return currentVideoImageFormat;
48
+ };
49
+ exports.getUserPreferredVideoImageFormat = getUserPreferredVideoImageFormat;
@@ -411,6 +411,12 @@ type FlatConfig = RemotionConfigObject & RemotionBundlingOptions & {
411
411
  * Default: 3
412
412
  */
413
413
  setBenchmarkRuns: (runs: number) => void;
414
+ /**
415
+ * Set which concurrency values should be used during a benchmark.
416
+ * Pass a comma-separated string of numbers, e.g. "1,4,8".
417
+ * Default: null (uses the --concurrency value)
418
+ */
419
+ setBenchmarkConcurrencies: (concurrencies: string | null) => void;
414
420
  /**
415
421
  * @deprecated 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.'
416
422
  */
@@ -20,7 +20,7 @@ const preview_server_2 = require("./preview-server");
20
20
  const still_frame_1 = require("./still-frame");
21
21
  const webpack_caching_1 = require("./webpack-caching");
22
22
  const webpack_poll_1 = require("./webpack-poll");
23
- const { concurrencyOption, offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, framesOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, askAIOption, publicLicenseKeyOption, experimentalClientSideRenderingOption, experimentalVisualModeOption, keyboardShortcutsOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, stillImageFormatOption, videoImageFormatOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, rspackOption, outDirOption, webpackPollOption, imageSequenceOption, bundleCacheOption, envFileOption, runsOption, noOpenOption, } = client_1.BrowserSafeApis.options;
23
+ const { benchmarkConcurrenciesOption, concurrencyOption, offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, framesOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, askAIOption, publicLicenseKeyOption, experimentalClientSideRenderingOption, experimentalVisualModeOption, keyboardShortcutsOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, stillImageFormatOption, videoImageFormatOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, rspackOption, outDirOption, webpackPollOption, imageSequenceOption, bundleCacheOption, envFileOption, runsOption, noOpenOption, } = client_1.BrowserSafeApis.options;
24
24
  exports.Config = {
25
25
  get Bundling() {
26
26
  throw new Error('The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.');
@@ -126,6 +126,7 @@ exports.Config = {
126
126
  setIPv4: ipv4Option.setConfig,
127
127
  setBundleOutDir: outDirOption.setConfig,
128
128
  setBenchmarkRuns: runsOption.setConfig,
129
+ setBenchmarkConcurrencies: benchmarkConcurrenciesOption.setConfig,
129
130
  };
130
131
  exports.ConfigInternals = {
131
132
  getBrowser: browser_1.getBrowser,
@@ -0,0 +1,2 @@
1
+ export declare const getNumberOfSharedAudioTags: () => number;
2
+ export declare const setNumberOfSharedAudioTags: (audioTags: number) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setNumberOfSharedAudioTags = exports.getNumberOfSharedAudioTags = void 0;
4
+ let numberOfSharedAudioTags = 0;
5
+ const getNumberOfSharedAudioTags = () => {
6
+ return numberOfSharedAudioTags;
7
+ };
8
+ exports.getNumberOfSharedAudioTags = getNumberOfSharedAudioTags;
9
+ const setNumberOfSharedAudioTags = (audioTags) => {
10
+ numberOfSharedAudioTags = audioTags;
11
+ };
12
+ exports.setNumberOfSharedAudioTags = setNumberOfSharedAudioTags;
@@ -0,0 +1,9 @@
1
+ type RemotionDetectionResult = {
2
+ type: 'match';
3
+ } | {
4
+ type: 'mismatch';
5
+ } | {
6
+ type: 'not-remotion';
7
+ };
8
+ export declare const detectRemotionServer: (port: number, cwd: string) => Promise<RemotionDetectionResult>;
9
+ export {};
@@ -0,0 +1,45 @@
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.detectRemotionServer = void 0;
7
+ const http_1 = __importDefault(require("http"));
8
+ const detectRemotionServer = (port, cwd) => {
9
+ return new Promise((resolve) => {
10
+ const req = http_1.default.get({
11
+ hostname: 'localhost',
12
+ port,
13
+ path: '/__remotion_config',
14
+ timeout: 1000,
15
+ }, (res) => {
16
+ let data = '';
17
+ res.on('data', (chunk) => {
18
+ data += chunk;
19
+ });
20
+ res.on('end', () => {
21
+ try {
22
+ const json = JSON.parse(data);
23
+ if ((json === null || json === void 0 ? void 0 : json.isRemotion) !== true) {
24
+ return resolve({ type: 'not-remotion' });
25
+ }
26
+ // Normalize paths for comparison to avoid issues with different separators or casing on Windows
27
+ const normalize = (p) => p.replace(/\\/g, '/').toLowerCase();
28
+ if (normalize(json.cwd) === normalize(cwd)) {
29
+ return resolve({ type: 'match' });
30
+ }
31
+ return resolve({ type: 'mismatch' });
32
+ }
33
+ catch (_a) {
34
+ resolve({ type: 'not-remotion' });
35
+ }
36
+ });
37
+ });
38
+ req.on('error', () => resolve({ type: 'not-remotion' }));
39
+ req.on('timeout', () => {
40
+ req.destroy();
41
+ resolve({ type: 'not-remotion' });
42
+ });
43
+ });
44
+ };
45
+ exports.detectRemotionServer = detectRemotionServer;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EXTRA_PACKAGES_DOCS = exports.EXTRA_PACKAGES = void 0;
4
4
  exports.EXTRA_PACKAGES = {
5
- mediabunny: '1.34.5',
6
- '@mediabunny/ac3': '1.34.5',
5
+ mediabunny: '1.35.1',
6
+ '@mediabunny/ac3': '1.35.1',
7
7
  zod: '4.3.6',
8
8
  };
9
9
  exports.EXTRA_PACKAGES_DOCS = {
@@ -0,0 +1 @@
1
+ export declare const isPortOpen: (port: number) => Promise<boolean>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPortOpen = void 0;
4
+ const net_1 = require("net");
5
+ const isPortOpen = (port) => {
6
+ return new Promise((resolve, reject) => {
7
+ const server = (0, net_1.createServer)();
8
+ server.once('error', (err) => {
9
+ if (err.code === 'EADDRINUSE') {
10
+ resolve(false);
11
+ }
12
+ else {
13
+ reject(err);
14
+ }
15
+ });
16
+ server.once('listening', () => {
17
+ server.close(() => {
18
+ resolve(true);
19
+ });
20
+ });
21
+ server.listen(port);
22
+ });
23
+ };
24
+ exports.isPortOpen = isPortOpen;
@@ -1,6 +1,24 @@
1
1
  import type { AudioCodec, StillImageFormat, VideoImageFormat } from '@remotion/renderer';
2
2
  import type { TypeOfOption } from '@remotion/renderer/client';
3
- declare const beepOnFinishOption: {
3
+ declare const benchmarkConcurrenciesOption: {
4
+ name: string;
5
+ cliFlag: "concurrencies";
6
+ description: () => import("react/jsx-runtime").JSX.Element;
7
+ ssrName: null;
8
+ docLink: string;
9
+ type: string | null;
10
+ getValue: ({ commandLine }: {
11
+ commandLine: Record<string, unknown>;
12
+ }) => {
13
+ value: string;
14
+ source: string;
15
+ } | {
16
+ value: null;
17
+ source: string;
18
+ };
19
+ setConfig: (value: string | null) => void;
20
+ id: "concurrencies";
21
+ }, beepOnFinishOption: {
4
22
  name: string;
5
23
  cliFlag: "beep-on-finish";
6
24
  description: () => import("react/jsx-runtime").JSX.Element;
@@ -933,6 +951,21 @@ declare const beepOnFinishOption: {
933
951
  };
934
952
  setConfig: (value: boolean) => void;
935
953
  id: "disable-headless";
954
+ }, delayRenderTimeoutInMillisecondsOption: {
955
+ name: string;
956
+ cliFlag: "timeout";
957
+ description: () => import("react/jsx-runtime").JSX.Element;
958
+ ssrName: "timeoutInMilliseconds";
959
+ docLink: string;
960
+ type: number;
961
+ getValue: ({ commandLine }: {
962
+ commandLine: Record<string, unknown>;
963
+ }) => {
964
+ source: string;
965
+ value: number;
966
+ };
967
+ setConfig: (value: number) => void;
968
+ id: "timeout";
936
969
  }, framesOption: {
937
970
  name: string;
938
971
  cliFlag: "frames";
@@ -1060,7 +1093,7 @@ export type CommandLineOptions = {
1060
1093
  [versionFlagOption.cliFlag]: TypeOfOption<typeof versionFlagOption>;
1061
1094
  [videoCodecOption.cliFlag]: TypeOfOption<typeof videoCodecOption>;
1062
1095
  [concurrencyOption.cliFlag]: TypeOfOption<typeof concurrencyOption>;
1063
- timeout: number;
1096
+ [delayRenderTimeoutInMillisecondsOption.cliFlag]: TypeOfOption<typeof delayRenderTimeoutInMillisecondsOption>;
1064
1097
  [configOption.cliFlag]: TypeOfOption<typeof configOption>;
1065
1098
  ['public-dir']: string;
1066
1099
  [audioBitrateOption.cliFlag]: TypeOfOption<typeof audioBitrateOption>;
@@ -1070,7 +1103,6 @@ export type CommandLineOptions = {
1070
1103
  [audioCodecOption.cliFlag]: AudioCodec;
1071
1104
  [publicPathOption.cliFlag]: string;
1072
1105
  [crfOption.cliFlag]: TypeOfOption<typeof crfOption>;
1073
- force: boolean;
1074
1106
  output: string | undefined;
1075
1107
  [overwriteOption.cliFlag]: TypeOfOption<typeof overwriteOption>;
1076
1108
  png: boolean;
@@ -1096,7 +1128,7 @@ export type CommandLineOptions = {
1096
1128
  [overrideFpsOption.cliFlag]: TypeOfOption<typeof overrideFpsOption>;
1097
1129
  [overrideDurationOption.cliFlag]: TypeOfOption<typeof overrideDurationOption>;
1098
1130
  [runsOption.cliFlag]: TypeOfOption<typeof runsOption>;
1099
- concurrencies: string;
1131
+ [benchmarkConcurrenciesOption.cliFlag]: TypeOfOption<typeof benchmarkConcurrenciesOption>;
1100
1132
  [enforceAudioOption.cliFlag]: TypeOfOption<typeof enforceAudioOption>;
1101
1133
  [glOption.cliFlag]: TypeOfOption<typeof glOption>;
1102
1134
  [packageManagerOption.cliFlag]: TypeOfOption<typeof packageManagerOption>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.quietFlagProvided = exports.parsedCli = exports.BooleanFlags = void 0;
7
7
  const client_1 = require("@remotion/renderer/client");
8
8
  const minimist_1 = __importDefault(require("minimist"));
9
- const { beepOnFinishOption, colorSpaceOption, concurrencyOption, disallowParallelEncodingOption, offthreadVideoCacheSizeInBytesOption, encodingBufferSizeOption, encodingMaxRateOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, numberOfGifLoopsOption, x264Option, enforceAudioOption, jpegQualityOption, audioBitrateOption, videoBitrateOption, audioCodecOption, publicPathOption, audioLatencyHintOption, darkModeOption, publicLicenseKeyOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, outDirOption, packageManagerOption, webpackPollOption, keyboardShortcutsOption, experimentalClientSideRenderingOption, experimentalVisualModeOption, imageSequencePatternOption, scaleOption, overwriteOption, crfOption, logLevelOption, videoCodecOption, stillFrameOption, imageSequenceOption, versionFlagOption, bundleCacheOption, envFileOption, glOption, runsOption, reproOption, mutedOption, headlessOption, disableGitSourceOption, framesOption, forSeamlessAacConcatenationOption, isProductionOption, noOpenOption, portOption, propsOption, configOption, browserOption, } = client_1.BrowserSafeApis.options;
9
+ const { benchmarkConcurrenciesOption, beepOnFinishOption, colorSpaceOption, concurrencyOption, disallowParallelEncodingOption, offthreadVideoCacheSizeInBytesOption, encodingBufferSizeOption, encodingMaxRateOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, numberOfGifLoopsOption, x264Option, enforceAudioOption, jpegQualityOption, audioBitrateOption, videoBitrateOption, audioCodecOption, publicPathOption, audioLatencyHintOption, darkModeOption, publicLicenseKeyOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, outDirOption, packageManagerOption, webpackPollOption, keyboardShortcutsOption, experimentalClientSideRenderingOption, experimentalVisualModeOption, imageSequencePatternOption, scaleOption, overwriteOption, crfOption, logLevelOption, videoCodecOption, stillFrameOption, imageSequenceOption, versionFlagOption, bundleCacheOption, envFileOption, glOption, runsOption, reproOption, mutedOption, headlessOption, disableGitSourceOption, delayRenderTimeoutInMillisecondsOption, framesOption, forSeamlessAacConcatenationOption, isProductionOption, noOpenOption, portOption, propsOption, configOption, browserOption, } = client_1.BrowserSafeApis.options;
10
10
  exports.BooleanFlags = [
11
11
  overwriteOption.cliFlag,
12
12
  imageSequenceOption.cliFlag,
package/dist/upgrade.js CHANGED
@@ -4,6 +4,7 @@ exports.upgradeCommand = void 0;
4
4
  const node_child_process_1 = require("node:child_process");
5
5
  const renderer_1 = require("@remotion/renderer");
6
6
  const studio_server_1 = require("@remotion/studio-server");
7
+ const catalog_utils_1 = require("./catalog-utils");
7
8
  const chalk_1 = require("./chalk");
8
9
  const extra_packages_1 = require("./extra-packages");
9
10
  const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
@@ -26,7 +27,8 @@ const getExtraPackageVersionsForRemotionVersion = (remotionVersion) => {
26
27
  }
27
28
  };
28
29
  const upgradeCommand = async ({ remotionRoot, packageManager, version, logLevel, args, }) => {
29
- const { dependencies, devDependencies, optionalDependencies, peerDependencies, } = studio_server_1.StudioServerInternals.getInstalledDependencies(remotionRoot);
30
+ var _a;
31
+ const depsWithVersions = studio_server_1.StudioServerInternals.getInstalledDependenciesWithVersions(remotionRoot);
30
32
  let targetVersion;
31
33
  if (version) {
32
34
  targetVersion = version;
@@ -48,32 +50,89 @@ const upgradeCommand = async ({ remotionRoot, packageManager, version, logLevel,
48
50
  .join(', ')}). Install dependencies using your favorite manager!`);
49
51
  }
50
52
  const allDeps = [
51
- ...dependencies,
52
- ...devDependencies,
53
- ...optionalDependencies,
54
- ...peerDependencies,
53
+ ...Object.keys(depsWithVersions.dependencies),
54
+ ...Object.keys(depsWithVersions.devDependencies),
55
+ ...Object.keys(depsWithVersions.optionalDependencies),
56
+ ...Object.keys(depsWithVersions.peerDependencies),
55
57
  ];
56
58
  const remotionToUpgrade = list_of_remotion_packages_1.listOfRemotionPackages.filter((u) => allDeps.includes(u));
57
- // Check if extra packages (zod, mediabunny) are installed
58
59
  const installedExtraPackages = Object.keys(extra_packages_1.EXTRA_PACKAGES).filter((pkg) => allDeps.includes(pkg));
59
- // Get the correct versions for extra packages for this Remotion version
60
60
  const extraPackageVersions = getExtraPackageVersionsForRemotionVersion(targetVersion);
61
- // Build the list of packages to upgrade
62
- const packagesWithVersions = [
63
- ...remotionToUpgrade.map((pkg) => `${pkg}@${targetVersion}`),
64
- ...installedExtraPackages.map((pkg) => `${pkg}@${extraPackageVersions[pkg]}`),
65
- ];
66
61
  if (installedExtraPackages.length > 0) {
67
62
  log_1.Log.info({ indent: false, logLevel }, `Also upgrading extra packages: ${installedExtraPackages.map((pkg) => `${pkg}@${extraPackageVersions[pkg]}`).join(', ')}`);
68
63
  }
69
- const command = studio_server_1.StudioServerInternals.getInstallCommand({
70
- manager: manager.manager,
71
- packages: packagesWithVersions,
72
- version: '',
73
- additionalArgs: args,
74
- });
75
- log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray(`$ ${manager.manager} ${command.join(' ')}`));
76
- const task = (0, node_child_process_1.spawn)(manager.manager, command, {
64
+ const allPackagesToUpgrade = [
65
+ ...remotionToUpgrade,
66
+ ...installedExtraPackages,
67
+ ];
68
+ const normalPackages = [];
69
+ const catalogPackages = [];
70
+ for (const pkg of allPackagesToUpgrade) {
71
+ const versionSpec = (0, catalog_utils_1.findVersionSpecifier)(depsWithVersions, pkg);
72
+ const targetVersionForPkg = (_a = extraPackageVersions[pkg]) !== null && _a !== void 0 ? _a : targetVersion;
73
+ if (versionSpec && (0, catalog_utils_1.isCatalogProtocol)(versionSpec)) {
74
+ catalogPackages.push({ pkg, version: targetVersionForPkg });
75
+ }
76
+ else {
77
+ normalPackages.push({ pkg, version: targetVersionForPkg });
78
+ }
79
+ }
80
+ if (catalogPackages.length > 0) {
81
+ const workspaceRoot = (0, catalog_utils_1.findWorkspaceRoot)(remotionRoot);
82
+ if (workspaceRoot) {
83
+ const updatedCatalogEntries = [];
84
+ for (const { pkg, version: pkgVersion } of catalogPackages) {
85
+ const didUpdate = (0, catalog_utils_1.updateCatalogEntry)({
86
+ workspaceRoot,
87
+ pkg,
88
+ newVersion: pkgVersion,
89
+ });
90
+ if (didUpdate) {
91
+ updatedCatalogEntries.push(`${pkg}@${pkgVersion}`);
92
+ }
93
+ else {
94
+ normalPackages.push({ pkg, version: pkgVersion });
95
+ }
96
+ }
97
+ if (updatedCatalogEntries.length > 0) {
98
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.green(`Updated catalog entries: ${updatedCatalogEntries.join(', ')}`));
99
+ }
100
+ }
101
+ else {
102
+ for (const catalogPkg of catalogPackages) {
103
+ normalPackages.push(catalogPkg);
104
+ }
105
+ }
106
+ }
107
+ const packagesWithVersions = normalPackages.map(({ pkg, version: pkgVersion }) => `${pkg}@${pkgVersion}`);
108
+ if (packagesWithVersions.length > 0) {
109
+ const command = studio_server_1.StudioServerInternals.getInstallCommand({
110
+ manager: manager.manager,
111
+ packages: packagesWithVersions,
112
+ version: '',
113
+ additionalArgs: args,
114
+ });
115
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray(`$ ${manager.manager} ${command.join(' ')}`));
116
+ await runPackageManagerCommand({
117
+ manager: manager.manager,
118
+ command,
119
+ logLevel,
120
+ });
121
+ }
122
+ if (catalogPackages.length > 0 && packagesWithVersions.length === 0) {
123
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray(`$ ${manager.manager} install`));
124
+ await runPackageManagerCommand({
125
+ manager: manager.manager,
126
+ command: ['install'],
127
+ logLevel,
128
+ });
129
+ }
130
+ log_1.Log.info({ indent: false, logLevel }, '⏫ Remotion has been upgraded!');
131
+ log_1.Log.info({ indent: false, logLevel }, 'https://remotion.dev/changelog');
132
+ };
133
+ exports.upgradeCommand = upgradeCommand;
134
+ const runPackageManagerCommand = async ({ manager, command, logLevel, }) => {
135
+ const task = (0, node_child_process_1.spawn)(manager, command, {
77
136
  env: {
78
137
  ...process.env,
79
138
  ADBLOCK: '1',
@@ -96,7 +155,4 @@ const upgradeCommand = async ({ remotionRoot, packageManager, version, logLevel,
96
155
  }
97
156
  });
98
157
  });
99
- log_1.Log.info({ indent: false, logLevel }, '⏫ Remotion has been upgraded!');
100
- log_1.Log.info({ indent: false, logLevel }, 'https://remotion.dev/changelog');
101
158
  };
102
- exports.upgradeCommand = upgradeCommand;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/cli"
4
4
  },
5
5
  "name": "@remotion/cli",
6
- "version": "4.0.429",
6
+ "version": "4.0.430",
7
7
  "description": "Control Remotion features using the `npx remotion` command",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "scripts": {
16
16
  "formatting": "oxfmt src --check",
17
+ "format": "oxfmt src",
17
18
  "lint": "eslint src",
18
19
  "test": "bun test src",
19
20
  "make": "tsgo -d"