@nuxt/webpack-builder 3.20.2 → 3.21.1

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 (33) hide show
  1. package/README.md +5 -3
  2. package/dist/THIRD-PARTY-LICENSES.md +3847 -0
  3. package/dist/_chunks/libs/@babel/parser.d.mts +1536 -0
  4. package/dist/_chunks/libs/@jridgewell/trace-mapping.d.mts +82 -0
  5. package/dist/_chunks/libs/@types/estree.d.mts +525 -0
  6. package/dist/_chunks/libs/@types/pug.d.mts +123 -0
  7. package/dist/_chunks/libs/@unhead/vue.d.mts +1096 -0
  8. package/dist/_chunks/libs/@vitejs/plugin-vue-jsx.d.mts +5297 -0
  9. package/dist/_chunks/libs/@vitejs/plugin-vue.d.mts +83 -0
  10. package/dist/_chunks/libs/@volar/language-core.d.mts +56 -0
  11. package/dist/_chunks/libs/@volar/source-map.d.mts +10 -0
  12. package/dist/_chunks/libs/@vue/compiler-core.d.mts +1213 -0
  13. package/dist/_chunks/libs/@vue/compiler-dom.d.mts +45 -0
  14. package/dist/_chunks/libs/@vue/language-core.d.mts +11387 -0
  15. package/dist/_chunks/libs/c12.d.mts +147 -0
  16. package/dist/_chunks/libs/compatx.d.mts +47 -0
  17. package/dist/_chunks/libs/h3.d.mts +45 -0
  18. package/dist/_chunks/libs/ofetch.d.mts +870 -0
  19. package/dist/_chunks/libs/open.d.mts +1 -0
  20. package/dist/_chunks/libs/oxc-transform.d.mts +422 -0
  21. package/dist/_chunks/libs/pkg-types.d.mts +23 -0
  22. package/dist/_chunks/libs/rollup-plugin-visualizer.d.mts +90 -0
  23. package/dist/_chunks/libs/scule.d.mts +15 -0
  24. package/dist/_chunks/libs/unctx.d.mts +28 -0
  25. package/dist/_chunks/libs/unimport.d.mts +386 -0
  26. package/dist/_chunks/libs/untyped.d.mts +44 -0
  27. package/dist/_chunks/libs/vue-router.d.mts +1413 -0
  28. package/dist/_chunks/rolldown-runtime.mjs +12 -0
  29. package/dist/index.d.mts +3150 -4
  30. package/dist/index.mjs +1310 -1155
  31. package/dist/loaders/vue-module-identifier.mjs +11 -0
  32. package/package.json +31 -27
  33. package/dist/index.d.ts +0 -5
