@remotion/bundler 3.3.8 → 3.3.10

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
@@ -154,6 +154,8 @@ async function bundle(...args) {
154
154
  remotionRoot: resolvedRemotionRoot,
155
155
  previewServerCommand: null,
156
156
  numberOfAudioTags: 0,
157
+ includeFavicon: false,
158
+ title: 'Remotion Bundle',
157
159
  });
158
160
  fs_1.default.writeFileSync(path_1.default.join(outDir, 'index.html'), html);
159
161
  return outDir;
@@ -0,0 +1 @@
1
+ export declare const getEtagOfFile: (filePath: string) => Promise<string>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getEtagOfFile = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const crypto_1 = __importDefault(require("crypto"));
9
+ const chunk = 1024 * 1024 * 5; // 5MB
10
+ const md5 = (data) => crypto_1.default.createHash('md5').update(data).digest('hex');
11
+ const getEtagOfFile = async (filePath) => {
12
+ const stream = await fs_1.default.promises.readFile(filePath);
13
+ if (stream.length <= chunk) {
14
+ return md5(stream);
15
+ }
16
+ const md5Chunks = [];
17
+ const chunksNumber = Math.ceil(stream.length / chunk);
18
+ for (let i = 0; i < chunksNumber; i++) {
19
+ const chunkStream = stream.slice(i * chunk, (i + 1) * chunk);
20
+ md5Chunks.push(md5(chunkStream));
21
+ }
22
+ return `${md5(Buffer.from(md5Chunks.join(''), 'hex'))}-${chunksNumber}`;
23
+ };
24
+ exports.getEtagOfFile = getEtagOfFile;
@@ -1,4 +1,4 @@
1
- export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, }: {
1
+ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, includeFavicon, title, }: {
2
2
  staticHash: string;
3
3
  baseDir: string;
4
4
  editorName: string | null;
@@ -7,4 +7,6 @@ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables
7
7
  remotionRoot: string;
8
8
  previewServerCommand: string | null;
9
9
  numberOfAudioTags: number;
10
+ includeFavicon: boolean;
11
+ title: string;
10
12
  }) => string;
@@ -5,15 +5,17 @@ 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, }) => `
8
+ const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, includeFavicon, title, }) => `
9
9
  <!DOCTYPE html>
10
10
  <html lang="en">
11
11
  <head>
12
12
  <meta charset="UTF-8" />
13
13
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
14
  <link rel="preconnect" href="https://fonts.gstatic.com" />
15
- <link rel="icon" type="image/png" href="/remotion.png" />
16
- <title>Remotion Preview</title>
15
+ ${includeFavicon
16
+ ? ` <link rel="icon" type="image/png" href="/remotion.png" />\n`
17
+ : ''}
18
+ <title>${title}</title>
17
19
  </head>
18
20
  <body>
19
21
  <script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
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, numberOfAudioTags, }: {
19
+ indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, includeFavicon, title, }: {
20
20
  staticHash: string;
21
21
  baseDir: string;
22
22
  editorName: string | null;
@@ -25,6 +25,8 @@ export declare const BundlerInternals: {
25
25
  remotionRoot: string;
26
26
  previewServerCommand: string | null;
27
27
  numberOfAudioTags: number;
28
+ includeFavicon: boolean;
29
+ title: string;
28
30
  }) => string;
29
31
  cacheExists: (remotionRoot: string, environment: "development" | "production", hash: string) => "exists" | "other-exists" | "does-not-exist";
30
32
  clearCache: (remotionRoot: string) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { StaticFile } from 'remotion';
2
+ export declare const readRecursively: ({ folder, output, startPath, }: {
3
+ folder: string;
4
+ startPath: string;
5
+ output?: StaticFile[] | undefined;
6
+ }) => StaticFile[];
@@ -0,0 +1,64 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.readRecursively = void 0;
30
+ const fs_1 = __importStar(require("fs"));
31
+ const path_1 = __importDefault(require("path"));
32
+ const readRecursively = ({ folder, output = [], startPath, }) => {
33
+ const absFolder = path_1.default.join(startPath, folder);
34
+ const files = fs_1.default.readdirSync(absFolder);
35
+ for (const file of files) {
36
+ if (file.startsWith('.DS_Store')) {
37
+ continue;
38
+ }
39
+ const stat = (0, fs_1.statSync)(path_1.default.join(absFolder, file));
40
+ if (stat.isDirectory()) {
41
+ (0, exports.readRecursively)({ startPath, folder: path_1.default.join(folder, file), output });
42
+ }
43
+ else if (stat.isFile()) {
44
+ output.push({
45
+ path: path_1.default.join(folder, file),
46
+ lastModified: Math.floor(stat.mtimeMs),
47
+ sizeInBytes: stat.size,
48
+ });
49
+ }
50
+ else if (stat.isSymbolicLink()) {
51
+ const realpath = fs_1.default.realpathSync(path_1.default.join(folder, file));
52
+ const realStat = fs_1.default.statSync(realpath);
53
+ if (realStat.isFile()) {
54
+ output.push({
55
+ path: realpath,
56
+ lastModified: Math.floor(realStat.mtimeMs),
57
+ sizeInBytes: realStat.size,
58
+ });
59
+ }
60
+ }
61
+ }
62
+ return output.sort((a, b) => a.path.localeCompare(b.path));
63
+ };
64
+ exports.readRecursively = readRecursively;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.3.8",
3
+ "version": "3.3.10",
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.8",
29
+ "remotion": "3.3.10",
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": "4d4c78cf83b5fd085f24d5fd19f4507815e200a7"
67
+ "gitHead": "4909df63b9663ecc0294f186d5fe7efd59eee143"
68
68
  }