mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
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:
parent
0d91e52211
commit
7d65769496
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@ -57,7 +57,7 @@ jobs:
|
||||
run: pnpm build
|
||||
|
||||
- name: Cache dist
|
||||
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
|
||||
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
|
||||
with:
|
||||
retention-days: 3
|
||||
name: dist
|
||||
@ -85,7 +85,7 @@ jobs:
|
||||
run: pnpm install
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1
|
||||
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
|
||||
with:
|
||||
languages: javascript
|
||||
queries: +security-and-quality
|
||||
@ -97,7 +97,7 @@ jobs:
|
||||
path: packages
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1
|
||||
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
|
||||
with:
|
||||
category: "/language:javascript"
|
||||
|
||||
@ -258,7 +258,7 @@ jobs:
|
||||
TEST_CONTEXT: ${{ matrix.context }}
|
||||
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'
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
4
.github/workflows/scorecards.yml
vendored
4
.github/workflows/scorecards.yml
vendored
@ -58,7 +58,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
|
||||
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@ -66,6 +66,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- 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:
|
||||
sarif_file: results.sarif
|
||||
|
@ -138,22 +138,22 @@ 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.
|
||||
|
||||
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`
|
||||
| [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`
|
||||
| [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/api/nuxt-config#webpack-1) 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`
|
||||
[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`
|
||||
|
||||
Here is a list of other common config files:
|
||||
|
||||
Name | Config File | How To Configure
|
||||
|----------------------------------------------|-------------------------|--------------------------
|
||||
| [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)
|
||||
| [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)
|
||||
| [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)
|
||||
---------------------------------------------|-------------------------|--------------------------
|
||||
[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)
|
||||
[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)
|
||||
[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)
|
||||
|
||||
## Vue Configuration
|
||||
|
||||
|
@ -66,10 +66,10 @@ Each active version has its own nightly releases which are generated automatical
|
||||
|
||||
Release | | Initial release | End Of Life | Docs
|
||||
----------------------------------------|---------------------------------------------------------------------------------------------------|-----------------|--------------|-------
|
||||
**4.x** (scheduled) | | 2024 Q1 | |
|
||||
**4.x** (scheduled) | | 2024 Q1 | |
|
||||
**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)
|
||||
**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 |
|
||||
|
||||
### Support Status
|
||||
|
||||
|
20
package.json
20
package.json
@ -36,7 +36,7 @@
|
||||
"@nuxt/schema": "workspace:*",
|
||||
"@nuxt/vite-builder": "workspace:*",
|
||||
"@nuxt/webpack-builder": "workspace:*",
|
||||
"rollup": "^4.9.5",
|
||||
"rollup": "^4.9.6",
|
||||
"nuxt": "workspace:*",
|
||||
"vite": "5.0.12",
|
||||
"vue": "3.4.15",
|
||||
@ -48,32 +48,32 @@
|
||||
"@nuxt/test-utils": "3.11.0",
|
||||
"@nuxt/webpack-builder": "workspace:*",
|
||||
"@types/fs-extra": "11.0.4",
|
||||
"@types/node": "20.11.5",
|
||||
"@types/node": "20.11.10",
|
||||
"@types/semver": "7.5.6",
|
||||
"@vitest/coverage-v8": "1.2.2",
|
||||
"@vue/test-utils": "2.4.3",
|
||||
"@vue/test-utils": "2.4.4",
|
||||
"case-police": "0.6.1",
|
||||
"changelogen": "0.5.5",
|
||||
"consola": "3.2.3",
|
||||
"devalue": "4.3.2",
|
||||
"eslint": "8.56.0",
|
||||
"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-unicorn": "50.0.1",
|
||||
"execa": "8.0.1",
|
||||
"fs-extra": "11.2.0",
|
||||
"globby": "14.0.0",
|
||||
"h3": "1.10.0",
|
||||
"happy-dom": "13.2.0",
|
||||
"h3": "1.10.1",
|
||||
"happy-dom": "13.3.4",
|
||||
"jiti": "1.21.0",
|
||||
"markdownlint-cli": "0.38.0",
|
||||
"markdownlint-cli": "0.39.0",
|
||||
"nitropack": "2.8.1",
|
||||
"nuxi": "3.10.0",
|
||||
"nuxt": "workspace:*",
|
||||
"ofetch": "1.3.3",
|
||||
"pathe": "1.1.2",
|
||||
"playwright-core": "1.41.0",
|
||||
"playwright-core": "1.41.1",
|
||||
"rimraf": "5.0.5",
|
||||
"semver": "7.5.4",
|
||||
"std-env": "3.7.0",
|
||||
@ -82,11 +82,11 @@
|
||||
"vitest": "1.2.2",
|
||||
"vitest-environment-nuxt": "1.0.0",
|
||||
"vue": "3.4.15",
|
||||
"vue-eslint-parser": "9.4.0",
|
||||
"vue-eslint-parser": "9.4.2",
|
||||
"vue-router": "4.2.5",
|
||||
"vue-tsc": "1.8.27"
|
||||
},
|
||||
"packageManager": "pnpm@8.14.1",
|
||||
"packageManager": "pnpm@8.15.0",
|
||||
"engines": {
|
||||
"node": "^14.18.0 || >=16.10.0"
|
||||
},
|
||||
|
@ -43,7 +43,7 @@
|
||||
"ufo": "^1.3.2",
|
||||
"unctx": "^2.3.1",
|
||||
"unimport": "^3.7.1",
|
||||
"untyped": "^1.4.0"
|
||||
"untyped": "^1.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/hash-sum": "1.0.2",
|
||||
@ -54,7 +54,7 @@
|
||||
"unbuild": "latest",
|
||||
"vite": "5.0.12",
|
||||
"vitest": "1.2.2",
|
||||
"webpack": "5.89.0"
|
||||
"webpack": "5.90.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.18.0 || >=16.10.0"
|
||||
|
@ -77,12 +77,12 @@
|
||||
"defu": "^6.1.4",
|
||||
"destr": "^2.0.2",
|
||||
"devalue": "^4.3.2",
|
||||
"esbuild": "^0.19.11",
|
||||
"esbuild": "^0.20.0",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"estree-walker": "^3.0.3",
|
||||
"fs-extra": "^11.2.0",
|
||||
"globby": "^14.0.0",
|
||||
"h3": "^1.10.0",
|
||||
"h3": "^1.10.1",
|
||||
"hookable": "^5.5.3",
|
||||
"jiti": "^1.21.0",
|
||||
"klona": "^2.0.6",
|
||||
@ -91,7 +91,7 @@
|
||||
"mlly": "^1.5.0",
|
||||
"nitropack": "^2.8.1",
|
||||
"nuxi": "^3.10.0",
|
||||
"nypm": "^0.3.4",
|
||||
"nypm": "^0.3.6",
|
||||
"ofetch": "^1.3.3",
|
||||
"ohash": "^1.1.3",
|
||||
"pathe": "^1.1.2",
|
||||
@ -109,7 +109,7 @@
|
||||
"unimport": "^3.7.1",
|
||||
"unplugin": "^1.6.0",
|
||||
"unplugin-vue-router": "^0.7.0",
|
||||
"untyped": "^1.4.0",
|
||||
"untyped": "^1.4.2",
|
||||
"vue": "^3.4.15",
|
||||
"vue-bundle-renderer": "^2.0.0",
|
||||
"vue-devtools-stub": "^0.1.0",
|
||||
|
@ -12,7 +12,6 @@ import {
|
||||
resolveSchema as resolveUntypedSchema
|
||||
} from 'untyped'
|
||||
import type { Schema, SchemaDefinition } from 'untyped'
|
||||
// @ts-expect-error TODO: add upstream type
|
||||
import untypedPlugin from 'untyped/babel-plugin'
|
||||
import jiti from 'jiti'
|
||||
|
||||
|
@ -43,8 +43,8 @@
|
||||
"@vitejs/plugin-vue-jsx": "3.1.0",
|
||||
"@vue/compiler-core": "3.4.15",
|
||||
"c12": "1.6.1",
|
||||
"esbuild-loader": "4.0.2",
|
||||
"h3": "1.10.0",
|
||||
"esbuild-loader": "4.0.3",
|
||||
"h3": "1.10.1",
|
||||
"ignore": "5.3.0",
|
||||
"nitropack": "2.8.1",
|
||||
"ofetch": "1.3.3",
|
||||
@ -56,7 +56,7 @@
|
||||
"vue-bundle-renderer": "2.0.0",
|
||||
"vue-loader": "17.4.2",
|
||||
"vue-router": "4.2.5",
|
||||
"webpack": "5.89.0",
|
||||
"webpack": "5.90.0",
|
||||
"webpack-dev-middleware": "7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -70,7 +70,7 @@
|
||||
"std-env": "^3.7.0",
|
||||
"ufo": "^1.3.2",
|
||||
"unimport": "^3.7.1",
|
||||
"untyped": "^1.4.0"
|
||||
"untyped": "^1.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.18.0 || >=16.10.0"
|
||||
|
@ -98,14 +98,14 @@ export default defineUntypedSchema({
|
||||
* @type {typeof import('../src/types/config').NuxtAppConfig['head']}
|
||||
*/
|
||||
head: {
|
||||
$resolve: async (val, get) => {
|
||||
const resolved: Required<AppHeadMetaObject> = defu(val, await get('meta'), {
|
||||
$resolve: async (val: Partial<AppHeadMetaObject> | undefined, get) => {
|
||||
const resolved = defu(val, await get('meta') as Partial<AppHeadMetaObject>, {
|
||||
meta: [],
|
||||
link: [],
|
||||
style: [],
|
||||
script: [],
|
||||
noscript: []
|
||||
})
|
||||
} as Required<Pick<AppHeadMetaObject, 'meta' | 'link' | 'style' | 'script' | 'noscript'>>)
|
||||
|
||||
// provides default charset and viewport if not set
|
||||
if (!resolved.meta.find(m => m.charset)?.charset) {
|
||||
@ -240,7 +240,7 @@ export default defineUntypedSchema({
|
||||
* @type {string | boolean}
|
||||
*/
|
||||
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[]}
|
||||
*/
|
||||
css: {
|
||||
$resolve: val => (val ?? []).map((c: any) => c.src || c)
|
||||
$resolve: (val: string[] | undefined) => (val ?? []).map((c: any) => c.src || c)
|
||||
}
|
||||
})
|
||||
|
@ -10,7 +10,7 @@ export default defineUntypedSchema({
|
||||
* @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }}
|
||||
*/
|
||||
builder: {
|
||||
$resolve: async (val, get) => {
|
||||
$resolve: async (val: 'vite' | 'webpack' | { bundle: (nuxt: unknown) => Promise<void> } | undefined = 'vite', get) => {
|
||||
if (typeof val === 'object') {
|
||||
return val
|
||||
}
|
||||
@ -27,7 +27,7 @@ export default defineUntypedSchema({
|
||||
* @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }}
|
||||
*/
|
||||
sourcemap: {
|
||||
$resolve: async (val, get) => {
|
||||
$resolve: async (val: boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' } | undefined, get) => {
|
||||
if (typeof val === 'boolean') {
|
||||
return { server: val, client: val }
|
||||
}
|
||||
@ -46,7 +46,7 @@ export default defineUntypedSchema({
|
||||
* @type {'silent' | 'info' | 'verbose'}
|
||||
*/
|
||||
logLevel: {
|
||||
$resolve: (val) => {
|
||||
$resolve: (val: string | undefined) => {
|
||||
if (val && !['silent', 'info', 'verbose'].includes(val)) {
|
||||
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)>}
|
||||
*/
|
||||
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)}
|
||||
*/
|
||||
analyze: {
|
||||
$resolve: async (val, get) => {
|
||||
const [rootDir, analyzeDir] = await Promise.all([get('rootDir'), get('analyzeDir')])
|
||||
$resolve: async (val: boolean | { enabled?: boolean } | Record<string, unknown>, get) => {
|
||||
const [rootDir, analyzeDir] = await Promise.all([get('rootDir'), get('analyzeDir')]) as [string, string]
|
||||
return defu(typeof val === 'boolean' ? { enabled: val } : val, {
|
||||
template: 'treemap',
|
||||
projectRoot: rootDir,
|
||||
@ -135,15 +135,16 @@ export default defineUntypedSchema({
|
||||
* @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>}
|
||||
*/
|
||||
keyedComposables: {
|
||||
$resolve: val => [
|
||||
$resolve: (val: Array<{ name: string, argumentLength: string }> | undefined) => [
|
||||
{ name: 'callOnce', argumentLength: 2 },
|
||||
{ name: 'defineNuxtComponent', argumentLength: 2 },
|
||||
{ name: 'useState', argumentLength: 2 },
|
||||
{ name: 'useFetch', argumentLength: 3 },
|
||||
{ name: 'useAsyncData', argumentLength: 3 },
|
||||
{ name: 'useLazyAsyncData', argumentLength: 3 },
|
||||
{ name: 'useLazyFetch', argumentLength: 3 }
|
||||
].concat(val).filter(Boolean)
|
||||
{ name: 'useLazyFetch', argumentLength: 3 },
|
||||
...val || []
|
||||
].filter(Boolean)
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -50,8 +50,8 @@ export default defineUntypedSchema({
|
||||
* It is normally not needed to configure this option.
|
||||
*/
|
||||
workspaceDir: {
|
||||
$resolve: async (val, get) => {
|
||||
const rootDir = await get('rootDir')
|
||||
$resolve: async (val: string | undefined, get): Promise<string> => {
|
||||
const rootDir = await get('rootDir') as string
|
||||
return val ? resolve(rootDir, val) : await findWorkspaceDir(rootDir).catch(() => rootDir)
|
||||
}
|
||||
},
|
||||
@ -88,7 +88,7 @@ export default defineUntypedSchema({
|
||||
* ```
|
||||
*/
|
||||
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: {
|
||||
$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: {
|
||||
$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: {
|
||||
$default: ['node_modules'],
|
||||
$resolve: async (val, get) => {
|
||||
const rootDir = await get('rootDir')
|
||||
$resolve: async (val: string[] | undefined, get): Promise<string[]> => {
|
||||
const rootDir = await get('rootDir') as string
|
||||
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')
|
||||
]
|
||||
}
|
||||
@ -149,9 +149,9 @@ export default defineUntypedSchema({
|
||||
* If a relative path is specified, it will be relative to your `rootDir`.
|
||||
*/
|
||||
analyzeDir: {
|
||||
$resolve: async (val, get) => val
|
||||
? resolve(await get('rootDir'), val)
|
||||
: resolve(await get('buildDir'), 'analyze')
|
||||
$resolve: async (val: string | undefined, get): Promise<string> => val
|
||||
? resolve(await get('rootDir') as string, val)
|
||||
: 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)[]}
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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>}
|
||||
*/
|
||||
alias: {
|
||||
$resolve: async (val, get) => {
|
||||
const [srcDir, rootDir, assetsDir, publicDir] = await Promise.all([get('srcDir'), get('rootDir'), get('dir.assets'), get('dir.public')])
|
||||
$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')]) as [string, string, string, string]
|
||||
return {
|
||||
'~': srcDir,
|
||||
'@': srcDir,
|
||||
@ -351,8 +351,8 @@ export default defineUntypedSchema({
|
||||
* inside the `ignore` array will be ignored in building.
|
||||
*/
|
||||
ignore: {
|
||||
$resolve: async (val, get) => {
|
||||
const [rootDir, ignorePrefix, analyzeDir, buildDir] = await Promise.all([get('rootDir'), get('ignorePrefix'), get('analyzeDir'), get('buildDir')])
|
||||
$resolve: async (val: string[] | undefined, get): Promise<string[]> => {
|
||||
const [rootDir, ignorePrefix, analyzeDir, buildDir] = await Promise.all([get('rootDir'), get('ignorePrefix'), get('analyzeDir'), get('buildDir')]) as [string, string, string, string]
|
||||
return [
|
||||
'**/*.stories.{js,cts,mts,ts,jsx,tsx}', // ignore storybook files
|
||||
'**/*.{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}',
|
||||
relative(rootDir, analyzeDir),
|
||||
relative(rootDir, buildDir),
|
||||
ignorePrefix && `**/${ignorePrefix}*.*`
|
||||
].concat(val).filter(Boolean)
|
||||
ignorePrefix && `**/${ignorePrefix}*.*`,
|
||||
...val || []
|
||||
].filter(Boolean)
|
||||
}
|
||||
},
|
||||
|
||||
@ -374,7 +375,9 @@ export default defineUntypedSchema({
|
||||
* @type {Array<string | RegExp>}
|
||||
*/
|
||||
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}
|
||||
*/
|
||||
runtimeConfig: {
|
||||
$resolve: async (val: RuntimeConfig, get) => {
|
||||
const app = await get('app')
|
||||
$resolve: async (val: RuntimeConfig, get): Promise<Record<string, unknown>> => {
|
||||
const app = await get('app') as Record<string, string>
|
||||
provideFallbackValues(val)
|
||||
return defu(val, {
|
||||
public: {},
|
||||
|
@ -19,9 +19,9 @@ export default defineUntypedSchema({
|
||||
typescriptBundlerResolution: {
|
||||
async $resolve (val, get) {
|
||||
// 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 }
|
||||
const setting = await get('typescript.tsConfig.compilerOptions.moduleResolution')
|
||||
const setting = await get('typescript.tsConfig.compilerOptions.moduleResolution') as string | undefined
|
||||
if (setting) {
|
||||
return setting.toLowerCase() === 'bundler'
|
||||
}
|
||||
@ -43,7 +43,7 @@ export default defineUntypedSchema({
|
||||
inlineStyles: {
|
||||
async $resolve (val, get) {
|
||||
// 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') {
|
||||
return false
|
||||
}
|
||||
@ -59,7 +59,7 @@ export default defineUntypedSchema({
|
||||
noScripts: {
|
||||
async $resolve (val, get) {
|
||||
// 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
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -8,8 +8,8 @@ export default defineUntypedSchema({
|
||||
*/
|
||||
nitro: {
|
||||
routeRules: {
|
||||
$resolve: async (val, get) => ({
|
||||
...await get('routeRules'),
|
||||
$resolve: async (val: Record<string, any> | undefined, get) => ({
|
||||
...await get('routeRules') as Record<string, any>,
|
||||
...val
|
||||
})
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ export default defineUntypedSchema({
|
||||
$resolve: async (val, get) => val ?? (await get('dev') ? 'development' : 'production')
|
||||
},
|
||||
define: {
|
||||
$resolve: async (val, get) => {
|
||||
const [isDev, isDebug] = await Promise.all([get('dev'), get('debug')])
|
||||
$resolve: async (val: Record<string, any> | undefined, get) => {
|
||||
const [isDev, isDebug] = await Promise.all([get('dev'), get('debug')]) as [boolean, boolean]
|
||||
return {
|
||||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDebug,
|
||||
'process.dev': isDev,
|
||||
@ -40,7 +40,7 @@ export default defineUntypedSchema({
|
||||
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`.')
|
||||
}
|
||||
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: {
|
||||
@ -49,28 +49,28 @@ export default defineUntypedSchema({
|
||||
},
|
||||
template: {
|
||||
compilerOptions: {
|
||||
$resolve: async (val, get) => val ?? (await get('vue')).compilerOptions
|
||||
$resolve: async (val, get) => val ?? (await get('vue') as Record<string, any>).compilerOptions
|
||||
}
|
||||
},
|
||||
script: {
|
||||
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: {
|
||||
$resolve: async (val, get) => {
|
||||
$resolve: async (val: Record<string, any>, get) => {
|
||||
return {
|
||||
isCustomElement: (await get('vue')).compilerOptions?.isCustomElement,
|
||||
isCustomElement: (await get('vue') as Record<string, any>).compilerOptions?.isCustomElement,
|
||||
...val
|
||||
}
|
||||
}
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: {
|
||||
$resolve: async (val, get) => [
|
||||
$resolve: async (val: string[] | undefined, get) => [
|
||||
...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'
|
||||
]
|
||||
}
|
||||
@ -83,15 +83,15 @@ export default defineUntypedSchema({
|
||||
clearScreen: true,
|
||||
build: {
|
||||
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
|
||||
},
|
||||
server: {
|
||||
fs: {
|
||||
allow: {
|
||||
$resolve: async (val, get) => {
|
||||
const [buildDir, srcDir, rootDir, workspaceDir, modulesDir] = await Promise.all([get('buildDir'), get('srcDir'), get('rootDir'), get('workspaceDir'), get('modulesDir')])
|
||||
$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')]) as [string, string, string, string, string]
|
||||
return [
|
||||
buildDir,
|
||||
srcDir,
|
||||
|
@ -16,8 +16,9 @@ export default defineUntypedSchema({
|
||||
* @type {boolean | { enabled?: boolean } & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options}
|
||||
*/
|
||||
analyze: {
|
||||
$resolve: async (val, get) => {
|
||||
return defu(val, await get('build.analyze'))
|
||||
$resolve: async (val: boolean | { enabled?: boolean } | Record<string, unknown>, get) => {
|
||||
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: {
|
||||
$resolve: async (val, get) => {
|
||||
const loaders: Record<string, any> = val && typeof val === 'object' ? val : {}
|
||||
const styleLoaders = [
|
||||
'css', 'cssModules', 'less',
|
||||
'sass', 'scss', 'stylus', 'vueStyle'
|
||||
]
|
||||
for (const name of styleLoaders) {
|
||||
const loader = val[name]
|
||||
const loader = loaders[name]
|
||||
if (loader && loader.sourceMap === undefined) {
|
||||
loader.sourceMap = Boolean(await get('build.cssSourceMap'))
|
||||
}
|
||||
}
|
||||
return val
|
||||
return loaders
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -41,13 +41,13 @@
|
||||
"consola": "^3.2.3",
|
||||
"cssnano": "^6.0.3",
|
||||
"defu": "^6.1.4",
|
||||
"esbuild": "^0.19.11",
|
||||
"esbuild": "^0.20.0",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"estree-walker": "^3.0.3",
|
||||
"externality": "^1.0.2",
|
||||
"fs-extra": "^11.2.0",
|
||||
"get-port-please": "^3.1.2",
|
||||
"h3": "^1.10.0",
|
||||
"h3": "^1.10.1",
|
||||
"knitwork": "^1.0.0",
|
||||
"magic-string": "^0.30.5",
|
||||
"mlly": "^1.5.0",
|
||||
|
@ -32,13 +32,13 @@
|
||||
"css-minimizer-webpack-plugin": "^6.0.0",
|
||||
"cssnano": "^6.0.3",
|
||||
"defu": "^6.1.4",
|
||||
"esbuild-loader": "^4.0.2",
|
||||
"esbuild-loader": "^4.0.3",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"estree-walker": "^3.0.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
||||
"fs-extra": "^11.2.0",
|
||||
"h3": "^1.10.0",
|
||||
"h3": "^1.10.1",
|
||||
"hash-sum": "^2.0.0",
|
||||
"lodash-es": "4.17.21",
|
||||
"magic-string": "^0.30.5",
|
||||
@ -62,7 +62,7 @@
|
||||
"url-loader": "^4.1.1",
|
||||
"vue-bundle-renderer": "^2.0.0",
|
||||
"vue-loader": "^17.4.2",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack": "^5.90.0",
|
||||
"webpack-bundle-analyzer": "^4.10.1",
|
||||
"webpack-dev-middleware": "^7.0.0",
|
||||
"webpack-hot-middleware": "^2.26.0",
|
||||
|
1195
pnpm-lock.yaml
1195
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"201k"`)
|
||||
|
||||
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
|
||||
.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 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)
|
||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"77.2k"`)
|
||||
|
Loading…
Reference in New Issue
Block a user