@rolldown/browser 1.0.1 → 1.0.3

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 (52) hide show
  1. package/dist/cli.mjs +7 -7
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +3 -3
  4. package/dist/{constructors-BTLtc_G_.js → constructors-B3MtwuwE.js} +1 -4
  5. package/dist/{error-CIj5jXSo.js → error-DAfzPCGW.js} +1 -1
  6. package/dist/experimental-index.browser.mjs +11 -6
  7. package/dist/experimental-index.d.mts +22 -5
  8. package/dist/experimental-index.mjs +13 -8
  9. package/dist/filter-index.d.mts +1 -1
  10. package/dist/filter-index.mjs +1 -1
  11. package/dist/get-log-filter.d.mts +3 -3
  12. package/dist/index.browser.mjs +3 -3
  13. package/dist/index.d.mts +5 -5
  14. package/dist/index.mjs +4 -4
  15. package/dist/parallel-plugin-worker.mjs +1 -1
  16. package/dist/parallel-plugin.d.mts +2 -2
  17. package/dist/parse-ast-index.d.mts +1 -1
  18. package/dist/parse-ast-index.mjs +2 -2
  19. package/dist/plugins-index.browser.mjs +2 -2
  20. package/dist/plugins-index.d.mts +3 -3
  21. package/dist/plugins-index.mjs +2 -2
  22. package/dist/{resolve-tsconfig-uVC8K7GR.js → resolve-tsconfig-B0FaCdVd.js} +14 -3
  23. package/dist/rolldown-binding.wasi-browser.js +1 -0
  24. package/dist/rolldown-binding.wasi.cjs +1 -0
  25. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  26. package/dist/{rolldown-build-DCjXbOeh.js → rolldown-build-XdM92thc.js} +31 -61
  27. package/dist/shared/{binding-CaVxb0SV.d.mts → binding-BhK3B-Zu.d.mts} +31 -0
  28. package/dist/shared/{bindingify-input-options-C7dl2XLe.mjs → bindingify-input-options-BKrzu-Ci.mjs} +12 -12
  29. package/dist/shared/{constructors-B1JYJxhf.d.mts → constructors-CtnJN4Sg.d.mts} +2 -2
  30. package/dist/shared/{constructors-CI_8FAaP.mjs → constructors-YQsI-lJq.mjs} +1 -4
  31. package/dist/shared/{define-config-CYgMQYTy.d.mts → define-config-D4nAGxn1.d.mts} +19 -5
  32. package/dist/shared/{get-log-filter-semyr3Lj.d.mts → get-log-filter-BpNVNJ5-.d.mts} +1 -1
  33. package/dist/shared/{load-config-BFkorvIR.mjs → load-config-BXndT4NL.mjs} +1 -1
  34. package/dist/shared/{normalize-string-or-regex-Dq6w-2tU.mjs → normalize-string-or-regex-CHVaSqeF.mjs} +1 -1
  35. package/dist/shared/{parse-Bmk53Le1.mjs → parse-DSgaJ6oU.mjs} +1 -1
  36. package/dist/shared/{prompt-U5ajztzG.mjs → prompt-DYnaB1Nb.mjs} +1 -1
  37. package/dist/shared/{resolve-tsconfig-Cwoo4h_o.mjs → resolve-tsconfig-DsK7KzKK.mjs} +14 -3
  38. package/dist/shared/{rolldown-Dyy9Y2li.mjs → rolldown-CMk-JrOo.mjs} +1 -1
  39. package/dist/shared/{rolldown-build-DYE2Qi6z.mjs → rolldown-build-Dh-EVzMc.mjs} +23 -52
  40. package/dist/shared/{transform-kP3ISMFT.d.mts → transform-HS_zMlQ1.d.mts} +2 -2
  41. package/dist/shared/{utils-KRVeJqya.d.mts → utils-m0ogxd-4.d.mts} +1 -1
  42. package/dist/shared/{watch-DXAEaxPd.mjs → watch-_n5IfB8D.mjs} +5 -5
  43. package/dist/utils-index.browser.mjs +5 -5
  44. package/dist/utils-index.d.mts +3 -3
  45. package/dist/utils-index.mjs +5 -5
  46. package/package.json +1 -1
  47. /package/dist/{normalize-string-or-regex-CBPw_c5O.js → normalize-string-or-regex-A9UIvc9j.js} +0 -0
  48. /package/dist/shared/{composable-filters-DpWB82jk.mjs → composable-filters-BcLvc0mh.mjs} +0 -0
  49. /package/dist/shared/{define-config-DJOr6Iwt.mjs → define-config-Demdg3_4.mjs} +0 -0
  50. /package/dist/shared/{error-CQ6njWsV.mjs → error-B5cMIevi.mjs} +0 -0
  51. /package/dist/shared/{logging-C6h4g8dA.d.mts → logging-BSNejiLS.d.mts} +0 -0
  52. /package/dist/shared/{logs-D80CXhvg.mjs → logs-aMKUxRpj.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-CBPw_c5O.js";
2
- import { i as unwrapBindingResult, o as parseSync$1, s as bindingifySourcemap$1, t as aggregateBindingErrorsIntoJsError } from "./error-CIj5jXSo.js";
1
+ import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-A9UIvc9j.js";
2
+ import { i as unwrapBindingResult, o as parseSync$1, s as bindingifySourcemap$1, t as aggregateBindingErrorsIntoJsError } from "./error-DAfzPCGW.js";
3
3
  import { BindingAttachDebugInfo, BindingBundler, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
4
4
  //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
5
5
  let _lazyMatch = () => {
@@ -431,7 +431,7 @@ const _path = {
431
431
  };
432
432
  //#endregion
433
433
  //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
434
- const delimiter = globalThis.process?.platform === "win32" ? ";" : ":";
434
+ const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
435
435
  const _platforms = {
436
436
  posix: void 0,
437
437
  win32: void 0
@@ -454,7 +454,7 @@ const win32 = /* @__PURE__ */ mix(";");
454
454
  *
455
455
  * @category Plugin APIs
456
456
  */
457
- const VERSION = "1.0.1";
457
+ const VERSION = "1.0.3";
458
458
  //#endregion
459
459
  //#region src/constants/index.ts
460
460
  /**
@@ -748,9 +748,6 @@ function getSortedPlugins(hookName, plugins) {
748
748
  ...post
749
749
  ];
750
750
  }
751
- //#endregion
752
- //#region ../../node_modules/.pnpm/valibot@1.4.0_typescript@6.0.3/node_modules/valibot/dist/index.mjs
753
- let store$4;
754
751
  const DEFAULT_CONFIG = {
755
752
  lang: void 0,
756
753
  message: void 0,
@@ -768,49 +765,12 @@ const DEFAULT_CONFIG = {
768
765
  function getGlobalConfig(config$1) {
769
766
  if (!config$1 && true) return DEFAULT_CONFIG;
770
767
  return {
771
- lang: config$1?.lang ?? store$4?.lang,
768
+ lang: config$1?.lang ?? void 0,
772
769
  message: config$1?.message,
773
- abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
774
- abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
770
+ abortEarly: config$1?.abortEarly ?? void 0,
771
+ abortPipeEarly: config$1?.abortPipeEarly ?? void 0
775
772
  };
776
773
  }
777
- let store$3;
778
- /**
779
- * Returns a global error message.
780
- *
781
- * @param lang The language of the message.
782
- *
783
- * @returns The error message.
784
- */
785
- /* @__NO_SIDE_EFFECTS__ */
786
- function getGlobalMessage(lang) {
787
- return store$3?.get(lang);
788
- }
789
- let store$2;
790
- /**
791
- * Returns a schema error message.
792
- *
793
- * @param lang The language of the message.
794
- *
795
- * @returns The error message.
796
- */
797
- /* @__NO_SIDE_EFFECTS__ */
798
- function getSchemaMessage(lang) {
799
- return store$2?.get(lang);
800
- }
801
- let store$1;
802
- /**
803
- * Returns a specific error message.
804
- *
805
- * @param reference The identifier reference.
806
- * @param lang The language of the message.
807
- *
808
- * @returns The error message.
809
- */
810
- /* @__NO_SIDE_EFFECTS__ */
811
- function getSpecificMessage(reference, lang) {
812
- return store$1?.get(reference)?.get(lang);
813
- }
814
774
  /**
815
775
  * Stringifies an unknown input to a literal or type string.
816
776
  *
@@ -858,7 +818,7 @@ function _addIssue(context, label, dataset, config$1, other) {
858
818
  abortPipeEarly: config$1.abortPipeEarly
859
819
  };
860
820
  const isSchema = context.kind === "schema";
861
- const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
821
+ const message$1 = other?.message ?? context.message ?? (context.reference, issue.lang, void 0) ?? (isSchema ? (issue.lang, void 0) : null) ?? config$1.message ?? (issue.lang, void 0);
862
822
  if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
863
823
  if (isSchema) dataset.typed = false;
864
824
  if (dataset.issues) dataset.issues.push(issue);
@@ -1928,7 +1888,8 @@ const TransformOptionsSchema = /* @__PURE__ */ object({
1928
1888
  helpers: /* @__PURE__ */ optional(/* @__PURE__ */ object({ mode: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("Runtime"), /* @__PURE__ */ literal("External")])) })),
1929
1889
  decorator: /* @__PURE__ */ optional(/* @__PURE__ */ object({
1930
1890
  legacy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1931
- emitDecoratorMetadata: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1891
+ emitDecoratorMetadata: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1892
+ strictNullChecks: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1932
1893
  })),
1933
1894
  jsx: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1934
1895
  /* @__PURE__ */ literal(false),
@@ -1979,6 +1940,7 @@ const ChecksOptionsSchema = /* @__PURE__ */ strictObject({
1979
1940
  eval: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting uses of direct `eval`s")),
1980
1941
  missingGlobalName: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the `output.globals` option is missing when needed")),
1981
1942
  missingNameOptionForIifeExport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the `output.name` option is missing when needed")),
1943
+ invalidAnnotation: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a `#__PURE__` / `@__PURE__` annotation has no effect due to its position")),
1982
1944
  mixedExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the way to export values is ambiguous")),
1983
1945
  unresolvedEntry: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an entrypoint cannot be resolved")),
1984
1946
  unresolvedImport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an import cannot be resolved")),
@@ -2028,7 +1990,16 @@ const MinifyOptionsSchema = /* @__PURE__ */ strictObject({
2028
1990
  })])),
2029
1991
  debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
2030
1992
  })])),
