Repository navigation
chore(automation-utils): replace shelljs file helpers with node:fs - #2503
Merged
r0b1n merged 1 commit intoOct 29, 2026
Merged
Conversation
Use node:fs/promises for rm, mkdir and cp in automation/utils and the charts-web and data-widgets scripts, and remove shelljs from automation/utils. shell.ts keeps small helpers where node:fs has no direct equivalent: - findFiles: glob that fails when a pattern matches nothing, like shelljs find - move: rename with a copy and remove fallback across file systems, like mv - makeWritableRecursive: chmod -R a+rw zip() now switches directories with process.chdir instead of pushd/popd.
Contributor
AI Code Review
What was reviewed
Skipped (out of scope): CI: pending: AI Code Review · unrelated failures: security/snyk (external scanner, not tied to this diff) Positives
|
r0b1n
merged commit Oct 29, 2026
e2f4c2f
into
chore/automation-utils-drop-shelljs
4 of 5 checks passed
Collaborator
Author
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.
Pull request type
Refactoring (e.g. file rename, variable rename, etc.)
Description
Second step towards replacing shelljs. Stacked on #2502; retarget to
mainafter that one is merged.The shelljs file helpers in
automation/utilsare replaced withnode:fs/promises, and shelljs is removed fromautomation/utils. (automation/run-e2estill uses its own shelljs; that is a later step.)rm -rf,mkdir -pandcpcall sites now userm/mkdir/cpfromnode:fs/promises, inautomation/utilsand in the charts-web and data-widgets scripts.shell.tskeeps small helpers only wherenode:fshas no direct equivalent:findFiles(...patterns):fs.globSyncthat throws when a pattern matches nothing. shelljsfindwithfatalfailed the same way, so a missing mpk still stops the release instead of being skipped silently.move(source, dest):renamewith a copy and remove fallback when crossing file systems, like shelljsmv. This replaces the cp + rm workaround inmoveModuleToDistfor mv silently swallows errors shelljs/shelljs#878.makeWritableRecursive(dir): thechmod -R a+rwused before re-zipping mpks.ensureFileExistsusesfs.accessand is now async.zip()switches directories withprocess.chdirinstead of shelljspushd/popd.rui-oss-clearanceimportsnode:fs/promisesstatically instead of the inlineawait import(...)calls.Copying a file into a directory now passes the full destination path, since
fs.cpdoesn't copy into an existing directory the way shelljscpdoes.pnpm-lock.yaml: removes shelljs 0.8.5. pnpm also swapped two peer-resolution variants of pluggable-widgets-tools between importers; that came frompnpm i, not a manual edit.What should be covered while testing?
Verified locally:
automation/utilstype-checks and lints; script lints pass for all modules and charts-web.ziprestoring the directory on failure,ensureFileExiststhrowingENOENT,findFilesmatching and throwing,makeWritableRecursive(600 → 666),move.pnpm turbo build --filter=@mendix/charts-web: Charts.mpk contains all 10 widgets merged undercom/pluspackage.xmlandLicense.txt.build:modulefordata-widgets(all 9 widget mpks copied, themesource,.version, LICENSE) andweb-actions(themesource identical to source).Not run locally: the release-only paths (
createModuleMpkin Docker,addWidgetsToMpk,moveModuleToDist, the OSS clearance scripts,rui-create-gh-release). They are worth watching on the next module release. The EXDEV fallback inmovewasn't exercised either.