@nuxt/kit-nightly 4.2.3-29422039.47e05245 → 4.2.3-29425455.7d502292

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,15 +1,13 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
1
  import { ModuleOptions, ModuleDefinition, NuxtModule, NuxtConfig, Nuxt, ModuleMeta, NuxtOptions, SchemaDefinition, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, Component, ComponentsDir, NuxtTemplate, NuxtMiddleware, NuxtHooks, NuxtPlugin, NuxtPluginTemplate, ResolvedNuxtTemplate, NuxtServerTemplate, NuxtTypeTemplate } from '@nuxt/schema';
3
2
  import { LoadConfigOptions } from 'c12';
4
3
  import { Import, InlinePreset } from 'unimport';
5
4
  import { WebpackPluginInstance, Configuration } from 'webpack';
6
5
  import { RspackPluginInstance } from '@rspack/core';
7
6
  import { Plugin, UserConfig } from 'vite';
8
- import * as unctx from 'unctx';
7
+ import { UseContext } from 'unctx';
9
8
  import { NitroRouteConfig, NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack/types';
10
9
  import { GlobOptions } from 'tinyglobby';
11
- import * as consola from 'consola';
12
- import { ConsolaOptions } from 'consola';
10
+ import { ConsolaInstance, ConsolaOptions } from 'consola';
13
11
 
14
12
  /**
15
13
  * Define a Nuxt module, automatically merging defaults with user provided options, installing
@@ -52,7 +50,7 @@ declare const normalizeModuleTranspilePath: (p: string) => string;
52
50
  */
53
51
  declare function hasNuxtModule(moduleName: string, nuxt?: Nuxt): boolean;
54
52
  /**
55
- * Checks if a Nuxt Module is compatible with a given semver version.
53
+ * Checks if a Nuxt module is compatible with a given semver version.
56
54
  */
57
55
  declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverVersion: string, nuxt?: Nuxt): Promise<boolean>;
58
56
  /**
@@ -111,7 +109,7 @@ interface LayerDirectories {
111
109
  * @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context.
112
110
  * @returns Array of LayerDirectories objects, ordered by priority (user layer first)
113
111
  */
114
- declare function getLayerDirectories(nuxt?: _nuxt_schema.Nuxt): LayerDirectories[];
112
+ declare function getLayerDirectories(nuxt?: Nuxt): LayerDirectories[];
115
113
 
116
114
  declare function setGlobalHead(head: NuxtAppConfig['head']): void;
117
115
 
@@ -178,20 +176,21 @@ interface ExtendViteConfigOptions extends Omit<ExtendConfigOptions, 'server' | '
178
176
  */
179
177
  client?: boolean;
180
178
  }
179
+ type ExtendWebpacklikeConfig = (fn: (config: Configuration) => void, options?: ExtendWebpackConfigOptions) => void;
181
180
  /**
182
181
  * Extend webpack config
183
182
  *
184
183
  * The fallback function might be called multiple times
185
184
  * when applying to both client and server builds.
186
185
  */
187
- declare const extendWebpackConfig: (fn: ((config: Configuration) => void), options?: ExtendWebpackConfigOptions) => void;
186
+ declare const extendWebpackConfig: ExtendWebpacklikeConfig;
188
187
  /**
189
188
  * Extend rspack config
190
189
  *
191
190
  * The fallback function might be called multiple times
192
191
  * when applying to both client and server builds.
193
192
  */
194
- declare const extendRspackConfig: (fn: ((config: Configuration) => void), options?: ExtendWebpackConfigOptions) => void;
193
+ declare const extendRspackConfig: ExtendWebpacklikeConfig;
195
194
  /**
196
195
  * Extend Vite config
197
196
  */
@@ -270,7 +269,7 @@ declare function addComponent(opts: AddComponentOptions): void;
270
269
  * Direct access to the Nuxt global context - see https://github.com/unjs/unctx.
271
270
  * @deprecated Use `getNuxtCtx` instead
272
271
  */
273
- declare const nuxtCtx: unctx.UseContext<Nuxt>;
272
+ declare const nuxtCtx: UseContext<Nuxt>;
274
273
  /** Direct access to the Nuxt context with asyncLocalStorage - see https://github.com/unjs/unctx. */
275
274
  declare const getNuxtCtx: () => Nuxt | null;
276
275
  /**
@@ -298,11 +297,11 @@ declare function useNuxt(): Nuxt;
298
297
  declare function tryUseNuxt(): Nuxt | null;
299
298
  declare function runWithNuxtContext<T extends (...args: any[]) => any>(nuxt: Nuxt, fn: T): ReturnType<T>;
300
299
 
301
- declare function createIsIgnored(nuxt?: _nuxt_schema.Nuxt | null): (pathname: string, stats?: unknown) => boolean;
300
+ declare function createIsIgnored(nuxt?: Nuxt | null | undefined): (pathname: string, stats?: unknown) => boolean;
302
301
  /**
303
302
  * Return a filter function to filter an array of paths
304
303
  */
