rolldown 1.0.0-beta.24 → 1.0.0-beta.26

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 (36) hide show
  1. package/dist/cli.cjs +5 -5
  2. package/dist/cli.mjs +5 -5
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.cjs +2 -2
  8. package/dist/experimental-index.d.cts +2 -4
  9. package/dist/experimental-index.d.mts +2 -4
  10. package/dist/experimental-index.mjs +2 -2
  11. package/dist/experimental-runtime-types.d.ts +2 -0
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.d.cts +2 -2
  16. package/dist/index.d.mts +2 -2
  17. package/dist/index.mjs +2 -2
  18. package/dist/parallel-plugin-worker.cjs +2 -2
  19. package/dist/parallel-plugin-worker.mjs +2 -2
  20. package/dist/parallel-plugin.d.cts +2 -2
  21. package/dist/parallel-plugin.d.mts +2 -2
  22. package/dist/parse-ast-index.cjs +1 -1
  23. package/dist/parse-ast-index.d.cts +1 -2
  24. package/dist/parse-ast-index.d.mts +1 -2
  25. package/dist/parse-ast-index.mjs +1 -1
  26. package/dist/shared/{binding-DG3bbtXG.d.cts → binding-B9-3a5q4.d.cts} +0 -2
  27. package/dist/shared/{binding-cECB-Ts3.d.mts → binding-DQYRWAqj.d.mts} +0 -2
  28. package/dist/shared/{define-config-BnlWQIlM.d.cts → define-config-DM79zlkB.d.mts} +27 -30
  29. package/dist/shared/{define-config-DLGGYzTV.d.mts → define-config-ZN70csxk.d.cts} +27 -30
  30. package/dist/shared/{load-config-CciutN6Q.mjs → load-config-d948USEs.mjs} +1 -1
  31. package/dist/shared/{load-config-xHhudbSQ.cjs → load-config-oBRxQcIP.cjs} +1 -1
  32. package/dist/shared/{parse-ast-index-BzYd1T7N.cjs → parse-ast-index-BZPHquvf.cjs} +4 -4
  33. package/dist/shared/{parse-ast-index-D-D8UIRn.mjs → parse-ast-index-BztFsVUE.mjs} +3 -3
  34. package/dist/shared/{src-CVZ9JbCC.mjs → src-BecWFsKh.mjs} +56 -40
  35. package/dist/shared/{src-DJtUlfyl.cjs → src-C8DreflS.cjs} +56 -40
  36. package/package.json +19 -19
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_parse_ast_index = require('./parse-ast-index-BzYd1T7N.cjs');
2
+ const require_parse_ast_index = require('./parse-ast-index-BZPHquvf.cjs');
3
3
  const require_misc = require('./misc-DksvspN4.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -9,7 +9,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
9
9
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
10
10
 
11
11
  //#region package.json
12
- var version = "1.0.0-beta.24";
12
+ var version = "1.0.0-beta.26";
13
13
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
14
14
 
15
15
  //#endregion
@@ -1999,7 +1999,8 @@ const ResolveOptionsSchema = strictObject({
1999
1999
  mainFiles: optional(array(string())),
2000
2000
  modules: optional(array(string())),
2001
2001
  symlinks: optional(boolean()),
2002
- tsconfigFilename: optional(string())
2002
+ tsconfigFilename: optional(string()),
2003
+ yarnPnp: optional(boolean())
2003
2004
  });
2004
2005
  const TreeshakingOptionsSchema = union([boolean(), looseObject({
2005
2006
  annotations: optional(boolean()),
@@ -2049,7 +2050,8 @@ const InputOptionsSchema = strictObject({
2049
2050
  literal("none"),
2050
2051
  literal("simple"),
2051
2052
  literal("full")
2052
- ]))
2053
+ ])),
2054
+ chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
2053
2055
  })),
2054
2056
  define: pipe(optional(record(string(), string())), description("Define global variables")),
2055
2057
  inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
@@ -2190,7 +2192,8 @@ const OutputOptionsSchema = strictObject({
2190
2192
  }, () => `The 'true' value is not supported`)),
2191
2193
  preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
2192
2194
  preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
