Repository navigation
OPS-11: dependency guard (runtime allowlist, tarball contents) - #99
Merged
Merged
Conversation
…ript scripts/check-deps.mjs (shared with the other three repos) fails CI when the published package gains a runtime or peer dependency outside the allowlist, any optional or bundled dependency, or a tarball file other than dist/, package.json, README, LICENSE and CHANGELOG. javascript-excel's allowlist is empty. examples/node runs tsc, so it now declares the typescript it used through hoisting (same 7.0.2; the lockfile keeps 245 packages).
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.
OPS-11 (dependency audit) for javascript-excel: a runtime-dependency guard in CI, plus one dev declaration. No removals were needed. This changes CI and dev files only, so no changeset.
Audit result
dependencies/peerDependenciesof the published packagedist/+ README + LICENSE + package.jsonexamples/nodedeclares thetypescriptit already used)Verified with
npm view javascript-excel@next dependencies, a clean install of the published tarball (npm ls --omit=dev --allshows only the package), andnpm pack --dry-run. depcheck 1.4.7 and knip 5 ran via npx (nothing added).@changesets/cli(root)version-packages)tsdown,typescript7.0.2vitest,vite,happy-dom/domtests, the playground@vitest/browser-playwright,playwrightpublintnpm run lint@types/nodereact,react-dom,vue,@types/react(-dom)typedoc+typescript6.0.3 (tools/api-docs)typescriptinexamples/nodecheckscript runstsc, which worked only through hoistingknip also reported
examples/snippets → javascript-excelas unused. That's a false positive: the snippets import it, and are only type-checked.Open Dependabot alert: minimatch (medium,
< 11.0.1), reached throughtypedoc0.28.20 intools/api-docs(private, CI-only, never published). The latest typedoc still requiresminimatch ^10.2.5. An npmoverridesentry forcing 11 didn't re-resolve cleanly, and when forced it broke the docs build, so it isn't in this PR. Recommendation: dismiss the alert as dev-only, or wait for typedoc to move to minimatch 11.Duplicates in the lockfile (22 names with two versions) are upstream pins: vite 8.3.8 pins
rolldown ~1.2.18and tsdown 0.23.7 pins~1.3.0(with their platform bindings). Overriding either would run a tool on a version it doesn't expect.The guard
scripts/check-deps.mjs(built-ins only; shared verbatim with react-data-export, react-data-import and react-xlsx-viewer), with unit tests inscripts/check-deps.test.mjs. It fails when the published package:dependenciesentry outside--allowpeerDependenciesentry outside--peeroptionalDependenciesorbundleDependencies--pack: would publish anything other thandist/**,package.json,README.md,LICENSEorCHANGELOG.md, which keeps private workspaces, sources, tests and fixtures out of the tarballNode 22/Node 24jobs (and Node 26), after the build:node scripts/check-deps.mjs --package packages/javascript-excel --allow '' --packAdding a runtime dependency now means changing that allowlist in the same PR, where it gets reviewed.
left-paddependency added by hand, it exits 1 with "dependencies: "left-pad" is not in the allowlist (none)". The scripts' tests pass (60, including the 7 new ones).examples/nodetype-checks.