305
- declare function isIgnored(pathname: string, _stats?: unknown, nuxt?: _nuxt_schema.Nuxt | null): boolean;
304
+ declare function isIgnored(pathname: string, _stats?: unknown, nuxt?: Nuxt | null | undefined): boolean;
306
305
  declare function resolveIgnorePatterns(relativePath?: string): string[];
307
306
 
308
307
  declare function addLayout(template: NuxtTemplate | string, name?: string): void;
@@ -509,11 +508,11 @@ declare function normalizeTemplate<T>(template: NuxtTemplate<T> | string, buildD
509
508
  */
510
509
  declare function updateTemplates(options?: {
511
510
  filter?: (template: ResolvedNuxtTemplate<any>) => boolean;
512
- }): Promise<any>;
511
+ }): Promise<void>;
513
512
  declare function writeTypes(nuxt: Nuxt): Promise<void>;
514
513
 
515
- declare const logger: consola.ConsolaInstance;
516
- declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): consola.ConsolaInstance;
514
+ declare const logger: ConsolaInstance;
515
+ declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): ConsolaInstance;
517
516
 
518
517
  interface ResolveModuleOptions {
519
518
  /** @deprecated use `url` with URLs pointing at a file - never a directory */
package/dist/index.d.ts CHANGED
@@ -1,15 +1,13 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
1
  import { ModuleOptions, ModuleDefinition, NuxtModule, NuxtConfig, Nuxt, ModuleMeta, NuxtOptions, SchemaDefinition, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, Component, ComponentsDir, NuxtTemplate, NuxtMiddleware, NuxtHooks, NuxtPlugin, NuxtPluginTemplate, ResolvedNuxtTemplate, NuxtServerTemplate, NuxtTypeTemplate } from '@nuxt/schema';
3
2
  import { LoadConfigOptions } from 'c12';
4
3
  import { Import, InlinePreset } from 'unimport';
5
4
  import { WebpackPluginInstance, Configuration } from 'webpack';
6
5
  import { RspackPluginInstance } from '@rspack/core';
7
6
  import { Plugin, UserConfig } from 'vite';
8
- import * as unctx from 'unctx';
7
+ import { UseContext } from 'unctx';
9
8
  import { NitroRouteConfig, NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack/types';
10
9
  import { GlobOptions } from 'tinyglobby';
11
- import * as consola from 'consola';
12
- import { ConsolaOptions } from 'consola';
10
+ import { ConsolaInstance, ConsolaOptions } from 'consola';
13
11
 
14
12
  /**
15
13
  * Define a Nuxt module, automatically merging defaults with user provided options, installing
@@ -52,7 +50,7 @@ declare const normalizeModuleTranspilePath: (p: string) => string;
52
50
  */
53
51
  declare function hasNuxtModule(moduleName: string, nuxt?: Nuxt): boolean;
54
52
  /**
55
- * Checks if a Nuxt Module is compatible with a given semver version.
53
+ * Checks if a Nuxt module is compatible with a given semver version.
56
54
  */
57
55
  declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverVersion: string, nuxt?: Nuxt): Promise<boolean>;
58
56
  /**
@@ -111,7 +109,7 @@ interface LayerDirectories {
111
109
  * @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context.
112
110
  * @returns Array of LayerDirectories objects, ordered by priority (user layer first)
113
111
  */
114
- declare function getLayerDirectories(nuxt?: _nuxt_schema.Nuxt): LayerDirectories[];
112
+ declare function getLayerDirectories(nuxt?: Nuxt): LayerDirectories[];
115
113
 
116
114
  declare function setGlobalHead(head: NuxtAppConfig['head']): void;
117
115
 
@@ -178,20 +176,21 @@ interface ExtendViteConfigOptions extends Omit<ExtendConfigOptions, 'server' | '
178
176
  */
179
177
  client?: boolean;
180
178
  }
179
+ type ExtendWebpacklikeConfig = (fn: (config: Configuration) => void, options?: ExtendWebpackConfigOptions) => void;
181
180
  /**
182
181
  * Extend webpack config
183
182
  *
184
183
  * The fallback function might be called multiple times
185
184
  * when applying to both client and server builds.
186
185
  */
187
- declare const extendWebpackConfig: (fn: ((config: Configuration) => void), options?: ExtendWebpackConfigOptions) => void;
186
+ declare const extendWebpackConfig: ExtendWebpacklikeConfig;
188
187
  /**
189
188
  * Extend rspack config
190
189
  *
191
190
  * The fallback function might be called multiple times
192
191
  * when applying to both client and server builds.
193
192
  */
194
- declare const extendRspackConfig: (fn: ((config: Configuration) => void), options?: ExtendWebpackConfigOptions) => void;
193
+ declare const extendRspackConfig: ExtendWebpacklikeConfig;
195
194
  /**
196
195
  * Extend Vite config
197
196
  */
@@ -270,7 +269,7 @@ declare function addComponent(opts: AddComponentOptions): void;
270
269
  * Direct access to the Nuxt global context - see https://github.com/unjs/unctx.
