rolldown 1.0.0-beta.31-commit.832324a → 1.0.0-beta.32

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 (39) hide show
  1. package/dist/cli.cjs +3 -3
  2. package/dist/cli.d.cts +1 -1
  3. package/dist/cli.d.mts +1 -1
  4. package/dist/cli.mjs +5 -4
  5. package/dist/config.cjs +3 -3
  6. package/dist/config.d.cts +2 -2
  7. package/dist/config.d.mts +2 -2
  8. package/dist/config.mjs +3 -3
  9. package/dist/experimental-index.cjs +2 -2
  10. package/dist/experimental-index.d.cts +2 -2
  11. package/dist/experimental-index.d.mts +2 -2
  12. package/dist/experimental-index.mjs +2 -2
  13. package/dist/filter-index.d.cts +2 -2
  14. package/dist/filter-index.d.mts +2 -2
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +2 -2
  19. package/dist/parallel-plugin-worker.cjs +2 -2
  20. package/dist/parallel-plugin-worker.d.cts +1 -1
  21. package/dist/parallel-plugin-worker.d.mts +1 -1
  22. package/dist/parallel-plugin-worker.mjs +4 -3
  23. package/dist/parallel-plugin.d.cts +2 -2
  24. package/dist/parallel-plugin.d.mts +2 -2
  25. package/dist/parse-ast-index.cjs +1 -1
  26. package/dist/parse-ast-index.d.cts +1 -1
  27. package/dist/parse-ast-index.d.mts +1 -1
  28. package/dist/parse-ast-index.mjs +1 -1
  29. package/dist/shared/{binding-BIqlUgrm.d.cts → binding-BEeJNtY4.d.mts} +1 -0
  30. package/dist/shared/{binding-COE5UL-B.d.mts → binding-CRMJJtol.d.cts} +1 -0
  31. package/dist/shared/{define-config-DfOVOsx6.d.mts → define-config-Cf8iQFTl.d.mts} +1 -1
  32. package/dist/shared/{define-config-DFC0Nu7H.d.cts → define-config-Dw9PP95x.d.cts} +1 -1
  33. package/dist/shared/{load-config-BsvtI-HD.mjs → load-config-BF8LOHEy.mjs} +1 -1
  34. package/dist/shared/{load-config-C2ByPkRr.cjs → load-config-Dl9pIpnr.cjs} +1 -1
  35. package/dist/shared/{parse-ast-index-B5ThufKy.mjs → parse-ast-index-Ch2Zs4Nn.mjs} +23 -23
  36. package/dist/shared/{parse-ast-index-DSyjeX7n.cjs → parse-ast-index-Cn-35Vbp.cjs} +23 -23
  37. package/dist/shared/{src-aI0ysjSj.cjs → src-CsEb-TS_.cjs} +66 -66
  38. package/dist/shared/{src-CJyr8NNX.mjs → src-p50l1OMU.mjs} +66 -66
  39. package/package.json +18 -18
@@ -1,4 +1,4 @@
1
- import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-B5ThufKy.mjs";
1
+ import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-Ch2Zs4Nn.mjs";
2
2
  import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -9,7 +9,7 @@ import os from "node:os";
9
9
  import { Worker } from "node:worker_threads";
10
10
 
11
11
  //#region package.json
12
- var version = "1.0.0-beta.31-commit.832324a";
12
+ var version = "1.0.0-beta.32";
13
13
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
14
14
 
15
15
  //#endregion
