@remotion/bundler 4.0.0-oops.3 → 4.0.0-publish.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.
Files changed (55) hide show
  1. package/dist/bundle-mode.d.ts +1 -1
  2. package/dist/bundle.d.ts +7 -0
  3. package/dist/bundle.js +77 -0
  4. package/dist/dev-middleware/compatible-api.d.ts +1 -0
  5. package/dist/dev-middleware/is-color-supported.js +5 -1
  6. package/dist/error-overlay/react-overlay/utils/open-in-editor.js +5 -1
  7. package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +1 -1
  8. package/dist/error-overlay/remotion-overlay/Button.js +1 -1
  9. package/dist/error-overlay/remotion-overlay/CodeFrame.js +2 -2
  10. package/dist/error-overlay/remotion-overlay/DismissButton.js +1 -1
  11. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
  12. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -4
  13. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +1 -1
  14. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
  15. package/dist/error-overlay/remotion-overlay/Overlay.js +1 -1
  16. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  17. package/dist/error-overlay/remotion-overlay/StackFrame.js +2 -2
  18. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  19. package/dist/error-overlay/remotion-overlay/carets.js +2 -2
  20. package/dist/error-overlay/remotion-overlay/index.js +2 -2
  21. package/dist/esbuild-loader/index.d.ts +2 -2
  22. package/dist/esbuild-loader/index.js +1 -0
  23. package/dist/esbuild-loader/interfaces.d.ts +1 -1
  24. package/dist/fast-refresh/index.d.ts +1 -1
  25. package/dist/fast-refresh/index.js +0 -27
  26. package/dist/fast-refresh/loader.d.ts +1 -1
  27. package/dist/get-port.js +26 -24
  28. package/dist/homepage/homepage.d.ts +0 -1
  29. package/dist/homepage/homepage.js +5 -6
  30. package/dist/hot-middleware/process-update.js +2 -2
  31. package/dist/index-html.d.ts +1 -0
  32. package/dist/index-html.js +40 -0
  33. package/dist/index.d.ts +18 -19
  34. package/dist/index.js +10 -16
  35. package/dist/is-path-inside.d.ts +1 -0
  36. package/dist/is-path-inside.js +27 -0
  37. package/dist/p-limit.d.ts +1 -0
  38. package/dist/p-limit.js +57 -0
  39. package/dist/renderEntry.d.ts +1 -1
  40. package/dist/renderEntry.js +51 -38
  41. package/dist/routes.d.ts +2 -0
  42. package/dist/routes.js +121 -0
  43. package/dist/serve-static.d.ts +9 -0
  44. package/dist/serve-static.js +81 -0
  45. package/dist/setup-environment.js +0 -1
  46. package/dist/start-server-pure.d.ts +8 -0
  47. package/dist/start-server-pure.js +68 -0
  48. package/dist/start-server.d.ts +6 -6
  49. package/dist/start-server.js +4 -4
  50. package/dist/ts-alias-plugin.d.ts +4 -0
  51. package/dist/ts-alias-plugin.js +21 -0
  52. package/dist/webpack-config.d.ts +3 -2
  53. package/dist/webpack-config.js +11 -21
  54. package/package.json +5 -19
  55. package/web/favicon.png +0 -0
@@ -1,3 +1,3 @@
1
- import { BundleState } from 'remotion';
1
+ import type { BundleState } from 'remotion';
2
2
  export declare const setBundleMode: (state: BundleState) => void;
3
3
  export declare const getBundleMode: () => BundleState;
