test(build): validate packaged bundle PURE annotations and improve no…#575
Merged
Conversation
d463391 to
3e13f00
Compare
…rmalization - add a generated-artifact validation script at bundle-pure-annotations-check.js to scan packaged JavaScript under bundle and dist outputs - fail when PURE annotations have whitespace after opening parenthesis, and report file plus line for quick diagnosis - add progress logging to show discovered files and each file being processed - run the new validation as part of size-check in package.json - widen the PURE annotation normalization spacing matcher in rollup.config.js to tolerate larger whitespace ranges before rewriting to canonical form
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a post-build validation script that scans generated bundle/dist JS for malformed PURE annotations (whitespace between ( and the comment), wires it into size-check, and widens the rollup normalization regex to match more whitespace variants.
Changes:
- New
lib/test/bundle-pure-annotations-check.jsscript recursively scanslib/bundleandlib/dist.jsfiles. size-checknpm script now also runs the new validator.fixPureAnnotations()regex broadened to allow up to 5 whitespace chars (including newlines) at each spot.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Chains the new PURE annotation checker into size-check. |
| lib/test/bundle-pure-annotations-check.js | New validator scanning generated JS for invalid PURE annotation spacing. |
| lib/rollup.config.js | Widens normalization regex from [ \t]{0,n} to \s{0,5}. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #575 +/- ##
=======================================
Coverage 99.35% 99.35%
=======================================
Files 165 165
Lines 5089 5089
Branches 1116 1118 +2
=======================================
Hits 5056 5056
Misses 33 33 🚀 New features to boost your workflow:
|
nevware21-bot
approved these changes
May 29, 2026
nevware21-bot
left a comment
Contributor
There was a problem hiding this comment.
Approved by nevware21-bot
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.
…rmalization