Repository navigation
feat(sync): read optional and peer dependencies - #2445
Merged
Merged
Conversation
Sync now scans every package the project declares: dependencies, devDependencies, optionalDependencies and peerDependencies. A declared package that is not installed, such as an omitted optional one, is skipped as before. From vercel-labs#2348.
antfu
approved these changes
Oct 9, 2026
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.
Part of #2323 (RFC: Install skills from npm packages). Carried over from #2348.
What changes
skills experimental_syncnow scans every package the project declares inpackage.json:dependenciesanddevDependencies, as beforeoptionalDependencies: installed by default and skipped by the package manager when they cannot be installedpeerDependencies: mostly useful in library repos, where the peers are installed for local development. npm 7+ and pnpm 8+ install peers automatically.The supply-chain rule from step 1 still holds, because every one of these is a package the user declared. A declared package that is not in
node_modules(an omitted optional, a peer the package manager did not install) is skipped, as before.This also moves the doc comment of
discoverNodeModuleSkillsback onto the function. Step 7 had left a type alias between the two.Tests
tests/sync.test.tscovers skills from an optional and a peer dependency, plus a declared optional dependency that is not installed. The test fails onmain, and the full suite passes (954).This PR was created with the help of an agent.