@remotion/renderer 4.1.0-alpha1 → 4.1.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/download-and-map-assets-to-file.d.ts +2 -4
- package/dist/assets/download-and-map-assets-to-file.js +14 -10
- package/dist/assets/download-map.d.ts +4 -0
- package/dist/assets/download-map.js +3 -0
- package/dist/audio-codec.d.ts +1 -1
- package/dist/browser/Browser.d.ts +7 -6
- package/dist/browser/Browser.js +13 -13
- package/dist/browser/BrowserPage.d.ts +21 -6
- package/dist/browser/BrowserPage.js +80 -19
- package/dist/browser/BrowserRunner.d.ts +0 -1
- package/dist/browser/BrowserRunner.js +6 -6
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +11 -3
- package/dist/browser/ConsoleMessage.d.ts +8 -1
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/DOMWorld.d.ts +10 -4
- package/dist/browser/DOMWorld.js +16 -15
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.d.ts +3 -6
- package/dist/browser/FrameManager.js +11 -16
- package/dist/browser/LaunchOptions.d.ts +2 -0
- package/dist/browser/Launcher.js +3 -3
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/Target.d.ts +2 -1
- package/dist/browser/Target.js +3 -1
- package/dist/browser/create-browser-fetcher.js +19 -24
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +14 -0
- package/dist/chalk/index.d.ts +2 -1
- package/dist/chalk/index.js +3 -8
- package/dist/chalk/is-color-supported.d.ts +1 -1
- package/dist/chalk/is-color-supported.js +18 -10
- package/dist/client.d.ts +26 -31
- package/dist/compositor/compose.js +6 -1
- package/dist/compositor/compositor.d.ts +3 -2
- package/dist/compositor/compositor.js +10 -10
- package/dist/compositor/payloads.d.ts +15 -1
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/cycle-browser-tabs.d.ts +2 -1
- package/dist/cycle-browser-tabs.js +2 -2
- package/dist/format-logs.d.ts +3 -0
- package/dist/format-logs.js +207 -0
- package/dist/get-browser-instance.d.ts +3 -2
- package/dist/get-browser-instance.js +5 -5
- package/dist/get-bundle-url-from-serve-url.d.ts +2 -0
- package/dist/get-bundle-url-from-serve-url.js +30 -0
- package/dist/get-compositions.d.ts +7 -6
- package/dist/get-compositions.js +21 -11
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-local-browser-executable.js +15 -0
- package/dist/get-video-metadata.d.ts +2 -0
- package/dist/get-video-metadata.js +14 -0
- package/dist/index.d.ts +64 -61
- package/dist/index.js +3 -1
- package/dist/logger.d.ts +2 -2
- package/dist/logger.js +23 -18
- package/dist/offthread-video-server.d.ts +3 -3
- package/dist/offthread-video-server.js +65 -29
- package/dist/open-browser.d.ts +3 -2
- package/dist/open-browser.js +7 -5
- package/dist/options/crf.js +1 -1
- package/dist/options/video-codec.js +1 -1
- package/dist/perf.js +4 -2
- package/dist/prepare-server.d.ts +4 -5
- package/dist/prepare-server.js +16 -14
- package/dist/prespawn-ffmpeg.d.ts +2 -1
- package/dist/prespawn-ffmpeg.js +3 -31
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +16 -8
- package/dist/render-frames.js +50 -22
- package/dist/render-media.d.ts +17 -9
- package/dist/render-media.js +41 -26
- package/dist/render-still.d.ts +13 -6
- package/dist/render-still.js +32 -17
- package/dist/replace-browser.d.ts +2 -1
- package/dist/replace-browser.js +2 -2
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.d.ts +8 -2
- package/dist/seek-to-frame.js +87 -25
- package/dist/select-composition.d.ts +10 -5
- package/dist/select-composition.js +39 -18
- package/dist/serialize-props.d.ts +6 -0
- package/dist/serialize-props.js +36 -0
- package/dist/serve-handler/index.js +1 -1
- package/dist/serve-static.d.ts +2 -3
- package/dist/serve-static.js +10 -4
- package/dist/set-props-and-env.d.ts +4 -1
- package/dist/set-props-and-env.js +52 -22
- package/dist/stitch-frames-to-video.d.ts +2 -1
- package/dist/stitch-frames-to-video.js +12 -22
- package/dist/symbolicate-stacktrace.d.ts +3 -2
- package/dist/symbolicate-stacktrace.js +14 -7
- package/dist/take-frame-and-compose.js +1 -1
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +10 -10
package/dist/get-compositions.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompositions = exports.internalGetCompositions = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
4
5
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
5
6
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
6
7
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
7
8
|
const get_browser_instance_1 = require("./get-browser-instance");
|
|
9
|
+
const logger_1 = require("./logger");
|
|
8
10
|
const prepare_server_1 = require("./prepare-server");
|
|
9
11
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
10
12
|
const seek_to_frame_1 = require("./seek-to-frame");
|
|
11
13
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
12
14
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
13
|
-
const innerGetCompositions = async ({ envVariables,
|
|
15
|
+
const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, onBrowserLog, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, }) => {
|
|
14
16
|
if (onBrowserLog) {
|
|
15
17
|
page.on('console', (log) => {
|
|
16
18
|
onBrowserLog({
|
|
@@ -22,7 +24,7 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
22
24
|
}
|
|
23
25
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
24
26
|
await (0, set_props_and_env_1.setPropsAndEnv)({
|
|
25
|
-
|
|
27
|
+
serializedInputPropsWithCustomSchema,
|
|
26
28
|
envVariables,
|
|
27
29
|
page,
|
|
28
30
|
serveUrl,
|
|
@@ -32,6 +34,8 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
32
34
|
retriesRemaining: 2,
|
|
33
35
|
audioEnabled: false,
|
|
34
36
|
videoEnabled: false,
|
|
37
|
+
indent,
|
|
38
|
+
logLevel,
|
|
35
39
|
});
|
|
36
40
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
37
41
|
page,
|
|
@@ -43,8 +47,8 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
43
47
|
frame: null,
|
|
44
48
|
args: [],
|
|
45
49
|
});
|
|
46
|
-
await (0, seek_to_frame_1.waitForReady)(page);
|
|
47
|
-
const result = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
50
|
+
await (0, seek_to_frame_1.waitForReady)({ page, timeoutInMilliseconds, frame: null });
|
|
51
|
+
const { value: result } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
48
52
|
pageFunction: () => {
|
|
49
53
|
return window.getStaticCompositions();
|
|
50
54
|
},
|
|
@@ -54,7 +58,7 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
54
58
|
});
|
|
55
59
|
return result;
|
|
56
60
|
};
|
|
57
|
-
const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent,
|
|
61
|
+
const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }) => {
|
|
58
62
|
const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
59
63
|
passedInInstance: puppeteerInstance,
|
|
60
64
|
browserExecutable,
|
|
@@ -62,7 +66,7 @@ const internalGetCompositions = async ({ browserExecutable, chromiumOptions, env
|
|
|
62
66
|
context: null,
|
|
63
67
|
forceDeviceScaleFactor: undefined,
|
|
64
68
|
indent,
|
|
65
|
-
|
|
69
|
+
logLevel,
|
|
66
70
|
});
|
|
67
71
|
const cleanup = [cleanupPage];
|
|
68
72
|
return new Promise((resolve, reject) => {
|
|
@@ -77,7 +81,7 @@ const internalGetCompositions = async ({ browserExecutable, chromiumOptions, env
|
|
|
77
81
|
port,
|
|
78
82
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
79
83
|
concurrency: 1,
|
|
80
|
-
|
|
84
|
+
logLevel,
|
|
81
85
|
indent,
|
|
82
86
|
}, {
|
|
83
87
|
onDownload: () => undefined,
|
|
@@ -88,12 +92,14 @@ const internalGetCompositions = async ({ browserExecutable, chromiumOptions, env
|
|
|
88
92
|
cleanup.push(() => cleanupServer(true));
|
|
89
93
|
return innerGetCompositions({
|
|
90
94
|
envVariables,
|
|
91
|
-
|
|
95
|
+
serializedInputPropsWithCustomSchema,
|
|
92
96
|
onBrowserLog,
|
|
93
97
|
page,
|
|
94
98
|
proxyPort: offthreadPort,
|
|
95
99
|
serveUrl,
|
|
96
100
|
timeoutInMilliseconds,
|
|
101
|
+
indent,
|
|
102
|
+
logLevel,
|
|
97
103
|
});
|
|
98
104
|
})
|
|
99
105
|
.then((comp) => {
|
|
@@ -115,12 +121,16 @@ exports.internalGetCompositions = internalGetCompositions;
|
|
|
115
121
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
|
|
116
122
|
*/
|
|
117
123
|
const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
118
|
-
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds,
|
|
124
|
+
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel, } = config !== null && config !== void 0 ? config : {};
|
|
119
125
|
return (0, exports.internalGetCompositions)({
|
|
120
126
|
browserExecutable: browserExecutable !== null && browserExecutable !== void 0 ? browserExecutable : null,
|
|
121
127
|
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
122
128
|
envVariables: envVariables !== null && envVariables !== void 0 ? envVariables : {},
|
|
123
|
-
|
|
129
|
+
serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
130
|
+
data: inputProps !== null && inputProps !== void 0 ? inputProps : {},
|
|
131
|
+
indent: undefined,
|
|
132
|
+
staticBase: null,
|
|
133
|
+
}).serializedString,
|
|
124
134
|
indent: false,
|
|
125
135
|
onBrowserLog: onBrowserLog !== null && onBrowserLog !== void 0 ? onBrowserLog : null,
|
|
126
136
|
port: port !== null && port !== void 0 ? port : null,
|
|
@@ -128,7 +138,7 @@ const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
128
138
|
serveUrlOrWebpackUrl,
|
|
129
139
|
server: undefined,
|
|
130
140
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
131
|
-
|
|
141
|
+
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : (0, logger_1.getLogLevel)(),
|
|
132
142
|
});
|
|
133
143
|
};
|
|
134
144
|
exports.getCompositions = getCompositions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
2
|
import type { Codec } from './codec';
|
|
3
3
|
import type { FileExtension } from './file-extensions';
|
|
4
|
-
export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
5
|
-
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
4
|
+
export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
|
|
5
|
+
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif")[]>;
|
|
6
6
|
export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getLocalBrowserExecutable = exports.ensureLocalBrowser = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
8
9
|
const BrowserFetcher_1 = require("./browser/BrowserFetcher");
|
|
9
10
|
const create_browser_fetcher_1 = require("./browser/create-browser-fetcher");
|
|
10
11
|
const revisions_1 = require("./browser/revisions");
|
|
@@ -28,6 +29,20 @@ const getSearchPathsForProduct = (product) => {
|
|
|
28
29
|
process.platform === 'win32'
|
|
29
30
|
? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
|
|
30
31
|
: null,
|
|
32
|
+
process.platform === 'win32'
|
|
33
|
+
? node_os_1.default.homedir() +
|
|
34
|
+
'\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe'
|
|
35
|
+
: null,
|
|
36
|
+
process.platform === 'win32'
|
|
37
|
+
? 'C:\\Program Files\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
38
|
+
: null,
|
|
39
|
+
process.platform === 'win32'
|
|
40
|
+
? 'C:\\Program Files (x86)\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
41
|
+
: null,
|
|
42
|
+
process.platform === 'win32'
|
|
43
|
+
? node_os_1.default.homedir() +
|
|
44
|
+
'\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
45
|
+
: null,
|
|
31
46
|
].filter(Boolean);
|
|
32
47
|
}
|
|
33
48
|
if (product === 'firefox') {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVideoMetadata = void 0;
|
|
4
|
+
const compositor_1 = require("./compositor/compositor");
|
|
5
|
+
const getVideoMetadata = async (videoSource) => {
|
|
6
|
+
const compositor = (0, compositor_1.startLongRunningCompositor)((0, compositor_1.getIdealMaximumFrameCacheItems)(), 'info', false);
|
|
7
|
+
const metadataResponse = await compositor.executeCommand('GetVideoMetadata', {
|
|
8
|
+
src: videoSource,
|
|
9
|
+
});
|
|
10
|
+
compositor.finishCommands();
|
|
11
|
+
await compositor.waitForDone();
|
|
12
|
+
return JSON.parse(metadataResponse.toString('utf-8'));
|
|
13
|
+
};
|
|
14
|
+
exports.getVideoMetadata = getVideoMetadata;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import execa from 'execa';
|
|
3
2
|
import { HeadlessBrowser } from './browser/Browser';
|
|
4
3
|
import { SymbolicateableError } from './error-handling/symbolicateable-error';
|
|
@@ -17,6 +16,7 @@ export type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
|
17
16
|
export { FileExtension } from './file-extensions';
|
|
18
17
|
export { FrameRange } from './frame-range';
|
|
19
18
|
export { getCompositions, GetCompositionsOptions } from './get-compositions';
|
|
19
|
+
export { getVideoMetadata } from './get-video-metadata';
|
|
20
20
|
export { ImageFormat, StillImageFormat, validateSelectedPixelFormatAndImageFormatCombination, VideoImageFormat, } from './image-format';
|
|
21
21
|
export type { LogLevel } from './log-level';
|
|
22
22
|
export { CancelSignal, makeCancelSignal } from './make-cancel-signal';
|
|
@@ -43,21 +43,20 @@ export declare const RenderInternals: {
|
|
|
43
43
|
downloadMap: import("./assets/download-map").DownloadMap;
|
|
44
44
|
remotionRoot: string;
|
|
45
45
|
concurrency: number;
|
|
46
|
-
|
|
46
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
47
47
|
indent: boolean;
|
|
48
48
|
}) => Promise<{
|
|
49
49
|
port: number;
|
|
50
50
|
close: () => Promise<void>;
|
|
51
51
|
compositor: import("./compositor/compositor").Compositor;
|
|
52
|
-
events: import("./offthread-video-server").OffthreadVideoServerEmitter;
|
|
53
52
|
}>;
|
|
54
53
|
validateEvenDimensionsWithCodec: ({ width, height, codec, scale, }: {
|
|
55
54
|
width: number;
|
|
56
55
|
height: number;
|
|
57
56
|
scale: number;
|
|
58
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
57
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
59
58
|
}) => void;
|
|
60
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
59
|
+
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
|
|
61
60
|
tmpDir: (str: string) => string;
|
|
62
61
|
deleteDirectory: (directory: string) => void;
|
|
63
62
|
isServeUrl: (potentialUrl: string) => boolean;
|
|
@@ -107,23 +106,23 @@ export declare const RenderInternals: {
|
|
|
107
106
|
};
|
|
108
107
|
registerErrorSymbolicationLock: () => number;
|
|
109
108
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
110
|
-
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
109
|
+
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
|
|
111
110
|
mimeContentType: typeof mimeContentType;
|
|
112
111
|
mimeLookup: typeof mimeLookup;
|
|
113
112
|
validateConcurrency: (value: unknown, setting: string) => void;
|
|
114
113
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
115
114
|
DEFAULT_BROWSER: import("./browser").Browser;
|
|
116
115
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
117
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
118
|
-
validateOpenGlRenderer: (option: "
|
|
116
|
+
DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | null;
|
|
117
|
+
validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | null) => "swangle" | "angle" | "egl" | "swiftshader" | null;
|
|
119
118
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
120
119
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
121
120
|
validateJpegQuality: (q: number | undefined) => void;
|
|
122
121
|
DEFAULT_TIMEOUT: number;
|
|
123
|
-
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "
|
|
124
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
122
|
+
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
123
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
125
124
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
126
|
-
isEqualOrBelowLogLevel: (currentLevel: "
|
|
125
|
+
isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
|
|
127
126
|
isValidLogLevel: (level: string) => boolean;
|
|
128
127
|
perf: typeof perf;
|
|
129
128
|
convertToPositiveFrameIndex: ({ frame, durationInFrames, }: {
|
|
@@ -138,7 +137,7 @@ export declare const RenderInternals: {
|
|
|
138
137
|
output: string;
|
|
139
138
|
onProgress: (p: number) => void;
|
|
140
139
|
numberOfFrames: number;
|
|
141
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
140
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
142
141
|
fps: number;
|
|
143
142
|
numberOfGifLoops: number | null;
|
|
144
143
|
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
@@ -146,7 +145,7 @@ export declare const RenderInternals: {
|
|
|
146
145
|
getMinConcurrency: () => number;
|
|
147
146
|
getMaxConcurrency: () => any;
|
|
148
147
|
getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
149
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
148
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
150
149
|
preferLossless: boolean;
|
|
151
150
|
}) => "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
152
151
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
@@ -203,10 +202,10 @@ export declare const RenderInternals: {
|
|
|
203
202
|
};
|
|
204
203
|
};
|
|
205
204
|
};
|
|
206
|
-
|
|
205
|
+
prores: {
|
|
207
206
|
default: import("./file-extensions").FileExtension;
|
|
208
207
|
forAudioCodec: {
|
|
209
|
-
|
|
208
|
+
aac: {
|
|
210
209
|
possible: import("./file-extensions").FileExtension[];
|
|
211
210
|
default: import("./file-extensions").FileExtension;
|
|
212
211
|
};
|
|
@@ -216,10 +215,10 @@ export declare const RenderInternals: {
|
|
|
216
215
|
};
|
|
217
216
|
};
|
|
218
217
|
};
|
|
219
|
-
|
|
218
|
+
mp3: {
|
|
220
219
|
default: import("./file-extensions").FileExtension;
|
|
221
220
|
forAudioCodec: {
|
|
222
|
-
|
|
221
|
+
mp3: {
|
|
223
222
|
possible: import("./file-extensions").FileExtension[];
|
|
224
223
|
default: import("./file-extensions").FileExtension;
|
|
225
224
|
};
|
|
@@ -229,22 +228,22 @@ export declare const RenderInternals: {
|
|
|
229
228
|
};
|
|
230
229
|
};
|
|
231
230
|
};
|
|
232
|
-
|
|
231
|
+
aac: {
|
|
233
232
|
default: import("./file-extensions").FileExtension;
|
|
234
233
|
forAudioCodec: {
|
|
234
|
+
aac: {
|
|
235
|
+
possible: import("./file-extensions").FileExtension[];
|
|
236
|
+
default: import("./file-extensions").FileExtension;
|
|
237
|
+
};
|
|
235
238
|
"pcm-16": {
|
|
236
239
|
possible: import("./file-extensions").FileExtension[];
|
|
237
240
|
default: import("./file-extensions").FileExtension;
|
|
238
241
|
};
|
|
239
242
|
};
|
|
240
243
|
};
|
|
241
|
-
|
|
244
|
+
wav: {
|
|
242
245
|
default: import("./file-extensions").FileExtension;
|
|
243
246
|
forAudioCodec: {
|
|
244
|
-
aac: {
|
|
245
|
-
possible: import("./file-extensions").FileExtension[];
|
|
246
|
-
default: import("./file-extensions").FileExtension;
|
|
247
|
-
};
|
|
248
247
|
"pcm-16": {
|
|
249
248
|
possible: import("./file-extensions").FileExtension[];
|
|
250
249
|
default: import("./file-extensions").FileExtension;
|
|
@@ -262,19 +261,14 @@ export declare const RenderInternals: {
|
|
|
262
261
|
};
|
|
263
262
|
gif: {
|
|
264
263
|
default: import("./file-extensions").FileExtension;
|
|
265
|
-
forAudioCodec: {
|
|
266
|
-
[x: string]: {
|
|
267
|
-
possible: import("./file-extensions").FileExtension[];
|
|
268
|
-
default: import("./file-extensions").FileExtension;
|
|
269
|
-
};
|
|
270
|
-
};
|
|
264
|
+
forAudioCodec: {};
|
|
271
265
|
};
|
|
272
266
|
};
|
|
273
267
|
supportedAudioCodecs: {
|
|
274
268
|
readonly h264: readonly ["aac", "pcm-16"];
|
|
275
269
|
readonly 'h264-mkv': readonly ["pcm-16"];
|
|
276
270
|
readonly aac: readonly ["aac", "pcm-16"];
|
|
277
|
-
readonly gif:
|
|
271
|
+
readonly gif: readonly [];
|
|
278
272
|
readonly h265: readonly ["aac", "pcm-16"];
|
|
279
273
|
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
280
274
|
readonly prores: readonly ["aac", "pcm-16"];
|
|
@@ -282,8 +276,8 @@ export declare const RenderInternals: {
|
|
|
282
276
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
283
277
|
readonly wav: readonly ["pcm-16"];
|
|
284
278
|
};
|
|
285
|
-
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
286
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
279
|
+
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif")[]>;
|
|
280
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">;
|
|
287
281
|
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
|
|
288
282
|
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
289
283
|
dynamicLibraryPathOptions: () => {
|
|
@@ -300,11 +294,11 @@ export declare const RenderInternals: {
|
|
|
300
294
|
};
|
|
301
295
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
302
296
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
303
|
-
DEFAULT_STILL_IMAGE_FORMAT: "
|
|
304
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
297
|
+
DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
|
|
298
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
|
|
305
299
|
DEFAULT_JPEG_QUALITY: number;
|
|
306
300
|
chalk: {
|
|
307
|
-
enabled: boolean;
|
|
301
|
+
enabled: () => boolean;
|
|
308
302
|
visible: boolean;
|
|
309
303
|
styles: Record<string, {
|
|
310
304
|
codes: [number, number];
|
|
@@ -328,6 +322,7 @@ export declare const RenderInternals: {
|
|
|
328
322
|
yellow: (str: string) => string;
|
|
329
323
|
blue: (str: string) => string;
|
|
330
324
|
magenta: (str: string) => string;
|
|
325
|
+
cyan: (str: string) => string;
|
|
331
326
|
white: (str: string) => string;
|
|
332
327
|
gray: (str: string) => string;
|
|
333
328
|
bgBlack: (str: string) => string;
|
|
@@ -356,34 +351,39 @@ export declare const RenderInternals: {
|
|
|
356
351
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
357
352
|
verboseAdvanced: (options: {
|
|
358
353
|
indent: boolean;
|
|
359
|
-
logLevel: "
|
|
354
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
360
355
|
} & {
|
|
361
356
|
tag?: string | undefined;
|
|
362
|
-
secondTag?: string | undefined;
|
|
363
357
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
364
358
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
365
359
|
infoAdvanced: (options: {
|
|
366
360
|
indent: boolean;
|
|
367
|
-
logLevel: "
|
|
361
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
368
362
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
369
363
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
370
364
|
warnAdvanced: (options: {
|
|
371
365
|
indent: boolean;
|
|
372
|
-
logLevel: "
|
|
366
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
373
367
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
374
368
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
369
|
+
errorAdvanced: (options: {
|
|
370
|
+
indent: boolean;
|
|
371
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
372
|
+
} & {
|
|
373
|
+
tag?: string | undefined;
|
|
374
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
375
375
|
};
|
|
376
|
-
getLogLevel: () => "
|
|
377
|
-
setLogLevel: (newLogLevel: "
|
|
376
|
+
getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
377
|
+
setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
378
378
|
INDENT_TOKEN: string;
|
|
379
|
-
isColorSupported: boolean;
|
|
379
|
+
isColorSupported: () => boolean;
|
|
380
380
|
HeadlessBrowser: typeof HeadlessBrowser;
|
|
381
|
-
prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency,
|
|
381
|
+
prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, }: {
|
|
382
382
|
webpackConfigOrServeUrl: string;
|
|
383
383
|
port: number | null;
|
|
384
384
|
remotionRoot: string;
|
|
385
385
|
concurrency: number;
|
|
386
|
-
|
|
386
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
387
387
|
indent: boolean;
|
|
388
388
|
}) => Promise<import("./prepare-server").RemotionServer>;
|
|
389
389
|
makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
|
|
@@ -391,7 +391,7 @@ export declare const RenderInternals: {
|
|
|
391
391
|
port: number | null;
|
|
392
392
|
remotionRoot: string;
|
|
393
393
|
concurrency: number;
|
|
394
|
-
|
|
394
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
395
395
|
indent: boolean;
|
|
396
396
|
}, { onDownload, onError, }: {
|
|
397
397
|
onError: (err: Error) => void;
|
|
@@ -401,14 +401,14 @@ export declare const RenderInternals: {
|
|
|
401
401
|
cleanupServer: (force: boolean) => Promise<unknown>;
|
|
402
402
|
}>;
|
|
403
403
|
internalRenderStill: (options: {
|
|
404
|
-
composition: import("remotion").
|
|
404
|
+
composition: import("remotion").VideoConfig;
|
|
405
405
|
output: string | null;
|
|
406
406
|
frame: number;
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
serializedInputPropsWithCustomSchema: string;
|
|
408
|
+
serializedResolvedPropsWithCustomSchema: string;
|
|
409
|
+
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
409
410
|
jpegQuality: number;
|
|
410
411
|
puppeteerInstance: HeadlessBrowser | null;
|
|
411
|
-
dumpBrowserLogs: boolean;
|
|
412
412
|
envVariables: Record<string, string>;
|
|
413
413
|
overwrite: boolean;
|
|
414
414
|
browserExecutable: import("./browser-executable").BrowserExecutable;
|
|
@@ -420,23 +420,23 @@ export declare const RenderInternals: {
|
|
|
420
420
|
cancelSignal: import("./make-cancel-signal").CancelSignal | null;
|
|
421
421
|
indent: boolean;
|
|
422
422
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
423
|
-
|
|
423
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
424
424
|
serveUrl: string;
|
|
425
425
|
port: number | null;
|
|
426
426
|
}) => Promise<{
|
|
427
427
|
buffer: Buffer | null;
|
|
428
428
|
}>;
|
|
429
|
-
internalOpenBrowser: ({ browser, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent,
|
|
430
|
-
shouldDumpIo: boolean;
|
|
429
|
+
internalOpenBrowser: ({ browser, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, viewport, logLevel, }: {
|
|
431
430
|
browserExecutable: string | null;
|
|
432
431
|
chromiumOptions: import("./open-browser").ChromiumOptions;
|
|
433
432
|
forceDeviceScaleFactor: number | undefined;
|
|
434
433
|
viewport: import("./browser/PuppeteerViewport").Viewport | null;
|
|
435
434
|
indent: boolean;
|
|
436
435
|
browser: import("./browser").Browser;
|
|
436
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
437
437
|
}) => Promise<HeadlessBrowser>;
|
|
438
438
|
internalSelectComposition: (options: {
|
|
439
|
-
|
|
439
|
+
serializedInputPropsWithCustomSchema: string;
|
|
440
440
|
envVariables: Record<string, string>;
|
|
441
441
|
puppeteerInstance: HeadlessBrowser | undefined;
|
|
442
442
|
onBrowserLog: ((log: import("./browser-log").BrowserLog) => void) | null;
|
|
@@ -446,12 +446,15 @@ export declare const RenderInternals: {
|
|
|
446
446
|
port: number | null;
|
|
447
447
|
indent: boolean;
|
|
448
448
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
449
|
-
|
|
449
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
450
450
|
serveUrl: string;
|
|
451
451
|
id: string;
|
|
452
|
-
}) => Promise<
|
|
453
|
-
|
|
454
|
-
|
|
452
|
+
}) => Promise<{
|
|
453
|
+
metadata: import("remotion").VideoConfig;
|
|
454
|
+
propsSize: number;
|
|
455
|
+
}>;
|
|
456
|
+
internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: {
|
|
457
|
+
serializedInputPropsWithCustomSchema: string;
|
|
455
458
|
envVariables: Record<string, string>;
|
|
456
459
|
puppeteerInstance: HeadlessBrowser | undefined;
|
|
457
460
|
onBrowserLog: ((log: import("./browser-log").BrowserLog) => void) | null;
|
|
@@ -461,11 +464,11 @@ export declare const RenderInternals: {
|
|
|
461
464
|
port: number | null;
|
|
462
465
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
463
466
|
indent: boolean;
|
|
464
|
-
|
|
467
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
465
468
|
serveUrlOrWebpackUrl: string;
|
|
466
|
-
}) => Promise<import("remotion").
|
|
467
|
-
internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency,
|
|
468
|
-
internalRenderMedia: ({ proResProfile, crf, composition,
|
|
469
|
+
}) => Promise<import("remotion").VideoConfig[]>;
|
|
470
|
+
internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
|
|
471
|
+
internalRenderMedia: ({ proResProfile, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, }: import("./render-media").InternalRenderMediaOptions) => Promise<{
|
|
469
472
|
buffer: Buffer | null;
|
|
470
473
|
slowestFrames: import("./render-media").SlowFrame[];
|
|
471
474
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.selectComposition = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getCompositions = exports.ErrorWithStackFrame = void 0;
|
|
29
|
+
exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.selectComposition = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getVideoMetadata = exports.getCompositions = exports.ErrorWithStackFrame = void 0;
|
|
30
30
|
const execa_1 = __importDefault(require("execa"));
|
|
31
31
|
const download_file_1 = require("./assets/download-file");
|
|
32
32
|
const audio_codec_1 = require("./audio-codec");
|
|
@@ -86,6 +86,8 @@ var handle_javascript_exception_1 = require("./error-handling/handle-javascript-
|
|
|
86
86
|
Object.defineProperty(exports, "ErrorWithStackFrame", { enumerable: true, get: function () { return handle_javascript_exception_1.ErrorWithStackFrame; } });
|
|
87
87
|
var get_compositions_2 = require("./get-compositions");
|
|
88
88
|
Object.defineProperty(exports, "getCompositions", { enumerable: true, get: function () { return get_compositions_2.getCompositions; } });
|
|
89
|
+
var get_video_metadata_1 = require("./get-video-metadata");
|
|
90
|
+
Object.defineProperty(exports, "getVideoMetadata", { enumerable: true, get: function () { return get_video_metadata_1.getVideoMetadata; } });
|
|
89
91
|
var image_format_2 = require("./image-format");
|
|
90
92
|
Object.defineProperty(exports, "validateSelectedPixelFormatAndImageFormatCombination", { enumerable: true, get: function () { return image_format_2.validateSelectedPixelFormatAndImageFormatCombination; } });
|
|
91
93
|
var make_cancel_signal_1 = require("./make-cancel-signal");
|
package/dist/logger.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ type LogOptions = {
|
|
|
6
6
|
};
|
|
7
7
|
type VerboseLogOptions = LogOptions & {
|
|
8
8
|
tag?: string;
|
|
9
|
-
secondTag?: string;
|
|
10
9
|
};
|
|
11
10
|
export declare const verboseTag: (str: string) => string;
|
|
12
11
|
export declare const secondverboseTag: (str: string) => string;
|
|
@@ -18,7 +17,8 @@ export declare const Log: {
|
|
|
18
17
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
19
18
|
warnAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
20
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
|
+
errorAdvanced: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
21
21
|
};
|
|
22
|
-
export declare const getLogLevel: () => "
|
|
22
|
+
export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
23
23
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
24
24
|
export {};
|
package/dist/logger.js
CHANGED
|
@@ -7,11 +7,11 @@ const log_level_1 = require("./log-level");
|
|
|
7
7
|
const truthy_1 = require("./truthy");
|
|
8
8
|
exports.INDENT_TOKEN = chalk_1.chalk.gray('│');
|
|
9
9
|
const verboseTag = (str) => {
|
|
10
|
-
return is_color_supported_1.isColorSupported ? chalk_1.chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
10
|
+
return (0, is_color_supported_1.isColorSupported)() ? chalk_1.chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
11
11
|
};
|
|
12
12
|
exports.verboseTag = verboseTag;
|
|
13
13
|
const secondverboseTag = (str) => {
|
|
14
|
-
return is_color_supported_1.isColorSupported ? chalk_1.chalk.bgWhite(` ${str} `) : `[${str}]`;
|
|
14
|
+
return (0, is_color_supported_1.isColorSupported)() ? chalk_1.chalk.bgWhite(` ${str} `) : `[${str}]`;
|
|
15
15
|
};
|
|
16
16
|
exports.secondverboseTag = secondverboseTag;
|
|
17
17
|
exports.Log = {
|
|
@@ -22,33 +22,28 @@ exports.Log = {
|
|
|
22
22
|
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'verbose')) {
|
|
23
23
|
return console.log(...[
|
|
24
24
|
options.indent ? exports.INDENT_TOKEN : null,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.filter(truthy_1.truthy)
|
|
30
|
-
.join(''),
|
|
31
|
-
...args.map((a) => chalk_1.chalk.gray(a)),
|
|
32
|
-
].filter(truthy_1.truthy));
|
|
25
|
+
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
26
|
+
]
|
|
27
|
+
.filter(truthy_1.truthy)
|
|
28
|
+
.concat(args.map((a) => chalk_1.chalk.gray(a))));
|
|
33
29
|
}
|
|
34
30
|
},
|
|
35
31
|
info: (...args) => {
|
|
36
32
|
exports.Log.infoAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
|
|
37
33
|
},
|
|
38
34
|
infoAdvanced: (options, ...args) => {
|
|
39
|
-
|
|
40
|
-
return console.log(...[options.indent ? exports.INDENT_TOKEN : null, ...args].filter(truthy_1.truthy));
|
|
41
|
-
}
|
|
35
|
+
return console.log(...[options.indent ? exports.INDENT_TOKEN : null].filter(truthy_1.truthy).concat(args));
|
|
42
36
|
},
|
|
43
37
|
warn: (...args) => {
|
|
44
|
-
|
|
38
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)((0, exports.getLogLevel)(), 'warn')) {
|
|
39
|
+
exports.Log.warnAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
|
|
40
|
+
}
|
|
45
41
|
},
|
|
46
42
|
warnAdvanced: (options, ...args) => {
|
|
47
43
|
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'warn')) {
|
|
48
|
-
return console.warn(...[
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
].filter(truthy_1.truthy));
|
|
44
|
+
return console.warn(...[options.indent ? chalk_1.chalk.yellow(exports.INDENT_TOKEN) : null]
|
|
45
|
+
.filter(truthy_1.truthy)
|
|
46
|
+
.concat(args.map((a) => chalk_1.chalk.yellow(a))));
|
|
52
47
|
}
|
|
53
48
|
},
|
|
54
49
|
error: (...args) => {
|
|
@@ -56,6 +51,16 @@ exports.Log = {
|
|
|
56
51
|
return console.error(...args.map((a) => chalk_1.chalk.red(a)));
|
|
57
52
|
}
|
|
58
53
|
},
|
|
54
|
+
errorAdvanced: (options, ...args) => {
|
|
55
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)((0, exports.getLogLevel)(), 'error')) {
|
|
56
|
+
return console.log(...[
|
|
57
|
+
options.indent ? exports.INDENT_TOKEN : null,
|
|
58
|
+
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
59
|
+
]
|
|
60
|
+
.filter(truthy_1.truthy)
|
|
61
|
+
.concat(args.map((a) => chalk_1.chalk.red(a))));
|
|
62
|
+
}
|
|
63
|
+
},
|
|
59
64
|
};
|
|
60
65
|
let logLevel = 'info';
|
|
61
66
|
const getLogLevel = () => {
|