@@ -0,0 +1,7 @@
1
+ import type { WebpackOverrideFn } from 'remotion';
2
+ export declare const bundle: (entryPoint: string, onProgressUpdate?: ((progress: number) => void) | undefined, options?: {
3
+ webpackOverride?: WebpackOverrideFn;
4
+ outDir?: string;
5
+ enableCaching?: boolean;
6
+ publicPath?: string;
7
+ }) => Promise<string>;
package/dist/bundle.js ADDED
@@ -0,0 +1,77 @@
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.bundle = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const os_1 = __importDefault(require("os"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const remotion_1 = require("remotion");
11
+ const util_1 = require("util");
12
+ const webpack_1 = __importDefault(require("webpack"));
13
+ const copy_dir_1 = require("./copy-dir");
14
+ const index_html_1 = require("./index-html");
15
+ const webpack_config_1 = require("./webpack-config");
16
+ const entry = require.resolve('./renderEntry');
17
+ const promisified = (0, util_1.promisify)(webpack_1.default);
18
+ const prepareOutDir = async (specified) => {
19
+ if (specified) {
20
+ await fs_1.default.promises.mkdir(specified, { recursive: true });
21
+ return specified;
22
+ }
23
+ return fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-graphics'));
24
+ };
25
+ const trimLeadingSlash = (p) => {
26
+ if (p.startsWith('/')) {
27
+ return trimLeadingSlash(p.substr(1));
28
+ }
29
+ return p;
30
+ };
31
+ const trimTrailingSlash = (p) => {
32
+ if (p.endsWith('/')) {
33
+ return trimTrailingSlash(p.substr(0, p.length - 1));
34
+ }
35
+ return p;
36
+ };
37
+ const bundle = async (entryPoint, onProgressUpdate, options) => {
38
+ var _a, _b, _c, _d;
39
+ const outDir = await prepareOutDir((_a = options === null || options === void 0 ? void 0 : options.outDir) !== null && _a !== void 0 ? _a : null);
40
+ const output = await promisified([
41
+ (0, webpack_config_1.webpackConfig)({
42
+ entry,
43
+ userDefinedComponent: entryPoint,
44
+ outDir,
45
+ environment: 'production',
46
+ webpackOverride: (_b = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _b !== void 0 ? _b : remotion_1.Internals.defaultOverrideFunction,
47
+ onProgressUpdate,
48
+ enableCaching: (_c = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _c !== void 0 ? _c : remotion_1.Internals.DEFAULT_WEBPACK_CACHE_ENABLED,
49
+ maxTimelineTracks: 15,
50
+ // For production, the variables are set dynamically
51
+ envVariables: {},
52
+ inputProps: {},
53
+ entryPoints: [],
54
+ }),
55
+ ]);
56
+ if (!output) {
57
+ throw new Error('Expected webpack output');
58
+ }
59
+ const { errors } = output.toJson();
60
+ if (errors !== undefined && errors.length > 0) {
61
+ throw new Error(errors[0].message + '\n' + errors[0].details);
62
+ }
63
+ const baseDir = (_d = options === null || options === void 0 ? void 0 : options.publicPath) !== null && _d !== void 0 ? _d : '/';
64
+ const publicDir = '/' +
65
+ [trimTrailingSlash(trimLeadingSlash(baseDir)), 'public']
66
+ .filter(Boolean)
67
+ .join('/');
68
+ const from = path_1.default.join(process.cwd(), 'public');
69
+ const to = path_1.default.join(outDir, 'public');
70
+ if (fs_1.default.existsSync(from)) {
71
+ await (0, copy_dir_1.copyDir)(from, to);
72
+ }
73
+ const html = (0, index_html_1.indexHtml)(publicDir, baseDir, null);
74
+ fs_1.default.writeFileSync(path_1.default.join(outDir, 'index.html'), html);
75
+ return outDir;
76
+ };
77
+ exports.bundle = bundle;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Request, Response } from 'express';
3
4
  import { ReadStream } from 'fs';
4
5
  export declare function getHeaderNames(res: Response): string[];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -2,7 +2,11 @@
2
2
  // Duplicated in create-video/src/open-in-editor.ts
3
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
4
  if (k2 === undefined) k2 = k;
5
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
6
10
  }) : (function(o, m, k, k2) {
7
11
  if (k2 === undefined) k2 = k;
8
12
  o[k2] = m[k];
@@ -9,6 +9,6 @@ const AskOnDiscord = () => {
9
9
  const openInBrowser = (0, react_1.useCallback)(() => {
10
10
  window.open(DISCORD_LINK, '_blank');
11
11
  }, []);
12
- return (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, children: "Ask on Discord" }, void 0);
12
+ return (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, children: "Ask on Discord" });
13
13
  };
14
14
  exports.AskOnDiscord = AskOnDiscord;
@@ -19,6 +19,6 @@ const buttonContainer = {
19
19
  fontSize: 14,
20
20
  };
21
21
  const Button = ({ children, onClick, disabled }) => {
22
- return ((0, jsx_runtime_1.jsx)("button", { style: button, type: "button", disabled: disabled, onClick: onClick, children: (0, jsx_runtime_1.jsx)("div", { style: buttonContainer, children: children }, void 0) }, void 0));
22
+ return ((0, jsx_runtime_1.jsx)("button", { style: button, type: "button", disabled: disabled, onClick: onClick, children: (0, jsx_runtime_1.jsx)("div", { style: buttonContainer, children: children }) }));
23
23
  };
24
24
  exports.Button = Button;
@@ -22,7 +22,7 @@ const CodeFrame = ({ source, lineNumberWidth }) => {
22
22
  tabSize: 2,
23
23
  color: s.highlight ? 'white' : 'rgba(255, 255, 255, 0.6)',
24
24
  lineHeight: 1.7,
25
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: lineNumber, children: String(s.lineNumber).padStart(lineNumberWidth, ' ') }, void 0), s.content] }, j));
26
- }) }, void 0));
25
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: lineNumber, children: String(s.lineNumber).padStart(lineNumberWidth, ' ') }), s.content] }, j));
26
+ }) }));
27
27
  };
