@rolldown/browser 1.0.0-beta.56 → 1.0.0-beta.58

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 (41) hide show
  1. package/dist/cli.mjs +8 -8
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +6 -6
  4. package/dist/{constructors-DMeuUDyD.js → constructors-BuqTjXTF.js} +1 -1
  5. package/dist/experimental-index.browser.mjs +3 -3
  6. package/dist/experimental-index.d.mts +4 -4
  7. package/dist/experimental-index.mjs +5 -5
  8. package/dist/experimental-runtime-types.d.ts +1 -1
  9. package/dist/filter-index.d.mts +3 -3
  10. package/dist/filter-index.mjs +123 -2
  11. package/dist/get-log-filter.d.mts +1 -1
  12. package/dist/index.browser.mjs +4 -2
  13. package/dist/index.d.mts +5 -5
  14. package/dist/index.mjs +6 -6
  15. package/dist/{normalize-string-or-regex-B-Y4k0qo.js → normalize-string-or-regex-3ql5-z8-.js} +3 -2
  16. package/dist/parallel-plugin-worker.mjs +3 -3
  17. package/dist/parallel-plugin.d.mts +2 -2
  18. package/dist/parse-ast-index.d.mts +1 -1
  19. package/dist/parse-ast-index.mjs +1 -1
  20. package/dist/plugins-index.browser.mjs +2 -2
  21. package/dist/plugins-index.d.mts +3 -3
  22. package/dist/plugins-index.mjs +2 -2
  23. package/dist/rolldown-binding.wasi.cjs +1 -1
  24. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  25. package/dist/{rolldown-build-BEV6JVIl.js → rolldown-build-CRqas5jO.js} +14 -6
  26. package/dist/shared/{binding-CDyF6W3D.d.mts → binding-MAEzB4KA.d.mts} +10 -0
  27. package/dist/shared/{bindingify-input-options-kzSFdf_-.mjs → bindingify-input-options--qcSYuhh.mjs} +8 -4
  28. package/dist/shared/composable-filters-C5qA4jo-.mjs +206 -0
  29. package/dist/shared/{constructors-B0L_9ar3.d.mts → constructors-CQP6o3cR.d.mts} +2 -2
  30. package/dist/shared/{constructors-Dw9UOO6Z.mjs → constructors-kOch67Sb.mjs} +1 -1
  31. package/dist/shared/{define-config-CrCCK_Ci.d.mts → define-config-yInAJbA1.d.mts} +471 -125
  32. package/dist/shared/{load-config-vlnYfd7q.mjs → load-config-BZhApFJg.mjs} +1 -1
  33. package/dist/shared/{logging-BpAvp7KV.d.mts → logging-B4x9qar8.d.mts} +1 -0
  34. package/dist/shared/{normalize-string-or-regex-CwM9ci6w.mjs → normalize-string-or-regex-CIiT1lMg.mjs} +3 -2
  35. package/dist/shared/{parse-ast-index-DZPue_kI.mjs → parse-ast-index-CgzK6cxG.mjs} +1 -1
  36. package/dist/shared/{rolldown-DtiFL1Ph.mjs → rolldown-Vl5SnJ_J.mjs} +2 -1
  37. package/dist/shared/{rolldown-build-B3XDwemQ.mjs → rolldown-build-7kWB1jqY.mjs} +7 -3
  38. package/dist/shared/{utils-B3dcnHc8.d.mts → utils-BGxZdOXA.d.mts} +2 -2
  39. package/dist/shared/{watch-BHMj7YNj.mjs → watch-CGYro6go.mjs} +4 -3
  40. package/package.json +16 -16
  41. package/dist/shared/composable-filters-G1eqjHFo.mjs +0 -122
@@ -1,4 +1,4 @@
1
- import { t as rolldown } from "./rolldown-DtiFL1Ph.mjs";
1
+ import { t as rolldown } from "./rolldown-Vl5SnJ_J.mjs";
2
2
  import path from "node:path";
3
3
  import { readdir } from "node:fs/promises";
4
4
  import { pathToFileURL } from "node:url";
@@ -27,6 +27,7 @@ interface RollupLog {
27
27
  url?: string;
28
28
  }
29
29
  type RollupLogWithString = RollupLog | string;
