more upgrades: fetch migration, vitest 4, socketcluster v20#204
Merged
JoshuaVSherman merged 4 commits intodevfrom May 1, 2026
Merged
more upgrades: fetch migration, vitest 4, socketcluster v20#204JoshuaVSherman merged 4 commits intodevfrom
JoshuaVSherman merged 4 commits intodevfrom
Conversation
- src/AgController/index.ts: drop superagent import + field; call backend user lookup via Node 24 fetch with Accept/Authorization headers; check res.ok and parse JSON. user.body.userType -> user.userType. - test/AgController/index.spec.ts: stub global fetch via vi.stubGlobal (with afterEach unstubAllGlobals) instead of patching agController .superagent.get chained .set().set() in three newTour tests. - src/lib/routeUtils.ts: express 5 / path-to-regexp 8 dropped bare '*'; catch-all SPA route is now '/*splat'. - package.json: bump @types/express ^4 -> ^5 to match express ^5.2.1. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- vitest 3.2.4 -> 4.1.5, @vitest/coverage-v8 3.2.4 -> 4.1.5 - vitest.config.ts: pool 'forks' kept, but poolOptions.forks moved to top-level 'forks' (vitest 4 flattened poolOptions; old key emits a deprecation warning). All 66 tests pass. The 3 moderate npm-audit vulns still chain through socketcluster-client -> uuid; they will resolve in P2 once socketcluster-server is aligned to 20. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CLI / utility deps: - cross-env 7 -> 10 - supports-color 9 -> 10 - serve-static 1 -> 2 SocketCluster ecosystem (aligning server with already-bumped client@20): - socketcluster-server 17 -> 20 - @types/socketcluster-server 17 -> 20 - eetase 5 -> 7 - consumable-stream 2 -> 3 - sc-errors 2 -> 3 Verified: 66 unit tests pass, prod smoke (test:prod) passes (server up 5s on port 8888). Skipped @types/node 25 since engine pins Node 24. Known: 3 moderate npm-audit vulns persist via socketcluster-client@20 -> uuid@8.3.2. socketcluster-client@20 is the latest release; no upstream version pulls uuid >=14, so this is not actionable from our side (the audit's recommended downgrade to client@9 would be a regression). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Continues the
more-upgradestrack from the prior PR (#202, node-24-esm). Brings the runtime/test/socketcluster stacks current, dropssuperagentfor nativefetch, and aligns withweb-jam-backPRs from yesterday.Major bumps
.nvmrc'*'->'/*splat'(path-to-regexp 8 dropped bare*)devDependenciespoolOptions.forks-> top-levelforks(vitest 4 flattened)Code changes
src/AgController/index.ts- droppedsuperagentimport + field; backend user lookup now uses Node 24 nativefetchwithAccept/Authorizationheaders, manualres.okcheck, and JSON parse. Response shape changeduser.body.userType->user.userType. Mirrors web-jam-back#742.test/AgController/index.spec.ts- threenewTourtests now stub the globalfetchviavi.stubGlobal(withafterEachvi.unstubAllGlobals) instead of patchingagController.superagent.getchained.set().set().src/lib/routeUtils.ts- express 5 catch-all wildcard syntax:app.get('*', ...)->app.get('/*splat', ...).vitest.config.ts- movedpoolOptions.forksto top-levelforks(deprecation in vitest 4).package.json- removedsuperagentand@types/superagent.README.md- added a "Local smoke testing" section documenting the two-terminal workflow (web-jam-back + WebJamSocketCluster) for pre-merge verification, since there's no hosted dev env.Verification
npm test(eslint + vitest): 66 passed / 66.npm run test:prod(clean install --omit=dev + smoke-start.mjs): OK - server stayed up 5s on port 8888.npx tsc --noEmit: clean.Known issues / intentionally skipped
npm auditvulns chain throughsocketcluster-client@20 -> uuid@8.3.2.socketcluster-client@20is the latest release and no version pullsuuid >= 14, so this is not actionable from our side - the audit's recommended downgrade to client@9 would be a regression. (A scheduled remote agent will recheck in 30 days.)@types/node25 skipped - engine pins Node 24, so 24.x types are correct.findOneAndUpdate({ new: true })->{ returnDocument: 'after' }) - not introduced here, cosmetic; could be cleaned up in a separate PR.Test plan
master(see README "Local smoke testing").Generated with Claude Code