28
28
  exports.CodeFrame = CodeFrame;
@@ -18,6 +18,6 @@ const DismissButton = () => {
18
18
  const dismiss = (0, react_1.useCallback)(() => {
19
19
  window.location.href = '/';
20
20
  }, []);
21
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: style, onClick: dismiss, children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 352 512", style: size, children: (0, jsx_runtime_1.jsx)("path", { fill: "white", d: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" }, void 0) }, void 0) }, void 0));
21
+ return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: style, onClick: dismiss, children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 352 512", style: size, children: (0, jsx_runtime_1.jsx)("path", { fill: "white", d: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" }) }) }));
22
22
  };
23
23
  exports.DismissButton = DismissButton;
@@ -36,10 +36,10 @@ const ErrorDisplay = ({ display }) => {
36
36
  .trim();
37
37
  }, [display.error]);
38
38
  const lineNumberWidth = String(highestLineNumber).length;
39
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message }, void 0), display.stackFrames.length > 0 && window.remotion_editorName ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OpenInEditor_1.OpenInEditor, { stack: display.stackFrames[0] }, void 0), (0, jsx_runtime_1.jsx)("div", { style: spacer }, void 0)] }, void 0)) : null, (0, jsx_runtime_1.jsx)(SearchGitHubIssues_1.SearchGithubIssues, { message: display.error.message }, void 0), (0, jsx_runtime_1.jsx)("div", { style: spacer }, void 0), (0, jsx_runtime_1.jsx)(AskOnDiscord_1.AskOnDiscord, {}, void 0), (0, jsx_runtime_1.jsx)("div", { style: stack, children: display.stackFrames.map((s, i) => {
39
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message }), display.stackFrames.length > 0 && window.remotion_editorName ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OpenInEditor_1.OpenInEditor, { stack: display.stackFrames[0] }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(SearchGitHubIssues_1.SearchGithubIssues, { message: display.error.message }), (0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsx)(AskOnDiscord_1.AskOnDiscord, {}), (0, jsx_runtime_1.jsx)("div", { style: stack, children: display.stackFrames.map((s, i) => {
40
40
  return ((0, jsx_runtime_1.jsx)(StackFrame_1.StackElement
41
41
  // eslint-disable-next-line react/no-array-index-key
42
42
  , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)' }, i));
43
- }) }, void 0)] }, void 0));
43
+ }) })] }));
44
44
  };
