fix: support JavaScript Express guards#87
Merged
Conversation
|
Adds Express guard support and production-backed demo with extensive tests. 🎯 Quality: 100% Elite · 📦 Size: Large — consider splitting if possible 📈 This month: Your 235th PR — above team average · Averaging Excellent |
Contributor
Author
|
/review |
daniloradovic
approved these changes
Jul 15, 2026
patchstackdave
approved these changes
Jul 15, 2026
84007ab to
5960b5e
Compare
* feat: add production virtual patch demo * feat: add guided virtual patch demo
5960b5e to
5acf761
Compare
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.
What changed
guard.ts,guard.js, orguard.cjsexpress.json()and before routesWhy
Bolt commonly generates a plain ESM
server.js. The existing Express adapter always scaffoldedguard.ts, inserted an extensionless import, and registered raw-stream middleware beforeexpress.json(). That shape could not run under Node and could consume the request before Express parsed{text}.Impact
The Express todo application used by the Patchstack virtual-patching walkthrough can now be wired by
patchstack-connect protectwithout manual middleware. TypeScript and CommonJS Express projects retain module-format-correct output.Validation
npm run typechecknpm test— 41 files, 473 tests passednpm run buildserver.jsfixture, CommonJS fixture, idempotency, middleware ordering, missing-parser fallback, and Node syntax checksDependency
This PR is stacked on #86 because the JavaScript guard also consumes the shared site-UUID baking added there. Merge #86 first, then retarget this PR to
main.