Dedup fs-extra shims into scripts/fsutil.js and reword titlebar comment#1029
Draft
notluquis wants to merge 1 commit into
Draft
Dedup fs-extra shims into scripts/fsutil.js and reword titlebar comment#1029notluquis wants to merge 1 commit into
notluquis wants to merge 1 commit into
Conversation
The three build scripts each redefined the same native replacements for the fs-extra helpers they used, so a change to one shim risked drifting from the others. Move copySync, removeSync, ensureDirSync, and readJSONSync into scripts/fsutil.js and require only what each consumer needs. The titlebar interop comment also carried an internal tooling prefix; reword it to plainly explain why the CommonJS exports shim is required before the inline module runs. Worked through this with Claude Code and verified the scripts still load and the unit suite stays green.
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.
Closes #1027.
Two small cleanups from the marker sweep.
The comment in
themedwindow.tscarried an internal tooling prefix that does not belong in the tree. Reworded it to plainly state why the CommonJS interop shim is needed:dialogtitlebar.jsis emitted as CommonJS undernodenext, soexportshas to exist before it runs as an inline module or itscustomElements.definenever fires.The three build scripts each carried their own copy of the same fs-extra replacement shims. Pulled
copySync,removeSync,ensureDirSync, andreadJSONSyncinto a singlescripts/fsutil.jsand hadcopyassets.js,buildutil.js, andextract.jsrequire what they use. Each script keeps its ownrequire('fs')since they all still callfsdirectly for other things.Built this with Claude Code and verified locally:
node --checkon all four scripts, the fsutil module loads and exports the four helpers,yarn tsc --noEmitis clean,yarn prettier --checkpasses on all touched files, andyarn vitest runstays green (449 tests).