mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
chore(deps): update all non-major dependencies (main) (#28321)
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
ede1f923fc
commit
c906312034
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@5cf07d8b700b67e235fbb65cbc84f69c0cf10464 # v3.25.14
|
||||
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@5cf07d8b700b67e235fbb65cbc84f69c0cf10464 # v3.25.14
|
||||
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@5cf07d8b700b67e235fbb65cbc84f69c0cf10464 # v3.25.14
|
||||
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
||||
if: github.repository == 'nuxt/nuxt' && success()
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
@ -579,7 +579,7 @@ For local development or automated deploy pipelines, testing against a separate
|
||||
|
||||
To utilize a separate target host for end-to-end tests, simply provide the `host` property of the `setup` function with the desired URL.
|
||||
|
||||
```ts twoslash
|
||||
```ts
|
||||
import { setup, createPage } from '@nuxt/test-utils/e2e'
|
||||
import { describe, it, expect } from 'vitest'
|
||||
|
||||
|
25
package.json
25
package.json
@ -39,42 +39,43 @@
|
||||
"@nuxt/ui-templates": "workspace:*",
|
||||
"@nuxt/vite-builder": "workspace:*",
|
||||
"@nuxt/webpack-builder": "workspace:*",
|
||||
"@types/node": "*",
|
||||
"c12": "2.0.0-beta.1",
|
||||
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
||||
"jiti": "2.0.0-beta.3",
|
||||
"magic-string": "^0.30.10",
|
||||
"magic-string": "^0.30.11",
|
||||
"nitro": "npm:nitro-nightly@3.0.0-beta-28665895.e727afda",
|
||||
"nuxt": "workspace:*",
|
||||
"rollup": "^4.19.0",
|
||||
"rollup": "^4.20.0",
|
||||
"typescript": "5.5.4",
|
||||
"unbuild": "3.0.0-rc.7",
|
||||
"vite": "5.3.5",
|
||||
"vue": "3.4.34"
|
||||
},
|
||||
"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": "3.0.0",
|
||||
"eslint-typegen": "0.2.4",
|
||||
"eslint-plugin-perfectionist": "3.1.1",
|
||||
"eslint-typegen": "0.3.0",
|
||||
"execa": "9.3.0",
|
||||
"globby": "14.0.2",
|
||||
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
||||
@ -96,7 +97,7 @@
|
||||
"vitest": "2.0.5",
|
||||
"vitest-environment-nuxt": "1.0.0",
|
||||
"vue": "3.4.34",
|
||||
"vue-router": "4.4.0",
|
||||
"vue-router": "4.4.2",
|
||||
"vue-tsc": "2.0.29"
|
||||
},
|
||||
"packageManager": "pnpm@9.6.0",
|
||||
|
@ -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": {
|
||||
|
@ -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 {}
|
||||
|
||||
/**
|
||||
|
@ -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>
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import { readPackageJSON, resolvePackageJSON } from 'pkg-types'
|
||||
import type { Nuxt } from '@nuxt/schema'
|
||||
import type { Nuxt, NuxtConfig } from '@nuxt/schema'
|
||||
import { resolve } from 'pathe'
|
||||
import { importModule, tryImportModule } from '../internal/esm'
|
||||
import type { LoadNuxtConfigOptions } from './config'
|
||||
@ -16,7 +16,7 @@ export interface LoadNuxtOptions extends LoadNuxtConfigOptions {
|
||||
export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
||||
// Backward compatibility
|
||||
opts.cwd = resolve(opts.cwd || (opts as any).rootDir /* backwards compat */ || '.')
|
||||
opts.overrides = opts.overrides || (opts as any).config as {} /* backwards compat */ || {}
|
||||
opts.overrides = opts.overrides || (opts as any).config as NuxtConfig /* backwards compat */ || {}
|
||||
|
||||
// Apply dev as config override
|
||||
opts.overrides.dev = !!opts.dev
|
||||
|
@ -55,10 +55,10 @@ function _defineNuxtModule<
|
||||
inlineOptions?: Partial<TOptions>,
|
||||
nuxt: Nuxt = useNuxt(),
|
||||
): Promise<
|
||||
TWith extends true
|
||||
? ResolvedModuleOptions<TOptions, TOptionsDefaults>
|
||||
: TOptions
|
||||
> {
|
||||
TWith extends true
|
||||
? ResolvedModuleOptions<TOptions, TOptionsDefaults>
|
||||
: TOptions
|
||||
> {
|
||||
const nuxtConfigOptionsKey = module.meta.configKey || module.meta.name
|
||||
|
||||
const nuxtConfigOptions: Partial<TOptions> = nuxtConfigOptionsKey && nuxtConfigOptionsKey in nuxt.options ? nuxt.options[<keyof NuxtOptions> nuxtConfigOptionsKey] : {}
|
||||
|
@ -59,7 +59,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
|
||||
|
@ -89,7 +89,7 @@
|
||||
"jiti": "^2.0.0-beta.3",
|
||||
"klona": "^2.0.6",
|
||||
"knitwork": "^1.1.0",
|
||||
"magic-string": "^0.30.10",
|
||||
"magic-string": "^0.30.11",
|
||||
"mlly": "^1.7.1",
|
||||
"nitro": "npm:nitro-nightly@3.0.0-beta-28665895.e727afda",
|
||||
"nuxi": "^3.12.0",
|
||||
@ -109,22 +109,22 @@
|
||||
"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.34",
|
||||
"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.34",
|
||||
"unbuild": "3.0.0-rc.7",
|
||||
"vite": "5.3.5",
|
||||
|
@ -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 = {
|
||||
|
@ -9,6 +9,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 */
|
||||
|
@ -17,6 +17,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
|
||||
|
@ -185,6 +185,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 'nitro/types'
|
||||
import type { Manifest } from 'vite'
|
||||
import type { H3Event } from 'h3'
|
||||
@ -94,8 +95,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 'nitro/types' {
|
||||
buildAssetsDir: string
|
||||
cdnURL: string
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface NitroRuntimeConfig extends RuntimeConfig {}
|
||||
interface NitroRouteConfig {
|
||||
ssr?: boolean
|
||||
@ -41,6 +42,7 @@ declare module 'nitropack/types' {
|
||||
buildAssetsDir: string
|
||||
cdnURL: string
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface NitroRuntimeConfig extends RuntimeConfig {}
|
||||
interface NitroRouteConfig {
|
||||
ssr?: boolean
|
||||
|
2
packages/nuxt/types.d.ts
vendored
2
packages/nuxt/types.d.ts
vendored
@ -20,6 +20,7 @@ declare module 'nitro/types' {
|
||||
buildAssetsDir: string
|
||||
cdnURL: string
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface NitroRuntimeConfig extends RuntimeConfig {}
|
||||
interface NitroRouteConfig {
|
||||
ssr?: boolean
|
||||
@ -41,6 +42,7 @@ declare module 'nitropack/types' {
|
||||
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.34",
|
||||
"@vue/compiler-sfc": "3.4.34",
|
||||
@ -58,7 +58,7 @@
|
||||
"vue": "3.4.34",
|
||||
"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 {
|
||||
@ -136,6 +138,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 {
|
||||
|
@ -19,7 +19,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/html-minifier": "4.0.5",
|
||||
"@unocss/reset": "0.61.5",
|
||||
"@unocss/reset": "0.61.9",
|
||||
"critters": "0.0.24",
|
||||
"execa": "9.3.0",
|
||||
"globby": "14.0.2",
|
||||
@ -30,7 +30,7 @@
|
||||
"pathe": "1.1.2",
|
||||
"prettier": "3.3.3",
|
||||
"scule": "1.3.0",
|
||||
"unocss": "0.61.5",
|
||||
"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": "3.0.0-rc.7",
|
||||
"vue": "3.4.34"
|
||||
},
|
||||
"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",
|
||||
@ -49,7 +49,7 @@
|
||||
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
||||
"jiti": "^2.0.0-beta.3",
|
||||
"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",
|
||||
|
@ -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",
|
||||
@ -43,8 +43,8 @@
|
||||
"jiti": "^2.0.0-beta.3",
|
||||
"knitwork": "^1.1.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",
|
||||
@ -78,7 +78,7 @@
|
||||
"@types/pify": "5.0.4",
|
||||
"@types/webpack-bundle-analyzer": "4.7.0",
|
||||
"@types/webpack-hot-middleware": "2.25.9",
|
||||
"rollup": "4.19.0",
|
||||
"rollup": "4.20.0",
|
||||
"unbuild": "3.0.0-rc.7",
|
||||
"vue": "3.4.34"
|
||||
},
|
||||
|
@ -4,7 +4,7 @@ import { defu } from 'defu'
|
||||
import { createJiti } from 'jiti'
|
||||
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)
|
||||
|
2289
pnpm-lock.yaml
2289
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -32,10 +32,10 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
||||
const serverDir = join(rootDir, '.output/server')
|
||||
|
||||
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"211k"`)
|
||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"205k"`)
|
||||
|
||||
const modules = await analyzeSizes('node_modules/**/*', serverDir)
|
||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1347k"`)
|
||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1346k"`)
|
||||
|
||||
const packages = modules.files
|
||||
.filter(m => m.endsWith('package.json'))
|
||||
@ -73,7 +73,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(`"534k"`)
|
||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"528k"`)
|
||||
|
||||
const modules = await analyzeSizes('node_modules/**/*', serverDir)
|
||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"80.3k"`)
|
||||
|
1
test/fixtures/basic-types/types.ts
vendored
1
test/fixtures/basic-types/types.ts
vendored
@ -567,6 +567,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
|
||||
}>()
|
||||
|
@ -486,7 +486,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()
|
||||
@ -501,7 +501,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()
|
||||
@ -516,7 +516,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