271
270
  * @deprecated Use `getNuxtCtx` instead
272
271
  */
273
- declare const nuxtCtx: unctx.UseContext<Nuxt>;
272
+ declare const nuxtCtx: UseContext<Nuxt>;
274
273
  /** Direct access to the Nuxt context with asyncLocalStorage - see https://github.com/unjs/unctx. */
275
274
  declare const getNuxtCtx: () => Nuxt | null;
276
275
  /**
@@ -298,11 +297,11 @@ declare function useNuxt(): Nuxt;
298
297
  declare function tryUseNuxt(): Nuxt | null;
299
298
  declare function runWithNuxtContext<T extends (...args: any[]) => any>(nuxt: Nuxt, fn: T): ReturnType<T>;
300
299
 
301
- declare function createIsIgnored(nuxt?: _nuxt_schema.Nuxt | null): (pathname: string, stats?: unknown) => boolean;
300
+ declare function createIsIgnored(nuxt?: Nuxt | null | undefined): (pathname: string, stats?: unknown) => boolean;
302
301
  /**
303
302
  * Return a filter function to filter an array of paths
304
303
  */
305
- declare function isIgnored(pathname: string, _stats?: unknown, nuxt?: _nuxt_schema.Nuxt | null): boolean;
304
+ declare function isIgnored(pathname: string, _stats?: unknown, nuxt?: Nuxt | null | undefined): boolean;
306
305
  declare function resolveIgnorePatterns(relativePath?: string): string[];
307
306
 
308
307
  declare function addLayout(template: NuxtTemplate | string, name?: string): void;
@@ -509,11 +508,11 @@ declare function normalizeTemplate<T>(template: NuxtTemplate<T> | string, buildD
509
508
  */
510
509
  declare function updateTemplates(options?: {
511
510
  filter?: (template: ResolvedNuxtTemplate<any>) => boolean;
512
- }): Promise<any>;
511
+ }): Promise<void>;
513
512
  declare function writeTypes(nuxt: Nuxt): Promise<void>;
514
513
 
515
- declare const logger: consola.ConsolaInstance;
516
- declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): consola.ConsolaInstance;
514
+ declare const logger: ConsolaInstance;
515
+ declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): ConsolaInstance;
517
516
 
518
517
  interface ResolveModuleOptions {
519
518
  /** @deprecated use `url` with URLs pointing at a file - never a directory */
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import { resolve, relative, join, dirname, normalize, isAbsolute, basename, pars
12
12
  import { createJiti } from 'jiti';
13
13
  import { parseNodeModulePath, interopDefault, lookupNodeModuleSubpath, resolveModuleExportNames } from 'mlly';
14
14
  import { resolveModulePath, resolveModuleURL } from 'exsolve';
15
- import { isRelative, withTrailingSlash as withTrailingSlash$2 } from 'ufo';
15
+ import { isRelative, withTrailingSlash as withTrailingSlash$2, withoutTrailingSlash } from 'ufo';
16
16
  import { read, update } from 'rc9';
17
17
  import semver, { gte } from 'semver';
18
18
  import { captureStackTrace } from 'errx';
@@ -887,7 +887,7 @@ async function loadNuxtConfig(opts) {
887
887
  const localLayers = (await glob("layers/*", {
888
888
  onlyDirectories: true,
889
889
  cwd: opts.cwd || process.cwd()
890
- })).map((d) => d.endsWith("/") ? d.substring(0, d.length - 1) : d).sort((a, b) => b.localeCompare(a));
890
+ })).map((d) => withTrailingSlash$2(d)).sort((a, b) => b.localeCompare(a));
891
891
  opts.overrides = defu$1(opts.overrides, { _extends: localLayers });
892
892
  const { configFile, layers = [], cwd, config: nuxtConfig, meta } = await withDefineNuxtConfig(
893
893
  () => loadConfig({
@@ -925,7 +925,7 @@ async function loadNuxtConfig(opts) {
925
925
  }
926
926
  const _layers = [];
927
927
  const processedLayers = /* @__PURE__ */ new Set();
928
- const localRelativePaths = new Set(localLayers);
928
+ const localRelativePaths = new Set(localLayers.map((layer) => withoutTrailingSlash(layer)));
929
929
  for (const layer of layers) {
930
930
  const resolvedRootDir = layer.config?.rootDir ?? layer.cwd;
931
931
  layer.config = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit-nightly",
3
- "version": "4.2.3-29422039.47e05245",
3
+ "version": "4.2.3-29425455.7d502292",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -45,7 +45,7 @@
45
45
  "untyped": "^2.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.3-29422039.47e05245",
48
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.3-29425455.7d502292",
49
49
  "@rspack/core": "1.6.7",
50
50
  "@types/semver": "7.7.1",
51
51
  "hookable": "5.5.3",
@@ -61,6 +61,7 @@
61
61
  },
62
62
  "_name": "@nuxt/kit",
63
63
  "scripts": {
64
+ "build:stub": "unbuild --stub",
64
65
  "test:attw": "attw --pack"
65
66
  }
66
67
  }