nitro-nightly 3.0.1-20260121-183047-b2b37883 → 3.0.1-20260122-173608-d4f5eafd
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.
- package/dist/_build/common.mjs +2 -2
- package/dist/_libs/c12+giget+readdirp+chokidar.d.mts +31 -31
- package/dist/_libs/commondir+is-reference.mjs +1 -1
- package/dist/_libs/compatx.d.mts +2 -2
- package/dist/_libs/hasown+resolve+deepmerge.mjs +1 -1
- package/dist/_libs/magic-string.d.mts +99 -99
- package/dist/_libs/mlly.d.mts +25 -25
- package/dist/_libs/plugin-alias.mjs +1 -1
- package/dist/_libs/plugin-inject.mjs +1 -1
- package/dist/_libs/plugin-json.mjs +1 -1
- package/dist/_libs/pluginutils+plugin-commonjs.d.mts +192 -192
- package/dist/_libs/unplugin+unimport.d.mts +159 -159
- package/dist/_libs/unwasm.d.mts +14 -14
- package/dist/_presets.mjs +5 -1
- package/dist/types/index.d.mts +827 -827
- package/dist/vite.d.mts +13 -13
- package/package.json +1 -1
|
@@ -67,9 +67,9 @@ interface ImportCommon {
|
|
|
67
67
|
/** Module specifier to import from */
|
|
68
68
|
from: ModuleId;
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
* Priority of the import, if multiple imports have the same name, the one with the highest priority will be used
|
|
71
|
+
* @default 1
|
|
72
|
+
*/
|
|
73
73
|
priority?: number;
|
|
74
74
|
/** If this import is disabled */
|
|
75
75
|
disabled?: boolean;
|
|
@@ -78,20 +78,20 @@ interface ImportCommon {
|
|
|
78
78
|
/** Import declaration type like const / var / enum */
|
|
79
79
|
declarationType?: ESMExport['declarationType'];
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
* Metadata of the import
|
|
82
|
+
*/
|
|
83
83
|
meta?: {
|
|
84
84
|
/** Short description of the import */description?: string; /** URL to the documentation */
|
|
85
85
|
docsUrl?: string; /** Additional metadata */
|
|
86
86
|
[key: string]: any;
|
|
87
87
|
};
|
|
88
88
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
* If this import is a pure type import
|
|
90
|
+
*/
|
|
91
91
|
type?: boolean;
|
|
92
92
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
* Using this as the from when generating type declarations
|
|
94
|
+
*/
|
|
95
95
|
typeFrom?: ModuleId;
|
|
96
96
|
}
|
|
97
97
|
interface Import extends ImportCommon {
|
|
@@ -100,10 +100,10 @@ interface Import extends ImportCommon {
|
|
|
100
100
|
/** Import as this name */
|
|
101
101
|
as?: ImportName;
|
|
102
102
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
* With properties
|
|
104
|
+
*
|
|
105
|
+
* Ignored for CJS imports.
|
|
106
|
+
*/
|
|
107
107
|
with?: Record<string, string>;
|
|
108
108
|
}
|
|
109
109
|
type PresetImport = Omit<Import, 'from'> | ImportName | [name: ImportName, as?: ImportName, from?: ModuleId];
|
|
@@ -115,22 +115,22 @@ interface InlinePreset extends ImportCommon {
|
|
|
115
115
|
*/
|
|
116
116
|
interface PackagePreset {
|
|
117
117
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
* Name of the package
|
|
119
|
+
*/
|
|
120
120
|
package: string;
|
|
121
121
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
* Path of the importer
|
|
123
|
+
* @default process.cwd()
|
|
124
|
+
*/
|
|
125
125
|
url?: string;
|
|
126
126
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
* RegExp, string, or custom function to exclude names of the extracted imports
|
|
128
|
+
*/
|
|
129
129
|
ignore?: (string | RegExp | ((name: string) => boolean))[];
|
|
130
130
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
* Use local cache if exits
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
134
134
|
cache?: boolean;
|
|
135
135
|
}
|
|
136
136
|
type Preset = InlinePreset | PackagePreset;
|
|
@@ -167,18 +167,18 @@ interface Unimport {
|
|
|
167
167
|
modifyDynamicImports: UnimportContext['modifyDynamicImports'];
|
|
168
168
|
generateTypeDeclarations: (options?: TypeDeclarationOptions) => Promise<string>;
|
|
169
169
|
/**
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
* Get un-imported usages from code
|
|
171
|
+
*/
|
|
172
172
|
detectImports: (code: string | MagicString) => Promise<DetectImportResult>;
|
|
173
173
|
/**
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
* Insert missing imports statements to code
|
|
175
|
+
*/
|
|
176
176
|
injectImports: (code: string | MagicString, id?: string, options?: InjectImportsOptions) => Promise<ImportInjectionResult>;
|
|
177
177
|
scanImportsFromDir: (dir?: (string | ScanDir)[], options?: ScanDirExportsOptions) => Promise<Import[]>;
|
|
178
178
|
scanImportsFromFile: (file: string, includeTypes?: boolean) => Promise<Import[]>;
|
|
179
179
|
/**
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
* @deprecated
|
|
181
|
+
*/
|
|
182
182
|
toExports: (filepath?: string, includeTypes?: boolean) => Promise<string>;
|
|
183
183
|
}
|
|
184
184
|
interface InjectionUsageRecord {
|
|
@@ -192,194 +192,194 @@ interface UnimportMeta {
|
|
|
192
192
|
interface AddonsOptions {
|
|
193
193
|
addons?: Addon[];
|
|
194
194
|
/**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
* Enable auto import inside for Vue's <template>
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
199
|
vueTemplate?: boolean;
|
|
200
200
|
/**
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
201
|
+
* Enable auto import directives for Vue's SFC.
|
|
202
|
+
*
|
|
203
|
+
* Library authors should include `meta.vueDirective: true` in the import metadata.
|
|
204
|
+
*
|
|
205
|
+
* When using a local directives folder, provide the `isDirective`
|
|
206
|
+
* callback to check if the import is a Vue directive.
|
|
207
|
+
*/
|
|
208
208
|
vueDirectives?: true | AddonVueDirectivesOptions;
|
|
209
209
|
}
|
|
210
210
|
interface AddonVueDirectivesOptions {
|
|
211
211
|
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
212
|
+
* Checks if the import is a Vue directive.
|
|
213
|
+
*
|
|
214
|
+
* **NOTES**:
|
|
215
|
+
* - imports from a library should include `meta.vueDirective: true`.
|
|
216
|
+
* - this callback is only invoked for local directives (only when meta.vueDirective is not set).
|
|
217
|
+
*
|
|
218
|
+
* @param from The path of the import normalized.
|
|
219
|
+
* @param importEntry The import entry.
|
|
220
|
+
*/
|
|
221
221
|
isDirective?: (from: string, importEntry: Import) => boolean;
|
|
222
222
|
}
|
|
223
223
|
interface UnimportOptions extends Pick<InjectImportsOptions, 'injectAtEnd' | 'mergeExisting' | 'parser'> {
|
|
224
224
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
* Auto import items
|
|
226
|
+
*/
|
|
227
227
|
imports: Import[];
|
|
228
228
|
/**
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
* Auto import preset
|
|
230
|
+
*/
|
|
231
231
|
presets: (Preset | BuiltinPresetName)[];
|
|
232
232
|
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
* Custom warning function
|
|
234
|
+
* @default console.warn
|
|
235
|
+
*/
|
|
236
236
|
warn: (msg: string) => void;
|
|
237
237
|
/**
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
* Custom debug log function
|
|
239
|
+
* @default console.log
|
|
240
|
+
*/
|
|
241
241
|
debugLog: (msg: string) => void;
|
|
242
242
|
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
243
|
+
* Unimport Addons.
|
|
244
|
+
* To use built-in addons, use:
|
|
245
|
+
* ```js
|
|
246
|
+
* addons: {
|
|
247
|
+
* addons: [<custom-addons-here>] // if you want to use also custom addons
|
|
248
|
+
* vueTemplate: true,
|
|
249
|
+
* vueDirectives: [<the-directives-here>]
|
|
250
|
+
* }
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* Built-in addons:
|
|
254
|
+
* - vueDirectives: enable auto import directives for Vue's SFC
|
|
255
|
+
* - vueTemplate: enable auto import inside for Vue's <template>
|
|
256
|
+
*
|
|
257
|
+
* @default {}
|
|
258
|
+
*/
|
|
259
259
|
addons: AddonsOptions | Addon[];
|
|
260
260
|
/**
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
* Name of virtual modules that exposed all the registed auto-imports
|
|
262
|
+
* @default []
|
|
263
|
+
*/
|
|
264
264
|
virtualImports: string[];
|
|
265
265
|
/**
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
* Directories to scan for auto import
|
|
267
|
+
* @default []
|
|
268
|
+
*/
|
|
269
269
|
dirs?: (string | ScanDir)[];
|
|
270
270
|
/**
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
* Options for scanning directories for auto import
|
|
272
|
+
*/
|
|
273
273
|
dirsScanOptions?: ScanDirExportsOptions;
|
|
274
274
|
/**
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
* Custom resolver to auto import id
|
|
276
|
+
*/
|
|
277
277
|
resolveId?: (id: string, importee?: string) => Thenable<string | void>;
|
|
278
278
|
/**
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
* Custom magic comments to be opt-out for auto import, per file/module
|
|
280
|
+
*
|
|
281
|
+
* @default ['@unimport-disable', '@imports-disable']
|
|
282
|
+
*/
|
|
283
283
|
commentsDisable?: string[];
|
|
284
284
|
/**
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
* Custom magic comments to debug auto import, printed to console
|
|
286
|
+
*
|
|
287
|
+
* @default ['@unimport-debug', '@imports-debug']
|
|
288
|
+
*/
|
|
289
289
|
commentsDebug?: string[];
|
|
290
290
|
/**
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
* Collect meta data for each auto import. Accessible via `ctx.meta`
|
|
292
|
+
*/
|
|
293
293
|
collectMeta?: boolean;
|
|
294
294
|
}
|
|
295
295
|
type PathFromResolver = (_import: Import) => string | undefined;
|
|
296
296
|
interface ScanDirExportsOptions {
|
|
297
297
|
/**
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
* Glob patterns for matching files
|
|
299
|
+
*
|
|
300
|
+
* @default ['*.{ts,js,mjs,cjs,mts,cts,tsx,jsx}']
|
|
301
|
+
*/
|
|
302
302
|
filePatterns?: string[];
|
|
303
303
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
* Custom function to filter scanned files
|
|
305
|
+
*/
|
|
306
306
|
fileFilter?: (file: string) => boolean;
|
|
307
307
|
/**
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
308
|
+
* Register type exports
|
|
309
|
+
*
|
|
310
|
+
* @default true
|
|
311
|
+
*/
|
|
312
312
|
types?: boolean;
|
|
313
313
|
/**
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
314
|
+
* Current working directory
|
|
315
|
+
*
|
|
316
|
+
* @default process.cwd()
|
|
317
|
+
*/
|
|
318
318
|
cwd?: string;
|
|
319
319
|
}
|
|
320
320
|
interface ScanDir {
|
|
321
321
|
/**
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
* Path pattern of the directory
|
|
323
|
+
*/
|
|
324
324
|
glob: string;
|
|
325
325
|
/**
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
* Register type exports
|
|
327
|
+
*
|
|
328
|
+
* @default true
|
|
329
|
+
*/
|
|
330
330
|
types?: boolean;
|
|
331
331
|
}
|
|
332
332
|
interface TypeDeclarationOptions {
|
|
333
333
|
/**
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
* Custom resolver for path of the import
|
|
335
|
+
*/
|
|
336
336
|
resolvePath?: PathFromResolver;
|
|
337
337
|
/**
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
* Append `export {}` to the end of the file
|
|
339
|
+
*
|
|
340
|
+
* @default true
|
|
341
|
+
*/
|
|
342
342
|
exportHelper?: boolean;
|
|
343
343
|
/**
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
344
|
+
* Auto-import for type exports
|
|
345
|
+
*
|
|
346
|
+
* @default true
|
|
347
|
+
*/
|
|
348
348
|
typeReExports?: boolean;
|
|
349
349
|
}
|
|
350
350
|
interface InjectImportsOptions {
|
|
351
351
|
/**
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
352
|
+
* Merge the existing imports
|
|
353
|
+
*
|
|
354
|
+
* @default false
|
|
355
|
+
*/
|
|
356
356
|
mergeExisting?: boolean;
|
|
357
357
|
/**
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
* If the module should be auto imported
|
|
359
|
+
*
|
|
360
|
+
* @default true
|
|
361
|
+
*/
|
|
362
362
|
autoImport?: boolean;
|
|
363
363
|
/**
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
364
|
+
* If the module should be transformed for virtual modules.
|
|
365
|
+
* Only available when `virtualImports` is set.
|
|
366
|
+
*
|
|
367
|
+
* @default true
|
|
368
|
+
*/
|
|
369
369
|
transformVirtualImports?: boolean;
|
|
370
370
|
/**
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
371
|
+
* Parser to use for parsing the code
|
|
372
|
+
*
|
|
373
|
+
* Note that `acorn` only takes valid JS Code, should usually only be used after transformationa and transpilation
|
|
374
|
+
*
|
|
375
|
+
* @default 'regex'
|
|
376
|
+
*/
|
|
377
377
|
parser?: 'acorn' | 'regex';
|
|
378
378
|
/**
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
379
|
+
* Inject the imports at the end of other imports
|
|
380
|
+
*
|
|
381
|
+
* @default false
|
|
382
|
+
*/
|
|
383
383
|
injectAtEnd?: boolean;
|
|
384
384
|
}
|
|
385
385
|
type Thenable<T> = Promise<T> | T;
|
|
@@ -389,16 +389,16 @@ interface Addon {
|
|
|
389
389
|
declaration?: (this: UnimportContext, dts: string, options: TypeDeclarationOptions) => Thenable<string>;
|
|
390
390
|
matchImports?: (this: UnimportContext, identifiers: Set<string>, matched: Import[]) => Thenable<Import[] | void>;
|
|
391
391
|
/**
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
* Extend or modify the imports list before injecting
|
|
393
|
+
*/
|
|
394
394
|
extendImports?: (this: UnimportContext, imports: Import[]) => Import[] | void;
|
|
395
395
|
/**
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
* Resolve imports before injecting
|
|
397
|
+
*/
|
|
398
398
|
injectImportsResolved?: (this: UnimportContext, imports: Import[], code: MagicString, id?: string) => Import[] | void;
|
|
399
399
|
/**
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
* Modify the injection code before injecting
|
|
401
|
+
*/
|
|
402
402
|
injectImportsStringified?: (this: UnimportContext, injection: string, imports: Import[], code: MagicString, id?: string) => string | void;
|
|
403
403
|
}
|
|
404
404
|
interface MagicStringResult {
|
|
@@ -415,11 +415,11 @@ interface UnimportPluginOptions extends UnimportOptions {
|
|
|
415
415
|
exclude: FilterPattern;
|
|
416
416
|
dts: boolean | string;
|
|
417
417
|
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
418
|
+
* Enable implicit auto import.
|
|
419
|
+
* Generate global TypeScript definitions.
|
|
420
|
+
*
|
|
421
|
+
* @default true
|
|
422
|
+
*/
|
|
423
423
|
autoImport?: boolean;
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
package/dist/_libs/unwasm.d.mts
CHANGED
|
@@ -4,24 +4,24 @@ import { Plugin } from "rollup";
|
|
|
4
4
|
//#region src/plugin/shared.d.ts
|
|
5
5
|
interface UnwasmPluginOptions {
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
* Directly import the `.wasm` files instead of bundling as base64 string.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
11
|
esmImport?: boolean;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
* Avoid using top level await and always use a proxy.
|
|
14
|
+
*
|
|
15
|
+
* Useful for compatibility with environments that don't support top level await.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
19
|
lazy?: boolean;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* Suppress all warnings from the plugin.
|
|
22
|
+
*
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
25
|
silent?: boolean;
|
|
26
26
|
} //#endregion
|
|
27
27
|
//#region src/plugin/index.d.ts
|
package/dist/_presets.mjs
CHANGED
|
@@ -1392,7 +1392,11 @@ const ISR_URL_PARAM = "__isr_route";
|
|
|
1392
1392
|
|
|
1393
1393
|
//#endregion
|
|
1394
1394
|
//#region src/presets/vercel/utils.ts
|
|
1395
|
-
const SUPPORTED_NODE_VERSIONS = [
|
|
1395
|
+
const SUPPORTED_NODE_VERSIONS = [
|
|
1396
|
+
20,
|
|
1397
|
+
22,
|
|
1398
|
+
24
|
|
1399
|
+
];
|
|
1396
1400
|
const FALLBACK_ROUTE = "/__server";
|
|
1397
1401
|
const ISR_SUFFIX = "-isr";
|
|
1398
1402
|
const SAFE_FS_CHAR_RE = /[^a-zA-Z0-9_.[\]/]/g;
|