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
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,13 @@ packages:

overrides:
nuxt-ai-ready: 3.5.0
# Key each patch by a version range, never an exact version. An exact key
# skips any other installed version without a warning: a Nuxt bump on
# 2026-11-12 added nitropack 2.13.6, and production shipped it unpatched.
# A range key patches every installed copy, or the install fails.
# Key each patch by a whole major. Any other key skips copies outside it
# silently: on 2026-11-12 an exact key shipped nitropack 2.13.6 unpatched.
# Every copy in the major takes the patch, or the install fails.
patchedDependencies:
hookable@^5.5.3: patches/hookable@5.5.3.patch
hookable@^6.1.1: patches/hookable@6.patch
nitropack@^2.13.4: patches/nitropack@2.patch
hookable@5: patches/hookable@5.5.3.patch
hookable@6: patches/hookable@6.patch
nitropack@2: patches/nitropack@2.patch
catalog:
'@antfu/eslint-config': ^9.3.0
'@cloudflare/sandbox': 1.0.0
Expand Down
15 changes: 11 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ConfigEnv, TestProjectConfiguration, ViteUserConfig } from 'vitest/config'
import { realpathSync } from 'node:fs'
import { readFileSync, realpathSync } from 'node:fs'
import { findPackageJSON } from 'node:module'
import { availableParallelism } from 'node:os'
import { dirname } from 'node:path'
Expand Down Expand Up @@ -37,19 +37,26 @@ function isNuxtRuntimeEntry(file: string): boolean {
* patched 2.13.4. The cache tests kept passing against 2.13.4, and production
* shipped the unpatched cache (Sentry SKILLD-5A).
*/
function shippedNitroRuntime(): string {
function shippedNitropack(): string {
const packageOf = (specifier: string, from: string) => realpathSync(findPackageJSON(specifier, pathToFileURL(from))!)
const nitroServer = packageOf('@nuxt/nitro-server', packageOf('nuxt', fileURLToPath(import.meta.url)))
return `${dirname(packageOf('nitropack', nitroServer))}/dist/runtime`
// Without its own dependency, Node falls back to pnpm's hoisted copy, which the build may not bundle.
if (!JSON.parse(readFileSync(nitroServer, 'utf8')).dependencies?.nitropack)
throw new Error('@nuxt/nitro-server no longer depends on nitropack. Point the nitropack aliases in vitest.config.ts at the copy the build bundles.')
return dirname(packageOf('nitropack', nitroServer))
}

const nitropack = shippedNitropack()

const nuxtVitestConfig = defineVitestConfig({
resolve: {
// Keep the object form: `defineVitestConfig` merges Nuxt's own aliases
// (`#app`, `#imports`) into an object and drops them from an array.
alias: {
'#checkin/checks': fileURLToPath(new URL('./test/fixtures/checkin-registry.ts', import.meta.url)),
'nitropack/runtime': shippedNitroRuntime(),
// A prefix alias also matches `nitropack/runtime/meta`, a separate export, so map it first.
'nitropack/runtime/meta': `${nitropack}/runtime-meta.mjs`,
'nitropack/runtime': `${nitropack}/dist/runtime`,
},
},
test: {
Expand Down
Loading