2193
- virtualDirname: optional(string())
2195
+ virtualDirname: optional(string()),
2196
+ minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
2194
2197
  });
2195
2198
  const getAddonDescription = (placement, wrapper) => {
2196
2199
  return `Code to insert the ${ansis.default.bold(placement)} of the bundled file (${ansis.default.bold(wrapper)} the wrapper function)`;
@@ -2359,19 +2362,6 @@ function transformModuleInfo(info, option) {
2359
2362
  };
2360
2363
  }
2361
2364
 
2362
- //#endregion
2363
- //#region src/utils/transform-side-effects.ts
2364
- function bindingifySideEffects(sideEffects) {
2365
- switch (sideEffects) {
2366
- case true: return require_parse_ast_index.BindingHookSideEffects.True;
2367
- case false: return require_parse_ast_index.BindingHookSideEffects.False;
2368
- case "no-treeshake": return require_parse_ast_index.BindingHookSideEffects.NoTreeshake;
2369
- case null:
2370
- case void 0: return void 0;
2371
- default: throw new Error(`Unexpected side effects: ${sideEffects}`);
2372
- }
2373
- }
2374
-
2375
2365
  //#endregion
2376
2366
  //#region src/utils/transform-sourcemap.ts
2377
2367
  function isEmptySourcemapFiled(array$1) {
@@ -2388,7 +2378,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
2388
2378
  }
2389
2379
 
2390
2380
  //#endregion
2391
- //#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2381
+ //#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2392
2382
  function u$1(o, n, a) {
2393
2383
  let t = (r) => o(r, ...n);
2394
2384
  return a === void 0 ? t : Object.assign(t, {
@@ -2398,7 +2388,7 @@ function u$1(o, n, a) {
2398
2388
  }
2399
2389
 
2400
2390
  //#endregion
2401
- //#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2391
+ //#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2402
2392
  function u(r, n, o) {
2403
2393
  let a = r.length - n.length;
2404
2394
  if (a === 0) return r(...n);
@@ -2407,7 +2397,7 @@ function u(r, n, o) {
2407
2397
  }
2408
2398
 
2409
2399
  //#endregion
2410
- //#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2400
+ //#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2411
2401
  function d(...r) {
2412
2402
  return u(i, r);
2413
2403
  }
@@ -2614,7 +2604,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2614
2604
  });
2615
2605
  data.loadModulePromiseMap.set(id, promise$1);
2616
2606
  try {
2617
- await context.load(id, bindingifySideEffects(options.moduleSideEffects));
2607
+ await context.load(id, options.moduleSideEffects ?? void 0);
2618
2608
  } catch (e) {
2619
2609
  data.loadModulePromiseMap.delete(id);
2620
2610
  data.loadModulePromiseResolveFnMap.delete(id);
@@ -2634,6 +2624,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2634
2624
  }, void 0);
2635
2625
  const res = await this.context.resolve(source, importer, {
2636
2626
  custom: receipt,
2627
+ isEntry: options?.isEntry,
2637
2628
  skipSelf: options?.skipSelf,
2638
2629
  vitePluginCustom
2639
2630
  });
@@ -2643,7 +2634,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2643
2634
  return {
2644
2635
  ...res,
2645
2636
  external: res.external === "relative" ? require_misc.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
2646
- ...info
2637
+ ...info,
2638
+ moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
2647
2639
  };
2648
2640
  }
2649
2641
  emitFile = (file) => {
@@ -2767,7 +2759,7 @@ function bindingifyResolveId(args$1) {
2767
2759
  id: ret.id,
2768
2760
  external: ret.external,
2769
2761
  normalizeExternalId: false,
2770
- sideEffects: bindingifySideEffects(exist.moduleSideEffects)
2762
+ moduleSideEffects: exist.moduleSideEffects ?? void 0
2771
2763
  };
2772
2764
  },
2773
2765
  meta: bindingifyPluginHookMeta(meta),
@@ -2791,7 +2783,7 @@ function bindingifyResolveDynamicImport(args$1) {
2791
2783
  id: ret.id,
2792
2784
  external: ret.external
2793
2785
  };
