Skip to content

Dedup fs-extra shims into scripts/fsutil.js and reword titlebar comment#1029

Draft
notluquis wants to merge 1 commit into
jupyterlab:masterfrom
notluquis:fix/cleanup-marker-fsutil
Draft

Dedup fs-extra shims into scripts/fsutil.js and reword titlebar comment#1029
notluquis wants to merge 1 commit into
jupyterlab:masterfrom
notluquis:fix/cleanup-marker-fsutil

Conversation

@notluquis

Copy link
Copy Markdown
Collaborator

Closes #1027.

Two small cleanups from the marker sweep.

The comment in themedwindow.ts carried an internal tooling prefix that does not belong in the tree. Reworded it to plainly state why the CommonJS interop shim is needed: dialogtitlebar.js is emitted as CommonJS under nodenext, so exports has to exist before it runs as an inline module or its customElements.define never fires.

The three build scripts each carried their own copy of the same fs-extra replacement shims. Pulled copySync, removeSync, ensureDirSync, and readJSONSync into a single scripts/fsutil.js and had copyassets.js, buildutil.js, and extract.js require what they use. Each script keeps its own require('fs') since they all still call fs directly for other things.

Built this with Claude Code and verified locally: node --check on all four scripts, the fsutil module loads and exports the four helpers, yarn tsc --noEmit is clean, yarn prettier --check passes on all touched files, and yarn vitest run stays green (449 tests).

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.
@notluquis notluquis self-assigned this Jul 7, 2026
@notluquis notluquis marked this pull request as draft July 7, 2026 17:25
@notluquis notluquis added this to the Future milestone Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comment and helper cleanup

1 participant