Reduce runtime dependencies from 17 packages to 10 - #186
Merged
Conversation
Remove fs-extra and debug from the runtime dependencies, and which from the dev dependencies: - fs-extra: 3 of its 7 call sites (existsSync, statSync) were plain node:fs re-exports; the rest map to fs.promises.mkdir/writeFile/readdir and JSON.parse(fs.readFileSync()). Drops fs-extra, graceful-fs, jsonfile and universalify. - debug: replaced by a ~10 line local helper. util.debuglog cannot be used because it only reads NODE_DEBUG from the launch environment, so it would have broken the documented DEBUG=java-caller contract, which this helper keeps working unchanged. Drops debug and ms. - which: used once, to find the java binary in a test, and its engines field (^22.22.2 || ^24.15.0 || >=26) excludes the Node 18/20 versions the CI matrix tests. Replaced by a findInPath test helper. - Bump yauzl so it no longer pulls buffer-crc32. Also fixes a few things found on the way: - engines said node >=12 while njre@3 requires >=18 and every dev tool needs 18+, so consumers on Node 12-16 installed a broken tree. - npm run lint was already broken on main: eslint 10 no longer hoists @eslint/js and globals, which eslint.config.js requires. They are now declared explicitly, and a Lint job runs npm run lint in CI so the script cannot silently rot again. - Drop the @babel/core and uuid overrides, which matched no package in the tree.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Max errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|---|
| actionlint | 4 | 2 | 0 | 0.06s | |||
| ✅ ACTION | zizmor | 4 | 0 | 0 | 2.08s | ||
| ✅ COPYPASTE | jscpd | yes | no | no | 0.76s | ||
| ✅ JAVASCRIPT | eslint | 11 | 0 | 0 | 0.75s | ||
| ✅ JSON | jsonlint | 9 | 0 | 0 | 0.08s | ||
| ✅ JSON | npm-package-json-lint | yes | no | no | 0.33s | ||
| ✅ JSON | prettier | 9 | 0 | 0 | 0.3s | ||
| ✅ JSON | v8r | 9 | 0 | 0 | 17.46s | ||
| markdownlint | 7 | 18 | 0 | 0.62s | |||
| markdown-table-formatter | 7 | 1 | 0 | 0.18s | |||
| ✅ REPOSITORY | betterleaks | yes | no | no | 0.65s | ||
| ✅ REPOSITORY | checkov | yes | no | no | 21.21s | ||
| ✅ REPOSITORY | git_diff | yes | no | no | 0.02s | ||
| ✅ REPOSITORY | grype | yes | no | no | 62.7s | ||
| ✅ REPOSITORY | osv-scanner | yes | no | no | 0.47s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 1.42s | ||
| ✅ REPOSITORY | syft | yes | no | no | 1.64s | ||
| ✅ REPOSITORY | trivy | yes | no | no | 11.78s | ||
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.21s | ||
| ✅ REPOSITORY | trufflehog | yes | no | no | 4.32s | ||
| ✅ SPELL | cspell | 40 | 0 | 0 | 3.81s | ||
| lychee | 27 | 4 | 0 | 55.09s | |||
| ✅ TYPESCRIPT | eslint | 1 | 0 | 0 | 0.26s | ||
| ✅ TYPESCRIPT | prettier | 1 | 0 | 0 | 0.31s | ||
| ts-standard | 1 | 1 | 0 | 0.3s | |||
| ✅ YAML | prettier | 9 | 0 | 0 | 0.43s | ||
| ✅ YAML | v8r | 9 | 0 | 0 | 8.47s | ||
| ✅ YAML | yamllint | 9 | 0 | 0 | 0.53s |
Detailed Issues
⚠️ ACTION / actionlint - 2 errors
.github/workflows/github-dependents-info.yml:55:9: shellcheck reported issue in this script: SC2086:info:1:15: Double quote to prevent globbing and word splitting [shellcheck]
|
55 | run: sudo chown -R $USER:$USER .
| ^~~~
.github/workflows/github-dependents-info.yml:55:9: shellcheck reported issue in this script: SC2086:info:1:21: Double quote to prevent globbing and word splitting [shellcheck]
|
55 | run: sudo chown -R $USER:$USER .
| ^~~~
⚠️ SPELL / lychee - 4 errors
📝 Summary
---------------------
🔍 Total...........75
🔗 Unique..........63
✅ Successful......24
⏳ Timeouts.........0
🔀 Redirected.......7
👻 Excluded........47
❓ Unknown..........0
🚫 Errors...........4
⛔ Unsupported......4
Errors in README.md
[403] https://npmjs.org/package/java-caller (at 5:1) | Rejected status code: 403 Forbidden | Followed 1 redirect. Redirects: https://npmjs.org/package/java-caller --[301]--> https://www.npmjs.com/package/java-caller
[403] https://npmjs.org/package/java-caller (at 6:1) | Rejected status code: 403 Forbidden | Followed 1 redirect. Redirects: https://npmjs.org/package/java-caller --[301]--> https://www.npmjs.com/package/java-caller
[403] https://www.npmjs.com/package/java-caller (at 4:1) | Rejected status code: 403 Forbidden
[403] https://www.npmjs.com/package/njre (at 16:145) | Rejected status code: 403 Forbidden
Hint: Followed 7 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdown-table-formatter - 1 error
1 files contain markdown tables to format:
- README.md
⚠️ MARKDOWN / markdownlint - 18 errors
CHANGELOG.md:7:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
CODE_OF_CONDUCT.md:58:44 error MD034/no-bare-urls Bare URL used [Context: "nicolas.vuillamy@gmail.com"]
CODE_OF_CONDUCT.md:71:14 error MD034/no-bare-urls Bare URL used [Context: "https://www.contributor-covena..."]
CODE_OF_CONDUCT.md:76:1 error MD034/no-bare-urls Bare URL used [Context: "https://www.contributor-covena..."]
README.md:66:13 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:66:27 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:66:37 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:66:47 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:66:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:66:13 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:66:27 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:66:37 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:67:361 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]
README.md:69:123 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]
README.md:73:315 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]
README.md:74:310 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]
README.md:75:208 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]
README.md:76:233 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]
⚠️ TYPESCRIPT / ts-standard - 1 error
Unable to locate the project file. A project file (tsconfig.json or tsconfig.eslint.json) is required in order to use ts-standard.
See detailed reports in MegaLinter artifacts