45
45
  exports.ErrorDisplay = ErrorDisplay;
@@ -48,14 +48,14 @@ const ErrorLoader = ({ error }) => {
48
48
  });
49
49
  }, [error]);
50
50
  if (state.type === 'loading') {
51
- return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: true, name: error.name, message: error.message }, void 0) }, void 0));
51
+ return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: true, name: error.name, message: error.message }) }));
52
52
  }
53
53
  if (state.type === 'error') {
54
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: error.name, message: error.message }, void 0), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: "Error while getting stack trace:" }, void 0), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: state.err.stack }, void 0), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: "Report this in the Remotion repo." }, void 0)] }, void 0));
54
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: error.name, message: error.message }), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: "Error while getting stack trace:" }), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: state.err.stack }), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: "Report this in the Remotion repo." })] }));
55
55
  }
56
56
  if (state.type === 'no-record') {
57
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: error.name, message: error.message }, void 0), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: "Check the Terminal and browser console for error messages." }, void 0)] }, void 0));
57
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: error.name, message: error.message }), (0, jsx_runtime_1.jsx)("div", { style: errorWhileErrorStyle, children: "Check the Terminal and browser console for error messages." })] }));
58
58
  }
59
- return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(ErrorDisplay_1.ErrorDisplay, { display: state.record }, void 0) }, void 0));
59
+ return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(ErrorDisplay_1.ErrorDisplay, { display: state.record }) }));
60
60
  };
61
61
  exports.ErrorLoader = ErrorLoader;
@@ -36,6 +36,6 @@ const spacer = {
36
36
  width: 5,
37
37
  };
38
38
  const ErrorTitle = ({ name, message, symbolicating }) => {
39
- return ((0, jsx_runtime_1.jsxs)("div", { style: title, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("span", { style: errName, children: name }, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsxs)("div", { style: row, children: [symbolicating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Symbolicating_1.Symbolicating, {}, void 0), (0, jsx_runtime_1.jsx)("div", { style: spacer }, void 0)] }, void 0)) : null, (0, jsx_runtime_1.jsx)("div", { children: message }, void 0)] }, void 0)] }, void 0), (0, react_overlay_1.didUnmountReactApp)() ? null : (0, jsx_runtime_1.jsx)(DismissButton_1.DismissButton, {}, void 0)] }, void 0));
39
+ return ((0, jsx_runtime_1.jsxs)("div", { style: title, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("span", { style: errName, children: name }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: row, children: [symbolicating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Symbolicating_1.Symbolicating, {}), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)("div", { children: message })] })] }), (0, react_overlay_1.didUnmountReactApp)() ? null : (0, jsx_runtime_1.jsx)(DismissButton_1.DismissButton, {})] }));
40
40
  };
41
41
  exports.ErrorTitle = ErrorTitle;
@@ -85,6 +85,6 @@ const OpenInEditor = ({ stack }) => {
85
85
  throw new Error('invalid state');
86
86
  }
87
87
  }, [state.type]);
88
- return ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, disabled: state.type !== 'idle', children: label }, void 0));
88
+ return ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, disabled: state.type !== 'idle', children: label }));
89
89
  };
90
90
  exports.OpenInEditor = OpenInEditor;
@@ -44,6 +44,6 @@ const Overlay = () => {
44
44
  color: 'white',
45
45
  }, children: errors.errors.map((err) => {
46
46
  return (0, jsx_runtime_1.jsx)(ErrorLoader_1.ErrorLoader, { error: err }, err.stack);
47
- }) }, void 0));
47
+ }) }));
48
48
  };
49
49
  exports.Overlay = Overlay;
@@ -8,6 +8,6 @@ const SearchGithubIssues = ({ message }) => {
8
8
  const openInBrowser = (0, react_1.useCallback)(() => {
9
9
  window.open(`https://github.com/remotion-dev/remotion/issues?q=${encodeURIComponent(message)}`, '_blank');
10
10
  }, [message]);
11
- return (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, children: "Search GitHub Issues" }, void 0);
11
+ return (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, children: "Search GitHub Issues" });
12
12
  };