@@ -0,0 +1,386 @@
1
+ import MagicString from "magic-string";
2
+ import { ESMExport } from "mlly";
3
+
4
+ //#region ../../node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/shared/unimport.C0UbTDPO.d.mts
5
+ declare const builtinPresets: {
6
+ '@vue/composition-api': InlinePreset;
7
+ '@vueuse/core': () => Preset;
8
+ '@vueuse/head': InlinePreset;
9
+ pinia: InlinePreset;
10
+ preact: InlinePreset;
11
+ quasar: InlinePreset;
12
+ react: InlinePreset;
13
+ 'react-router': InlinePreset;
14
+ 'react-router-dom': InlinePreset;
15
+ svelte: InlinePreset;
16
+ 'svelte/animate': InlinePreset;
17
+ 'svelte/easing': InlinePreset;
18
+ 'svelte/motion': InlinePreset;
19
+ 'svelte/store': InlinePreset;
20
+ 'svelte/transition': InlinePreset;
21
+ 'vee-validate': InlinePreset;
22
+ vitepress: InlinePreset;
23
+ 'vue-demi': InlinePreset;
24
+ 'vue-i18n': InlinePreset;
25
+ 'vue-router': InlinePreset;
26
+ 'vue-router-composables': InlinePreset;
27
+ vue: InlinePreset;
28
+ 'vue/macros': InlinePreset;
29
+ vuex: InlinePreset;
30
+ vitest: InlinePreset;
31
+ 'uni-app': InlinePreset;
32
+ 'solid-js': InlinePreset;
33
+ 'solid-app-router': InlinePreset;
34
+ rxjs: InlinePreset;
35
+ 'date-fns': InlinePreset;
36
+ };
37
+ type BuiltinPresetName = keyof typeof builtinPresets;
38
+ type ModuleId = string;
39
+ type ImportName = string;
40
+ interface ImportCommon {
41
+ /** Module specifier to import from */
42
+ from: ModuleId;
43
+ /**
44
+ * Priority of the import, if multiple imports have the same name, the one with the highest priority will be used
45
+ * @default 1
46
+ */
47
+ priority?: number;
48
+ /** If this import is disabled */
49
+ disabled?: boolean;
50
+ /** Won't output import in declaration file if true */
51
+ dtsDisabled?: boolean;
52
+ /** Import declaration type like const / var / enum */
53
+ declarationType?: ESMExport['declarationType'];
54
+ /**
55
+ * Metadata of the import
56
+ */
57
+ meta?: {
58
+ /** Short description of the import */description?: string; /** URL to the documentation */
59
+ docsUrl?: string; /** Additional metadata */
60
+ [key: string]: any;
61
+ };
62
+ /**
63
+ * If this import is a pure type import
64
+ */
65
+ type?: boolean;
66
+ /**
67
+ * Using this as the from when generating type declarations
68
+ */
69
+ typeFrom?: ModuleId;
70
+ }
71
+ interface Import extends ImportCommon {
72
+ /** Import name to be detected */
73
+ name: ImportName;
74
+ /** Import as this name */
75
+ as?: ImportName;
76
+ /**
77
+ * With properties
78
+ *
79
+ * Ignored for CJS imports.
80
+ */
81
+ with?: Record<string, string>;
82
+ }
83
+ type PresetImport = Omit<Import, 'from'> | ImportName | [name: ImportName, as?: ImportName, from?: ModuleId];
84
+ interface InlinePreset extends ImportCommon {
85
+ imports: (PresetImport | InlinePreset)[];
86
+ }
87
+ /**
88
+ * Auto extract exports from a package for auto import
89
+ */
90
+ interface PackagePreset {
91
+ /**
92
+ * Name of the package
93
+ */
94
+ package: string;
95
+ /**
96
+ * Path of the importer
97
+ * @default process.cwd()
98
+ */
99
+ url?: string;
100
+ /**
101
+ * RegExp, string, or custom function to exclude names of the extracted imports
102
+ */
103
+ ignore?: (string | RegExp | ((name: string) => boolean))[];
104
+ /**
105
+ * Use local cache if exits
106
+ * @default true
107
+ */
108
+ cache?: boolean;
109
+ }
110
+ type Preset = InlinePreset | PackagePreset;
111
+ interface UnimportContext {
112
+ readonly version: string;
113
+ options: Partial<UnimportOptions>;
114
+ staticImports: Import[];
115
+ dynamicImports: Import[];
116
+ addons: Addon[];
117
+ getImports: () => Promise<Import[]>;
118
+ getImportMap: () => Promise<Map<string, Import>>;
119
+ getMetadata: () => UnimportMeta | undefined;
120
+ modifyDynamicImports: (fn: (imports: Import[]) => Thenable<void | Import[]>) => Promise<void>;
121
+ clearDynamicImports: () => void;
122
+ replaceImports: (imports: UnimportOptions['imports']) => Promise<Import[]>;
123
+ invalidate: () => void;
124
+ resolveId: (id: string, parentId?: string) => Thenable<string | null | undefined | void>;
125
+ }
126
+ interface DetectImportResult {
127
+ s: MagicString;
128
+ strippedCode: string;
129
+ isCJSContext: boolean;
130
+ matchedImports: Import[];
131
+ firstOccurrence: number;
132
+ }
133
+ interface Unimport {
134
+ readonly version: string;
135
+ init: () => Promise<void>;
136
+ clearDynamicImports: UnimportContext['clearDynamicImports'];
137
+ getImportMap: UnimportContext['getImportMap'];
138
+ getImports: UnimportContext['getImports'];
139
+ getInternalContext: () => UnimportContext;
140
+ getMetadata: UnimportContext['getMetadata'];
141
+ modifyDynamicImports: UnimportContext['modifyDynamicImports'];
142
+ generateTypeDeclarations: (options?: TypeDeclarationOptions) => Promise<string>;
143
+ /**
144
+ * Get un-imported usages from code
145
+ */
146
+ detectImports: (code: string | MagicString) => Promise<DetectImportResult>;
147
+ /**
148
+ * Insert missing imports statements to code
149
+ */
150
+ injectImports: (code: string | MagicString, id?: string, options?: InjectImportsOptions) => Promise<ImportInjectionResult>;
151
+ scanImportsFromDir: (dir?: (string | ScanDir)[], options?: ScanDirExportsOptions) => Promise<Import[]>;
152
+ scanImportsFromFile: (file: string, includeTypes?: boolean) => Promise<Import[]>;
153
+ /**
154
+ * @deprecated
155
+ */
156
+ toExports: (filepath?: string, includeTypes?: boolean) => Promise<string>;
157
+ }
158
+ interface InjectionUsageRecord {
159
+ import: Import;
160
+ count: number;
161
+ moduleIds: string[];
162
+ }
163
+ interface UnimportMeta {
164
+ injectionUsage: Record<string, InjectionUsageRecord>;
165
+ }
166
+ interface AddonsOptions {
167
+ addons?: Addon[];
168
+ /**
169
+ * Enable auto import inside for Vue's <template>
170
+ *
171
+ * @default false
172
+ */
173
+ vueTemplate?: boolean;
174
+ /**
175
+ * Enable auto import directives for Vue's SFC.
176
+ *
177
+ * Library authors should include `meta.vueDirective: true` in the import metadata.
178
+ *
179
+ * When using a local directives folder, provide the `isDirective`
180
+ * callback to check if the import is a Vue directive.
181
+ */
182
+ vueDirectives?: true | AddonVueDirectivesOptions;
183
+ }
184
+ interface AddonVueDirectivesOptions {
185
+ /**
186
+ * Checks if the import is a Vue directive.
187
+ *
188
+ * **NOTES**:
189
+ * - imports from a library should include `meta.vueDirective: true`.
190
+ * - this callback is only invoked for local directives (only when meta.vueDirective is not set).
191
+ *
192
+ * @param from The path of the import normalized.
193
+ * @param importEntry The import entry.
194
+ */
195
+ isDirective?: (from: string, importEntry: Import) => boolean;
196
+ }
197
+ interface UnimportOptions extends Pick<InjectImportsOptions, 'injectAtEnd' | 'mergeExisting' | 'parser'> {
198
+ /**
199
+ * Auto import items
200
+ */
201
+ imports: Import[];
202
+ /**
203
+ * Auto import preset
204
+ */
205
+ presets: (Preset | BuiltinPresetName)[];
206
+ /**
207
+ * Custom warning function
208
+ * @default console.warn
209
+ */
210
+ warn: (msg: string) => void;
211
+ /**
212
+ * Custom debug log function
213
+ * @default console.log
214
+ */
215
+ debugLog: (msg: string) => void;
216
+ /**
217
+ * Unimport Addons.
218
+ * To use built-in addons, use:
219
+ * ```js
220
+ * addons: {
221
+ * addons: [<custom-addons-here>] // if you want to use also custom addons
222
+ * vueTemplate: true,
223
+ * vueDirectives: [<the-directives-here>]
224
+ * }
225
+ * ```
226
+ *
227
+ * Built-in addons:
228
+ * - vueDirectives: enable auto import directives for Vue's SFC
229
+ * - vueTemplate: enable auto import inside for Vue's <template>
230
+ *
231
+ * @default {}
232
+ */
233
+ addons: AddonsOptions | Addon[];
234
+ /**
235
+ * Name of virtual modules that exposed all the registed auto-imports
236
+ * @default []
237
+ */
238
+ virtualImports: string[];
239
+ /**
240
+ * Directories to scan for auto import
241
+ * @default []
242
+ */
243
+ dirs?: (string | ScanDir)[];
244
+ /**
245
+ * Options for scanning directories for auto import
246
+ */
247
+ dirsScanOptions?: ScanDirExportsOptions;
248
+ /**
249
+ * Custom resolver to auto import id
250
+ */
251
+ resolveId?: (id: string, importee?: string) => Thenable<string | void>;
252
+ /**
253
+ * Custom magic comments to be opt-out for auto import, per file/module
254
+ *
255
+ * @default ['@unimport-disable', '@imports-disable']
256
+ */
257
+ commentsDisable?: string[];
258
+ /**
259
+ * Custom magic comments to debug auto import, printed to console
260
+ *
261
+ * @default ['@unimport-debug', '@imports-debug']
262
+ */
263
+ commentsDebug?: string[];
264
+ /**
265
+ * Collect meta data for each auto import. Accessible via `ctx.meta`
266
+ */
267
+ collectMeta?: boolean;
268
+ }
269
+ type PathFromResolver = (_import: Import) => string | undefined;
270
+ interface ScanDirExportsOptions {
271
+ /**
272
+ * Glob patterns for matching files
273
+ *
274
+ * @default ['*.{ts,js,mjs,cjs,mts,cts,tsx,jsx}']
275
+ */
276
+ filePatterns?: string[];
277
+ /**
278
+ * Custom function to filter scanned files
279
+ */
280
+ fileFilter?: (file: string) => boolean;
281
+ /**
282
+ * Register type exports
283
+ *
284
+ * @default true
285
+ */
286
+ types?: boolean;
287
+ /**
288
+ * Current working directory
289
+ *
290
+ * @default process.cwd()
291
+ */
292
+ cwd?: string;
293
+ }
294
+ interface ScanDir {
295
+ /**
296
+ * Path pattern of the directory
297
+ */
298
+ glob: string;
299
+ /**
300
+ * Register type exports
301
+ *
302
+ * @default true
303
+ */
304
+ types?: boolean;
305
+ }
306
+ interface TypeDeclarationOptions {
307
+ /**
308
+ * Custom resolver for path of the import
309
+ */
310
+ resolvePath?: PathFromResolver;
311
+ /**
312
+ * Append `export {}` to the end of the file
313
+ *
314
+ * @default true
315
+ */
316
+ exportHelper?: boolean;
317
+ /**
318
+ * Auto-import for type exports
319
+ *
320
+ * @default true
321
+ */
322
+ typeReExports?: boolean;
323
+ }
324
+ interface InjectImportsOptions {
325
+ /**
326
+ * Merge the existing imports
327
+ *
328
+ * @default false
329
+ */
330
+ mergeExisting?: boolean;
331
+ /**
332
+ * If the module should be auto imported
333
+ *
334
+ * @default true
335
+ */
336
+ autoImport?: boolean;
337
+ /**
338
+ * If the module should be transformed for virtual modules.
339
+ * Only available when `virtualImports` is set.
340
+ *
341
+ * @default true
342
+ */
343
+ transformVirtualImports?: boolean;
344
+ /**
345
+ * Parser to use for parsing the code
346
+ *
347
+ * Note that `acorn` only takes valid JS Code, should usually only be used after transformationa and transpilation
348
+ *
349
+ * @default 'regex'
350
+ */
351
+ parser?: 'acorn' | 'regex';
352
+ /**
353
+ * Inject the imports at the end of other imports
354
+ *
355
+ * @default false
356
+ */
357
+ injectAtEnd?: boolean;
358
+ }
359
+ type Thenable<T> = Promise<T> | T;
360
+ interface Addon {
361
+ name?: string;
362
+ transform?: (this: UnimportContext, code: MagicString, id: string | undefined) => Thenable<MagicString>;
363
+ declaration?: (this: UnimportContext, dts: string, options: TypeDeclarationOptions) => Thenable<string>;
364
+ matchImports?: (this: UnimportContext, identifiers: Set<string>, matched: Import[]) => Thenable<Import[] | void>;
365
+ /**
366
+ * Extend or modify the imports list before injecting
367
+ */
368
+ extendImports?: (this: UnimportContext, imports: Import[]) => Import[] | void;
369
+ /**
370
+ * Resolve imports before injecting
371
+ */
372
+ injectImportsResolved?: (this: UnimportContext, imports: Import[], code: MagicString, id?: string) => Import[] | void;
373
+ /**
374
+ * Modify the injection code before injecting
375
+ */
376
+ injectImportsStringified?: (this: UnimportContext, injection: string, imports: Import[], code: MagicString, id?: string) => string | void;
377
+ }
378
+ interface MagicStringResult {
379
+ s: MagicString;
380
+ code: string;
381
+ }
382
+ interface ImportInjectionResult extends MagicStringResult {
383
+ imports: Import[];
384
+ }
385
+ //#endregion
386
+ export { type UnimportOptions as i, type InlinePreset as n, type Unimport as r, type Import as t };
@@ -0,0 +1,44 @@
1
+ //#region ../../node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.kR35CG5k.d.mts
2
+ type JSValue = string | number | bigint | boolean | symbol | Function | Array<any> | undefined | object | null;
3
+ type JSType = "string" | "number" | "bigint" | "boolean" | "symbol" | "function" | "object" | "any" | "array";
4
+ type ResolveFn = (value: unknown, get: (key: string) => Promise<unknown>) => JSValue | Promise<JSValue>;
5
+ interface TypeDescriptor {
6
+ /** Used internally to handle schema types */
7
+ type?: JSType | JSType[];
8
+ /** Fully resolved correct TypeScript type for generated TS declarations */
9
+ tsType?: string;
10
+ /** Human-readable type description for use in generated documentation */
11
+ markdownType?: string;
12
+ items?: TypeDescriptor | TypeDescriptor[];
13
+ }
14
+ interface FunctionArg extends TypeDescriptor {
15
+ name?: string;
16
+ default?: JSValue;
17
+ optional?: boolean;
18
+ }
19
+ interface Schema extends TypeDescriptor {
20
+ id?: string;
21
+ default?: JSValue;
22
+ resolve?: ResolveFn;
23
+ properties?: {
24
+ [key: string]: Schema;
25
+ };
26
+ required?: string[];
27
+ title?: string;
28
+ description?: string;
29
+ $schema?: string;
30
+ tags?: string[];
31
+ args?: FunctionArg[];
32
+ returns?: TypeDescriptor;
33
+ }
34
+ interface InputObject {
35
+ $schema?: Schema;
36
+ $resolve?: ResolveFn;
37
+ $default?: any;
38
+ [key: string]: JSValue | InputObject;
39
+ }
40
+ type SchemaDefinition = {
41
+ [x: string]: JSValue | InputObject;
42
+ };
43
+ //#endregion
44
+ export { SchemaDefinition as n, Schema as t };