@remotion/renderer 4.0.462 → 4.0.464
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/browser/BrowserFetcher.js +2 -5
- package/dist/browser/extract-zip-archive.d.ts +1 -0
- package/dist/browser/extract-zip-archive.js +144 -0
- package/dist/esm/error-handling.mjs +5 -0
- package/dist/esm/index.mjs +1899 -353
- package/dist/print-useful-error-message.js +6 -0
- package/package.json +14 -15
- package/vendor/yauzl-patched/LICENSE +21 -0
- package/vendor/yauzl-patched/buffer-crc32.js +111 -0
- package/vendor/yauzl-patched/fd-slicer.js +326 -0
- package/vendor/yauzl-patched/index.d.ts +23 -0
- package/vendor/yauzl-patched/index.js +969 -0
- package/vendor/yauzl-patched/pend.js +55 -0
- package/dist/options/experimental-visual-mode.d.ts +0 -16
- package/dist/options/experimental-visual-mode.js +0 -30
|
@@ -47,18 +47,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
47
47
|
return result;
|
|
48
48
|
};
|
|
49
49
|
})();
|
|
50
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
-
};
|
|
53
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
51
|
exports.getRevisionInfo = exports.downloadBrowser = exports.readVersionFile = exports.TESTED_VERSION = void 0;
|
|
55
52
|
const fs = __importStar(require("node:fs"));
|
|
56
53
|
const os = __importStar(require("node:os"));
|
|
57
54
|
const path = __importStar(require("node:path"));
|
|
58
55
|
const node_util_1 = require("node:util");
|
|
59
|
-
const extract_zip_1 = __importDefault(require("extract-zip"));
|
|
60
56
|
const download_file_1 = require("../assets/download-file");
|
|
61
57
|
const make_file_executable_1 = require("../compositor/make-file-executable");
|
|
58
|
+
const extract_zip_archive_1 = require("./extract-zip-archive");
|
|
62
59
|
const get_chrome_download_url_1 = require("./get-chrome-download-url");
|
|
63
60
|
Object.defineProperty(exports, "TESTED_VERSION", { enumerable: true, get: function () { return get_chrome_download_url_1.TESTED_VERSION; } });
|
|
64
61
|
const get_download_destination_1 = require("./get-download-destination");
|
|
@@ -165,7 +162,7 @@ const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMo
|
|
|
165
162
|
logLevel,
|
|
166
163
|
abortSignal: new AbortController().signal,
|
|
167
164
|
});
|
|
168
|
-
await (0,
|
|
165
|
+
await (0, extract_zip_archive_1.extractZipArchive)(archivePath, outputPath);
|
|
169
166
|
const possibleSubdirs = [
|
|
170
167
|
'chrome-linux',
|
|
171
168
|
'chrome-headless-shell-linux64',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const extractZipArchive: (archivePath: string, dir: string) => Promise<void>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.extractZipArchive = void 0;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const promises_1 = require("node:fs/promises");
|
|
39
|
+
const path = __importStar(require("node:path"));
|
|
40
|
+
const consumers_1 = require("node:stream/consumers");
|
|
41
|
+
const promises_2 = require("node:stream/promises");
|
|
42
|
+
const node_util_1 = require("node:util");
|
|
43
|
+
const yauzl = __importStar(require("../../vendor/yauzl-patched"));
|
|
44
|
+
const openZip = (0, node_util_1.promisify)(yauzl.open);
|
|
45
|
+
const openReadStream = (zipfile, entry) => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
zipfile.openReadStream(entry, (err, readStream) => {
|
|
48
|
+
if (err) {
|
|
49
|
+
reject(err);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (!readStream) {
|
|
53
|
+
reject(new Error('Failed to open zip read stream'));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
resolve(readStream);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const getExtractedMode = (entryMode, isDir) => {
|
|
61
|
+
if (entryMode !== 0) {
|
|
62
|
+
return entryMode;
|
|
63
|
+
}
|
|
64
|
+
return isDir ? 0o755 : 0o644;
|
|
65
|
+
};
|
|
66
|
+
const extractEntry = async ({ entry, zipfile, dir, }) => {
|
|
67
|
+
if (entry.fileName.startsWith('__MACOSX/')) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const dest = path.join(dir, entry.fileName);
|
|
71
|
+
const destDir = path.dirname(dest);
|
|
72
|
+
await (0, promises_1.mkdir)(destDir, { recursive: true });
|
|
73
|
+
const canonicalDestDir = await (0, promises_1.realpath)(destDir);
|
|
74
|
+
const relativeDestDir = path.relative(dir, canonicalDestDir);
|
|
75
|
+
if (relativeDestDir.split(path.sep).includes('..')) {
|
|
76
|
+
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
77
|
+
}
|
|
78
|
+
const mode = (entry.externalFileAttributes >> 16) & 0xffff;
|
|
79
|
+
const IFMT = 61440;
|
|
80
|
+
const IFDIR = 16384;
|
|
81
|
+
const IFLNK = 40960;
|
|
82
|
+
const symlinkEntry = (mode & IFMT) === IFLNK;
|
|
83
|
+
let isDir = (mode & IFMT) === IFDIR;
|
|
84
|
+
if (!isDir && entry.fileName.endsWith('/')) {
|
|
85
|
+
isDir = true;
|
|
86
|
+
}
|
|
87
|
+
const madeBy = entry.versionMadeBy >> 8;
|
|
88
|
+
if (!isDir && madeBy === 0 && entry.externalFileAttributes === 16) {
|
|
89
|
+
isDir = true;
|
|
90
|
+
}
|
|
91
|
+
const procMode = getExtractedMode(mode, isDir) & 0o777;
|
|
92
|
+
const destDirectory = isDir ? dest : path.dirname(dest);
|
|
93
|
+
await (0, promises_1.mkdir)(destDirectory, {
|
|
94
|
+
recursive: true,
|
|
95
|
+
mode: isDir ? procMode : undefined,
|
|
96
|
+
});
|
|
97
|
+
if (isDir) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const readStream = await openReadStream(zipfile, entry);
|
|
101
|
+
if (symlinkEntry) {
|
|
102
|
+
const link = (await (0, consumers_1.buffer)(readStream)).toString();
|
|
103
|
+
await (0, promises_1.symlink)(link, dest);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
await (0, promises_2.pipeline)(readStream, (0, node_fs_1.createWriteStream)(dest, { mode: procMode }));
|
|
107
|
+
};
|
|
108
|
+
const extractZipArchive = async (archivePath, dir) => {
|
|
109
|
+
if (!path.isAbsolute(dir)) {
|
|
110
|
+
throw new Error('Target directory is expected to be absolute');
|
|
111
|
+
}
|
|
112
|
+
await (0, promises_1.mkdir)(dir, { recursive: true });
|
|
113
|
+
const resolvedDir = await (0, promises_1.realpath)(dir);
|
|
114
|
+
const zipfile = await openZip(archivePath, { lazyEntries: true });
|
|
115
|
+
return new Promise((resolve, reject) => {
|
|
116
|
+
let canceled = false;
|
|
117
|
+
const cancel = (err) => {
|
|
118
|
+
if (canceled) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
canceled = true;
|
|
122
|
+
zipfile.close();
|
|
123
|
+
reject(err);
|
|
124
|
+
};
|
|
125
|
+
zipfile.on('error', cancel);
|
|
126
|
+
zipfile.on('close', () => {
|
|
127
|
+
if (!canceled) {
|
|
128
|
+
resolve();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
zipfile.on('entry', (entry) => {
|
|
132
|
+
if (canceled) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
extractEntry({ entry, zipfile, dir: resolvedDir })
|
|
136
|
+
.then(() => {
|
|
137
|
+
zipfile.readEntry();
|
|
138
|
+
})
|
|
139
|
+
.catch(cancel);
|
|
140
|
+
});
|
|
141
|
+
zipfile.readEntry();
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
exports.extractZipArchive = extractZipArchive;
|
|
@@ -292,6 +292,10 @@ var printUsefulErrorMessage = (err, logLevel, indent) => {
|
|
|
292
292
|
Log.info({ indent, logLevel });
|
|
293
293
|
Log.info({ indent, logLevel }, "\uD83D\uDCA1 This error indicates that your Lambda concurrency limit is too low. See: https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit");
|
|
294
294
|
}
|
|
295
|
+
if (err.message.includes("Failed to acquire WebGL2 context") || err.message.includes("Failed to acquire WebGL context")) {
|
|
296
|
+
Log.info({ indent, logLevel });
|
|
297
|
+
Log.info({ indent, logLevel }, "\uD83D\uDCA1 Get help for this issue at https://remotion.dev/docs/troubleshooting/webgl2-context");
|
|
298
|
+
}
|
|
295
299
|
if (err.message.includes("Error creating WebGL context")) {
|
|
296
300
|
Log.info({ indent, logLevel });
|
|
297
301
|
Log.warn({
|
|
@@ -302,6 +306,7 @@ var printUsefulErrorMessage = (err, logLevel, indent) => {
|
|
|
302
306
|
indent,
|
|
303
307
|
logLevel
|
|
304
308
|
}, "\uD83D\uDCA1 Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl");
|
|
309
|
+
Log.info({ indent, logLevel }, "\uD83D\uDCA1 Get help for this issue at https://remotion.dev/docs/troubleshooting/webgl2-context");
|
|
305
310
|
}
|
|
306
311
|
if (err.message.includes("The bucket does not allow ACLs")) {
|
|
307
312
|
Log.info({ indent, logLevel });
|