fix: resync package-lock with package.json + robust vitest setup path

- Regenerate lockfile so @tanstack/react-query (and the related
  query-core / persist-client packages) resolve to 5.102.8, matching
  package.json. The committed lockfile was stale at 5.75.1, which made
  `npm ci` abort with "lock file's @tanstack/react-query@5.75.1 does not
  satisfy 5.102.8" and left vitest running against a half-broken
  node_modules.
- Use path.resolve(__dirname, './src/test/setup.ts') for vitest
  setupFiles so the setup module is located relative to the config file
  rather than the invocation cwd, fixing the "Cannot find module
  .../src/test/setup.ts" resolution failure.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-09-24 20:08:44 +07:00
parent ef86d858c2
commit f25fc2bd74
3 changed files with 12 additions and 14 deletions

18
package-lock.json generated
View file

@ -59,7 +59,7 @@
"@scure/bip39": "1.6.0", "@scure/bip39": "1.6.0",
"@tanstack/query-core": "^5.102.8", "@tanstack/query-core": "^5.102.8",
"@tanstack/query-persist-client-core": "^5.102.8", "@tanstack/query-persist-client-core": "^5.102.8",
"@tanstack/react-query": "^5.56.2", "@tanstack/react-query": "^5.102.8",
"@tanstack/react-query-persist-client": "^5.102.8", "@tanstack/react-query-persist-client": "^5.102.8",
"@unhead/addons": "^2.0.10", "@unhead/addons": "^2.0.10",
"@unhead/react": "^2.0.10", "@unhead/react": "^2.0.10",
@ -3545,19 +3545,13 @@
} }
}, },
"node_modules/@tanstack/react-query": { "node_modules/@tanstack/react-query": {
"version": "5.75.1", "version": "5.102.8",
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.75.1.tgz", "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.102.8.tgz",
"integrity": "sha512-tN+gG+eXCHYm+VpmdXUP1rfE9LUrRzgYozTkBZtJV1/WFM3vwWNKQC8G6b2RKcs+2cPg+hdToZHZfjL3bF4yIQ==", "integrity": "sha512-TYBea4OuXWD7MhaSHq069TWbFe7rcwWN6kzT7JF0OKi1K6c1gTv2IzD6A6ExJsCMozdkqBWeuIUZmu4KQg0O5A==",
"license": "MIT", "license": "MIT",
"dependencies": {
"@tanstack/query-core": "5.75.0"
},
"funding": { "funding": {
"type": "github", "url": "https://github.com/sponsors/tannerlinsley",
"url": "https://github.com/sponsors/tannerlinsley" "type": "github"
},
"peerDependencies": {
"react": "^18 || ^19"
} }
}, },
"node_modules/@tanstack/react-query-persist-client": { "node_modules/@tanstack/react-query-persist-client": {

View file

@ -66,7 +66,7 @@
"@scure/bip39": "1.6.0", "@scure/bip39": "1.6.0",
"@tanstack/query-core": "^5.102.8", "@tanstack/query-core": "^5.102.8",
"@tanstack/query-persist-client-core": "^5.102.8", "@tanstack/query-persist-client-core": "^5.102.8",
"@tanstack/react-query": "5.102.8", "@tanstack/react-query": "^5.102.8",
"@tanstack/react-query-persist-client": "5.102.8", "@tanstack/react-query-persist-client": "5.102.8",
"@unhead/addons": "^2.0.10", "@unhead/addons": "^2.0.10",
"@unhead/react": "^2.0.10", "@unhead/react": "^2.0.10",

View file

@ -20,7 +20,11 @@ export default defineConfig(() => ({
test: { test: {
globals: true, globals: true,
environment: 'jsdom', environment: 'jsdom',
setupFiles: './src/test/setup.ts', // Absolute path (resolved from this config's own directory) so the setup
// file is found regardless of the cwd vitest is invoked from. A bare
// relative './src/test/setup.ts' can resolve against the wrong root on
// some setups and fail with "Cannot find module .../src/test/setup.ts".
setupFiles: path.resolve(__dirname, './src/test/setup.ts'),
// Only run the app's own tests. Skill templates under .agents/ carry their // Only run the app's own tests. Skill templates under .agents/ carry their
// own *.test.tsx that assume a different project layout (e.g. they import // own *.test.tsx that assume a different project layout (e.g. they import
// @/lib/getDisplayName, which doesn't exist here) and must never run as // @/lib/getDisplayName, which doesn't exist here) and must never run as