@rolldown/browser 1.0.0-rc.12 → 1.0.0-rc.13

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 (37) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +2 -2
  4. package/dist/{error-nyELQq9T.js → error-D_M_TRRS.js} +1 -1
  5. package/dist/experimental-index.browser.mjs +3 -3
  6. package/dist/experimental-index.d.mts +16 -18
  7. package/dist/experimental-index.mjs +3 -3
  8. package/dist/filter-index.d.mts +1 -1
  9. package/dist/index.browser.mjs +2 -2
  10. package/dist/index.d.mts +3 -2
  11. package/dist/index.mjs +3 -3
  12. package/dist/parallel-plugin-worker.mjs +1 -1
  13. package/dist/parallel-plugin.d.mts +2 -2
  14. package/dist/parse-ast-index.d.mts +1 -2
  15. package/dist/parse-ast-index.mjs +1 -1
  16. package/dist/plugins-index.d.mts +3 -3
  17. package/dist/{resolve-tsconfig-CkWJwi9L.js → resolve-tsconfig-YM52CJsk.js} +1 -1
  18. package/dist/rolldown-binding.wasi-browser.js +6 -0
  19. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  20. package/dist/{rolldown-build-B2FA5DNv.js → rolldown-build-Bz6L_TNm.js} +47 -4
  21. package/dist/shared/binding-ChYotyxN.d.mts +3171 -0
  22. package/dist/shared/{bindingify-input-options-MqDue3xO.mjs → bindingify-input-options-Y2rQIZiC.mjs} +45 -2
  23. package/dist/shared/{constructors-BVnf_fH1.d.mts → constructors-DFNu-pUS.d.mts} +2 -2
  24. package/dist/shared/{define-config-Cr6054d_.d.mts → define-config-r09Rqv1_.d.mts} +12 -15
  25. package/dist/shared/{load-config-DIkJ9d-P.mjs → load-config-B52gTI_Z.mjs} +1 -1
  26. package/dist/shared/{parse-B_jvq8dU.mjs → parse-C27hqfZ9.mjs} +1 -1
  27. package/dist/shared/{rolldown-B5m6XtwJ.mjs → rolldown-BjzKYYwB.mjs} +1 -1
  28. package/dist/shared/{rolldown-build-CfQ_wZyF.mjs → rolldown-build-YfCjCcGn.mjs} +2 -2
  29. package/dist/shared/{transform-DEgNAQOQ.d.mts → transform-CcdA4xZ5.d.mts} +15 -15
  30. package/dist/shared/{utils-6wxe_LMG.d.mts → utils-C4hvMCOQ.d.mts} +1 -1
  31. package/dist/shared/{watch-Bkj4zPhn.mjs → watch-BeG0KBxY.mjs} +2 -2
  32. package/dist/utils-index.browser.mjs +5 -5
  33. package/dist/utils-index.d.mts +4 -4
  34. package/dist/utils-index.mjs +4 -4
  35. package/dist/wasi-worker-browser.mjs +8 -0
  36. package/package.json +4 -2
  37. package/dist/shared/types-K2r0mx6Y.d.mts +0 -1302