13
13
  exports.SearchGithubIssues = SearchGithubIssues;
@@ -41,8 +41,8 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
41
41
  const toggleCodeFrame = (0, react_1.useCallback)(() => {
42
42
  setShowCodeFrame((f) => !f);
43
43
  }, []);
44
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }, void 0), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] }, void 0)) : null] }, void 0), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, {}, void 0) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}, void 0) }, void 0)) : null] }, void 0), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
44
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, {}) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
45
45
  s.originalScriptCode.length > 0 &&
46
- showCodeFrame ? ((0, jsx_runtime_1.jsx)(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode }, void 0)) : null }, void 0)] }, void 0));
46
+ showCodeFrame ? ((0, jsx_runtime_1.jsx)(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })] }));
47
47
  };
48
48
  exports.StackElement = StackElement;
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Symbolicating = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Symbolicating = (props) => {
6
- return ((0, jsx_runtime_1.jsxs)("svg", { id: "loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: "16", height: "16", fill: "white", ...props, children: [(0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(0 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(45 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.125s" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(90 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.25s" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(135 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.375s" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(180 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.5s" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(225 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.675s" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(270 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.75s" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(315 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.875s" }, void 0) }, void 0)] }, void 0));
6
+ return ((0, jsx_runtime_1.jsxs)("svg", { id: "loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: "16", height: "16", fill: "white", ...props, children: [(0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(0 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(45 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.125s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(90 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.25s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(135 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.375s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(180 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.5s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(225 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.675s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(270 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.75s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(315 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.875s" }) })] }));
7
7
  };
8
8
  exports.Symbolicating = Symbolicating;
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CaretDown = exports.CaretRight = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const CaretRight = () => {
6
- return ((0, jsx_runtime_1.jsx)("svg", { style: { height: 20 }, "aria-hidden": "true", focusable: "false", role: "img", viewBox: "0 0 192 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }, void 0) }, void 0));
6
+ return ((0, jsx_runtime_1.jsx)("svg", { style: { height: 20 }, "aria-hidden": "true", focusable: "false", role: "img", viewBox: "0 0 192 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }) }));
7
7
  };
8
8
  exports.CaretRight = CaretRight;
9
9
  const CaretDown = () => {
10
- return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: 20 }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }, void 0) }, void 0));
10
+ return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: 20 }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
11
11
  };
12
12
  exports.CaretDown = CaretDown;
@@ -9,10 +9,10 @@ const client_1 = __importDefault(require("react-dom/client"));
9
9
  const Overlay_1 = require("./Overlay");
10
10
  const mountRemotionOverlay = () => {
11
11
  if (client_1.default.createRoot) {
12
- client_1.default.createRoot(document.getElementById('remotion-error-overlay')).render((0, jsx_runtime_1.jsx)(Overlay_1.Overlay, {}, void 0));
12
+ client_1.default.createRoot(document.getElementById('remotion-error-overlay')).render((0, jsx_runtime_1.jsx)(Overlay_1.Overlay, {}));
13
13
  }
14
14
  else {
15
- client_1.default.render((0, jsx_runtime_1.jsx)(Overlay_1.Overlay, {}, void 0), document.getElementById('remotion-error-overlay'));
15
+ client_1.default.render((0, jsx_runtime_1.jsx)(Overlay_1.Overlay, {}), document.getElementById('remotion-error-overlay'));
16
16
  }
17
17
  };
18
18
  exports.mountRemotionOverlay = mountRemotionOverlay;
@@ -1,4 +1,4 @@
1
- import webpack from 'webpack';
2
- import { LoaderOptions } from './interfaces';
1
+ import type webpack from 'webpack';
2
+ import type { LoaderOptions } from './interfaces';
3
3
  declare function ESBuildLoader(this: webpack.LoaderContext<LoaderOptions>, source: string): Promise<void>;
4
4
  export default ESBuildLoader;
