chore(deps): update all non-major dependencies (main) (#25342)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
renovate[bot] 2024-01-29 16:53:25 +00:00 committed by GitHub
parent 0d91e52211
commit 7d65769496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 818 additions and 600 deletions

View File

@ -57,7 +57,7 @@ jobs:
run: pnpm build run: pnpm build
- name: Cache dist - name: Cache dist
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with: with:
retention-days: 3 retention-days: 3
name: dist name: dist
@ -85,7 +85,7 @@ jobs:
run: pnpm install run: pnpm install
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
with: with:
languages: javascript languages: javascript
queries: +security-and-quality queries: +security-and-quality
@ -97,7 +97,7 @@ jobs:
path: packages path: packages
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
with: with:
category: "/language:javascript" category: "/language:javascript"
@ -258,7 +258,7 @@ jobs:
TEST_CONTEXT: ${{ matrix.context }} TEST_CONTEXT: ${{ matrix.context }}
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || runner.os == 'Windows' }} SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || runner.os == 'Windows' }}
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5
if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on' if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on'
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -58,7 +58,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab. # format to the repository Actions tab.
- name: "Upload artifact" - name: "Upload artifact"
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with: with:
name: SARIF file name: SARIF file
path: results.sarif path: results.sarif
@ -66,6 +66,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard. # Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 uses: github/codeql-action/upload-sarif@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
with: with:
sarif_file: results.sarif sarif_file: results.sarif

View File

