@remotion/bundler 4.0.0-alpha4 → 4.0.0-alpha5

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 CHANGED
@@ -1,5 +1,5 @@
1
- import type { WebpackOverrideFn } from 'remotion';
2
1
  import webpack from 'webpack';
2
+ import type { WebpackOverrideFn } from './webpack-config';
3
3
  export declare type LegacyBundleOptions = {
4
4
  webpackOverride?: WebpackOverrideFn;
5
5
  outDir?: string;
@@ -21,6 +21,7 @@ export declare type BundleOptions = {
21
21
  entryPoint: string;
22
22
  onProgress?: (progress: number) => void;
23
23
  ignoreRegisterRootWarning?: boolean;
24
+ onDirectoryCreated?: (dir: string) => void;
24
25
  } & LegacyBundleOptions;
25
26
  declare type Arguments = [options: BundleOptions] | [
26
27
  entryPoint: string,
package/dist/bundle.js CHANGED
@@ -68,7 +68,7 @@ const getConfig = ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, optio
68
68
  webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : ((f) => f),
69
69
  onProgress,
70
70
  enableCaching: (_b = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _b !== void 0 ? _b : true,
71
- maxTimelineTracks: 15,
71
+ maxTimelineTracks: 90,
72
72
  // For production, the variables are set dynamically
73
73
  envVariables: {},
74
74
  entryPoints: [],
@@ -125,7 +125,7 @@ const validateEntryPoint = async (entryPoint) => {
125
125
  * @see [Documentation](https://www.remotion.dev/docs/bundle)
126
126
  */
127
127
  async function bundle(...args) {
128
- var _a, _b, _c, _d;
128
+ var _a, _b, _c, _d, _e;
129
129
  const actualArgs = convertArgumentsIntoOptions(args);
130
130
  const entryPoint = path_1.default.resolve(process.cwd(), actualArgs.entryPoint);
131
131
  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();
@@ -133,6 +133,7 @@ async function bundle(...args) {
133
133
  await validateEntryPoint(entryPoint);
134
134
  }
135
135
  const outDir = await prepareOutDir((_c = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.outDir) !== null && _c !== void 0 ? _c : null);
136
+ (_d = actualArgs.onDirectoryCreated) === null || _d === void 0 ? void 0 : _d.call(actualArgs, outDir);
136
137
  // The config might use an override which might use
137
138
  // `process.cwd()`. The context should always be the Remotion root.
138
139
  // This is not supported in worker threads (used for tests)
@@ -159,7 +160,7 @@ async function bundle(...args) {
159
160
  if (errors !== undefined && errors.length > 0) {
160
161
  throw new Error(errors[0].message + '\n' + errors[0].details);
161
162
  }
162
- const baseDir = (_d = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.publicPath) !== null && _d !== void 0 ? _d : '/';
163
+ const baseDir = (_e = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.publicPath) !== null && _e !== void 0 ? _e : '/';
163
164
  const staticHash = '/' +
164
165
  [trimTrailingSlash(trimLeadingSlash(baseDir)), 'public']
165
166
  .filter(Boolean)
@@ -187,6 +188,7 @@ async function bundle(...args) {
187
188
  dest: to,
188
189
  onSymlinkDetected: showSymlinkWarning,
189
190
  onProgress: (prog) => { var _a; return (_a = options.onPublicDirCopyProgress) === null || _a === void 0 ? void 0 : _a.call(options, prog); },
191
+ copied: 0,
190
192
  });
191
193
  }
192
194
  const html = (0, index_html_1.indexHtml)({
@@ -196,6 +198,7 @@ async function bundle(...args) {
196
198
  inputProps: null,
197
199
  remotionRoot: resolvedRemotionRoot,
198
200
  previewServerCommand: null,
201
+ renderQueue: null,
199
202
  numberOfAudioTags: 0,
200
203
  publicFiles: (0, read_recursively_1.readRecursively)({
201
204
  folder: '.',
@@ -205,6 +208,7 @@ async function bundle(...args) {
205
208
  }),
206
209
  includeFavicon: false,
207
210
  title: 'Remotion Bundle',
211
+ renderDefaults: undefined,
208
212
  });
209
213
  fs_1.default.writeFileSync(path_1.default.join(outDir, 'index.html'), html);
210
214
  return outDir;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  import fs from 'fs';
3
- export declare function copyDir({ src, dest, onSymlinkDetected, onProgress, }: {
3
+ export declare function copyDir({ src, dest, onSymlinkDetected, onProgress, copied, }: {
4
4
  src: string;
5
5
  dest: string;
6
6
  onSymlinkDetected: (entry: fs.Dirent, dir: string) => void;
7
7
  onProgress: (bytes: number) => void;
8
+ copied: number;
8
9
  }): Promise<void>;
package/dist/copy-dir.js CHANGED
@@ -6,10 +6,9 @@ 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, onSymlinkDetected, onProgress, }) {
9
+ async function copyDir({ src, dest, onSymlinkDetected, onProgress, copied = 0, }) {
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;
13
12
  for (const entry of entries) {
14
13
  const srcPath = path_1.default.join(src, entry.name);
15
14
  const destPath = path_1.default.join(dest, entry.name);
@@ -19,6 +18,7 @@ async function copyDir({ src, dest, onSymlinkDetected, onProgress, }) {
19
18
  dest: destPath,
20
19
  onSymlinkDetected,
21
20
  onProgress,
21
+ copied,
22
22
  });
23
23
  }
24
24
  else if (entry.isSymbolicLink()) {
@@ -1,5 +1,35 @@
1
1
  import type { StaticFile } from 'remotion';
2
- export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, numberOfAudioTags, publicFiles, includeFavicon, title, }: {
2
+ export declare type RenderDefaults = {
3
+ jpegQuality: number;
4
+ scale: number;
5
+ logLevel: string;
6
+ codec: string;
7
+ concurrency: number;
8
+ minConcurrency: number;
9
+ muted: boolean;
10
+ maxConcurrency: number;
11
+ stillImageFormat: 'png' | 'jpeg' | 'webp' | 'pdf';
12
+ videoImageFormat: 'png' | 'jpeg' | 'none';
13
+ audioCodec: string | null;
14
+ enforceAudioTrack: boolean;
15
+ proResProfile: string;
16
+ pixelFormat: string;
17
+ audioBitrate: string | null;
18
+ videoBitrate: string | null;
19
+ everyNthFrame: number;
20
+ numberOfGifLoops: number | null;
21
+ delayRenderTimeout: number;
22
+ disableWebSecurity: boolean;
23
+ openGlRenderer: string | null;
24
+ ignoreCertificateErrors: boolean;
25
+ headless: boolean;
26
+ };
27
+ declare global {
28
+ interface Window {
29
+ remotion_renderDefaults: RenderDefaults | undefined;
30
+ }
31
+ }
32
+ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, }: {
3
33
  staticHash: string;
4
34
  baseDir: string;
5
35
  editorName: string | null;
@@ -7,8 +37,10 @@ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables
7
37
  envVariables?: Record<string, string> | undefined;
8
38
  remotionRoot: string;
9
39
  previewServerCommand: string | null;
40
+ renderQueue: unknown | null;
10
41
  numberOfAudioTags: number;
11
42
  publicFiles: StaticFile[];
12
43
  includeFavicon: boolean;
13
44
  title: string;
45
+ renderDefaults: RenderDefaults | undefined;
14
46
  }) => 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, publicFiles, includeFavicon, title, }) => `
8
+ const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, }) => `
9
9
  <!DOCTYPE html>
10
10
  <html lang="en">
11
11
  <head>
@@ -26,11 +26,16 @@ ${includeFavicon
26
26
  ? `<script>window.remotion_editorName = "${editorName}";</script>`
27
27
  : '<script>window.remotion_editorName = null;</script>'}
28
28
  <script>window.remotion_projectName = ${JSON.stringify(path_1.default.basename(remotionRoot))};</script>
29
+ <script>window.remotion_renderDefaults = ${JSON.stringify(renderDefaults)};</script>
29
30
  <script>window.remotion_cwd = ${JSON.stringify(remotionRoot)};</script>
30
31
  <script>window.remotion_previewServerCommand = ${previewServerCommand ? JSON.stringify(previewServerCommand) : 'null'};</script>
31
32
  ${inputProps
32
33
  ? `<script>window.remotion_inputProps = ${JSON.stringify(JSON.stringify(inputProps))};</script>
33
34
  `
35
+ : ''}
36
+ ${renderQueue
37
+ ? `<script>window.remotion_initialRenderQueue = ${JSON.stringify(renderQueue)};</script>
38
+ `
34
39
  : ''}
35
40
  ${envVariables
36
41
  ? `<script> window.process = {
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare const BundlerInternals: {
7
7
  userDefinedComponent: string;
8
8
  outDir: string | null;
9
9
  environment: "development" | "production";
10
- webpackOverride: import("remotion").WebpackOverrideFn;
10
+ webpackOverride: import("./webpack-config").WebpackOverrideFn;
11
11
  onProgress?: ((f: number) => void) | undefined;
12
12
  enableCaching?: boolean | undefined;
13
13
  envVariables: Record<string, string>;
@@ -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, publicFiles, includeFavicon, title, }: {
20
+ indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, renderQueue, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, }: {
21
21
  staticHash: string;
22
22
  baseDir: string;
23
23
  editorName: string | null;
@@ -25,10 +25,12 @@ export declare const BundlerInternals: {
25
25
  envVariables?: Record<string, string> | undefined;
26
26
  remotionRoot: string;
27
27
  previewServerCommand: string | null;
28
+ renderQueue: unknown;
28
29
  numberOfAudioTags: number;
29
30
  publicFiles: import("remotion").StaticFile[];
30
31
  includeFavicon: boolean;
31
32
  title: string;
33
+ renderDefaults: import("./index-html").RenderDefaults | undefined;
32
34
  }) => string;
33
35
  cacheExists: (remotionRoot: string, environment: "development" | "production", hash: string) => "exists" | "other-exists" | "does-not-exist";
34
36
  clearCache: (remotionRoot: string) => Promise<void>;
@@ -47,6 +49,6 @@ export declare const BundlerInternals: {
47
49
  limit: number;
48
50
  }) => import("remotion").StaticFile[];
49
51
  };
50
- export { WebpackConfiguration, WebpackOverrideFn } from 'remotion';
51
52
  export { bundle, BundleOptions, LegacyBundleOptions } from './bundle';
53
+ export { WebpackConfiguration, WebpackOverrideFn } from './webpack-config';
52
54
  export { webpack };
@@ -16,4 +16,54 @@ remotion_1.Internals.CSSUtils.injectCSS(`
16
16
  font-size: 15px;
17
17
  line-height: 1.25;
18
18
  }
19
+
20
+ .__remotion-info-button-container code {
21
+ font-family: monospace;
22
+ font-size: 14px;
23
+ color: #0584f2
24
+ }
25
+
26
+ .__remotion-vertical-scrollbar::-webkit-scrollbar {
27
+ width: 6px;
28
+ }
29
+ .__remotion-vertical-scrollbar::-webkit-scrollbar-thumb {
30
+ background-color: rgba(0, 0, 0, 0.0);
31
+ }
32
+ .__remotion-vertical-scrollbar:hover::-webkit-scrollbar-thumb {
33
+ background-color: rgba(0, 0, 0, 0.6);
34
+ }
35
+ .__remotion-vertical-scrollbar:hover::-webkit-scrollbar-thumb:hover {
36
+ background-color: rgba(0, 0, 0, 1);
37
+ }
38
+
39
+ .__remotion-horizontal-scrollbar::-webkit-scrollbar {
40
+ height: 6px;
41
+ }
42
+ .__remotion-horizontal-scrollbar::-webkit-scrollbar-thumb {
43
+ background-color: rgba(0, 0, 0, 0.0);
44
+ }
45
+ .__remotion-horizontal-scrollbar:hover::-webkit-scrollbar-thumb {
46
+ background-color: rgba(0, 0, 0, 0.6);
47
+ }
48
+ .__remotion-horizontal-scrollbar:hover::-webkit-scrollbar-thumb:hover {
49
+ background-color: rgba(0, 0, 0, 1);
50
+ }
51
+
52
+ .__remotion-timeline-slider {
53
+ appearance: none;
54
+ width: 100px;
55
+ border-radius: 3px;
56
+ height: 6px;
57
+ background-color: rgba(255, 255, 255, 0.1);
58
+ accent-color: #ffffff;
59
+ }
60
+
61
+ .__remotion-timeline-slider::-moz-range-thumb {
62
+ width: 14px;
63
+ height: 14px;
64
+ border-radius: 50%;
65
+ background-color: #ffffff;
66
+ appearance: none;
67
+ }
68
+
19
69
  `);
@@ -40,8 +40,7 @@ const remotionCacheLocation = (remotionRoot, environment, hash) => {
40
40
  return path_1.default.join(getWebpackCacheDir(remotionRoot), (0, exports.getWebpackCacheName)(environment, hash));
41
41
  };
42
42
  const clearCache = (remotionRoot) => {
43
- var _a;
44
- return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(getWebpackCacheDir(remotionRoot), {
43
+ return fs_1.default.promises.rm(getWebpackCacheDir(remotionRoot), {
45
44
  recursive: true,
46
45
  });
47
46
  };
@@ -1,4 +1,6 @@
1
- import type { WebpackConfiguration, WebpackOverrideFn } from 'remotion';
1
+ import type { Configuration } from 'webpack';
2
+ export declare type WebpackConfiguration = Configuration;
3
+ export declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
2
4
  export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgress, enableCaching, envVariables, maxTimelineTracks, entryPoints, remotionRoot, keyboardShortcutsEnabled, poll, }: {
3
5
  entry: string;
4
6
  userDefinedComponent: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "4.0.0-alpha4",
3
+ "version": "4.0.0-alpha5",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -20,7 +20,7 @@
20
20
  "css-loader": "5.2.7",
21
21
  "esbuild": "0.16.12",
22
22
  "react-refresh": "0.9.0",
23
- "remotion": "4.0.0-alpha4",
23
+ "remotion": "4.0.0-alpha5",
24
24
  "style-loader": "2.0.0",
25
25
  "webpack": "5.76.1"
26
26
  },