refactor(nuxt): prefix all core modules with nuxt: (#30028)

This commit is contained in:
Julien Huang 2024-12-09 13:38:25 +01:00 committed by GitHub
parent 33789bec05
commit 8c956db866
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 7 deletions

View File

@ -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: {

View File

@ -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)

View File

@ -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)

View File

@ -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) {

View File

@ -13,7 +13,7 @@ import { defaultPresets } from './presets'
export default defineNuxtModule<Partial<ImportsOptions>>({
meta: {
name: 'imports',
name: 'nuxt:imports',
configKey: 'imports',
},
defaults: nuxt => ({

View File

@ -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