@remotion/cli 4.0.172 → 4.0.173

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.
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/benchmark.js CHANGED
@@ -80,7 +80,7 @@ const makeBenchmarkProgressBar = ({ totalRuns, run, progress, doneIn, }) => {
80
80
  const totalProgress = (run + progress) / totalRuns;
81
81
  return [
82
82
  `Rendering (${run + 1} out of ${totalRuns} runs)`,
83
- (0, make_progress_bar_1.makeProgressBar)(totalProgress),
83
+ (0, make_progress_bar_1.makeProgressBar)(totalProgress, false),
84
84
  doneIn === null
85
85
  ? `${(totalProgress * 100).toFixed(2)}% `
86
86
  : chalk_1.chalk.gray(doneIn),
@@ -12,7 +12,7 @@ const makeDownloadProgress = ({ bytesDownloaded, totalBytes, doneIn, }) => {
12
12
  const progress = bytesDownloaded / totalBytes;
13
13
  return [
14
14
  ` +`,
15
- (0, make_progress_bar_1.makeProgressBar)(progress),
15
+ (0, make_progress_bar_1.makeProgressBar)(progress, false),
16
16
  `${doneIn ? 'Got' : 'Getting'} Headless Shell`,
17
17
  doneIn === null
18
18
  ? (progress * 100).toFixed(0) + '%'
@@ -1,3 +1,3 @@
1
1
  import type { DownloadProgress } from '@remotion/studio-server';
2
2
  export declare const getFileSizeDownloadBar: (downloaded: number) => string;
3
- export declare const makeMultiDownloadProgress: (progresses: DownloadProgress[]) => string | null;
3
+ export declare const makeMultiDownloadProgress: (progresses: DownloadProgress[], totalFrames: number) => string | null;
@@ -2,43 +2,44 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeMultiDownloadProgress = exports.getFileSizeDownloadBar = void 0;
4
4
  const studio_server_1 = require("@remotion/studio-server");
5
+ const studio_shared_1 = require("@remotion/studio-shared");
6
+ const chalk_1 = require("./chalk");
7
+ const make_link_1 = require("./hyperlinks/make-link");
5
8
  const make_progress_bar_1 = require("./make-progress-bar");
6
9
  const progress_bar_1 = require("./progress-bar");
7
10
  const truthy_1 = require("./truthy");
8
11
  const getFileSizeDownloadBar = (downloaded) => {
9
- const desiredLength = (0, make_progress_bar_1.makeProgressBar)(0).length;
10
- return `${studio_server_1.StudioServerInternals.formatBytes(downloaded).padEnd(desiredLength - 2, ' ')}`;
12
+ const desiredLength = (0, make_progress_bar_1.makeProgressBar)(0, true).length;
13
+ return `${studio_server_1.StudioServerInternals.formatBytes(downloaded).padEnd(desiredLength, ' ')}`;
11
14
  };
12
15
  exports.getFileSizeDownloadBar = getFileSizeDownloadBar;
13
- const makeMultiDownloadProgress = (progresses) => {
16
+ const makeMultiDownloadProgress = (progresses, totalFrames) => {
14
17
  if (progresses.length === 0) {
15
18
  return null;
16
19
  }
17
- if (progresses.length === 1) {
18
- const [progress] = progresses;
19
- const truncatedFileName = progress.name.length >= 60
20
- ? progress.name.substring(0, 57) + '...'
21
- : progress.name;
22
- return [
23
- `Downloading assets`.padEnd(progress_bar_1.LABEL_WIDTH, ' '),
24
- progress.progress
25
- ? (0, make_progress_bar_1.makeProgressBar)(progress.progress)
26
- : (0, exports.getFileSizeDownloadBar)(progress.downloaded),
27
- truncatedFileName,
28
- ]
29
- .filter(truthy_1.truthy)
30
- .join(' ');
31
- }
32
20
  const everyFileHasContentLength = progresses.every((p) => p.totalBytes !== null);
33
- return [
34
- `Downloading assets`.padEnd(progress_bar_1.LABEL_WIDTH, ' '),
21
+ const isDone = progresses.every((p) => p.progress === 1);
22
+ const topRow = [
23
+ (isDone ? `Downloaded assets` : 'Downloading assets').padEnd(progress_bar_1.LABEL_WIDTH, ' '),
35
24
  everyFileHasContentLength
36
25
  ? (0, make_progress_bar_1.makeProgressBar)(progresses.reduce((a, b) => a + b.progress, 0) /
37
- progresses.length)
26
+ progresses.length, false)
38
27
  : (0, exports.getFileSizeDownloadBar)(progresses.reduce((a, b) => a + b.downloaded, 0)),
39
- `${progresses.length} files`,
28
+ `${progresses.length} file${progresses.length === 1 ? '' : 's'}`.padStart((0, progress_bar_1.getRightLabelWidth)(totalFrames), ' '),
40
29
  ]
41
30
  .filter(truthy_1.truthy)
42
31
  .join(' ');
32
+ const downloadsToShow = progresses
33
+ .filter((p) => p.progress !== 1)
34
+ .slice(0, 2);
35
+ return [
36
+ topRow,
37
+ ...downloadsToShow.map((toShow) => {
38
+ const truncatedFileName = toShow.name.length >= 60
39
+ ? toShow.name.substring(0, 57) + '...'
40
+ : toShow.name;
41
+ return chalk_1.chalk.gray(`↓ ${(0, studio_shared_1.formatBytes)(toShow.downloaded).padEnd(8, ' ')} ${(0, make_link_1.makeHyperlink)({ url: toShow.name, fallback: truncatedFileName, text: truncatedFileName })}`);
42
+ }),
43
+ ].join('\n');
43
44
  };
44
45
  exports.makeMultiDownloadProgress = makeMultiDownloadProgress;
@@ -6,8 +6,8 @@ const formatEtaString = (timeRemainingInMilliseconds) => {
6
6
  // Get render estimated time value and extract hours, minutes, and seconds
7
7
  const remainingTime = timeRemainingInMilliseconds / 1000;
8
8
  const remainingTimeHours = Math.floor(remainingTime / 3600);
9
- const remainingTimeMinutes = Math.round((remainingTime % 3600) / 60);
10
- const remainingTimeSeconds = Math.round(remainingTime % 60);
9
+ const remainingTimeMinutes = Math.floor((remainingTime % 3600) / 60);
10
+ const remainingTimeSeconds = Math.floor(remainingTime % 60);
11
11
  // Create estimated time string by concatenating them with colons
12
12
  const estimatedTimeString = [
13
13
  remainingTimeHours ? `${remainingTimeHours}h` : null,
package/dist/get-env.js CHANGED
@@ -34,6 +34,7 @@ const node_fs_1 = __importStar(require("node:fs"));
34
34
  const node_path_1 = __importDefault(require("node:path"));
35
35
  const chalk_1 = require("./chalk");
36
36
  const config_1 = require("./config");
37
+ const make_link_1 = require("./hyperlinks/make-link");
37
38
  const log_1 = require("./log");
38
39
  const parsed_cli_1 = require("./parsed-cli");
39
40
  function getProcessEnv() {
@@ -86,7 +87,8 @@ const getEnvForEnvFile = ({ processEnv, envFile, onUpdate, logLevel, indent, })
86
87
  watchEnvFile({ processEnv, envFile, onUpdate, logLevel });
87
88
  }
88
89
  }
89
- log_1.Log.verbose({ indent, logLevel }, `Loaded env file from ${envFile}.`);
90
+ const relativeEnvFile = node_path_1.default.relative(process.cwd(), envFile);
91
+ log_1.Log.verbose({ indent, logLevel }, `Loaded env file from ${(0, make_link_1.makeHyperlink)({ fallback: envFile, text: relativeEnvFile, url: 'file://' + envFile })}.`);
90
92
  return {
91
93
  ...processEnv,
92
94
  ...dotenv_1.default.parse(envFileData),
@@ -0,0 +1,2 @@
1
+ /// <reference types="node" />
2
+ export declare function supportsHyperlink(stream: NodeJS.WriteStream): boolean;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ // From https://github.com/jamestalmage/supports-hyperlinks/blob/master/index.js
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.supportsHyperlink = void 0;
5
+ // MIT License
6
+ // Copyright (c) James Talmage <james@talmage.io> (github.com/jamestalmage)
7
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+ const renderer_1 = require("@remotion/renderer");
11
+ function parseVersion(versionString) {
12
+ if (/^\d{3,4}$/.test(versionString)) {
13
+ // Env var doesn't always use dots. example: 4601 => 46.1.0
14
+ const m = /(\d{1,2})(\d{2})/.exec(versionString) || [];
15
+ return {
16
+ major: 0,
17
+ minor: parseInt(m[1], 10),
18
+ patch: parseInt(m[2], 10),
19
+ };
20
+ }
21
+ const versions = (versionString || '').split('.').map((n) => parseInt(n, 10));
22
+ return {
23
+ major: versions[0],
24
+ minor: versions[1],
25
+ patch: versions[2],
26
+ };
27
+ }
28
+ function supportsHyperlink(stream) {
29
+ const { CI, FORCE_HYPERLINK, NETLIFY, TEAMCITY_VERSION, TERM_PROGRAM, TERM_PROGRAM_VERSION, VTE_VERSION, } = process.env;
30
+ if (FORCE_HYPERLINK) {
31
+ return !(FORCE_HYPERLINK.length > 0 && parseInt(FORCE_HYPERLINK, 10) === 0);
32
+ }
33
+ // Netlify does not run a TTY, it does not need `supportsColor` check
34
+ if (NETLIFY) {
35
+ return true;
36
+ }
37
+ // If they specify no colors, they probably don't want hyperlinks.
38
+ if (!renderer_1.RenderInternals.isColorSupported()) {
39
+ return false;
40
+ }
41
+ if (stream && !stream.isTTY) {
42
+ return false;
43
+ }
44
+ if (process.platform === 'win32') {
45
+ return false;
46
+ }
47
+ if (CI) {
48
+ return false;
49
+ }
50
+ if (TEAMCITY_VERSION) {
51
+ return false;
52
+ }
53
+ if (TERM_PROGRAM) {
54
+ const version = parseVersion(TERM_PROGRAM_VERSION || '');
55
+ switch (TERM_PROGRAM) {
56
+ case 'iTerm.app':
57
+ if (version.major === 3) {
58
+ return version.minor >= 1;
59
+ }
60
+ return version.major > 3;
61
+ case 'WezTerm':
62
+ return version.major >= 20200620;
63
+ case 'vscode':
64
+ // eslint-disable-next-line no-mixed-operators
65
+ return (version.major > 1 || (version.major === 1 && version.minor >= 72));
66
+ // No default
67
+ }
68
+ }
69
+ if (VTE_VERSION) {
70
+ // 0.50.0 was supposed to support hyperlinks, but throws a segfault
71
+ if (VTE_VERSION === '0.50.0') {
72
+ return false;
73
+ }
74
+ const version = parseVersion(VTE_VERSION);
75
+ return version.major > 0 || version.minor >= 50;
76
+ }
77
+ return false;
78
+ }
79
+ exports.supportsHyperlink = supportsHyperlink;
@@ -0,0 +1 @@
1
+ export declare function supportsHyperlink(): false | string;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ // From https://github.com/jamestalmage/supports-hyperlinks/blob/master/index.js
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.supportsHyperlink = void 0;
5
+ // MIT License
6
+ // Copyright (c) James Talmage <james@talmage.io> (github.com/jamestalmage)
7
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+ const renderer_1 = require("@remotion/renderer");
11
+ function parseVersion(versionString) {
12
+ if (/^\d{3,4}$/.test(versionString)) {
13
+ // Env var doesn't always use dots. example: 4601 => 46.1.0
14
+ const m = /(\d{1,2})(\d{2})/.exec(versionString) || [];
15
+ return {
16
+ major: 0,
17
+ minor: parseInt(m[1], 10),
18
+ patch: parseInt(m[2], 10),
19
+ };
20
+ }
21
+ const versions = (versionString || '').split('.').map((n) => parseInt(n, 10));
22
+ return {
23
+ major: versions[0],
24
+ minor: versions[1],
25
+ patch: versions[2],
26
+ };
27
+ }
28
+ function supportsHyperlink() {
29
+ const { CI, NETLIFY, TEAMCITY_VERSION, TERM_PROGRAM, TERM_PROGRAM_VERSION, VTE_VERSION, } = process.env;
30
+ // Netlify does not run a TTY, it does not need `supportsColor` check
31
+ if (NETLIFY) {
32
+ return 'Click';
33
+ }
34
+ // If they specify no colors, they probably don't want hyperlinks.
35
+ if (!renderer_1.RenderInternals.isColorSupported()) {
36
+ return false;
37
+ }
38
+ if (process.platform === 'win32') {
39
+ return false;
40
+ }
41
+ if (CI) {
42
+ return false;
43
+ }
44
+ if (TEAMCITY_VERSION) {
45
+ return false;
46
+ }
47
+ if (TERM_PROGRAM) {
48
+ const version = parseVersion(TERM_PROGRAM_VERSION || '');
49
+ switch (TERM_PROGRAM) {
50
+ case 'iTerm.app':
51
+ if (version.major === 3) {
52
+ return version.minor >= 1 ? 'Cmd+Click' : false;
53
+ }
54
+ return version.major > 3 ? 'Cmd+Click' : false;
55
+ case 'WezTerm':
56
+ return version.major >= 20200620 ? 'Click' : false;
57
+ case 'vscode':
58
+ // eslint-disable-next-line no-mixed-operators
59
+ return version.major > 1 || (version.major === 1 && version.minor >= 72)
60
+ ? process.platform === 'darwin'
61
+ ? 'Option+Click'
62
+ : 'Ctrl+Click'
63
+ : false;
64
+ // No default
65
+ }
66
+ }
67
+ if (VTE_VERSION) {
68
+ // 0.50.0 was supposed to support hyperlinks, but throws a segfault
69
+ if (VTE_VERSION === '0.50.0') {
70
+ return false;
71
+ }
72
+ const version = parseVersion(VTE_VERSION);
73
+ return version.major > 0 || version.minor >= 50 ? 'Click' : false;
74
+ }
75
+ return false;
76
+ }
77
+ exports.supportsHyperlink = supportsHyperlink;
@@ -0,0 +1,5 @@
1
+ export declare const makeHyperlink: ({ text, url, fallback, }: {
2
+ text: string | ((clickInstruction: string) => string);
3
+ url: string;
4
+ fallback: string;
5
+ }) => string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeHyperlink = void 0;
4
+ const is_supported_1 = require("./is-supported");
5
+ const OSC = '\u001B]';
6
+ const SEP = ';';
7
+ const BEL = '\u0007';
8
+ const makeHyperlink = ({ text, url, fallback, }) => {
9
+ const supports = (0, is_supported_1.supportsHyperlink)();
10
+ if (!supports) {
11
+ return fallback;
12
+ }
13
+ const label = typeof text === 'function' ? text(supports) : text;
14
+ return [OSC, '8', SEP, SEP, url, BEL, label, OSC, '8', SEP, SEP, BEL].join('');
15
+ };
16
+ exports.makeHyperlink = makeHyperlink;
@@ -0,0 +1,2 @@
1
+ /// <reference types="node" />
2
+ export declare function supportsHyperlink(stream: NodeJS.WriteStream): boolean;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ // From https://github.com/jamestalmage/supports-hyperlinks/blob/master/index.js
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.supportsHyperlink = void 0;
5
+ // MIT License
6
+ // Copyright (c) James Talmage <james@talmage.io> (github.com/jamestalmage)
7
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+ const renderer_1 = require("@remotion/renderer");
11
+ function parseVersion(versionString) {
12
+ if (/^\d{3,4}$/.test(versionString)) {
13
+ // Env var doesn't always use dots. example: 4601 => 46.1.0
14
+ const m = /(\d{1,2})(\d{2})/.exec(versionString) || [];
15
+ return {
16
+ major: 0,
17
+ minor: parseInt(m[1], 10),
18
+ patch: parseInt(m[2], 10),
19
+ };
20
+ }
21
+ const versions = (versionString || '').split('.').map((n) => parseInt(n, 10));
22
+ return {
23
+ major: versions[0],
24
+ minor: versions[1],
25
+ patch: versions[2],
26
+ };
27
+ }
28
+ function supportsHyperlink(stream) {
29
+ const { CI, FORCE_HYPERLINK, NETLIFY, TEAMCITY_VERSION, TERM_PROGRAM, TERM_PROGRAM_VERSION, VTE_VERSION, } = process.env;
30
+ if (FORCE_HYPERLINK) {
31
+ return !(FORCE_HYPERLINK.length > 0 && parseInt(FORCE_HYPERLINK, 10) === 0);
32
+ }
33
+ // Netlify does not run a TTY, it does not need `supportsColor` check
34
+ if (NETLIFY) {
35
+ return true;
36
+ }
37
+ // If they specify no colors, they probably don't want hyperlinks.
38
+ if (!renderer_1.RenderInternals.isColorSupported()) {
39
+ return false;
40
+ }
41
+ if (stream && !stream.isTTY) {
42
+ return false;
43
+ }
44
+ if (process.platform === 'win32') {
45
+ return false;
46
+ }
47
+ if (CI) {
48
+ return false;
49
+ }
50
+ if (TEAMCITY_VERSION) {
51
+ return false;
52
+ }
53
+ if (TERM_PROGRAM) {
54
+ const version = parseVersion(TERM_PROGRAM_VERSION || '');
55
+ switch (TERM_PROGRAM) {
56
+ case 'iTerm.app':
57
+ if (version.major === 3) {
58
+ return version.minor >= 1;
59
+ }
60
+ return version.major > 3;
61
+ case 'WezTerm':
62
+ return version.major >= 20200620;
63
+ case 'vscode':
64
+ // eslint-disable-next-line no-mixed-operators
65
+ return (version.major > 1 || (version.major === 1 && version.minor >= 72));
66
+ // No default
67
+ }
68
+ }
69
+ if (VTE_VERSION) {
70
+ // 0.50.0 was supposed to support hyperlinks, but throws a segfault
71
+ if (VTE_VERSION === '0.50.0') {
72
+ return false;
73
+ }
74
+ const version = parseVersion(VTE_VERSION);
75
+ return version.major > 0 || version.minor >= 50;
76
+ }
77
+ return false;
78
+ }
79
+ exports.supportsHyperlink = supportsHyperlink;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import minimist from 'minimist';
2
+ import { supportsHyperlink } from './hyperlinks/is-supported';
2
3
  export declare const cli: () => Promise<void>;
3
4
  export declare const CliInternals: {
4
5
  createOverwriteableCliOutput: (options: {
@@ -57,7 +58,7 @@ export declare const CliInternals: {
57
58
  bgMagentaBright: (str: string) => string;
58
59
  bgWhiteBright: (str: string) => string;
59
60
  };
60
- makeProgressBar: (percentage: number) => string;
61
+ makeProgressBar: (percentage: number, noColor: boolean) => string;
61
62
  Log: {
62
63
  verbose: (options: import("@remotion/renderer").LogOptions & {
63
64
  tag?: string | undefined;
@@ -168,11 +169,18 @@ export declare const CliInternals: {
168
169
  quiet: boolean;
169
170
  }) => import("@remotion/renderer").OnBrowserDownload;
170
171
  LABEL_WIDTH: number;
171
- printFact: (printLevel: "verbose" | "info" | "warn" | "error") => ({ indent, logLevel, left, right, color, }: {
172
+ printFact: (printLevel: "verbose" | "info" | "warn" | "error") => ({ indent, logLevel, left, right, color, link, }: {
172
173
  indent: boolean;
173
174
  logLevel: "verbose" | "info" | "warn" | "error";
174
175
  left: string;
175
176
  right: string;
177
+ link?: string | undefined;
176
178
  color: "blue" | "blueBright" | "gray" | undefined;
177
179
  }) => void;
180
+ makeHyperlink: ({ text, url, fallback, }: {
181
+ text: string | ((clickInstruction: string) => string);
182
+ url: string;
183
+ fallback: string;
184
+ }) => string;
185
+ supportsHyperlink: typeof supportsHyperlink;
178
186
  };
package/dist/index.js CHANGED
@@ -24,6 +24,8 @@ const get_cli_options_1 = require("./get-cli-options");
24
24
  const get_composition_with_dimension_override_1 = require("./get-composition-with-dimension-override");
25
25
  const get_config_file_name_1 = require("./get-config-file-name");
26
26
  const gpu_1 = require("./gpu");
27
+ const is_supported_1 = require("./hyperlinks/is-supported");
28
+ const make_link_1 = require("./hyperlinks/make-link");
27
29
  const image_formats_1 = require("./image-formats");
28
30
  const initialize_cli_1 = require("./initialize-cli");
29
31
  const lambda_command_1 = require("./lambda-command");
@@ -163,4 +165,6 @@ exports.CliInternals = {
163
165
  defaultBrowserDownloadProgress: browser_download_bar_1.defaultBrowserDownloadProgress,
164
166
  LABEL_WIDTH: progress_bar_1.LABEL_WIDTH,
165
167
  printFact: progress_bar_1.printFact,
168
+ makeHyperlink: make_link_1.makeHyperlink,
169
+ supportsHyperlink: is_supported_1.supportsHyperlink,
166
170
  };
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.initializeCli = void 0;
4
7
  const client_1 = require("@remotion/renderer/client");
8
+ const path_1 = __importDefault(require("path"));
5
9
  const get_config_file_name_1 = require("./get-config-file-name");
10
+ const make_link_1 = require("./hyperlinks/make-link");
6
11
  const log_1 = require("./log");
7
12
  const parse_command_line_1 = require("./parse-command-line");
8
13
  const parsed_cli_1 = require("./parsed-cli");
@@ -13,12 +18,16 @@ const initializeCli = async (remotionRoot) => {
13
18
  commandLine: parsed_cli_1.parsedCli,
14
19
  }).value;
15
20
  // Only now Log.verbose is available
16
- log_1.Log.verbose({ indent: false, logLevel }, 'Remotion root directory:', remotionRoot);
21
+ log_1.Log.verbose({ indent: false, logLevel }, 'Remotion root directory:', (0, make_link_1.makeHyperlink)({
22
+ fallback: remotionRoot,
23
+ text: path_1.default.relative(process.cwd(), remotionRoot) || '.',
24
+ url: `file://${remotionRoot}`,
25
+ }));
17
26
  if (remotionRoot !== process.cwd()) {
18
27
  log_1.Log.warn({ indent: false, logLevel }, `Warning: The root directory of your project is ${remotionRoot}, but you are executing this command from ${process.cwd()}. The recommendation is to execute commands from the root directory.`);
19
28
  }
20
29
  if (appliedName) {
21
- log_1.Log.verbose({ indent: false, logLevel }, `Applied configuration from ${appliedName}.`);
30
+ log_1.Log.verbose({ indent: false, logLevel }, `Applied configuration from ${(0, make_link_1.makeHyperlink)({ url: `file://${appliedName}`, text: path_1.default.relative(process.cwd(), appliedName), fallback: appliedName })}.`);
22
31
  }
23
32
  else {
24
33
  log_1.Log.verbose({ indent: false, logLevel }, 'No config file loaded.');
@@ -1 +1 @@
1
- export declare const makeProgressBar: (percentage: number) => string;
1
+ export declare const makeProgressBar: (percentage: number, noColor: boolean) => string;
@@ -7,8 +7,8 @@ const full = '━';
7
7
  const half = '╸';
8
8
  const half_right = '╺';
9
9
  const totalBars = 18;
10
- const makeProgressBar = (percentage) => {
11
- const color = renderer_1.RenderInternals.isColorSupported();
10
+ const makeProgressBar = (percentage, noColor) => {
11
+ const color = noColor ? false : renderer_1.RenderInternals.isColorSupported();
12
12
  const barsToShow = Math.floor(percentage * totalBars);
13
13
  const extraBar = (percentage * totalBars) % barsToShow;
14
14
  const grayBars = totalBars - barsToShow;
@@ -20,6 +20,9 @@ const makeProgressBar = (percentage) => {
20
20
  if (!showHalf && barsToShow > 0 && gray.length > 0 && color) {
21
21
  gray[0] = half_right;
22
22
  }
23
+ if (!color) {
24
+ return `${base}${gray.join('')}`;
25
+ }
23
26
  return `${chalk_1.chalk.blue(base)}${chalk_1.chalk.dim(gray.join(''))}`;
24
27
  };
25
28
  exports.makeProgressBar = makeProgressBar;
@@ -0,0 +1,6 @@
1
+ import type { OnArtifact } from '@remotion/renderer';
2
+ import type { ArtifactProgress } from '@remotion/studio-shared';
3
+ export declare const handleOnArtifact: (onProgress: (artifact: ArtifactProgress) => void) => {
4
+ onArtifact: OnArtifact;
5
+ initialProgress: ArtifactProgress;
6
+ };
@@ -0,0 +1,27 @@
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.handleOnArtifact = void 0;
7
+ const fs_1 = require("fs");
8
+ const path_1 = __importDefault(require("path"));
9
+ const handleOnArtifact = (onProgress) => {
10
+ const progress = { received: [] };
11
+ const onArtifact = (artifact) => {
12
+ // TODO: Normalize backslashes on Windows
13
+ const absoluteOutputDestination = path_1.default.join(process.cwd(), artifact.filename);
14
+ (0, fs_1.writeFileSync)(artifact.filename, artifact.content);
15
+ progress.received.push({
16
+ absoluteOutputDestination,
17
+ filename: artifact.filename,
18
+ sizeInBytes: artifact.content.length,
19
+ });
20
+ };
21
+ onProgress(progress);
22
+ return {
23
+ onArtifact,
24
+ initialProgress: progress,
25
+ };
26
+ };
27
+ exports.handleOnArtifact = handleOnArtifact;
@@ -147,17 +147,17 @@ declare const beepOnFinishOption: {
147
147
  description: () => import("react/jsx-runtime").JSX.Element;
148
148
  ssrName: "x264Preset";
149
149
  docLink: string;
150
- type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
150
+ type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
151
151
  getValue: ({ commandLine }: {
152
152
  commandLine: Record<string, unknown>;
153
153
  }) => {
154
- value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
154
+ value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
155
155
  source: string;
156
156
  } | {
157
157
  value: null;
158
158
  source: string;
159
159
  };
160
- setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
160
+ setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
161
161
  }, enforceAudioOption: {
162
162
  name: string;
163
163
  cliFlag: "enforce-audio-track";
@@ -18,6 +18,7 @@ export declare const makeBundlingAndCopyProgress: ({ bundling, copying, symLinks
18
18
  copying: CopyingState;
19
19
  symLinks: SymbolicLinksState;
20
20
  }) => string;
21
+ export declare const getRightLabelWidth: (totalFrames: number) => number;
21
22
  export declare const makeRenderingAndStitchingProgress: ({ prog, isUsingParallelEncoding, }: {
22
23
  prog: AggregateRenderProgress;
23
24
  isUsingParallelEncoding: boolean;
@@ -26,10 +27,11 @@ export declare const makeRenderingAndStitchingProgress: ({ prog, isUsingParallel
26
27
  progress: number;
27
28
  message: string;
28
29
  };
29
- export declare const printFact: (printLevel: LogLevel) => ({ indent, logLevel, left, right, color, }: {
30
+ export declare const printFact: (printLevel: LogLevel) => ({ indent, logLevel, left, right, color, link, }: {
30
31
  indent: boolean;
31
32
  logLevel: LogLevel;
32
33
  left: string;
33
34
  right: string;
35
+ link?: string | undefined;
34
36
  color: 'blue' | 'blueBright' | 'gray' | undefined;
35
37
  }) => void;
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printFact = exports.makeRenderingAndStitchingProgress = exports.makeBundlingAndCopyProgress = exports.createOverwriteableCliOutput = exports.LABEL_WIDTH = void 0;
3
+ exports.printFact = exports.makeRenderingAndStitchingProgress = exports.getRightLabelWidth = exports.makeBundlingAndCopyProgress = exports.createOverwriteableCliOutput = exports.LABEL_WIDTH = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
5
  const studio_server_1 = require("@remotion/studio-server");
6
6
  const chalk_1 = require("./chalk");
7
7
  const download_progress_1 = require("./download-progress");
8
8
  const eta_string_1 = require("./eta-string");
9
+ const make_link_1 = require("./hyperlinks/make-link");
9
10
  const log_1 = require("./log");
10
11
  const make_progress_bar_1 = require("./make-progress-bar");
11
12
  const truthy_1 = require("./truthy");
@@ -58,7 +59,7 @@ const makeBundlingProgress = ({ bundlingState, }) => {
58
59
  const { doneIn, progress } = bundlingState;
59
60
  return [
60
61
  `${doneIn ? 'Bundled' : 'Bundling'} code`.padEnd(exports.LABEL_WIDTH, ' '),
61
- (0, make_progress_bar_1.makeProgressBar)(progress),
62
+ (0, make_progress_bar_1.makeProgressBar)(progress, false),
62
63
  doneIn === null
63
64
  ? (progress * 100).toFixed(0) + '%'
64
65
  : chalk_1.chalk.gray(`${doneIn}ms`),
@@ -73,7 +74,9 @@ const makeCopyingProgress = (options) => {
73
74
  }
74
75
  return [
75
76
  'Copying public dir'.padEnd(exports.LABEL_WIDTH, ' '),
76
- options.doneIn ? (0, make_progress_bar_1.makeProgressBar)(1) : (0, download_progress_1.getFileSizeDownloadBar)(options.bytes),
77
+ options.doneIn
78
+ ? (0, make_progress_bar_1.makeProgressBar)(1, false)
79
+ : (0, download_progress_1.getFileSizeDownloadBar)(options.bytes),
77
80
  options.doneIn === null ? null : chalk_1.chalk.gray(`${options.doneIn}ms`),
78
81
  ]
79
82
  .filter(truthy_1.truthy)
@@ -114,10 +117,10 @@ const makeRenderingProgress = ({ frames, totalFrames, doneIn, timeRemainingInMil
114
117
  .filter(truthy_1.truthy)
115
118
  .join(' ')
116
119
  .padEnd(exports.LABEL_WIDTH, ' '),
117
- (0, make_progress_bar_1.makeProgressBar)(progress),
120
+ (0, make_progress_bar_1.makeProgressBar)(progress, false),
118
121
  doneIn === null
119
122
  ? [
120
- `${String(frames).padStart(String(totalFrames).length, ' ')}/${totalFrames}`,
123
+ `${frames}/${totalFrames}`.padStart((0, exports.getRightLabelWidth)(totalFrames)),
121
124
  timeRemainingInMilliseconds
122
125
  ? chalk_1.chalk.gray(`${(0, eta_string_1.formatEtaString)(timeRemainingInMilliseconds)} remaining`)
123
126
  : null,
@@ -129,6 +132,10 @@ const makeRenderingProgress = ({ frames, totalFrames, doneIn, timeRemainingInMil
129
132
  .filter(truthy_1.truthy)
130
133
  .join(' ');
131
134
  };
135
+ const getRightLabelWidth = (totalFrames) => {
136
+ return `${totalFrames}/${totalFrames}`.length;
137
+ };
138
+ exports.getRightLabelWidth = getRightLabelWidth;
132
139
  const makeStitchingProgress = ({ stitchingProgress, isUsingParallelEncoding, }) => {
133
140
  const { frames, totalFrames, doneIn, stage, codec } = stitchingProgress;
134
141
  const progress = frames / totalFrames;
@@ -141,7 +148,7 @@ const makeStitchingProgress = ({ stitchingProgress, isUsingParallelEncoding, })
141
148
  (stage === 'muxing' && isUsingParallelEncoding
142
149
  ? `${doneIn ? 'Muxed' : 'Muxing'} ${mediaType}`
143
150
  : `${doneIn ? 'Encoded' : 'Encoding'} ${mediaType}`).padEnd(exports.LABEL_WIDTH, ' '),
144
- (0, make_progress_bar_1.makeProgressBar)(progress),
151
+ (0, make_progress_bar_1.makeProgressBar)(progress, false),
145
152
  doneIn === null
146
153
  ? `${String(frames).padStart(String(totalFrames).length, ' ')}/${totalFrames}`
147
154
  : chalk_1.chalk.gray(`${doneIn}ms`),
@@ -150,10 +157,11 @@ const makeStitchingProgress = ({ stitchingProgress, isUsingParallelEncoding, })
150
157
  .join(' ');
151
158
  };
152
159
  const makeRenderingAndStitchingProgress = ({ prog, isUsingParallelEncoding, }) => {
160
+ var _a;
153
161
  const { rendering, stitching, downloads, bundling } = prog;
154
162
  const output = [
155
163
  rendering ? makeRenderingProgress(rendering) : null,
156
- (0, download_progress_1.makeMultiDownloadProgress)(downloads),
164
+ (0, download_progress_1.makeMultiDownloadProgress)(downloads, (_a = rendering === null || rendering === void 0 ? void 0 : rendering.totalFrames) !== null && _a !== void 0 ? _a : 0),
157
165
  stitching === null
158
166
  ? null
159
167
  : makeStitchingProgress({
@@ -204,7 +212,7 @@ const getGuiProgressSubtitle = (progress) => {
204
212
  }
205
213
  return `Stitched ${progress.stitching.frames}/${progress.stitching.totalFrames}`;
206
214
  };
207
- const printFact = (printLevel) => ({ indent, logLevel, left, right, color, }) => {
215
+ const printFact = (printLevel) => ({ indent, logLevel, left, right, color, link, }) => {
208
216
  const fn = (str) => {
209
217
  if (color === 'gray') {
210
218
  return chalk_1.chalk.gray(str);
@@ -221,7 +229,16 @@ const printFact = (printLevel) => ({ indent, logLevel, left, right, color, }) =>
221
229
  log_1.Log[printLevel]({ indent, logLevel }, fn(`${left} = ${right}`));
222
230
  return;
223
231
  }
224
- const leftPadded = left.padEnd(exports.LABEL_WIDTH, ' ');
232
+ let leftPadded = left.padEnd(exports.LABEL_WIDTH, ' ');
233
+ if (link) {
234
+ const endPadding = exports.LABEL_WIDTH - left.length;
235
+ leftPadded =
236
+ (0, make_link_1.makeHyperlink)({
237
+ text: left,
238
+ fallback: left,
239
+ url: link,
240
+ }) + ' '.repeat(endPadding);
241
+ }
225
242
  log_1.Log[printLevel]({ indent, logLevel }, fn(`${leftPadded} ${right}`));
226
243
  };
227
244
  exports.printFact = printFact;
@@ -39,6 +39,7 @@ const config_1 = require("../config");
39
39
  const get_cli_options_1 = require("../get-cli-options");
40
40
  const get_composition_with_dimension_override_1 = require("../get-composition-with-dimension-override");
41
41
  const get_filename_1 = require("../get-filename");
42
+ const make_link_1 = require("../hyperlinks/make-link");
42
43
  const image_formats_1 = require("../image-formats");
43
44
  const log_1 = require("../log");
44
45
  const make_on_download_1 = require("../make-on-download");
@@ -217,11 +218,13 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
217
218
  .filter(truthy_1.truthy)
218
219
  .join(' '),
219
220
  color: 'gray',
221
+ link: 'https://www.remotion.dev/docs/terminology/composition',
220
222
  });
221
223
  (0, progress_bar_1.printFact)('info')({
222
224
  indent,
223
225
  logLevel,
224
226
  left: 'Codec',
227
+ link: 'https://www.remotion.dev/docs/encoding',
225
228
  right: [codec, isVerbose ? `(${codecReason})` : null]
226
229
  .filter(truthy_1.truthy)
227
230
  .join(' '),
@@ -238,6 +241,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
238
241
  indent,
239
242
  logLevel,
240
243
  left: 'Concurrency',
244
+ link: 'https://www.remotion.dev/docs/terminology/concurrency',
241
245
  right: `${actualConcurrency}x`,
242
246
  color: 'gray',
243
247
  });
@@ -400,7 +404,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
400
404
  if (!updatesDontOverwrite) {
401
405
  updateRenderProgress({ newline: true, printToConsole: true });
402
406
  }
403
- log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${(exists ? '○' : '+').padEnd(progress_bar_1.LABEL_WIDTH)} ${relativeOutputLocation}`));
407
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${(exists ? '○' : '+').padEnd(progress_bar_1.LABEL_WIDTH)} ${(0, make_link_1.makeHyperlink)({ url: `file://${absoluteOutputFile}`, text: relativeOutputLocation, fallback: relativeOutputLocation })}`));
404
408
  if (absoluteSeparateAudioTo) {
405
409
  log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${(audioExists ? '○' : '+').padEnd(progress_bar_1.LABEL_WIDTH, ' ')} ${absoluteSeparateAudioTo}`));
406
410
  }
@@ -16,6 +16,7 @@ const config_1 = require("../config");
16
16
  const determine_image_format_1 = require("../determine-image-format");
17
17
  const get_cli_options_1 = require("../get-cli-options");
18
18
  const get_composition_with_dimension_override_1 = require("../get-composition-with-dimension-override");
19
+ const make_link_1 = require("../hyperlinks/make-link");
19
20
  const log_1 = require("../log");
20
21
  const make_on_download_1 = require("../make-on-download");
21
22
  const parsed_cli_1 = require("../parsed-cli");
@@ -155,6 +156,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
155
156
  (0, progress_bar_1.printFact)('info')({
156
157
  indent,
157
158
  left: 'Composition',
159
+ link: 'https://remotion.dev/docs/terminology/composition',
158
160
  logLevel,
159
161
  right: [compositionId, isVerbose ? `(${reason})` : null]
160
162
  .filter(truthy_1.truthy)
@@ -239,6 +241,6 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
239
241
  printToConsole: true,
240
242
  isUsingParallelEncoding: false,
241
243
  });
242
- log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${(exists ? '○' : '+').padEnd(progress_bar_1.LABEL_WIDTH)} ${relativeOutputLocation}`));
244
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${(exists ? '○' : '+').padEnd(progress_bar_1.LABEL_WIDTH)} ${(0, make_link_1.makeHyperlink)({ url: 'file://' + absoluteOutputLocation, text: relativeOutputLocation, fallback: relativeOutputLocation })}`));
243
245
  };
244
246
  exports.renderStillFlow = renderStillFlow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.172",
3
+ "version": "4.0.173",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -32,14 +32,14 @@
32
32
  "dotenv": "9.0.2",
33
33
  "minimist": "1.2.6",
34
34
  "prompts": "2.4.2",
35
- "@remotion/bundler": "4.0.172",
36
- "@remotion/media-utils": "4.0.172",
37
- "@remotion/renderer": "4.0.172",
38
- "@remotion/studio-shared": "4.0.172",
39
- "@remotion/player": "4.0.172",
40
- "@remotion/studio-server": "4.0.172",
41
- "remotion": "4.0.172",
42
- "@remotion/studio": "4.0.172"
35
+ "@remotion/bundler": "4.0.173",
36
+ "@remotion/media-utils": "4.0.173",
37
+ "@remotion/studio-shared": "4.0.173",
38
+ "@remotion/player": "4.0.173",
39
+ "@remotion/studio-server": "4.0.173",
40
+ "remotion": "4.0.173",
41
+ "@remotion/studio": "4.0.173",
42
+ "@remotion/renderer": "4.0.173"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -63,10 +63,10 @@
63
63
  "react-dom": "18.3.1",
64
64
  "vitest": "0.31.1",
65
65
  "zod": "3.22.3",
66
- "@remotion/zod-types": "4.0.172",
67
- "@remotion/tailwind": "4.0.172",
68
- "@remotion/enable-scss": "4.0.172",
69
- "@remotion/skia": "4.0.172"
66
+ "@remotion/tailwind": "4.0.173",
67
+ "@remotion/zod-types": "4.0.173",
68
+ "@remotion/enable-scss": "4.0.173",
69
+ "@remotion/skia": "4.0.173"
70
70
  },
71
71
  "keywords": [
72
72
  "remotion",