@remotion/bundler 3.3.25 → 3.3.26

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.js CHANGED
@@ -12,6 +12,7 @@ const webpack_1 = __importDefault(require("webpack"));
12
12
  const worker_threads_1 = require("worker_threads");
13
13
  const copy_dir_1 = require("./copy-dir");
14
14
  const index_html_1 = require("./index-html");
15
+ const read_recursively_1 = require("./read-recursively");
15
16
  const webpack_config_1 = require("./webpack-config");
16
17
  const promisified = (0, util_1.promisify)(webpack_1.default);
17
18
  const prepareOutDir = async (specified) => {
@@ -155,6 +156,12 @@ async function bundle(...args) {
155
156
  remotionRoot: resolvedRemotionRoot,
156
157
  previewServerCommand: null,
157
158
  numberOfAudioTags: 0,
159
+ publicFiles: (0, read_recursively_1.readRecursively)({
160
+ folder: '.',
161
+ startPath: from,
162
+ staticHash,
163
+ limit: 1000,
164
+ }),
158
165
  includeFavicon: false,
159
166
  title: 'Remotion Bundle',
160
167
  });
@@ -1,4 +1,5 @@
1
- export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, includeFavicon, title, }: {
1
+ import type { StaticFile } from 'remotion';
2
+ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, publicFiles, includeFavicon, title, }: {
2
3
  staticHash: string;
3
4
  baseDir: string;
4
5
  editorName: string | null;
@@ -7,6 +8,7 @@ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables
7
8
  remotionRoot: string;
8
9
  previewServerCommand: string | null;
9
10
  numberOfAudioTags: number;
11
+ publicFiles: StaticFile[];
10
12
  includeFavicon: boolean;
11
13
  title: string;
12
14
  }) => string;
@@ -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, numberOfAudioTags, includeFavicon, title, }) => `
8
+ const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, publicFiles, includeFavicon, title, }) => `
9
9
  <!DOCTYPE html>
10
10
  <html lang="en">
11
11
  <head>
@@ -38,6 +38,7 @@ ${includeFavicon
38
38
  };</script>
