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.
@@ -67,9 +67,9 @@ interface ImportCommon {
67
67
  /** Module specifier to import from */
68
68
  from: ModuleId;
69
69
  /**
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
- */
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
- * Metadata of the import
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
- * If this import is a pure type import
90
- */
89
+ * If this import is a pure type import
90
+ */
91
91
  type?: boolean;
92
92
  /**
93
- * Using this as the from when generating type declarations
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
- * With properties
104
- *
105
- * Ignored for CJS imports.
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
- * Name of the package
119
- */
118
+ * Name of the package
119
+ */
120
120
  package: string;
121
121
  /**
122
- * Path of the importer
123
- * @default process.cwd()
124
- */
122
+ * Path of the importer
123
+ * @default process.cwd()
124
+ */
125
125
  url?: string;
126
126
  /**
127
- * RegExp, string, or custom function to exclude names of the extracted imports
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
- * Use local cache if exits
132
- * @default true
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
- * Get un-imported usages from code
171
- */
170
+ * Get un-imported usages from code
171
+ */
172
172
  detectImports: (code: string | MagicString) => Promise<DetectImportResult>;
173
173
  /**
174
- * Insert missing imports statements to code
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
- * @deprecated
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
- * Enable auto import inside for Vue's <template>
196
- *
197
- * @default false
198
- */
195
+ * Enable auto import inside for Vue's <template>
196
+ *
197
+ * @default false
198
+ */
199
199
  vueTemplate?: boolean;
200
200
  /**
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
- */
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
- * 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
- */
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
- * Auto import items
226
- */
225
+ * Auto import items
226
+ */
227
227
  imports: Import[];
228
228
  /**
229
- * Auto import preset
230
- */
229
+ * Auto import preset
230
+ */
231
231
  presets: (Preset | BuiltinPresetName)[];
232
232
  /**
233
- * Custom warning function
234
- * @default console.warn
235
- */
233
+ * Custom warning function
234
+ * @default console.warn
235
+ */
236
236
  warn: (msg: string) => void;
237
237
  /**
238
- * Custom debug log function
239
- * @default console.log
240
- */
238
+ * Custom debug log function
239
+ * @default console.log
240
+ */
241
241
  debugLog: (msg: string) => void;
242
242
  /**
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
- */
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
- * Name of virtual modules that exposed all the registed auto-imports
262
- * @default []
263
- */
261
+ * Name of virtual modules that exposed all the registed auto-imports
262
+ * @default []
263
+ */
264
264
  virtualImports: string[];
265
265
  /**
266
- * Directories to scan for auto import
267
- * @default []
268
- */
266
+ * Directories to scan for auto import
267
+ * @default []
268
+ */
269
269
  dirs?: (string | ScanDir)[];
270
270
  /**
271
- * Options for scanning directories for auto import
272
- */
271
+ * Options for scanning directories for auto import
272
+ */
273
273
  dirsScanOptions?: ScanDirExportsOptions;
274
274
  /**
275
- * Custom resolver to auto import id
276
- */
275
+ * Custom resolver to auto import id
276
+ */
277
277
  resolveId?: (id: string, importee?: string) => Thenable<string | void>;
278
278
  /**
279
- * Custom magic comments to be opt-out for auto import, per file/module
280
- *
281
- * @default ['@unimport-disable', '@imports-disable']
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
- * Custom magic comments to debug auto import, printed to console
286
- *
287
- * @default ['@unimport-debug', '@imports-debug']
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
- * Collect meta data for each auto import. Accessible via `ctx.meta`
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
- * Glob patterns for matching files
299
- *
300
- * @default ['*.{ts,js,mjs,cjs,mts,cts,tsx,jsx}']
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
- * Custom function to filter scanned files
305
- */
304
+ * Custom function to filter scanned files
305
+ */
306
306
  fileFilter?: (file: string) => boolean;
307
307
  /**
308
- * Register type exports
309
- *
310
- * @default true
311
- */
308
+ * Register type exports
309
+ *
310
+ * @default true
311
+ */
312
312
  types?: boolean;
313
313
  /**
314
- * Current working directory
315
- *
316
- * @default process.cwd()
317
- */
314
+ * Current working directory
315
+ *
316
+ * @default process.cwd()
317
+ */
318
318
  cwd?: string;
319
319
  }
320
320
  interface ScanDir {
321
321
  /**
322
- * Path pattern of the directory
323
- */
322
+ * Path pattern of the directory
323
+ */
324
324
  glob: string;
325
325
  /**
326
- * Register type exports
327
- *
328
- * @default true
329
- */
326
+ * Register type exports
327
+ *
328
+ * @default true
329
+ */
330
330
  types?: boolean;
331
331
  }
332
332
  interface TypeDeclarationOptions {
333
333
  /**
334
- * Custom resolver for path of the import
335
- */
334
+ * Custom resolver for path of the import
335
+ */
336
336
  resolvePath?: PathFromResolver;
337
337
  /**
338
- * Append `export {}` to the end of the file
339
- *
340
- * @default true
341
- */
338
+ * Append `export {}` to the end of the file
339
+ *
340
+ * @default true
341
+ */
342
342
  exportHelper?: boolean;
343
343
  /**
344
- * Auto-import for type exports
345
- *
346
- * @default true
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
- * Merge the existing imports
353
- *
354
- * @default false
355
- */
352
+ * Merge the existing imports
353
+ *
354
+ * @default false
355
+ */
356
356
  mergeExisting?: boolean;
357
357
  /**
358
- * If the module should be auto imported
359
- *
360
- * @default true
361
- */
358
+ * If the module should be auto imported
359
+ *
360
+ * @default true
361
+ */
362
362
  autoImport?: boolean;
363
363
  /**
364
- * If the module should be transformed for virtual modules.
365
- * Only available when `virtualImports` is set.
366
- *
367
- * @default true
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
- * 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
- */
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
- * Inject the imports at the end of other imports
380
- *
381
- * @default false
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
- * Extend or modify the imports list before injecting
393
- */
392
+ * Extend or modify the imports list before injecting
393
+ */
394
394
  extendImports?: (this: UnimportContext, imports: Import[]) => Import[] | void;
395
395
  /**
396
- * Resolve imports before injecting
397
- */
396
+ * Resolve imports before injecting
397
+ */
398
398
  injectImportsResolved?: (this: UnimportContext, imports: Import[], code: MagicString, id?: string) => Import[] | void;
399
399
  /**
400
- * Modify the injection code before injecting
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
- * Enable implicit auto import.
419
- * Generate global TypeScript definitions.
420
- *
421
- * @default true
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
@@ -4,24 +4,24 @@ import { Plugin } from "rollup";
4
4
  //#region src/plugin/shared.d.ts
5
5
  interface UnwasmPluginOptions {
6
6
  /**
7
- * Directly import the `.wasm` files instead of bundling as base64 string.
8
- *
9
- * @default false
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
- * 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
- */
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
- * Suppress all warnings from the plugin.
22
- *
23
- * @default false
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 = [20, 22];
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;