2794
- if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
2786
+ if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
2795
2787
  args$1.pluginContextData.updateModuleOption(ret.id, {
2796
2788
  meta: ret.meta || {},
2797
2789
  moduleSideEffects: ret.moduleSideEffects || null,
@@ -2819,7 +2811,7 @@ function bindingifyTransform(args$1) {
2819
2811
  return {
2820
2812
  code: ret.code,
2821
2813
  map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, ret.map)),
2822
- sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
2814
+ moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
2823
2815
  moduleType: ret.moduleType
2824
2816
  };
2825
2817
  },
@@ -2846,7 +2838,7 @@ function bindingifyLoad(args$1) {
2846
2838
  code: ret.code,
2847
2839
  map: bindingifySourcemap$1(map),
2848
2840
  moduleType: ret.moduleType,
2849
- sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
2841
+ moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
2850
2842
  };
2851
2843
  },
2852
2844
  meta: bindingifyPluginHookMeta(meta),
@@ -3500,7 +3492,7 @@ var ChunkingContextImpl = class {
3500
3492
  //#endregion
3501
3493
  //#region src/utils/bindingify-output-options.ts
3502
3494
  function bindingifyOutputOptions(outputOptions) {
3503
- const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
3495
+ const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3504
3496
  const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
3505
3497
  return {
3506
3498
  dir,
@@ -3535,7 +3527,9 @@ function bindingifyOutputOptions(outputOptions) {
3535
3527
  preserveModules,
3536
3528
  virtualDirname,
3537
3529
  legalComments,
3538
- preserveModulesRoot
3530
+ preserveModulesRoot,
3531
+ topLevelVar,
3532
+ minifyInternalExports: outputOptions.minifyInternalExports
3539
3533
  };
3540
3534
  }
3541
3535
  function bindingifyAddon(configAddon) {
@@ -3704,6 +3698,12 @@ var NormalizedOutputOptionsImpl = class {
3704
3698
  get virtualDirname() {
3705
3699
  return this.inner.virtualDirname;
3706
3700
  }
3701
+ get topLevelVar() {
3702
+ return this.inner.topLevelVar ?? false;
3703
+ }
3704
+ get minifyInternalExports() {
3705
+ return this.inner.minifyInternalExports ?? false;
3706
+ }
3707
3707
  };
3708
3708
  function normalizeAddon(value) {
3709
3709
  if (typeof value === "function") return value;
@@ -3838,14 +3838,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3838
3838
  moduleTypes: inputOptions.moduleTypes,
3839
3839
  define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
3840
3840
  inject: bindingifyInject(inputOptions.inject),
3841
- experimental: {
3842
- strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
3843
- disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
3844
- viteMode: inputOptions.experimental?.viteMode,
3845
- resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
3846
- hmr: bindingifyHmr(inputOptions.experimental?.hmr),
3847
- attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
3848
- },
3841
+ experimental: bindingifyExperimental(inputOptions.experimental),
3849
3842
  profilerNames: inputOptions?.profilerNames,
3850
3843
  jsx,
3851
3844
  transform,
@@ -3858,7 +3851,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3858
3851
  pluginContextData.moduleOptionMap.forEach((value, key) => {
3859
3852
  if (value.invalidate) ret.push({
3860
3853
  id: key,
3861
- sideEffects: bindingifySideEffects(value.moduleSideEffects)
3854
+ sideEffects: value.moduleSideEffects ?? void 0
3862
3855
  });
3863
3856
  });
3864
3857
  return ret;
@@ -3900,7 +3893,29 @@ function bindingifyExternal(external) {
3900
3893
  };
3901
3894
  }
3902
3895
  }
3896
+ function bindingifyExperimental(experimental) {
3897
+ let chunkModulesOrder = require_parse_ast_index.BindingChunkModuleOrderBy.ExecOrder;
3898
+ if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
3899
+ case "exec-order":
3900
+ chunkModulesOrder = require_parse_ast_index.BindingChunkModuleOrderBy.ExecOrder;
3901
+ break;
3902
+ case "module-id":
3903
+ chunkModulesOrder = require_parse_ast_index.BindingChunkModuleOrderBy.ModuleId;
3904
+ break;
3905
+ default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
3906
+ }
3907
+ return {
3908
+ strictExecutionOrder: experimental?.strictExecutionOrder,
3909
+ disableLiveBindings: experimental?.disableLiveBindings,
3910
+ viteMode: experimental?.viteMode,
3911
+ resolveNewUrlToAsset: experimental?.resolveNewUrlToAsset,
3912
+ hmr: bindingifyHmr(experimental?.hmr),
3913
+ attachDebugInfo: bindingifyAttachDebugInfo(experimental?.attachDebugInfo),
3914
+ chunkModulesOrder
3915
+ };
3916
+ }
3903
3917
  function bindingifyResolve(resolve) {
3918
+ const yarnPnp = typeof process === "object" && !!process.versions.pnp;
3904
3919
  if (resolve) {
3905
3920
  const { alias, extensionAlias,...rest } = resolve;
3906
3921
  return {
@@ -3912,9 +3927,10 @@ function bindingifyResolve(resolve) {
3912
3927
  target: name,
3913
3928
  replacements: value
3914
3929
  })) : void 0,
3930
+ yarnPnp,
3915
3931
  ...rest
3916
3932
  };
3917
- }
3933
+ } else return { yarnPnp };
3918
3934
  }
