build(deps): bump express to v5 and migrate wildcard route - #1384
Open
TimothyJones wants to merge 1 commit into
Open
build(deps): bump express to v5 and migrate wildcard route#1384TimothyJones wants to merge 1 commit into
TimothyJones wants to merge 1 commit into
Conversation
Bumps express from ^4.20.0 / ^4.21.0 to ^5.1.0 and @types/express from
^4.17.14 to ^5.0.0 across all packages that use them.
Express 5's router (path-to-regexp v8) no longer accepts a bare '*'
route pattern, so the catch-all route in the HTTP mock server now uses
'/{*splat}', which matches all paths including '/'.
Replaces #950, which bumped the dependency without the required
code migration.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ct3i5iaQ1pNwSDofkY37bv
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.
Bumps
expressfrom^4.20.0/^4.21.0to^5.1.0(resolves to 5.2.1) and@types/expressfrom^4.17.14to^5.0.0(resolves to 5.0.6) in every package that uses them:case-core-plugin-http(runtime dependency)case-core,contract-case-dsl-js-jest,contract-case-dsl-js-vitest(dev dependencies, test servers)case-entities,case-core-plugin-http-dsl(@types/expressonly)Why #950 failed
#950 bumped the dependency without migrating the code. Express 5 uses
router@2/path-to-regexp@8, which rejects a bare'*'route pattern at registration time (TypeError: Missing parameter name), so the HTTP mock server incase-core-plugin-httpcrashed on startup. That PR is also a year stale and now conflicts withmain(it predates thecontract-case-jest→contract-case-dsl-js-jestpackage split).Migration
The only code change needed was the catch-all route in
mockHttpServer.ts:'/{*splat}'is the express 5 spelling of "match every path", including/.Everything else already used express-5-compatible APIs — the test servers use literal routes,
:parampath parameters,res.format, andbody-parser@2(which is already the express 5-era version), and none of the other v4→v5 breaking changes (res.redirect('back'),req.param(), magic statusres.send(code), etc.) appear in the codebase.Verification
nx run-many -t build,lintfor all six changed packages plus nine downstream dependents (case-connector,cli,contract-case-dsl-js, …): all greencase-coretests: 27 suites / 454 tests pass, exercising the migrated mock server against the express test server via the full contract-testing flowcase-core-plugin-httptests: pass'::'and the container has no IPv6 (a bare Nodenet.listen(0, '::')fails identically there, so it's environmental, not express-related); those suites run in CILockfile changes are limited to the express upgrade — the only new transitive dependencies are express 5's own
router,path-to-regexp, andis-promise. The remainingexpress@4in the lockfile is a transitive dependency of docusaurus (webpack-dev-server), which is out of scope here.Closes #950
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ct3i5iaQ1pNwSDofkY37bv
Generated by Claude Code