nitro 3.0.260415-beta → 3.0.260522-beta

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 (91) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md.gz +0 -0
  2. package/dist/_build/common.mjs +157 -45
  3. package/dist/_build/rolldown.mjs +6 -6
  4. package/dist/_build/rollup.mjs +11 -11
  5. package/dist/_build/vite.build.mjs +3 -3
  6. package/dist/_build/vite.dev.mjs +149 -0
  7. package/dist/_build/vite.env.mjs +177 -0
  8. package/dist/_chunks/nitro.mjs +241 -14
  9. package/dist/_chunks/nitro2.mjs +117 -90
  10. package/dist/_chunks/utils.mjs +4 -4
  11. package/dist/_common.mjs +2 -2
  12. package/dist/_dev.d.mts +1 -1
  13. package/dist/_dev.mjs +7 -6
  14. package/dist/_libs/c12+rc9.mjs +24 -11
  15. package/dist/_libs/c12+readdirp+chokidar.d.mts +7 -8
  16. package/dist/_libs/citty.mjs +1 -1
  17. package/dist/_libs/common.d.mts +37 -0
  18. package/dist/_libs/commondir+is-reference.mjs +3 -3
  19. package/dist/_libs/compatx.d.mts +1 -1
  20. package/dist/_libs/compatx.mjs +1 -1
  21. package/dist/_libs/estree+pluginutils.d.mts +1 -1
  22. package/dist/_libs/estree-walker.mjs +1 -1
  23. package/dist/_libs/hasown+resolve+deepmerge.mjs +62 -49
  24. package/dist/_libs/httpxy.d.mts +2 -4
  25. package/dist/_libs/httpxy.mjs +13 -9
  26. package/dist/_libs/jsonc-parser+workers-utils.d.mts +1579 -0
  27. package/dist/_libs/klona.mjs +1 -1
  28. package/dist/_libs/magic-string.d.mts +1 -1
  29. package/dist/_libs/mlly.d.mts +1 -1
  30. package/dist/_libs/nypm+tinyexec.mjs +137 -113
  31. package/dist/_libs/openapi-types.d.mts +730 -0
  32. package/dist/_libs/perfect-debounce.mjs +1 -1
  33. package/dist/_libs/pkg-types.d.mts +8 -5
  34. package/dist/_libs/plugin-alias.mjs +2 -2
  35. package/dist/_libs/plugin-inject.mjs +4 -2
  36. package/dist/_libs/plugin-json.mjs +2 -2
  37. package/dist/_libs/pluginutils.mjs +18 -5
  38. package/dist/_libs/readdirp+chokidar.mjs +4 -3
  39. package/dist/_libs/remapping.mjs +2 -2
  40. package/dist/_libs/resolve-uri+gen-mapping.mjs +2 -5
  41. package/dist/_libs/rou3.d.mts +1 -1
  42. package/dist/_libs/rou3.mjs +1 -1
  43. package/dist/_libs/std-env.d.mts +1 -1
  44. package/dist/_libs/tsconfck.mjs +1 -1
  45. package/dist/_libs/ultrahtml.mjs +1 -1
  46. package/dist/_libs/unimport+unplugin.mjs +61 -39
  47. package/dist/_libs/unplugin+unimport.d.mts +4 -4
  48. package/dist/_libs/unwasm.d.mts +1 -1
  49. package/dist/_presets.mjs +118 -91
  50. package/dist/builder.d.mts +1 -1
  51. package/dist/builder.mjs +3 -3
  52. package/dist/cli/_chunks/build.mjs +3 -3
  53. package/dist/cli/_chunks/common.mjs +1 -1
  54. package/dist/cli/_chunks/deploy.mjs +2 -2
  55. package/dist/cli/_chunks/dev.mjs +4 -4
  56. package/dist/cli/_chunks/docs.mjs +1 -1
  57. package/dist/cli/_chunks/list.mjs +2 -2
  58. package/dist/cli/_chunks/prepare.mjs +3 -3
  59. package/dist/cli/_chunks/preview.mjs +4 -4
  60. package/dist/cli/_chunks/run.mjs +2 -2
  61. package/dist/cli/_chunks/task.mjs +1 -1
  62. package/dist/cli/index.mjs +1 -1
  63. package/dist/docs/0.docs/5.cache.md +53 -9
  64. package/dist/docs/1.deploy/2.providers/2.aws-amplify.md +3 -3
  65. package/dist/docs/1.deploy/2.providers/21.vercel.md +6 -0
  66. package/dist/docs/3.examples/27.vite-ssr-tsr-react.md +1 -1
  67. package/dist/node_modules/ufo/dist/index.mjs +2 -2
  68. package/dist/node_modules/ufo/package.json +9 -9
  69. package/dist/presets/azure/runtime/azure-swa.mjs +2 -0
  70. package/dist/presets/vercel/runtime/queue.dev.mjs +41 -0
  71. package/dist/runtime/internal/app.mjs +4 -111
  72. package/dist/runtime/internal/route-rules.d.mts +1 -0
  73. package/dist/runtime/internal/route-rules.mjs +29 -1
  74. package/dist/runtime/internal/routes/scalar.mjs +1 -0
  75. package/dist/runtime/virtual/app.d.mts +4 -0
  76. package/dist/runtime/virtual/app.mjs +32 -0
  77. package/dist/types/index.d.mts +959 -1836
  78. package/dist/vite.d.mts +1 -1
  79. package/dist/vite.mjs +23 -331
  80. package/package.json +43 -44
  81. package/dist/THIRD-PARTY-LICENSES.md +0 -1646
  82. package/dist/_chunks/nitro3.mjs +0 -136
  83. package/dist/_chunks/nitro4.mjs +0 -127
  84. package/dist/_libs/_.mjs +0 -2
  85. package/dist/_libs/_2.mjs +0 -2
  86. package/dist/_libs/_3.mjs +0 -2
  87. package/dist/_libs/_4.mjs +0 -2
  88. package/dist/_libs/_5.mjs +0 -2
  89. package/dist/_libs/_6.mjs +0 -2
  90. package/dist/_libs/_7.mjs +0 -2
  91. package/dist/_libs/escape-string-regexp.mjs +0 -5