3919
3935
  function bindingifyInject(inject) {
3920
3936
  if (inject) return Object.entries(inject).map(([alias, item]) => {
@@ -4168,7 +4184,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
4168
4184
  function transformHmrPatchOutput(output) {
4169
4185
  handleHmrPatchOutputErrors(output);
4170
4186
  const { patch } = output;
4171
- return patch;
4187
+ return patch ?? void 0;
4172
4188
  }
4173
4189
  function handleHmrPatchOutputErrors(output) {
4174
4190
  const rawErrors = output.errors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.24",
3
+ "version": "1.0.0-beta.26",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "type": "module",
6
6
  "homepage": "https://rolldown.rs/",
@@ -90,13 +90,13 @@
90
90
  "dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
91
91
  },
92
92
  "dependencies": {
93
- "@oxc-project/runtime": "=0.75.1",
94
- "@oxc-project/types": "=0.75.1",
93
+ "@oxc-project/runtime": "=0.76.0",
94
+ "@oxc-project/types": "=0.76.0",
95
95
  "ansis": "^4.0.0",
96
- "@rolldown/pluginutils": "1.0.0-beta.24"
96
+ "@rolldown/pluginutils": "1.0.0-beta.26"
97
97
  },
98
98
  "devDependencies": {
99
- "@napi-rs/cli": "3.0.0-alpha.91",
99
+ "@napi-rs/cli": "3.0.0-alpha.92",
100
100
  "@napi-rs/wasm-runtime": "^0.2.10",
101
101
  "@oxc-node/cli": "^0.0.29",
102
102
  "@rollup/plugin-json": "^6.1.0",
@@ -106,7 +106,7 @@
106
106
  "emnapi": "^1.2.0",
107
107
  "execa": "^9.2.0",
108
108
  "glob": "^11.0.0",
109
- "oxc-parser": "=0.75.1",
109
+ "oxc-parser": "=0.76.0",
110
110
  "pathe": "^2.0.3",
111
111
  "remeda": "^2.10.0",
112
112
  "rolldown-plugin-dts": "^0.13.6",
@@ -118,21 +118,21 @@
118
118
  "typescript": "^5.7.3",
119
119
  "valibot": "1.1.0",
120
120
  "@rolldown/testing": "0.0.1",
121
- "rolldown": "1.0.0-beta.24"
121
+ "rolldown": "1.0.0-beta.26"
122
122
  },
123
123
  "optionalDependencies": {
124
- "@rolldown/binding-darwin-x64": "1.0.0-beta.24",
125
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.24",
126
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.24",
127
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.24",
128
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.24",
129
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.24",
130
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.24",
131
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.24",
132
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.24",
133
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.24",
134
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.24",
135
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.24"
124
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.26",
125
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.26",
126
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.26",
127
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.26",
128
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.26",
129
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.26",
130
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.26",
131
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.26",
132
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.26",
133
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.26",
134
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.26",
135
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.26"
136
136
  },
137
137
  "scripts": {
138
138
  "# Scrips for binding #": "_",