@remotion/bundler 4.0.15 → 4.0.16

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.
@@ -29,6 +29,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.readRecursively = void 0;
30
30
  const node_fs_1 = __importStar(require("node:fs"));
31
31
  const node_path_1 = __importDefault(require("node:path"));
32
+ // There can be symbolic links that point to files that don't exist.
33
+ // https://github.com/remotion-dev/remotion/issues/2587
34
+ const statOrNull = (p) => {
35
+ try {
36
+ return (0, node_fs_1.statSync)(p);
37
+ }
38
+ catch (err) {
39
+ return null;
40
+ }
41
+ };
42
+ const encodeBySplitting = (p) => {
43
+ // Intentional: split by path.sep, then join by /
44
+ const splitBySlash = p.split(node_path_1.default.sep);
45
+ const encodedArray = splitBySlash.map((element) => {
46
+ return encodeURIComponent(element);
47
+ });
48
+ const merged = encodedArray.join('/');
49
+ return merged;
50
+ };
32
51
  const readRecursively = ({ folder, output = [], startPath, staticHash, limit, }) => {
33
52
  const absFolder = node_path_1.default.join(startPath, folder);
34
53
  if (!node_fs_1.default.existsSync(absFolder)) {
@@ -42,7 +61,10 @@ const readRecursively = ({ folder, output = [], startPath, staticHash, limit, })
42
61
  if (file.startsWith('.DS_Store')) {
43
62
  continue;
44
63
  }
45
- const stat = (0, node_fs_1.statSync)(node_path_1.default.join(absFolder, file));
64
+ const stat = statOrNull(node_path_1.default.join(absFolder, file));
65
+ if (!stat) {
66
+ continue;
67
+ }
46
68
  if (stat.isDirectory()) {
47
69
  (0, exports.readRecursively)({
48
70
  startPath,
@@ -57,18 +79,21 @@ const readRecursively = ({ folder, output = [], startPath, staticHash, limit, })
57
79
  name: node_path_1.default.join(folder, file),
58
80
  lastModified: Math.floor(stat.mtimeMs),
59
81
  sizeInBytes: stat.size,
60
- src: staticHash + '/' + encodeURIComponent(node_path_1.default.join(folder, file)),
82
+ src: staticHash + '/' + encodeBySplitting(node_path_1.default.join(folder, file)),
61
83
  });
62
84
  }
63
85
  else if (stat.isSymbolicLink()) {
64
86
  const realpath = node_fs_1.default.realpathSync(node_path_1.default.join(folder, file));
65
- const realStat = node_fs_1.default.statSync(realpath);
87
+ const realStat = statOrNull(realpath);
88
+ if (!realStat) {
89
+ continue;
90
+ }
66
91
  if (realStat.isFile()) {
67
92
  output.push({
68
93
  name: realpath,
69
94
  lastModified: Math.floor(realStat.mtimeMs),
70
95
  sizeInBytes: realStat.size,
71
- src: staticHash + '/' + encodeURIComponent(realpath),
96
+ src: staticHash + '/' + encodeBySplitting(realpath),
72
97
  });
73
98
  }
74
99
  }
@@ -117,6 +117,7 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
117
117
  alias: {
118
118
  // Only one version of react
119
119
  'react/jsx-runtime': require.resolve('react/jsx-runtime'),
120
+ 'react/jsx-dev-runtime': require.resolve('react/jsx-dev-runtime'),
120
121
  react: require.resolve('react'),
121
122
  'react-dom/client': shouldUseReactDomClient
122
123
  ? require.resolve('react-dom/client')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "4.0.15",
3
+ "version": "4.0.16",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -22,7 +22,7 @@
22
22
  "react-refresh": "0.9.0",
23
23
  "style-loader": "2.0.0",
24
24
  "webpack": "5.83.1",
25
- "remotion": "4.0.15"
25
+ "remotion": "4.0.16"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.8.0",