@nuxt/schema-nightly 4.4.0-29554618.f8e243a5 → 4.4.0-29555069.df7ef5d2

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/index.d.mts CHANGED
@@ -1,13 +1,6 @@
1
1
  import { Defu } from "defu";
2
2
  import { TSConfig } from "pkg-types";
3
- import { AppConfig as AppConfig$1, KeepAliveProps, TransitionProps } from "vue";
4
- import { ServerOptions, UserConfig, ViteDevServer } from "vite";
5
- import { Options } from "@vitejs/plugin-vue";
6
- import { Options as Options$1 } from "@vitejs/plugin-vue-jsx";
7
3
  import { InputObject, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1 } from "untyped";
8
- import { SnakeCase } from "scule";
9
- import { DotenvOptions, ResolvedConfig, SourceOptions } from "c12";
10
- import { RouteLocationNormalizedGeneric, RouteLocationRaw, RouteRecordRaw, RouterHistory, RouterOptions as RouterOptions$1 } from "vue-router";
11
4
  import { IncomingMessage, Server, ServerResponse } from "node:http";
12
5
  import { AssetURLTagConfig } from "@vue/compiler-sfc";
13
6
  import { CompilerOptions } from "@vue/compiler-core";
@@ -15,29 +8,36 @@ import { AriaAttributes, DataKeys, GlobalAttributes, RenderSSRHeadOptions, Seria
15
8
  import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
16
9
  import { PluginVisualizerOptions } from "rollup-plugin-visualizer";
17
10
  import { TransformerOptions } from "unctx/transform";
11
+ import { DotenvOptions, ResolvedConfig, SourceOptions } from "c12";
18
12
  import { CompatibilityDateSpec } from "compatx";
19
- import { Ignore, Options as Options$2 } from "ignore";
13
+ import { Ignore, Options } from "ignore";
20
14
  import { ChokidarOptions } from "chokidar";
21
15
  import { CorsOptions, H3CorsOptions } from "h3";
22
16
  import { NuxtLinkOptions } from "nuxt/app";
23
17
  import { FetchOptions } from "ofetch";
24
- import { Options as Options$3 } from "autoprefixer";
25
- import { Options as Options$4 } from "cssnano";
18
+ import { Options as Options$1 } from "autoprefixer";
19
+ import { Options as Options$2 } from "cssnano";
26
20
  import { RawVueCompilerOptions } from "@vue/language-core";
27
21
  import { PluginOptions } from "mini-css-extract-plugin";
28
22
  import { LoaderOptions } from "esbuild-loader";
29
- import { Options as Options$5 } from "pug";
23
+ import { Options as Options$3 } from "pug";
30
24
  import { VueLoaderOptions } from "vue-loader";
31
25
  import { BasePluginOptions, DefinedDefaultMinimizerAndOptions } from "css-minimizer-webpack-plugin";
32
26
  import { Compiler, Configuration, Stats, WebpackError } from "webpack";
33
27
  import { ProcessOptions } from "postcss";
34
- import { Options as Options$6 } from "webpack-dev-middleware";
28
+ import { Options as Options$4 } from "webpack-dev-middleware";
35
29
  import { ClientOptions, MiddlewareOptions } from "webpack-hot-middleware";
30
+ import { AppConfig as AppConfig$1, KeepAliveProps, TransitionProps } from "vue";
36
31
  import { TransformOptions } from "oxc-transform";
37
32
  import { TransformOptions as TransformOptions$1 } from "esbuild";
33
+ import { RouteLocationNormalizedGeneric, RouteLocationRaw, RouteRecordRaw, RouterHistory, RouterOptions as RouterOptions$1 } from "vue-router";
38
34
  import { Server as Server$1 } from "node:https";
35
+ import { ServerOptions, UserConfig, ViteDevServer } from "vite";
39
36
  import { Manifest } from "vue-bundle-renderer";
40
37
  import { Import, InlinePreset, Unimport, UnimportOptions } from "unimport";
38
+ import { Options as Options$5 } from "@vitejs/plugin-vue";
39
+ import { Options as Options$6 } from "@vitejs/plugin-vue-jsx";
40
+ import { SnakeCase } from "scule";
41
41
  import { AsyncLocalStorage } from "node:async_hooks";
42
42
  import { Hookable } from "hookable";
43
43
 
@@ -82,168 +82,6 @@ interface NuxtCompatibilityIssues extends Array<NuxtCompatibilityIssue> {
82
82
  toString(): string;
83
83
  }
84
84
  //#endregion
85
- //#region src/types/components.d.ts
86
- interface ComponentMeta {
87
- [key: string]: unknown;
88
- }
89
- interface Component {
90
- pascalName: string;
91
- kebabName: string;
92
- export: string;
93
- filePath: string;
94
- shortPath: string;
95
- chunkName: string;
96
- prefetch: boolean;
97
- preload: boolean;
98
- global?: boolean | "sync";
99
- island?: boolean;
100
- meta?: ComponentMeta;
101
- mode?: "client" | "server" | "all";
102
- /**
103
- * This number allows configuring the behavior of overriding Nuxt components.
104
- * If multiple components are provided with the same name, then higher priority
105
- * components will be used instead of lower priority components.
106
- */
107
- priority?: number;
108
- /**
109
- * Path to component's declaration file
110
- * Used for type generation when different from filePath
111
- * @default filePath
112
- */
113
- declarationPath?: string;
114
- /**
115
- * Allow bypassing client/server transforms for internal Nuxt components like
116
- * ServerPlaceholder and NuxtClientFallback.
117
- *
118
- * @internal
119
- */
120
- _raw?: boolean;
121
- }
122
- interface ScanDir {
123
- /**
124
- * Path (absolute or relative) to the directory containing your components.
125
- * You can use Nuxt aliases (~ or @) to refer to directories inside project or directly use an npm package path similar to require.
126
- */
127
- path: string;
128
- /**
129
- * Accept Pattern that will be run against specified path.
130
- */
131
- pattern?: string | string[];
132
- /**
133
- * Ignore patterns that will be run against specified path.
134
- */
135
- ignore?: string[];
136
- /**
137
- * Prefix all matched components.
138
- */
139
- prefix?: string;
140
- /**
141
- * Prefix component name by its path.
142
- */
143
- pathPrefix?: boolean;
144
- /**
145
- * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments.
146
- * Learn more on webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
147
- */
148
- prefetch?: boolean;
149
- /**
150
- * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments.
151
- * Learn more on webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
152
- */
153
- preload?: boolean;
154
- /**
155
- * This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not.
156
- */
157
- isAsync?: boolean;
158
- extendComponent?: (component: Component) => Promise<Component | void> | (Component | void);
159
- /**
160
- * If enabled, registers components to be globally available.
161
- *
162
- */
163
- global?: boolean;
164
- /**
165
- * If enabled, registers components as islands
166
- */
167
- island?: boolean;
168
- }
169
- interface ComponentsDir extends ScanDir {
170
- /**
171
- * Watch specified path for changes, including file additions and file deletions.
172
- */
173
- watch?: boolean;
174
- /**
175
- * Extensions supported by Nuxt builder.
176
- */
177
- extensions?: string[];
178
- /**
179
- * Transpile specified path using build.transpile.
180
- * By default ('auto') it will set transpile: true if node_modules/ is in path.
181
- */
182
- transpile?: "auto" | boolean;
183
- /**
184
- * This number allows configuring the behavior of overriding Nuxt components.
185
- * It will be inherited by any components within the directory.
186
- *
187
- * If multiple components are provided with the same name, then higher priority
188
- * components will be used instead of lower priority components.
189
- */
190
- priority?: number;
191
- }
192
- interface ComponentsOptions {
193
- dirs: (string | ComponentsDir)[];
194
- /**
195
- * The default value for whether to globally register components.
196
- *
197
- * When components are registered globally, they will still be directly imported where used,
198
- * but they can also be used dynamically, for example `<component :is="`icon-${myIcon}`">`.
199
- *
200
- * This can be overridden by an individual component directory entry.
201
- */
202
- global?: boolean;
203
- /**
204
- * Whether to write metadata to the build directory with information about the components that
205
- * are auto-registered in your app.
206
- */
207
- generateMetadata?: boolean;
208
- loader?: boolean;
209
- transform?: {
210
- exclude?: RegExp[];
211
- include?: RegExp[];
212
- };
213
- }
214
- //#endregion
215
- //#region src/types/compiler.d.ts
216
- interface KeyedFunction {
217
- /**
218
- * The name of the function.
219
- *
220
- * Use 'default' to target a module's default export. In that case, the callable name
221
- * is derived from the filename (camel-cased) for matching during analysis.
222
- */
223
- name: string;
224
- /**
225
- * The path to the file where the function is defined.
226
- * You can use Nuxt aliases (~ or @) to refer to directories inside the project or directly use an npm package path similar to require.
227
- */
228
- source: string;
229
- /**
230
- * The maximum number of arguments the function can accept.
231
- * In the case that the function is called with fewer arguments than this number,
232
- * the compiler will inject an auto-generated key as an additional argument.
233
- *
234
- * The key is unique based on the location of the function being invoked within the file.
235
- *
236
- * @example `{ name: 'useKey', source: '~/composables/useKey', argumentLength: 2 }`
237
- *
238
- * ```ts
239
- * useKey() // will be transformed to: useKey('\$KzLSZ0O59L')
240
- * useKey('first') // will be transformed to: useKey('first', '\$KzLSZ0O59L')
241
- * useKey('first', 'second') // will not be transformed
242
- * ```
243
- */
244
- argumentLength: number;
245
- }
246
- //#endregion
247
85
  //#region src/types/router.d.ts
248
86
  type RouterOptions = Partial<Omit<RouterOptions$1, "history" | "routes">> & {
249
87
  history?: (baseURL?: string) => RouterHistory | null | undefined;
@@ -498,6 +336,150 @@ interface Nuxt {
498
336
  "apps": Record<string, NuxtApp>;
499
337
  }
500
338
  //#endregion
339
+ //#region src/types/head.d.ts
340
+ type MetaObjectRaw = SerializableHead;
341
+ type MetaObject = MetaObjectRaw;
342
+ type AppHeadMetaObject = MetaObjectRaw & {
343
+ /**
344
+ * The character encoding in which the document is encoded => `<meta charset="<value>" />`
345
+ */
346
+ charset?: string;
347
+ /**
348
+ * Configuration of the viewport (the area of the window in which web content can be seen),
349
+ * mapped to => `<meta name="viewport" content="<value>" />`
350
+ */
351
+ viewport?: string;
352
+ };
353
+ type SerializableHtmlAttributes = GlobalAttributes & AriaAttributes & DataKeys;
354
+ //#endregion
355
+ //#region src/types/config.d.ts
356
+ type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
357
+ type UpperSnakeCase<S extends string> = Uppercase<SnakeCase<S>>;
358
+ declare const message: symbol;
359
+ type RuntimeValue<T, B extends string> = T & {
360
+ [message]?: B;
361
+ } | T;
362
+ type Overrideable<T extends Record<string, any>, Path extends string = ""> = { [K in keyof T]?: K extends string ? unknown extends T[K] ? unknown : T[K] extends Record<string, unknown> ? RuntimeValue<Overrideable<T[K], `${Path}_${UpperSnakeCase<K>}`>, `You can override this value at runtime with NUXT${Path}_${UpperSnakeCase<K>}`> : RuntimeValue<T[K], `You can override this value at runtime with NUXT${Path}_${UpperSnakeCase<K>}`> : K extends number ? T[K] : never };
363
+ type RuntimeConfigNamespace = Record<string, unknown>;
364
+ interface PublicRuntimeConfig extends RuntimeConfigNamespace {}
365
+ interface RuntimeConfig extends RuntimeConfigNamespace {
366
+ public: PublicRuntimeConfig;
367
+ }
368
+ /**
369
+ * User configuration in `nuxt.config` file
370
+ */
371
+ interface NuxtConfig extends DeepPartial<Omit<ConfigSchema, "components" | "vue" | "vite" | "runtimeConfig" | "webpack" | "nitro">> {
372
+ components?: ConfigSchema["components"];
373
+ vue?: Omit<DeepPartial<ConfigSchema["vue"]>, "config"> & {
374
+ config?: Partial<Filter<AppConfig$1, string | boolean>>;
375
+ };
376
+ vite?: ConfigSchema["vite"];
377
+ runtimeConfig?: Overrideable<RuntimeConfig>;
378
+ webpack?: DeepPartial<ConfigSchema["webpack"]> & {
379
+ $client?: DeepPartial<ConfigSchema["webpack"]>;
380
+ $server?: DeepPartial<ConfigSchema["webpack"]>;
381
+ };
382
+ /**
383
+ * Experimental custom config schema
384
+ * @see [Nuxt Issue #15592](https://github.com/nuxt/nuxt/issues/15592)
385
+ */
386
+ $schema?: SchemaDefinition$1;
387
+ }
388
+ type NuxtConfigLayer = ResolvedConfig<NuxtConfig & {
389
+ srcDir: ConfigSchema["srcDir"];
390
+ rootDir: ConfigSchema["rootDir"];
391
+ }> & {
392
+ cwd: string;
393
+ configFile: string;
394
+ };
395
+ interface NuxtBuilder {
396
+ bundle: (nuxt: Nuxt) => Promise<void>;
397
+ }
398
+ interface NuxtOptions extends Omit<ConfigSchema, "vue" | "sourcemap" | "debug" | "builder" | "postcss" | "webpack"> {
399
+ vue: Omit<ConfigSchema["vue"], "config"> & {
400
+ config?: Partial<Filter<AppConfig$1, string | boolean>>;
401
+ };
402
+ sourcemap: Required<Exclude<ConfigSchema["sourcemap"], boolean>>;
403
+ debug: Required<Exclude<ConfigSchema["debug"], true>>;
404
+ builder: "@nuxt/vite-builder" | "@nuxt/webpack-builder" | "@nuxt/rspack-builder" | NuxtBuilder;
405
+ postcss: Omit<ConfigSchema["postcss"], "order"> & {
406
+ order: Exclude<ConfigSchema["postcss"]["order"], string>;
407
+ };
408
+ webpack: ConfigSchema["webpack"] & {
409
+ $client: ConfigSchema["webpack"];
410
+ $server: ConfigSchema["webpack"];
411
+ };
412
+ _layers: readonly NuxtConfigLayer[];
413
+ $schema: SchemaDefinition$1;
414
+ }
415
+ interface ViteConfig extends Omit<UserConfig, "publicDir"> {
416
+ /** The path to the entrypoint for the Vite build. */
417
+ entry?: string;
418
+ /**
419
+ * Options passed to @vitejs/plugin-vue.
420
+ * @see [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue)
421
+ */
422
+ vue?: Options$5;
423
+ /**
424
+ * Options passed to @vitejs/plugin-vue-jsx.
425
+ * @see [@vitejs/plugin-vue-jsx.](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)
426
+ */
427
+ vueJsx?: Options$6;
428
+ /**
429
+ * Warmup vite entrypoint caches on dev startup.
430
+ */
431
+ warmupEntry?: boolean;
432
+ /**
433
+ * Use environment variables or top level `server` options to configure Nuxt server.
434
+ */
435
+ server?: Omit<ServerOptions, "port" | "host">;
436
+ /**
437
+ * Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`.
438
+ *
439
+ * You can read more in <https://nuxt.com/docs/4.x/api/nuxt-config#public>.
440
+ * @deprecated
441
+ */
442
+ publicDir?: never;
443
+ }
444
+ interface ViteOptions extends ViteConfig {}
445
+ interface CustomAppConfig {
446
+ [key: string]: unknown;
447
+ }
448
+ interface AppConfigInput extends CustomAppConfig {
449
+ /** @deprecated reserved */
450
+ private?: never;
451
+ /** @deprecated reserved */
452
+ nuxt?: never;
453
+ /** @deprecated reserved */
454
+ nitro?: never;
455
+ /** @deprecated reserved */
456
+ server?: never;
457
+ }
458
+ type Serializable<T> = T extends Function ? never : T extends Promise<infer U> ? Serializable<U> : T extends string & {} ? T : T extends Record<string, any> ? { [K in keyof T]: Serializable<T[K]> } : T;
459
+ type ValueOf<T> = T[keyof T];
460
+ type Filter<T extends Record<string, any>, V> = Pick<T, ValueOf<{ [K in keyof T]: NonNullable<T[K]> extends V ? K : never }>>;
461
+ interface NuxtAppConfig {
462
+ head: Serializable<AppHeadMetaObject>;
463
+ layoutTransition: boolean | Serializable<TransitionProps>;
464
+ pageTransition: boolean | Serializable<TransitionProps>;
465
+ viewTransition?: ViewTransitionOptions["enabled"] | ViewTransitionOptions;
466
+ keepalive: boolean | Serializable<KeepAliveProps>;
467
+ }
468
+ interface AppConfig {
469
+ [key: string]: unknown;
470
+ }
471
+ interface ViewTransitionOptions {
472
+ enabled: boolean | "always";
473
+ types?: string[];
474
+ }
475
+ type ViewTransitionTypesFn = (to: RouteLocationNormalizedGeneric, from: RouteLocationNormalizedGeneric) => string[];
476
+ interface ViewTransitionPageOptions {
477
+ enabled?: boolean | "always";
478
+ types?: string[] | ViewTransitionTypesFn;
479
+ toTypes?: string[] | ViewTransitionTypesFn;
480
+ fromTypes?: string[] | ViewTransitionTypesFn;
481
+ }
482
+ //#endregion
501
483
  //#region src/types/hooks.d.ts
502
484
  type HookResult = Promise<void> | void;
503
485
  type TSReference = {
@@ -926,26 +908,10 @@ interface NuxtHooks {
926
908
  * Called on `progress` on WebpackBar.
927
909
  * @param statesArray The array containing the states on progress
928
910
  * @returns void
929
- */
930
- "rspack:progress": (statesArray: any[]) => void;
931
- }
932
- type NuxtHookName = keyof NuxtHooks;
933
- //#endregion
934
- //#region src/types/head.d.ts
935
- type MetaObjectRaw = SerializableHead;
936
- type MetaObject = MetaObjectRaw;
937
- type AppHeadMetaObject = MetaObjectRaw & {
938
- /**
939
- * The character encoding in which the document is encoded => `<meta charset="<value>" />`
940
- */
941
- charset?: string;
942
- /**
943
- * Configuration of the viewport (the area of the window in which web content can be seen),
944
- * mapped to => `<meta name="viewport" content="<value>" />`
945
- */
946
- viewport?: string;
947
- };
948
- type SerializableHtmlAttributes = GlobalAttributes & AriaAttributes & DataKeys;
911
+ */
912
+ "rspack:progress": (statesArray: any[]) => void;
913
+ }
914
+ type NuxtHookName = keyof NuxtHooks;
949
915
  //#endregion
950
916
  //#region src/types/imports.d.ts
951
917
  interface ImportsOptions extends UnimportOptions {
@@ -995,6 +961,10 @@ interface ConfigSchema {
995
961
  */
996
962
  imports: ImportsOptions;
997
963
  /**
964
+ * Configure the Nuxt compiler.
965
+ */
966
+ compiler: NuxtCompilerOptions;
967
+ /**
998
968
  * Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be enabled if you have a `pages/` directory in your source folder.
999
969
  *
1000
970
  * Additionally, you can provide a glob pattern or an array of patterns to scan only certain files for pages.
@@ -1424,6 +1394,12 @@ interface ConfigSchema {
1424
1394
  */
1425
1395
  keyedComposables: KeyedFunction[];
1426
1396
  /**
1397
+ * Factories for functions that should be registered for automatic key injection.
1398
+ *
1399
+ * @see keyedComposables
1400
+ */
1401
+ keyedComposableFactories: KeyedFunctionFactory[];
1402
+ /**
1427
1403
  * Tree shake code from specific builds.
1428
1404
  */
1429
1405
  treeShake: {
@@ -1722,7 +1698,7 @@ interface ConfigSchema {
1722
1698
  * }
1723
1699
  * ```
1724
1700
  */
1725
- ignoreOptions: Options$2;
1701
+ ignoreOptions: Options;
1726
1702
  /**
1727
1703
  * Any file in `pages/`, `layouts/`, `middleware/`, and `public/` directories will be ignored during the build process if its filename starts with the prefix specified by `ignorePrefix`. This is intended to prevent certain files from being processed or served in the built application. By default, the `ignorePrefix` is set to '-', ignoring any files starting with '-'.
1728
1704
  *
@@ -2505,8 +2481,8 @@ interface ConfigSchema {
2505
2481
  * @see [PostCSS docs](https://postcss.org/)
2506
2482
  */
2507
2483
  plugins: Record<string, unknown> & {
2508
- autoprefixer?: false | Options$3;
2509
- cssnano?: false | Options$4;
2484
+ autoprefixer?: false | Options$1;
2485
+ cssnano?: false | Options$2;
2510
2486
  };
2511
2487
  };
2512
2488
  router: {
@@ -2733,7 +2709,7 @@ interface ConfigSchema {
2733
2709
  /**
2734
2710
  * @see [`pug` options](https://pugjs.org/api/reference.html#options)
2735
2711
  */
2736
- pugPlain: Options$5;
2712
+ pugPlain: Options$3;
2737
2713
  /**
2738
2714
  * See [vue-loader](https://github.com/vuejs/vue-loader) for available options.
2739
2715
  */
@@ -2822,8 +2798,8 @@ interface ConfigSchema {
2822
2798
  execute?: boolean;
2823
2799
  postcssOptions: ProcessOptions & {
2824
2800
  plugins: Record<string, unknown> & {
2825
- autoprefixer?: Options$3;
2826
- cssnano?: Options$4;
2801
+ autoprefixer?: Options$1;
2802
+ cssnano?: Options$2;
2827
2803
  };
2828
2804
  };
2829
2805
  sourceMap?: boolean;
@@ -2832,7 +2808,7 @@ interface ConfigSchema {
2832
2808
  /**
2833
2809
  * See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options.
2834
2810
  */
2835
- devMiddleware: Options$6<IncomingMessage, ServerResponse>;
2811
+ devMiddleware: Options$4<IncomingMessage, ServerResponse>;
2836
2812
  /**
2837
2813
  * See [webpack-hot-middleware](https://github.com/webpack/webpack-hot-middleware) for available options.
2838
2814
  */
@@ -2854,135 +2830,198 @@ interface ConfigSchema {
2854
2830
  };
2855
2831
  }
2856
2832
  //#endregion
2857
- //#region src/types/config.d.ts
2858
- type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
2859
- type UpperSnakeCase<S extends string> = Uppercase<SnakeCase<S>>;
2860
- declare const message: symbol;
2861
- type RuntimeValue<T, B extends string> = T & {
2862
- [message]?: B;
2863
- } | T;
2864
- type Overrideable<T extends Record<string, any>, Path extends string = ""> = { [K in keyof T]?: K extends string ? unknown extends T[K] ? unknown : T[K] extends Record<string, unknown> ? RuntimeValue<Overrideable<T[K], `${Path}_${UpperSnakeCase<K>}`>, `You can override this value at runtime with NUXT${Path}_${UpperSnakeCase<K>}`> : RuntimeValue<T[K], `You can override this value at runtime with NUXT${Path}_${UpperSnakeCase<K>}`> : K extends number ? T[K] : never };
2865
- type RuntimeConfigNamespace = Record<string, unknown>;
2866
- interface PublicRuntimeConfig extends RuntimeConfigNamespace {}
2867
- interface RuntimeConfig extends RuntimeConfigNamespace {
2868
- public: PublicRuntimeConfig;
2869
- }
2833
+ //#region src/utils/definition.d.ts
2834
+ type JavascriptExtension = "js" | "ts" | "tsx" | "jsx" | "mjs" | "cjs" | "mts" | "cts";
2835
+ type VueExtension = "vue";
2870
2836
  /**
2871
- * User configuration in `nuxt.config` file
2837
+ * Allows adding additional types to a property of an object.
2838
+ * If the property is an array, the type will be added to the array items.
2872
2839
  */
2873
- interface NuxtConfig extends DeepPartial<Omit<ConfigSchema, "components" | "vue" | "vite" | "runtimeConfig" | "webpack" | "nitro">> {
2874
- components?: ConfigSchema["components"];
2875
- vue?: Omit<DeepPartial<ConfigSchema["vue"]>, "config"> & {
2876
- config?: Partial<Filter<AppConfig$1, string | boolean>>;
2877
- };
2878
- vite?: ConfigSchema["vite"];
2879
- runtimeConfig?: Overrideable<RuntimeConfig>;
2880
- webpack?: DeepPartial<ConfigSchema["webpack"]> & {
2881
- $client?: DeepPartial<ConfigSchema["webpack"]>;
2882
- $server?: DeepPartial<ConfigSchema["webpack"]>;
2883
- };
2840
+ type AugmentProperty<T extends Record<string, any>, K extends keyof T, V> = { [key in keyof T]: key extends K ? NonNullable<T[key]> extends Array<infer U> ? (U | V)[] : T[key] : T[key] };
2841
+ //#endregion
2842
+ //#region src/types/compiler.d.ts
2843
+ interface KeyedFunction {
2884
2844
  /**
2885
- * Experimental custom config schema
2886
- * @see [Nuxt Issue #15592](https://github.com/nuxt/nuxt/issues/15592)
2845
+ * The name of the function.
2846
+ *
2847
+ * Use 'default' to target a module's default export. In that case, the callable name
2848
+ * is derived from the filename (camel-cased) for matching during analysis.
2887
2849
  */
2888
- $schema?: SchemaDefinition$1;
2889
- }
2890
- type NuxtConfigLayer = ResolvedConfig<NuxtConfig & {
2891
- srcDir: ConfigSchema["srcDir"];
2892
- rootDir: ConfigSchema["rootDir"];
2893
- }> & {
2894
- cwd: string;
2895
- configFile: string;
2896
- };
2897
- interface NuxtBuilder {
2898
- bundle: (nuxt: Nuxt) => Promise<void>;
2850
+ name: string;
2851
+ /**
2852
+ * The path to the file where the function is defined.
2853
+ * You can use Nuxt aliases (~ or @) to refer to directories inside the project or directly use an npm package path similar to require.
2854
+ */
2855
+ source: string;
2856
+ /**
2857
+ * The maximum number of arguments the function can accept.
2858
+ * In the case that the function is called with fewer arguments than this number,
2859
+ * the compiler will inject an auto-generated key as an additional argument.
2860
+ *
2861
+ * The key is unique based on the location of the function being invoked within the file.
2862
+ *
2863
+ * @example `{ name: 'useKey', source: '~/composables/useKey', argumentLength: 2 }`
2864
+ *
2865
+ * ```ts
2866
+ * useKey() // will be transformed to: useKey('\$KzLSZ0O59L')
2867
+ * useKey('first') // will be transformed to: useKey('first', '\$KzLSZ0O59L')
2868
+ * useKey('first', 'second') // will not be transformed
2869
+ * ```
2870
+ */
2871
+ argumentLength: number;
2899
2872
  }
2900
- interface NuxtOptions extends Omit<ConfigSchema, "vue" | "sourcemap" | "debug" | "builder" | "postcss" | "webpack"> {
2901
- vue: Omit<ConfigSchema["vue"], "config"> & {
2902
- config?: Partial<Filter<AppConfig$1, string | boolean>>;
2903
- };
2904
- sourcemap: Required<Exclude<ConfigSchema["sourcemap"], boolean>>;
2905
- debug: Required<Exclude<ConfigSchema["debug"], true>>;
2906
- builder: "@nuxt/vite-builder" | "@nuxt/webpack-builder" | "@nuxt/rspack-builder" | NuxtBuilder;
2907
- postcss: Omit<ConfigSchema["postcss"], "order"> & {
2908
- order: Exclude<ConfigSchema["postcss"]["order"], string>;
2909
- };
2910
- webpack: ConfigSchema["webpack"] & {
2911
- $client: ConfigSchema["webpack"];
2912
- $server: ConfigSchema["webpack"];
2913
- };
2914
- _layers: readonly NuxtConfigLayer[];
2915
- $schema: SchemaDefinition$1;
2873
+ interface KeyedFunctionFactory extends Pick<KeyedFunction, "argumentLength"> {
2874
+ /**
2875
+ * The name of the factory function.
2876
+ * @example 'createUseFetch'
2877
+ */
2878
+ name: string;
2879
+ source: string;
2916
2880
  }
2917
- interface ViteConfig extends Omit<UserConfig, "publicDir"> {
2918
- /** The path to the entrypoint for the Vite build. */
2919
- entry?: string;
2881
+ interface NuxtCompilerOptions {
2920
2882
  /**
2921
- * Options passed to @vitejs/plugin-vue.
2922
- * @see [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue)
2883
+ * Enable scanning of directories for Nuxt compiler transformations.
2923
2884
  */
2924
- vue?: Options;
2885
+ scan?: boolean;
2886
+ }
2887
+ interface CompilerScanDir {
2925
2888
  /**
2926
- * Options passed to @vitejs/plugin-vue-jsx.
2927
- * @see [@vitejs/plugin-vue-jsx.](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)
2889
+ * Path (absolute or relative) to the directory to scan for files.
2890
+ * Relative paths are resolved against the Nuxt source directory of the project.
2891
+ *
2892
+ * You can use Nuxt aliases (~ or @) to refer to directories inside the project or directly use an NPM package path similar to `require()`.
2928
2893
  */
2929
- vueJsx?: Options$1;
2894
+ path: string;
2930
2895
  /**
2931
- * Warmup vite entrypoint caches on dev startup.
2896
+ * The file extensions to scan in the specified path.
2897
+ *
2898
+ * This has no effect if `pattern` is specified.
2932
2899
  */
2933
- warmupEntry?: boolean;
2900
+ extensions?: (JavascriptExtension | (string & {}))[];
2934
2901
  /**
2935
- * Use environment variables or top level `server` options to configure Nuxt server.
2902
+ * Accept Pattern that will be run against the specified path.
2936
2903
  */
2937
- server?: Omit<ServerOptions, "port" | "host">;
2904
+ pattern?: string | string[];
2938
2905
  /**
2939
- * Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`.
2940
- *
2941
- * You can read more in <https://nuxt.com/docs/4.x/api/nuxt-config#public>.
2942
- * @deprecated
2906
+ * Ignore patterns that will be run against the specified path.
2943
2907
  */
2944
- publicDir?: never;
2908
+ ignore?: string[];
2945
2909
  }
2946
- interface ViteOptions extends ViteConfig {}
2947
- interface CustomAppConfig {
2910
+ //#endregion
2911
+ //#region src/types/components.d.ts
2912
+ interface ComponentMeta {
2948
2913
  [key: string]: unknown;
2949
2914
  }
2950
- interface AppConfigInput extends CustomAppConfig {
2951
- /** @deprecated reserved */
2952
- private?: never;
2953
- /** @deprecated reserved */
2954
- nuxt?: never;
2955
- /** @deprecated reserved */
2956
- nitro?: never;
2957
- /** @deprecated reserved */
2958
- server?: never;
2959
- }
2960
- type Serializable<T> = T extends Function ? never : T extends Promise<infer U> ? Serializable<U> : T extends string & {} ? T : T extends Record<string, any> ? { [K in keyof T]: Serializable<T[K]> } : T;
2961
- type ValueOf<T> = T[keyof T];
2962
- type Filter<T extends Record<string, any>, V> = Pick<T, ValueOf<{ [K in keyof T]: NonNullable<T[K]> extends V ? K : never }>>;
2963
- interface NuxtAppConfig {
2964
- head: Serializable<AppHeadMetaObject>;
2965
- layoutTransition: boolean | Serializable<TransitionProps>;
2966
- pageTransition: boolean | Serializable<TransitionProps>;
2967
- viewTransition?: ViewTransitionOptions["enabled"] | ViewTransitionOptions;
2968
- keepalive: boolean | Serializable<KeepAliveProps>;
2915
+ interface Component {
2916
+ pascalName: string;
2917
+ kebabName: string;
2918
+ export: string;
2919
+ filePath: string;
2920
+ shortPath: string;
2921
+ chunkName: string;
2922
+ prefetch: boolean;
2923
+ preload: boolean;
2924
+ global?: boolean | "sync";
2925
+ island?: boolean;
2926
+ meta?: ComponentMeta;
2927
+ mode?: "client" | "server" | "all";
2928
+ /**
2929
+ * This number allows configuring the behavior of overriding Nuxt components.
2930
+ * If multiple components are provided with the same name, then higher priority
2931
+ * components will be used instead of lower priority components.
2932
+ */
2933
+ priority?: number;
2934
+ /**
2935
+ * Path to component's declaration file
2936
+ * Used for type generation when different from filePath
2937
+ * @default filePath
2938
+ */
2939
+ declarationPath?: string;
2940
+ /**
2941
+ * Allow bypassing client/server transforms for internal Nuxt components like
2942
+ * ServerPlaceholder and NuxtClientFallback.
2943
+ *
2944
+ * @internal
2945
+ */
2946
+ _raw?: boolean;
2969
2947
  }
2970
- interface AppConfig {
2971
- [key: string]: unknown;
2948
+ interface ScanDir extends Omit<CompilerScanDir, "extensions"> {
2949
+ /**
2950
+ * Prefix all matched components.
2951
+ */
2952
+ prefix?: string;
2953
+ /**
2954
+ * Prefix component name by its path.
2955
+ */
2956
+ pathPrefix?: boolean;
2957
+ /**
2958
+ * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments.
2959
+ * Learn more on webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
2960
+ */
2961
+ prefetch?: boolean;
2962
+ /**
2963
+ * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments.
2964
+ * Learn more on webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
2965
+ */
2966
+ preload?: boolean;
2967
+ /**
2968
+ * This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not.
2969
+ */
2970
+ isAsync?: boolean;
2971
+ extendComponent?: (component: Component) => Promise<Component | void> | (Component | void);
2972
+ /**
2973
+ * If enabled, registers components to be globally available.
2974
+ *
2975
+ */
2976
+ global?: boolean;
2977
+ /**
2978
+ * If enabled, registers components as islands
2979
+ */
2980
+ island?: boolean;
2972
2981
  }
2973
- interface ViewTransitionOptions {
2974
- enabled: boolean | "always";
2975
- types?: string[];
2982
+ interface ComponentsDir extends ScanDir, AugmentProperty<Pick<CompilerScanDir, "extensions">, "extensions", VueExtension> {
2983
+ /**
2984
+ * Watch specified path for changes, including file additions and file deletions.
2985
+ */
2986
+ watch?: boolean;
2987
+ /**
2988
+ * Transpile specified path using build.transpile.
2989
+ * By default ('auto') it will set transpile: true if node_modules/ is in path.
2990
+ */
2991
+ transpile?: "auto" | boolean;
2992
+ /**
2993
+ * This number allows configuring the behavior of overriding Nuxt components.
2994
+ * It will be inherited by any components within the directory.
2995
+ *
2996
+ * If multiple components are provided with the same name, then higher priority
2997
+ * components will be used instead of lower priority components.
2998
+ */
2999
+ priority?: number;
2976
3000
  }
2977
- type ViewTransitionTypesFn = (to: RouteLocationNormalizedGeneric, from: RouteLocationNormalizedGeneric) => string[];
2978
- interface ViewTransitionPageOptions {
2979
- enabled?: boolean | "always";
2980
- types?: string[] | ViewTransitionTypesFn;
2981
- toTypes?: string[] | ViewTransitionTypesFn;
2982
- fromTypes?: string[] | ViewTransitionTypesFn;
3001
+ interface ComponentsOptions {
3002
+ dirs: (string | ComponentsDir)[];
3003
+ /**
3004
+ * The default value for whether to globally register components.
3005
+ *
3006
+ * When components are registered globally, they will still be directly imported where used,
3007
+ * but they can also be used dynamically, for example `<component :is="`icon-${myIcon}`">`.
3008
+ *
3009
+ * This can be overridden by an individual component directory entry.
3010
+ */
3011
+ global?: boolean;
3012
+ /**
3013
+ * Whether to write metadata to the build directory with information about the components that
3014
+ * are auto-registered in your app.
3015
+ */
3016
+ generateMetadata?: boolean;
3017
+ loader?: boolean;
3018
+ transform?: {
3019
+ exclude?: RegExp[];
3020
+ include?: RegExp[];
3021
+ };
2983
3022
  }
2984
3023
  //#endregion
2985
3024
  //#region src/config/index.d.ts
2986
3025
  declare const _default: InputObject;
2987
3026
  //#endregion
2988
- export { type AppConfig, type AppConfigInput, type AppHeadMetaObject, type Component, type ComponentMeta, type ComponentsDir, type ComponentsOptions, type ConfigSchema, type CustomAppConfig, type GenerateAppOptions, type HookResult, type ImportPresetWithDeprecation, type ImportsOptions, type KeyedFunction, type MetaObject, type MetaObjectRaw, type ModuleDefinition, type ModuleDependencies, type ModuleDependencyMeta, type ModuleMeta, type ModuleOptions, type ModuleSetupInstallResult, type ModuleSetupReturn, type Nuxt, type NuxtAnalyzeMeta, type NuxtApp, type NuxtAppConfig, type NuxtBuilder, type NuxtCompatibility, type NuxtCompatibilityIssue, type NuxtCompatibilityIssues, type NuxtConfig, type NuxtConfigLayer, _default as NuxtConfigSchema, type NuxtDebugContext, type NuxtDebugModuleMutationRecord, type NuxtDebugOptions, type NuxtHookName, type NuxtHooks, type NuxtLayout, type NuxtMiddleware, type NuxtModule, type NuxtOptions, type NuxtPage, type NuxtPlugin, type NuxtPluginTemplate, type NuxtServerTemplate, type NuxtTemplate, type NuxtTypeTemplate, type PublicRuntimeConfig, type ResolvedModuleOptions, type ResolvedNuxtTemplate, type RouterConfig, type RouterConfigSerializable, type RouterOptions, type RuntimeConfig, type RuntimeValue, type ScanDir, type SchemaDefinition, type TSReference, type UpperSnakeCase, type ViewTransitionOptions, type ViewTransitionPageOptions, type ViteConfig, type ViteOptions, type VueTSConfig, type WatchEvent };
3027
+ export { type AppConfig, type AppConfigInput, type AppHeadMetaObject, type CompilerScanDir, type Component, type ComponentMeta, type ComponentsDir, type ComponentsOptions, type ConfigSchema, type CustomAppConfig, type GenerateAppOptions, type HookResult, type ImportPresetWithDeprecation, type ImportsOptions, type KeyedFunction, type KeyedFunctionFactory, type MetaObject, type MetaObjectRaw, type ModuleDefinition, type ModuleDependencies, type ModuleDependencyMeta, type ModuleMeta, type ModuleOptions, type ModuleSetupInstallResult, type ModuleSetupReturn, type Nuxt, type NuxtAnalyzeMeta, type NuxtApp, type NuxtAppConfig, type NuxtBuilder, type NuxtCompatibility, type NuxtCompatibilityIssue, type NuxtCompatibilityIssues, type NuxtCompilerOptions, type NuxtConfig, type NuxtConfigLayer, _default as NuxtConfigSchema, type NuxtDebugContext, type NuxtDebugModuleMutationRecord, type NuxtDebugOptions, type NuxtHookName, type NuxtHooks, type NuxtLayout, type NuxtMiddleware, type NuxtModule, type NuxtOptions, type NuxtPage, type NuxtPlugin, type NuxtPluginTemplate, type NuxtServerTemplate, type NuxtTemplate, type NuxtTypeTemplate, type PublicRuntimeConfig, type ResolvedModuleOptions, type ResolvedNuxtTemplate, type RouterConfig, type RouterConfigSerializable, type RouterOptions, type RuntimeConfig, type RuntimeValue, type ScanDir, type SchemaDefinition, type TSReference, type UpperSnakeCase, type ViewTransitionOptions, type ViewTransitionPageOptions, type ViteConfig, type ViteOptions, type VueTSConfig, type WatchEvent };
package/dist/index.mjs CHANGED
@@ -236,6 +236,19 @@ var build_default = defineResolvers({
236
236
  },
237
237
  ...Array.isArray(val) ? val : []
238
238
  ].filter(Boolean) },
239
+ keyedComposableFactories: { $resolve: (val) => [
240
+ {
241
+ name: "createUseFetch",
242
+ source: "#app/composables/fetch",
243
+ argumentLength: 3
244
+ },
245
+ {
246
+ name: "createUseAsyncData",
247
+ source: "#app/composables/asyncData",
248
+ argumentLength: 3
249
+ },
250
+ ...Array.isArray(val) ? val : []
251
+ ].filter(Boolean) },
239
252
  treeShake: { composables: {
240
253
  server: { $resolve: async (val, get) => defu(typeof val === "object" ? val || {} : {}, await get("dev") ? {} : {
241
254
  "vue": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/schema-nightly",
3
- "version": "4.4.0-29554618.f8e243a5",
3
+ "version": "4.4.0-29555069.df7ef5d2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",