mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
refactor(nuxt): prefix all core modules with nuxt:
(#30028)
This commit is contained in:
parent
33789bec05
commit
8c956db866
@ -28,7 +28,7 @@ export type getComponentsT = (mode?: 'client' | 'server' | 'all') => Component[]
|
||||
|
||||
export default defineNuxtModule<ComponentsOptions>({
|
||||
meta: {
|
||||
name: 'components',
|
||||
name: 'nuxt:components',
|
||||
configKey: 'components',
|
||||
},
|
||||
defaults: {
|
||||
|
@ -16,7 +16,7 @@ import { createJiti } from 'jiti'
|
||||
|
||||
export default defineNuxtModule({
|
||||
meta: {
|
||||
name: 'nuxt-config-schema',
|
||||
name: 'nuxt:nuxt-config-schema',
|
||||
},
|
||||
async setup (_, nuxt) {
|
||||
const resolver = createResolver(import.meta.url)
|
||||
|
@ -177,7 +177,6 @@ export { }
|
||||
},
|
||||
}
|
||||
|
||||
const adHocModules = ['router', 'pages', 'imports', 'meta', 'components', 'nuxt-config-schema']
|
||||
const IMPORT_NAME_RE = /\.\w+$/
|
||||
const GIT_RE = /^git\+/
|
||||
export const schemaTemplate: NuxtTemplate = {
|
||||
@ -187,7 +186,7 @@ export const schemaTemplate: NuxtTemplate = {
|
||||
const getImportName = (name: string) => (name[0] === '.' ? './' + join(relativeRoot, name) : name).replace(IMPORT_NAME_RE, '')
|
||||
|
||||
const modules = nuxt.options._installedModules
|
||||
.filter(m => m.meta && m.meta.configKey && m.meta.name && !adHocModules.includes(m.meta.name))
|
||||
.filter(m => m.meta && m.meta.configKey && m.meta.name && !m.meta.name.startsWith('nuxt:') && m.meta.name !== 'nuxt-config-schema')
|
||||
.map(m => [genString(m.meta.configKey), getImportName(m.entryPath || m.meta.name), m] as const)
|
||||
|
||||
const privateRuntimeConfig = Object.create(null)
|
||||
|
@ -7,7 +7,7 @@ const components = ['NoScript', 'Link', 'Base', 'Title', 'Meta', 'Style', 'Head'
|
||||
|
||||
export default defineNuxtModule<NuxtOptions['unhead']>({
|
||||
meta: {
|
||||
name: 'meta',
|
||||
name: 'nuxt:meta',
|
||||
configKey: 'unhead',
|
||||
},
|
||||
async setup (options, nuxt) {
|
||||
|
@ -13,7 +13,7 @@ import { defaultPresets } from './presets'
|
||||
|
||||
export default defineNuxtModule<Partial<ImportsOptions>>({
|
||||
meta: {
|
||||
name: 'imports',
|
||||
name: 'nuxt:imports',
|
||||
configKey: 'imports',
|
||||
},
|
||||
defaults: nuxt => ({
|
||||
|
@ -23,7 +23,8 @@ const OPTIONAL_PARAM_RE = /^\/?:.*(?:\?|\(\.\*\)\*)$/
|
||||
|
||||
export default defineNuxtModule({
|
||||
meta: {
|
||||
name: 'pages',
|
||||
name: 'nuxt:pages',
|
||||
configKey: 'pages',
|
||||
},
|
||||
async setup (_options, nuxt) {
|
||||
const useExperimentalTypedPages = nuxt.options.experimental.typedPages
|
||||
|
Loading…
Reference in New Issue
Block a user