@remotion/bundler 3.2.21 → 3.2.23-ensure-ffmpeg.123

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 (42) hide show
  1. package/LICENSE.md +8 -8
  2. package/dist/bundle-mode.d.ts +0 -0
  3. package/dist/bundle-mode.js +0 -0
  4. package/dist/bundle.d.ts +0 -0
  5. package/dist/bundle.js +19 -5
  6. package/dist/copy-dir.d.ts +0 -0
  7. package/dist/copy-dir.js +0 -0
  8. package/dist/esbuild-loader/index.d.ts +0 -0
  9. package/dist/esbuild-loader/index.js +0 -0
  10. package/dist/esbuild-loader/interfaces.d.ts +0 -0
  11. package/dist/esbuild-loader/interfaces.js +0 -0
  12. package/dist/fast-refresh/helpers.d.ts +0 -0
  13. package/dist/fast-refresh/helpers.js +0 -0
  14. package/dist/fast-refresh/index.d.ts +0 -0
  15. package/dist/fast-refresh/index.js +0 -0
  16. package/dist/fast-refresh/loader.d.ts +0 -0
  17. package/dist/fast-refresh/loader.js +0 -0
  18. package/dist/fast-refresh/runtime.d.ts +0 -0
  19. package/dist/fast-refresh/runtime.js +0 -0
  20. package/dist/homepage/homepage.d.ts +0 -0
  21. package/dist/homepage/homepage.js +0 -0
  22. package/dist/index-html.d.ts +2 -1
  23. package/dist/index-html.js +7 -1
  24. package/dist/index.d.ts +2 -1
  25. package/dist/index.js +0 -0
  26. package/dist/renderEntry.d.ts +0 -0
  27. package/dist/renderEntry.js +27 -4
  28. package/dist/setup-environment.d.ts +0 -0
  29. package/dist/setup-environment.js +5 -0
  30. package/dist/stringify-with-circular-references.d.ts +1 -0
  31. package/dist/stringify-with-circular-references.js +18 -0
  32. package/dist/test/validate-bundle.test.d.ts +0 -0
  33. package/dist/test/validate-bundle.test.js +0 -0
  34. package/dist/test/validate-public-dir.test.d.ts +0 -0
  35. package/dist/test/validate-public-dir.test.js +0 -0
  36. package/dist/validate-public-dir.d.ts +0 -0
  37. package/dist/validate-public-dir.js +0 -0
  38. package/dist/webpack-cache.d.ts +0 -0
  39. package/dist/webpack-cache.js +0 -0
  40. package/dist/webpack-config.d.ts +0 -0
  41. package/dist/webpack-config.js +4 -1
  42. package/package.json +9 -9
package/LICENSE.md CHANGED
@@ -1,34 +1,34 @@
1
1
  # Remotion License
2
2
 
3
- Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit organisations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
3
+ Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
4
4
 
