@rspack-debug/cli 2.0.4 → 2.0.5

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.
@@ -236,6 +236,27 @@ interface JitiOptions {
236
236
  */
237
237
  tryNative?: boolean;
238
238
 
239
+ /**
240
+ * Always use a temp file (instead of a `data:` URL) for the ESM
241
+ * evaluation fallback path.
242
+ *
243
+ * jiti automatically falls back to a temp file when the `data:` URL
244
+ * import fails with `ENAMETOOLONG` — which happens on filesystems with
245
+ * a strict `NAME_MAX` limit (e.g. ecryptfs-encrypted home directories
246
+ * on Linux, some macOS configurations) once the base64-encoded source
247
+ * exceeds the limit. Setting this to `true` forces the temp-file path
248
+ * up front, skipping the `data:` URL attempt.
249
+ *
250
+ * The temp file is written to `{TMP_DIR}/jiti-esm/` and cleaned up
251
+ * after import.
252
+ *
253
+ * Can also be enabled using the `JITI_ESM_EVAL_TEMP_FILE=true`
254
+ * environment variable.
255
+ *
256
+ * @default false
257
+ */
258
+ esmEvalTempFile?: boolean;
259
+
239
260
  /**
240
261
  * Enable JSX support Enable JSX support using
241
262
  * {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx | `@babel/plugin-transform-react-jsx`}.
@@ -245,6 +266,42 @@ interface JitiOptions {
245
266
  * @default false
246
267
  */
247
268
  jsx?: boolean | JSXOptions;
269
+
270
+ /**
271
+ * Virtual modules - pre-loaded module objects that bypass filesystem resolution.
272
+ * Useful for bundled modules in compiled binaries (e.g., Bun).
273
+ *
274
+ * When a module ID matches a key in this map, the corresponding value is
275
+ * returned directly without any filesystem resolution or transformation.
276
+ *
277
+ * @example
278
+ * ```ts
279
+ * import * as typebox from "@sinclair/typebox";
280
+ *
281
+ * const jiti = createJiti(import.meta.url, {
282
+ * virtualModules: {
283
+ * "@sinclair/typebox": typebox,
284
+ * },
285
+ * });
286
+ * ```
287
+ */
288
+ virtualModules?: Record<string, unknown>;
289
+
290
+ /**
291
+ * Enable tsconfig paths resolution.
292
+ *
293
+ * - `true`: auto-discover `tsconfig.json` by walking up from the
294
+ * jiti instance's parent path
295
+ * - `string`: explicit path to a `tsconfig.json` file
296
+ * - `false` (default): disabled
297
+ *
298
+ * When enabled, jiti uses
299
+ * {@link https://github.com/privatenumber/get-tsconfig | get-tsconfig}
300
+ * to resolve TypeScript path aliases defined in `compilerOptions.paths`.
301
+ *
302
+ * @default false
303
+ */
304
+ tsconfigPaths?: boolean | string;
248
305
  }
249
306
 
250
307
  interface NodeRequire {
@@ -1 +1 @@
1
- {"name":"jiti","version":"2.6.1","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"jiti","version":"2.7.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
package/dist/index.js CHANGED
@@ -600,12 +600,18 @@ const commonOptionsForBuildAndServe = (command)=>command.option('-d, --devtool <
600
600
  }).option('-m, --mode <mode>', 'mode').option('-o, --output-path <dir>', 'output path dir').option('-w, --watch', 'watch');
601
601
  function setBuiltinEnvArg(env, envNameSuffix, value) {
602
602
  const envName = `RSPACK_${envNameSuffix}`;
603
- if (!(envName in env)) env[envName] = value;
603
+ if (!Object.prototype.hasOwnProperty.call(env, envName)) env[envName] = value;
604
604
  }
605
+ const DANGEROUS_ENV_KEYS = new Set([
606
+ '__proto__',
607
+ 'constructor',
608
+ 'prototype'
609
+ ]);
605
610
  function normalizeEnvToObject(options) {
606
611
  function parseValue(previous, value) {
607
612
  const [allKeys, val] = value.split(/=(.+)/, 2);
608
613
  const splitKeys = allKeys.split(/\.(?!$)/);
614
+ if (splitKeys.some((k)=>DANGEROUS_ENV_KEYS.has(k.replace(/=$/, '')))) return previous;
609
615
  let prevRef = previous;
610
616
  splitKeys.forEach((key, index)=>{
611
617
  let someKey = key;
@@ -1143,7 +1149,7 @@ class RspackCLI {
1143
1149
  this.colors = this.createColors();
1144
1150
  this.program = program;
1145
1151
  program.help();
1146
- program.version("2.0.4");
1152
+ program.version("2.0.5");
1147
1153
  }
1148
1154
  wrapAction(fn) {
1149
1155
  return (...args)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/cli",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.rs",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -37,12 +37,12 @@
37
37
  "cross-env": "^10.1.0",
38
38
  "execa": "^5.1.1",
39
39
  "exit-hook": "^5.1.0",
40
- "jiti": "^2.6.1",
40
+ "jiti": "^2.7.0",
41
41
  "prebundle": "^1.6.4",
42
42
  "rspack-merge": "0.1.1",
43
43
  "typescript": "^6.0.3",
44
- "@rspack/core": "npm:@rspack-debug/core@2.0.4",
45
- "@rspack/test-tools": "npm:@rspack-debug/test-tools@2.0.4"
44
+ "@rspack/core": "npm:@rspack-debug/core@2.0.5",
45
+ "@rspack/test-tools": "npm:@rspack-debug/test-tools@2.0.5"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@rspack/core": "^2.0.0-0",