@ -137,23 +137,23 @@ Non primitive JS types | ❌ No | ✅ Yes
Nuxt uses [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file as the single source of trust for configurations and skips reading external configuration files. During the course of building your project, you may have a need to configure those. The following table highlights common configurations and, where applicable, how they can be configured with Nuxt. Nuxt uses [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file as the single source of trust for configurations and skips reading external configuration files. During the course of building your project, you may have a need to configure those. The following table highlights common configurations and, where applicable, how they can be configured with Nuxt.
Name | Config File | How To Configure Name | Config File | How To Configure
|----------------------------------------------|---------------------------|------------------------- ---------------------------------------------|---------------------------|-------------------------
| [Nitro](https://nitro.unjs.io) | ~~`nitro.config.ts`~~ | Use [`nitro`](/docs/api/nuxt-config#nitro) key in `nuxt.config` [Nitro](https://nitro.unjs.io) | ~~`nitro.config.ts`~~ | Use [`nitro`](/docs/api/nuxt-config#nitro) key in `nuxt.config`
| [PostCSS](https://postcss.org) | ~~`postcss.config.js`~~ | Use [`postcss`](/docs/api/nuxt-config#postcss) key in `nuxt.config` [PostCSS](https://postcss.org) | ~~`postcss.config.js`~~ | Use [`postcss`](/docs/api/nuxt-config#postcss) key in `nuxt.config`
| [Vite](https://vitejs.dev) | ~~`vite.config.ts`~~ | Use [`vite`](/docs/api/nuxt-config#vite) key in `nuxt.config` [Vite](https://vitejs.dev) | ~~`vite.config.ts`~~ | Use [`vite`](/docs/api/nuxt-config#vite) key in `nuxt.config`
| [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/api/nuxt-config#webpack-1) key in `nuxt.config` [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/api/nuxt-config#webpack-1) key in `nuxt.config`
Here is a list of other common config files: Here is a list of other common config files:
Name | Config File | How To Configure Name | Config File | How To Configure
|----------------------------------------------|-------------------------|-------------------------- ---------------------------------------------|-------------------------|--------------------------
| [TypeScript](https://www.typescriptlang.org) | `tsconfig.json` | [More Info](/docs/guide/concepts/typescript#nuxttsconfigjson) [TypeScript](https://www.typescriptlang.org) | `tsconfig.json` | [More Info](/docs/guide/concepts/typescript#nuxttsconfigjson)
| [ESLint](https://eslint.org) | `.eslintrc.js` | [More Info](https://eslint.org/docs/latest/use/configure/configuration-files) [ESLint](https://eslint.org) | `.eslintrc.js` | [More Info](https://eslint.org/docs/latest/use/configure/configuration-files)
| [Prettier](https://prettier.io) | `.prettierrc.json` | [More Info](https://prettier.io/docs/en/configuration.html) [Prettier](https://prettier.io) | `.prettierrc.json` | [More Info](https://prettier.io/docs/en/configuration.html)
| [Stylelint](https://stylelint.io) | `.stylelintrc.json` | [More Info](https://stylelint.io/user-guide/configure) [Stylelint](https://stylelint.io) | `.stylelintrc.json` | [More Info](https://stylelint.io/user-guide/configure)
| [TailwindCSS](https://tailwindcss.com) | `tailwind.config.js` | [More Info](https://tailwindcss.nuxtjs.org/tailwind/config) [TailwindCSS](https://tailwindcss.com) | `tailwind.config.js` | [More Info](https://tailwindcss.nuxtjs.org/tailwind/config)
| [Vitest](https://vitest.dev) | `vitest.config.ts` | [More Info](https://vitest.dev/config) [Vitest](https://vitest.dev) | `vitest.config.ts` | [More Info](https://vitest.dev/config)
## Vue Configuration ## Vue Configuration

View File

@ -66,10 +66,10 @@ Each active version has its own nightly releases which are generated automatical
Release | | Initial release | End Of Life | Docs Release | | Initial release | End Of Life | Docs
----------------------------------------|---------------------------------------------------------------------------------------------------|-----------------|--------------|------- ----------------------------------------|---------------------------------------------------------------------------------------------------|-----------------|--------------|-------
**4.x** (scheduled) | | 2024 Q1 | | **4.x** (scheduled) | | 2024 Q1 | | &nbsp;
**3.x** (stable) | <a href="https://npmjs.com/package/nuxt"><img alt="Nuxt latest 3.x version" src="https://flat.badgen.net/npm/v/nuxt?label="></a> | 2022-11-16 | TBA | [nuxt.com](/docs) **3.x** (stable) | <a href="https://npmjs.com/package/nuxt"><img alt="Nuxt latest 3.x version" src="https://flat.badgen.net/npm/v/nuxt?label="></a> | 2022-11-16 | TBA | [nuxt.com](/docs)
**2.x** (maintenance) | <a href="https://www.npmjs.com/package/nuxt?activeTab=versions"><img alt="Nuxt 2.x version" src="https://flat.badgen.net/npm/v/nuxt/2x?label="></a> | 2018-09-21 | 2024-06-30 | [v2.nuxt.com](https://v2.nuxt.com/docs) **2.x** (maintenance) | <a href="https://www.npmjs.com/package/nuxt?activeTab=versions"><img alt="Nuxt 2.x version" src="https://flat.badgen.net/npm/v/nuxt/2x?label="></a> | 2018-09-21 | 2024-06-30 | [v2.nuxt.com](https://v2.nuxt.com/docs)
**1.x** (unsupported) | <a href="https://www.npmjs.com/package/nuxt?activeTab=versions"><img alt="Nuxt 1.x version" src="https://flat.badgen.net/npm/v/nuxt/1x?label="></a> | 2018-01-08 | 2019-09-21 | **1.x** (unsupported) | <a href="https://www.npmjs.com/package/nuxt?activeTab=versions"><img alt="Nuxt 1.x version" src="https://flat.badgen.net/npm/v/nuxt/1x?label="></a> | 2018-01-08 | 2019-09-21 | &nbsp;
### Support Status ### Support Status

View File

@ -36,7 +36,7 @@
"@nuxt/schema": "workspace:*", "@nuxt/schema": "workspace:*",
"@nuxt/vite-builder": "workspace:*", "@nuxt/vite-builder": "workspace:*",
"@nuxt/webpack-builder": "workspace:*", "@nuxt/webpack-builder": "workspace:*",
"rollup": "^4.9.5", "rollup": "^4.9.6",
"nuxt": "workspace:*", "nuxt": "workspace:*",
"vite": "5.0.12", "vite": "5.0.12",
"vue": "3.4.15", "vue": "3.4.15",
@ -48,32 +48,32 @@
"@nuxt/test-utils": "3.11.0", "@nuxt/test-utils": "3.11.0",
"@nuxt/webpack-builder": "workspace:*", "@nuxt/webpack-builder": "workspace:*",
"@types/fs-extra": "11.0.4", "@types/fs-extra": "11.0.4",
"@types/node": "20.11.5", "@types/node": "20.11.10",
"@types/semver": "7.5.6", "@types/semver": "7.5.6",
"@vitest/coverage-v8": "1.2.2", "@vitest/coverage-v8": "1.2.2",
"@vue/test-utils": "2.4.3", "@vue/test-utils": "2.4.4",
"case-police": "0.6.1", "case-police": "0.6.1",
"changelogen": "0.5.5", "changelogen": "0.5.5",
"consola": "3.2.3", "consola": "3.2.3",
"devalue": "4.3.2", "devalue": "4.3.2",
"eslint": "8.56.0", "eslint": "8.56.0",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "48.0.2", "eslint-plugin-jsdoc": "48.0.4",
"eslint-plugin-no-only-tests": "3.1.0", "eslint-plugin-no-only-tests": "3.1.0",
"eslint-plugin-unicorn": "50.0.1", "eslint-plugin-unicorn": "50.0.1",
"execa": "8.0.1", "execa": "8.0.1",
"fs-extra": "11.2.0", "fs-extra": "11.2.0",
"globby": "14.0.0", "globby": "14.0.0",
"h3": "1.10.0", "h3": "1.10.1",
"happy-dom": "13.2.0", "happy-dom": "13.3.4",
"jiti": "1.21.0", "jiti": "1.21.0",
"markdownlint-cli": "0.38.0", "markdownlint-cli": "0.39.0",
"nitropack": "2.8.1", "nitropack": "2.8.1",
"nuxi": "3.10.0", "nuxi": "3.10.0",
"nuxt": "workspace:*", "nuxt": "workspace:*",
"ofetch": "1.3.3", "ofetch": "1.3.3",
"pathe": "1.1.2", "pathe": "1.1.2",
"playwright-core": "1.41.0", "playwright-core": "1.41.1",
"rimraf": "5.0.5", "rimraf": "5.0.5",
"semver": "7.5.4", "semver": "7.5.4",
"std-env": "3.7.0", "std-env": "3.7.0",
@ -82,11 +82,11 @@
"vitest": "1.2.2", "vitest": "1.2.2",
"vitest-environment-nuxt": "1.0.0", "vitest-environment-nuxt": "1.0.0",
"vue": "3.4.15", "vue": "3.4.15",
"vue-eslint-parser": "9.4.0", "vue-eslint-parser": "9.4.2",
"vue-router": "4.2.5", "vue-router": "4.2.5",
"vue-tsc": "1.8.27" "vue-tsc": "1.8.27"
}, },
"packageManager": "pnpm@8.14.1", "packageManager": "pnpm@8.15.0",
"engines": { "engines": {
"node": "^14.18.0 || >=16.10.0" "node": "^14.18.0 || >=16.10.0"
}, },

View File

@ -43,7 +43,7 @@
"ufo": "^1.3.2", "ufo": "^1.3.2",
"unctx": "^2.3.1", "unctx": "^2.3.1",
"unimport": "^3.7.1", "unimport": "^3.7.1",
"untyped": "^1.4.0" "untyped": "^1.4.2"
}, },
"devDependencies": { "devDependencies": {
"@types/hash-sum": "1.0.2", "@types/hash-sum": "1.0.2",
@ -54,7 +54,7 @@
"unbuild": "latest", "unbuild": "latest",
"vite": "5.0.12", "vite": "5.0.12",
"vitest": "1.2.2", "vitest": "1.2.2",
"webpack": "5.89.0" "webpack": "5.90.0"
}, },
"engines": { "engines": {
"node": "^14.18.0 || >=16.10.0" "node": "^14.18.0 || >=16.10.0"

View File

@ -77,12 +77,12 @@
"defu": "^6.1.4", "defu": "^6.1.4",
"destr": "^2.0.2", "destr": "^2.0.2",
"devalue": "^4.3.2", "devalue": "^4.3.2",
"esbuild": "^0.19.11", "esbuild": "^0.20.0",
"escape-string-regexp": "^5.0.0", "escape-string-regexp": "^5.0.0",
"estree-walker": "^3.0.3", "estree-walker": "^3.0.3",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"globby": "^14.0.0", "globby": "^14.0.0",
"h3": "^1.10.0", "h3": "^1.10.1",
"hookable": "^5.5.3", "hookable": "^5.5.3",
"jiti": "^1.21.0", "jiti": "^1.21.0",
"klona": "^2.0.6", "klona": "^2.0.6",
@ -91,7 +91,7 @@
"mlly": "^1.5.0", "mlly": "^1.5.0",
"nitropack": "^2.8.1", "nitropack": "^2.8.1",
"nuxi": "^3.10.0", "nuxi": "^3.10.0",
"nypm": "^0.3.4", "nypm": "^0.3.6",
"ofetch": "^1.3.3", "ofetch": "^1.3.3",
"ohash": "^1.1.3", "ohash": "^1.1.3",
"pathe": "^1.1.2", "pathe": "^1.1.2",
@ -109,7 +109,7 @@
"unimport": "^3.7.1", "unimport": "^3.7.1",
"unplugin": "^1.6.0", "unplugin": "^1.6.0",
"unplugin-vue-router": "^0.7.0", "unplugin-vue-router": "^0.7.0",
"untyped": "^1.4.0", "untyped": "^1.4.2",
"vue": "^3.4.15", "vue": "^3.4.15",
"vue-bundle-renderer": "^2.0.0", "vue-bundle-renderer": "^2.0.0",
"vue-devtools-stub": "^0.1.0", "vue-devtools-stub": "^0.1.0",

View File

@ -12,7 +12,6 @@ import {
resolveSchema as resolveUntypedSchema resolveSchema as resolveUntypedSchema
} from 'untyped' } from 'untyped'
import type { Schema, SchemaDefinition } from 'untyped' import type { Schema, SchemaDefinition } from 'untyped'
// @ts-expect-error TODO: add upstream type
import untypedPlugin from 'untyped/babel-plugin' import untypedPlugin from 'untyped/babel-plugin'
import jiti from 'jiti' import jiti from 'jiti'

View File

@ -43,8 +43,8 @@
"@vitejs/plugin-vue-jsx": "3.1.0", "@vitejs/plugin-vue-jsx": "3.1.0",
"@vue/compiler-core": "3.4.15", "@vue/compiler-core": "3.4.15",
"c12": "1.6.1", "c12": "1.6.1",
"esbuild-loader": "4.0.2", "esbuild-loader": "4.0.3",
"h3": "1.10.0", "h3": "1.10.1",
"ignore": "5.3.0", "ignore": "5.3.0",
"nitropack": "2.8.1", "nitropack": "2.8.1",
"ofetch": "1.3.3", "ofetch": "1.3.3",
@ -56,7 +56,7 @@
"vue-bundle-renderer": "2.0.0", "vue-bundle-renderer": "2.0.0",
"vue-loader": "17.4.2", "vue-loader": "17.4.2",
"vue-router": "4.2.5", "vue-router": "4.2.5",
"webpack": "5.89.0", "webpack": "5.90.0",
"webpack-dev-middleware": "7.0.0" "webpack-dev-middleware": "7.0.0"
}, },
"dependencies": { "dependencies": {
@ -70,7 +70,7 @@
"std-env": "^3.7.0", "std-env": "^3.7.0",
"ufo": "^1.3.2", "ufo": "^1.3.2",
"unimport": "^3.7.1", "unimport": "^3.7.1",
"untyped": "^1.4.0" "untyped": "^1.4.2"
}, },
"engines": { "engines": {
"node": "^14.18.0 || >=16.10.0" "node": "^14.18.0 || >=16.10.0"

View File

@ -98,14 +98,14 @@ export default defineUntypedSchema({
* @type {typeof import('../src/types/config').NuxtAppConfig['head']} * @type {typeof import('../src/types/config').NuxtAppConfig['head']}
*/ */
head: { head: {
$resolve: async (val, get) => { $resolve: async (val: Partial<AppHeadMetaObject> | undefined, get) => {
const resolved: Required<AppHeadMetaObject> = defu(val, await get('meta'), { const resolved = defu(val, await get('meta') as Partial<AppHeadMetaObject>, {
meta: [], meta: [],
link: [], link: [],
style: [], style: [],
script: [], script: [],
noscript: [] noscript: []
}) } as Required<Pick<AppHeadMetaObject, 'meta' | 'link' | 'style' | 'script' | 'noscript'>>)
// provides default charset and viewport if not set // provides default charset and viewport if not set
if (!resolved.meta.find(m => m.charset)?.charset) { if (!resolved.meta.find(m => m.charset)?.charset) {
@ -240,7 +240,7 @@ export default defineUntypedSchema({
* @type {string | boolean} * @type {string | boolean}
*/ */
spaLoadingTemplate: { spaLoadingTemplate: {
$resolve: async (val, get) => typeof val === 'string' ? resolve(await get('srcDir'), val) : val ?? null $resolve: async (val: string | boolean | undefined, get) => typeof val === 'string' ? resolve(await get('srcDir') as string, val) : val ?? null
}, },
/** /**
@ -291,6 +291,6 @@ export default defineUntypedSchema({
* @type {string[]} * @type {string[]}
*/ */
css: { css: {
$resolve: val => (val ?? []).map((c: any) => c.src || c) $resolve: (val: string[] | undefined) => (val ?? []).map((c: any) => c.src || c)
} }
}) })

View File

@ -10,7 +10,7 @@ export default defineUntypedSchema({
* @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }} * @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }}
*/ */
builder: { builder: {
$resolve: async (val, get) => { $resolve: async (val: 'vite' | 'webpack' | { bundle: (nuxt: unknown) => Promise<void> } | undefined = 'vite', get) => {
if (typeof val === 'object') { if (typeof val === 'object') {
return val return val
} }
@ -27,7 +27,7 @@ export default defineUntypedSchema({
* @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }} * @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }}
*/ */
sourcemap: { sourcemap: {
$resolve: async (val, get) => { $resolve: async (val: boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' } | undefined, get) => {
if (typeof val === 'boolean') { if (typeof val === 'boolean') {
return { server: val, client: val } return { server: val, client: val }
} }
@ -46,7 +46,7 @@ export default defineUntypedSchema({
* @type {'silent' | 'info' | 'verbose'} * @type {'silent' | 'info' | 'verbose'}
*/ */
logLevel: { logLevel: {
$resolve: (val) => { $resolve: (val: string | undefined) => {
if (val && !['silent', 'info', 'verbose'].includes(val)) { if (val && !['silent', 'info', 'verbose'].includes(val)) {
consola.warn(`Invalid \`logLevel\` option: \`${val}\`. Must be one of: \`silent\`, \`info\`, \`verbose\`.`) consola.warn(`Invalid \`logLevel\` option: \`${val}\`. Must be one of: \`silent\`, \`info\`, \`verbose\`.`)
} }
@ -71,7 +71,7 @@ export default defineUntypedSchema({
* @type {Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)>} * @type {Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)>}
*/ */
transpile: { transpile: {
$resolve: val => [].concat(val).filter(Boolean) $resolve: (val: Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)> | undefined) => (val || []).filter(Boolean)
}, },
/** /**
@ -109,8 +109,8 @@ export default defineUntypedSchema({
* @type {boolean | { enabled?: boolean } & ((0 extends 1 & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options ? {} : typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options) | typeof import('rollup-plugin-visualizer').PluginVisualizerOptions)} * @type {boolean | { enabled?: boolean } & ((0 extends 1 & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options ? {} : typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options) | typeof import('rollup-plugin-visualizer').PluginVisualizerOptions)}
*/ */
analyze: { analyze: {
$resolve: async (val, get) => { $resolve: async (val: boolean | { enabled?: boolean } | Record<string, unknown>, get) => {
const [rootDir, analyzeDir] = await Promise.all([get('rootDir'), get('analyzeDir')]) const [rootDir, analyzeDir] = await Promise.all([get('rootDir'), get('analyzeDir')]) as [string, string]
return defu(typeof val === 'boolean' ? { enabled: val } : val, { return defu(typeof val === 'boolean' ? { enabled: val } : val, {
template: 'treemap', template: 'treemap',
projectRoot: rootDir, projectRoot: rootDir,
@ -135,15 +135,16 @@ export default defineUntypedSchema({
* @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>} * @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>}
*/ */
keyedComposables: { keyedComposables: {
$resolve: val => [ $resolve: (val: Array<{ name: string, argumentLength: string }> | undefined) => [
{ name: 'callOnce', argumentLength: 2 }, { name: 'callOnce', argumentLength: 2 },
{ name: 'defineNuxtComponent', argumentLength: 2 }, { name: 'defineNuxtComponent', argumentLength: 2 },
{ name: 'useState', argumentLength: 2 }, { name: 'useState', argumentLength: 2 },
{ name: 'useFetch', argumentLength: 3 }, { name: 'useFetch', argumentLength: 3 },
{ name: 'useAsyncData', argumentLength: 3 }, { name: 'useAsyncData', argumentLength: 3 },
{ name: 'useLazyAsyncData', argumentLength: 3 }, { name: 'useLazyAsyncData', argumentLength: 3 },
{ name: 'useLazyFetch', argumentLength: 3 } { name: 'useLazyFetch', argumentLength: 3 },
].concat(val).filter(Boolean) ...val || []
].filter(Boolean)
}, },
/** /**

View File

@ -50,8 +50,8 @@ export default defineUntypedSchema({
* It is normally not needed to configure this option. * It is normally not needed to configure this option.
*/ */
workspaceDir: { workspaceDir: {
$resolve: async (val, get) => { $resolve: async (val: string | undefined, get): Promise<string> => {
const rootDir = await get('rootDir') const rootDir = await get('rootDir') as string
return val ? resolve(rootDir, val) : await findWorkspaceDir(rootDir).catch(() => rootDir) return val ? resolve(rootDir, val) : await findWorkspaceDir(rootDir).catch(() => rootDir)
} }
}, },
@ -88,7 +88,7 @@ export default defineUntypedSchema({
* ``` * ```
*/ */
srcDir: { srcDir: {
$resolve: async (val, get) => resolve(await get('rootDir'), val || '.') $resolve: async (val: string | undefined, get): Promise<string> => resolve(await get('rootDir') as string, val || '.')
}, },
/** /**
@ -99,7 +99,7 @@ export default defineUntypedSchema({
* *
*/ */
serverDir: { serverDir: {
$resolve: async (val, get) => resolve(await get('rootDir'), val || resolve(await get('srcDir'), 'server')) $resolve: async (val: string | undefined, get): Promise<string> => resolve(await get('rootDir') as string, val || resolve(await get('srcDir') as string, 'server'))
}, },
/** /**
@ -115,7 +115,7 @@ export default defineUntypedSchema({
* ``` * ```
*/ */
buildDir: { buildDir: {
$resolve: async (val, get) => resolve(await get('rootDir'), val || '.nuxt') $resolve: async (val: string | undefined, get): Promise<string> => resolve(await get('rootDir') as string, val || '.nuxt')
}, },
/** /**
@ -134,10 +134,10 @@ export default defineUntypedSchema({
*/ */
modulesDir: { modulesDir: {
$default: ['node_modules'], $default: ['node_modules'],
$resolve: async (val, get) => { $resolve: async (val: string[] | undefined, get): Promise<string[]> => {
const rootDir = await get('rootDir') const rootDir = await get('rootDir') as string
return [ return [
...await Promise.all(val.map(async (dir: string) => resolve(rootDir, dir))), ...await Promise.all((val || []).map(async (dir: string) => resolve(rootDir, dir))),
resolve(process.cwd(), 'node_modules') resolve(process.cwd(), 'node_modules')
] ]
} }
@ -149,9 +149,9 @@ export default defineUntypedSchema({
* If a relative path is specified, it will be relative to your `rootDir`. * If a relative path is specified, it will be relative to your `rootDir`.
*/ */
analyzeDir: { analyzeDir: {
$resolve: async (val, get) => val $resolve: async (val: string | undefined, get): Promise<string> => val
? resolve(await get('rootDir'), val) ? resolve(await get('rootDir') as string, val)
: resolve(await get('buildDir'), 'analyze') : resolve(await get('buildDir') as string, 'analyze')
}, },
/** /**
@ -210,7 +210,7 @@ export default defineUntypedSchema({
* @type {(typeof import('../src/types/module').NuxtModule | string | [typeof import('../src/types/module').NuxtModule | string, Record<string, any>] | undefined | null | false)[]} * @type {(typeof import('../src/types/module').NuxtModule | string | [typeof import('../src/types/module').NuxtModule | string, Record<string, any>] | undefined | null | false)[]}
*/ */
modules: { modules: {
$resolve: val => [].concat(val).filter(Boolean) $resolve: (val: string[] | undefined): string[] => (val || []).filter(Boolean)
}, },
/** /**
@ -267,7 +267,7 @@ export default defineUntypedSchema({
* The extensions that should be resolved by the Nuxt resolver. * The extensions that should be resolved by the Nuxt resolver.
*/ */
extensions: { extensions: {
$resolve: val => ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.vue'].concat(val).filter(Boolean) $resolve: (val: string[] | undefined): string[] => ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.vue', ...val || []].filter(Boolean)
}, },
/** /**
@ -311,8 +311,8 @@ export default defineUntypedSchema({
* @type {Record<string, string>} * @type {Record<string, string>}
*/ */
alias: { alias: {
$resolve: async (val, get) => { $resolve: async (val: Record<string, string>, get): Promise<Record<string, string>> => {
const [srcDir, rootDir, assetsDir, publicDir] = await Promise.all([get('srcDir'), get('rootDir'), get('dir.assets'), get('dir.public')]) const [srcDir, rootDir, assetsDir, publicDir] = await Promise.all([get('srcDir'), get('rootDir'), get('dir.assets'), get('dir.public')]) as [string, string, string, string]
return { return {
'~': srcDir, '~': srcDir,
'@': srcDir, '@': srcDir,
@ -351,8 +351,8 @@ export default defineUntypedSchema({
* inside the `ignore` array will be ignored in building. * inside the `ignore` array will be ignored in building.
*/ */
ignore: { ignore: {
$resolve: async (val, get) => { $resolve: async (val: string[] | undefined, get): Promise<string[]> => {
const [rootDir, ignorePrefix, analyzeDir, buildDir] = await Promise.all([get('rootDir'), get('ignorePrefix'), get('analyzeDir'), get('buildDir')]) const [rootDir, ignorePrefix, analyzeDir, buildDir] = await Promise.all([get('rootDir'), get('ignorePrefix'), get('analyzeDir'), get('buildDir')]) as [string, string, string, string]
return [ return [
'**/*.stories.{js,cts,mts,ts,jsx,tsx}', // ignore storybook files '**/*.stories.{js,cts,mts,ts,jsx,tsx}', // ignore storybook files
'**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}', // ignore tests '**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}', // ignore tests
@ -360,8 +360,9 @@ export default defineUntypedSchema({
'**/.{pnpm-store,vercel,netlify,output,git,cache,data}', '**/.{pnpm-store,vercel,netlify,output,git,cache,data}',
relative(rootDir, analyzeDir), relative(rootDir, analyzeDir),
relative(rootDir, buildDir), relative(rootDir, buildDir),
ignorePrefix && `**/${ignorePrefix}*.*` ignorePrefix && `**/${ignorePrefix}*.*`,
].concat(val).filter(Boolean) ...val || []
].filter(Boolean)
} }
}, },
@ -374,7 +375,9 @@ export default defineUntypedSchema({
* @type {Array<string | RegExp>} * @type {Array<string | RegExp>}
*/ */
watch: { watch: {
$resolve: val => [].concat(val).filter((b: unknown) => typeof b === 'string' || b instanceof RegExp) $resolve: (val: Array<unknown> | undefined) => {
return (val || []).filter((b: unknown) => typeof b === 'string' || b instanceof RegExp)
}
}, },
/** /**
@ -455,8 +458,8 @@ export default defineUntypedSchema({
* @type {typeof import('../src/types/config').RuntimeConfig} * @type {typeof import('../src/types/config').RuntimeConfig}
*/ */
runtimeConfig: { runtimeConfig: {
$resolve: async (val: RuntimeConfig, get) => { $resolve: async (val: RuntimeConfig, get): Promise<Record<string, unknown>> => {
const app = await get('app') const app = await get('app') as Record<string, string>
provideFallbackValues(val) provideFallbackValues(val)
return defu(val, { return defu(val, {
public: {}, public: {},

View File

@ -19,9 +19,9 @@ export default defineUntypedSchema({
typescriptBundlerResolution: { typescriptBundlerResolution: {
async $resolve (val, get) { async $resolve (val, get) {
// TODO: remove in v3.10 // TODO: remove in v3.10
val = val ?? await get('experimental').then((e: Record<string, any>) => e?.typescriptBundlerResolution) val = val ?? await (get('experimental') as Promise<Record<string, any>>).then(e => e?.typescriptBundlerResolution)
if (typeof val === 'boolean') { return val } if (typeof val === 'boolean') { return val }
const setting = await get('typescript.tsConfig.compilerOptions.moduleResolution') const setting = await get('typescript.tsConfig.compilerOptions.moduleResolution') as string | undefined
if (setting) { if (setting) {
return setting.toLowerCase() === 'bundler' return setting.toLowerCase() === 'bundler'
} }
@ -43,7 +43,7 @@ export default defineUntypedSchema({
inlineStyles: { inlineStyles: {
async $resolve (val, get) { async $resolve (val, get) {
// TODO: remove in v3.10 // TODO: remove in v3.10
val = val ?? await get('experimental').then((e: Record<string, any>) => e?.inlineSSRStyles) val = val ?? await (get('experimental') as Promise<Record<string, any>>).then((e: Record<string, any>) => e?.inlineSSRStyles)
if (val === false || (await get('dev')) || (await get('ssr')) === false || (await get('builder')) === '@nuxt/webpack-builder') { if (val === false || (await get('dev')) || (await get('ssr')) === false || (await get('builder')) === '@nuxt/webpack-builder') {
return false return false
} }
@ -59,7 +59,7 @@ export default defineUntypedSchema({
noScripts: { noScripts: {
async $resolve (val, get) { async $resolve (val, get) {
// TODO: remove in v3.10 // TODO: remove in v3.10
return val ?? await get('experimental').then((e: Record<string, any>) => e?.noScripts) ?? false return val ?? await (get('experimental') as Promise<Record<string, any>>).then((e: Record<string, any>) => e?.noScripts) ?? false
} }
}, },
}, },

View File

@ -8,8 +8,8 @@ export default defineUntypedSchema({
*/ */
nitro: { nitro: {
routeRules: { routeRules: {
$resolve: async (val, get) => ({ $resolve: async (val: Record<string, any> | undefined, get) => ({
...await get('routeRules'), ...await get('routeRules') as Record<string, any>,
...val ...val
}) })
} }

View File

@ -20,8 +20,8 @@ export default defineUntypedSchema({
$resolve: async (val, get) => val ?? (await get('dev') ? 'development' : 'production') $resolve: async (val, get) => val ?? (await get('dev') ? 'development' : 'production')
}, },
define: { define: {
$resolve: async (val, get) => { $resolve: async (val: Record<string, any> | undefined, get) => {
const [isDev, isDebug] = await Promise.all([get('dev'), get('debug')]) const [isDev, isDebug] = await Promise.all([get('dev'), get('debug')]) as [boolean, boolean]
return { return {
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDebug, __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDebug,
'process.dev': isDev, 'process.dev': isDev,
@ -40,7 +40,7 @@ export default defineUntypedSchema({
if (val) { if (val) {
consola.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`.') consola.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`.')
} }
return val ?? await Promise.all([get('srcDir'), get('dir')]).then(([srcDir, dir]) => resolve(srcDir, dir.public)) return val ?? await Promise.all([get('srcDir') as Promise<string>, get('dir') as Promise<Record<string, string>>]).then(([srcDir, dir]) => resolve(srcDir, dir.public))
} }
}, },
vue: { vue: {
@ -49,28 +49,28 @@ export default defineUntypedSchema({
}, },
template: { template: {
compilerOptions: { compilerOptions: {
$resolve: async (val, get) => val ?? (await get('vue')).compilerOptions $resolve: async (val, get) => val ?? (await get('vue') as Record<string, any>).compilerOptions
} }
}, },
script: { script: {
propsDestructure: { propsDestructure: {
$resolve: async (val, get) => val ?? Boolean((await get('vue')).propsDestructure) $resolve: async (val, get) => val ?? Boolean((await get('vue') as Record<string, any>).propsDestructure)
} }
} }
}, },
vueJsx: { vueJsx: {
$resolve: async (val, get) => { $resolve: async (val: Record<string, any>, get) => {
return { return {
isCustomElement: (await get('vue')).compilerOptions?.isCustomElement, isCustomElement: (await get('vue') as Record<string, any>).compilerOptions?.isCustomElement,
...val ...val
} }
} }
}, },
optimizeDeps: { optimizeDeps: {
exclude: { exclude: {
$resolve: async (val, get) => [ $resolve: async (val: string[] | undefined, get) => [
...val || [], ...val || [],
...(await get('build.transpile')).filter((i: string) => typeof i === 'string'), ...(await get('build.transpile') as Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)>).filter((i) => typeof i === 'string'),
'vue-demi' 'vue-demi'
] ]
} }
@ -83,15 +83,15 @@ export default defineUntypedSchema({
clearScreen: true, clearScreen: true,
build: { build: {
assetsDir: { assetsDir: {
$resolve: async (val, get) => val ?? withoutLeadingSlash((await get('app')).buildAssetsDir) $resolve: async (val, get) => val ?? withoutLeadingSlash((await get('app') as Record<string, string>).buildAssetsDir)
}, },
emptyOutDir: false emptyOutDir: false
}, },
server: { server: {
fs: { fs: {
allow: { allow: {
$resolve: async (val, get) => { $resolve: async (val: string[] | undefined, get) => {
const [buildDir, srcDir, rootDir, workspaceDir, modulesDir] = await Promise.all([get('buildDir'), get('srcDir'), get('rootDir'), get('workspaceDir'), get('modulesDir')]) const [buildDir, srcDir, rootDir, workspaceDir, modulesDir] = await Promise.all([get('buildDir'), get('srcDir'), get('rootDir'), get('workspaceDir'), get('modulesDir')]) as [string, string, string, string, string]
return [ return [
buildDir, buildDir,
srcDir, srcDir,

View File

@ -16,8 +16,9 @@ export default defineUntypedSchema({
* @type {boolean | { enabled?: boolean } & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options} * @type {boolean | { enabled?: boolean } & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options}
*/ */
analyze: { analyze: {
$resolve: async (val, get) => { $resolve: async (val: boolean | { enabled?: boolean } | Record<string, unknown>, get) => {
return defu(val, await get('build.analyze')) const value = typeof val === 'boolean' ? { enabled: val } : val
return defu(value, await get('build.analyze') as { enabled?: boolean } | Record<string, unknown>)
} }
}, },
@ -137,17 +138,18 @@ export default defineUntypedSchema({
*/ */
loaders: { loaders: {
$resolve: async (val, get) => { $resolve: async (val, get) => {
const loaders: Record<string, any> = val && typeof val === 'object' ? val : {}
const styleLoaders = [ const styleLoaders = [
'css', 'cssModules', 'less', 'css', 'cssModules', 'less',
'sass', 'scss', 'stylus', 'vueStyle' 'sass', 'scss', 'stylus', 'vueStyle'
] ]
for (const name of styleLoaders) { for (const name of styleLoaders) {
const loader = val[name] const loader = loaders[name]
if (loader && loader.sourceMap === undefined) { if (loader && loader.sourceMap === undefined) {
loader.sourceMap = Boolean(await get('build.cssSourceMap')) loader.sourceMap = Boolean(await get('build.cssSourceMap'))
} }
} }
return val return loaders
}, },
/** /**

View File

@ -41,13 +41,13 @@
"consola": "^3.2.3", "consola": "^3.2.3",
"cssnano": "^6.0.3", "cssnano": "^6.0.3",
"defu": "^6.1.4", "defu": "^6.1.4",
"esbuild": "^0.19.11", "esbuild": "^0.20.0",
"escape-string-regexp": "^5.0.0", "escape-string-regexp": "^5.0.0",
"estree-walker": "^3.0.3", "estree-walker": "^3.0.3",
"externality": "^1.0.2", "externality": "^1.0.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"get-port-please": "^3.1.2", "get-port-please": "^3.1.2",
"h3": "^1.10.0", "h3": "^1.10.1",
"knitwork": "^1.0.0", "knitwork": "^1.0.0",
"magic-string": "^0.30.5", "magic-string": "^0.30.5",
"mlly": "^1.5.0", "mlly": "^1.5.0",

View File

@ -32,13 +32,13 @@
"css-minimizer-webpack-plugin": "^6.0.0", "css-minimizer-webpack-plugin": "^6.0.0",
"cssnano": "^6.0.3", "cssnano": "^6.0.3",
"defu": "^6.1.4", "defu": "^6.1.4",
"esbuild-loader": "^4.0.2", "esbuild-loader": "^4.0.3",
"escape-string-regexp": "^5.0.0", "escape-string-regexp": "^5.0.0",
"estree-walker": "^3.0.3", "estree-walker": "^3.0.3",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.2", "fork-ts-checker-webpack-plugin": "^9.0.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"h3": "^1.10.0", "h3": "^1.10.1",
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"lodash-es": "4.17.21", "lodash-es": "4.17.21",
"magic-string": "^0.30.5", "magic-string": "^0.30.5",
@ -62,7 +62,7 @@
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"vue-bundle-renderer": "^2.0.0", "vue-bundle-renderer": "^2.0.0",
"vue-loader": "^17.4.2", "vue-loader": "^17.4.2",
"webpack": "^5.89.0", "webpack": "^5.90.0",
"webpack-bundle-analyzer": "^4.10.1", "webpack-bundle-analyzer": "^4.10.1",
"webpack-dev-middleware": "^7.0.0", "webpack-dev-middleware": "^7.0.0",
"webpack-hot-middleware": "^2.26.0", "webpack-hot-middleware": "^2.26.0",

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"201k"`) expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"201k"`)
const modules = await analyzeSizes('node_modules/**/*', serverDir) const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1337k"`) expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1331k"`)
const packages = modules.files const packages = modules.files
.filter(m => m.endsWith('package.json')) .filter(m => m.endsWith('package.json'))
@ -72,7 +72,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
const serverDir = join(rootDir, '.output-inline/server') const serverDir = join(rootDir, '.output-inline/server')
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir) const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"519k"`) expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"520k"`)
const modules = await analyzeSizes('node_modules/**/*', serverDir) const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"77.2k"`) expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"77.2k"`)