@rolldown/browser 1.0.0-beta.16 → 1.0.0-beta.18

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 (47) hide show
  1. package/dist/cli.cjs +6 -6
  2. package/dist/cli.mjs +1042 -1083
  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 +4 -6
  7. package/dist/experimental-index.browser.mjs +3 -3
  8. package/dist/experimental-index.cjs +3 -3
  9. package/dist/experimental-index.d.cts +2 -2
  10. package/dist/experimental-index.d.mts +2 -2
  11. package/dist/experimental-index.mjs +5 -17
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/filter-index.mjs +1 -6
  15. package/dist/index.browser.mjs +1 -1
  16. package/dist/index.cjs +2 -2
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +3 -4
  20. package/dist/parallel-plugin-worker.cjs +2 -2
  21. package/dist/parallel-plugin-worker.mjs +27 -33
  22. package/dist/parallel-plugin.d.cts +2 -2
  23. package/dist/parallel-plugin.d.mts +2 -2
  24. package/dist/parse-ast-index.cjs +1 -1
  25. package/dist/parse-ast-index.d.cts +1 -1
  26. package/dist/parse-ast-index.d.mts +1 -1
  27. package/dist/parse-ast-index.mjs +1 -2
  28. package/dist/rolldown-binding.wasi-browser.js +3 -2
  29. package/dist/rolldown-binding.wasi.cjs +2 -1
  30. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  31. package/dist/shared/{binding--Y47JZSL.d.cts → binding-D__94uwg.d.cts} +13 -462
  32. package/dist/shared/{binding-C_9au5Eg.d.mts → binding-DwMf_OTa.d.mts} +13 -462
  33. package/dist/shared/{define-config-CFPAmfEQ.d.mts → define-config-CXjwrGWr.d.cts} +69 -9
  34. package/dist/shared/{define-config-CAyC9-af.d.cts → define-config-DaQ-joKc.d.mts} +69 -9
  35. package/dist/shared/dist-BoWaIc-K.mjs +147 -0
  36. package/dist/shared/{load-config-CHic6lPj.mjs → load-config-BwSSRqdO.mjs} +14 -19
  37. package/dist/shared/{load-config-CKPqlbjH.cjs → load-config-CbF4BrKX.cjs} +1 -1
  38. package/dist/shared/{parse-ast-index-BjSB6ZTb.mjs → parse-ast-index-BHw-MFh6.mjs} +10 -28
  39. package/dist/shared/{parse-ast-index-X4pECV1E.cjs → parse-ast-index-DQhRVBEm.cjs} +1 -1
  40. package/dist/shared/prompt-C5jz26Zn.mjs +852 -0
  41. package/dist/shared/{src-Cw7MpyXh.cjs → src-BP3CtG4Q.cjs} +21 -18
  42. package/dist/shared/{src-C_ps7iS5.mjs → src-D1ozKBtx.mjs} +1144 -1367
  43. package/dist/{src-UXJBOke0.js → src-CEdhd_Z1.js} +21 -18
  44. package/package.json +3 -2
  45. package/dist/shared/chunk-DSsiIF1Z.mjs +0 -30
  46. package/dist/shared/dist-DeDsdiza.mjs +0 -153
  47. package/dist/shared/prompt-C14hEutp.mjs +0 -854
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
2
  const require_dist = require('./dist-BMVjvV-v.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-X4pECV1E.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-DQhRVBEm.cjs');
