@remotion/bundler 3.3.1 → 3.3.3
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/bundle.d.ts +2 -0
- package/dist/bundle.js +20 -1
- package/dist/copy-dir.d.ts +8 -1
- package/dist/copy-dir.js +19 -3
- package/dist/index-html.d.ts +2 -1
- package/dist/index-html.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/renderEntry.js +1 -1
- package/package.json +3 -3
package/dist/bundle.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare type LegacyBundleOptions = {
|
|
|
7
7
|
publicPath?: string;
|
|
8
8
|
rootDir?: string;
|
|
9
9
|
publicDir?: string | null;
|
|
10
|
+
onPublicDirCopyProgress?: (bytes: number) => void;
|
|
11
|
+
onSymlinkDetected?: (path: string) => void;
|
|
10
12
|
};
|
|
11
13
|
export declare const getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }: {
|
|
12
14
|
outDir: string;
|
package/dist/bundle.js
CHANGED
|
@@ -125,8 +125,26 @@ async function bundle(...args) {
|
|
|
125
125
|
? path_1.default.resolve(resolvedRemotionRoot, options.publicDir)
|
|
126
126
|
: path_1.default.join(resolvedRemotionRoot, 'public');
|
|
127
127
|
const to = path_1.default.join(outDir, 'public');
|
|
128
|
+
let symlinkWarningShown = false;
|
|
129
|
+
const showSymlinkWarning = (ent, src) => {
|
|
130
|
+
if (symlinkWarningShown) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const absolutePath = path_1.default.join(src, ent.name);
|
|
134
|
+
if (options.onSymlinkDetected) {
|
|
135
|
+
options.onSymlinkDetected(absolutePath);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
symlinkWarningShown = true;
|
|
139
|
+
console.warn(`\nFound a symbolic link in the public folder (${absolutePath}). The symlink will be forwarded into the bundle.`);
|
|
140
|
+
};
|
|
128
141
|
if (fs_1.default.existsSync(from)) {
|
|
129
|
-
await (0, copy_dir_1.copyDir)(
|
|
142
|
+
await (0, copy_dir_1.copyDir)({
|
|
143
|
+
src: from,
|
|
144
|
+
dest: to,
|
|
145
|
+
onSymlinkDetected: showSymlinkWarning,
|
|
146
|
+
onProgress: (prog) => { var _a; return (_a = options.onPublicDirCopyProgress) === null || _a === void 0 ? void 0 : _a.call(options, prog); },
|
|
147
|
+
});
|
|
130
148
|
}
|
|
131
149
|
const html = (0, index_html_1.indexHtml)({
|
|
132
150
|
staticHash,
|
|
@@ -135,6 +153,7 @@ async function bundle(...args) {
|
|
|
135
153
|
inputProps: null,
|
|
136
154
|
remotionRoot: resolvedRemotionRoot,
|
|
137
155
|
previewServerCommand: null,
|
|
156
|
+
numberOfAudioTags: 0,
|
|
138
157
|
});
|
|
139
158
|
fs_1.default.writeFileSync(path_1.default.join(outDir, 'index.html'), html);
|
|
140
159
|
return outDir;
|
package/dist/copy-dir.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
export declare function copyDir({ src, dest, onSymlinkDetected, onProgress, }: {
|
|
4
|
+
src: string;
|
|
5
|
+
dest: string;
|
|
6
|
+
onSymlinkDetected: (entry: fs.Dirent, dir: string) => void;
|
|
7
|
+
onProgress: (bytes: number) => void;
|
|
8
|
+
}): Promise<void>;
|
package/dist/copy-dir.js
CHANGED
|
@@ -6,17 +6,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.copyDir = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
async function copyDir(src, dest) {
|
|
9
|
+
async function copyDir({ src, dest, onSymlinkDetected, onProgress, }) {
|
|
10
10
|
await fs_1.default.promises.mkdir(dest, { recursive: true });
|
|
11
11
|
const entries = await fs_1.default.promises.readdir(src, { withFileTypes: true });
|
|
12
|
+
let copied = 0;
|
|
12
13
|
for (const entry of entries) {
|
|
13
14
|
const srcPath = path_1.default.join(src, entry.name);
|
|
14
15
|
const destPath = path_1.default.join(dest, entry.name);
|
|
15
16
|
if (entry.isDirectory()) {
|
|
16
|
-
await copyDir(
|
|
17
|
+
await copyDir({
|
|
18
|
+
src: srcPath,
|
|
19
|
+
dest: destPath,
|
|
20
|
+
onSymlinkDetected,
|
|
21
|
+
onProgress,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
else if (entry.isSymbolicLink()) {
|
|
25
|
+
const realpath = await fs_1.default.promises.realpath(srcPath);
|
|
26
|
+
onSymlinkDetected(entry, src);
|
|
27
|
+
await fs_1.default.promises.symlink(realpath, destPath);
|
|
17
28
|
}
|
|
18
29
|
else {
|
|
19
|
-
await
|
|
30
|
+
const [, { size }] = await Promise.all([
|
|
31
|
+
fs_1.default.promises.copyFile(srcPath, destPath),
|
|
32
|
+
fs_1.default.promises.stat(srcPath),
|
|
33
|
+
]);
|
|
34
|
+
copied += size;
|
|
35
|
+
onProgress(copied);
|
|
20
36
|
}
|
|
21
37
|
}
|
|
22
38
|
}
|
package/dist/index-html.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, }: {
|
|
1
|
+
export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, }: {
|
|
2
2
|
staticHash: string;
|
|
3
3
|
baseDir: string;
|
|
4
4
|
editorName: string | null;
|
|
@@ -6,4 +6,5 @@ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables
|
|
|
6
6
|
envVariables?: Record<string, string> | undefined;
|
|
7
7
|
remotionRoot: string;
|
|
8
8
|
previewServerCommand: string | null;
|
|
9
|
+
numberOfAudioTags: number;
|
|
9
10
|
}) => string;
|
package/dist/index-html.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.indexHtml = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, }) => `
|
|
8
|
+
const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, }) => `
|
|
9
9
|
<!DOCTYPE html>
|
|
10
10
|
<html lang="en">
|
|
11
11
|
<head>
|
|
@@ -16,6 +16,7 @@ const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash,
|
|
|
16
16
|
<title>Remotion Preview</title>
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
|
+
<script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
|
|
19
20
|
<script>window.remotion_staticBase = "${staticHash}";</script>
|
|
20
21
|
<div id="video-container"></div>
|
|
21
22
|
<div id="explainer-container"></div>
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const BundlerInternals: {
|
|
|
16
16
|
entryPoints: string[];
|
|
17
17
|
remotionRoot: string;
|
|
18
18
|
}) => [string, webpack.Configuration];
|
|
19
|
-
indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, }: {
|
|
19
|
+
indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, }: {
|
|
20
20
|
staticHash: string;
|
|
21
21
|
baseDir: string;
|
|
22
22
|
editorName: string | null;
|
|
@@ -24,6 +24,7 @@ export declare const BundlerInternals: {
|
|
|
24
24
|
envVariables?: Record<string, string> | undefined;
|
|
25
25
|
remotionRoot: string;
|
|
26
26
|
previewServerCommand: string | null;
|
|
27
|
+
numberOfAudioTags: number;
|
|
27
28
|
}) => string;
|
|
28
29
|
cacheExists: (remotionRoot: string, environment: "development" | "production", hash: string) => "exists" | "other-exists" | "does-not-exist";
|
|
29
30
|
clearCache: (remotionRoot: string) => Promise<void>;
|
package/dist/renderEntry.js
CHANGED
|
@@ -116,7 +116,7 @@ const WaitForRoot = () => {
|
|
|
116
116
|
const renderContent = () => {
|
|
117
117
|
const bundleMode = (0, bundle_mode_1.getBundleMode)();
|
|
118
118
|
if (bundleMode.type === 'composition' || bundleMode.type === 'evaluation') {
|
|
119
|
-
const markup = ((0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { children: [(0, jsx_runtime_1.jsx)(WaitForRoot, {}), (0, jsx_runtime_1.jsx)(GetVideo, { state: bundleMode })] }));
|
|
119
|
+
const markup = ((0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { numberOfAudioTags: 0, children: [(0, jsx_runtime_1.jsx)(WaitForRoot, {}), (0, jsx_runtime_1.jsx)(GetVideo, { state: bundleMode })] }));
|
|
120
120
|
if (client_1.default.createRoot) {
|
|
121
121
|
const root = client_1.default.createRoot(videoContainer);
|
|
122
122
|
root.render(markup);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/bundler",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "Bundler for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"css-loader": "5.2.7",
|
|
27
27
|
"esbuild": "0.15.13",
|
|
28
28
|
"react-refresh": "0.9.0",
|
|
29
|
-
"remotion": "3.3.
|
|
29
|
+
"remotion": "3.3.3",
|
|
30
30
|
"style-loader": "2.0.0",
|
|
31
31
|
"webpack": "5.74.0"
|
|
32
32
|
},
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "27db3bbb7b8bd67aa3767e55c5c8f21a8d9fa16b"
|
|
68
68
|
}
|