@@ -65,4 +65,4 @@ function debounce(fn, wait = 25, options = {}) {
65
65
  async function _applyPromised(fn, _this, args) {
66
66
  return await fn.apply(_this, args);
67
67
  }
68
- export { debounce as t };
68
+ export { debounce };
@@ -1,20 +1,23 @@
1
- import { CompilerOptions, TypeAcquisition } from "typescript";
1
+ import * as ts from "typescript";
2
+ //#endregion
3
+ //#region src/tsconfig/types.d.ts
2
4
  type StripEnums<T extends Record<string, any>> = { [K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any };
3
5
  interface TSConfig {
4
- compilerOptions?: StripEnums<CompilerOptions>;
6
+ compilerOptions?: StripEnums<ts.CompilerOptions>;
5
7
  exclude?: string[];
6
8
  compileOnSave?: boolean;
7
9
  extends?: string | string[];
8
10
  files?: string[];
9
11
  include?: string[];
10
- typeAcquisition?: TypeAcquisition;
12
+ typeAcquisition?: ts.TypeAcquisition;
11
13
  references?: {
12
14
  path: string;
13
15
  }[];
14
- }
16
+ } //#endregion
17
+ //#region src/tsconfig/utils.d.ts
15
18
  /**
16
19
  * Defines a TSConfig structure.
17
20
  * @param tsconfig - The contents of `tsconfig.json` as an object. See {@link TSConfig}.
18
21
  * @returns the same `tsconfig.json` object.
19
22
  */
20
- export { TSConfig as t };
23
+ export type { TSConfig };
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "../_common.mjs";
1
+ import { __exportAll } from "../_common.mjs";
2
2
  import path from "node:path";
3
3
  var dist_exports = /* @__PURE__ */ __exportAll({ default: () => alias });
4
4
  function matches(pattern, importee) {
@@ -59,4 +59,4 @@ function alias(options = {}) {
59
59
  }
60
60
  };
61
61
  }
62
- export { dist_exports as n, alias as t };
62
+ export { alias, dist_exports };
@@ -1,5 +1,7 @@
1
- import { S as MagicString, c as walk, i as createFilter, r as attachScopes, s as makeLegalIdentifier } from "../_build/common.mjs";
1
+ import { __exportAll } from "../_common.mjs";
2
+ import { MagicString, attachScopes, createFilter, makeLegalIdentifier, walk } from "../_build/common.mjs";
2
3
  import { sep } from "path";
4
+ var es_exports = /* @__PURE__ */ __exportAll({ default: () => inject });
3
5
  var escape = function(str) {
4
6
  return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
5
7
  };
@@ -126,4 +128,4 @@ function inject(options) {
126
128
  }
