Skip to content

remove unused dependencies#3127

Merged
turadg merged 2 commits intomasterfrom
ta/deps-cleanup
Mar 17, 2026
Merged

remove unused dependencies#3127
turadg merged 2 commits intomasterfrom
ta/deps-cleanup

Conversation

@turadg
Copy link
Member

@turadg turadg commented Mar 12, 2026

incidental

Description

Prompted by,

Knip does a more reliable analysis of what's used or not.

This adds a script to verify there are no unused dependencies in the package.json. It skips devDepedencies since those don't generally affect package consumers.

This doesn't go into CI but it could.

Security Considerations

hygiene, avoid unused deps

Scaling Considerations

none

Documentation Considerations

none

Testing Considerations

CI

Compatibility Considerations

no

Upgrade Considerations

changeset defined

@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: 6ada52b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@endo/compartment-mapper Patch
@endo/lp32 Patch
@endo/marshal Patch
@endo/module-source Patch
@endo/netstring Patch
@endo/pass-style Patch
@endo/patterns Patch
@endo/stream-node Patch
@endo/bundle-source Patch
@endo/check-bundle Patch
@endo/daemon Patch
@endo/import-bundle Patch
@endo/test262-runner Patch
@endo/captp Patch
@endo/exo Patch
@endo/ocapn Patch
@endo/cli Patch
@endo/far Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@turadg turadg marked this pull request as ready for review March 12, 2026 23:40
Copilot AI review requested due to automatic review settings March 12, 2026 23:40
@turadg turadg enabled auto-merge March 12, 2026 23:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes a set of runtime dependencies that appear to be unused across several @endo/* packages, and adds a maintenance script/config to check for unused runtime dependencies (excluding devDependencies) using Knip.

Changes:

  • Removed stale entries from multiple packages/*/package.json dependencies lists (and updated yarn.lock accordingly).
  • Added scripts/maintenance/check-unused-deps.sh to run Knip and fail if unused runtime dependencies are detected.
  • Added a Knip config (scripts/maintenance/knip.json) and a changeset documenting the dependency hygiene update.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Reflects dependency removals across workspaces.
scripts/maintenance/knip.json Adds Knip configuration for workspace scanning (but currently contains invalid JSON).
scripts/maintenance/check-unused-deps.sh Adds a helper script to detect unused runtime dependencies via Knip.
packages/stream-node/package.json Removes stale runtime deps from dependencies.
packages/patterns/package.json Removes stale runtime deps from dependencies.
packages/pass-style/package.json Removes stale runtime deps from dependencies.
packages/ocapn/package.json Removes stale runtime deps from dependencies.
packages/netstring/package.json Removes stale runtime deps from dependencies.
packages/module-source/package.json Removes stale runtime deps from dependencies.
packages/marshal/package.json Removes stale runtime deps from dependencies.
packages/lp32/package.json Removes stale runtime deps from dependencies.
packages/daemon/package.json Removes stale runtime deps from dependencies.
packages/compartment-mapper/package.json Removes stale runtime deps from dependencies.
packages/cli/package.json Removes stale runtime deps from dependencies.
.changeset/soft-icons-share.md Declares patch releases for affected publishable packages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

"ignoreWorkspaces": [".", "golang/cosmos"],
"workspaces": {
"packages/*": {
// Broad to allow for deep imports
Comment on lines +5 to +6
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would favor making #!/bin/bash explicit. The -- in these commands eliminates ambiguity when a filename resembles a flag. It doesn’t come up often but it is on my pile of best practices. If shell check doesn’t complain, though, it’s fine either way.

--config "$SCRIPT_DIR/knip.json" \
--reporter json \
--include dependencies \
"$@" >"$REPORT_FILE"
@turadg turadg requested review from kriskowal and kumavis March 13, 2026 11:22
Comment on lines +5 to +6
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would favor making #!/bin/bash explicit. The -- in these commands eliminates ambiguity when a filename resembles a flag. It doesn’t come up often but it is on my pile of best practices. If shell check doesn’t complain, though, it’s fine either way.

@turadg turadg merged commit c578413 into master Mar 17, 2026
21 checks passed
@turadg turadg deleted the ta/deps-cleanup branch March 17, 2026 20:56
@github-actions github-actions bot mentioned this pull request Mar 16, 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.

3 participants