@@ -31,9 +31,9 @@ function makeBuiltinPluginCallable(plugin) {
31
31
  for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
32
32
  try {
33
33
  return await callablePlugin[key](...args$1);
34
- } catch (e) {
35
- if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
36
- return error(logPluginError(e, plugin.name, {
34
+ } catch (e$1) {
35
+ if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
36
+ return error(logPluginError(e$1, plugin.name, {
37
37
  hook: key,
38
38
  id: key === "transform" ? args$1[2] : void 0
39
39
  }));
@@ -352,8 +352,8 @@ var MinimalPluginContextImpl = class {
352
352
  watchMode
353
353
  };
354
354
  }
355
- error(e) {
356
- return error(logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
355
+ error(e$1) {
356
+ return error(logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
357
357
  }
358
358
  };
359
359
 
@@ -2210,7 +2210,7 @@ function validateOption(key, options) {
2210
2210
  const issuePaths = issue.path.map((path$1) => path$1.key);
2211
2211
  let issueMsg = issue.message;
2212
2212
  if (issue.type === "union") {
2213
- const subIssue = issue.issues?.find((i$1) => !(i$1.type !== issue.received && i$1.input === issue.input));
2213
+ const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
2214
2214
  if (subIssue) {
2215
2215
  if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
2216
2216
  issueMsg = subIssue.message;
@@ -2253,19 +2253,19 @@ function bindingifySourcemap$1(map) {
2253
2253
  //#endregion
2254
2254
  //#region src/utils/error.ts
2255
2255
  function normalizeErrors(rawErrors) {
2256
- const errors = rawErrors.map((e) => e instanceof Error ? e : Object.assign(/* @__PURE__ */ new Error(), {
2257
- kind: e.kind,
2258
- message: e.message,
2256
+ const errors = rawErrors.map((e$1) => e$1 instanceof Error ? e$1 : Object.assign(/* @__PURE__ */ new Error(), {
2257
+ kind: e$1.kind,
2258
+ message: e$1.message,
2259
2259
  stack: void 0
2260
2260
  }));
2261
2261
  let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
2262
- for (let i$1 = 0; i$1 < errors.length; i$1++) {
2262
+ for (let i = 0; i < errors.length; i++) {
2263
2263
  summary += "\n";
2264
- if (i$1 >= 5) {
2264
+ if (i >= 5) {
2265
2265
  summary += "...";
2266
2266
  break;
2267
2267
  }
2268
- summary += getErrorMessage(errors[i$1]);
2268
+ summary += getErrorMessage(errors[i]);
2269
2269
  }
2270
2270
  const wrapper = new Error(summary);
2271
2271
  Object.defineProperty(wrapper, "errors", {
@@ -2280,20 +2280,20 @@ function normalizeErrors(rawErrors) {
2280
2280
  });
2281
2281
  return wrapper;
2282
2282
  }
2283
- function getErrorMessage(e) {
2284
- if (Object.hasOwn(e, "kind")) return e.message;
2283
+ function getErrorMessage(e$1) {
2284
+ if (Object.hasOwn(e$1, "kind")) return e$1.message;
2285
2285
  let s = "";
2286
- if (e.plugin) s += `[plugin ${e.plugin}]`;
2287
- const id = e.id ?? e.loc?.file;
2286
+ if (e$1.plugin) s += `[plugin ${e$1.plugin}]`;
2287
+ const id = e$1.id ?? e$1.loc?.file;
2288
2288
  if (id) {
2289
2289
  s += " " + id;
2290
- if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
2290
+ if (e$1.loc) s += `:${e$1.loc.line}:${e$1.loc.column}`;
2291
2291
  }
2292
2292
  if (s) s += "\n";
2293
- const message = `${e.name ?? "Error"}: ${e.message}`;
2293
+ const message = `${e$1.name ?? "Error"}: ${e$1.message}`;
2294
2294
  s += message;
2295
- if (e.frame) s = joinNewLine(s, e.frame);
2296
- if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
2295
+ if (e$1.frame) s = joinNewLine(s, e$1.frame);
2296
+ if (e$1.stack) s = joinNewLine(s, e$1.stack.replace(message, ""));
2297
2297
  return s;
2298
2298
  }
2299
2299
  function joinNewLine(s1, s2) {
@@ -2337,33 +2337,33 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
2337
2337
  }
2338
2338
 
2339
2339
  //#endregion
2340
- //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2341
- function u$1(o, n, a) {
2342
- let t = (r) => o(r, ...n);
2343
- return a === void 0 ? t : Object.assign(t, {
2344
- lazy: a,
2345
- lazyArgs: n
2340
+ //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2341
+ function e(e$1, t$2, n$1) {
2342
+ let r = (n$2) => e$1(n$2, ...t$2);
2343
+ return n$1 === void 0 ? r : Object.assign(r, {
2344
+ lazy: n$1,
2345
+ lazyArgs: t$2
2346
2346
  });
2347
2347
  }
2348
2348
 
2349
2349
  //#endregion
2350
- //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2351
- function u(r, n, o) {
2352
- let a = r.length - n.length;
2353
- if (a === 0) return r(...n);
2354
- if (a === 1) return u$1(r, n, o);
2355
- throw new Error("Wrong number of arguments");
2350
+ //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/purry-DH9cw9sy.js
2351
+ function t(t$2, n$1, r) {
2352
+ let i = t$2.length - n$1.length;
2353
+ if (i === 0) return t$2(...n$1);
2354
+ if (i === 1) return e(t$2, n$1, r);
2355
+ throw Error(`Wrong number of arguments`);
2356
2356
  }
2357
2357
 
2358
2358
  //#endregion
2359
- //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2360
- function d(...r) {
2361
- return u(i, r);
2362
- }
2363
- var i = (r, t) => {
2364
- let a = [[], []];
2365
- for (let [o, e] of r.entries()) t(e, o, r) ? a[0].push(e) : a[1].push(e);
2366
- return a;
2359
+ //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/partition-BJYkp-a7.js
2360
+ function t$1(...t$2) {
2361
+ return t(n, t$2);
2362
+ }
2363
+ const n = (e$1, t$2) => {
2364
+ let n$1 = [[], []];
2365
+ for (let [r, i] of e$1.entries()) t$2(i, r, e$1) ? n$1[0].push(i) : n$1[1].push(i);
2366
+ return n$1;
2367
2367
  };
2368
2368
 
2369
2369
  //#endregion
@@ -2388,8 +2388,8 @@ function transformFilterMatcherToFilterExprs(filterOption) {
2388
2388
  let idExcludes = [];
2389
2389
  let codeIncludes = [];
2390
2390
  let codeExcludes = [];
2391
- if (id) [idIncludes, idExcludes] = d(generalHookFilterMatcherToFilterExprs(id, "id") ?? [], (m) => m.kind === "include");
2392
- if (code) [codeIncludes, codeExcludes] = d(generalHookFilterMatcherToFilterExprs(code, "code") ?? [], (m) => m.kind === "include");
2391
+ if (id) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id, "id") ?? [], (m) => m.kind === "include");
2392
+ if (code) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code, "code") ?? [], (m) => m.kind === "include");
2393
2393
  ret.push(...idExcludes);
2394
2394
  ret.push(...codeExcludes);
2395
2395
  let andExprList = [];
@@ -2417,7 +2417,7 @@ function bindingifyFilterExprImpl(expr, list) {
2417
2417
  switch (expr.kind) {
2418
2418
  case "and": {
2419
2419
  let args$1 = expr.args;
2420
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2420
+ for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
2421
2421
  list.push({
2422
2422
  kind: "And",
2423
2423
  payload: args$1.length
@@ -2426,7 +2426,7 @@ function bindingifyFilterExprImpl(expr, list) {
2426
2426
  }
2427
2427
  case "or": {
2428
2428
  let args$1 = expr.args;
2429
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2429
+ for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
2430
2430
  list.push({
2431
2431
  kind: "Or",
2432
2432
  payload: args$1.length
@@ -2576,10 +2576,10 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2576
2576
  data.loadModulePromiseMap.set(id, promise$1);
2577
2577
  try {
2578
2578
  await context.load(id, options.moduleSideEffects ?? void 0);
2579
- } catch (e) {
2579
+ } catch (e$1) {
2580
2580
  data.loadModulePromiseMap.delete(id);
2581
2581
  data.loadModulePromiseResolveFnMap.delete(id);
2582
- throw e;
2582
+ throw e$1;
2583
2583
  }
2584
2584
  return promise$1;
2585
2585
  }
@@ -2666,12 +2666,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2666
2666
  this.warn = getLogHandler$1(this.warn);
2667
2667
  this.info = getLogHandler$1(this.info);
2668
2668
  }
2669
- error(e, pos) {
2670
- if (typeof e === "string") e = { message: e };
2671
- if (pos) augmentCodeLocation(e, pos, this.moduleSource, this.moduleId);
2672
- e.id = this.moduleId;
2673
- e.hook = "transform";
2674
- return error(logPluginError(normalizeLog(e), this.pluginName));
2669
+ error(e$1, pos) {
2670
+ if (typeof e$1 === "string") e$1 = { message: e$1 };
2671
+ if (pos) augmentCodeLocation(e$1, pos, this.moduleSource, this.moduleId);
2672
+ e$1.id = this.moduleId;
2673
+ e$1.hook = "transform";
2674
+ return error(logPluginError(normalizeLog(e$1), this.pluginName));
2675
2675
  }
2676
2676
  getCombinedSourcemap() {
2677
2677
  return JSON.parse(this.inner.getCombinedSourcemap());
@@ -2897,9 +2897,9 @@ function transformRenderedChunk(chunk) {
2897
2897
  }
2898
2898
  function transformChunkModules(modules) {
2899
2899
  const result = {};
2900
- for (let i$1 = 0; i$1 < modules.values.length; i$1++) {
2901
- let key = modules.keys[i$1];
2902
- const mod = modules.values[i$1];
2900
+ for (let i = 0; i < modules.values.length; i++) {
2901
+ let key = modules.keys[i];
2902
+ const mod = modules.values[i];
2903
2903
  result[key] = transformToRenderedModule(mod);
2904
2904
  }
2905
2905
  return result;
@@ -3408,8 +3408,8 @@ function wrapHandlers(plugin) {
3408
3408
  if (handler) plugin[hookName] = async (...args$1) => {
3409
3409
  try {
3410
3410
  return await handler(...args$1);
3411
- } catch (e) {
3412
- return error(logPluginError(e, plugin.name, {
3411
+ } catch (e$1) {
3412
+ return error(logPluginError(e$1, plugin.name, {
3413
3413
  hook: hookName,
3414
3414
  id: hookName === "transform" ? args$1[2] : void 0
3415
3415
  }));
@@ -4070,7 +4070,7 @@ async function initializeParallelPlugins(plugins) {
4070
4070
  };
4071
4071
  }
4072
4072
  function initializeWorkers(registryId, count, pluginInfos) {
4073
- return Promise.all(Array.from({ length: count }, (_, i$1) => initializeWorker(registryId, pluginInfos, i$1)));
4073
+ return Promise.all(Array.from({ length: count }, (_, i) => initializeWorker(registryId, pluginInfos, i)));
4074
4074
  }
4075
4075
  async function initializeWorker(registryId, pluginInfos, threadNumber) {
4076
4076
  const urlString = import.meta.resolve("#parallel-plugin-worker");
@@ -4090,9 +4090,9 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
4090
4090
  });
4091
4091
  });
4092
4092
  return worker;
4093
- } catch (e) {
4093
+ } catch (e$1) {
4094
4094
  worker?.terminate();
4095
- throw e;
4095
+ throw e$1;
4096
4096
  }
4097
4097
  }
4098
4098
  const availableParallelism = () => {
@@ -4134,9 +4134,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
4134
4134
  onLog,
4135
4135
  stopWorkers: parallelPluginInitResult?.stopWorkers
4136
4136
  };
4137
- } catch (e) {
4137
+ } catch (e$1) {
4138
4138
  await parallelPluginInitResult?.stopWorkers();
4139
- throw e;
4139
+ throw e$1;
4140
4140
  }
4141
4141
  }
4142
4142
 
@@ -4155,9 +4155,9 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
4155
4155
  asyncRuntimeShutdown = true;
4156
4156
  }
4157
4157
  };
4158
- } catch (e) {
4158
+ } catch (e$1) {
4159
4159
  await option.stopWorkers?.();
4160
- throw e;
4160
+ throw e$1;
4161
4161
  }
4162
4162
  }
4163
4163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.31-commit.832324a",
3
+ "version": "1.0.0-beta.32",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "type": "module",
6
6
  "homepage": "https://rolldown.rs/",
@@ -95,12 +95,12 @@
95
95
  "@oxc-project/runtime": "=0.81.0",
96
96
  "@oxc-project/types": "=0.81.0",
97
97
  "ansis": "^4.0.0",
98
- "@rolldown/pluginutils": "1.0.0-beta.31-commit.832324a"
98
+ "@rolldown/pluginutils": "1.0.0-beta.32"
99
99
  },
100
100
  "devDependencies": {
101
101
  "@napi-rs/cli": "^3.1.2",
102
102
  "@napi-rs/wasm-runtime": "^1.0.0",
103
- "@oxc-node/cli": "^0.0.30",
103
+ "@oxc-node/cli": "^0.0.32",
104
104
  "@rollup/plugin-json": "^6.1.0",
105
105
  "@valibot/to-json-schema": "1.3.0",
106
106
  "buble": "^0.20.0",
@@ -120,23 +120,23 @@
120
120
  "typescript": "^5.7.3",
121
121
  "valibot": "1.1.0",
122
122
  "@rolldown/testing": "0.0.1",
123
- "rolldown": "1.0.0-beta.31-commit.832324a"
123
+ "rolldown": "1.0.0-beta.32"
124
124
  },
125
125
  "optionalDependencies": {
126
- "@rolldown/binding-darwin-x64": "1.0.0-beta.31-commit.832324a",
127
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.31-commit.832324a",
128
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.31-commit.832324a",
129
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.31-commit.832324a",
130
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.31-commit.832324a",
131
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.31-commit.832324a",
132
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.31-commit.832324a",
133
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.31-commit.832324a",
134
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.31-commit.832324a",
135
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.31-commit.832324a",
136
- "@rolldown/binding-openharmony-arm64": "1.0.0-beta.31-commit.832324a",
137
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.31-commit.832324a",
138
- "@rolldown/binding-android-arm64": "1.0.0-beta.31-commit.832324a",
139
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.31-commit.832324a"
126
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.32",
127
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.32",
128
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.32",
129
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.32",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.32",
131
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.32",
132
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.32",
133
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.32",
134
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.32",
135
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.32",
136
+ "@rolldown/binding-openharmony-arm64": "1.0.0-beta.32",
137
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.32",
138
+ "@rolldown/binding-android-arm64": "1.0.0-beta.32",
139
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.32"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",