mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 00:23:53 +00:00
chore(deps): update all non-major dependencies (3.x) (#28302)
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
b02d4fec68
commit
17ff2d5c98
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -57,7 +57,7 @@ jobs:
|
||||
run: pnpm build
|
||||
|
||||
- name: Cache dist
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
|
||||
with:
|
||||
retention-days: 3
|
||||
name: dist
|
||||
@ -85,7 +85,7 @@ jobs:
|
||||
run: pnpm install
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
|
||||
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
||||
with:
|
||||
languages: javascript
|
||||
queries: +security-and-quality
|
||||
@ -97,7 +97,7 @@ jobs:
|
||||
path: packages
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
|
||||
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
||||
with:
|
||||
category: "/language:javascript"
|
||||
|
||||
|
6
.github/workflows/scorecards.yml
vendored
6
.github/workflows/scorecards.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
|
||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@ -59,7 +59,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@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
|
||||
if: github.repository == 'nuxt/nuxt' && success()
|
||||
with:
|
||||
name: SARIF file
|
||||
@ -68,7 +68,7 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
|
||||
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
||||
if: github.repository == 'nuxt/nuxt' && success()
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
@ -3,7 +3,6 @@ import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
|
||||
// @ts-expect-error missing types
|
||||
import noOnlyTests from 'eslint-plugin-no-only-tests'
|
||||
import typegen from 'eslint-typegen'
|
||||
// @ts-expect-error missing types
|
||||
import perfectionist from 'eslint-plugin-perfectionist'
|
||||
|
||||
export default createConfigForNuxt({
|
||||
@ -189,6 +188,7 @@ export default createConfigForNuxt({
|
||||
},
|
||||
},
|
||||
// Sort rule keys in eslint config
|
||||
// @ts-expect-error incorrect types 🤔
|
||||
{
|
||||
files: ['**/eslint.config.mjs'],
|
||||
name: 'local/sort-eslint-config',
|
||||
|
31
package.json
31
package.json
@ -39,36 +39,37 @@
|
||||
"@nuxt/ui-templates": "workspace:*",
|
||||
"@nuxt/vite-builder": "workspace:*",
|
||||
"@nuxt/webpack-builder": "workspace:*",
|
||||
"magic-string": "^0.30.10",
|
||||
"@types/node": "*",
|
||||
"magic-string": "^0.30.11",
|
||||
"nuxt": "workspace:*",
|
||||
"rollup": "^4.19.0",
|
||||
"vite": "5.3.4",
|
||||
"rollup": "^4.20.0",
|
||||
"vite": "5.3.5",
|
||||
"vue": "3.4.33"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.7.0",
|
||||
"@nuxt/eslint-config": "0.3.13",
|
||||
"@eslint/js": "9.8.0",
|
||||
"@nuxt/eslint-config": "0.5.0",
|
||||
"@nuxt/kit": "workspace:*",
|
||||
"@nuxt/test-utils": "3.13.1",
|
||||
"@nuxt/test-utils": "3.14.0",
|
||||
"@nuxt/webpack-builder": "workspace:*",
|
||||
"@testing-library/vue": "8.1.0",
|
||||
"@types/eslint__js": "8.42.3",
|
||||
"@types/node": "20.14.12",
|
||||
"@types/node": "20.14.14",
|
||||
"@types/semver": "7.5.8",
|
||||
"@unhead/schema": "1.9.16",
|
||||
"@vitejs/plugin-vue": "5.1.0",
|
||||
"@vitejs/plugin-vue": "5.1.2",
|
||||
"@vitest/coverage-v8": "2.0.5",
|
||||
"@vue/test-utils": "2.4.6",
|
||||
"autoprefixer": "10.4.19",
|
||||
"autoprefixer": "10.4.20",
|
||||
"case-police": "0.6.1",
|
||||
"changelogen": "0.5.5",
|
||||
"consola": "3.2.3",
|
||||
"cssnano": "7.0.4",
|
||||
"devalue": "5.0.0",
|
||||
"eslint": "9.7.0",
|
||||
"eslint": "9.8.0",
|
||||
"eslint-plugin-no-only-tests": "3.1.0",
|
||||
"eslint-plugin-perfectionist": "2.11.0",
|
||||
"eslint-typegen": "0.2.4",
|
||||
"eslint-plugin-perfectionist": "3.1.2",
|
||||
"eslint-typegen": "0.3.0",
|
||||
"execa": "9.3.0",
|
||||
"globby": "14.0.2",
|
||||
"h3": "1.12.0",
|
||||
@ -78,7 +79,7 @@
|
||||
"nitropack": "2.9.7",
|
||||
"nuxi": "3.12.0",
|
||||
"nuxt": "workspace:*",
|
||||
"nuxt-content-twoslash": "0.1.0",
|
||||
"nuxt-content-twoslash": "0.1.1",
|
||||
"ofetch": "1.3.4",
|
||||
"pathe": "1.1.2",
|
||||
"playwright-core": "1.45.3",
|
||||
@ -90,8 +91,8 @@
|
||||
"vitest": "2.0.5",
|
||||
"vitest-environment-nuxt": "1.0.0",
|
||||
"vue": "3.4.33",
|
||||
"vue-router": "4.4.0",
|
||||
"vue-tsc": "2.0.28"
|
||||
"vue-router": "4.4.2",
|
||||
"vue-tsc": "2.0.29"
|
||||
},
|
||||
"packageManager": "pnpm@9.6.0",
|
||||
"engines": {
|
||||
|
@ -44,7 +44,7 @@
|
||||
"semver": "^7.6.3",
|
||||
"ufo": "^1.5.4",
|
||||
"unctx": "^2.3.1",
|
||||
"unimport": "^3.9.0",
|
||||
"unimport": "^3.10.0",
|
||||
"untyped": "^1.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -54,7 +54,7 @@
|
||||
"lodash-es": "4.17.21",
|
||||
"nitropack": "2.9.7",
|
||||
"unbuild": "latest",
|
||||
"vite": "5.3.4",
|
||||
"vite": "5.3.5",
|
||||
"vitest": "2.0.5",
|
||||
"webpack": "5.93.0"
|
||||
},
|
||||
|
@ -30,8 +30,10 @@ export interface ExtendConfigOptions {
|
||||
prepend?: boolean
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface ExtendWebpackConfigOptions extends ExtendConfigOptions {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface ExtendViteConfigOptions extends ExtendConfigOptions {}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,7 @@ function clearRequireCache (id: string) {
|
||||
function getRequireCacheItem (id: string) {
|
||||
try {
|
||||
return _require.cache[id]
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// ignore issues accessing require.cache
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import { globby } from 'globby'
|
||||
import defu from 'defu'
|
||||
|
||||
export interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig>, 'overrides'> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
overrides?: Exclude<LoadConfigOptions<NuxtConfig>['overrides'], Promise<any> | Function>
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ export function getDirectory (p: string) {
|
||||
// we need to target directories instead of module file paths themselves
|
||||
// /home/user/project/node_modules/module/index.js -> /home/user/project/node_modules/module
|
||||
return isAbsolute(p) && lstatSync(p).isFile() ? dirname(p) : p
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// maybe the path is absolute but does not exist, allow this to bubble up
|
||||
}
|
||||
return p
|
||||
|
1
packages/nuxt/config.d.ts
vendored
1
packages/nuxt/config.d.ts
vendored
@ -3,5 +3,6 @@ import type { ConfigLayerMeta, DefineConfig } from 'c12'
|
||||
|
||||
export { NuxtConfig } from 'nuxt/schema'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface DefineNuxtConfig extends DefineConfig<NuxtConfig, ConfigLayerMeta> {}
|
||||
export declare const defineNuxtConfig: DefineNuxtConfig
|
||||
|
@ -74,7 +74,7 @@
|
||||
"chokidar": "^3.6.0",
|
||||
"compatx": "^0.1.8",
|
||||
"consola": "^3.2.3",
|
||||
"cookie-es": "^1.2.1",
|
||||
"cookie-es": "^1.2.2",
|
||||
"defu": "^6.1.4",
|
||||
"destr": "^2.0.3",
|
||||
"devalue": "^5.0.0",
|
||||
@ -89,7 +89,7 @@
|
||||
"jiti": "^1.21.6",
|
||||
"klona": "^2.0.6",
|
||||
"knitwork": "^1.1.0",
|
||||
"magic-string": "^0.30.10",
|
||||
"magic-string": "^0.30.11",
|
||||
"mlly": "^1.7.1",
|
||||
"nitropack": "^2.9.7",
|
||||
"nuxi": "^3.12.0",
|
||||
@ -109,25 +109,25 @@
|
||||
"uncrypto": "^0.1.3",
|
||||
"unctx": "^2.3.1",
|
||||
"unenv": "^1.10.0",
|
||||
"unimport": "^3.9.0",
|
||||
"unimport": "^3.10.0",
|
||||
"unplugin": "^1.12.0",
|
||||
"unplugin-vue-router": "^0.10.1",
|
||||
"unplugin-vue-router": "^0.10.2",
|
||||
"unstorage": "^1.10.2",
|
||||
"untyped": "^1.4.2",
|
||||
"vue": "^3.4.33",
|
||||
"vue-bundle-renderer": "^2.1.0",
|
||||
"vue-devtools-stub": "^0.1.0",
|
||||
"vue-router": "^4.4.0"
|
||||
"vue-router": "^4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxt/scripts": "0.6.4",
|
||||
"@nuxt/scripts": "0.6.5",
|
||||
"@nuxt/ui-templates": "1.3.4",
|
||||
"@parcel/watcher": "2.4.1",
|
||||
"@types/estree": "1.0.5",
|
||||
"@vitejs/plugin-vue": "5.1.0",
|
||||
"@vitejs/plugin-vue": "5.1.2",
|
||||
"@vue/compiler-sfc": "3.4.33",
|
||||
"unbuild": "latest",
|
||||
"vite": "5.3.4",
|
||||
"vite": "5.3.5",
|
||||
"vitest": "2.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -23,6 +23,7 @@ export interface CookieOptions<T = any> extends _CookieOptions {
|
||||
readonly?: boolean
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface CookieRef<T> extends Ref<T> {}
|
||||
|
||||
const CookieDefaults = {
|
||||
|
@ -12,6 +12,7 @@ export const NUXT_ERROR_SIGNATURE = '__nuxt_error'
|
||||
/** @since 3.0.0 */
|
||||
export const useError = () => toRef(useNuxtApp().payload, 'error')
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface NuxtError<DataT = unknown> extends H3Error<DataT> {}
|
||||
|
||||
/** @since 3.0.0 */
|
||||
|
@ -20,6 +20,7 @@ type AvailableRouterMethod<R extends NitroFetchRequest> = _AvailableRouterMethod
|
||||
export type FetchResult<ReqT extends NitroFetchRequest, M extends AvailableRouterMethod<ReqT>> = TypedInternalResponse<ReqT, unknown, Lowercase<M>>
|
||||
|
||||
type ComputedOptions<T extends Record<string, any>> = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
[K in keyof T]: T[K] extends Function ? T[K] : ComputedOptions<T[K]> | Ref<T[K]> | T[K]
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ function _loadAsyncComponent (component: Component) {
|
||||
}
|
||||
|
||||
/** @since 3.0.0 */
|
||||
export async function preloadRouteComponents (to: RouteLocationRaw, router: Router & { _routePreloaded?: Set<string>, _preloadPromises?: Array<Promise<any>> } = useRouter()): Promise<void> {
|
||||
export async function preloadRouteComponents (to: RouteLocationRaw, router: Router & { _routePreloaded?: Set<string>, _preloadPromises?: Array<Promise<unknown>> } = useRouter()): Promise<void> {
|
||||
if (import.meta.server) { return }
|
||||
|
||||
const { path, matched } = router.resolve(to)
|
||||
@ -61,7 +61,7 @@ export async function preloadRouteComponents (to: RouteLocationRaw, router: Rout
|
||||
.filter(component => typeof component === 'function')
|
||||
|
||||
for (const component of components) {
|
||||
const promise = Promise.resolve((component as Function)())
|
||||
const promise = Promise.resolve((component as () => unknown)())
|
||||
.catch(() => {})
|
||||
.finally(() => promises.splice(promises.indexOf(promise)))
|
||||
promises.push(promise)
|
||||
|
@ -91,7 +91,7 @@ const isProcessingMiddleware = () => {
|
||||
|
||||
// Conditional types, either one or other
|
||||
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }
|
||||
type XOR<T, U> = (T | U) extends Object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U
|
||||
type XOR<T, U> = (T | U) extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U
|
||||
|
||||
export type OpenWindowFeatures = {
|
||||
popup?: boolean
|
||||
|
@ -5,6 +5,7 @@ import { useNuxtApp } from './nuxt'
|
||||
// @ts-expect-error virtual file
|
||||
import __appConfig from '#build/app.config.mjs'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T
|
||||
|
||||
// Workaround for vite HMR with virtual modules
|
||||
|
@ -187,6 +187,7 @@ interface _NuxtApp {
|
||||
provide: (name: string, value: any) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface NuxtApp extends _NuxtApp {}
|
||||
|
||||
export const NuxtPluginIndicator = '__nuxt_plugin'
|
||||
|
@ -17,7 +17,11 @@ export default defineNuxtPlugin({
|
||||
}
|
||||
}
|
||||
if (import.meta.server) {
|
||||
nuxtApp.hook('app:rendered', ({ renderResult }) => { renderResult?.html && nextTick(checkIfLayoutUsed) })
|
||||
nuxtApp.hook('app:rendered', ({ renderResult }) => {
|
||||
if (renderResult?.html) {
|
||||
nextTick(checkIfLayoutUsed)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
onNuxtReady(checkIfLayoutUsed)
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ interface RouterHooks {
|
||||
interface Router {
|
||||
currentRoute: Ref<Route>
|
||||
isReady: () => Promise<void>
|
||||
options: {}
|
||||
options: Record<string, unknown>
|
||||
install: () => Promise<void>
|
||||
// Navigation
|
||||
push: (url: string) => Promise<void>
|
||||
|
2
packages/nuxt/src/app/types/augments.d.ts
vendored
2
packages/nuxt/src/app/types/augments.d.ts
vendored
@ -40,7 +40,7 @@ declare module 'vue' {
|
||||
$nuxt: NuxtApp
|
||||
}
|
||||
interface ComponentInternalInstance {
|
||||
_nuxtOnBeforeMountCbs: Function[]
|
||||
_nuxtOnBeforeMountCbs: Array<() => void | Promise<void>>
|
||||
_nuxtIdIndex?: Record<string, number>
|
||||
}
|
||||
interface ComponentCustomOptions {
|
||||
|
@ -13,7 +13,7 @@ import { componentsChunkPlugin, islandsTransform } from './islandsTransform'
|
||||
import { createTransformPlugin } from './transform'
|
||||
|
||||
const isPureObjectOrString = (val: any) => (!Array.isArray(val) && typeof val === 'object') || typeof val === 'string'
|
||||
const isDirectory = (p: string) => { try { return statSync(p).isDirectory() } catch (_e) { return false } }
|
||||
const isDirectory = (p: string) => { try { return statSync(p).isDirectory() } catch { return false } }
|
||||
function compareDirByPathLength ({ path: pathA }: { path: string }, { path: pathB }: { path: string }) {
|
||||
return pathB.split(/[\\/]/).filter(Boolean).length - pathA.split(/[\\/]/).filter(Boolean).length
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
getRequestDependencies,
|
||||
renderResourceHeaders,
|
||||
} from 'vue-bundle-renderer/runtime'
|
||||
import type { Manifest as ClientManifest } from 'vue-bundle-renderer'
|
||||
import type { RenderResponse } from 'nitropack'
|
||||
import type { Manifest } from 'vite'
|
||||
import type { H3Event } from 'h3'
|
||||
@ -95,8 +96,6 @@ export interface NuxtRenderResponse {
|
||||
headers: Record<string, string>
|
||||
}
|
||||
|
||||
interface ClientManifest {}
|
||||
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getClientManifest: () => Promise<Manifest> = () => import('#build/dist/server/client.manifest.mjs')
|
||||
.then(r => r.default || r)
|
||||
|
@ -42,6 +42,7 @@ export interface PageMeta {
|
||||
}
|
||||
|
||||
declare module 'vue-router' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface RouteMeta extends UnwrapRef<PageMeta> {}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,11 @@ export default defineNuxtPlugin({
|
||||
}
|
||||
|
||||
if (import.meta.server) {
|
||||
nuxtApp.hook('app:rendered', ({ renderResult }) => { renderResult?.html && nextTick(checkIfPageUnused) })
|
||||
nuxtApp.hook('app:rendered', ({ renderResult }) => {
|
||||
if (renderResult?.html) {
|
||||
nextTick(checkIfPageUnused)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
onNuxtReady(checkIfPageUnused)
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ describe('imports:transform', () => {
|
||||
|
||||
const transformPlugin = TransformPlugin.raw({ ctx, options: { transform: { exclude: [/node_modules/] } } }, { framework: 'rollup' }) as Plugin
|
||||
const transform = async (source: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await (transformPlugin.transform! as Function).call({ error: null, warn: null } as any, source, '')
|
||||
return typeof result === 'string' ? result : result?.code
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import { normalizeLineEndings } from './utils'
|
||||
const pluginVite = DevOnlyPlugin.raw({}, { framework: 'vite' }) as Plugin
|
||||
|
||||
const viteTransform = async (source: string, id: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await (pluginVite.transform! as Function)(source, id)
|
||||
return typeof result === 'string' ? result : result?.code
|
||||
}
|
||||
|
@ -29,11 +29,13 @@ const viteTransform = async (source: string, id: string, selectiveClient = false
|
||||
selectiveClient,
|
||||
}, { framework: 'vite' }) as Plugin
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await (vitePlugin.transform! as Function)(source, id)
|
||||
return typeof result === 'string' ? result : result?.code
|
||||
}
|
||||
|
||||
const webpackTransform = async (source: string, id: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await ((pluginWebpack as UnpluginOptions).transform! as Function)(source, id)
|
||||
return typeof result === 'string' ? result : result?.code
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ describe('route-injection:transform', () => {
|
||||
const injectionPlugin = RouteInjectionPlugin({ options: { sourcemap: { client: false, server: false } } } as Nuxt).raw({}, { framework: 'rollup' }) as Plugin
|
||||
|
||||
const transform = async (source: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await (injectionPlugin.transform! as Function).call({ error: null, warn: null } as any, source, 'test.vue')
|
||||
const code: string = typeof result === 'string' ? result : result?.code
|
||||
let depth = 0
|
||||
|
@ -55,6 +55,7 @@ const treeshakeTemplatePlugin = TreeShakeTemplatePlugin.raw({
|
||||
}, { framework: 'rollup' }) as Plugin
|
||||
|
||||
const treeshake = async (source: string): Promise<string> => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await (treeshakeTemplatePlugin.transform! as Function).call({
|
||||
parse: (code: string, opts: any = {}) => Parser.parse(code, {
|
||||
sourceType: 'module',
|
||||
@ -79,6 +80,7 @@ async function SFCCompile (name: string, source: string, options: Options, ssr =
|
||||
build: { sourcemap: false },
|
||||
define: {},
|
||||
})
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
const result = await (plugin.transform! as Function).call({
|
||||
parse: (code: string, opts: any = {}) => Parser.parse(code, {
|
||||
sourceType: 'module',
|
||||
|
@ -20,6 +20,7 @@ declare module 'nitropack' {
|
||||
buildAssetsDir: string
|
||||
cdnURL: string
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface NitroRuntimeConfig extends RuntimeConfig {}
|
||||
interface NitroRouteConfig {
|
||||
ssr?: boolean
|
||||
|
1
packages/nuxt/types.d.ts
vendored
1
packages/nuxt/types.d.ts
vendored
@ -20,6 +20,7 @@ declare module 'nitropack' {
|
||||
buildAssetsDir: string
|
||||
cdnURL: string
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface NitroRuntimeConfig extends RuntimeConfig {}
|
||||
interface NitroRouteConfig {
|
||||
ssr?: boolean
|
||||
|
@ -38,9 +38,9 @@
|
||||
"@nuxt/ui-templates": "1.3.4",
|
||||
"@types/file-loader": "5.0.4",
|
||||
"@types/pug": "2.0.10",
|
||||
"@types/sass-loader": "8.0.8",
|
||||
"@types/sass-loader": "8.0.9",
|
||||
"@unhead/schema": "1.9.16",
|
||||
"@vitejs/plugin-vue": "5.1.0",
|
||||
"@vitejs/plugin-vue": "5.1.2",
|
||||
"@vitejs/plugin-vue-jsx": "4.0.0",
|
||||
"@vue/compiler-core": "3.4.33",
|
||||
"@vue/compiler-sfc": "3.4.33",
|
||||
@ -54,11 +54,11 @@
|
||||
"unbuild": "latest",
|
||||
"unctx": "2.3.1",
|
||||
"unenv": "1.10.0",
|
||||
"vite": "5.3.4",
|
||||
"vite": "5.3.5",
|
||||
"vue": "3.4.33",
|
||||
"vue-bundle-renderer": "2.1.0",
|
||||
"vue-loader": "17.4.2",
|
||||
"vue-router": "4.4.0",
|
||||
"vue-router": "4.4.2",
|
||||
"webpack": "5.93.0",
|
||||
"webpack-dev-middleware": "7.3.0"
|
||||
},
|
||||
@ -73,7 +73,7 @@
|
||||
"std-env": "^3.7.0",
|
||||
"ufo": "^1.5.4",
|
||||
"uncrypto": "^0.1.3",
|
||||
"unimport": "^3.9.0",
|
||||
"unimport": "^3.10.0",
|
||||
"untyped": "^1.4.2"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -11,6 +11,7 @@ import type { AppHeadMetaObject } from './head'
|
||||
|
||||
export type { SchemaDefinition } from 'untyped'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T
|
||||
|
||||
export type UpperSnakeCase<S extends string> = Uppercase<SnakeCase<S>>
|
||||
@ -33,6 +34,7 @@ type Overrideable<T extends Record<string, any>, Path extends string = ''> = {
|
||||
|
||||
type RuntimeConfigNamespace = Record<string, unknown>
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface PublicRuntimeConfig extends RuntimeConfigNamespace { }
|
||||
|
||||
export interface RuntimeConfig extends RuntimeConfigNamespace {
|
||||
@ -142,6 +144,7 @@ export interface AppConfigInput extends CustomAppConfig {
|
||||
server?: never
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
type Serializable<T> = T extends Function ? never : T extends Promise<infer U> ? Serializable<U> : T extends string & {} ? T : T extends Record<string, any> ? { [K in keyof T]: Serializable<T[K]> } : T
|
||||
|
||||
export interface NuxtAppConfig {
|
||||
|
@ -3,13 +3,21 @@ import type { Head, MergeHead } from '@unhead/schema'
|
||||
/** @deprecated Extend types from `@unhead/schema` directly. This may be removed in a future minor version. */
|
||||
export interface HeadAugmentations extends MergeHead {
|
||||
// runtime type modifications
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
base?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
link?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
meta?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
style?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
script?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
noscript?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
htmlAttrs?: {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
bodyAttrs?: {}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ export type NuxtLayout = {
|
||||
file: string
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface ImportPresetWithDeprecation extends InlinePreset {
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ export interface NuxtTypeTemplate<Options = TemplateDefaultOptions> extends Omit
|
||||
}
|
||||
|
||||
type _TemplatePlugin<Options> = Omit<NuxtPlugin, 'src'> & NuxtTemplate<Options>
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface NuxtPluginTemplate<Options = TemplateDefaultOptions> extends _TemplatePlugin<Options> { }
|
||||
|
||||
export interface NuxtApp {
|
||||
|
@ -20,7 +20,7 @@
|
||||
"devDependencies": {
|
||||
"@types/html-minifier": "4.0.5",
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"@unocss/reset": "0.61.5",
|
||||
"@unocss/reset": "0.61.9",
|
||||
"critters": "0.0.24",
|
||||
"execa": "9.3.0",
|
||||
"globby": "14.0.2",
|
||||
@ -32,7 +32,7 @@
|
||||
"pathe": "1.1.2",
|
||||
"prettier": "3.3.3",
|
||||
"scule": "1.3.0",
|
||||
"unocss": "0.61.5",
|
||||
"vite": "5.3.4"
|
||||
"unocss": "0.61.9",
|
||||
"vite": "5.3.5"
|
||||
}
|
||||
}
|
||||
|
@ -27,16 +27,16 @@
|
||||
"@nuxt/schema": "workspace:*",
|
||||
"@types/clear": "0.1.4",
|
||||
"@types/estree": "1.0.5",
|
||||
"rollup": "4.19.0",
|
||||
"rollup": "4.20.0",
|
||||
"unbuild": "latest",
|
||||
"vue": "3.4.33"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "workspace:*",
|
||||
"@rollup/plugin-replace": "^5.0.7",
|
||||
"@vitejs/plugin-vue": "^5.1.0",
|
||||
"@vitejs/plugin-vue": "^5.1.2",
|
||||
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"clear": "^0.1.0",
|
||||
"consola": "^3.2.3",
|
||||
"cssnano": "^7.0.4",
|
||||
@ -48,20 +48,20 @@
|
||||
"get-port-please": "^3.1.2",
|
||||
"h3": "^1.12.0",
|
||||
"knitwork": "^1.1.0",
|
||||
"magic-string": "^0.30.10",
|
||||
"magic-string": "^0.30.11",
|
||||
"mlly": "^1.7.1",
|
||||
"ohash": "^1.1.3",
|
||||
"pathe": "^1.1.2",
|
||||
"perfect-debounce": "^1.0.0",
|
||||
"pkg-types": "^1.1.3",
|
||||
"postcss": "^8.4.39",
|
||||
"postcss": "^8.4.40",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"std-env": "^3.7.0",
|
||||
"strip-literal": "^2.1.0",
|
||||
"ufo": "^1.5.4",
|
||||
"unenv": "^1.10.0",
|
||||
"unplugin": "^1.12.0",
|
||||
"vite": "^5.3.4",
|
||||
"vite": "^5.3.5",
|
||||
"vite-node": "^2.0.5",
|
||||
"vite-plugin-checker": "^0.7.2",
|
||||
"vue-bundle-renderer": "^2.1.0"
|
||||
|
@ -72,6 +72,7 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin {
|
||||
: outputOptions.assetFileNames({
|
||||
type: 'asset',
|
||||
name: `${fileName}-styles.mjs`,
|
||||
originalFileName: `${fileName}-styles.mjs`,
|
||||
source: '',
|
||||
})
|
||||
|
||||
@ -97,6 +98,7 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin {
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: 'styles.mjs',
|
||||
originalFileName: 'styles.mjs',
|
||||
source:
|
||||
[
|
||||
'const interopDefault = r => r.default || r || []',
|
||||
|
@ -40,7 +40,7 @@ export async function warmupViteServer (
|
||||
entries: string[],
|
||||
isServer: boolean,
|
||||
) {
|
||||
const warmedUrls = new Set<String>()
|
||||
const warmedUrls = new Set<string>()
|
||||
|
||||
const warmup = async (url: string) => {
|
||||
try {
|
||||
|
@ -27,7 +27,7 @@
|
||||
"dependencies": {
|
||||
"@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
|
||||
"@nuxt/kit": "workspace:*",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"css-loader": "^7.1.2",
|
||||
"css-minimizer-webpack-plugin": "^7.0.0",
|
||||
"cssnano": "^7.0.4",
|
||||
@ -40,14 +40,14 @@
|
||||
"h3": "^1.12.0",
|
||||
"hash-sum": "^2.0.0",
|
||||
"lodash-es": "4.17.21",
|
||||
"magic-string": "^0.30.10",
|
||||
"memfs": "^4.9.4",
|
||||
"magic-string": "^0.30.11",
|
||||
"memfs": "^4.11.1",
|
||||
"mini-css-extract-plugin": "^2.9.0",
|
||||
"mlly": "^1.7.1",
|
||||
"ohash": "^1.1.3",
|
||||
"pathe": "^1.1.2",
|
||||
"pify": "^6.1.0",
|
||||
"postcss": "^8.4.39",
|
||||
"postcss": "^8.4.40",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-import-resolver": "^2.0.0",
|
||||
"postcss-loader": "^8.1.1",
|
||||
|
@ -6,7 +6,7 @@ import type { Nuxt, NuxtOptions } from '@nuxt/schema'
|
||||
import { defu } from 'defu'
|
||||
import type { Plugin } from 'postcss'
|
||||
|
||||
const isPureObject = (obj: unknown): obj is Object => obj !== null && !Array.isArray(obj) && typeof obj === 'object'
|
||||
const isPureObject = (obj: unknown): obj is object => obj !== null && !Array.isArray(obj) && typeof obj === 'object'
|
||||
|
||||
function sortPlugins ({ plugins, order }: NuxtOptions['postcss']): string[] {
|
||||
const names = Object.keys(plugins)
|
||||
|
2523
pnpm-lock.yaml
2523
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
1
test/fixtures/basic-types/types.ts
vendored
1
test/fixtures/basic-types/types.ts
vendored
@ -550,6 +550,7 @@ describe('composables', () => {
|
||||
describe('app config', () => {
|
||||
it('merges app config as expected', () => {
|
||||
interface ExpectedMergedAppConfig {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
nuxt: {}
|
||||
fromLayer: boolean
|
||||
fromNuxtConfig: boolean
|
||||
|
2
test/fixtures/basic/pages/meta.vue
vendored
2
test/fixtures/basic/pages/meta.vue
vendored
@ -13,7 +13,7 @@ const serialisedMeta: Record<string, string> = {}
|
||||
const meta = useRoute().meta
|
||||
for (const key in meta) {
|
||||
if (Array.isArray(meta[key])) {
|
||||
serialisedMeta[key] = meta[key].map((fn: Function) => fn.toString())
|
||||
serialisedMeta[key] = meta[key].map((fn: () => unknown) => fn.toString())
|
||||
continue
|
||||
}
|
||||
if (typeof meta[key] === 'string') {
|
||||
|
1
test/fixtures/basic/plugins/test.d.ts
vendored
1
test/fixtures/basic/plugins/test.d.ts
vendored
@ -1,2 +1,3 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface MyInterface {}
|
||||
export {}
|
||||
|
1
test/fixtures/minimal-types/types.ts
vendored
1
test/fixtures/minimal-types/types.ts
vendored
@ -51,6 +51,7 @@ describe('config typings', () => {
|
||||
it('appConfig', () => {
|
||||
expectTypeOf(useAppConfig().foo).toEqualTypeOf<unknown>()
|
||||
expectTypeOf(useAppConfig()).toEqualTypeOf<{
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
nuxt: {}
|
||||
[key: string]: unknown
|
||||
}>()
|
||||
|
@ -489,7 +489,7 @@ describe('url', () => {
|
||||
|
||||
describe('loading state', () => {
|
||||
it('expect loading state to be changed by hooks', async () => {
|
||||
vi.stubGlobal('setTimeout', vi.fn((cb: Function) => cb()))
|
||||
vi.stubGlobal('setTimeout', vi.fn((cb: () => void) => cb()))
|
||||
const nuxtApp = useNuxtApp()
|
||||
const { isLoading } = useLoadingIndicator()
|
||||
expect(isLoading.value).toBeFalsy()
|
||||
@ -504,7 +504,7 @@ describe('loading state', () => {
|
||||
|
||||
describe('loading state', () => {
|
||||
it('expect loading state to be changed by force starting/stoping', async () => {
|
||||
vi.stubGlobal('setTimeout', vi.fn((cb: Function) => cb()))
|
||||
vi.stubGlobal('setTimeout', vi.fn((cb: () => void) => cb()))
|
||||
const nuxtApp = useNuxtApp()
|
||||
const { isLoading, start, finish } = useLoadingIndicator()
|
||||
expect(isLoading.value).toBeFalsy()
|
||||
@ -519,7 +519,7 @@ describe('loading state', () => {
|
||||
|
||||
describe('loading state', () => {
|
||||
it('expect error from loading state to be changed by finish({ error: true })', async () => {
|
||||
vi.stubGlobal('setTimeout', vi.fn((cb: Function) => cb()))
|
||||
vi.stubGlobal('setTimeout', vi.fn((cb: () => void) => cb()))
|
||||
const nuxtApp = useNuxtApp()
|
||||
const { error, start, finish } = useLoadingIndicator()
|
||||
expect(error.value).toBeFalsy()
|
||||
|
@ -4,6 +4,7 @@ import { defineEventHandler } from 'h3'
|
||||
import { registerEndpoint } from '@nuxt/test-utils/runtime'
|
||||
|
||||
vi.mock('#app/compat/idle-callback', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
requestIdleCallback: (cb: Function) => cb(),
|
||||
cancelIdleCallback: () => {},
|
||||
}))
|
||||
|
@ -32,7 +32,7 @@ export async function renderPage (path = '/') {
|
||||
page.on('request', (req) => {
|
||||
try {
|
||||
requests.push(req.url().replace(url('/'), '/'))
|
||||
} catch (err) {
|
||||
} catch {
|
||||
// TODO
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user