4
4
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
5
5
  const node_path = require_chunk.__toESM(require("node:path"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -8,7 +8,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
8
8
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
9
9
 
10
10
  //#region package.json
11
- var version = "1.0.0-beta.16";
11
+ var version = "1.0.0-beta.18";
12
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
13
 
14
14
  //#endregion
@@ -2133,6 +2133,7 @@ const InputOptionsSchema = strictObject({
2133
2133
  experimental: optional(strictObject({
2134
2134
  disableLiveBindings: optional(boolean()),
2135
2135
  enableComposingJsPlugins: optional(boolean()),
2136
+ viteMode: optional(boolean()),
2136
2137
  resolveNewUrlToAsset: optional(boolean()),
2137
2138
  strictExecutionOrder: optional(boolean()),
2138
2139
  hmr: optional(HmrSchema),
@@ -4503,12 +4504,12 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
4503
4504
  //#endregion
4504
4505
  //#region src/utils/create-bundler.ts
4505
4506
  let asyncRuntimeShutdown = false;
4506
- async function createBundler(inputOptions, outputOptions, isClose) {
4507
+ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose) {
4507
4508
  const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
4508
4509
  if (asyncRuntimeShutdown) (0, src_rolldown_binding_wasi_cjs.startAsyncRuntime)();
4509
4510
  try {
4510
4511
  return {
4511
- bundler: new src_rolldown_binding_wasi_cjs.Bundler(option.bundlerOptions),
4512
+ impl: bundler.createImpl(option.bundlerOptions),
4512
4513
  stopWorkers: option.stopWorkers,
4513
4514
  shutdown: () => {
4514
4515
  (0, src_rolldown_binding_wasi_cjs.shutdownAsyncRuntime)();
@@ -4539,47 +4540,49 @@ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4539
4540
  var RolldownBuild = class {
4540
4541
  #inputOptions;
4541
4542
  #bundler;
4543
+ #bundlerImpl;
4542
4544
  constructor(inputOptions) {
4543
4545
  this.#inputOptions = inputOptions;
4546
+ this.#bundler = new src_rolldown_binding_wasi_cjs.BindingBundler();
4544
4547
  }
4545
4548
  get closed() {
4546
- return this.#bundler?.bundler.closed ?? false;
4549
+ return this.#bundlerImpl?.impl.closed ?? false;
4547
4550
  }
4548
4551
  async #getBundlerWithStopWorker(outputOptions, isClose) {
4549
- if (this.#bundler) await this.#bundler.stopWorkers?.();
4550
- return this.#bundler = await createBundler(this.#inputOptions, outputOptions, isClose);
4552
+ if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
4553
+ return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions, isClose);
4551
4554
  }
4552
4555
  async generate(outputOptions = {}) {
4553
4556
  validateOption("output", outputOptions);
4554
- const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4555
- const output = await bundler.generate();
4557
+ const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
4558
+ const output = await impl.generate();
4556
4559
  return transformToRollupOutput(output);
4557
4560
  }
4558
4561
  async write(outputOptions = {}) {
4559
4562
  validateOption("output", outputOptions);
4560
- const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4561
- const output = await bundler.write();
4563
+ const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
4564
+ const output = await impl.write();
4562
4565
  return transformToRollupOutput(output);
4563
4566
  }
4564
4567
  async close() {
4565
- const { bundler, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4568
+ const { impl, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4566
4569
  await stopWorkers?.();
4567
- await bundler.close();
4570
+ await impl.close();
4568
4571
  shutdown();
4569
4572
  }
4570
4573
  async [Symbol.asyncDispose]() {
4571
4574
  await this.close();
4572
4575
  }
4573
4576
  async generateHmrPatch(changedFiles) {
4574
- const output = await this.#bundler.bundler.generateHmrPatch(changedFiles);
4577
+ const output = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
4575
4578
  return transformHmrPatchOutput(output);
4576
4579
  }
4577
4580
  async hmrInvalidate(file, firstInvalidatedBy) {
4578
- const output = await this.#bundler.bundler.hmrInvalidate(file, firstInvalidatedBy);
4581
+ const output = await this.#bundlerImpl.impl.hmrInvalidate(file, firstInvalidatedBy);
4579
4582
  return transformHmrPatchOutput(output);
4580
4583
  }
4581
4584
  get watchFiles() {
4582
- return this.#bundler?.bundler.getWatchFiles() ?? Promise.resolve([]);
4585
+ return this.#bundlerImpl?.impl.getWatchFiles() ?? Promise.resolve([]);
4583
4586
  }
4584
4587
  };
4585
4588
 
@@ -4807,10 +4810,10 @@ Object.defineProperty(exports, 'composeJsPlugins', {
4807
4810
  return composeJsPlugins;
4808
4811
  }
4809
4812
  });
4810
- Object.defineProperty(exports, 'createBundler', {
4813
+ Object.defineProperty(exports, 'createBundlerImpl', {
4811
4814
  enumerable: true,
4812
4815
  get: function () {
4813
- return createBundler;
4816
+ return createBundlerImpl;
4814
4817
  }
4815
4818
  });
4816
4819
  Object.defineProperty(exports, 'defineConfig', {