chore(deps): upgrade dependencies and fix docker-e2e Vitest RPC timeout - #448
Merged
Conversation
Bump @fastify/static, @kreuzberg/node, @types/{archiver,yauzl,node}, defuddle,
vite-plugin-dts, and vite/vite-node/vitest (coordinated, since vitest 3
doesn't support vite 8) after reviewing each changelog for breaking changes.
typescript stays on 5.9.x for now (see follow-up); tree-sitter is unchanged
per known incompatibility.
Fixes required by the vitest 3->4 bump:
- Vitest 4 mock constructors use real `new` semantics, so arrow-function
mockImplementations used to mock classes threw "is not a constructor";
converted the affected call sites across test files to function
expressions and extended the existing test-file Biome override to
disable useArrowFunction, which otherwise fights this fix.
- Re-spying an already-spied prototype method no longer resets its call
count, which broke HtmlPipeline/MarkdownPipeline middleware-count
assertions; added afterEach(() => vi.restoreAllMocks()).
@kreuzberg/node 4.10.2 stopped embedding the sheet name inside XLSX table
markdown; DocumentPipeline now reconstructs it from metadata.sheetNames so
indexed spreadsheet content doesn't silently lose that context.
Removed the @ts-expect-error workarounds now that @types/archiver@8 matches
archiver@8's ESM exports.
Also cleaned up lint drift from the Biome 2.4->2.5 bump (formatter reflow of
it.each calls) plus two small fixes (unused param, optional chain).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s dependency set (notably Vite/Vitest/Biome and related tooling) and adjusts tests + pipeline behavior to stay compatible, while also fixing npm run test:docker flakiness by avoiding long-running spawnSync calls that block Vitest’s worker heartbeat.
Changes:
- Replace
spawnSyncDocker invocations intest/docker-e2e.test.tswith asyncspawnhelpers to keep the event loop responsive during long Docker operations. - Upgrade dependencies (incl.
@fastify/static,@kreuzberg/node, Vite/Vitest, Biome) and apply the required test/mocking updates for Vitest 4 semantics. - Restore XLSX sheet-name context in
DocumentPipelineoutput when Kreuzberg no longer includes it in per-table markdown.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/docker-e2e.test.ts | Switch Docker build/run to async helpers to prevent Vitest RPC timeouts during long operations |
| test/archive-integration.test.ts | Remove obsolete @ts-expect-error now that archiver typings match exports |
| src/web/main.client.ts | Simplify HTMX xhr header check using optional chaining |
| src/utils/archive/ArchiveFactory.test.ts | Biome-driven it.each formatting change |
| src/tools/ScrapeTool.test.ts | Update mock constructor implementation for Vitest 4 “new” semantics + formatting |
| src/tools/CancelJobTool.test.ts | Biome-driven it.each formatting change |
| src/telemetry/telemetry.test.ts | Convert mocked class constructor to function expression for Vitest 4 semantics |
| src/telemetry/postHogClient.test.ts | Convert mocked constructor to function expression for Vitest 4 semantics |
| src/store/DocumentManagementService.test.ts | Convert mocked constructors to function expressions for Vitest 4 semantics |
| src/splitter/splitters/TextContentSplitter.test.ts | Tighten spy typing and update vitest import types |
| src/splitter/SemanticMarkdownSplitter.test.ts | Remove unused param warning by prefixing with _ |
| src/scraper/utils/sandbox.test.ts | Convert JSDOM mock implementations to function expressions for Vitest 4 semantics |
| src/scraper/strategies/GitHubScraperStrategy.test.ts | Convert mockImplementation to function expression for Vitest 4 semantics |
| src/scraper/pipelines/MarkdownPipeline.test.ts | Add afterEach(vi.restoreAllMocks) to prevent spy call-count leakage in Vitest 4 |
| src/scraper/pipelines/HtmlPipeline.test.ts | Add afterEach(vi.restoreAllMocks) to prevent spy call-count leakage in Vitest 4 |
| src/scraper/pipelines/DocumentPipeline.ts | Reconstruct XLSX sheet-name headings from Kreuzberg metadata when available |
| src/pipeline/PipelineManager.test.ts | Convert mocked worker constructor to function expression + formatting |
| src/index.test.ts | Convert mocked service constructor to function expression for Vitest 4 semantics |
| src/cli/index.test.ts | Convert multiple mocked constructors/tools to function expressions for Vitest 4 semantics |
| src/cli/commands/search.test.ts | Convert mocked tool constructor to function expression |
| src/cli/commands/scrape.test.ts | Convert mocked tool/event bus constructors to function expressions |
| src/cli/commands/refresh.test.ts | Convert mocked tool/event bus constructors to function expressions |
| src/cli/commands/mcp.test.ts | Convert mocked store constructors to function expressions |
| src/cli/commands/list.test.ts | Convert mocked tool constructor to function expression |
| src/cli/commands/findVersion.test.ts | Convert mocked tool constructor to function expression |
| src/cli/commands/fetchUrl.test.ts | Convert mocked fetchers/tools to function expressions |
| src/cli/commands/default.test.ts | Convert mocked store constructor to function expression |
| src/auth/ProxyAuthManager.test.ts | Adjust proxy provider mock + Biome formatting |
| src/app/AppServer.test.ts | Convert mocked auth manager constructor to function expression |
| package.json | Upgrade runtime/dev dependencies (Fastify static, Kreuzberg, Vite/Vitest, typings, etc.) |
| package-lock.json | Lockfile updates corresponding to dependency upgrades |
| biome.json | Bump Biome schema + disable useArrowFunction for src/**/*.test.ts to avoid fighting Vitest 4 constructor-mocking needs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+156
to
+159
| "vite": "^8.1.5", | ||
| "vite-node": "^6.0.0", | ||
| "vite-plugin-dts": "^5.0.3", | ||
| "vitest": "^4.1.10" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm run test:dockerreporting a false-positive failure:test/docker-e2e.test.tsusedspawnSyncfordocker build/docker run, which blocks Node's event loop for the whole command duration. Vitest's worker↔main-thread RPC heartbeat has a hardcoded 60s timeout, so any long-running synchronous call tripped[vitest-worker]: Timeout calling "onTaskUpdate"and failed the run even though every test assertion passed. Switched to asyncspawn-based helpers so the event loop stays responsive.typescriptandtree-sitter(see below), after reviewing each changelog for breaking changes:@fastify/static9→10,@kreuzberg/node4.4→4.10 (kept tilde-pinned given its license churned MIT→Elastic→MIT across minors),@types/archiver7→8 (now matches archiver@8's ESM exports — removed the@ts-expect-errorworkarounds),@types/yauzl2→3,@types/node24→26,defuddle0.18→0.19,vite-plugin-dts4→5 (confirmed unused in this repo).vite/vite-node/vitestbumped together (7→8 / 5→6 / 3→4) since Vitest 3 doesn't support Vite 8.newsemantics, so arrow-functionmockImplementations used to mock classes now throw"is not a constructor". Converted the affected call sites across test files to function expressions, and extended the existing test-file Biome override to disableuseArrowFunction(which otherwise fights this fix).HtmlPipeline/MarkdownPipelinemiddleware-count assertions; addedafterEach(() => vi.restoreAllMocks()).@kreuzberg/node4.10.2 stopped embedding the sheet name inside XLSX table markdown;DocumentPipelinenow reconstructs it frommetadata.sheetNamesso indexed spreadsheet content doesn't silently lose that context.it.eachcalls) plus two small fixes (unused param, optional chain).typescriptstays on^5.9.3: bumping breaksnpm cioutright (ERESOLVE—@kitajs/ts-html-plugin@4.1.4peer-depends ontypescript@^5.9.3). Its only newer-TS-compatible release is a5.0.0-next.2prerelease pinned to the exacttypescript@6.0.2and requiring a@kitajs/html@5.0.0-next.1prerelease bump too — holding off until a stable release exists.tree-sitter/tree-sitter-javascript/tree-sitter-pythonare intentionally left unchanged (no mutually compatible newer versions available).Test plan
npm run typechecknpm run lint(clean — 0 errors/warnings/info)npm run buildnpm test— 130/130 test files, 1874/1874 tests passingnpm run test:docker— all 5 Docker image tests passing, no more spurious RPC-timeout failure🤖 Generated with Claude Code