@remotion/bundler 4.0.102 → 4.0.103
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/LICENSE.md +1 -1
- package/dist/bundle.d.ts +3 -1
- package/dist/bundle.js +6 -5
- package/dist/index-html.d.ts +3 -2
- package/dist/index-html.js +12 -14
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/bundle-mode.d.ts +0 -3
- package/dist/bundle-mode.js +0 -14
package/LICENSE.md
CHANGED
package/dist/bundle.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GitSource } from '@remotion/studio-shared';
|
|
1
2
|
import webpack from 'webpack';
|
|
2
3
|
import type { WebpackOverrideFn } from './webpack-config';
|
|
3
4
|
export type LegacyBundleOptions = {
|
|
@@ -22,13 +23,14 @@ export type BundleOptions = {
|
|
|
22
23
|
onProgress?: (progress: number) => void;
|
|
23
24
|
ignoreRegisterRootWarning?: boolean;
|
|
24
25
|
onDirectoryCreated?: (dir: string) => void;
|
|
26
|
+
gitSource?: GitSource | null;
|
|
25
27
|
} & LegacyBundleOptions;
|
|
26
28
|
type Arguments = [options: BundleOptions] | [
|
|
27
29
|
entryPoint: string,
|
|
28
30
|
onProgress?: (progress: number) => void,
|
|
29
31
|
options?: LegacyBundleOptions
|
|
30
32
|
];
|
|
31
|
-
export declare const
|
|
33
|
+
export declare const findClosestFolderWithItem: (currentDir: string, file: string) => string | null;
|
|
32
34
|
/**
|
|
33
35
|
* @description The method bundles a Remotion project using Webpack and prepares it for rendering using renderMedia()
|
|
34
36
|
* @see [Documentation](https://www.remotion.dev/docs/bundle)
|
package/dist/bundle.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.bundle = exports.
|
|
29
|
+
exports.bundle = exports.findClosestFolderWithItem = exports.getConfig = void 0;
|
|
30
30
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
31
31
|
const node_fs_1 = __importStar(require("node:fs"));
|
|
32
32
|
const node_os_1 = __importDefault(require("node:os"));
|
|
@@ -95,7 +95,7 @@ const convertArgumentsIntoOptions = (args) => {
|
|
|
95
95
|
return firstArg;
|
|
96
96
|
};
|
|
97
97
|
const recursionLimit = 5;
|
|
98
|
-
const
|
|
98
|
+
const findClosestFolderWithItem = (currentDir, file) => {
|
|
99
99
|
let possibleFile = '';
|
|
100
100
|
for (let i = 0; i < recursionLimit; i++) {
|
|
101
101
|
possibleFile = node_path_1.default.join(currentDir, file);
|
|
@@ -107,9 +107,9 @@ const findClosestFolderWithFile = (currentDir, file) => {
|
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
109
|
};
|
|
110
|
-
exports.
|
|
110
|
+
exports.findClosestFolderWithItem = findClosestFolderWithItem;
|
|
111
111
|
const findClosestPackageJsonFolder = (currentDir) => {
|
|
112
|
-
return (0, exports.
|
|
112
|
+
return (0, exports.findClosestFolderWithItem)(currentDir, 'package.json');
|
|
113
113
|
};
|
|
114
114
|
const validateEntryPoint = async (entryPoint) => {
|
|
115
115
|
const contents = await node_fs_1.promises.readFile(entryPoint, 'utf8');
|
|
@@ -127,7 +127,7 @@ const validateEntryPoint = async (entryPoint) => {
|
|
|
127
127
|
* @see [Documentation](https://www.remotion.dev/docs/bundle)
|
|
128
128
|
*/
|
|
129
129
|
async function bundle(...args) {
|
|
130
|
-
var _a, _b, _c, _d, _e;
|
|
130
|
+
var _a, _b, _c, _d, _e, _f;
|
|
131
131
|
const actualArgs = convertArgumentsIntoOptions(args);
|
|
132
132
|
const entryPoint = node_path_1.default.resolve(process.cwd(), actualArgs.entryPoint);
|
|
133
133
|
const resolvedRemotionRoot = (_b = (_a = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.rootDir) !== null && _a !== void 0 ? _a : findClosestPackageJsonFolder(entryPoint)) !== null && _b !== void 0 ? _b : process.cwd();
|
|
@@ -218,6 +218,7 @@ async function bundle(...args) {
|
|
|
218
218
|
title: 'Remotion Bundle',
|
|
219
219
|
renderDefaults: undefined,
|
|
220
220
|
publicFolderExists: baseDir + '/public',
|
|
221
|
+
gitSource: (_f = actualArgs.gitSource) !== null && _f !== void 0 ? _f : null,
|
|
221
222
|
});
|
|
222
223
|
node_fs_1.default.writeFileSync(node_path_1.default.join(outDir, 'index.html'), html);
|
|
223
224
|
node_fs_1.default.copyFileSync(node_path_1.default.join(__dirname, '../favicon.ico'), node_path_1.default.join(outDir, 'favicon.ico'));
|
package/dist/index-html.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RenderDefaults } from '@remotion/studio';
|
|
1
|
+
import type { GitSource, RenderDefaults } from '@remotion/studio';
|
|
2
2
|
import type { StaticFile } from 'remotion';
|
|
3
|
-
export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, }: {
|
|
3
|
+
export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, }: {
|
|
4
4
|
staticHash: string;
|
|
5
5
|
baseDir: string;
|
|
6
6
|
editorName: string | null;
|
|
@@ -15,4 +15,5 @@ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables
|
|
|
15
15
|
includeFavicon: boolean;
|
|
16
16
|
title: string;
|
|
17
17
|
renderDefaults: RenderDefaults | undefined;
|
|
18
|
+
gitSource: GitSource | null;
|
|
18
19
|
}) => string;
|
package/dist/index-html.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.indexHtml = void 0;
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
9
|
-
const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, }) =>
|
|
9
|
+
const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, }) =>
|
|
10
10
|
// Must setup remotion_editorName and remotion.remotion_projectName before bundle.js is loaded
|
|
11
11
|
`
|
|
12
12
|
<!DOCTYPE html>
|
|
@@ -15,15 +15,14 @@ const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash,
|
|
|
15
15
|
<meta charset="UTF-8" />
|
|
16
16
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
17
17
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
18
|
-
${includeFavicon
|
|
19
|
-
?
|
|
18
|
+
${includeFavicon
|
|
19
|
+
? `<link id="__remotion_favicon" rel="icon" type="image/png" href="/remotion.png" />`
|
|
20
20
|
: ''}
|
|
21
21
|
<title>${title}</title>
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<div id="video-container"></div>
|
|
24
|
+
<script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
|
|
25
|
+
<script>window.remotion_staticBase = "${staticHash}";</script>
|
|
27
26
|
${editorName
|
|
28
27
|
? `<script>window.remotion_editorName = "${editorName}";</script>`
|
|
29
28
|
: '<script>window.remotion_editorName = null;</script>'}
|
|
@@ -32,22 +31,21 @@ ${includeFavicon
|
|
|
32
31
|
<script>window.remotion_cwd = ${JSON.stringify(remotionRoot)};</script>
|
|
33
32
|
<script>window.remotion_studioServerCommand = ${studioServerCommand ? JSON.stringify(studioServerCommand) : 'null'};</script>
|
|
34
33
|
${inputProps
|
|
35
|
-
? `<script>window.remotion_inputProps = ${JSON.stringify(JSON.stringify(inputProps))};</script
|
|
36
|
-
`
|
|
34
|
+
? `<script>window.remotion_inputProps = ${JSON.stringify(JSON.stringify(inputProps))};</script>`
|
|
37
35
|
: ''}
|
|
38
36
|
${renderQueue
|
|
39
|
-
? `<script>window.remotion_initialRenderQueue = ${JSON.stringify(renderQueue)};</script
|
|
40
|
-
`
|
|
37
|
+
? `<script>window.remotion_initialRenderQueue = ${JSON.stringify(renderQueue)};</script>`
|
|
41
38
|
: ''}
|
|
42
39
|
${envVariables
|
|
43
|
-
? `<script>
|
|
44
|
-
env: ${JSON.stringify(envVariables)}
|
|
45
|
-
};</script>
|
|
46
|
-
`
|
|
40
|
+
? `<script>window.process = {env: ${JSON.stringify(envVariables)}};</script>`
|
|
47
41
|
: ''}
|
|
42
|
+
${gitSource
|
|
43
|
+
? `<script>window.remotion_gitSource = ${JSON.stringify(gitSource)};</script>`
|
|
44
|
+
: null}
|
|
48
45
|
<script>window.remotion_staticFiles = ${JSON.stringify(publicFiles)}</script>
|
|
49
46
|
<script>window.remotion_publicFolderExists = ${publicFolderExists ? `"${publicFolderExists}"` : 'null'};</script>
|
|
50
47
|
|
|
48
|
+
<div id="video-container"></div>
|
|
51
49
|
<div id="${remotion_1.Internals.REMOTION_STUDIO_CONTAINER_ELEMENT}"></div>
|
|
52
50
|
<div id="menuportal-0"></div>
|
|
53
51
|
<div id="menuportal-1"></div>
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const BundlerInternals: {
|
|
|
15
15
|
remotionRoot: string;
|
|
16
16
|
poll: number | null;
|
|
17
17
|
}) => [string, webpack.Configuration];
|
|
18
|
-
indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, }: {
|
|
18
|
+
indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, }: {
|
|
19
19
|
staticHash: string;
|
|
20
20
|
baseDir: string;
|
|
21
21
|
editorName: string | null;
|
|
@@ -29,7 +29,8 @@ export declare const BundlerInternals: {
|
|
|
29
29
|
publicFolderExists: string | null;
|
|
30
30
|
includeFavicon: boolean;
|
|
31
31
|
title: string;
|
|
32
|
-
renderDefaults: import("@remotion/studio
|
|
32
|
+
renderDefaults: import("@remotion/studio").RenderDefaults | undefined;
|
|
33
|
+
gitSource: import("@remotion/studio").GitSource | null;
|
|
33
34
|
}) => string;
|
|
34
35
|
cacheExists: (remotionRoot: string, environment: "development" | "production", hash: string) => "exists" | "other-exists" | "does-not-exist";
|
|
35
36
|
clearCache: (remotionRoot: string, env: "development" | "production") => Promise<void>;
|
|
@@ -47,8 +48,9 @@ export declare const BundlerInternals: {
|
|
|
47
48
|
staticHash: string;
|
|
48
49
|
limit: number;
|
|
49
50
|
}) => import("remotion").StaticFile[];
|
|
50
|
-
|
|
51
|
+
findClosestFolderWithItem: (currentDir: string, file: string) => string | null;
|
|
51
52
|
};
|
|
53
|
+
export type { GitSource } from '@remotion/studio';
|
|
52
54
|
export { bundle, BundleOptions, LegacyBundleOptions } from './bundle';
|
|
53
55
|
export { WebpackConfiguration, WebpackOverrideFn } from './webpack-config';
|
|
54
56
|
export { webpack };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ exports.BundlerInternals = {
|
|
|
17
17
|
clearCache: webpack_cache_1.clearCache,
|
|
18
18
|
getConfig: bundle_1.getConfig,
|
|
19
19
|
readRecursively: read_recursively_1.readRecursively,
|
|
20
|
-
|
|
20
|
+
findClosestFolderWithItem: bundle_1.findClosestFolderWithItem,
|
|
21
21
|
};
|
|
22
22
|
var bundle_2 = require("./bundle");
|
|
23
23
|
Object.defineProperty(exports, "bundle", { enumerable: true, get: function () { return bundle_2.bundle; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/bundler",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.103",
|
|
4
4
|
"description": "Bundler for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"style-loader": "2.0.0",
|
|
26
26
|
"source-map": "0.7.3",
|
|
27
27
|
"webpack": "5.83.1",
|
|
28
|
-
"
|
|
29
|
-
"remotion": "4.0.
|
|
30
|
-
"@remotion/studio
|
|
28
|
+
"remotion": "4.0.103",
|
|
29
|
+
"@remotion/studio-shared": "4.0.103",
|
|
30
|
+
"@remotion/studio": "4.0.103"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=16.8.0",
|
package/dist/bundle-mode.d.ts
DELETED
package/dist/bundle-mode.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBundleMode = exports.setBundleMode = void 0;
|
|
4
|
-
let bundleMode = {
|
|
5
|
-
type: 'index',
|
|
6
|
-
};
|
|
7
|
-
const setBundleMode = (state) => {
|
|
8
|
-
bundleMode = state;
|
|
9
|
-
};
|
|
10
|
-
exports.setBundleMode = setBundleMode;
|
|
11
|
-
const getBundleMode = () => {
|
|
12
|
-
return bundleMode;
|
|
13
|
-
};
|
|
14
|
-
exports.getBundleMode = getBundleMode;
|