@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,4 +1,4 @@
1
- import { BindingAttachDebugInfo, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
1
+ import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
2
2
 
3
3
  //#region rolldown:runtime
4
4
  var __create = Object.create;
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
 
28
28
  //#endregion
29
29
  //#region package.json
30
- var version = "1.0.0-beta.16";
30
+ var version = "1.0.0-beta.18";
31
31
 
32
32
  //#endregion
33
33
  //#region src/builtin-plugin/utils.ts
@@ -2344,6 +2344,7 @@ const InputOptionsSchema = strictObject({
2344
2344
  experimental: optional(strictObject({
2345
2345
  disableLiveBindings: optional(boolean()),
2346
2346
  enableComposingJsPlugins: optional(boolean()),
2347
+ viteMode: optional(boolean()),
2347
2348
  resolveNewUrlToAsset: optional(boolean()),
2348
2349
  strictExecutionOrder: optional(boolean()),
2349
2350
  hmr: optional(HmrSchema),
@@ -2982,7 +2983,7 @@ function bindingPluginOrder(order) {
2982
2983
  }
2983
2984
 
2984
2985
  //#endregion
2985
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.0/node_modules/oxc-parser/wrap.mjs
2986
+ //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
2986
2987
  function wrap$1(result) {
2987
2988
  let program, module$1, comments, errors;
2988
2989
  return {
@@ -4791,12 +4792,12 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
4791
4792
  //#endregion
4792
4793
  //#region src/utils/create-bundler.ts
4793
4794
  let asyncRuntimeShutdown = false;
4794
- async function createBundler(inputOptions, outputOptions, isClose) {
4795
+ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose) {
4795
4796
  const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
4796
4797
  if (asyncRuntimeShutdown) startAsyncRuntime();
4797
4798
  try {
4798
4799
  return {
4799
- bundler: new Bundler(option.bundlerOptions),
4800
+ impl: bundler.createImpl(option.bundlerOptions),
4800
4801
  stopWorkers: option.stopWorkers,
4801
4802
  shutdown: () => {
4802
4803
  shutdownAsyncRuntime();
@@ -4827,47 +4828,49 @@ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4827
4828
  var RolldownBuild = class {
4828
4829
  #inputOptions;
4829
4830
  #bundler;
4831
+ #bundlerImpl;
4830
4832
  constructor(inputOptions) {
4831
4833
  this.#inputOptions = inputOptions;
4834
+ this.#bundler = new BindingBundler();
4832
4835
  }
4833
4836
  get closed() {
4834
- return this.#bundler?.bundler.closed ?? false;
4837
+ return this.#bundlerImpl?.impl.closed ?? false;
4835
4838
  }
4836
4839
  async #getBundlerWithStopWorker(outputOptions, isClose) {
4837
- if (this.#bundler) await this.#bundler.stopWorkers?.();
4838
- return this.#bundler = await createBundler(this.#inputOptions, outputOptions, isClose);
4840
+ if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
4841
+ return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions, isClose);
4839
4842
  }
4840
4843
  async generate(outputOptions = {}) {
4841
4844
  validateOption("output", outputOptions);
4842
- const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4843
- const output = await bundler.generate();
4845
+ const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
4846
+ const output = await impl.generate();
4844
4847
  return transformToRollupOutput(output);
4845
4848
  }
4846
4849
  async write(outputOptions = {}) {
4847
4850
  validateOption("output", outputOptions);
4848
- const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4849
- const output = await bundler.write();
4851
+ const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
4852
+ const output = await impl.write();
4850
4853
  return transformToRollupOutput(output);
4851
4854
  }
4852
4855
  async close() {
4853
- const { bundler, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4856
+ const { impl, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4854
4857
  await stopWorkers?.();
4855
- await bundler.close();
4858
+ await impl.close();
4856
4859
  shutdown();
4857
4860
  }
4858
4861
  async [Symbol.asyncDispose]() {
4859
4862
  await this.close();
4860
4863
  }
4861
4864
  async generateHmrPatch(changedFiles) {
4862
- const output = await this.#bundler.bundler.generateHmrPatch(changedFiles);
4865
+ const output = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
4863
4866
  return transformHmrPatchOutput(output);
4864
4867
  }
4865
4868
  async hmrInvalidate(file, firstInvalidatedBy) {
4866
- const output = await this.#bundler.bundler.hmrInvalidate(file, firstInvalidatedBy);
4869
+ const output = await this.#bundlerImpl.impl.hmrInvalidate(file, firstInvalidatedBy);
4867
4870
  return transformHmrPatchOutput(output);
4868
4871
  }
4869
4872
  get watchFiles() {
4870
- return this.#bundler?.bundler.getWatchFiles() ?? Promise.resolve([]);
4873
+ return this.#bundlerImpl?.impl.getWatchFiles() ?? Promise.resolve([]);
4871
4874
  }
4872
4875
  };
4873
4876
 
@@ -5035,4 +5038,4 @@ function defineConfig(config) {
5035
5038
  const VERSION = version;
5036
5039
 
5037
5040
  //#endregion
5038
- export { BuiltinPlugin, PluginDriver, VERSION, assetPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
5041
+ export { BuiltinPlugin, PluginDriver, VERSION, assetPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundlerImpl, defineConfig, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.16",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "type": "module",
@@ -55,7 +55,8 @@
55
55
  "access": "public"
56
56
  },
57
57
  "dependencies": {
58
- "@napi-rs/wasm-runtime": "^0.2.10"
58
+ "@napi-rs/wasm-runtime": "^0.2.10",
59
+ "@oxc-project/runtime": "=0.73.2"
59
60
  },
60
61
  "scripts": {
61
62
  "build": "pnpm run build:debug",
@@ -1,30 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
- key = keys[i];
17
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: ((k) => from[k]).bind(null, key),
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
- value: mod,
26
- enumerable: true
27
- }) : target, mod));
28
-
29
- //#endregion
30
- export { __commonJS, __esm, __toESM };
@@ -1,153 +0,0 @@
1
- import { __esm } from "./chunk-DSsiIF1Z.mjs";
2
-
3
- //#region src/utils/misc.ts
4
- function arraify(value) {
5
- return Array.isArray(value) ? value : [value];
6
- }
7
- function isNullish(value) {
8
- return value === null || value === void 0;
9
- }
10
- function isPromiseLike(value) {
11
- return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
12
- }
13
- function unimplemented(info) {
14
- if (info) throw new Error(`unimplemented: ${info}`);
15
- throw new Error("unimplemented");
16
- }
17
- function unreachable(info) {
18
- if (info) throw new Error(`unreachable: ${info}`);
19
- throw new Error("unreachable");
20
- }
21
- function unsupported(info) {
22
- throw new Error(`UNSUPPORTED: ${info}`);
23
- }
24
- function noop(..._args) {}
25
- var init_misc = __esm({ "src/utils/misc.ts"() {} });
26
-
27
- //#endregion
28
- //#region ../pluginutils/dist/index.js
29
- function and(...args) {
30
- return new And(...args);
31
- }
32
- function or(...args) {
33
- return new Or(...args);
34
- }
35
- function not(expr) {
36
- return new Not(expr);
37
- }
38
- function id(pattern, params) {
39
- return new Id(pattern, params);
40
- }
41
- function moduleType(pattern) {
42
- return new ModuleType(pattern);
43
- }
44
- function code(pattern) {
45
- return new Code(pattern);
46
- }
47
- function query(key, pattern) {
48
- return new Query(key, pattern);
49
- }
50
- function include(expr) {
51
- return new Include(expr);
52
- }
53
- function exclude(expr) {
54
- return new Exclude(expr);
55
- }
56
- /**
57
- * convert a queryObject to FilterExpression like
58
- * ```js
59
- * and(query(k1, v1), query(k2, v2))
60
- * ```
61
- * @param queryFilterObject The query filter object needs to be matched.
62
- * @returns a `And` FilterExpression
63
- */
64
- function queries(queryFilter) {
65
- let arr = Object.entries(queryFilter).map(([key, value]) => {
66
- return new Query(key, value);
67
- });
68
- return and(...arr);
69
- }
70
- var And, Or, Not, Id, ModuleType, Code, Query, Include, Exclude;
71
- var init_dist = __esm({ "../pluginutils/dist/index.js"() {
72
- And = class {
73
- kind;
74
- args;
75
- constructor(...args) {
76
- if (args.length === 0) throw new Error("`And` expects at least one operand");
77
- this.args = args;
78
- this.kind = "and";
79
- }
80
- };
81
- Or = class {
82
- kind;
83
- args;
84
- constructor(...args) {
85
- if (args.length === 0) throw new Error("`Or` expects at least one operand");
86
- this.args = args;
87
- this.kind = "or";
88
- }
89
- };
90
- Not = class {
91
- kind;
92
- expr;
93
- constructor(expr) {
94
- this.expr = expr;
95
- this.kind = "not";
96
- }
97
- };
98
- Id = class {
99
- kind;
100
- pattern;
101
- params;
102
- constructor(pattern, params) {
103
- this.pattern = pattern;
104
- this.kind = "id";
105
- this.params = params ?? { cleanUrl: false };
106
- }
107
- };
108
- ModuleType = class {
109
- kind;
110
- pattern;
111
- constructor(pattern) {
112
- this.pattern = pattern;
113
- this.kind = "moduleType";
114
- }
115
- };
116
- Code = class {
117
- kind;
118
- pattern;
119
- constructor(expr) {
120
- this.pattern = expr;
121
- this.kind = "code";
122
- }
123
- };
124
- Query = class {
125
- kind;
126
- key;
127
- pattern;
128
- constructor(key, pattern) {
129
- this.pattern = pattern;
130
- this.key = key;
131
- this.kind = "query";
132
- }
133
- };
134
- Include = class {
135
- kind;
136
- expr;
137
- constructor(expr) {
138
- this.expr = expr;
139
- this.kind = "include";
140
- }
141
- };
142
- Exclude = class {
143
- kind;
144
- expr;
145
- constructor(expr) {
146
- this.expr = expr;
147
- this.kind = "exclude";
148
- }
149
- };
150
- } });
151
-
152
- //#endregion
153
- export { and, arraify, code, exclude, id, include, init_dist, init_misc, isNullish, isPromiseLike, moduleType, noop, not, or, queries, query, unimplemented, unreachable, unsupported };