@remotion/bundler 3.3.91 → 3.3.93

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.
@@ -0,0 +1,5 @@
1
+ import type { Compiler } from 'webpack';
2
+ export declare class AllowOptionalDependenciesPlugin {
3
+ filter(error: Error): boolean;
4
+ apply(compiler: Compiler): void;
5
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // When Webpack cannot resolve these dependencies, it will not print an error message.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AllowOptionalDependenciesPlugin = void 0;
5
+ const OPTIONAL_DEPENDENCIES = [
6
+ 'zod',
7
+ '@remotion/zod-types',
8
+ 'react-native-reanimated',
9
+ 'react-native-reanimated/package.json',
10
+ ];
11
+ class AllowOptionalDependenciesPlugin {
12
+ filter(error) {
13
+ for (const dependency of OPTIONAL_DEPENDENCIES) {
14
+ if (error.message.includes(`Can't resolve '${dependency}'`)) {
15
+ return false;
16
+ }
17
+ }
18
+ return true;
19
+ }
20
+ apply(compiler) {
21
+ compiler.hooks.afterEmit.tap('AllowOptionalDependenciesPlugin', (compilation) => {
22
+ compilation.errors = compilation.errors.filter(this.filter);
23
+ compilation.warnings = compilation.warnings.filter(this.filter);
24
+ });
25
+ }
26
+ }
27
+ exports.AllowOptionalDependenciesPlugin = AllowOptionalDependenciesPlugin;
@@ -44,7 +44,9 @@ const GetVideo = ({ state }) => {
44
44
  if (!video && compositions.compositions.length > 0) {
45
45
  const foundComposition = compositions.compositions.find((c) => c.id === state.compositionName);
46
46
  if (!foundComposition) {
47
- throw new Error('Found no composition with the name ' + state.compositionName);
47
+ throw new Error(`Found no composition with the name ${state.compositionName}. The following compositions were found instead: ${compositions.compositions
48
+ .map((c) => c.id)
49
+ .join(', ')}. All compositions must have their ID calculated deterministically and must be mounted at the same time.`);
48
50
  }
49
51
  compositions.setCurrentComposition((_a = foundComposition === null || foundComposition === void 0 ? void 0 : foundComposition.id) !== null && _a !== void 0 ? _a : null);
50
52
  compositions.setCurrentCompositionMetadata({
@@ -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 optional_depdendencies_1 = require("./optional-depdendencies");
35
36
  const stringify_with_circular_references_1 = require("./stringify-with-circular-references");
36
37
  const webpack_cache_1 = require("./webpack-cache");
37
38
  const esbuild = require("esbuild");
@@ -92,6 +93,7 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
92
93
  'process.env.KEYBOARD_SHORTCUTS_ENABLED': keyboardShortcutsEnabled,
93
94
  [`process.env.${remotion_1.Internals.ENV_VARIABLES_ENV_NAME}`]: JSON.stringify(envVariables),
94
95
  }),
96
+ new optional_depdendencies_1.AllowOptionalDependenciesPlugin(),
95
97
  ]
96
98
  : [
97
99
  new webpack_1.ProgressPlugin((p) => {
@@ -99,6 +101,7 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
99
101
  onProgress(Number((p * 100).toFixed(2)));
100
102
  }
101
103
  }),
104
+ new optional_depdendencies_1.AllowOptionalDependenciesPlugin(),
102
105
  ],
103
106
  output: {
104
107
  hashFunction: 'xxhash64',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.3.91",
3
+ "version": "3.3.93",
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": "3.3.91",
23
+ "remotion": "3.3.93",
24
24
  "style-loader": "2.0.0",
25
25
  "webpack": "5.76.1"
26
26
  },