39
39
  `
40
40
  : ''}
41
+ <script>window.remotion_staticFiles = ${JSON.stringify(publicFiles)}</script>
41
42
 
42
43
  <div id="container"></div>
43
44
  <div id="menuportal-0"></div>
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare const BundlerInternals: {
17
17
  remotionRoot: string;
18
18
  poll: number | null;
19
19
  }) => [string, webpack.Configuration];
20
- indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, includeFavicon, title, }: {
20
+ indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, publicFiles, includeFavicon, title, }: {
21
21
  staticHash: string;
22
22
  baseDir: string;
23
23
  editorName: string | null;
@@ -26,6 +26,7 @@ export declare const BundlerInternals: {
26
26
  remotionRoot: string;
27
27
  previewServerCommand: string | null;
28
28
  numberOfAudioTags: number;
29
+ publicFiles: import("remotion/.").StaticFile[];
29
30
  includeFavicon: boolean;
30
31
  title: string;
31
32
  }) => string;
@@ -38,6 +39,13 @@ export declare const BundlerInternals: {
38
39
  onProgress?: ((progress: number) => void) | undefined;
39
40
  options?: import("./bundle").LegacyBundleOptions | undefined;
40
41
  }) => [string, webpack.Configuration];
42
+ readRecursively: ({ folder, output, startPath, staticHash, limit, }: {
43
+ folder: string;
44
+ startPath: string;
45
+ output?: import("remotion/.").StaticFile[] | undefined;
46
+ staticHash: string;
47
+ limit: number;
48
+ }) => import("remotion/.").StaticFile[];
41
49
  };
42
50
  export { bundle, BundleOptions, LegacyBundleOptions } from './bundle';
43
51
  export { webpack };
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ const webpack_config_1 = require("./webpack-config");
8
8
  const esbuild = require("esbuild");
9
9
  const webpack = require("webpack");
10
10
  exports.webpack = webpack;
11
+ const read_recursively_1 = require("./read-recursively");
11
12
  exports.BundlerInternals = {
12
13
  esbuild,
13
14
  webpackConfig: webpack_config_1.webpackConfig,
@@ -15,6 +16,7 @@ exports.BundlerInternals = {
15
16
  cacheExists: webpack_cache_1.cacheExists,
16
17
  clearCache: webpack_cache_1.clearCache,
17
18
  getConfig: bundle_1.getConfig,
19
+ readRecursively: read_recursively_1.readRecursively,
18
20
  };
19
21
  var bundle_2 = require("./bundle");
20
22
  Object.defineProperty(exports, "bundle", { enumerable: true, get: function () { return bundle_2.bundle; } });
@@ -1,6 +1,8 @@
1
1
  import type { StaticFile } from 'remotion';
2
- export declare const readRecursively: ({ folder, output, startPath, }: {
2
+ export declare const readRecursively: ({ folder, output, startPath, staticHash, limit, }: {
3
3
  folder: string;
4
4
  startPath: string;
5
5
  output?: StaticFile[] | undefined;
6
+ staticHash: string;
7
+ limit: number;
6
8
  }) => StaticFile[];
@@ -29,22 +29,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.readRecursively = void 0;
30
30
  const fs_1 = __importStar(require("fs"));
31
31
  const path_1 = __importDefault(require("path"));
32
- const readRecursively = ({ folder, output = [], startPath, }) => {
32
+ const readRecursively = ({ folder, output = [], startPath, staticHash, limit, }) => {
33
33
  const absFolder = path_1.default.join(startPath, folder);
34
+ if (!fs_1.default.existsSync(absFolder)) {
35
+ return [];
36
+ }
34
37
  const files = fs_1.default.readdirSync(absFolder);
35
38
  for (const file of files) {
39
+ if (output.length >= limit) {
40
+ break;
41
+ }
36
42
  if (file.startsWith('.DS_Store')) {
37
43
  continue;
38
44
  }
39
45
  const stat = (0, fs_1.statSync)(path_1.default.join(absFolder, file));
40
46
  if (stat.isDirectory()) {
41
- (0, exports.readRecursively)({ startPath, folder: path_1.default.join(folder, file), output });
47
+ (0, exports.readRecursively)({
48
+ startPath,
49
+ folder: path_1.default.join(folder, file),
50
+ output,
51
+ staticHash,
52
+ limit,
53
+ });
42
54
  }
43
55
  else if (stat.isFile()) {
44
56
  output.push({
45
- path: path_1.default.join(folder, file),
57
+ name: path_1.default.join(folder, file),
46
58
  lastModified: Math.floor(stat.mtimeMs),
47
59
  sizeInBytes: stat.size,
60
+ src: staticHash + '/' + path_1.default.join(folder, file),
48
61
  });
49
62
  }
50
63
  else if (stat.isSymbolicLink()) {
@@ -52,13 +65,14 @@ const readRecursively = ({ folder, output = [], startPath, }) => {
52
65
  const realStat = fs_1.default.statSync(realpath);
53
66
  if (realStat.isFile()) {
54
67
  output.push({
55
- path: realpath,
68
+ name: realpath,
56
69
  lastModified: Math.floor(realStat.mtimeMs),
57
70
  sizeInBytes: realStat.size,
71
+ src: staticHash + '/' + realpath,
58
72
  });
59
73
  }
60
74
  }
61
75
  }
62
- return output.sort((a, b) => a.path.localeCompare(b.path));
76
+ return output.sort((a, b) => a.name.localeCompare(b.name));
63
77
  };
64
78
  exports.readRecursively = readRecursively;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.3.25",
3
+ "version": "3.3.26",
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.16.12",
28
28
  "react-refresh": "0.9.0",
29
- "remotion": "3.3.25",
29
+ "remotion": "3.3.26",
30
30
  "style-loader": "2.0.0",
31
31
  "webpack": "5.74.0"
32
32
  },
@@ -37,8 +37,8 @@
37
37
  "devDependencies": {
38
38
  "@jonny/eslint-config": "3.0.266",
39
39
  "@types/node": "^16.7.5",
40
- "@types/react": "18.0.23",
41
- "@types/react-dom": "18.0.0",
40
+ "@types/react": "18.0.26",
41
+ "@types/react-dom": "18.0.10",
42
42
  "@types/webpack-env": "^1.16.0",
43
43
  "@typescript-eslint/eslint-plugin": "5.18.0",
44
44
  "@typescript-eslint/parser": "5.18.0",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "48e46dd2ede8fe903bf0139cebd6f546d7f2b5e0"
67
+ "gitHead": "8efe8771f7c2b1d22bd50e8c81cc37ae054dfae9"
68
68
  }