@@ -35,6 +35,7 @@ async function ESBuildLoader(source) {
35
35
  sourcefile: this.resourcePath,
36
36
  };
37
37
  if (!('tsconfigRaw' in transformOptions) && isTypescriptInstalled()) {
38
+ // eslint-disable-next-line @typescript-eslint/consistent-type-imports
38
39
  const typescript = require('typescript');
39
40
  const tsConfig = typescript.readConfigFile(tsConfigPath, typescript.sys.readFile);
40
41
  transformOptions.tsconfigRaw = tsConfig.config;
@@ -1,4 +1,4 @@
1
- import { transform, TransformOptions } from 'esbuild';
1
+ import type { transform, TransformOptions } from 'esbuild';
2
2
  declare type Implementation = {
3
3
  transform: typeof transform;
4
4
  };
@@ -24,7 +24,7 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  * SOFTWARE.
26
26
  */
27
- import webpack from 'webpack';
27
+ import type webpack from 'webpack';
28
28
  export declare class ReactFreshWebpackPlugin {
29
29
  apply(compiler: webpack.Compiler): void;
30
30
  }
@@ -4,33 +4,6 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ReactFreshWebpackPlugin = void 0;
7
- /**
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2020 Vercel, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
- // This file is copied from the @vercel/next.js, with removed TS annotations
31
- // minor tweaks, and removed all webpack v4-related functionality
32
- //
33
- // https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
34
7
  const webpack_1 = require("webpack");
35
8
  class ReactRefreshRuntimeModule extends webpack_1.RuntimeModule {
36
9
  constructor() {
@@ -30,6 +30,6 @@
30
30
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
31
  * SOFTWARE.
32
32
  */
33
- import { LoaderDefinition } from 'webpack';
33
+ import type { LoaderDefinition } from 'webpack';
34
34
  declare const ReactRefreshLoader: LoaderDefinition;
35
35
  export default ReactRefreshLoader;
package/dist/get-port.js CHANGED
@@ -5,16 +5,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getDesiredPort = void 0;
7
7
  const net_1 = __importDefault(require("net"));
8
- const getAvailablePort = (portToTry) => new Promise((resolve, reject) => {
9
- const server = net_1.default.createServer();
10
- server.unref();
11
- server.on('error', reject);
12
- server.listen({ port: portToTry }, () => {
13
- const { port } = server.address();
14
- server.close(() => {
15
- resolve(port);
16
- });
8
+ const p_limit_1 = require("./p-limit");
9
+ const getAvailablePort = (portToTry) => new Promise((resolve) => {
10
+ let status = 'unavailable';
11
+ const host = '127.0.0.1';
12
+ const socket = new net_1.default.Socket();
13
+ socket.on('connect', () => {
14
+ status = 'unavailable';
15
+ socket.destroy();
17
16
  });
17
+ socket.setTimeout(1000);
18
+ socket.on('timeout', () => {
19
+ status = 'unavailable';
20
+ socket.destroy();
21
+ resolve(status);
22
+ });
23
+ socket.on('error', () => {
24
+ status = 'available';
25
+ });
26
+ socket.on('close', () => resolve(status));
27
+ socket.connect(portToTry, host);
18
28
  });
19
29
  const portCheckSequence = function* (ports) {
20
30
  if (ports) {
@@ -22,30 +32,18 @@ const portCheckSequence = function* (ports) {
22
32
  }
23
33
  yield 0; // Fall back to 0 if anything else failed
24
34
  };
25
- const isPortAvailable = async (port) => {
26
- try {
27
- await getAvailablePort(port);
28
- return true;
29
- }
30
- catch (error) {
31
- if (!['EADDRINUSE', 'EACCES'].includes(error.code)) {
32
- throw error;
33
- }
34
- return false;
35
- }
36
- };
37
35
  const getPort = async (from, to) => {
38
36
  const ports = makeRange(from, to);
39
37
  for (const port of portCheckSequence(ports)) {
40
- if (await isPortAvailable(port)) {
38
+ if ((await getAvailablePort(port)) === 'available') {
41
39
  return port;
42
40
  }
43
41
  }
44
42
  throw new Error('No available ports found');
45
43
  };
46
- const getDesiredPort = async (desiredPort, from, to) => {
44
+ const getDesiredPortUnlimited = async (desiredPort, from, to) => {
47
45
  if (typeof desiredPort !== 'undefined' &&
48
- (await isPortAvailable(desiredPort))) {
46
+ (await getAvailablePort(desiredPort)) === 'available') {
49
47
  return desiredPort;
50
48
  }
51
49
  const actualPort = await getPort(from, to);
@@ -55,6 +53,10 @@ const getDesiredPort = async (desiredPort, from, to) => {
55
53
  }
56
54
  return actualPort;
57
55
  };
56
+ const limit = (0, p_limit_1.pLimit)(1);
57
+ const getDesiredPort = (desiredPort, from, to) => {
58
+ return limit(getDesiredPortUnlimited, desiredPort, from, to);
59
+ };
58
60
  exports.getDesiredPort = getDesiredPort;
59
61
  const makeRange = (from, to) => {
60
62
  if (!Number.isInteger(from) || !Number.isInteger(to)) {
@@ -1,3 +1,2 @@
1
1
  import React from 'react';
2
- export declare const AvailableCompositions: React.FC;
3
2
  export declare const Homepage: React.FC;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Homepage = exports.AvailableCompositions = void 0;
3
+ exports.Homepage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const bundle_mode_1 = require("../bundle-mode");
@@ -47,17 +47,16 @@ const AvailableCompositions = () => {
47
47
  (0, renderEntry_1.setBundleModeAndUpdate)({ type: 'evaluation' });
48
48
  }, []);
49
49
  if ((0, bundle_mode_1.getBundleMode)().type !== 'evaluation') {
50
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showComps, children: "Click here to see a list of available compositions." }, void 0));
50
+ return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showComps, children: "Click here to see a list of available compositions." }));
51
51
  }
52
- return ((0, jsx_runtime_1.jsxs)("div", { children: [comps === null ? (0, jsx_runtime_1.jsx)("p", { children: "Loading compositions..." }, void 0) : null, (0, jsx_runtime_1.jsx)("ul", { children: comps === null
52
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [comps === null ? (0, jsx_runtime_1.jsx)("p", { children: "Loading compositions..." }) : null, (0, jsx_runtime_1.jsx)("ul", { children: comps === null
53
53
  ? null
54
54
  : comps.map((c) => {
55
55
  return (0, jsx_runtime_1.jsx)("li", { children: c.id }, c.id);
56
- }) }, void 0)] }, void 0));
56
+ }) })] }));
57
57
  };
