Repository navigation
fix(javascript): parse explicit CommonJS wrapper syntax - #2475
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: Valid CommonJS wrapper code in a I tested head 405f82c against base bb54082. I used 32 fixture folders and Node 22, 24 and 26. Results
The five snippets in a
Relationships were found on every valid Edges (not blockers)
Not run
Thanks, rudycelekli, for the fix and for the clear notes on the first revision. Full case table (32 cases)How to read it:
Commands
Test setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
|
@greptileai review |
|
Valid
.cjstop-levelreturnandnew.targetwere reported as syntax failures in artifact analysis and reference imports. The shared parser now admits CommonJS wrapper syntax while preserving inert reconstruction of module declarations stored in.cjsassets. Reference imports retain extension-based runtime diagnostics; artifact parsing infers declaration syntax and uses CommonJS diagnostics for recovered scripts, so module-only strict errors do not contaminate valid sloppy CommonJS source.The first published implementation forced artifact
.cjssources into CommonJS mode and caused two existing directory/ASAR reconstruction tests to become partial. This same-PR correction preserves the existing static-source contract at the producing parser; both in-process analysis and compiled analysis workers consume it without downstream patches.Validation with pinned Node 24.18.0 and locked dependencies:
npm run checkandnpm run verify:test-discoverypassed.A first local repair draft exposed Babel's sticky module diagnostics on valid sloppy CommonJS scripts. Two new native controls caught that draft; the final parser obtains CommonJS diagnostics when syntax inference chose a recovered script. The failed draft and initial missing-artifact run are preserved separately. A check attempt blocked by a concurrent artifact writer was excluded; its raw log was overwritten by the successful sequential retry, and that limitation is recorded.
GitHub CI failed on the previous published revision. After correction, the GitHub CI run passed at commit
405f82c5c6e36d38906cd5b536bcf63b8c6dcd2c; the latest check rollup is successful, including the formerly failing test shard. Independent automated review also passed the same 41 consumer/wrapper/reference cases and required check. Maintainer acceptance is not established.AI assistance: OpenAI Codex generated the implementation, tests, analysis and this description. Verification was automated; independent AI review is tracked separately. No human review or understanding is claimed.