30
+ /** @category Plugin APIs */
30
31
  interface RollupError extends RollupLog {
31
32
  name?: string;
32
33
  stack?: string;
@@ -32,11 +32,12 @@ function getLogHandler(level, code, logger, pluginName, logLevel) {
32
32
 
33
33
  //#endregion
34
34
  //#region package.json
35
- var version = "1.0.0-beta.56";
35
+ var version = "1.0.0-beta.58";
36
36
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
37
37
 
38
38
  //#endregion
39
39
  //#region src/version.ts
40
+ /** @category Plugin APIs */
40
41
  const VERSION = version;
41
42
 
42
43
  //#endregion
@@ -190,7 +191,7 @@ function bindingAssetSource(source) {
190
191
  }
191
192
 
192
193
  //#endregion
193
- //#region \0@oxc-project+runtime@0.103.0/helpers/decorate.js
194
+ //#region \0@oxc-project+runtime@0.106.0/helpers/decorate.js
194
195
  function __decorate(decorators, target, key, desc) {
195
196
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
196
197
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,7 +1,7 @@
1
1
  import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-DEfpOy5A.mjs";
2
2
  import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
3
3
 
4
- //#region ../../node_modules/.pnpm/oxc-parser@0.103.0/node_modules/oxc-parser/src-js/wrap.js
4
+ //#region ../../node_modules/.pnpm/oxc-parser@0.106.0/node_modules/oxc-parser/src-js/wrap.js
5
5
  function wrap$1(result) {
6
6
  let program, module, comments, errors;
7
7
  return {
@@ -1,6 +1,7 @@
1
- import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-B3XDwemQ.mjs";
1
+ import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-7kWB1jqY.mjs";
2
2
 
3
3
  //#region src/api/rolldown/index.ts
4
+ /** @category Programmatic APIs */
4
5
  const rolldown = async (input) => {
5
6
  validateOption("input", input);
6
7
  return new RolldownBuild(await PluginDriver.callOptionsHook(input));
@@ -1,7 +1,7 @@
1
1
  import { i as logInputHookInOutputPlugin, n as error } from "./logs-DEfpOy5A.mjs";
2
2
  import { i as unimplemented } from "./misc-BubmxcE3.mjs";
3
- import { C as LOG_LEVEL_DEBUG, D as logLevelPriority, E as LOG_LEVEL_WARN, S as normalizeLog, T as LOG_LEVEL_INFO, _ as PlainObjectLike, f as transformRenderedChunk, g as lazyProp, h as transformAssetSource, n as BuiltinPlugin, p as __decorate, u as transformToRollupOutput, v as MinimalPluginContextImpl, w as LOG_LEVEL_ERROR, y as VERSION } from "./normalize-string-or-regex-CwM9ci6w.mjs";
4
- import { c as normalizeHook, i as transformModuleInfo, s as unwrapBindingResult, t as bindingifyInputOptions } from "./bindingify-input-options-kzSFdf_-.mjs";
3
+ import { C as LOG_LEVEL_DEBUG, D as logLevelPriority, E as LOG_LEVEL_WARN, S as normalizeLog, T as LOG_LEVEL_INFO, _ as PlainObjectLike, f as transformRenderedChunk, g as lazyProp, h as transformAssetSource, n as BuiltinPlugin, p as __decorate, u as transformToRollupOutput, v as MinimalPluginContextImpl, w as LOG_LEVEL_ERROR, y as VERSION } from "./normalize-string-or-regex-CIiT1lMg.mjs";
4
+ import { c as normalizeHook, i as transformModuleInfo, s as unwrapBindingResult, t as bindingifyInputOptions } from "./bindingify-input-options--qcSYuhh.mjs";
5
5
  import { Worker } from "node:worker_threads";
6
6
  import { BindingBundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
7
7
  import path from "node:path";
@@ -1614,6 +1614,7 @@ const ChecksOptionsSchema = strictObject({
1614
1614
  commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
1615
1615
  importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
1616
1616
  emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warning when detecting empty import meta")),
1617
+ cannotCallNamespace: pipe(optional(boolean()), description("Whether to emit warning when detecting cannot call namespace")),
1617
1618
  configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
1618
1619
  preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature")),
1619
1620
  couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warning when detecting could not clean directory")),
@@ -1745,7 +1746,7 @@ const InputOptionsSchema = strictObject({
1745
1746
  transform: optional(TransformOptionsSchema),
1746
1747
  watch: optional(union([WatchOptionsSchema, literal(false)])),
1747
1748
  checks: optional(ChecksOptionsSchema),
1748
- debug: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
1749
+ devtools: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
1749
1750
  preserveEntrySignatures: pipe(optional(union([
1750
1751
  literal("strict"),
1751
1752
  literal("allow-extension"),
@@ -1875,6 +1876,7 @@ const OutputOptionsSchema = strictObject({
1875
1876
  generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
1876
1877
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
1877
1878
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
1879
+ dynamicImportInCjs: pipe(optional(boolean()), description("Dynamic import in CJS output")),
1878
1880
  manualChunks: optional(ManualChunksFunctionSchema),
1879
1881
  advancedChunks: optional(AdvancedChunksSchema),
1880
1882
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
@@ -2055,6 +2057,7 @@ function bindingifyOutputOptions(outputOptions) {
2055
2057
  minify: outputOptions.minify,
2056
2058
  externalLiveBindings: outputOptions.externalLiveBindings,
2057
2059
  inlineDynamicImports: outputOptions.inlineDynamicImports,
2060
+ dynamicImportInCjs: outputOptions.dynamicImportInCjs,
2058
2061
  advancedChunks,
2059
2062
  polyfillRequire: outputOptions.polyfillRequire,
2060
2063
  sanitizeFileName,
@@ -2220,6 +2223,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
2220
2223
  //#endregion
2221
2224
  //#region src/api/rolldown/rolldown-build.ts
2222
2225
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
2226
+ /** @category Programmatic APIs */
2223
2227
  var RolldownBuild = class RolldownBuild {
2224
2228
  #inputOptions;
2225
2229
  #bundler;
@@ -1,5 +1,5 @@
1
- import { a as RollupLog } from "./logging-BpAvp7KV.mjs";
2
- import { t as BindingBuiltinPluginName } from "./binding-CDyF6W3D.mjs";
1
+ import { a as RollupLog } from "./logging-B4x9qar8.mjs";
2
+ import { t as BindingBuiltinPluginName } from "./binding-MAEzB4KA.mjs";
3
3
 
4
4
  //#region src/types/utils.d.ts
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,8 +1,8 @@
1
1
  import { o as logMultiplyNotifyOption } from "./logs-DEfpOy5A.mjs";
2
2
  import { t as arraify } from "./misc-BubmxcE3.mjs";
3
- import { E as LOG_LEVEL_WARN } from "./normalize-string-or-regex-CwM9ci6w.mjs";
4
- import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-B3XDwemQ.mjs";
5
- import { a as aggregateBindingErrorsIntoJsError } from "./bindingify-input-options-kzSFdf_-.mjs";
3
+ import { E as LOG_LEVEL_WARN } from "./normalize-string-or-regex-CIiT1lMg.mjs";
4
+ import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-7kWB1jqY.mjs";
5
+ import { a as aggregateBindingErrorsIntoJsError } from "./bindingify-input-options--qcSYuhh.mjs";
6
6
  import { BindingWatcher, shutdownAsyncRuntime } from "../rolldown-binding.wasi.cjs";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
@@ -340,6 +340,7 @@ function getValidNotifyOption(bundlerOptions) {
340
340
 
341
341
  //#endregion
342
342
  //#region src/api/watch/index.ts
343
+ /** @category Programmatic APIs */
343
344
  const watch = (input) => {
344
345
  const emitter = new WatcherEmitter();
345
346
  createWatcher(emitter, input);
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.56",
3
+ "version": "1.0.0-beta.58",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
+ "keywords": [
6
+ "bundler",
7
+ "esbuild",
8
+ "parcel",
9
+ "rolldown",
10
+ "rollup",
11
+ "webpack"
12
+ ],
5
13
  "homepage": "https://rolldown.rs/",
6
- "type": "module",
14
+ "license": "MIT",
7
15
  "repository": {
8
16
  "type": "git",
9
17
  "url": "git+https://github.com/rolldown/rolldown.git",
10
18
  "directory": "packages/browser"
11
19
  },
12
- "license": "MIT",
13
- "keywords": [
14
- "webpack",
15
- "parcel",
16
- "esbuild",
17
- "rollup",
18
- "bundler",
19
- "rolldown"
20
- ],
20
+ "bin": {
21
+ "rolldown": "./bin/cli.mjs"
22
+ },
21
23
  "files": [
22
24
  "bin",
23
25
  "dist",
24
26
  "!*/.tsbuildinfo"
25
27
  ],
26
- "bin": {
27
- "rolldown": "./bin/cli.mjs"
28
- },
28
+ "type": "module",
29
29
  "main": "./dist/index.mjs",
30
30
  "module": "./dist/index.mjs",
31
31
  "types": "./dist/index.d.mts",
@@ -49,8 +49,8 @@
49
49
  "./package.json": "./package.json"
50
50
  },
51
51
  "publishConfig": {
52
- "registry": "https://registry.npmjs.org/",
53
- "access": "public"
52
+ "access": "public",
53
+ "registry": "https://registry.npmjs.org/"
54
54
  },
55
55
  "dependencies": {
56
56
  "@napi-rs/wasm-runtime": "^1.0.0"
@@ -1,122 +0,0 @@
1
- //#region ../pluginutils/dist/composable-filters.js
2
- var And = class {
3
- kind;
4
- args;
5
- constructor(...args) {
6
- if (args.length === 0) throw new Error("`And` expects at least one operand");
7
- this.args = args;
8
- this.kind = "and";
9
- }
10
- };
11
- var Or = class {
12
- kind;
13
- args;
14
- constructor(...args) {
15
- if (args.length === 0) throw new Error("`Or` expects at least one operand");
16
- this.args = args;
17
- this.kind = "or";
18
- }
19
- };
20
- var Not = class {
21
- kind;
22
- expr;
23
- constructor(expr) {
24
- this.expr = expr;
25
- this.kind = "not";
26
- }
27
- };
28
- var Id = class {
29
- kind;
30
- pattern;
31
- params;
32
- constructor(pattern, params) {
33
- this.pattern = pattern;
34
- this.kind = "id";
35
- this.params = params ?? { cleanUrl: false };
36
- }
37
- };
38
- var ModuleType = class {
39
- kind;
40
- pattern;
41
- constructor(pattern) {
42
- this.pattern = pattern;
43
- this.kind = "moduleType";
44
- }
45
- };
46
- var Code = class {
47
- kind;
48
- pattern;
49
- constructor(expr) {
50
- this.pattern = expr;
51
- this.kind = "code";
52
- }
53
- };
54
- var Query = class {
55
- kind;
56
- key;
57
- pattern;
58
- constructor(key, pattern) {
59
- this.pattern = pattern;
60
- this.key = key;
61
- this.kind = "query";
62
- }
63
- };
64
- var Include = class {
65
- kind;
66
- expr;
67
- constructor(expr) {
68
- this.expr = expr;
69
- this.kind = "include";
70
- }
71
- };
72
- var Exclude = class {
73
- kind;
74
- expr;
75
- constructor(expr) {
76
- this.expr = expr;
77
- this.kind = "exclude";
78
- }
79
- };
80
- function and(...args) {
81
- return new And(...args);
82
- }
83
- function or(...args) {
84
- return new Or(...args);
85
- }
86
- function not(expr) {
87
- return new Not(expr);
88
- }
89
- function id(pattern, params) {
90
- return new Id(pattern, params);
91
- }
92
- function moduleType(pattern) {
93
- return new ModuleType(pattern);
94
- }
95
- function code(pattern) {
96
- return new Code(pattern);
97
- }
98
- function query(key, pattern) {
99
- return new Query(key, pattern);
100
- }
101
- function include(expr) {
102
- return new Include(expr);
103
- }
104
- function exclude(expr) {
105
- return new Exclude(expr);
106
- }
107
- /**
108
- * convert a queryObject to FilterExpression like
109
- * ```js
110
- * and(query(k1, v1), query(k2, v2))
111
- * ```
112
- * @param queryFilterObject The query filter object needs to be matched.
113
- * @returns a `And` FilterExpression
114
- */
115
- function queries(queryFilter) {
116
- return and(...Object.entries(queryFilter).map(([key, value]) => {
117
- return new Query(key, value);
118
- }));
119
- }
120
-
121
- //#endregion
122
- export { include as a, or as c, id as i, queries as l, code as n, moduleType as o, exclude as r, not as s, and as t, query as u };