127
129
  };
128
130
  }
129
- export { inject as t };
131
+ export { es_exports, inject };
@@ -1,4 +1,4 @@
1
- import { a as dataToEsm, i as createFilter } from "../_build/common.mjs";
1
+ import { createFilter, dataToEsm } from "../_build/common.mjs";
2
2
  function json(options) {
3
3
  if (options === void 0) options = {};
4
4
  var filter = createFilter(options.include, options.exclude);
@@ -29,4 +29,4 @@ function json(options) {
29
29
  }
30
30
  };
31
31
  }
32
- export { json as t };
32
+ export { json };
@@ -1,10 +1,10 @@
1
- import { S as MagicString, x as stripLiteral } from "../_build/common.mjs";
1
+ import { __exportAll } from "../_common.mjs";
2
+ import { MagicString, stripLiteral } from "../_build/common.mjs";
2
3
  import fs from "node:fs";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import path from "node:path";
5
6
  import "node:assert";
6
7
  import { createHash } from "node:crypto";
7
- import { isCSSRequest, normalizePath } from "vite";
8
8
  import assert$1 from "node:assert/strict";
9
9
  function exactRegex(str, flags) {
10
10
  return new RegExp(`^${escapeRegex(str)}$`, flags);
@@ -81,6 +81,13 @@ function slash(p) {
81
81
  return p.replace(windowsSlashRE, "/");
82
82
  }
83
83
  const isWindows = typeof process !== "undefined" && process.platform === "win32";
84
+ function normalizePath(id) {
85
+ return path.posix.normalize(isWindows ? slash(id) : id);
86
+ }
87
+ const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
88
+ function isCSSRequest(request) {
89
+ return CSS_LANGS_RE.test(request);
90
+ }
84
91
  function injectQuery(url, queryToInject) {
85
92
  const { file, postfix } = splitFileAndPostfix(url);
86
93
  return `${isWindows ? slash(file) : file}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : postfix}`;
@@ -272,7 +279,7 @@ function assetsPlugin(pluginOpts) {
272
279
  load: {
273
280
  filter: { id: /^\0virtual:fullstack\// },
274
281
  async handler(id) {
275
- if (id === "\0virtual:fullstack/runtime") return `export const mergeAssets = ${(await import("./_2.mjs")).mergeAssets.toString()};`;
282
+ if (id === "\0virtual:fullstack/runtime") return `export const mergeAssets = ${(await Promise.resolve().then(() => runtime_exports)).mergeAssets.toString()};`;
276
283
  const parsed = parseAssetsVirtual(id);
277
284
  if (!parsed) return;
278
285
  assert$1.notEqual(this.environment.name, "client");
@@ -490,7 +497,12 @@ function collectAssetDepsInner(fileName, bundle) {
490
497
  };
491
498
  }
492
499
  function patchViteClientPlugin() {
493
- const viteClientPath = normalizePath(fileURLToPath(import.meta.resolve("vite/dist/client/client.mjs")));
500
+ let viteClientPath;
501
+ try {
502
+ viteClientPath = normalizePath(fileURLToPath(import.meta.resolve("vite/dist/client/client.mjs")));
503
+ } catch {
504
+ return null;
505
+ }
494
506
  function endIndexOf(code, searchValue) {
495
507
  const i = code.lastIndexOf(searchValue);
496
508
  return i === -1 ? i : i + searchValue.length;
@@ -595,6 +607,7 @@ function assetsURL(url, config) {
595
607
  function assetsURLDev(url, config) {
596
608
  return config.base + url;
597
609
  }
610
+ var runtime_exports = /* @__PURE__ */ __exportAll({ mergeAssets: () => mergeAssets });
598
611
  function mergeAssets(...args) {
599
612
  const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
600
613
  const css = uniqBy(args.flatMap((h) => h.css), (a) => a.href);
@@ -617,4 +630,4 @@ function mergeAssets(...args) {
617
630
  });
618
631
  }
619
632
  }
620
- export { assetsPlugin as n, mergeAssets as t };
633
+ export { assetsPlugin };
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "../_common.mjs";
1
+ import { __exportAll } from "../_common.mjs";
2
2
  import { stat, unwatchFile, watch, watchFile } from "node:fs";
3
3
  import { lstat, open, readdir, realpath, stat as stat$1 } from "node:fs/promises";
4
4
  import { type } from "node:os";
@@ -1338,7 +1338,8 @@ var FSWatcher = class extends EventEmitter {
1338
1338
  if (!this._userIgnored) {
1339
1339
  const { cwd } = this.options;
1340
1340
  const ignored = (this.options.ignored || []).map(normalizeIgnored(cwd));
1341
- this._userIgnored = anymatch([...[...this._ignoredPaths].map(normalizeIgnored(cwd)), ...ignored], void 0);
1341
+ const list = [...[...this._ignoredPaths].map(normalizeIgnored(cwd)), ...ignored];
1342
+ this._userIgnored = anymatch(list, void 0);
1342
1343
  }
1343
1344
  return this._userIgnored(path, stats);
1344
1345
  }
@@ -1430,4 +1431,4 @@ var chokidar_default = {
1430
1431
  watch: watch$1,
1431
1432
  FSWatcher
1432
1433
  };
1433
- export { watch$1 as n, chokidar_exports as t };
1434
+ export { chokidar_exports, watch$1 as watch };
@@ -1,4 +1,4 @@
1
- import { a as toDecodedMap, c as decodedMappings, i as setSourceContent, l as traceSegment, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, s as TraceMap, t as GenMapping } from "./resolve-uri+gen-mapping.mjs";
1
+ import { GenMapping, TraceMap, decodedMappings, maybeAddSegment, setIgnore, setSourceContent, toDecodedMap, toEncodedMap, traceSegment } from "./resolve-uri+gen-mapping.mjs";
2
2
  var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
3
3
  var EMPTY_SOURCES = [];
4
4
  function SegmentObject(source, line, column, name, content, ignore) {
@@ -110,4 +110,4 @@ function remapping(input, loader, options) {
110
110
  };
111
111
  return new SourceMap(traceMappings(buildSourceMapTree(input, loader)), opts);
112
112
  }
113
- export { remapping as t };
113
+ export { remapping };
@@ -1,4 +1,4 @@
1
- import { C as decode, w as encode } from "../_build/common.mjs";
1
+ import { decode, encode } from "../_build/common.mjs";
2
2
  const schemeRegex = /^[\w+.-]+:\/\//;
3
3
  const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
4
4
  const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
@@ -358,8 +358,6 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
358
358
  if (skipable && skipSourceless(line, index)) return;
359
359
  return insert(line, index, [genColumn]);
360
360
  }
361
- assert(sourceLine);
362
- assert(sourceColumn);
363
361
  const sourcesIndex = put(sources, source);
364
362
  const namesIndex = name ? put(names, name) : NO_NAME;
365
363
  if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
@@ -377,7 +375,6 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
377
375
  sourceColumn
378
376
  ]);
379
377
  }
380
- function assert(_val) {}
381
378
  function getIndex(arr, index) {
382
379
  for (let i = arr.length; i <= index; i++) arr[i] = [];
383
380
  return arr[index];
@@ -407,4 +404,4 @@ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIn
407
404
  if (prev.length === 1) return false;
408
405
  return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
409
406
  }
410
- export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t };
407
+ export { GenMapping, TraceMap, decodedMappings, maybeAddSegment, setIgnore, setSourceContent, toDecodedMap, toEncodedMap, traceSegment };
@@ -37,4 +37,4 @@ interface RouterCompilerOptions<T = any> {
37
37
  *
38
38
  * @param router - The router context to compile.
39
39
  */
40
- export { RouterContext as n, RouterCompilerOptions as t };
40
+ export { RouterCompilerOptions, type RouterContext };
@@ -464,4 +464,4 @@ function serializeData(ctx, value) {
464
464
  }
465
465
  return `$${index}`;
466
466
  }
467
- export { findRoute as a, findAllRoutes as i, addRoute as n, createRouter as r, compileRouterToString as t };
467
+ export { addRoute, compileRouterToString, createRouter, findAllRoutes, findRoute };
@@ -7,4 +7,4 @@ type ProviderName = (string & {}) | "appveyor" | "aws_amplify" | "azure_pipeline
7
7
  /**
8
8
  * Provides information about a CI/CD or Deployment provider, including its name and possibly other metadata.
9
9
  */
10
- export { ProviderName as t };
10
+ export type { ProviderName };
@@ -516,4 +516,4 @@ var TSConfckCache = class {
516
516
  #configPaths = /* @__PURE__ */ new Map();
517
517
  #parsed = /* @__PURE__ */ new Map();
518
518
  };
519
- export { parse as n, TSConfckCache as t };
519
+ export { TSConfckCache, parse };
@@ -122,4 +122,4 @@ var T = class {
122
122
  function z(e, t) {
123
123
  return new T(t).visit(e);
124
124
  }
125
- export { z as n, P as t };
125
+ export { P, z };
@@ -1,47 +1,45 @@
1
- import { i as __toESM } from "../_common.mjs";
2
- import { N as require_picomatch, S as MagicString, T as parse$1, b as getMagicString, ct as join$1, dt as resolve$1, st as isAbsolute$2, y as createUnimport } from "../_build/common.mjs";
3
- import { t as walk } from "./estree-walker.mjs";
4
- import { t as remapping } from "./remapping.mjs";
1
+ import { __exportAll, __toESM } from "../_common.mjs";
2
+ import { MagicString, createUnimport, getMagicString, importModule, isAbsolute as isAbsolute$2, isPackageExists, join as join$1, parse as parse$1, require_picomatch, resolve as resolve$1 } from "../_build/common.mjs";
3
+ import { walk } from "./estree-walker.mjs";
4
+ import { remapping } from "./remapping.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import fs, { promises } from "node:fs";
7
7
  import path, { basename, dirname, extname, isAbsolute, normalize, resolve } from "node:path";
8
8
  import process$1 from "node:process";
9
9
  import { Buffer } from "node:buffer";
10
10
  import * as querystring from "node:querystring";
11
- async function detectImportsAcorn(code, ctx, options) {
12
- const s = getMagicString(code);
13
- const map = await ctx.getImportMap();
14
- let matchedImports = [];
15
- const enableAutoImport = options?.autoImport !== false;
16
- const enableTransformVirtualImports = options?.transformVirtualImports !== false && ctx.options.virtualImports?.length;
17
- if (enableAutoImport || enableTransformVirtualImports) {
18
- const ast = parse$1(s.original, {
19
- sourceType: "module",
20
- ecmaVersion: "latest",
21
- locations: true
22
- });
23
- const virtualImports = createVirtualImportsAcronWalker(map, ctx.options.virtualImports);
24
- const scopes = traveseScopes(ast, enableTransformVirtualImports ? virtualImports.walk : {});
25
- if (enableAutoImport) {
26
- const identifiers = scopes.unmatched;
27
- matchedImports.push(...Array.from(identifiers).map((name) => {
28
- const item = map.get(name);
29
- if (item && !item.disabled) return item;
30
- return null;
31
- }).filter(Boolean));
32
- for (const addon of ctx.addons) matchedImports = await addon.matchImports?.call(ctx, identifiers, matchedImports) || matchedImports;
11
+ function createEstreeDetector(parse) {
12
+ return async (code, ctx, options) => {
13
+ const s = getMagicString(code);
14
+ const map = await ctx.getImportMap();
15
+ let matchedImports = [];
16
+ const enableAutoImport = options?.autoImport !== false;
17
+ const enableTransformVirtualImports = options?.transformVirtualImports !== false && ctx.options.virtualImports?.length;
18
+ if (enableAutoImport || enableTransformVirtualImports) {
19
+ const ast = parse(s.original);
20
+ const virtualImports = createVirtualImports(map, ctx.options.virtualImports);
21
+ const scopes = traveseScopes(ast, enableTransformVirtualImports ? virtualImports.walk : {});
22
+ if (enableAutoImport) {
23
+ const identifiers = scopes.unmatched;
24
+ matchedImports.push(...Array.from(identifiers).map((name) => {
25
+ const item = map.get(name);
26
+ if (item && !item.disabled) return item;
27
+ return null;
28
+ }).filter(Boolean));
29
+ for (const addon of ctx.addons) matchedImports = await addon.matchImports?.call(ctx, identifiers, matchedImports) || matchedImports;
30
+ }
31
+ virtualImports.ranges.forEach(([start, end]) => {
32
+ s.remove(start, end);
33
+ });
34
+ matchedImports.push(...virtualImports.imports);
33
35
  }
34
- virtualImports.ranges.forEach(([start, end]) => {
35
- s.remove(start, end);
36
- });
37
- matchedImports.push(...virtualImports.imports);
38
- }
39
- return {
40
- s,
41
- strippedCode: code.toString(),
42
- matchedImports,
43
- isCJSContext: false,
44
- firstOccurrence: 0
36
+ return {
37
+ s,
38
+ strippedCode: code.toString(),
39
+ matchedImports,
40
+ isCJSContext: false,
41
+ firstOccurrence: 0
42
+ };
45
43
  };
46
44
  }
47
45
  function traveseScopes(ast, additionalWalk) {
@@ -164,7 +162,7 @@ function traveseScopes(ast, additionalWalk) {
164
162
  scopes
165
163
  };
166
164
  }
167
- function createVirtualImportsAcronWalker(importMap, virtualImports = []) {
165
+ function createVirtualImports(importMap, virtualImports = []) {
168
166
  const imports = [];
169
167
  const ranges = [];
170
168
  return {
@@ -190,6 +188,25 @@ function createVirtualImportsAcronWalker(importMap, virtualImports = []) {
190
188
  } }
191
189
  };
192
190
  }
191
+ var detect_acorn_exports = /* @__PURE__ */ __exportAll({ detectImportsAcorn: () => detectImportsAcorn });
192
+ const detectImportsAcorn = createEstreeDetector((code) => parse$1(code, {
193
+ sourceType: "module",
194
+ ecmaVersion: "latest",
195
+ locations: true
196
+ }));
197
+ var detect_oxc_exports = /* @__PURE__ */ __exportAll({ detectImportsOxc: () => detectImportsOxc });
198
+ let detectorPromise;
199
+ async function loadDetector() {
200
+ let parseSync;
201
+ if (isPackageExists("rolldown")) parseSync = (await importModule("rolldown/utils")).parseSync;
202
+ else if (isPackageExists("oxc-parser")) parseSync = (await importModule("oxc-parser")).parseSync;
203
+ else throw new Error("[unimport] the `oxc` parser requires either `rolldown` or `oxc-parser` to be installed.");
204
+ return createEstreeDetector((code) => parseSync("", code, { sourceType: "module" }).program);
205
+ }
206
+ async function detectImportsOxc(code, ctx, options) {
207
+ detectorPromise ??= loadDetector();
208
+ return (await detectorPromise)(code, ctx, options);
209
+ }
193
210
  var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
194
211
  function toArray$2(array) {
195
212
  array = array || [];
@@ -1602,6 +1619,11 @@ function createFilter(include, exclude, options) {
1602
1619
  return !includeMatchers.length;
1603
1620
  };
1604
1621
  }
1622
+ var unplugin_exports = /* @__PURE__ */ __exportAll({
1623
+ default: () => unplugin,
1624
+ defaultExcludes: () => defaultExcludes,
1625
+ defaultIncludes: () => defaultIncludes
1626
+ });
1605
1627
  const defaultIncludes = [
1606
1628
  /\.[jt]sx?$/,
1607
1629
  /\.vue$/,
@@ -1638,4 +1660,4 @@ const unplugin = createUnplugin((options = {}) => {
1638
1660
  }
1639
1661
  };
1640
1662
  });
1641
- export { detectImportsAcorn as a, createVirtualImportsAcronWalker as i, defaultIncludes as n, traveseScopes as o, unplugin as r, defaultExcludes as t };
1663
+ export { detect_acorn_exports, detect_oxc_exports, unplugin_exports };
@@ -1,5 +1,5 @@
1
- import { t as MagicString } from "./magic-string.mjs";
2
- import { t as ESMExport } from "./mlly.mjs";
1
+ import { MagicString } from "./magic-string.mjs";
2
+ import { ESMExport } from "./mlly.mjs";
3
3
  //#region src/filter.d.ts
4
4
  /**
5
5
  * A valid `picomatch` glob pattern, or array of patterns.
@@ -367,7 +367,7 @@ interface InjectImportsOptions {
367
367
  *
368
368
  * @default 'regex'
369
369
  */
370
- parser?: 'acorn' | 'regex';
370
+ parser?: 'acorn' | 'oxc' | 'regex';
371
371
  /**
372
372
  * Inject the imports at the end of other imports
373
373
  *
@@ -413,4 +413,4 @@ interface UnimportPluginOptions extends UnimportOptions {
413
413
  */
414
414
  autoImport?: boolean;
415
415
  }
416
- export { type Unimport as n, type UnimportPluginOptions as t };
416
+ export { Unimport, type UnimportPluginOptions };
@@ -23,4 +23,4 @@ interface UnwasmPluginOptions {
23
23
  silent?: boolean;
24
24
  } //#endregion
25
25
  //#region src/plugin/index.d.ts
26
- export { UnwasmPluginOptions as t };
26
+ export type { UnwasmPluginOptions };