@@ -7,7 +7,7 @@ import { BindingAttachDebugInfo, BindingChunkModuleOrderBy, BindingLogLevel, Bin
7
7
  import path from "node:path";
8
8
  import fsp from "node:fs/promises";
9
9
  //#region package.json
10
- var version = "1.0.0-rc.12";
10
+ var version = "1.0.0-rc.13";
11
11
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
12
12
  //#endregion
13
13
  //#region src/constants/version.ts
@@ -216,7 +216,7 @@ function bindingAssetSource(source) {
216
216
  return { inner: source };
217
217
  }
218
218
  //#endregion
219
- //#region \0@oxc-project+runtime@0.122.0/helpers/decorate.js
219
+ //#region \0@oxc-project+runtime@0.123.0/helpers/decorate.js
220
220
  function __decorate(decorators, target, key, desc) {
221
221
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
222
222
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -565,6 +565,49 @@ Object.defineProperty(BindingMagicString.prototype, "isRolldownMagicString", {
565
565
  writable: false,
566
566
  configurable: false
567
567
  });
568
+ function assertString(content, msg) {
569
+ if (typeof content !== "string") throw new TypeError(msg);
570
+ }
571
+ const nativeAppend = BindingMagicString.prototype.append;
572
+ const nativePrepend = BindingMagicString.prototype.prepend;
573
+ const nativeAppendLeft = BindingMagicString.prototype.appendLeft;
574
+ const nativeAppendRight = BindingMagicString.prototype.appendRight;
575
+ const nativePrependLeft = BindingMagicString.prototype.prependLeft;
576
+ const nativePrependRight = BindingMagicString.prototype.prependRight;
577
+ const nativeOverwrite = BindingMagicString.prototype.overwrite;
578
+ const nativeUpdate = BindingMagicString.prototype.update;
579
+ BindingMagicString.prototype.append = function(content) {
580
+ assertString(content, "outro content must be a string");
581
+ return nativeAppend.call(this, content);
582
+ };
583
+ BindingMagicString.prototype.prepend = function(content) {
584
+ assertString(content, "outro content must be a string");
585
+ return nativePrepend.call(this, content);
586
+ };
587
+ BindingMagicString.prototype.appendLeft = function(index, content) {
588
+ assertString(content, "inserted content must be a string");
589
+ return nativeAppendLeft.call(this, index, content);
590
+ };
591
+ BindingMagicString.prototype.appendRight = function(index, content) {
592
+ assertString(content, "inserted content must be a string");
593
+ return nativeAppendRight.call(this, index, content);
594
+ };
595
+ BindingMagicString.prototype.prependLeft = function(index, content) {
596
+ assertString(content, "inserted content must be a string");
597
+ return nativePrependLeft.call(this, index, content);
598
+ };
599
+ BindingMagicString.prototype.prependRight = function(index, content) {
600
+ assertString(content, "inserted content must be a string");
601
+ return nativePrependRight.call(this, index, content);
602
+ };
603
+ BindingMagicString.prototype.overwrite = function(start, end, content, options) {
604
+ assertString(content, "replacement content must be a string");
605
+ return nativeOverwrite.call(this, start, end, content, options);
606
+ };
607
+ BindingMagicString.prototype.update = function(start, end, content, options) {
608
+ assertString(content, "replacement content must be a string");
609
+ return nativeUpdate.call(this, start, end, content, options);
610
+ };
568
611
  const nativeReplace = BindingMagicString.prototype.replace;
569
612
  const nativeReplaceAll = BindingMagicString.prototype.replaceAll;
570
613
  BindingMagicString.prototype.replace = function(searchValue, replacement) {
@@ -1,5 +1,5 @@
1
- import { s as StringOrRegExp, t as BuiltinPlugin } from "./utils-6wxe_LMG.mjs";
2
- import { BindingEsmExternalRequirePluginConfig, BindingIsolatedDeclarationPluginConfig, BindingViteBuildImportAnalysisPluginConfig, BindingViteDynamicImportVarsPluginConfig, BindingViteImportGlobPluginConfig, BindingViteJsonPluginConfig, BindingViteModulePreloadPolyfillPluginConfig, BindingViteReactRefreshWrapperPluginConfig, BindingViteReporterPluginConfig, BindingViteResolvePluginConfig } from "../binding.cjs";
1
+ import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, b as BindingViteDynamicImportVarsPluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteBuildImportAnalysisPluginConfig } from "./binding-ChYotyxN.mjs";
2
+ import { s as StringOrRegExp, t as BuiltinPlugin } from "./utils-C4hvMCOQ.mjs";
3
3
 
4
4
  //#region src/builtin-plugin/constructors.d.ts
5
5
  declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
@@ -1,9 +1,6 @@
1
- import { t as Program } from "./types-K2r0mx6Y.mjs";
1
+ import { A as ExternalMemoryStatus, J as Program, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, u as BindingMagicString, z as PreRenderedChunk } from "./binding-ChYotyxN.mjs";
2
2
  import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-C6h4g8dA.mjs";
3
- import { a as NullValue, i as MaybePromise, n as MakeAsync, o as PartialNull, r as MaybeArray, s as StringOrRegExp$1, t as BuiltinPlugin } from "./utils-6wxe_LMG.mjs";
4
- import { BindingHookResolveIdExtraArgs, BindingPluginContextResolveOptions, BindingRenderedChunk, BindingTransformHookExtraArgs, ExternalMemoryStatus, JsxOptions, MinifyOptions, ParserOptions, PreRenderedChunk, TransformOptions } from "../binding.cjs";
5
- import { BindingWatcherBundler } from "../../binding.cjs";
6
- import { BindingMagicString, PreRenderedChunk as PreRenderedChunk$1 } from "./binding.cjs";
3
+ import { a as NullValue, i as MaybePromise, n as MakeAsync, o as PartialNull, r as MaybeArray, s as StringOrRegExp$1, t as BuiltinPlugin } from "./utils-C4hvMCOQ.mjs";
7
4
 
8
5
  //#region src/types/misc.d.ts
9
6
  /** @inline */
@@ -140,7 +137,7 @@ interface OutputAsset extends ExternalMemoryHandle {
140
137
  names: string[];
141
138
  }
142
139
  /** @category Plugin APIs */
143
- interface SourceMap$1 {
140
+ interface SourceMap {
144
141
  file: string;
145
142
  mappings: string;
146
143
  names: string[];
@@ -222,7 +219,7 @@ interface OutputChunk extends ExternalMemoryHandle {
222
219
  isDynamicEntry: boolean;
223
220
  moduleIds: string[];
224
221
  /** The source map of this chunk if present. */
225
- map: SourceMap$1 | null;
222
+ map: SourceMap | null;
226
223
  sourcemapFileName: string | null;
227
224
  /** The preliminary file name of this chunk with hash placeholders. */
228
225
  preliminaryFileName: string;
@@ -314,7 +311,7 @@ type GlobalsFunction = (name: string) => string;
314
311
  type CodeSplittingNameFunction = (moduleId: string, ctx: ChunkingContext) => string | NullValue;
315
312
  /** @inline */
316
313
  type CodeSplittingTestFunction = (id: string) => boolean | undefined | void;
317
- type MinifyOptions$1 = Omit<MinifyOptions, "module" | "sourcemap">;
314
+ type MinifyOptions = Omit<MinifyOptions$1, "module" | "sourcemap">;
318
315
  interface CommentsOptions {
319
316
  /**
320
317
  * Comments that contain `@license`, `@preserve` or start with `//!` or `/*!`
@@ -603,7 +600,7 @@ interface OutputOptions {
603
600
  *
604
601
  * @default 'dce-only'
605
602
  */
606
- minify?: boolean | "dce-only" | MinifyOptions$1;
603
+ minify?: boolean | "dce-only" | MinifyOptions;
607
604
  /**
608
605
  * Specifies the global variable name that contains the exports of `umd` / `iife` {@link OutputOptions.format | formats}.
609
606
  *
@@ -1570,7 +1567,7 @@ interface ChecksOptions {
1570
1567
  }
1571
1568
  //#endregion
1572
1569
  //#region src/options/transform-options.d.ts
1573
- interface TransformOptions$1 extends Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
1570
+ interface TransformOptions extends Omit<TransformOptions$1, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
1574
1571
  /**
1575
1572
  * Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
1576
1573
  *
@@ -1767,7 +1764,7 @@ interface NormalizedOutputOptions {
1767
1764
  /** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
1768
1765
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
1769
1766
  /** @see {@linkcode OutputOptions.minify | minify} */
1770
- minify: false | MinifyOptions$1 | "dce-only";
1767
+ minify: false | MinifyOptions | "dce-only";
1771
1768
  /**
1772
1769
  * @deprecated Use `comments.legal` instead.
1773
1770
  * @see {@linkcode OutputOptions.legalComments | legalComments}
@@ -2108,7 +2105,7 @@ interface EmittedPrebuiltChunk {
2108
2105
  /**
2109
2106
  * The corresponding source map for this chunk.
2110
2107
  */
2111
- map?: SourceMap$1;
2108
+ map?: SourceMap;
2112
2109
  sourcemapFileName?: string;
2113
2110
  /**
2114
2111
  * The module id of the facade module for this chunk, if any.
@@ -2280,7 +2277,7 @@ interface TransformPluginContext extends PluginContext {
2280
2277
  /**
2281
2278
  * Get the combined source maps of all previous plugins.
2282
2279
  */
2283
- getCombinedSourcemap(): SourceMap$1;
2280
+ getCombinedSourcemap(): SourceMap;
2284
2281
  }
2285
2282
  //#endregion
2286
2283
  //#region src/types/module-side-effects.d.ts
@@ -3764,7 +3761,7 @@ interface InputOptions {
3764
3761
  *
3765
3762
  *
3766
3763
  */
3767
- transform?: TransformOptions$1;
3764
+ transform?: TransformOptions;
3768
3765
  /**
3769
3766
  * Watch mode related options.
3770
3767
  *
@@ -3866,4 +3863,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
3866
3863
  declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
3867
3864
  declare function defineConfig(config: ConfigExport): ConfigExport;
3868
3865
  //#endregion
3869
- export { VERSION as $, MinifyOptions$1 as $t, SourceDescription as A, WarningHandlerWithDefault as At, exprInterpreter as B, build as Bt, PartialResolvedId as C, RolldownFsModule as Ct, ResolvedId as D, TransformOptions$1 as Dt, ResolveIdResult as E, NormalizedInputOptions as Et, QueryFilterObject as F, RolldownWatcherWatcherEventMap as Ft, interpreterImpl as G, ChunkingContext as Gt, importerId as H, AdvancedChunksGroup as Ht, TopLevelFilterExpression as I, WatchOptions as It, or as J, CodeSplittingOptions as Jt, moduleType as K, CodeSplittingGroup as Kt, and as L, rolldown as Lt, withFilter as M, watch as Mt, FilterExpression as N, RolldownWatcher as Nt, RolldownPlugin as O, ChecksOptions as Ot, FilterExpressionKind as P, RolldownWatcherEvent as Pt, RUNTIME_MODULE_ID as Q, GlobalsFunction as Qt, code as R, RolldownBuild as Rt, ParallelPluginHooks as S, RolldownFileStats as St, ResolveIdExtraOptions as T, NormalizedOutputOptions as Tt, include as U, AdvancedChunksOptions as Ut, id as V, AddonFunction as Vt, interpreter as W, ChunkFileNamesFunction as Wt, query as X, GeneratedCodeOptions as Xt, queries as Y, CommentsOptions as Yt, PreRenderedChunk$1 as Z, GeneratedCodePreset as Zt, ImportKind as _, GeneralHookFilter as _t, ExternalOption as a, RenderedChunk as an, TransformPluginContext as at, ModuleType as b, BufferEncoding as bt, InputOptions as c, SourceMap$1 as cn, EmittedFile as ct, WatcherFileWatcherOptions as d, SourcemapIgnoreListOption as dn, PluginContext as dt, ModuleFormat as en, BundleError as et, WatcherOptions as f, PluginContextResolveOptions as ft, HookFilterExtension as g, PluginContextMeta as gt, FunctionPluginHooks as h, MinimalPluginContext as ht, RolldownOptions as i, OutputChunk as in, TreeshakingOptions as it, TransformResult as j, RolldownMagicString as jt, RolldownPluginOption as k, LoggingFunction as kt, ModuleTypes as l, freeExternalMemory as ln, EmittedPrebuiltChunk as lt, CustomPluginOptions as m, defineParallelPlugin as mt, RolldownOptionsFunction as n, PreRenderedAsset as nn, SourceMapInput as nt, ExternalOptionFunction as o, RenderedModule as on, EmittedAsset as ot, AsyncPluginHooks as p, DefineParallelPluginResult as pt, not as q, CodeSplittingNameFunction as qt, defineConfig as r, OutputAsset as rn, OutputBundle as rt, InputOption as s, RolldownOutput as sn, EmittedChunk as st, ConfigExport as t, OutputOptions as tn, ExistingRawSourceMap as tt, OptimizationOptions as u, ModuleInfo as un, GetModuleInfo as ut, LoadResult as v, HookFilter as vt, Plugin as w, InternalModuleFormat as wt, ObjectHook as x, RolldownDirectoryEntry as xt, ModuleOptions as y, ModuleTypeFilter as yt, exclude as z, BuildOptions as zt };
3866
+ export { BundleError as $, ModuleFormat as $t, SourceDescription as A, RolldownMagicString as At, exprInterpreter as B, AddonFunction as Bt, PartialResolvedId as C, InternalModuleFormat as Ct, ResolvedId as D, ChecksOptions as Dt, ResolveIdResult as E, TransformOptions as Et, QueryFilterObject as F, WatchOptions as Ft, interpreterImpl as G, CodeSplittingGroup as Gt, importerId as H, AdvancedChunksOptions as Ht, TopLevelFilterExpression as I, rolldown as It, or as J, CommentsOptions as Jt, moduleType as K, CodeSplittingNameFunction as Kt, and as L, RolldownBuild as Lt, withFilter as M, RolldownWatcher as Mt, FilterExpression as N, RolldownWatcherEvent as Nt, RolldownPlugin as O, LoggingFunction as Ot, FilterExpressionKind as P, RolldownWatcherWatcherEventMap as Pt, VERSION as Q, MinifyOptions as Qt, code as R, BuildOptions as Rt, ParallelPluginHooks as S, RolldownFsModule as St, ResolveIdExtraOptions as T, NormalizedInputOptions as Tt, include as U, ChunkFileNamesFunction as Ut, id as V, AdvancedChunksGroup as Vt, interpreter as W, ChunkingContext as Wt, query as X, GeneratedCodePreset as Xt, queries as Y, GeneratedCodeOptions as Yt, RUNTIME_MODULE_ID as Z, GlobalsFunction as Zt, ImportKind as _, HookFilter as _t, ExternalOption as a, RenderedModule as an, EmittedAsset as at, ModuleType as b, RolldownDirectoryEntry as bt, InputOptions as c, freeExternalMemory as cn, EmittedPrebuiltChunk as ct, WatcherFileWatcherOptions as d, PluginContextResolveOptions as dt, OutputOptions as en, ExistingRawSourceMap as et, WatcherOptions as f, DefineParallelPluginResult as ft, HookFilterExtension as g, GeneralHookFilter as gt, FunctionPluginHooks as h, PluginContextMeta as ht, RolldownOptions as i, RenderedChunk as in, TransformPluginContext as it, TransformResult as j, watch as jt, RolldownPluginOption as k, WarningHandlerWithDefault as kt, ModuleTypes as l, ModuleInfo as ln, GetModuleInfo as lt, CustomPluginOptions as m, MinimalPluginContext as mt, RolldownOptionsFunction as n, OutputAsset as nn, OutputBundle as nt, ExternalOptionFunction as o, RolldownOutput as on, EmittedChunk as ot, AsyncPluginHooks as p, defineParallelPlugin as pt, not as q, CodeSplittingOptions as qt, defineConfig as r, OutputChunk as rn, TreeshakingOptions as rt, InputOption as s, SourceMap as sn, EmittedFile as st, ConfigExport as t, PreRenderedAsset as tn, SourceMapInput as tt, OptimizationOptions as u, SourcemapIgnoreListOption as un, PluginContext as ut, LoadResult as v, ModuleTypeFilter as vt, Plugin as w, NormalizedOutputOptions as wt, ObjectHook as x, RolldownFileStats as xt, ModuleOptions as y, BufferEncoding as yt, exclude as z, build as zt };
@@ -1,4 +1,4 @@
1
- import { t as rolldown } from "./rolldown-B5m6XtwJ.mjs";
1
+ import { t as rolldown } from "./rolldown-BjzKYYwB.mjs";
2
2
  import path from "node:path";
3
3
  import { readdir } from "node:fs/promises";
4
4
  import { cwd } from "node:process";
@@ -1,5 +1,5 @@
1
1
  import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
2
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/wrap.js
2
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/wrap.js
3
3
  function wrap(result) {
4
4
  let program, module, comments, errors;
5
5
  return {
@@ -1,4 +1,4 @@
1
- import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-CfQ_wZyF.mjs";
1
+ import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-YfCjCcGn.mjs";
2
2
  //#region src/api/rolldown/index.ts
3
3
  /**
4
4
  * The API compatible with Rollup's `rollup` function.
@@ -1,6 +1,6 @@
1
1
  import { i as logInputHookInOutputPlugin, n as error } from "./logs-D80CXhvg.mjs";
2
2
  import { n as BuiltinPlugin } from "./normalize-string-or-regex-D0o84ejN.mjs";
3
- import { c as __decorate, d as PlainObjectLike, f as MinimalPluginContextImpl, h as LOG_LEVEL_DEBUG, i as transformModuleInfo, l as transformAssetSource, m as normalizeLog, o as transformToRollupOutput, p as normalizeHook, s as transformRenderedChunk, t as bindingifyInputOptions, u as lazyProp, v as LOG_LEVEL_WARN, x as VERSION, y as logLevelPriority } from "./bindingify-input-options-MqDue3xO.mjs";
3
+ import { c as __decorate, d as PlainObjectLike, f as MinimalPluginContextImpl, h as LOG_LEVEL_DEBUG, i as transformModuleInfo, l as transformAssetSource, m as normalizeLog, o as transformToRollupOutput, p as normalizeHook, s as transformRenderedChunk, t as bindingifyInputOptions, u as lazyProp, v as LOG_LEVEL_WARN, x as VERSION, y as logLevelPriority } from "./bindingify-input-options-Y2rQIZiC.mjs";
4
4
  import { v as unimplemented } from "./composable-filters-B2ByPP8y.mjs";
5
5
  import { i as unwrapBindingResult } from "./error-CQ6njWsV.mjs";
6
6
  import { Worker } from "node:worker_threads";
@@ -211,7 +211,7 @@ function getSortedPlugins(hookName, plugins) {
211
211
  ];
212
212
  }
213
213
  //#endregion
214
- //#region ../../node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.mjs
214
+ //#region ../../node_modules/.pnpm/valibot@1.3.1_typescript@6.0.2/node_modules/valibot/dist/index.mjs
215
215
  let store$4;
216
216
  /**
217
217
  * Returns the global configuration.
@@ -1,5 +1,5 @@
1
+ import { F as MinifyResult$1, H as SourceMap, L as ParseResult$1, P as MinifyOptions$1, R as ParserOptions$1, W as TsconfigCache$1, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult, v as BindingTsconfigResult } from "./binding-ChYotyxN.mjs";
1
2
  import { a as RolldownLog } from "./logging-C6h4g8dA.mjs";
2
- import { BindingEnhancedTransformOptions, BindingEnhancedTransformResult, BindingTsconfigCompilerOptions as TsconfigCompilerOptions, BindingTsconfigRawOptions as TsconfigRawOptions, BindingTsconfigResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, SourceMap, TsconfigCache } from "../binding.cjs";
3
3
 
4
4
  //#region src/utils/resolve-tsconfig.d.ts
5
5
  /**
@@ -12,11 +12,11 @@ import { BindingEnhancedTransformOptions, BindingEnhancedTransformResult, Bindin
12
12
  * @category Utilities
13
13
  * @experimental
14
14
  */
15
- declare class TsconfigCache$1 extends TsconfigCache {
15
+ declare class TsconfigCache extends TsconfigCache$1 {
16
16
  constructor();
17
17
  }
18
18
  /** @hidden This is only expected to be used by Vite */
19
- declare function resolveTsconfig(filename: string, cache?: TsconfigCache$1 | null): BindingTsconfigResult | null;
19
+ declare function resolveTsconfig(filename: string, cache?: TsconfigCache | null): BindingTsconfigResult | null;
20
20
  //#endregion
21
21
  //#region src/utils/parse.d.ts
22
22
  /**
@@ -24,13 +24,13 @@ declare function resolveTsconfig(filename: string, cache?: TsconfigCache$1 | nul
24
24
  *
25
25
  * @category Utilities
26
26
  */
27
- interface ParseResult$1 extends ParseResult {}
27
+ interface ParseResult extends ParseResult$1 {}
28
28
  /**
29
29
  * Options for parsing a code
30
30
  *
31
31
  * @category Utilities
32
32
  */
33
- interface ParserOptions$1 extends ParserOptions {}
33
+ interface ParserOptions extends ParserOptions$1 {}
34
34
  /**
35
35
  * Parse JS/TS source asynchronously on a separate thread.
36
36
  *
@@ -46,7 +46,7 @@ interface ParserOptions$1 extends ParserOptions {}
46
46
  *
47
47
  * @category Utilities
48
48
  */
49
- declare function parse(filename: string, sourceText: string, options?: ParserOptions$1 | null): Promise<ParseResult$1>;
49
+ declare function parse(filename: string, sourceText: string, options?: ParserOptions | null): Promise<ParseResult>;
50
50
  /**
51
51
  * Parse JS/TS source synchronously on current thread.
52
52
  *
@@ -59,7 +59,7 @@ declare function parse(filename: string, sourceText: string, options?: ParserOpt
59
59
  *
60
60
  * @category Utilities
61
61
  */
62
- declare function parseSync(filename: string, sourceText: string, options?: ParserOptions$1 | null): ParseResult$1;
62
+ declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | null): ParseResult;
63
63
  //#endregion
64
64
  //#region src/utils/minify.d.ts
65
65
  /**
@@ -67,7 +67,7 @@ declare function parseSync(filename: string, sourceText: string, options?: Parse
67
67
  *
68
68
  * @category Utilities
69
69
  */
70
- interface MinifyOptions$1 extends MinifyOptions {
70
+ interface MinifyOptions extends MinifyOptions$1 {
71
71
  inputMap?: SourceMap;
72
72
  }
73
73
  /**
@@ -75,7 +75,7 @@ interface MinifyOptions$1 extends MinifyOptions {
75
75
  *
76
76
  * @category Utilities
77
77
  */
78
- interface MinifyResult$1 extends MinifyResult {}
78
+ interface MinifyResult extends MinifyResult$1 {}
79
79
  /**
80
80
  * Minify asynchronously.
81
81
  *
@@ -84,14 +84,14 @@ interface MinifyResult$1 extends MinifyResult {}
84
84
  * @category Utilities
85
85
  * @experimental
86
86
  */
87
- declare function minify(filename: string, sourceText: string, options?: MinifyOptions$1 | null): Promise<MinifyResult$1>;
87
+ declare function minify(filename: string, sourceText: string, options?: MinifyOptions | null): Promise<MinifyResult>;
88
88
  /**
89
89
  * Minify synchronously.
90
90
  *
91
91
  * @category Utilities
92
92
  * @experimental
93
93
  */
94
- declare function minifySync(filename: string, sourceText: string, options?: MinifyOptions$1 | null): MinifyResult$1;
94
+ declare function minifySync(filename: string, sourceText: string, options?: MinifyOptions | null): MinifyResult;
95
95
  //#endregion
96
96
  //#region src/utils/transform.d.ts
97
97
  /**
@@ -99,7 +99,7 @@ declare function minifySync(filename: string, sourceText: string, options?: Mini
99
99
  *
100
100
  * @category Utilities
101
101
  */
102
- interface TransformOptions$1 extends BindingEnhancedTransformOptions {}
102
+ interface TransformOptions extends BindingEnhancedTransformOptions {}
103
103
  /**
104
104
  * Result of transforming a code.
105
105
  *
@@ -127,7 +127,7 @@ type TransformResult = Omit<BindingEnhancedTransformResult, "errors" | "warnings
127
127
  * @category Utilities
128
128
  * @experimental
129
129
  */
130
- declare function transform(filename: string, sourceText: string, options?: TransformOptions$1 | null, cache?: TsconfigCache$1 | null): Promise<TransformResult>;
130
+ declare function transform(filename: string, sourceText: string, options?: TransformOptions | null, cache?: TsconfigCache | null): Promise<TransformResult>;
131
131
  /**
132
132
  * Transpile a JavaScript or TypeScript into a target ECMAScript version.
133
133
  *
@@ -144,6 +144,6 @@ declare function transform(filename: string, sourceText: string, options?: Trans
144
144
  * @category Utilities
145
145
  * @experimental
146
146
  */
147
- declare function transformSync(filename: string, sourceText: string, options?: TransformOptions$1 | null, cache?: TsconfigCache$1 | null): TransformResult;
147
+ declare function transformSync(filename: string, sourceText: string, options?: TransformOptions | null, cache?: TsconfigCache | null): TransformResult;
148
148
  //#endregion
149
- export { transform as a, MinifyResult$1 as c, ParseResult$1 as d, ParserOptions$1 as f, resolveTsconfig as g, TsconfigCache$1 as h, TsconfigRawOptions as i, minify as l, parseSync as m, TransformResult as n, transformSync as o, parse as p, TsconfigCompilerOptions as r, MinifyOptions$1 as s, TransformOptions$1 as t, minifySync as u };
149
+ export { MinifyOptions as a, minifySync as c, parse as d, parseSync as f, transformSync as i, ParseResult as l, resolveTsconfig as m, TransformResult as n, MinifyResult as o, TsconfigCache as p, transform as r, minify as s, TransformOptions as t, ParserOptions as u };
@@ -1,4 +1,4 @@
1
- import { BindingBuiltinPluginName } from "../binding.cjs";
1
+ import { t as BindingBuiltinPluginName } from "./binding-ChYotyxN.mjs";
2
2
 
3
3
  //#region src/types/utils.d.ts
4
4
  type MaybePromise<T> = T | Promise<T>;
@@ -1,7 +1,7 @@
1
1
  import { o as logMultipleWatcherOption } from "./logs-D80CXhvg.mjs";
2
- import { v as LOG_LEVEL_WARN } from "./bindingify-input-options-MqDue3xO.mjs";
2
+ import { v as LOG_LEVEL_WARN } from "./bindingify-input-options-Y2rQIZiC.mjs";
3
3
  import { h as arraify } from "./composable-filters-B2ByPP8y.mjs";
4
- import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-CfQ_wZyF.mjs";
4
+ import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-YfCjCcGn.mjs";
5
5
  import { t as aggregateBindingErrorsIntoJsError } from "./error-CQ6njWsV.mjs";
6
6
  import { BindingWatcher, shutdownAsyncRuntime } from "../rolldown-binding.wasi.cjs";
7
7
  //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
@@ -1,6 +1,6 @@
1
- import { a as parse, o as parseSync } from "./error-nyELQq9T.js";
2
- import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./resolve-tsconfig-CkWJwi9L.js";
3
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
1
+ import { a as parse, o as parseSync } from "./error-D_M_TRRS.js";
2
+ import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./resolve-tsconfig-YM52CJsk.js";
3
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/generated/visit/walk.js
4
4
  function walkNode(node, visitors) {
5
5
  if (node == null) return;
6
6
  if (Array.isArray(node)) {
@@ -2010,7 +2010,7 @@ function walkTSUnionType(node, visitors) {
2010
2010
  exit !== null && exit(node);
2011
2011
  }
2012
2012
  //#endregion
2013
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
2013
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
2014
2014
  /** Mapping from node type name to node type ID */
2015
2015
  const NODE_TYPE_IDS_MAP = new Map([
2016
2016
  ["DebuggerStatement", 0],
@@ -2180,7 +2180,7 @@ const NODE_TYPE_IDS_MAP = new Map([
2180
2180
  ["TSUnionType", 164]
2181
2181
  ]);
2182
2182
  //#endregion
2183
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/visit/visitor.js
2183
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/visit/visitor.js
2184
2184
  let compiledVisitor;
2185
2185
  function createCompiledVisitor() {
2186
2186
  compiledVisitor = [];
@@ -1,5 +1,5 @@
1
- import { n as types_d_exports, t as Program$1 } from "./shared/types-K2r0mx6Y.mjs";
2
- import { a as transform, c as MinifyResult, d as ParseResult, f as ParserOptions, h as TsconfigCache, i as TsconfigRawOptions, l as minify, m as parseSync, n as TransformResult, o as transformSync, p as parse, r as TsconfigCompilerOptions, s as MinifyOptions, t as TransformOptions, u as minifySync } from "./shared/transform-DEgNAQOQ.mjs";
1
+ import { J as Program$1, Y as types_d_exports, _ as BindingTsconfigRawOptions, g as BindingTsconfigCompilerOptions } from "./shared/binding-ChYotyxN.mjs";
2
+ import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as transformSync, l as ParseResult, n as TransformResult, o as MinifyResult, p as TsconfigCache, r as transform, s as minify, t as TransformOptions, u as ParserOptions } from "./shared/transform-CcdA4xZ5.mjs";
3
3
 
4
4
  //#region ../../node_modules/.pnpm/@oxc-project+types@0.121.0/node_modules/@oxc-project/types/types.d.ts
5
5
  // Auto-generated code, DO NOT EDIT DIRECTLY!
@@ -1300,7 +1300,7 @@ interface Span {
1300
1300
  type ModuleKind = "script" | "module" | "commonjs";
1301
1301
  type Node = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
1302
1302
  //#endregion
1303
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts
1303
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts
1304
1304
  interface VisitorObject$1 {
1305
1305
  DebuggerStatement?: (node: DebuggerStatement) => void;
1306
1306
  "DebuggerStatement:exit"?: (node: DebuggerStatement) => void;
@@ -1670,4 +1670,4 @@ declare class Visitor {
1670
1670
  visit(program: Program$1): void;
1671
1671
  }
1672
1672
  //#endregion
1673
- export { type types_d_exports as ESTree, type MinifyOptions, type MinifyResult, type ParseResult, type ParserOptions, type TransformOptions, type TransformResult, TsconfigCache, type TsconfigCompilerOptions, type TsconfigRawOptions, Visitor, type VisitorObject, minify, minifySync, parse, parseSync, transform, transformSync };
1673
+ export { type types_d_exports as ESTree, type MinifyOptions, type MinifyResult, type ParseResult, type ParserOptions, type TransformOptions, type TransformResult, TsconfigCache, type BindingTsconfigCompilerOptions as TsconfigCompilerOptions, type BindingTsconfigRawOptions as TsconfigRawOptions, Visitor, type VisitorObject, minify, minifySync, parse, parseSync, transform, transformSync };
@@ -1,6 +1,6 @@
1
- import { n as parseSync, t as parse } from "./shared/parse-B_jvq8dU.mjs";
1
+ import { n as parseSync, t as parse } from "./shared/parse-C27hqfZ9.mjs";
2
2
  import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-Cwoo4h_o.mjs";
3
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
3
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/generated/visit/walk.js
4
4
  function walkNode(node, visitors) {
5
5
  if (node == null) return;
6
6
  if (Array.isArray(node)) {
@@ -2010,7 +2010,7 @@ function walkTSUnionType(node, visitors) {
2010
2010
  exit !== null && exit(node);
2011
2011
  }
2012
2012
  //#endregion
2013
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
2013
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
2014
2014
  /** Mapping from node type name to node type ID */
2015
2015
  const NODE_TYPE_IDS_MAP = new Map([
2016
2016
  ["DebuggerStatement", 0],
@@ -2180,7 +2180,7 @@ const NODE_TYPE_IDS_MAP = new Map([
2180
2180
  ["TSUnionType", 164]
2181
2181
  ]);
2182
2182
  //#endregion
2183
- //#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/visit/visitor.js
2183
+ //#region ../../node_modules/.pnpm/oxc-parser@0.121.0_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1/node_modules/oxc-parser/src-js/visit/visitor.js
2184
2184
  let compiledVisitor;
2185
2185
  function createCompiledVisitor() {
2186
2186
  compiledVisitor = [];
@@ -3,6 +3,8 @@ import { memfsExported as __memfsExported } from '@napi-rs/wasm-runtime/fs'
3
3
 
4
4
  const fs = createFsProxy(__memfsExported)
5
5
 
6
+ const errorOutputs = []
7
+
6
8
  const handler = new MessageHandler({
7
9
  onLoad({ wasmModule, wasmMemory }) {
8
10
  const wasi = new WASI({
@@ -17,6 +19,8 @@ const handler = new MessageHandler({
17
19
  printErr: function() {
18
20
  // eslint-disable-next-line no-console
19
21
  console.error.apply(console, arguments)
22
+
23
+ errorOutputs.push([...arguments])
20
24
  },
21
25
  })
22
26
  return instantiateNapiModuleSync(wasmModule, {
@@ -32,6 +36,10 @@ const handler = new MessageHandler({
32
36
  },
33
37
  })
34
38
  },
39
+ onError(error) {
40
+ postMessage({ type: 'error', error, errorOutputs })
41
+ errorOutputs.length = 0
42
+ }
35
43
  })
36
44
 
37
45
  globalThis.onmessage = function (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-rc.12",
3
+ "version": "1.0.0-rc.13",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "keywords": [
6
6
  "bundler",
@@ -53,7 +53,9 @@
53
53
  "registry": "https://registry.npmjs.org/"
54
54
  },
55
55
  "dependencies": {
56
- "@napi-rs/wasm-runtime": "^1.0.0"
56
+ "@emnapi/core": "^1.9.1",
57
+ "@emnapi/runtime": "^1.9.1",
58
+ "@napi-rs/wasm-runtime": "^1.1.2"
57
59
  },
58
60
  "scripts": {
59
61
  "build": "pnpm run build:debug",