fix: resolve all 14 open Dependabot alerts - #62
Conversation
- Bump wrangler ^4.109.0 -> ^4.127.1 in all three packages (fixes miniflare's pinned sharp < 0.35.0, undici < 7.29.0) - Bump @cloudflare/vitest-pool-workers ^0.8.0 -> ^0.20.3 in user-mgmt (fixes nested wrangler 4.35.0 command injection, stray vitest 3.0.9 peer hoist, and its miniflare's old ws/sharp/undici) - Add root npm override js-yaml ^4.3.1 (lerna pins 4.3.0 exactly, even in latest lerna 10.0.1) - npm update brace-expansion/vite for in-range transitive fixes - Migrate vitest.config to the new cloudflareTest() plugin API required by vitest-pool-workers 0.20.x (ESM-only, so renamed to .mts) - Add test/cloudflare-test.d.ts reference: the new package no longer exposes the cloudflare:test ambient types via its "types" field All 93 user-mgmt tests pass; tsc --noEmit clean in user-mgmt and session-state. Claude-Session: https://claude.ai/code/session_011sL8MCm9Qma4oKkvdZbHu5
There was a problem hiding this comment.
🟡 Changes recommended
The new cloudflare-test.d.ts uses a brittle hard-coded relative path into node_modules, which can break depending on install/hoist layout and should be made resilient.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR batches dev-dependency upgrades (primarily wrangler and @cloudflare/vitest-pool-workers) and updates the user-mgmt Vitest configuration to the newer ESM/plugin-based Cloudflare Workers test integration, with the stated goal of clearing all open Dependabot alerts originating from the root lockfile.
Changes:
- Bumped
wranglerto^4.127.1across workspace packages, and bumped@cloudflare/vitest-pool-workersto^0.20.3inuser-mgmt. - Migrated
user-mgmtVitest config fromdefineWorkersConfig(.ts) todefineConfig+cloudflareTest()(.mts). - Added a root
overridesentry forjs-yamland introduced a local d.ts reference to restorecloudflare:testambient typings.
File summaries
| File | Description |
|---|---|
| packages/user-mgmt/vitest.config.ts | Removed old Workers pool config file (replaced by ESM config). |
| packages/user-mgmt/vitest.config.mts | New ESM Vitest config using cloudflareTest() plugin. |
| packages/user-mgmt/test/cloudflare-test.d.ts | Adds explicit ambient type inclusion for cloudflare:test. |
| packages/user-mgmt/package.json | Bumps @cloudflare/vitest-pool-workers and wrangler. |
| packages/session-state/package.json | Bumps wrangler. |
| packages/account-pages/package.json | Bumps wrangler. |
| package.json | Adds overrides to force a non-vulnerable js-yaml. |
Review details
- Files reviewed: 6/8 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace the hard-coded ../node_modules path reference with a 'reference types' directive, which resolves through normal node_modules lookup and keeps working if npm changes hoisting. Claude-Session: https://claude.ai/code/session_011sL8MCm9Qma4oKkvdZbHu5
|
Addressed the Copilot review: replaced the hard-coded |
Summary
Clears all 14 open Dependabot alerts (all npm, all dev-scope, all in the root
package-lock.json) in one batch. Verified after the update that no vulnerable version remains anywhere in the lockfile.overridesentry (lerna pins 4.3.0 exactly, even at latest 10.0.1)npm update(in-range)Changes
wrangler^4.109.0 → ^4.127.1 in account-pages, session-state, user-mgmt@cloudflare/vitest-pool-workers^0.8.0 → ^0.20.3 in user-mgmtpackage.json:overrides: { "js-yaml": "^4.3.1" }vitest.config.ts→vitest.config.mts, migrated fromdefineWorkersConfig+poolOptions.workersto the newdefineConfig+cloudflareTest()plugin API (required by vitest-pool-workers 0.13+; the package is now ESM-only, hence.mts)test/cloudflare-test.d.tsreferencing thecloudflare:testambient types, which the new package no longer exposes via itstypesfieldNotes
-alphabuilds; that is what Cloudflare currently ships in latest wrangler. The alternative (vitest-pool-workers 0.19.x, miniflare 4.x stable) leaves undici 7.28.0 in the tree, so the alert would stay open.Verification
vitest runin user-mgmt: 7 files, 93 tests, all passtsc --noEmitclean in user-mgmt and session-statehttps://claude.ai/code/session_011sL8MCm9Qma4oKkvdZbHu5