Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nuxtrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
setups.@nuxt/test-utils="4.0.3"
setups.@nuxt/test-utils="4.1.0"
16 changes: 16 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ const config = {
async viteFinal(newConfig) {
newConfig.plugins ??= []

// Fix: Nuxt's generated #internal/nuxt/paths (<buildDir>/paths.mjs) calls
// getAppConfig() during module evaluation (#build/fetch.mjs → baseURL()). Without an
// SSR payload, Nuxt's client useRuntimeConfig shim returns undefined and `.app`
// throws, so fall back to an empty config.
newConfig.plugins.unshift({
name: 'storybook-nuxt-paths-app-config',
enforce: 'pre',
transform(code, id) {
if (!/paths\.mjs(?:$|\?)/.test(id)) return
return code.replace(
'const getAppConfig = () => useRuntimeConfig().app',
'const getAppConfig = () => useRuntimeConfig()?.app ?? {}',
)
},
})

// Fix: nuxt:components:imports-alias relies on internal Nuxt state that is
// cleaned up after nuxt.close() in @storybook-vue/nuxt's loadNuxtViteConfig.
// When that state is gone, `import X from '#components'` is left unresolved
Expand Down
5 changes: 3 additions & 2 deletions app/components/global/BlogPostWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { defineLink } from '@unhead/vue'
import type { RawBlogPostFrontmatter } from '#shared/schemas/blog'
import { generateBlogTID } from '#shared/utils/atproto'
import { posts } from '#blog/posts'
Expand All @@ -21,10 +22,10 @@ useSeoMeta({

useHead({
link: [
{
defineLink({
rel: 'site.standard.document',
href: `at://${NPMX_DEV_DID}/site.standard.document/${generateBlogTID(props.frontmatter.date, props.frontmatter.slug)}`,
},
}),
],
})

Expand Down
6 changes: 5 additions & 1 deletion app/pages/package-changelog/[[org]]/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ const parsedRoute = computed(() => {

const packageName = org ? `${org}/${name}` : name

const version = 'version' in route.params ? route.params.version : null
// TODO: drop once nuxt emits child route names in `RouteRecordInfo` again. Since 4.5.2 the
// child arg is `never`, so `useRoute('changelog')` doesn't union in the `changelog-version`
// params and `version` widens to `unknown`.
// @ts-expect-error see above
const version: string | null = 'version' in route.params ? route.params.version : null

return { packageName, version }
})
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@nuxtjs/mdc": "0.23.1",
"better-sqlite3": "13.0.3",
"docus": "5.12.3",
"nuxt": "4.4.8",
"nuxt": "4.5.2",
"tailwindcss": "4.3.3"
}
}
13 changes: 1 addition & 12 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ const config: KnipConfig = {
msw: {
entry: ['.storybook/.public/mockServiceWorker.js'],
},
ignoreDependencies: [
'@iconify-json/*',
'puppeteer',
'vite-plugin-pwa',
'@vueuse/shared',

/** Optional peer dependency of @nuxt/vite-builder for the rolldown-powered build */
'rolldown',

/** Used in test/e2e/helpers/ which is excluded from knip project scope */
'h3-next',
],
ignoreDependencies: ['@iconify-json/*', 'puppeteer', 'vite-plugin-pwa', '@vueuse/shared'],
ignoreUnresolved: ['#oauth/config'],
ignoreFiles: ['app/components/UserCombobox.vue', '**/*.unused.*'],
},
Expand Down
16 changes: 9 additions & 7 deletions modules/security-headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ export default defineNuxtModule({
].join('; ')

// CSP via <meta> tag — only present in HTML pages, not API responses.
nuxt.options.app.head ??= {}
const head = nuxt.options.app.head as { meta?: Array<Record<string, string>> }
head.meta ??= []
head.meta.push({
'http-equiv': 'Content-Security-Policy',
'content': csp,
})
if (!nuxt.options.test) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of this guard currently prevents one of the e2e tests ("HTML pages include CSP meta tag and security headers") from passing locally.

nuxt.options.app.head ??= {}
const head = nuxt.options.app.head as { meta?: Array<Record<string, string>> }
head.meta ??= []
head.meta.push({
'http-equiv': 'Content-Security-Policy',
'content': csp,
})
}

// Other security headers via route rules (fine on all responses).
nuxt.options.routeRules ??= {}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@nuxt/a11y": "1.0.0-alpha.1",
"@nuxt/fonts": "0.14.0",
"@nuxt/scripts": "1.3.5",
"@nuxt/test-utils": "4.0.3",
"@nuxt/test-utils": "4.1.0",
"@nuxtjs/color-mode": "4.0.1",
"@nuxtjs/html-validator": "2.1.0",
"@nuxtjs/i18n": "10.6.0",
Expand All @@ -80,7 +80,7 @@
"@vueuse/core": "14.4.0",
"@vueuse/integrations": "14.4.0",
"@vueuse/nuxt": "14.4.0",
"@vueuse/router": "^14.2.1",
"@vueuse/router": "^14.4.0",
"@vueuse/shared": "14.4.0",
"algoliasearch": "5.56.0",
"defu": "6.1.7",
Expand All @@ -92,7 +92,7 @@
"ipaddr.js": "2.5.0",
"marked": "18.0.9",
"module-replacements": "3.1.0",
"nuxt": "4.4.8",
"nuxt": "4.5.2",
"nuxt-og-image": "6.7.8",
"ofetch": "1.5.1",
"ohash": "2.0.12",
Expand All @@ -111,7 +111,7 @@
"virtua": "0.50.1",
"vite-plugin-pwa": "1.3.0",
"vite-plus": "catalog:vite-plus",
"vue": "3.5.39",
"vue": "3.5.41",
"vue-data-ui": "3.23.5",
"vue-router": "5.2.0"
},
Expand Down
13 changes: 0 additions & 13 deletions patches/@nuxt__test-utils.patch

This file was deleted.

13 changes: 13 additions & 0 deletions patches/@nuxt__test-utils@4.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/dist/config.mjs b/dist/config.mjs
index 3d627e2a5febb492e4f8630c1301701c2770f4e2..5cacae1577070faebaa034e4eb665391c8833382 100644
--- a/dist/config.mjs
+++ b/dist/config.mjs
@@ -103,7 +103,7 @@ async function getVitestConfigFromNuxt(options, loadNuxtOptions = {}) {
optimizeDeps: { noDiscovery: true },
test: {
environmentOptions: {
- nuxtRuntimeConfig: applyEnv(structuredClone(options.nuxt.options.runtimeConfig), {
+ nuxtRuntimeConfig: applyEnv(JSON.parse(JSON.stringify(options.nuxt.options.runtimeConfig)), {
prefix: "NUXT_",
env: await setupDotenv(defu$1(loadNuxtOptions.dotenv, {
cwd: rootDir,
Loading
Loading