From f25fc2bd74f621b1f1b80a8bad6ab271109b5283 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 24 Sep 2026 20:08:44 +0700 Subject: [PATCH] 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 --- package-lock.json | 18 ++++++------------ package.json | 2 +- vite.config.ts | 6 +++++- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6df6826..337e09c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "@scure/bip39": "1.6.0", "@tanstack/query-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", "@unhead/addons": "^2.0.10", "@unhead/react": "^2.0.10", @@ -3545,19 +3545,13 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.75.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.75.1.tgz", - "integrity": "sha512-tN+gG+eXCHYm+VpmdXUP1rfE9LUrRzgYozTkBZtJV1/WFM3vwWNKQC8G6b2RKcs+2cPg+hdToZHZfjL3bF4yIQ==", + "version": "5.102.8", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.102.8.tgz", + "integrity": "sha512-TYBea4OuXWD7MhaSHq069TWbFe7rcwWN6kzT7JF0OKi1K6c1gTv2IzD6A6ExJsCMozdkqBWeuIUZmu4KQg0O5A==", "license": "MIT", - "dependencies": { - "@tanstack/query-core": "5.75.0" - }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "peerDependencies": { - "react": "^18 || ^19" + "url": "https://github.com/sponsors/tannerlinsley", + "type": "github" } }, "node_modules/@tanstack/react-query-persist-client": { diff --git a/package.json b/package.json index 0361711..b1408b3 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@scure/bip39": "1.6.0", "@tanstack/query-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", "@unhead/addons": "^2.0.10", "@unhead/react": "^2.0.10", diff --git a/vite.config.ts b/vite.config.ts index dd04b5a..96e0ca6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -20,7 +20,11 @@ export default defineConfig(() => ({ test: { globals: true, 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 // 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