refactor: rename options.layers to options._extends (#3109)

This commit is contained in:
pooya parsa 2022-02-07 19:44:48 +01:00 committed by GitHub
parent 29171bd105
commit c9c0171b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -37,8 +37,7 @@ export async function loadNuxtConfig (opts: LoadNuxtConfigOptions): Promise<Nuxt
nuxtConfig._nuxtConfigFile = configFile
nuxtConfig._nuxtConfigFiles = [configFile]
nuxtConfig.layers = layers
nuxtConfig._extends = layers
// Resolve and apply defaults
return applyDefaults(NuxtConfigSchema, nuxtConfig) as NuxtOptions

View File

@ -1,16 +1,15 @@
import { ConfigSchema } from '../../schema/config'
import type { ResolvedConfig } from 'c12'
/** Normalized Nuxt options available as `nuxt.options.*` */
export interface NuxtOptions extends ConfigSchema {
layers: ResolvedConfig<NuxtOptions>[]
}
type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> | T[P] } : T
/** User configuration in `nuxt.config` file */
export interface NuxtConfig extends DeepPartial<ConfigSchema> { }
/** Normalized Nuxt options available as `nuxt.options.*` */
export interface NuxtOptions extends ConfigSchema {
_extends: ResolvedConfig<NuxtConfig>[]
}
export interface PublicRuntimeConfig extends Record<string, any> { }
export interface PrivateRuntimeConfig extends PublicRuntimeConfig { }