58
- exports.AvailableCompositions = AvailableCompositions;
59
58
  const Homepage = () => {
60
59
  const url = window.location.origin + window.location.pathname;
61
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("h1", { children: "Remotion Bundle" }, void 0), "This is a website which contains a bundled Remotion video. You can render videos based on this URL.", (0, jsx_runtime_1.jsx)("h2", { children: "Available compositions" }, void 0), (0, jsx_runtime_1.jsx)(exports.AvailableCompositions, {}, void 0), (0, jsx_runtime_1.jsx)("h2", { children: "How to render" }, void 0), "Locally: ", (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsxs)("div", { style: pre, children: ["npx remotion render ", url, " ", '<comp-name> <output-location>'] }, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), "With Remotion Lambda: ", (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsxs)("div", { style: pre, children: ["npx remotion lambda render ", url, " ", '<comp-name>'] }, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsxs)("p", { children: ["You can also render still images, and use the Node.JS APIs", ' ', (0, jsx_runtime_1.jsx)("code", { children: "getCompositions()" }, void 0), ", ", (0, jsx_runtime_1.jsx)("code", { children: "renderMedia()" }, void 0), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "renderMediaOnLambda()" }, void 0), ", ", (0, jsx_runtime_1.jsx)("code", { children: "renderStill()" }, void 0), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "renderStillOnLambda()" }, void 0), " with this URL."] }, void 0), (0, jsx_runtime_1.jsxs)("p", { children: ["Visit", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs", target: "_blank", children: "remotion.dev/docs" }, void 0), ' ', "to read the documentation."] }, void 0)] }, void 0));
60
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("h1", { children: "Remotion Bundle" }), "This is a website which contains a bundled Remotion video. You can render videos based on this URL.", (0, jsx_runtime_1.jsx)("h2", { children: "Available compositions" }), (0, jsx_runtime_1.jsx)(AvailableCompositions, {}), (0, jsx_runtime_1.jsx)("h2", { children: "How to render" }), "Locally: ", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: pre, children: ["npx remotion render ", url, " ", '<comp-name> <output-location>'] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), "With Remotion Lambda: ", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: pre, children: ["npx remotion lambda render ", url, " ", '<comp-name>'] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("p", { children: ["You can also render still images, and use the Node.JS APIs", ' ', (0, jsx_runtime_1.jsx)("code", { children: "getCompositions()" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "renderMedia()" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "renderMediaOnLambda()" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "renderStill()" }), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "renderStillOnLambda()" }), " with this URL."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Visit", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs", target: "_blank", children: "remotion.dev/docs" }), ' ', "to read the documentation."] })] }));
62
61
  };