Show us your support by starring ⭐ the repository
Traces are now activated with NODE_DEBUG=java-caller instead of DEBUG=java-caller. Keeping the old contract required a hand-rolled namespace matcher, since util.debuglog only reads NODE_DEBUG from the environment the process was launched with; using the built-in directly drops that custom code, at the cost of a documented breaking change. Consequences, documented in CHANGELOG and README: - the env var is NODE_DEBUG, and it must be set at launch: assigning process.env.NODE_DEBUG at runtime no longer enables traces, so test/helpers/init.js can no longer turn them on under a debugger - output format becomes "JAVA-CALLER <pid>: <message>" Updated the CI workflow, test:debug script and both example apps.
The javascript flavor is a deliberate choice, so the suggestion to build a custom flavor is noise on every run.
Breaking changes: NODE_DEBUG replaces DEBUG for traces, and the minimum supported Node.js version moves from 12 to 18.
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.
Shrinks the supply-chain surface by removing dependencies that node built-ins cover, without any change to the public API.
Runtime: 17 packages -> 10
fs-extraexistsSync,statSync) were plainnode:fsre-exports; the rest are one-liners onfs.promises/JSON.parsedebugyauzlbump)njreandsemverare kept: njre is the whole point of the library, and semver'scoerceis what parses Java's1.8.0_292-style versions.DEBUG=java-callerstill works exactly as documented.util.debuglogwas not usable as a replacement because it only readsNODE_DEBUGfrom the environment the process was launched with, so it could not honour the existing contract. Verified:DEBUG=java-callerandDEBUG=java-caller,njreboth emit traces, unset emits nothing.Dev:
whichremovedUsed once, to locate the
javabinary in a test. Itsenginesfield is^22.22.2 || ^24.15.0 || >=26.0.0, which excludes Node 18 and 20 from our own CI matrix (npm was already printingEBADENGINEon every install). Replaced by afindInPathhelper intest/helpers/common.jsthat honoursPATHEXTon Windows.Fixes found along the way
engineswas wrong: it claimednode >=12.0.0, butnjre@3requires>=18and every dev tool needs 18+. Anyone installing on Node 12-16 got a tree that could not work. Now>=18.0.0.npm run lintwas already broken onmain: ESLint 10 stopped hoisting@eslint/jsandglobals, whicheslint.config.jsrequires, so the script failed before linting anything. CI never ran it (MegaLinter uses its own eslint), so nothing caught it. They are now declared as devDependencies, and aLintjob runsnpm run lintin CI.@babel/coreanduuidmatched zero packages in the tree. Stale pins like these are what caused theEOVERRIDElockfile failure on Update all non-major dependencies #185.Verification
npm run test: 36 passing, including the real njre install paths that exercise the replacedmkdir/writeFile/readdir/statSynccallsnpm run lint: clean (eslint + prettier)