2031
- codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({ removeWhitespace: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()) })]))
1993
+ codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1994
+ removeWhitespace: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1995
+ legalComments: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1996
+ /* @__PURE__ */ literal("none"),
1997
+ /* @__PURE__ */ literal("inline"),
1998
+ /* @__PURE__ */ literal("eof"),
1999
+ /* @__PURE__ */ literal("external"),
2000
+ /* @__PURE__ */ strictObject({ linked: /* @__PURE__ */ string() })
2001
+ ]))
2002
+ })]))
2032
2003
  });
2033
2004
  const ResolveOptionsSchema = /* @__PURE__ */ strictObject({
2034
2005
  alias: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
@@ -2468,7 +2439,7 @@ function bindingAssetSource(source) {
2468
2439
  return { inner: source };
2469
2440
  }
2470
2441
  //#endregion
2471
- //#region \0@oxc-project+runtime@0.130.0/helpers/decorate.js
2442
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
2472
2443
  function __decorate(decorators, target, key, desc) {
2473
2444
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2474
2445
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -2765,7 +2736,7 @@ function transformToOutputBundle(context, output, changed) {
2765
2736
  const originalStackTraceLimit = Error.stackTraceLimit;
2766
2737
  Error.stackTraceLimit = 2;
2767
2738
  const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
2768
- const stack = new Error(message).stack ?? message;
2739
+ const stack = (/* @__PURE__ */ new Error(message)).stack ?? message;
2769
2740
  Error.stackTraceLimit = originalStackTraceLimit;
2770
2741
  context.warn({
2771
2742
  message: stack,
@@ -3072,7 +3043,7 @@ function exclude(expr) {
3072
3043
  return new Exclude(expr);
3073
3044
  }
3074
3045
  //#endregion
3075
- //#region ../../node_modules/.pnpm/remeda@2.34.0/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
3046
+ //#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
3076
3047
  function e(e, t, n) {
3077
3048
  let r = (n) => e(n, ...t);
3078
3049
  return n === void 0 ? r : Object.assign(r, {
@@ -3081,7 +3052,7 @@ function e(e, t, n) {
3081
3052
  });
3082
3053
  }
3083
3054
  //#endregion
3084
- //#region ../../node_modules/.pnpm/remeda@2.34.0/node_modules/remeda/dist/purry.js
3055
+ //#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/purry.js
3085
3056
  function t$1(t, n, r) {
3086
3057
  let i = t.length - n.length;
3087
3058
  if (i === 0) return t(...n);
@@ -3089,7 +3060,7 @@ function t$1(t, n, r) {
3089
3060
  throw Error(`Wrong number of arguments`);
3090
3061
  }
3091
3062
  //#endregion
3092
- //#region ../../node_modules/.pnpm/remeda@2.34.0/node_modules/remeda/dist/partition.js
3063
+ //#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/partition.js
3093
3064
  function t(...t) {
3094
3065
  return t$1(n, t);
3095
3066
  }
@@ -3604,7 +3575,7 @@ function bindingifyTransform(args) {
3604
3575
  }
3605
3576
  return {
3606
3577
  code: normalizedCode,
3607
- map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, map)),
3578
+ map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, map)) ?? (ret.map === null ? null : void 0),
3608
3579
  moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
3609
3580
  moduleType: ret.moduleType
3610
3581
  };
@@ -4413,7 +4384,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
4413
4384
  platform: inputOptions.platform,
4414
4385
  shimMissingExports: inputOptions.shimMissingExports,
4415
4386
  logLevel: bindingifyLogLevel(logLevel),
4416
- onLog: async (level, log) => onLog(level, log),
4387
+ onLog,
4417
4388
  treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
4418
4389
  moduleTypes: inputOptions.moduleTypes,
4419
4390
  define: normalizedTransform.define,
@@ -5251,21 +5222,20 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
5251
5222
  const normalizedInputPlugins = normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX);
5252
5223
  const normalizedOutputPlugins = normalizePlugins(hookOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
5253
5224
  let plugins = [...normalizedInputPlugins, ...checkOutputPluginOption(normalizedOutputPlugins, onLog)];
5254
- const parallelPluginInitResult = void 0;
5255
5225
  if (inputOptions.experimental?.strictExecutionOrder !== void 0) console.warn("`experimental.strictExecutionOrder` has been stabilized and moved to `output.strictExecutionOrder`. Please update your configuration.");
5256
5226
  try {
5257
5227
  return {
5258
5228
  bundlerOptions: {
5259
5229
  inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedInputPlugins, normalizedOutputPlugins, onLog, logLevel, watchMode),
5260
5230
  outputOptions: bindingifyOutputOptions(outputOptions),
5261
- parallelPluginsRegistry: parallelPluginInitResult?.registry
5231
+ parallelPluginsRegistry: void 0
5262
5232
  },
5263
5233
  inputOptions,
5264
5234
  onLog,
5265
- stopWorkers: parallelPluginInitResult?.stopWorkers
5235
+ stopWorkers: void 0
5266
5236
  };
5267
5237
  } catch (e) {
5268
- await parallelPluginInitResult?.stopWorkers();
5238
+ await void 0;
5269
5239
  throw e;
5270
5240
  }
5271
5241
  }
@@ -1310,6 +1310,20 @@ interface CodegenOptions {
1310
1310
  * @default true
1311
1311
  */
1312
1312
  removeWhitespace?: boolean;
1313
+ /**
1314
+ * How to handle legal comments (comments containing `@license`, `@preserve`, or starting with `//!`/`/*!`).
1315
+ *
1316
+ * * `"none"` - Do not preserve any legal comments.
1317
+ * * `"inline"` - Preserve all legal comments inline.
1318
+ * * `"eof"` - Move all legal comments to the end of the file.
1319
+ * * `"external"` - Extract legal comments without linking.
1320
+ * * `{ linked: "path/to/legal.txt" }` - Extract legal comments and add a link comment to the given path.
1321
+ *
1322
+ * @default "none" (when minifying)
1323
+ */
1324
+ legalComments?: 'none' | 'inline' | 'eof' | 'external' | {
1325
+ linked: string;
1326
+ };
1313
1327
  }
1314
1328
  interface CompressOptions {
1315
1329
  /**
@@ -1435,6 +1449,11 @@ interface MinifyResult {
1435
1449
  code: string;
1436
1450
  map?: SourceMap;
1437
1451
  errors: Array<OxcError>;
1452
+ /**
1453
+ * Legal comments extracted from the source code.
1454
+ * Only populated when `codegen.legalComments` is `"linked"` or `"external"`.
1455
+ */
1456
+ legalComments: Array<string>;
1438
1457
  }
1439
1458
  interface TreeShakeOptions {
1440
1459
  /**
@@ -2074,6 +2093,18 @@ interface DecoratorOptions {
2074
2093
  * @default false
2075
2094
  */
2076
2095
  emitDecoratorMetadata?: boolean;
2096
+ /**
2097
+ * Aligns nullable-union `design:type` emission with `--strictNullChecks`.
2098
+ *
2099
+ * When `true` (default), `T | null` and `T | undefined` emit `Object`, matching tsc strict.
2100
+ * When `false`, `null` and `undefined` are elided from the union so the underlying
2101
+ * primitive constructor is emitted, matching tsc with `--strictNullChecks=false`
2102
+ * and `babel-plugin-transform-typescript-metadata`.
2103
+ *
2104
+ * @see https://www.typescriptlang.org/tsconfig/#strictNullChecks
2105
+ * @default true
2106
+ */
2107
+ strictNullChecks?: boolean;
2077
2108
  }
2078
2109
  type HelperMode =
2079
2110
  /**
@@ -1,13 +1,13 @@
1
- import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-D80CXhvg.mjs";
2
- import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Dq6w-2tU.mjs";
3
- import { _ as noop, a as id, b as unsupported, f as or, h as arraify, n as code, r as exclude, s as include, t as and, u as moduleType, y as unreachable } from "./composable-filters-DpWB82jk.mjs";
4
- import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-CQ6njWsV.mjs";
1
+ import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-aMKUxRpj.mjs";
2
+ import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-CHVaSqeF.mjs";
3
+ import { _ as noop, a as id, b as unsupported, f as or, h as arraify, n as code, r as exclude, s as include, t as and, u as moduleType, y as unreachable } from "./composable-filters-BcLvc0mh.mjs";
4
+ import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-B5cMIevi.mjs";
5
5
  import { parseAst } from "../parse-ast-index.mjs";
6
6
  import { BindingAttachDebugInfo, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects } from "../rolldown-binding.wasi.cjs";
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.1";
10
+ var version = "1.0.3";
11
11
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
12
12
  //#endregion
13
13
  //#region src/constants/version.ts
@@ -218,7 +218,7 @@ function bindingAssetSource(source) {
218
218
  return { inner: source };
219
219
  }
220
220
  //#endregion
221
- //#region \0@oxc-project+runtime@0.130.0/helpers/decorate.js
221
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
222
222
  function __decorate(decorators, target, key, desc) {
223
223
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
224
224
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -515,7 +515,7 @@ function transformToOutputBundle(context, output, changed) {
515
515
  const originalStackTraceLimit = Error.stackTraceLimit;
516
516
  Error.stackTraceLimit = 2;
517
517
  const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
518
- const stack = new Error(message).stack ?? message;
518
+ const stack = (/* @__PURE__ */ new Error(message)).stack ?? message;
519
519
  Error.stackTraceLimit = originalStackTraceLimit;
520
520
  context.warn({
521
521
  message: stack,
@@ -672,7 +672,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
672
672
  return map;
673
673
  }
674
674
  //#endregion
675
- //#region ../../node_modules/.pnpm/remeda@2.34.0/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
675
+ //#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
676
676
  function e(e, t, n) {
677
677
  let r = (n) => e(n, ...t);
678
678
  return n === void 0 ? r : Object.assign(r, {
@@ -681,7 +681,7 @@ function e(e, t, n) {
681
681
  });
682
682
  }
683
683
  //#endregion
684
- //#region ../../node_modules/.pnpm/remeda@2.34.0/node_modules/remeda/dist/purry.js
684
+ //#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/purry.js
685
685
  function t$1(t, n, r) {
686
686
  let i = t.length - n.length;
687
687
  if (i === 0) return t(...n);
@@ -689,7 +689,7 @@ function t$1(t, n, r) {
689
689
  throw Error(`Wrong number of arguments`);
690
690
  }
691
691
  //#endregion
692
- //#region ../../node_modules/.pnpm/remeda@2.34.0/node_modules/remeda/dist/partition.js
692
+ //#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/partition.js
693
693
  function t(...t) {
694
694
  return t$1(n, t);
695
695
  }
@@ -1199,7 +1199,7 @@ function bindingifyTransform(args) {
1199
1199
  }
1200
1200
  return {
1201
1201
  code: normalizedCode,
1202
- map: bindingifySourcemap(normalizeTransformHookSourcemap(id, code, map)),
1202
+ map: bindingifySourcemap(normalizeTransformHookSourcemap(id, code, map)) ?? (ret.map === null ? null : void 0),
1203
1203
  moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
1204
1204
  moduleType: ret.moduleType
1205
1205
  };
@@ -2008,7 +2008,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
2008
2008
  platform: inputOptions.platform,
2009
2009
  shimMissingExports: inputOptions.shimMissingExports,
2010
2010
  logLevel: bindingifyLogLevel(logLevel),
2011
- onLog: async (level, log) => onLog(level, log),
2011
+ onLog,
2012
2012
  treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
2013
2013
  moduleTypes: inputOptions.moduleTypes,
2014
2014
  define: normalizedTransform.define,
@@ -1,5 +1,5 @@
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-CaVxb0SV.mjs";
2
- import { s as StringOrRegExp, t as BuiltinPlugin } from "./utils-KRVeJqya.mjs";
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-BhK3B-Zu.mjs";
2
+ import { s as StringOrRegExp, t as BuiltinPlugin } from "./utils-m0ogxd-4.mjs";
3
3
 
4
4
  //#region src/builtin-plugin/constructors.d.ts
5
5
  declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
@@ -1,4 +1,4 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Dq6w-2tU.mjs";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-CHVaSqeF.mjs";
2
2
  //#region src/builtin-plugin/constructors.ts
3
3
  function viteModulePreloadPolyfillPlugin(config) {
4
4
  return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
@@ -31,9 +31,6 @@ function viteBuildImportAnalysisPlugin(config) {
31
31
  function viteResolvePlugin(config) {
32
32
  return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", {
33
33
  ...config,
34
- async resolveSubpathImports(id, importer, isRequire, scan) {
35
- return config.resolveSubpathImports(id, importer, isRequire, scan);
36
- },
37
34
  yarnPnp: typeof process === "object" && !!process.versions?.pnp
38
35
  }));
39
36
  }
@@ -1,6 +1,6 @@
1
- import { A as ExternalMemoryStatus, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, bn as Program, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, u as BindingMagicString, z as PreRenderedChunk } from "./binding-CaVxb0SV.mjs";
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-KRVeJqya.mjs";
1
+ import { A as ExternalMemoryStatus, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, bn as Program, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, u as BindingMagicString, z as PreRenderedChunk } from "./binding-BhK3B-Zu.mjs";
2
+ import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-BSNejiLS.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-m0ogxd-4.mjs";
4
4
 
5
5
  //#region src/types/misc.d.ts
6
6
  /** @inline */
@@ -850,8 +850,6 @@ interface OutputOptions {
850
850
  *
851
851
  * When both `legalComments` and `comments.legal` are set, `comments.legal` takes priority.
852
852
  *
853
- *
854
- *
855
853
  * @default true
856
854
  */
857
855
  comments?: boolean | CommentsOptions;
@@ -1500,6 +1498,15 @@ interface ChecksOptions {
1500
1498
  * */
1501
1499
  missingNameOptionForIifeExport?: boolean;
1502
1500
  /**
1501
+ * Whether to emit warnings when a `#__PURE__` / `@__PURE__` annotation has no effect due to its position.
1502
+ *
1503
+ * Annotations placed where they cannot annotate a call expression (e.g. before a non-call expression,
1504
+ * before a statement declaration, or between an identifier and `=` in a variable declarator) are
1505
+ * ignored by the parser. Matches Rollup's `INVALID_ANNOTATION` log code.
1506
+ * @default true
1507
+ * */
1508
+ invalidAnnotation?: boolean;
1509
+ /**
1503
1510
  * Whether to emit warnings when the way to export values is ambiguous.
1504
1511
  *
1505
1512
  * See [`output.exports`](https://rolldown.rs/reference/OutputOptions.exports).
@@ -1613,6 +1620,8 @@ interface ChecksOptions {
1613
1620
  * Such modules can significantly slow down module resolution. Consider using
1614
1621
  * [`@rolldown/plugin-transform-imports`](https://github.com/rolldown/plugins/tree/main/packages/transform-imports)
1615
1622
  * to rewrite barrel imports at the source level so the barrel file is never loaded.
1623
+ *
1624
+ * See [Large barrel modules](https://rolldown.rs/in-depth/lazy-barrel-optimization#large-barrel-modules) for more details.
1616
1625
  * @default true
1617
1626
  * */
1618
1627
  largeBarrelModules?: boolean;
@@ -3860,6 +3869,11 @@ interface InputOptions {
3860
3869
  makeAbsoluteExternalsRelative?: MakeAbsoluteExternalsRelative;
3861
3870
  /**
3862
3871
  * Devtools integration options.
3872
+ *
3873
+ * When enabled, Rolldown writes JSON-lines devtools output under
3874
+ * `node_modules/.rolldown/{session_id}/`. Consumers can parse the output with
3875
+ * `@rolldown/debug` after `await bundle.close()` resolves.
3876
+ *
3863
3877
  * @experimental
3864
3878
  */
3865
3879
  devtools?: {
@@ -1,4 +1,4 @@
1
- import { a as RolldownLog } from "./logging-C6h4g8dA.mjs";
1
+ import { a as RolldownLog } from "./logging-BSNejiLS.mjs";
2
2
 
3
3
  //#region src/get-log-filter.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as rolldown } from "./rolldown-Dyy9Y2li.mjs";
1
+ import { t as rolldown } from "./rolldown-CMk-JrOo.mjs";
2
2
  import path from "node:path";
3
3
  import { readdir } from "node:fs/promises";
4
4
  import { cwd } from "node:process";
@@ -1,4 +1,4 @@
1
- import { c as logPluginError, n as error } from "./logs-D80CXhvg.mjs";
1
+ import { c as logPluginError, n as error } from "./logs-aMKUxRpj.mjs";
2
2
  import { BindingCallableBuiltinPlugin } from "../rolldown-binding.wasi.cjs";
3
3
  //#region src/builtin-plugin/utils.ts
4
4
  var BuiltinPlugin = class {
@@ -1,5 +1,5 @@
1
1
  import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
2
- //#region ../../node_modules/.pnpm/oxc-parser@0.130.0/node_modules/oxc-parser/src-js/wrap.js
2
+ //#region ../../node_modules/.pnpm/oxc-parser@0.133.0/node_modules/oxc-parser/src-js/wrap.js
3
3
  function wrap(result) {
4
4
  let program, module, comments, errors;
5
5
  return {
@@ -134,7 +134,7 @@ function requirePicocolors() {
134
134
  picocolors.exports.createColors = createColors;
135
135
  return picocolors.exports;
136
136
  }
137
- const e = /* @__PURE__ */ getDefaultExportFromCjs(/* @__PURE__ */ requirePicocolors());
137
+ const e = /*@__PURE__*/ getDefaultExportFromCjs(/* @__PURE__ */ requirePicocolors());
138
138
  function J({ onlyFirst: t = false } = {}) {
139
139
  const F = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
140
140
  return new RegExp(F, t ? void 0 : "g");
@@ -1,4 +1,4 @@
1
- import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-CQ6njWsV.mjs";
1
+ import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-B5cMIevi.mjs";
2
2
  import { TsconfigCache, collapseSourcemaps, enhancedTransform, enhancedTransformSync, minify, minifySync, resolveTsconfig } from "../rolldown-binding.wasi.cjs";
3
3
  //#region src/utils/minify.ts
4
4
  /**
@@ -36,6 +36,17 @@ function minifySync$1(filename, sourceText, options) {
36
36
  //#endregion
37
37
  //#region src/utils/transform.ts
38
38
  const yarnPnp$1 = typeof process === "object" && !!process.versions?.pnp;
39
+ function normalizeBindingWarning(warning) {
40
+ if (warning.type === "JsError") return warning.field0;
41
+ return {
42
+ code: warning.field0.kind,
43
+ message: warning.field0.message,
44
+ id: warning.field0.id,
45
+ exporter: warning.field0.exporter,
46
+ loc: warning.field0.loc,
47
+ pos: warning.field0.pos
48
+ };
49
+ }
39
50
  /**
40
51
  * Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
41
52
  *
@@ -59,7 +70,7 @@ async function transform(filename, sourceText, options, cache) {
59
70
  return {
60
71
  ...result,
61
72
  errors: result.errors.map(normalizeBindingError),
62
- warnings: result.warnings.map((w) => w.field0)
73
+ warnings: result.warnings.map(normalizeBindingWarning)
63
74
  };
64
75
  }
65
76
  /**
@@ -83,7 +94,7 @@ function transformSync(filename, sourceText, options, cache) {
83
94
  return {
84
95
  ...result,
85
96
  errors: result.errors.map(normalizeBindingError),
86
- warnings: result.warnings.map((w) => w.field0)
97
+ warnings: result.warnings.map(normalizeBindingWarning)
87
98
  };
88
99
  }
89
100
  //#endregion
@@ -1,4 +1,4 @@
1
- import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-DYE2Qi6z.mjs";
1
+ import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-Dh-EVzMc.mjs";
2
2
  //#region src/api/rolldown/index.ts
3
3
  /**
4
4
  * The API compatible with Rollup's `rollup` function.