diff --git a/.eslintrc b/.eslintrc index ccc3ae8e4f..ab0d96eefd 100644 --- a/.eslintrc +++ b/.eslintrc @@ -24,6 +24,16 @@ "jsdoc/require-returns": "off", "jsdoc/require-param-type": "off", "no-redeclare": "off", + "import/order": [ + "error", { + "pathGroups": [ + { + "pattern": "@nuxt/test-utils", + "group": "external" + } + ] + } + ], "import/no-restricted-paths": [ "error", { diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 98aa03da49..ebfdd8c008 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,6 +17,7 @@ Please carefully read the contribution docs before creating a pull request - [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue) - [ ] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance) - [ ] โœจ New feature (a non-breaking change that adds functionality) +- [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries) - [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change) ### ๐Ÿ“š Description @@ -33,4 +34,3 @@ Please carefully read the contribution docs before creating a pull request - [ ] I have linked an issue or discussion. - [ ] I have updated the documentation accordingly. - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6726e35d44..9114eeb532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,6 +172,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - run: corepack enable - uses: actions/setup-node@v3 with: diff --git a/docs/1.getting-started/5.seo-meta.md b/docs/1.getting-started/5.seo-meta.md index 09c868aa54..c0e2ec533a 100644 --- a/docs/1.getting-started/5.seo-meta.md +++ b/docs/1.getting-started/5.seo-meta.md @@ -112,7 +112,7 @@ useServerSeoMeta({ ``` -::ReadMore{link="https://unhead.harlanzw.com/guide/guides/useseometa"} +::ReadMore{link="https://unhead.harlanzw.com/guide/composables/use-seo-meta"} :: ## Components diff --git a/docs/2.guide/2.directory-structure/1.modules.md b/docs/2.guide/2.directory-structure/1.modules.md new file mode 100644 index 0000000000..b2dbc75c24 --- /dev/null +++ b/docs/2.guide/2.directory-structure/1.modules.md @@ -0,0 +1,61 @@ +--- +navigation.icon: IconDirectory +title: 'modules' +head.title: 'modules/' +description: Use the modules/ directory to automatically register local modules within your application. +--- + +# Modules Directory + +::StabilityEdge + +Nuxt scans the `modules/` directory and loads them before starting. It is a good place to place any local modules you develop while building your application. + +The auto-registered files patterns are: +- `modules/*/index.ts` +- `modules/*.ts` + +You don't need to add those local modules to your [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt.config) separately. + +::code-group +```ts [modules/hello/index.ts] +// `nuxt/kit` is a helper subpath import you can use when defining local modules +// that means you do not need to add `@nuxt/kit` to your project's dependencies +import { createResolver, defineNuxtModule, addServerHandler } from 'nuxt/kit' + +export default defineNuxtModule({ + meta: { + name: 'hello' + }, + setup () { + const { resolve } = createResolver(import.meta.url) + + // Add an API route + addServerHandler({ + route: '/api/hello', + handler: resolve('./runtime/api-route') + }) + } +}) +``` +```ts [modules/hello/runtime/api-route.ts] +export default defineEventHandler(() => { + return { hello: 'world' } +} +``` +:: + +When starting Nuxt, the `hello` module will be registered and the `/api/hello` route will be available. + +The local modules are registered by alphabetical order. You can change the order by prefixing with a number if front of each directory: + +`ห‹`md +modules/ + 1.first-module/ + index.ts + 2.second-module.ts +ห‹`ห‹ + +:ReadMore{link="/docs/guide/going-further/modules"} + +:: diff --git a/docs/2.guide/3.going-further/1.internals.md b/docs/2.guide/3.going-further/1.internals.md index 2220aae10a..79b8ec1b72 100644 --- a/docs/2.guide/3.going-further/1.internals.md +++ b/docs/2.guide/3.going-further/1.internals.md @@ -70,6 +70,8 @@ const nuxtApp = { } ``` +:StabilityEdge{title="nuxtApp.versions"} + For more details, check out [the source code](https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/nuxt.ts). ## Runtime Context vs. Build Context diff --git a/docs/3.api/4.advanced/1.hooks.md b/docs/3.api/4.advanced/1.hooks.md index af93555a06..151446493d 100644 --- a/docs/3.api/4.advanced/1.hooks.md +++ b/docs/3.api/4.advanced/1.hooks.md @@ -38,7 +38,7 @@ Hook | Arguments | Description `kit:compatibility` | `compatibility, issues` | Allows extending compatibility checks. `ready` | `nuxt` | Called after Nuxt initialization, when the Nuxt instance is ready to work. `close` | `nuxt` | Called when Nuxt instance is gracefully closing. -`restart` | - | Called to restart the current Nuxt instance. **This hook is currently only available on the [Edge Channel](/docs/guide/going-further/edge-channel/).** +`restart` | `{ hard?: boolean }` | To be called to restart the current Nuxt instance. **This hook is currently only available on the [Edge Channel](/docs/guide/going-further/edge-channel/).** `modules:before` | - | Called during Nuxt initialization, before installing user modules. `modules:done` | - | Called during Nuxt initialization, after installing user modules. `app:resolve` | `app` | Called after resolving the `app` instance. diff --git a/docs/README.md b/docs/README.md index bd8432f899..18bc0d5ec4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,7 @@ +--- +navigation: false +--- + # Nuxt Docs This repository contains the documentation of Nuxt hosted on nuxt.com. diff --git a/package.json b/package.json index e6b0b2bff0..e246e6c781 100644 --- a/package.json +++ b/package.json @@ -49,15 +49,15 @@ "@nuxt/webpack-builder": "workspace:*", "@nuxtjs/eslint-config-typescript": "^12.0.0", "@types/crawler": "^1.2.2", - "@types/node": "^18.14.4", + "@types/node": "^18.14.6", "@types/rimraf": "^3", "@types/semver": "^7.3.13", "@unocss/reset": "^0.50.3", "case-police": "^0.5.13", - "changelogen": "^0.4.1", + "changelogen": "^0.5.1", "crawler": "^1.4.0", "eslint": "^8.35.0", - "eslint-plugin-jsdoc": "^40.0.0", + "eslint-plugin-jsdoc": "^40.0.1", "execa": "^7.0.0", "expect-type": "^0.15.0", "globby": "^13.1.3", @@ -67,7 +67,7 @@ "nuxt": "workspace:*", "ofetch": "^1.0.1", "pathe": "^1.1.0", - "rimraf": "^4.1.3", + "rimraf": "^4.3.0", "semver": "^7.3.8", "std-env": "^3.3.2", "typescript": "^4.9.5", diff --git a/packages/kit/src/compatibility.ts b/packages/kit/src/compatibility.ts index abd83a6653..98462f9db9 100644 --- a/packages/kit/src/compatibility.ts +++ b/packages/kit/src/compatibility.ts @@ -12,7 +12,7 @@ export async function checkNuxtCompatibility (constraints: NuxtCompatibility, nu if (constraints.nuxt) { const nuxtVersion = getNuxtVersion(nuxt) const nuxtSemanticVersion = nuxtVersion - .replace(/-[0-9]+\.[0-9a-f]{7,8}/, '') // Remove edge prefix + .replace(/-[0-9]+\.[0-9a-f]+/, '') // Remove edge prefix if (!satisfies(nuxtSemanticVersion, constraints.nuxt, { includePrerelease: true })) { issues.push({ name: 'nuxt', diff --git a/packages/nuxi/bin/nuxi.mjs b/packages/nuxi/bin/nuxi.mjs index b6bf5f6a68..8dcfc256bd 100755 --- a/packages/nuxi/bin/nuxi.mjs +++ b/packages/nuxi/bin/nuxi.mjs @@ -1,3 +1,2 @@ #!/usr/bin/env node -process._startTime = Date.now() -import('../dist/cli.mjs').then(r => (r.default || r).main()) +import('../dist/cli-wrapper.mjs') diff --git a/packages/nuxi/build.config.ts b/packages/nuxi/build.config.ts index 294834abe4..522086d61a 100644 --- a/packages/nuxi/build.config.ts +++ b/packages/nuxi/build.config.ts @@ -10,6 +10,8 @@ export default defineBuildConfig({ }, entries: [ 'src/cli', + 'src/cli-run', + 'src/cli-wrapper', 'src/index' ], externals: [ diff --git a/packages/nuxi/src/cli-run.ts b/packages/nuxi/src/cli-run.ts new file mode 100644 index 0000000000..07aef4afac --- /dev/null +++ b/packages/nuxi/src/cli-run.ts @@ -0,0 +1,5 @@ +// @ts-ignore +process._startTime = Date.now() + +// @ts-ignore +import('./cli').then(r => (r.default || r).main()) diff --git a/packages/nuxi/src/cli-wrapper.ts b/packages/nuxi/src/cli-wrapper.ts new file mode 100644 index 0000000000..66891d694d --- /dev/null +++ b/packages/nuxi/src/cli-wrapper.ts @@ -0,0 +1,39 @@ +/** + * This file is used to wrap the CLI entrypoint in a restartable process. + */ +import { fileURLToPath } from 'node:url' +import { fork } from 'node:child_process' +import type { ChildProcess } from 'node:child_process' + +const cliEntry = fileURLToPath(new URL('../dist/cli-run.mjs', import.meta.url)) + +// Only enable wrapper for nuxt dev command +if (process.argv[2] === 'dev') { + process.env.__CLI_ARGV__ = JSON.stringify(process.argv) + startSubprocess() +} else { + import(cliEntry) +} + +function startSubprocess () { + let childProc: ChildProcess + + process.on('exit', () => { + if (childProc) { + childProc.kill() + } + }) + + start() + + function start () { + childProc = fork(cliEntry) + childProc.on('close', (code) => { if (code) { process.exit(code) } }) + childProc.on('message', (message) => { + if ((message as { type: string })?.type === 'nuxt:restart') { + childProc.kill() + startSubprocess() + } + }) + } +} diff --git a/packages/nuxi/src/cli.ts b/packages/nuxi/src/cli.ts index 5f4023eeac..71a1dfc6e3 100755 --- a/packages/nuxi/src/cli.ts +++ b/packages/nuxi/src/cli.ts @@ -9,7 +9,7 @@ import { showHelp } from './utils/help' import { showBanner } from './utils/banner' async function _main () { - const _argv = process.argv.slice(2) + const _argv = (process.env.__CLI_ARGV__ ? JSON.parse(process.env.__CLI_ARGV__) : process.argv).slice(2) const args = mri(_argv, { boolean: [ 'no-clear' diff --git a/packages/nuxi/src/commands/dev.ts b/packages/nuxi/src/commands/dev.ts index 93c3a6de93..a656a873c9 100644 --- a/packages/nuxi/src/commands/dev.ts +++ b/packages/nuxi/src/commands/dev.ts @@ -94,7 +94,18 @@ export default defineNuxtCommand({ } currentNuxt = await loadNuxt({ rootDir, dev: true, ready: false }) - currentNuxt.hooks.hookOnce('restart', () => load(true)) + + currentNuxt.hooks.hookOnce('restart', async (options) => { + if (options?.hard && process.send) { + await listener.close().catch(() => {}) + await currentNuxt.close().catch(() => {}) + await watcher.close().catch(() => {}) + await distWatcher.close().catch(() => {}) + process.send({ type: 'nuxt:restart' }) + } else { + await load(true) + } + }) if (!isRestart) { showURL() @@ -117,7 +128,7 @@ export default defineNuxtCommand({ await currentNuxt.ready() await currentNuxt.hooks.callHook('listen', listener.server, listener) - const address = listener.server.address() as AddressInfo + const address = (listener.server.address() || {}) as AddressInfo currentNuxt.options.devServer.url = listener.url currentNuxt.options.devServer.port = address.port currentNuxt.options.devServer.host = address.address diff --git a/packages/nuxt/kit.d.ts b/packages/nuxt/kit.d.ts new file mode 100644 index 0000000000..4625be9a95 --- /dev/null +++ b/packages/nuxt/kit.d.ts @@ -0,0 +1 @@ +export * from '@nuxt/kit' diff --git a/packages/nuxt/kit.mjs b/packages/nuxt/kit.mjs new file mode 100644 index 0000000000..4625be9a95 --- /dev/null +++ b/packages/nuxt/kit.mjs @@ -0,0 +1 @@ +export * from '@nuxt/kit' diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 82ec4f66bd..9a74c2b473 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -21,6 +21,10 @@ "types": "./schema.d.ts", "import": "./schema.mjs" }, + "./kit": { + "types": "./kit.d.ts", + "import": "./kit.mjs" + }, "./app": "./dist/app/index.mjs", "./package.json": "./package.json" }, @@ -35,6 +39,7 @@ "types.d.ts", "dist", "config.*", + "kit.*", "schema.*" ], "scripts": { @@ -47,10 +52,10 @@ "@nuxt/telemetry": "^2.1.10", "@nuxt/ui-templates": "^1.1.1", "@nuxt/vite-builder": "3.2.3", - "@unhead/ssr": "^1.1.14", + "@unhead/ssr": "^1.1.16", "@vue/reactivity": "^3.2.47", "@vue/shared": "^3.2.47", - "@vueuse/head": "^1.1.9", + "@vueuse/head": "^1.1.15", "chokidar": "^3.5.3", "cookie-es": "^0.5.0", "defu": "^6.1.2", @@ -77,7 +82,7 @@ "ufo": "^1.1.1", "unctx": "^2.1.2", "unenv": "^1.2.1", - "unhead": "^1.1.14", + "unhead": "^1.1.16", "unimport": "^3.0.2", "unplugin": "^1.1.0", "untyped": "^1.2.2", diff --git a/packages/nuxt/src/app/composables/router.ts b/packages/nuxt/src/app/composables/router.ts index 6f61e55ad1..8650778a99 100644 --- a/packages/nuxt/src/app/composables/router.ts +++ b/packages/nuxt/src/app/composables/router.ts @@ -142,7 +142,7 @@ export const setPageLayout = (layout: string) => { useState('_layout').value = layout } const nuxtApp = useNuxtApp() - if (process.dev && nuxtApp.isHydrating && useState('_layout').value !== layout) { + if (process.dev && nuxtApp.isHydrating && nuxtApp.payload.serverRendered && useState('_layout').value !== layout) { console.warn('[warn] [nuxt] `setPageLayout` should not be called to change the layout during hydration as this will cause hydration errors.') } const inMiddleware = isProcessingMiddleware() diff --git a/packages/nuxt/src/app/config.ts b/packages/nuxt/src/app/config.ts index 0c3dd95baa..99eddf85a9 100644 --- a/packages/nuxt/src/app/config.ts +++ b/packages/nuxt/src/app/config.ts @@ -65,7 +65,7 @@ if (process.dev) { // Vite if (import.meta.hot) { import.meta.hot.accept((newModule) => { - const newConfig = newModule._getAppConfig() + const newConfig = newModule?._getAppConfig() applyHMR(newConfig) }) } diff --git a/packages/nuxt/src/components/module.ts b/packages/nuxt/src/components/module.ts index afc7047f43..71472e66d6 100644 --- a/packages/nuxt/src/components/module.ts +++ b/packages/nuxt/src/components/module.ts @@ -202,6 +202,7 @@ export default defineNuxtModule({ sourcemap: nuxt.options.sourcemap[mode], getComponents, mode, + transform: typeof nuxt.options.components === 'object' && !Array.isArray(nuxt.options.components) ? nuxt.options.components.transform : undefined, experimentalComponentIslands: nuxt.options.experimental.componentIslands })) }) @@ -219,6 +220,7 @@ export default defineNuxtModule({ sourcemap: nuxt.options.sourcemap[mode], getComponents, mode, + transform: typeof nuxt.options.components === 'object' && !Array.isArray(nuxt.options.components) ? nuxt.options.components.transform : undefined, experimentalComponentIslands: nuxt.options.experimental.componentIslands })) }) diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 3fd4365507..1b86ea03bb 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -1,7 +1,7 @@ -import { join, normalize, resolve } from 'pathe' +import { join, normalize, relative, resolve } from 'pathe' import { createHooks, createDebugger } from 'hookable' import type { LoadNuxtOptions } from '@nuxt/kit' -import { loadNuxtConfig, nuxtCtx, installModule, addComponent, addVitePlugin, addWebpackPlugin, tryResolveModule, addPlugin } from '@nuxt/kit' +import { resolvePath, resolveAlias, resolveFiles, loadNuxtConfig, nuxtCtx, installModule, addComponent, addVitePlugin, addWebpackPlugin, tryResolveModule, addPlugin } from '@nuxt/kit' import escapeRE from 'escape-string-regexp' import fse from 'fs-extra' @@ -122,10 +122,38 @@ async function initNuxt (nuxt: Nuxt) { // Init user modules await nuxt.callHook('modules:before') - const modulesToInstall = [ - ...nuxt.options.modules, - ...nuxt.options._modules - ] + const modulesToInstall = [] + + const watchedPaths = new Set() + const specifiedModules = new Set() + + for (const _mod of nuxt.options.modules) { + const mod = Array.isArray(_mod) ? _mod[0] : _mod + if (typeof mod !== 'string') { continue } + const modPath = await resolvePath(resolveAlias(mod)) + specifiedModules.add(modPath) + } + + // Automatically register user modules + for (const config of nuxt.options._layers.map(layer => layer.config).reverse()) { + const layerModules = await resolveFiles(config.srcDir, [ + `${config.dir?.modules || 'modules'}/*{${nuxt.options.extensions.join(',')}}`, + `${config.dir?.modules || 'modules'}/*/index{${nuxt.options.extensions.join(',')}}` + ]) + for (const mod of layerModules) { + watchedPaths.add(relative(config.srcDir, mod)) + if (specifiedModules.has(mod)) { continue } + specifiedModules.add(mod) + modulesToInstall.push(mod) + } + } + + // Register user and then ad-hoc modules + modulesToInstall.push(...nuxt.options.modules, ...nuxt.options._modules) + + nuxt.hooks.hookOnce('builder:watch', (event, path) => { + if (watchedPaths.has(path)) { nuxt.callHook('restart', { hard: true }) } + }) // Add addComponent({ diff --git a/packages/nuxt/src/core/schema.ts b/packages/nuxt/src/core/schema.ts index 4544bfe920..77fa41f094 100644 --- a/packages/nuxt/src/core/schema.ts +++ b/packages/nuxt/src/core/schema.ts @@ -1,5 +1,5 @@ import { existsSync } from 'node:fs' -import { writeFile, mkdir, rm } from 'node:fs/promises' +import { writeFile, mkdir } from 'node:fs/promises' import { dirname, resolve } from 'pathe' import chokidar from 'chokidar' import { defu } from 'defu' @@ -7,7 +7,6 @@ import { debounce } from 'perfect-debounce' import { defineNuxtModule, createResolver } from '@nuxt/kit' import { resolveSchema as resolveUntypedSchema, - generateMarkdown, generateTypes } from 'untyped' import type { Schema, SchemaDefinition } from 'untyped' @@ -39,9 +38,14 @@ export default defineNuxtModule({ }) // Register module types - nuxt.hook('prepare:types', (ctx) => { + nuxt.hook('prepare:types', async (ctx) => { ctx.references.push({ path: 'nuxt-config-schema' }) ctx.references.push({ path: 'schema/nuxt.schema.d.ts' }) + if (nuxt.options._prepare) { + await nuxt.hooks.callHook('schema:beforeWrite', schema) + await writeSchema(schema) + await nuxt.hooks.callHook('schema:written') + } }) // Resolve schema after all modules initialized @@ -122,13 +126,6 @@ export default defineNuxtModule({ } async function writeSchema (schema: Schema) { - // Avoid writing empty schema - const isEmptySchema = !schema.properties || Object.keys(schema.properties).length === 0 - if (isEmptySchema) { - await rm(resolve(nuxt.options.buildDir, 'schema'), { recursive: true }).catch(() => { }) - return - } - // Write it to build dir await mkdir(resolve(nuxt.options.buildDir, 'schema'), { recursive: true }) await writeFile( @@ -136,12 +133,6 @@ export default defineNuxtModule({ JSON.stringify(schema, null, 2), 'utf8' ) - const markdown = '# Nuxt Custom Config Schema' + generateMarkdown(schema) - await writeFile( - resolve(nuxt.options.buildDir, 'schema/nuxt.schema.md'), - markdown, - 'utf8' - ) const _types = generateTypes(schema, { addExport: true, interfaceName: 'NuxtCustomSchema', @@ -152,12 +143,18 @@ export default defineNuxtModule({ ` export type CustomAppConfig = Exclude +declare module '@nuxt/schema' { + interface NuxtConfig extends NuxtCustomSchema {} + interface NuxtOptions extends NuxtCustomSchema {} + interface CustomAppConfig extends CustomAppConfig {} +} + declare module 'nuxt/schema' { interface NuxtConfig extends NuxtCustomSchema {} interface NuxtOptions extends NuxtCustomSchema {} - interface AppConfigInput extends CustomAppConfig {} - interface AppConfig extends CustomAppConfig {} -}` + interface CustomAppConfig extends CustomAppConfig {} +} +` const typesPath = resolve( nuxt.options.buildDir, 'schema/nuxt.schema.d.ts' diff --git a/packages/nuxt/src/pages/module.ts b/packages/nuxt/src/pages/module.ts index f7e85439ab..46fa4cc62d 100644 --- a/packages/nuxt/src/pages/module.ts +++ b/packages/nuxt/src/pages/module.ts @@ -146,9 +146,11 @@ export default defineNuxtModule({ // Add router plugin addPlugin(resolve(runtimeDir, 'plugins/router')) - const getSources = (pages: NuxtPage[]): string[] => pages.flatMap(p => - [relative(nuxt.options.srcDir, p.file), ...getSources(p.children || [])] - ) + const getSources = (pages: NuxtPage[]): string[] => pages + .filter(p => Boolean(p.file)) + .flatMap(p => + [relative(nuxt.options.srcDir, p.file as string), ...getSources(p.children || [])] + ) // Do not prefetch page chunks nuxt.hook('build:manifest', async (manifest) => { diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 946b67b5b0..66070c53e3 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -249,28 +249,40 @@ export function normalizeRoutes (routes: NuxtPage[], metaImports: Set = return { imports: metaImports, routes: genArrayFromRaw(routes.map((page) => { + const route = Object.fromEntries( + Object.entries(page) + .filter(([key, value]) => key !== 'file' && (Array.isArray(value) ? value.length : value)) + .map(([key, value]) => [key, JSON.stringify(value)]) + ) as Record, string> & { component?: string } + + if (page.children?.length) { + route.children = normalizeRoutes(page.children, metaImports).routes + } + + // Without a file, we can't use `definePageMeta` to extract route-level meta from the file + if (!page.file) { + for (const key of ['name', 'path', 'meta', 'alias', 'redirect'] as const) { + if (page[key]) { route[key] = JSON.stringify(page[key]) } + } + return route + } + const file = normalize(page.file) const metaImportName = genSafeVariableName(filename(file) + hash(file)) + 'Meta' metaImports.add(genImport(`${file}?macro=true`, [{ name: 'default', as: metaImportName }])) let aliasCode = `${metaImportName}?.alias || []` - if (Array.isArray(page.alias) && page.alias.length) { - aliasCode = `${JSON.stringify(page.alias)}.concat(${aliasCode})` + const alias = Array.isArray(page.alias) ? page.alias : [page.alias].filter(Boolean) + if (alias.length) { + aliasCode = `${JSON.stringify(alias)}.concat(${aliasCode})` } - const route = { - ...Object.fromEntries(Object.entries(page).map(([key, value]) => [key, JSON.stringify(value)])), - file: undefined, - name: `${metaImportName}?.name ?? ${page.name ? JSON.stringify(page.name) : 'undefined'}`, - path: `${metaImportName}?.path ?? ${JSON.stringify(page.path)}`, - children: page.children ? normalizeRoutes(page.children, metaImports).routes : [], - meta: page.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(page.meta)}}` : `${metaImportName} || {}`, - alias: aliasCode, - redirect: page.redirect ? JSON.stringify(page.redirect) : `${metaImportName}?.redirect || undefined`, - component: genDynamicImport(file, { interopDefault: true }) - } - - delete route.file + route.name = `${metaImportName}?.name ?? ${page.name ? JSON.stringify(page.name) : 'undefined'}` + route.path = `${metaImportName}?.path ?? ${JSON.stringify(page.path)}` + route.meta = page.meta && Object.values(page.meta).filter(value => value !== undefined).length ? `{...(${metaImportName} || {}), ...${JSON.stringify(page.meta)}}` : `${metaImportName} || {}` + route.alias = aliasCode + route.redirect = page.redirect ? JSON.stringify(page.redirect) : `${metaImportName}?.redirect || undefined` + route.component = genDynamicImport(file, { interopDefault: true }) return route })) diff --git a/packages/schema/package.json b/packages/schema/package.json index b1f98f03ac..e0ca4fe48d 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@types/lodash.template": "^4", "@types/semver": "^7.3.13", - "@unhead/schema": "^1.1.14", + "@unhead/schema": "^1.1.16", "@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue-jsx": "^3.0.0", "nitropack": "^2.2.3", diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 97ebd5520e..cda2f8b736 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -219,6 +219,11 @@ export default defineUntypedSchema({ */ middleware: 'middleware', + /** + * The modules directory, each file in which will be auto-registered as a Nuxt module. + */ + modules: 'modules', + /** * The directory which will be processed to auto-generate your application page routes. */ diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index 00694d45ac..112233deab 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -115,10 +115,10 @@ export default defineUntypedSchema({ componentIslands: false, /** - * Enable experimental config schema support + * Config schema support * * @see https://github.com/nuxt/nuxt/issues/15592 */ - configSchema: false + configSchema: true } }) diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index 6dbe9919a3..9935128c2f 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -22,7 +22,7 @@ export default defineUntypedSchema({ * * @experimental This is an experimental feature and API may change in the future. * - * @see https://nitro.unjs.io/config/#routes + * @see https://nitro.unjs.io/config/#routerules * * @type {typeof import('nitropack')['NitroConfig']['routeRules']} */ diff --git a/packages/schema/src/types/config.ts b/packages/schema/src/types/config.ts index ed9827f875..9bc2602e17 100644 --- a/packages/schema/src/types/config.ts +++ b/packages/schema/src/types/config.ts @@ -135,7 +135,10 @@ export interface RuntimeConfig extends RuntimeConfigNamespace { } // -- App Config -- -export interface AppConfigInput extends Record { + +export interface CustomAppConfig extends Record { } + +export interface AppConfigInput extends CustomAppConfig { /** @deprecated reserved */ private?: never /** @deprecated reserved */ @@ -153,4 +156,4 @@ export interface NuxtAppConfig { keepalive: boolean | KeepAliveProps } -export interface AppConfig { } +export interface AppConfig extends CustomAppConfig { } diff --git a/packages/schema/src/types/global/vite.ts b/packages/schema/src/types/global/vite.ts index 18979845e3..58199475b9 100644 --- a/packages/schema/src/types/global/vite.ts +++ b/packages/schema/src/types/global/vite.ts @@ -1,35 +1,134 @@ /** * Reference: https://github.com/vitejs/vite/blob/main/packages/vite/types/importMeta.d.ts */ +export type ModuleNamespace = Record & { + [Symbol.toStringTag]: 'Module' +} export interface ViteHot { readonly data: any accept (): void - accept (cb: (mod: any) => void): void - accept (dep: string, cb: (mod: any) => void): void - accept (deps: readonly string[], cb: (mods: any[]) => void): void + accept (cb: (mod: ModuleNamespace | undefined) => void): void + accept (dep: string, cb: (mod: ModuleNamespace | undefined) => void): void + accept (deps: readonly string[], cb: (mods: Array) => void): void + acceptExports (exportNames: string | readonly string[], cb?: (mod: ModuleNamespace | undefined) => void): void dispose (cb: (data: any) => void): void - decline (): void - invalidate (): void + prune (cb: (data: any) => void): void + invalidate (message?: string): void on (event: any, cb: (payload: any) => void): void send (event: any, data?: any): void } -export interface ViteGlobOptions { - as?: string - eager?: boolean +export interface KnownAsTypeMap { + raw: string + url: string + worker: Worker +} + +export interface ImportGlobOptions< + Eager extends boolean, + AsType extends string +> { + /** + * Import type for the import url. + */ + as?: AsType + /** + * Import as static or dynamic + * + * @default false + */ + eager?: Eager + /** + * Import only the specific named export. Set to `default` to import the default export. + */ import?: string + /** + * Custom queries + */ query?: string | Record + /** + * Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance. + * + * @default false + */ exhaustive?: boolean } +export interface ImportGlobFunction { + /** + * Import a list of files with a glob pattern. + * + * Overload 1: No generic provided, infer the type from `eager` and `as` + */ + < + Eager extends boolean, + As extends string, + T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown + >( + glob: string | string[], + options?: ImportGlobOptions + ): (Eager extends true + ? true + : false) extends true + ? Record + : Record Promise> + /** + * Import a list of files with a glob pattern. + * + * Overload 2: Module generic provided, infer the type from `eager: false` + */ + ( + glob: string | string[], + options?: ImportGlobOptions + ): Record Promise> + /** + * Import a list of files with a glob pattern. + * + * Overload 3: Module generic provided, infer the type from `eager: true` + */ + ( + glob: string | string[], + options: ImportGlobOptions + ): Record +} + +export interface ImportGlobEagerFunction { + /** + * Eagerly import a list of files with a glob pattern. + * + * Overload 1: No generic provided, infer the type from `as` + */ + < + As extends string, + T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown + >( + glob: string | string[], + options?: Omit, 'eager'> + ): Record + /** + * Eagerly import a list of files with a glob pattern. + * + * Overload 2: Module generic provided + */ + ( + glob: string | string[], + options?: Omit, 'eager'> + ): Record +} + export interface ViteImportMeta { /** Vite client HMR API - see https://vitejs.dev/guide/api-hmr.html */ readonly hot?: ViteHot /** vite glob import utility - https://vitejs.dev/guide/features.html#glob-import */ - glob (glob: string | string[], options?: ViteGlobOptions): Record Promise>> + glob: ImportGlobFunction + + /** + * @deprecated Use `import.meta.glob('*', { eager: true })` instead + */ + globEager: ImportGlobEagerFunction } diff --git a/packages/schema/src/types/hooks.ts b/packages/schema/src/types/hooks.ts index 566b89042b..4148bf6acc 100644 --- a/packages/schema/src/types/hooks.ts +++ b/packages/schema/src/types/hooks.ts @@ -22,7 +22,7 @@ export type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir' export type NuxtPage = { name?: string path: string - file: string + file?: string meta?: Record alias?: string[] | string redirect?: string @@ -77,7 +77,12 @@ export interface NuxtHooks { * Called to restart the current Nuxt instance. * @returns Promise */ - 'restart': () => HookResult + 'restart': (options?: { + /** + * Try to restart the whole process if supported + */ + hard?: boolean + }) => HookResult /** * Called during Nuxt initialization, before installing user modules. diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 9722c1755a..3b2249fdae 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -24,7 +24,7 @@ "pathe": "^1.1.0" }, "devDependencies": { - "playwright": "^1.31.1", + "playwright": "^1.31.2", "unbuild": "latest", "vitest": "^0.29.2" }, diff --git a/packages/vite/package.json b/packages/vite/package.json index 64f01cd6d1..e404a9ece9 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -27,7 +27,7 @@ "chokidar": "^3.5.3", "cssnano": "^5.1.15", "defu": "^6.1.2", - "esbuild": "^0.17.10", + "esbuild": "^0.17.11", "escape-string-regexp": "^5.0.0", "estree-walker": "^3.0.3", "externality": "^1.0.0", diff --git a/packages/vite/src/vite.ts b/packages/vite/src/vite.ts index 4797ec4090..e3bcd17d14 100644 --- a/packages/vite/src/vite.ts +++ b/packages/vite/src/vite.ts @@ -64,6 +64,9 @@ export async function bundle (nuxt: Nuxt) { copyPublicDir: false, rollupOptions: { output: { + sourcemapIgnoreList: (relativeSourcePath) => { + return relativeSourcePath.includes('node_modules') || relativeSourcePath.includes(ctx.nuxt.options.buildDir) + }, sanitizeFileName: sanitizeFilePath, // https://github.com/vitejs/vite/tree/main/packages/vite/src/node/build.ts#L464-L478 assetFileNames: nuxt.options.dev diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d9aae88774..1c45f36448 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,15 +26,15 @@ importers: '@nuxt/webpack-builder': workspace:* '@nuxtjs/eslint-config-typescript': ^12.0.0 '@types/crawler': ^1.2.2 - '@types/node': ^18.14.4 + '@types/node': ^18.14.6 '@types/rimraf': ^3 '@types/semver': ^7.3.13 '@unocss/reset': ^0.50.3 case-police: ^0.5.13 - changelogen: ^0.4.1 + changelogen: ^0.5.1 crawler: ^1.4.0 eslint: ^8.35.0 - eslint-plugin-jsdoc: ^40.0.0 + eslint-plugin-jsdoc: ^40.0.1 execa: ^7.0.0 expect-type: ^0.15.0 globby: ^13.1.3 @@ -44,7 +44,7 @@ importers: nuxt: workspace:* ofetch: ^1.0.1 pathe: ^1.1.0 - rimraf: ^4.1.3 + rimraf: ^4.3.0 semver: ^7.3.8 std-env: ^3.3.2 typescript: ^4.9.5 @@ -62,15 +62,15 @@ importers: '@nuxt/webpack-builder': link:packages/webpack '@nuxtjs/eslint-config-typescript': 12.0.0_ycpbpc6yetojsgtrx3mwntkhsu '@types/crawler': 1.2.2 - '@types/node': 18.14.4 + '@types/node': 18.14.6 '@types/rimraf': 3.0.2 '@types/semver': 7.3.13 '@unocss/reset': 0.50.3 case-police: 0.5.13 - changelogen: 0.4.1 + changelogen: 0.5.1 crawler: 1.4.0 eslint: 8.35.0 - eslint-plugin-jsdoc: 40.0.0_eslint@8.35.0 + eslint-plugin-jsdoc: 40.0.1_eslint@8.35.0 execa: 7.0.0 expect-type: 0.15.0 globby: 13.1.3 @@ -80,13 +80,13 @@ importers: nuxt: link:packages/nuxt ofetch: 1.0.1 pathe: 1.1.0 - rimraf: 4.1.3 + rimraf: 4.3.0 semver: 7.3.8 std-env: 3.3.2 typescript: 4.9.5 ufo: 1.1.1 unbuild: 1.1.2 - vite: 4.1.4_@types+node@18.14.4 + vite: 4.1.4_@types+node@18.14.6 vitest: 0.29.2 vue-tsc: 1.2.0_typescript@4.9.5 @@ -418,10 +418,10 @@ importers: '@nuxt/vite-builder': workspace:* '@types/fs-extra': ^11.0.1 '@types/hash-sum': ^1.0.0 - '@unhead/ssr': ^1.1.14 + '@unhead/ssr': ^1.1.16 '@vue/reactivity': ^3.2.47 '@vue/shared': ^3.2.47 - '@vueuse/head': ^1.1.9 + '@vueuse/head': ^1.1.15 chokidar: ^3.5.3 cookie-es: ^0.5.0 defu: ^6.1.2 @@ -449,7 +449,7 @@ importers: unbuild: ^1.1.2 unctx: ^2.1.2 unenv: ^1.2.1 - unhead: ^1.1.14 + unhead: ^1.1.16 unimport: ^3.0.2 unplugin: ^1.1.0 untyped: ^1.2.2 @@ -464,10 +464,10 @@ importers: '@nuxt/telemetry': 2.1.10 '@nuxt/ui-templates': 1.1.1 '@nuxt/vite-builder': link:../vite - '@unhead/ssr': 1.1.14 + '@unhead/ssr': 1.1.16 '@vue/reactivity': 3.2.47 '@vue/shared': 3.2.47 - '@vueuse/head': 1.1.9_vue@3.2.47 + '@vueuse/head': 1.1.15_vue@3.2.47 chokidar: 3.5.3 cookie-es: 0.5.0 defu: 6.1.2 @@ -494,7 +494,7 @@ importers: ufo: 1.1.1 unctx: 2.1.2 unenv: 1.2.1 - unhead: 1.1.14 + unhead: 1.1.16 unimport: 3.0.2 unplugin: 1.1.0 untyped: 1.2.2 @@ -511,7 +511,7 @@ importers: specifiers: '@types/lodash.template': ^4 '@types/semver': ^7.3.13 - '@unhead/schema': ^1.1.14 + '@unhead/schema': ^1.1.16 '@vitejs/plugin-vue': ^4.0.0 '@vitejs/plugin-vue-jsx': ^3.0.0 c12: ^1.1.2 @@ -547,7 +547,7 @@ importers: devDependencies: '@types/lodash.template': 4.5.1 '@types/semver': 7.3.13 - '@unhead/schema': 1.1.14 + '@unhead/schema': 1.1.16 '@vitejs/plugin-vue': 4.0.0_vite@4.1.4 '@vitejs/plugin-vue-jsx': 3.0.0_vite@4.1.4 nitropack: 2.2.3 @@ -565,7 +565,7 @@ importers: jiti: ^1.17.1 ofetch: ^1.0.1 pathe: ^1.1.0 - playwright: ^1.31.1 + playwright: ^1.31.2 unbuild: ^1.1.2 vitest: ^0.29.2 dependencies: @@ -579,7 +579,7 @@ importers: ofetch: 1.0.1 pathe: 1.1.0 devDependencies: - playwright: 1.31.1 + playwright: 1.31.2 unbuild: 1.1.2 vitest: 0.29.2 @@ -595,7 +595,7 @@ importers: chokidar: ^3.5.3 cssnano: ^5.1.15 defu: ^6.1.2 - esbuild: ^0.17.10 + esbuild: ^0.17.11 escape-string-regexp: ^5.0.0 estree-walker: ^3.0.3 externality: ^1.0.0 @@ -632,7 +632,7 @@ importers: chokidar: 3.5.3 cssnano: 5.1.15_postcss@8.4.21 defu: 6.1.2 - esbuild: 0.17.10 + esbuild: 0.17.11 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 externality: 1.0.0 @@ -1103,8 +1103,8 @@ packages: requiresBuild: true optional: true - /@esbuild/android-arm/0.17.10: - resolution: {integrity: sha512-7YEBfZ5lSem9Tqpsz+tjbdsEshlO9j/REJrfv4DXgKTt1+/MHqGwbtlyxQuaSlMeUZLxUKBaX8wdzlTfHkmnLw==} + /@esbuild/android-arm/0.17.11: + resolution: {integrity: sha512-CdyX6sRVh1NzFCsf5vw3kULwlAhfy9wVt8SZlrhQ7eL2qBjGbFhRBWkkAzuZm9IIEOCKJw4DXA6R85g+qc8RDw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1119,8 +1119,8 @@ packages: requiresBuild: true optional: true - /@esbuild/android-arm64/0.17.10: - resolution: {integrity: sha512-ht1P9CmvrPF5yKDtyC+z43RczVs4rrHpRqrmIuoSvSdn44Fs1n6DGlpZKdK6rM83pFLbVaSUwle8IN+TPmkv7g==} + /@esbuild/android-arm64/0.17.11: + resolution: {integrity: sha512-QnK4d/zhVTuV4/pRM4HUjcsbl43POALU2zvBynmrrqZt9LPcLA3x1fTZPBg2RRguBQnJcnU059yKr+bydkntjg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1135,8 +1135,8 @@ packages: requiresBuild: true optional: true - /@esbuild/android-x64/0.17.10: - resolution: {integrity: sha512-CYzrm+hTiY5QICji64aJ/xKdN70IK8XZ6iiyq0tZkd3tfnwwSWTYH1t3m6zyaaBxkuj40kxgMyj1km/NqdjQZA==} + /@esbuild/android-x64/0.17.11: + resolution: {integrity: sha512-3PL3HKtsDIXGQcSCKtWD/dy+mgc4p2Tvo2qKgKHj9Yf+eniwFnuoQ0OUhlSfAEpKAFzF9N21Nwgnap6zy3L3MQ==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1151,8 +1151,8 @@ packages: requiresBuild: true optional: true - /@esbuild/darwin-arm64/0.17.10: - resolution: {integrity: sha512-3HaGIowI+nMZlopqyW6+jxYr01KvNaLB5znXfbyyjuo4lE0VZfvFGcguIJapQeQMS4cX/NEispwOekJt3gr5Dg==} + /@esbuild/darwin-arm64/0.17.11: + resolution: {integrity: sha512-pJ950bNKgzhkGNO3Z9TeHzIFtEyC2GDQL3wxkMApDEghYx5Qers84UTNc1bAxWbRkuJOgmOha5V0WUeh8G+YGw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1167,8 +1167,8 @@ packages: requiresBuild: true optional: true - /@esbuild/darwin-x64/0.17.10: - resolution: {integrity: sha512-J4MJzGchuCRG5n+B4EHpAMoJmBeAE1L3wGYDIN5oWNqX0tEr7VKOzw0ymSwpoeSpdCa030lagGUfnfhS7OvzrQ==} + /@esbuild/darwin-x64/0.17.11: + resolution: {integrity: sha512-iB0dQkIHXyczK3BZtzw1tqegf0F0Ab5texX2TvMQjiJIWXAfM4FQl7D909YfXWnB92OQz4ivBYQ2RlxBJrMJOw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1183,8 +1183,8 @@ packages: requiresBuild: true optional: true - /@esbuild/freebsd-arm64/0.17.10: - resolution: {integrity: sha512-ZkX40Z7qCbugeK4U5/gbzna/UQkM9d9LNV+Fro8r7HA7sRof5Rwxc46SsqeMvB5ZaR0b1/ITQ/8Y1NmV2F0fXQ==} + /@esbuild/freebsd-arm64/0.17.11: + resolution: {integrity: sha512-7EFzUADmI1jCHeDRGKgbnF5sDIceZsQGapoO6dmw7r/ZBEKX7CCDnIz8m9yEclzr7mFsd+DyasHzpjfJnmBB1Q==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1199,8 +1199,8 @@ packages: requiresBuild: true optional: true - /@esbuild/freebsd-x64/0.17.10: - resolution: {integrity: sha512-0m0YX1IWSLG9hWh7tZa3kdAugFbZFFx9XrvfpaCMMvrswSTvUZypp0NFKriUurHpBA3xsHVE9Qb/0u2Bbi/otg==} + /@esbuild/freebsd-x64/0.17.11: + resolution: {integrity: sha512-iPgenptC8i8pdvkHQvXJFzc1eVMR7W2lBPrTE6GbhR54sLcF42mk3zBOjKPOodezzuAz/KSu8CPyFSjcBMkE9g==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1215,8 +1215,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-arm/0.17.10: - resolution: {integrity: sha512-whRdrrl0X+9D6o5f0sTZtDM9s86Xt4wk1bf7ltx6iQqrIIOH+sre1yjpcCdrVXntQPCNw/G+XqsD4HuxeS+2QA==} + /@esbuild/linux-arm/0.17.11: + resolution: {integrity: sha512-M9iK/d4lgZH0U5M1R2p2gqhPV/7JPJcRz+8O8GBKVgqndTzydQ7B2XGDbxtbvFkvIs53uXTobOhv+RyaqhUiMg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1231,8 +1231,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-arm64/0.17.10: - resolution: {integrity: sha512-g1EZJR1/c+MmCgVwpdZdKi4QAJ8DCLP5uTgLWSAVd9wlqk9GMscaNMEViG3aE1wS+cNMzXXgdWiW/VX4J+5nTA==} + /@esbuild/linux-arm64/0.17.11: + resolution: {integrity: sha512-Qxth3gsWWGKz2/qG2d5DsW/57SeA2AmpSMhdg9TSB5Svn2KDob3qxfQSkdnWjSd42kqoxIPy3EJFs+6w1+6Qjg==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1247,8 +1247,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-ia32/0.17.10: - resolution: {integrity: sha512-1vKYCjfv/bEwxngHERp7huYfJ4jJzldfxyfaF7hc3216xiDA62xbXJfRlradiMhGZbdNLj2WA1YwYFzs9IWNPw==} + /@esbuild/linux-ia32/0.17.11: + resolution: {integrity: sha512-dB1nGaVWtUlb/rRDHmuDQhfqazWE0LMro/AIbT2lWM3CDMHJNpLckH+gCddQyhhcLac2OYw69ikUMO34JLt3wA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1263,8 +1263,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-loong64/0.17.10: - resolution: {integrity: sha512-mvwAr75q3Fgc/qz3K6sya3gBmJIYZCgcJ0s7XshpoqIAIBszzfXsqhpRrRdVFAyV1G9VUjj7VopL2HnAS8aHFA==} + /@esbuild/linux-loong64/0.17.11: + resolution: {integrity: sha512-aCWlq70Q7Nc9WDnormntGS1ar6ZFvUpqr8gXtO+HRejRYPweAFQN615PcgaSJkZjhHp61+MNLhzyVALSF2/Q0g==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -1279,8 +1279,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-mips64el/0.17.10: - resolution: {integrity: sha512-XilKPgM2u1zR1YuvCsFQWl9Fc35BqSqktooumOY2zj7CSn5czJn279j9TE1JEqSqz88izJo7yE4x3LSf7oxHzg==} + /@esbuild/linux-mips64el/0.17.11: + resolution: {integrity: sha512-cGeGNdQxqY8qJwlYH1BP6rjIIiEcrM05H7k3tR7WxOLmD1ZxRMd6/QIOWMb8mD2s2YJFNRuNQ+wjMhgEL2oCEw==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1295,8 +1295,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-ppc64/0.17.10: - resolution: {integrity: sha512-kM4Rmh9l670SwjlGkIe7pYWezk8uxKHX4Lnn5jBZYBNlWpKMBCVfpAgAJqp5doLobhzF3l64VZVrmGeZ8+uKmQ==} + /@esbuild/linux-ppc64/0.17.11: + resolution: {integrity: sha512-BdlziJQPW/bNe0E8eYsHB40mYOluS+jULPCjlWiHzDgr+ZBRXPtgMV1nkLEGdpjrwgmtkZHEGEPaKdS/8faLDA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1311,8 +1311,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-riscv64/0.17.10: - resolution: {integrity: sha512-r1m9ZMNJBtOvYYGQVXKy+WvWd0BPvSxMsVq8Hp4GzdMBQvfZRvRr5TtX/1RdN6Va8JMVQGpxqde3O+e8+khNJQ==} + /@esbuild/linux-riscv64/0.17.11: + resolution: {integrity: sha512-MDLwQbtF+83oJCI1Cixn68Et/ME6gelmhssPebC40RdJaect+IM+l7o/CuG0ZlDs6tZTEIoxUe53H3GmMn8oMA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1327,8 +1327,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-s390x/0.17.10: - resolution: {integrity: sha512-LsY7QvOLPw9WRJ+fU5pNB3qrSfA00u32ND5JVDrn/xG5hIQo3kvTxSlWFRP0NJ0+n6HmhPGG0Q4jtQsb6PFoyg==} + /@esbuild/linux-s390x/0.17.11: + resolution: {integrity: sha512-4N5EMESvws0Ozr2J94VoUD8HIRi7X0uvUv4c0wpTHZyZY9qpaaN7THjosdiW56irQ4qnJ6Lsc+i+5zGWnyqWqQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1343,8 +1343,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-x64/0.17.10: - resolution: {integrity: sha512-zJUfJLebCYzBdIz/Z9vqwFjIA7iSlLCFvVi7glMgnu2MK7XYigwsonXshy9wP9S7szF+nmwrelNaP3WGanstEg==} + /@esbuild/linux-x64/0.17.11: + resolution: {integrity: sha512-rM/v8UlluxpytFSmVdbCe1yyKQd/e+FmIJE2oPJvbBo+D0XVWi1y/NQ4iTNx+436WmDHQBjVLrbnAQLQ6U7wlw==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1359,8 +1359,8 @@ packages: requiresBuild: true optional: true - /@esbuild/netbsd-x64/0.17.10: - resolution: {integrity: sha512-lOMkailn4Ok9Vbp/q7uJfgicpDTbZFlXlnKT2DqC8uBijmm5oGtXAJy2ZZVo5hX7IOVXikV9LpCMj2U8cTguWA==} + /@esbuild/netbsd-x64/0.17.11: + resolution: {integrity: sha512-4WaAhuz5f91h3/g43VBGdto1Q+X7VEZfpcWGtOFXnggEuLvjV+cP6DyLRU15IjiU9fKLLk41OoJfBFN5DhPvag==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1375,8 +1375,8 @@ packages: requiresBuild: true optional: true - /@esbuild/openbsd-x64/0.17.10: - resolution: {integrity: sha512-/VE0Kx6y7eekqZ+ZLU4AjMlB80ov9tEz4H067Y0STwnGOYL8CsNg4J+cCmBznk1tMpxMoUOf0AbWlb1d2Pkbig==} + /@esbuild/openbsd-x64/0.17.11: + resolution: {integrity: sha512-UBj135Nx4FpnvtE+C8TWGp98oUgBcmNmdYgl5ToKc0mBHxVVqVE7FUS5/ELMImOp205qDAittL6Ezhasc2Ev/w==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1391,8 +1391,8 @@ packages: requiresBuild: true optional: true - /@esbuild/sunos-x64/0.17.10: - resolution: {integrity: sha512-ERNO0838OUm8HfUjjsEs71cLjLMu/xt6bhOlxcJ0/1MG3hNqCmbWaS+w/8nFLa0DDjbwZQuGKVtCUJliLmbVgg==} + /@esbuild/sunos-x64/0.17.11: + resolution: {integrity: sha512-1/gxTifDC9aXbV2xOfCbOceh5AlIidUrPsMpivgzo8P8zUtczlq1ncFpeN1ZyQJ9lVs2hILy1PG5KPp+w8QPPg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1407,8 +1407,8 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-arm64/0.17.10: - resolution: {integrity: sha512-fXv+L+Bw2AeK+XJHwDAQ9m3NRlNemG6Z6ijLwJAAVdu4cyoFbBWbEtyZzDeL+rpG2lWI51cXeMt70HA8g2MqIg==} + /@esbuild/win32-arm64/0.17.11: + resolution: {integrity: sha512-vtSfyx5yRdpiOW9yp6Ax0zyNOv9HjOAw8WaZg3dF5djEHKKm3UnoohftVvIJtRh0Ec7Hso0RIdTqZvPXJ7FdvQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1423,8 +1423,8 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-ia32/0.17.10: - resolution: {integrity: sha512-3s+HADrOdCdGOi5lnh5DMQEzgbsFsd4w57L/eLKKjMnN0CN4AIEP0DCP3F3N14xnxh3ruNc32A0Na9zYe1Z/AQ==} + /@esbuild/win32-ia32/0.17.11: + resolution: {integrity: sha512-GFPSLEGQr4wHFTiIUJQrnJKZhZjjq4Sphf+mM76nQR6WkQn73vm7IsacmBRPkALfpOCHsopSvLgqdd4iUW2mYw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1439,8 +1439,8 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-x64/0.17.10: - resolution: {integrity: sha512-oP+zFUjYNaMNmjTwlFtWep85hvwUu19cZklB3QsBOcZSs6y7hmH4LNCJ7075bsqzYaNvZFXJlAVaQ2ApITDXtw==} + /@esbuild/win32-x64/0.17.11: + resolution: {integrity: sha512-N9vXqLP3eRL8BqSy8yn4Y98cZI2pZ8fyuHx6lKjiG2WABpT2l01TXdzq5Ma2ZUBzfB7tx5dXVhge8X9u0S70ZQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1529,7 +1529,7 @@ packages: '@jest/schemas': 29.4.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.14.4 + '@types/node': 18.14.6 '@types/yargs': 17.0.22 chalk: 4.1.2 dev: false @@ -1752,7 +1752,7 @@ packages: dependencies: cross-spawn: 7.0.3 is-glob: 4.0.3 - open: 8.4.1 + open: 8.4.2 picocolors: 1.0.0 tiny-glob: 0.2.9 tslib: 2.5.0 @@ -1932,7 +1932,7 @@ packages: /@types/cheerio/0.22.31: resolution: {integrity: sha512-Kt7Cdjjdi2XWSfrZ53v4Of0wG3ZcmaegFXjMmz9tfNrZSkzzo36G0AL1YqSdcIA78Etjt6E609pt5h1xnQkPUw==} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 dev: true /@types/clear/0.1.2: @@ -1942,7 +1942,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 dev: true /@types/crawler/1.2.2: @@ -1986,14 +1986,14 @@ packages: resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} dependencies: '@types/jsonfile': 6.1.1 - '@types/node': 18.14.4 + '@types/node': 18.14.6 dev: true /@types/glob/8.0.1: resolution: {integrity: sha512-8bVUjXZvJacUFkJXHdyZ9iH1Eaj5V7I8c4NdH5sQJsdXkqT4CA5Dhb4yb4VE/3asyx4L9ayZr1NIhTsWHczmMw==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 18.14.4 + '@types/node': 18.14.6 dev: true /@types/hash-sum/1.0.0: @@ -2026,7 +2026,7 @@ packages: /@types/jsonfile/6.1.1: resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 dev: true /@types/lodash-es/4.17.6: @@ -2053,8 +2053,8 @@ packages: resolution: {integrity: sha512-nJOuiTlsvmClSr3+a/trTSx4DTuY/VURsWGKSf/eeavh0LRMqdsK60ti0TlwM5iHiGOK3/Ibkxsbr7i9rzGreA==} dev: true - /@types/node/18.14.4: - resolution: {integrity: sha512-VhCw7I7qO2X49+jaKcAUwi3rR+hbxT5VcYF493+Z5kMLI0DL568b7JI4IDJaxWFH0D/xwmGJNoXisyX+w7GH/g==} + /@types/node/18.14.6: + resolution: {integrity: sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==} /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -2075,7 +2075,7 @@ packages: resolution: {integrity: sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==} dependencies: '@types/glob': 8.0.1 - '@types/node': 18.14.4 + '@types/node': 18.14.6 dev: true /@types/semver/7.3.13: @@ -2103,7 +2103,7 @@ packages: /@types/webpack-bundle-analyzer/4.6.0: resolution: {integrity: sha512-XeQmQCCXdZdap+A/60UKmxW5Mz31Vp9uieGlHB3T4z/o2OLVLtTI3bvTuS6A2OWd/rbAAQiGGWIEFQACu16szA==} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 tapable: 2.2.1 webpack: 5.75.0 transitivePeerDependencies: @@ -2138,7 +2138,7 @@ packages: /@types/webpack-sources/3.2.0: resolution: {integrity: sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 '@types/source-list-map': 0.1.2 source-map: 0.7.4 dev: true @@ -2152,7 +2152,7 @@ packages: /@types/webpack/4.41.33: resolution: {integrity: sha512-PPajH64Ft2vWevkerISMtnZ8rTs4YmRbs+23c402J0INmxDKCrhZNvwZYtzx96gY2wAtXdrK1BS2fiC8MlLr3g==} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 '@types/tapable': 1.0.8 '@types/uglify-js': 3.17.1 '@types/webpack-sources': 3.2.0 @@ -2300,41 +2300,41 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@unhead/dom/1.1.14: - resolution: {integrity: sha512-a1sc1m+MknBdhecYbH3ubYRgNly5mIi+u35OJ6wo0jKclsdO0TsQ1uNwfEqxZZTs2RUH0p67w6fvjk2QSSjv4A==} + /@unhead/dom/1.1.16: + resolution: {integrity: sha512-4JlwF4pNVynZsxT5687ntvS2yafGtWg7Y76IAPmLSOVrZ6fpYqF/vUn5+eCbMb0Og4C9ECrkbD9NSIqAiQ/0/Q==} dependencies: - '@unhead/schema': 1.1.14 - '@unhead/shared': 1.1.14 + '@unhead/schema': 1.1.16 + '@unhead/shared': 1.1.16 dev: false - /@unhead/schema/1.1.14: - resolution: {integrity: sha512-oxC9JyMJGjhFpRJRzD78sJutdVzkPnmxAse+9s2GCBmYiLuBbkzaTUozutjor6Y7/DkoD3MsqPGEIOo+H/UsUw==} + /@unhead/schema/1.1.16: + resolution: {integrity: sha512-I9xIM9A5q4MBkHM0GTleed47WztJKpA8tJ0HSM74dVl887R3H5qwH9h3RMOo6y9xVhqgFt1MGL6wxTDAjqRczg==} dependencies: hookable: 5.4.2 zhead: 2.0.4 - /@unhead/shared/1.1.14: - resolution: {integrity: sha512-V230FvL39gkMqDHocI7cDg1oFSyn/bQa8xbKVNOrDVRVDc9QKoMccLMyE0T7cwXWcA4tAwJF2NlLRZbowpwFcw==} + /@unhead/shared/1.1.16: + resolution: {integrity: sha512-Fien3han5vZ4sIaH89Tk9o7eensIDEdRynbwnik+WNo0PTfmaN/LCa3EYsacOdNYeZ3eMjjYpmQt6r+FJCqzSA==} dependencies: - '@unhead/schema': 1.1.14 + '@unhead/schema': 1.1.16 dev: false - /@unhead/ssr/1.1.14: - resolution: {integrity: sha512-t7TBISnDj9xgqBPlSxahx7kzJs+eaDBjcINsv+2CY7Q7A7XpZ4bJiOSem86/rY1nBNV+Gx/WPdLs9D81y8DO+Q==} + /@unhead/ssr/1.1.16: + resolution: {integrity: sha512-SCay47uCx7jHL30iX/D0chxOLLY5m2/WCU5bepCQlzFO25OFC6cEEYtG6/BQOIRVnyN8a2KvOU38jgL9xQZN9A==} dependencies: - '@unhead/schema': 1.1.14 - '@unhead/shared': 1.1.14 + '@unhead/schema': 1.1.16 + '@unhead/shared': 1.1.16 dev: false - /@unhead/vue/1.1.14_vue@3.2.47: - resolution: {integrity: sha512-CRb8YgfcKm8/FtbWip/kiZEkGfYD6iCYXigbIrPFOKJr/EsZoFWH3FeJiu4ZL4hkaSydTmFGMSQxCxkwTQ9e0w==} + /@unhead/vue/1.1.16_vue@3.2.47: + resolution: {integrity: sha512-EbE0kqJHDmebF+X6fL7HqGnbTa+b6h6SzIvE+D0i0/IwhD2lXRrPcBy0XyLV9CLBpAbLVG4OByxnBX+7Kk/vUA==} peerDependencies: vue: '>=2.7 || >=3' dependencies: - '@unhead/schema': 1.1.14 - '@unhead/shared': 1.1.14 + '@unhead/schema': 1.1.16 + '@unhead/shared': 1.1.16 hookable: 5.4.2 - unhead: 1.1.14 + unhead: 1.1.16 vue: 3.2.47 dev: false @@ -2790,15 +2790,15 @@ packages: - vue dev: true - /@vueuse/head/1.1.9_vue@3.2.47: - resolution: {integrity: sha512-J6OT32x1MnFs6a90DdusFfxPZYupYGR1kItDTw06Lj6ZORJRG1Del1BEy5FFXI7mhuIM4/nGLXgW+FtLE6JJQQ==} + /@vueuse/head/1.1.15_vue@3.2.47: + resolution: {integrity: sha512-LJqvb7dpSqnsdn6YWUxv97vWCnn/s6IfBrE4ih5kRlh8XQXr/HjXJ8IyIxxp0X7QDr3FhOsjRDpJSiQbDYbBdQ==} peerDependencies: vue: '>=2.7 || >=3' dependencies: - '@unhead/dom': 1.1.14 - '@unhead/schema': 1.1.14 - '@unhead/ssr': 1.1.14 - '@unhead/vue': 1.1.14_vue@3.2.47 + '@unhead/dom': 1.1.16 + '@unhead/schema': 1.1.16 + '@unhead/ssr': 1.1.16 + '@unhead/vue': 1.1.16_vue@3.2.47 vue: 3.2.47 dev: false @@ -3434,19 +3434,24 @@ packages: resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - /changelogen/0.4.1: - resolution: {integrity: sha512-p1dJO1Z995odIxdypzAykHIaUu+XnEvwYPSTyKJsbpL82o99sxN1G24tbecoMxTsV4PI+ZId82GJXRL2hhOeJA==} + /changelogen/0.5.1: + resolution: {integrity: sha512-vBaHKtnjsQHSQMVgVlDTTShRdIdYfadFVGaPhik2OR0VI+NeZuQNKcNfnruG7Ap37ecsZSKXhp5j9GVmtEGguQ==} hasBin: true dependencies: c12: 1.1.2 + colorette: 2.0.19 consola: 2.15.3 convert-gitmoji: 0.1.3 - execa: 6.1.0 + execa: 7.0.0 mri: 1.2.0 node-fetch-native: 1.0.2 + ofetch: 1.0.1 + open: 8.4.2 + pathe: 1.1.0 pkg-types: 1.0.2 scule: 1.0.0 semver: 7.3.8 + yaml: 2.2.1 transitivePeerDependencies: - supports-color dev: true @@ -4248,7 +4253,7 @@ packages: peerDependencies: webpack: ^4.40.0 || ^5.0.0 dependencies: - esbuild: 0.17.10 + esbuild: 0.17.11 get-tsconfig: 4.4.0 loader-utils: 2.0.4 webpack: 5.75.0 @@ -4284,34 +4289,34 @@ packages: '@esbuild/win32-ia32': 0.16.17 '@esbuild/win32-x64': 0.16.17 - /esbuild/0.17.10: - resolution: {integrity: sha512-n7V3v29IuZy5qgxx25TKJrEm0FHghAlS6QweUcyIgh/U0zYmQcvogWROitrTyZId1mHSkuhhuyEXtI9OXioq7A==} + /esbuild/0.17.11: + resolution: {integrity: sha512-pAMImyokbWDtnA/ufPxjQg0fYo2DDuzAlqwnDvbXqHLphe+m80eF++perYKVm8LeTuj2zUuFXC+xgSVxyoHUdg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.10 - '@esbuild/android-arm64': 0.17.10 - '@esbuild/android-x64': 0.17.10 - '@esbuild/darwin-arm64': 0.17.10 - '@esbuild/darwin-x64': 0.17.10 - '@esbuild/freebsd-arm64': 0.17.10 - '@esbuild/freebsd-x64': 0.17.10 - '@esbuild/linux-arm': 0.17.10 - '@esbuild/linux-arm64': 0.17.10 - '@esbuild/linux-ia32': 0.17.10 - '@esbuild/linux-loong64': 0.17.10 - '@esbuild/linux-mips64el': 0.17.10 - '@esbuild/linux-ppc64': 0.17.10 - '@esbuild/linux-riscv64': 0.17.10 - '@esbuild/linux-s390x': 0.17.10 - '@esbuild/linux-x64': 0.17.10 - '@esbuild/netbsd-x64': 0.17.10 - '@esbuild/openbsd-x64': 0.17.10 - '@esbuild/sunos-x64': 0.17.10 - '@esbuild/win32-arm64': 0.17.10 - '@esbuild/win32-ia32': 0.17.10 - '@esbuild/win32-x64': 0.17.10 + '@esbuild/android-arm': 0.17.11 + '@esbuild/android-arm64': 0.17.11 + '@esbuild/android-x64': 0.17.11 + '@esbuild/darwin-arm64': 0.17.11 + '@esbuild/darwin-x64': 0.17.11 + '@esbuild/freebsd-arm64': 0.17.11 + '@esbuild/freebsd-x64': 0.17.11 + '@esbuild/linux-arm': 0.17.11 + '@esbuild/linux-arm64': 0.17.11 + '@esbuild/linux-ia32': 0.17.11 + '@esbuild/linux-loong64': 0.17.11 + '@esbuild/linux-mips64el': 0.17.11 + '@esbuild/linux-ppc64': 0.17.11 + '@esbuild/linux-riscv64': 0.17.11 + '@esbuild/linux-s390x': 0.17.11 + '@esbuild/linux-x64': 0.17.11 + '@esbuild/netbsd-x64': 0.17.11 + '@esbuild/openbsd-x64': 0.17.11 + '@esbuild/sunos-x64': 0.17.11 + '@esbuild/win32-arm64': 0.17.11 + '@esbuild/win32-ia32': 0.17.11 + '@esbuild/win32-x64': 0.17.11 /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -4462,8 +4467,8 @@ packages: - supports-color dev: true - /eslint-plugin-jsdoc/40.0.0_eslint@8.35.0: - resolution: {integrity: sha512-LOPyIu1vAVvGPkye3ci0moj0iNf3f8bmin6do2DYDj+77NRXWnkmhKRy8swWsatUs3mB5jYPWPUsFg9pyfEiyA==} + /eslint-plugin-jsdoc/40.0.1_eslint@8.35.0: + resolution: {integrity: sha512-KkiRInury7YrjjV5aCHDxwsPy6XFt5p2b2CnpDMITnWs8patNPf5kj24+VXIWw45kP6z/B0GOKfrYczB56OjQQ==} engines: {node: ^14 || ^16 || ^17 || ^18 || ^19} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -4727,21 +4732,6 @@ packages: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - /execa/6.1.0: - resolution: {integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 3.0.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - dev: true - /execa/7.0.0: resolution: {integrity: sha512-tQbH0pH/8LHTnwTrsKWideqi6rFB/QNUawEwrn+WHyz7PX1Tuz2u7wfTvbaNBdP5JD5LVWxNo8/A8CHNZ3bV6g==} engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} @@ -5160,6 +5150,16 @@ packages: minimatch: 5.1.6 once: 1.4.0 + /glob/9.2.1: + resolution: {integrity: sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + fs.realpath: 1.0.0 + minimatch: 7.4.2 + minipass: 4.2.4 + path-scurry: 1.6.1 + dev: true + /globals/11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -5383,11 +5383,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - /human-signals/3.0.1: - resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==} - engines: {node: '>=12.20.0'} - dev: true - /human-signals/4.3.0: resolution: {integrity: sha512-zyzVyMjpGBX2+6cDVZeFPCdtOtdsxOeseRhB9tkQ6xXmGUNrcnBzdEKPy3VPNYz+4gy1oukVOXcrJCunSyc6QQ==} engines: {node: '>=14.18.0'} @@ -5716,7 +5711,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.4.3 - '@types/node': 18.14.4 + '@types/node': 18.14.6 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.10 @@ -5727,7 +5722,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -5735,7 +5730,7 @@ packages: resolution: {integrity: sha512-GLHN/GTAAMEy5BFdvpUfzr9Dr80zQqBrh0fz1mtRMe05hqP45+HfQltu7oTBfduD0UeZs09d+maFtFYAXFWvAA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 jest-util: 29.4.3 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -6187,6 +6182,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch/7.4.2: + resolution: {integrity: sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist/1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true @@ -6197,8 +6199,8 @@ packages: dependencies: yallist: 4.0.0 - /minipass/4.0.3: - resolution: {integrity: sha512-OW2r4sQ0sI+z5ckEt5c1Tri4xTgZwYDxpE54eqWlQloQRoWtXjqt9udJ5Z4dSv7wK+nfFI7FRXyCpBSft+gpFw==} + /minipass/4.2.4: + resolution: {integrity: sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==} engines: {node: '>=8'} /minizlib/2.1.2: @@ -6230,7 +6232,7 @@ packages: optional: true dependencies: defu: 6.1.2 - esbuild: 0.17.10 + esbuild: 0.17.11 fs-extra: 11.1.0 globby: 13.1.3 jiti: 1.17.1 @@ -6320,7 +6322,7 @@ packages: defu: 6.1.2 destr: 1.2.2 dot-prop: 7.2.0 - esbuild: 0.17.10 + esbuild: 0.17.11 escape-string-regexp: 5.0.0 etag: 1.8.1 fs-extra: 11.1.0 @@ -6554,8 +6556,8 @@ packages: dependencies: mimic-fn: 4.0.0 - /open/8.4.1: - resolution: {integrity: sha512-/4b7qZNhv6Uhd7jjnREh1NjnPxlTq+XNWPG88Ydkj5AILcA5m3ajvcg57pB24EQjKv0dK62XnDqk9c/hkIG5Kg==} + /open/8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} dependencies: define-lazy-prop: 2.0.0 @@ -6698,6 +6700,14 @@ packages: /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + /path-scurry/1.6.1: + resolution: {integrity: sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==} + engines: {node: '>=14'} + dependencies: + lru-cache: 7.16.0 + minipass: 4.2.4 + dev: true + /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -6744,19 +6754,19 @@ packages: mlly: 1.1.1 pathe: 1.1.0 - /playwright-core/1.31.1: - resolution: {integrity: sha512-JTyX4kV3/LXsvpHkLzL2I36aCdml4zeE35x+G5aPc4bkLsiRiQshU5lWeVpHFAuC8xAcbI6FDcw/8z3q2xtJSQ==} + /playwright-core/1.31.2: + resolution: {integrity: sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ==} engines: {node: '>=14'} hasBin: true dev: true - /playwright/1.31.1: - resolution: {integrity: sha512-zKJabsIA2rvOwJ12lGTqWv4HVJzlfw2JtUvO4hAr7J8UXQZ1qEPpX20E1vcz/9fotnTkwgqp3CVdIBwptBN3Fg==} + /playwright/1.31.2: + resolution: {integrity: sha512-jpC47n2PKQNtzB7clmBuWh6ftBRS/Bt5EGLigJ9k2QAKcNeYXZkEaDH5gmvb6+AbcE0DO6GnXdbl9ogG6Eh+og==} engines: {node: '>=14'} hasBin: true requiresBuild: true dependencies: - playwright-core: 1.31.1 + playwright-core: 1.31.2 dev: true /pluralize/8.0.0: @@ -7352,10 +7362,12 @@ packages: dependencies: glob: 7.2.3 - /rimraf/4.1.3: - resolution: {integrity: sha512-iyzalDLo3l5FZxxaIGUY7xI4Bf90Xt7pCipc1Mr7RsdU7H3538z+M0tlsUDrz0aHeGS9uNqiKHUJyTewwRP91Q==} + /rimraf/4.3.0: + resolution: {integrity: sha512-5qVDXPbByA1qSJEWMv1qAwKsoS22vVpsL2QyxCKBw4gf6XiFo1K3uRLY6uSOOBFDwnqAZtnbILqWKKlzh8bkGg==} engines: {node: '>=14'} hasBin: true + dependencies: + glob: 9.2.1 dev: true /rollup-plugin-dts/5.2.0_fn2onl6nbsljlgjr3jlzr6w7we: @@ -7382,7 +7394,7 @@ packages: rollup: optional: true dependencies: - open: 8.4.1 + open: 8.4.2 picomatch: 2.3.1 rollup: 3.18.0 source-map: 0.7.4 @@ -7874,7 +7886,7 @@ packages: dependencies: chownr: 2.0.0 fs-minipass: 2.1.0 - minipass: 4.0.3 + minipass: 4.2.4 minizlib: 2.1.2 mkdirp: 1.0.4 yallist: 4.0.0 @@ -8132,7 +8144,7 @@ packages: chalk: 5.2.0 consola: 2.15.3 defu: 6.1.2 - esbuild: 0.17.10 + esbuild: 0.17.11 globby: 13.1.3 hookable: 5.4.2 jiti: 1.17.1 @@ -8188,12 +8200,12 @@ packages: node-fetch-native: 1.0.2 pathe: 1.1.0 - /unhead/1.1.14: - resolution: {integrity: sha512-tFy0nLOyiKmIVzfz5HuSRzVi55XuRS1G8LslrWn42tezssuZw6JqiscUJZRI14rNdcwhtcQV2iTy4Uw7s1uZrA==} + /unhead/1.1.16: + resolution: {integrity: sha512-m2cPqEkgwHnA/di9P17TRS21p4aAJw4QolwTyXM+gzrlnFPe8gqOYuwEVnLRMS/NgoNWH7iPDOGyf5bbbrnTaw==} dependencies: - '@unhead/dom': 1.1.14 - '@unhead/schema': 1.1.14 - '@unhead/shared': 1.1.14 + '@unhead/dom': 1.1.16 + '@unhead/schema': 1.1.16 + '@unhead/shared': 1.1.16 hookable: 5.4.2 dev: false @@ -8434,7 +8446,7 @@ packages: - terser dev: false - /vite-node/0.29.2_@types+node@18.14.4: + /vite-node/0.29.2_@types+node@18.14.6: resolution: {integrity: sha512-5oe1z6wzI3gkvc4yOBbDBbgpiWiApvuN4P55E8OI131JGrSuo4X3SOZrNmZYo4R8Zkze/dhi572blX0zc+6SdA==} engines: {node: '>=v14.16.0'} hasBin: true @@ -8444,7 +8456,7 @@ packages: mlly: 1.1.1 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.1.4_@types+node@18.14.4 + vite: 4.1.4_@types+node@18.14.6 transitivePeerDependencies: - '@types/node' - less @@ -8537,7 +8549,7 @@ packages: optionalDependencies: fsevents: 2.3.2 - /vite/4.1.4_@types+node@18.14.4: + /vite/4.1.4_@types+node@18.14.6: resolution: {integrity: sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -8562,7 +8574,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.14.4 + '@types/node': 18.14.6 esbuild: 0.16.17 postcss: 8.4.21 resolve: 1.22.1 @@ -8595,7 +8607,7 @@ packages: dependencies: '@types/chai': 4.3.4 '@types/chai-subset': 1.3.3 - '@types/node': 18.14.4 + '@types/node': 18.14.6 '@vitest/expect': 0.29.2 '@vitest/runner': 0.29.2 '@vitest/spy': 0.29.2 @@ -8614,8 +8626,8 @@ packages: tinybench: 2.3.1 tinypool: 0.3.1 tinyspy: 1.1.1 - vite: 4.1.4_@types+node@18.14.4 - vite-node: 0.29.2_@types+node@18.14.4 + vite: 4.1.4_@types+node@18.14.6 + vite-node: 0.29.2_@types+node@18.14.6 why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -9018,6 +9030,11 @@ packages: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} + /yaml/2.2.1: + resolution: {integrity: sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==} + engines: {node: '>= 14'} + dev: true + /yargs-parser/21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} diff --git a/scripts/bump-edge.ts b/scripts/bump-edge.ts index f48951bb70..1d1cbc9e7e 100644 --- a/scripts/bump-edge.ts +++ b/scripts/bump-edge.ts @@ -1,6 +1,8 @@ import { execSync } from 'node:child_process' import { $fetch } from 'ofetch' import { inc } from 'semver' +import { getGitDiff, determineSemverChange, loadChangelogConfig, parseCommits } from 'changelogen' +import { execaSync } from 'execa' import { loadWorkspace } from './_utils' async function main () { @@ -14,9 +16,15 @@ async function main () { const latestNitro = nitroInfo['dist-tags'].latest nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@^${latestNitro}` + const config = await loadChangelogConfig(process.cwd()) + + const latestTag = execaSync('git', ['describe', '--tags', '--abbrev=0']).stdout + + const commits = await getGitDiff(latestTag) + const bumpType = determineSemverChange(parseCommits(commits, config), config) + for (const pkg of workspace.packages.filter(p => !p.data.private)) { - // TODO: Set release type based on changelog after 3.0.0 - const newVersion = inc(pkg.data.version, 'prerelease', 'rc') + const newVersion = inc(pkg.data.version, bumpType || 'prerelease') workspace.setVersion(pkg.data.name, `${newVersion}-${date}.${commit}`) const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge') workspace.rename(pkg.data.name, newname) diff --git a/test/basic.test.ts b/test/basic.test.ts index 3bb086397a..10a04b7b7e 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest' import { joinURL, withQuery } from 'ufo' import { isCI, isWindows } from 'std-env' import { normalize } from 'pathe' -// eslint-disable-next-line import/order import { setup, fetch, $fetch, startServer, isDev, createPage, url } from '@nuxt/test-utils' import type { NuxtIslandResponse } from '../packages/nuxt/src/core/runtime/nitro/renderer' @@ -47,6 +46,13 @@ describe('route rules', () => { }) }) +describe('modules', () => { + it('should auto-register modules in ~/modules', async () => { + const result = await $fetch('/auto-registered-module') + expect(result).toEqual('handler added by auto-registered module') + }) +}) + describe('pages', () => { it('render index', async () => { const html = await $fetch('/') diff --git a/test/fixtures/basic/modules/auto-registered/index.ts b/test/fixtures/basic/modules/auto-registered/index.ts new file mode 100644 index 0000000000..98e5ad9cbb --- /dev/null +++ b/test/fixtures/basic/modules/auto-registered/index.ts @@ -0,0 +1,15 @@ +import { createResolver, defineNuxtModule, addServerHandler } from 'nuxt/kit' + +export default defineNuxtModule({ + meta: { + name: 'auto-registered-module' + }, + setup () { + const resolver = createResolver(import.meta.url) + + addServerHandler({ + handler: resolver.resolve('./runtime/handler'), + route: '/auto-registered-module' + }) + } +}) diff --git a/test/fixtures/basic/modules/auto-registered/runtime/handler.ts b/test/fixtures/basic/modules/auto-registered/runtime/handler.ts new file mode 100644 index 0000000000..563d40e0b9 --- /dev/null +++ b/test/fixtures/basic/modules/auto-registered/runtime/handler.ts @@ -0,0 +1 @@ +export default defineEventHandler(() => 'handler added by auto-registered module') diff --git a/test/fixtures/basic/modules/example.ts b/test/fixtures/basic/modules/example.ts index d55c2c4253..d4eca6c235 100644 --- a/test/fixtures/basic/modules/example.ts +++ b/test/fixtures/basic/modules/example.ts @@ -1,5 +1,4 @@ -import { fileURLToPath } from 'node:url' -import { defineNuxtModule, addPlugin, useNuxt } from '@nuxt/kit' +import { defineNuxtModule, createResolver, addPlugin, useNuxt } from 'nuxt/kit' export default defineNuxtModule({ defaults: { @@ -11,11 +10,13 @@ export default defineNuxtModule({ configKey: 'sampleModule' }, setup () { - addPlugin(fileURLToPath(new URL('./runtime/plugin', import.meta.url))) + const resolver = createResolver(import.meta.url) + + addPlugin(resolver.resolve('./runtime/plugin')) useNuxt().hook('app:resolve', (app) => { app.middleware.push({ name: 'unctx-test', - path: fileURLToPath(new URL('./runtime/middleware', import.meta.url)), + path: resolver.resolve('./runtime/middleware'), global: true }) }) diff --git a/test/fixtures/basic/nuxt.config.ts b/test/fixtures/basic/nuxt.config.ts index df9b888ac2..f09079b074 100644 --- a/test/fixtures/basic/nuxt.config.ts +++ b/test/fixtures/basic/nuxt.config.ts @@ -11,6 +11,7 @@ declare module 'nitropack' { } export default defineNuxtConfig({ + typescript: { strict: true }, app: { pageTransition: true, layoutTransition: true, @@ -161,8 +162,7 @@ export default defineNuxtConfig({ componentIslands: true, reactivityTransform: true, treeshakeClientOnly: true, - payloadExtraction: true, - configSchema: true + payloadExtraction: true }, appConfig: { fromNuxtConfig: true, diff --git a/test/fixtures/basic/types.ts b/test/fixtures/basic/types.ts index 9052f0dcc7..c1ba1b0df7 100644 --- a/test/fixtures/basic/types.ts +++ b/test/fixtures/basic/types.ts @@ -247,8 +247,9 @@ describe('app config', () => { val: number }, userConfig: number + [key: string]: any } - expectTypeOf().toMatchTypeOf() + expectTypeOf().toEqualTypeOf() }) }) diff --git a/test/hmr.test.ts b/test/hmr.test.ts index 184975d280..1be25aca44 100644 --- a/test/hmr.test.ts +++ b/test/hmr.test.ts @@ -3,7 +3,6 @@ import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { isWindows } from 'std-env' import { join } from 'pathe' -// eslint-disable-next-line import/order import { setup, $fetch } from '@nuxt/test-utils' import { expectWithPolling, renderPage } from './utils'