@remotion/bundler 3.2.32 → 3.2.33

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 (2) hide show
  1. package/dist/bundle.js +17 -4
  2. package/package.json +4 -4
package/dist/bundle.js CHANGED
@@ -71,11 +71,24 @@ 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 resolvedRemotionRoot = (_b = (_a = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.rootDir) !== null && _a !== void 0 ? _a : findClosestPackageJsonFolder(actualArgs.entryPoint)) !== null && _b !== void 0 ? _b : process.cwd();
91
+ const outDir = await prepareOutDir((_c = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.outDir) !== null && _c !== void 0 ? _c : null);
79
92
  // The config might use an override which might use
80
93
  // `process.cwd()`. The context should always be the Remotion root.
81
94
  // This is not supported in worker threads (used for tests)
@@ -102,7 +115,7 @@ async function bundle(...args) {
102
115
  if (errors !== undefined && errors.length > 0) {
103
116
  throw new Error(errors[0].message + '\n' + errors[0].details);
104
117
  }
105
- const baseDir = (_c = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.publicPath) !== null && _c !== void 0 ? _c : '/';
118
+ const baseDir = (_d = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.publicPath) !== null && _d !== void 0 ? _d : '/';
106
119
  const staticHash = '/' +
107
120
  [trimTrailingSlash(trimLeadingSlash(baseDir)), 'public']
108
121
  .filter(Boolean)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.2.32",
3
+ "version": "3.2.33",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  "css-loader": "5.2.7",
27
27
  "esbuild": "0.14.19",
28
28
  "react-refresh": "0.9.0",
29
- "remotion": "3.2.32",
29
+ "remotion": "3.2.33",
30
30
  "style-loader": "2.0.0",
31
31
  "webpack": "5.74.0"
32
32
  },
@@ -51,7 +51,7 @@
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": "4f7ab3637405d140041f898f95f78c99943d1b40"
67
+ "gitHead": "3c864e5ab73870674d028a1199005ddbabaede12"
68
68
  }