63
62
  exports.Homepage = Homepage;
@@ -50,7 +50,7 @@ const processUpdate = function (hash, moduleMap, options) {
50
50
  async function check() {
51
51
  var _a;
52
52
  const cb = function (err, updatedModules) {
53
- var _a, _b;
53
+ var _a;
54
54
  if (err)
55
55
  return handleError(err);
56
56
  if (!updatedModules) {
@@ -69,7 +69,7 @@ const processUpdate = function (hash, moduleMap, options) {
69
69
  logUpdates(updatedModules, renewedModules);
70
70
  };
71
71
  const applyResult = (_a = module.hot) === null || _a === void 0 ? void 0 : _a.apply(applyOptions, applyCallback);
72
- if ((_b = applyResult) === null || _b === void 0 ? void 0 : _b.then) {
72
+ if (applyResult === null || applyResult === void 0 ? void 0 : applyResult.then) {
73
73
  // HotModuleReplacement.runtime.js refers to the result as `outdatedModules`
74
74
  applyResult
75
75
  .then((outdatedModules) => {
@@ -0,0 +1 @@
1
+ export declare const indexHtml: (staticHash: string, baseDir: string, editorName: string | null) => string;
@@ -0,0 +1,40 @@
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.indexHtml = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const indexHtml = (staticHash, baseDir, editorName) => `
9
+ <!DOCTYPE html>
10
+ <html lang="en">
11
+ <head>
12
+ <meta charset="UTF-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
15
+ <link rel="icon" type="image/png" href="/remotion.png" />
16
+ <title>Remotion Preview</title>
17
+ </head>
18
+ <body>
19
+ <script>window.remotion_staticBase = "${staticHash}";</script>
20
+ <div id="video-container"></div>
21
+ <div id="explainer-container"></div>
22
+ ${editorName
23
+ ? `<script>window.remotion_editorName = "${editorName}";</script>`
24
+ : '<script>window.remotion_editorName = null;</script>'}
25
+ <script>window.remotion_projectName = ${JSON.stringify(path_1.default.basename(process.cwd()))};</script>
26
+ <script>window.remotion_cwd = ${JSON.stringify(process.cwd())};</script>
27
+
28
+ <div id="container"></div>
29
+ <div id="menuportal-0"></div>
30
+ <div id="menuportal-1"></div>
31
+ <div id="menuportal-2"></div>
32
+ <div id="menuportal-3"></div>
33
+ <div id="menuportal-4"></div>
34
+ <div id="menuportal-5"></div>
35
+ <div id="remotion-error-overlay"></div>
36
+ <script src="${baseDir}bundle.js"></script>
37
+ </body>
38
+ </html>
39
+ `.trim();
40
+ exports.indexHtml = indexHtml;