feat(nuxt): update devdependency nitropack to v2.5.1 (#21696)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
Daniel Roe 2023-06-22 10:38:26 +01:00 committed by GitHub
parent 36ad75c269
commit be3f6f7018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 598 additions and 590 deletions

View File

@ -43,7 +43,7 @@
"@types/lodash-es": "4.17.7",
"@types/semver": "7.5.0",
"lodash-es": "4.17.21",
"nitropack": "2.4.1",
"nitropack": "2.5.1",
"unbuild": "latest",
"vite": "4.3.9",
"vitest": "0.32.2",

View File

@ -80,7 +80,7 @@
"local-pkg": "^0.4.3",
"magic-string": "^0.30.0",
"mlly": "^1.4.0",
"nitropack": "^2.4.1",
"nitropack": "^2.5.1",
"nuxi": "workspace:../nuxi",
"nypm": "^0.2.1",
"ofetch": "^1.1.1",

View File

@ -11,10 +11,10 @@ const props = defineProps({
// Deliberately prevent reactive update when error is cleared
// eslint-disable-next-line vue/no-setup-props-destructure
const { error } = props
const _error = props.error
// TODO: extract to a separate utility
const stacktrace = (error.stack || '')
const stacktrace = (_error.stack || '')
.split('\n')
.splice(1)
.map((line) => {
@ -31,12 +31,12 @@ const stacktrace = (error.stack || '')
}).map(i => `<span class="stack${i.internal ? ' internal' : ''}">${i.text}</span>`).join('\n')
// Error page props
const statusCode = Number(error.statusCode || 500)
const statusCode = Number(_error.statusCode || 500)
const is404 = statusCode === 404
const statusMessage = error.statusMessage ?? (is404 ? 'Page Not Found' : 'Internal Server Error')
const description = error.message || error.toString()
const stack = process.dev && !is404 ? error.description || `<pre>${stacktrace}</pre>` : undefined
const statusMessage = _error.statusMessage ?? (is404 ? 'Page Not Found' : 'Internal Server Error')
const description = _error.message || _error.toString()
const stack = process.dev && !is404 ? _error.description || `<pre>${stacktrace}</pre>` : undefined
// TODO: Investigate side-effect issue with imports
const _Error404 = defineAsyncComponent(() => import('@nuxt/ui-templates/templates/error-404.vue').then(r => r.default || r))

View File

@ -6,14 +6,14 @@ export function baseURL (): string {
}
export function buildAssetsDir (): string {
return useRuntimeConfig().app.buildAssetsDir
return useRuntimeConfig().app.buildAssetsDir as string
}
export function buildAssetsURL (...path: string[]): string {
return joinURL(publicAssetsURL(), useRuntimeConfig().app.buildAssetsDir, ...path)
return joinURL(publicAssetsURL(), buildAssetsDir(), ...path)
}
export function publicAssetsURL (...path: string[]): string {
const publicBase = useRuntimeConfig().app.cdnURL || useRuntimeConfig().app.baseURL
const publicBase = useRuntimeConfig().app.cdnURL as string || useRuntimeConfig().app.baseURL
return path.length ? joinURL(publicBase, ...path) : publicBase
}

View File

@ -1,7 +1,7 @@
/// <reference types="nitropack" />
export * from './dist/index'
import type { SchemaDefinition } from 'nuxt/schema'
import type { SchemaDefinition, RuntimeConfig } from 'nuxt/schema'
import type { NuxtIslandContext, NuxtIslandResponse, NuxtRenderHTMLContext } from './dist/core/runtime/nitro/renderer'
declare global {
@ -10,6 +10,8 @@ declare global {
}
declare module 'nitropack' {
interface NitroRuntimeConfigApp extends RuntimeConfig['app'] {}
interface NitroRuntimeConfig extends RuntimeConfig {}
interface NitroRouteConfig {
ssr?: boolean
experimentalNoScripts?: boolean

View File

@ -36,7 +36,7 @@
"esbuild-loader": "3.0.1",
"h3": "1.7.0",
"ignore": "5.2.4",
"nitropack": "2.4.1",
"nitropack": "2.5.1",
"unbuild": "latest",
"unctx": "2.3.1",
"vite": "4.3.9",

File diff suppressed because it is too large Load Diff

View File

@ -35,10 +35,10 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
it('default server bundle size', async () => {
stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"62.2k"')
expect.soft(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"63.9k"')
const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2297k"')
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2328k"')
const packages = modules.files
.filter(m => m.endsWith('package.json'))
@ -59,30 +59,32 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
"@vue/server-renderer",
"@vue/shared",
"cookie-es",
"debug",
"defu",
"destr",
"devalue",
"estree-walker",
"h3",
"h3/node_modules/destr",
"has-flag",
"hookable",
"http-graceful-shutdown",
"iron-webcrypto",
"klona",
"ms",
"node-fetch-native",
"ofetch",
"ofetch/node_modules/destr",
"ohash",
"pathe",
"radix3",
"scule",
"source-map-js",
"supports-color",
"ufo",
"uncrypto",
"unctx",
"unenv",
"unhead",
"unstorage",
"unstorage/node_modules/destr",
"vue",
"vue-bundle-renderer",
]