5
5
  - [Free license](#free-license)
6
6
  - [Company license](#company-license)
7
7
 
8
8
  ## Free license
9
9
 
10
- Copyright © 2022 [Jonny Burger](https://jonny.io)
10
+ Copyright © 2022 [Remotion](https://www.remotion.dev/)
11
11
 
12
12
  ### Eligibility
13
13
 
14
14
  You are eligible to use Remotion for free if you are:
15
15
 
16
16
  - an individual
17
- - a for-profit organisation with up to 3 employees
18
- - a non-profit or not-for-profit organisation
17
+ - a for-profit organization with up to 3 employees
18
+ - a non-profit or not-for-profit organization
19
19
  - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
20
20
 
21
21
  ### Allowed use cases
22
22
 
23
- Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify and the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
23
+ Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
24
24
 
25
25
  ### Disallowed use cases
26
26
 
27
- It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
27
+ It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
28
28
 
29
29
  ### Warranty notice
30
30
 
31
- The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
31
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
32
32
 
33
33
  ### Support
34
34
 
@@ -36,6 +36,6 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
36
36
 
37
37
  ## Company license
38
38
 
39
- You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support.
39
+ You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
40
40
 
41
41
  Visit [companies.remotion.dev](https://companies.remotion.dev) for pricing and to buy a license.
File without changes
File without changes
package/dist/bundle.d.ts CHANGED
File without changes
package/dist/bundle.js CHANGED
@@ -71,11 +71,25 @@ const convertArgumentsIntoOptions = (args) => {
71
71
  }
72
72
  return firstArg;
73
73
  };
74
+ const recursionLimit = 5;
75
+ const findClosestPackageJsonFolder = (currentDir) => {
76
+ let possiblePackageJson = '';
77
+ for (let i = 0; i < recursionLimit; i++) {
78
+ possiblePackageJson = path_1.default.join(currentDir, 'package.json');
79
+ const exists = fs_1.default.existsSync(possiblePackageJson);
80
+ if (exists) {
81
+ return path_1.default.dirname(possiblePackageJson);
82
+ }
83
+ currentDir = path_1.default.dirname(currentDir);
84
+ }
85
+ return null;
86
+ };
74
87
  async function bundle(...args) {
75
- var _a, _b, _c;
88
+ var _a, _b, _c, _d;
76
89
  const actualArgs = convertArgumentsIntoOptions(args);
77
- const resolvedRemotionRoot = (_a = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.rootDir) !== null && _a !== void 0 ? _a : process.cwd();
78
- const outDir = await prepareOutDir((_b = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.outDir) !== null && _b !== void 0 ? _b : null);
90
+ const entryPoint = path_1.default.resolve(process.cwd(), actualArgs.entryPoint);
91
+ 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();
92
+ const outDir = await prepareOutDir((_c = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.outDir) !== null && _c !== void 0 ? _c : null);
79
93
  // The config might use an override which might use
80
94
  // `process.cwd()`. The context should always be the Remotion root.
81
95
  // This is not supported in worker threads (used for tests)
@@ -83,7 +97,7 @@ async function bundle(...args) {
83
97
  if (worker_threads_1.isMainThread) {
84
98
  process.chdir(resolvedRemotionRoot);
85
99
  }
86
- const { entryPoint, onProgress, ...options } = actualArgs;
100
+ const { onProgress, ...options } = actualArgs;
87
101
  const [, config] = (0, exports.getConfig)({
88
102
  outDir,
89
103
  entryPoint,
@@ -102,7 +116,7 @@ async function bundle(...args) {
102
116
  if (errors !== undefined && errors.length > 0) {
103
117
  throw new Error(errors[0].message + '\n' + errors[0].details);
104
118
  }
105
- const baseDir = (_c = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.publicPath) !== null && _c !== void 0 ? _c : '/';
119
+ const baseDir = (_d = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.publicPath) !== null && _d !== void 0 ? _d : '/';
106
120
  const staticHash = '/' +
107
121
  [trimTrailingSlash(trimLeadingSlash(baseDir)), 'public']
108
122
  .filter(Boolean)
File without changes
package/dist/copy-dir.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +1,9 @@
1
- export declare const indexHtml: ({ baseDir, editorName, inputProps, staticHash, remotionRoot, previewServerCommand, }: {
1
+ export declare const indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, }: {
2
2
  staticHash: string;
3
3
  baseDir: string;
4
4
  editorName: string | null;
5
5
  inputProps: object | null;
6
+ envVariables?: Record<string, string> | undefined;
6
7
  remotionRoot: string;
7
8
  previewServerCommand: string | null;
8
9
  }) => 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, staticHash, remotionRoot, previewServerCommand, }) => `
8
+ const indexHtml = ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, }) => `
9
9
  <!DOCTYPE html>
10
10
  <html lang="en">
11
11
  <head>
@@ -29,6 +29,12 @@ const indexHtml = ({ baseDir, editorName, inputProps, staticHash, remotionRoot,
29
29
  ? `<script>window.remotion_inputProps = ${JSON.stringify(JSON.stringify(inputProps))};</script>
30
30
  `
31
31
  : ''}
32
+ ${envVariables
33
+ ? `<script> window.process = {
34
+ env: ${JSON.stringify(envVariables)}
35
+ };</script>
36
+ `
37
+ : ''}
32
38
 
33
39
  <div id="container"></div>
34
40
  <div id="menuportal-0"></div>
package/dist/index.d.ts CHANGED
@@ -16,11 +16,12 @@ export declare const BundlerInternals: {
16
16
  entryPoints: string[];
17
17
  remotionRoot: string;
18
18
  }) => [string, webpack.Configuration];
19
- indexHtml: ({ baseDir, editorName, inputProps, staticHash, remotionRoot, previewServerCommand, }: {
19
+ indexHtml: ({ baseDir, editorName, inputProps, envVariables, staticHash, remotionRoot, previewServerCommand, }: {
20
20
  staticHash: string;
21
21
  baseDir: string;
22
22
  editorName: string | null;
23
23
  inputProps: object | null;
24
+ envVariables?: Record<string, string> | undefined;
24
25
  remotionRoot: string;
25
26
  previewServerCommand: string | null;
26
27
  }) => string;
package/dist/index.js CHANGED
File without changes
File without changes
@@ -15,6 +15,19 @@ const remotion_1 = require("remotion");
15
15
  const bundle_mode_1 = require("./bundle-mode");
16
16
  const homepage_1 = require("./homepage/homepage");
17
17
  remotion_1.Internals.CSSUtils.injectCSS(remotion_1.Internals.CSSUtils.makeDefaultCSS(null, '#fff'));
18
+ const getCanSerializeDefaultProps = (object) => {
19
+ try {
20
+ const str = JSON.stringify(object);
21
+ // 256MB is the theoretical limit, making it throw if over 90% of that is reached.
22
+ return str.length < 256 * 1024 * 1024 * 0.9;
23
+ }
24
+ catch (err) {
25
+ if (err.message.includes('Invalid string length')) {
26
+ return false;
27
+ }
28
+ throw err;
29
+ }
30
+ };
18
31
  const GetVideo = ({ state }) => {
19
32
  const video = remotion_1.Internals.useVideo();
20
33
  const compositions = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
@@ -82,7 +95,7 @@ let cleanupVideoContainer = () => {
82
95
  let cleanupExplainerContainer = () => {
83
96
  explainerContainer.innerHTML = '';
84
97
  };
85
- const waitForRootHandle = (0, remotion_1.delayRender)('Loading root component');
98
+ const waitForRootHandle = (0, remotion_1.delayRender)('Loading root component - See https://remotion.dev/docs/troubleshooting/loading-root-component if you experience a timeout');
86
99
  const WaitForRoot = () => {
87
100
  const [Root, setRoot] = (0, react_1.useState)(() => remotion_1.Internals.getRoot());
88
101
  (0, react_1.useEffect)(() => {
@@ -161,9 +174,19 @@ if (typeof window !== 'undefined') {
161
174
  if (!remotion_1.Internals.compositionsRef.current) {
162
175
  throw new Error('Unexpectedly did not have a CompositionManager');
163
176
  }
164
- return remotion_1.Internals.compositionsRef.current
165
- .getCompositions()
166
- .map((c) => {
177
+ const compositions = remotion_1.Internals.compositionsRef.current.getCompositions();
178
+ const canSerializeDefaultProps = getCanSerializeDefaultProps(compositions);
179
+ if (!canSerializeDefaultProps) {
180
+ console.warn('defaultProps are too big to serialize - trying to find the problematic composition...');
181
+ for (const comp of compositions) {
182
+ if (!getCanSerializeDefaultProps(comp)) {
183
+ throw new Error(`defaultProps too big - could not serialize - the defaultProps of composition with ID ${comp.id} - the object that was passed to defaultProps was too big. Learn how to mitigate this error by visiting https://remotion.dev/docs/troubleshooting/serialize-defaultprops`);
184
+ }
185
+ }
186
+ console.warn('Could not single out a problematic composition - The composition list as a whole is too big to serialize.');
187
+ throw new Error('defaultProps too big - Could not serialize - an object that was passed to defaultProps was too big. Learn how to mitigate this error by visiting https://remotion.dev/docs/troubleshooting/serialize-defaultprops');
188
+ }
189
+ return compositions.map((c) => {
167
190
  return {
168
191
  defaultProps: c.defaultProps,
169
192
  durationInFrames: c.durationInFrames,
File without changes
@@ -11,4 +11,9 @@ remotion_1.Internals.CSSUtils.injectCSS(`
11
11
  background: transparent;
12
12
  box-sizing: border-box;
13
13
  }
14
+
15
+ .algolia-docsearch-suggestion--highlight {
16
+ font-size: 15px;
17
+ line-height: 1.25;
18
+ }
14
19
  `);
@@ -0,0 +1 @@
1
+ export declare const jsonStringifyWithCircularReferences: (circ: unknown) => string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsonStringifyWithCircularReferences = void 0;
4
+ const jsonStringifyWithCircularReferences = (circ) => {
5
+ let seen = [];
6
+ const val = JSON.stringify(circ, (_, value) => {
7
+ if (typeof value === 'object' && value !== null && seen) {
8
+ if (seen.includes(value)) {
9
+ return '[Circular]';
10
+ }
11
+ seen.push(value);
12
+ }
13
+ return value;
14
+ });
15
+ seen = null;
16
+ return val;
17
+ };
18
+ exports.jsonStringifyWithCircularReferences = jsonStringifyWithCircularReferences;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -32,6 +32,7 @@ const react_dom_1 = __importDefault(require("react-dom"));
32
32
  const remotion_1 = require("remotion");
33
33
  const webpack_1 = __importStar(require("webpack"));
34
34
  const fast_refresh_1 = require("./fast-refresh");
35
+ const stringify_with_circular_references_1 = require("./stringify-with-circular-references");
35
36
  const webpack_cache_1 = require("./webpack-cache");
36
37
  const esbuild = require("esbuild");
37
38
  if (!react_dom_1.default || !react_dom_1.default.version) {
@@ -168,7 +169,9 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
168
169
  ],
169
170
  },
170
171
  });
171
- const hash = (0, crypto_1.createHash)('md5').update(JSON.stringify(conf)).digest('hex');
172
+ const hash = (0, crypto_1.createHash)('md5')
173
+ .update((0, stringify_with_circular_references_1.jsonStringifyWithCircularReferences)(conf))
174
+ .digest('hex');
172
175
  return [
173
176
  hash,
174
177
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.2.21",
3
+ "version": "3.2.23-ensure-ffmpeg.123+3ffa18f9e",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -24,11 +24,11 @@
24
24
  "license": "SEE LICENSE IN LICENSE.md",
25
25
  "dependencies": {
26
26
  "css-loader": "5.2.7",
27
- "esbuild": "0.14.19",
27
+ "esbuild": "0.15.13",
28
28
  "react-refresh": "0.9.0",
29
- "remotion": "3.2.21",
29
+ "remotion": "3.2.23-ensure-ffmpeg.123+3ffa18f9e",
30
30
  "style-loader": "2.0.0",
31
- "webpack": "5.72.0"
31
+ "webpack": "5.74.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -37,21 +37,21 @@
37
37
  "devDependencies": {
38
38
  "@jonny/eslint-config": "3.0.266",
39
39
  "@types/node": "^16.7.5",
40
- "@types/react": "18.0.1",
40
+ "@types/react": "18.0.23",
41
41
  "@types/react-dom": "18.0.0",
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",
45
- "eslint": "8.13.0",
45
+ "eslint": "8.25.0",
46
46
  "eslint-plugin-10x": "1.5.2",
47
47
  "eslint-plugin-react": "7.29.4",
48
48
  "eslint-plugin-react-hooks": "4.4.0",
49
- "prettier": "^2.0.5",
49
+ "prettier": "^2.7.1",
50
50
  "prettier-plugin-organize-imports": "^2.3.4",
51
51
  "react": "^18.0.0",
52
52
  "react-dom": "^18.0.0",
53
53
  "typescript": "^4.7.0",
54
- "vitest": "^0.18.0"
54
+ "vitest": "0.24.3"
55
55
  },
56
56
  "keywords": [
57
57
  "remotion",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "7236c416c1efcc6079ad262d6d5afa10e6775b81"
67
+ "gitHead": "3ffa18f9eafd4322373c51c92816c671b92e3258"
68
68
  }