Skip to content

feat(sync): read optional and peer dependencies - #2445

Merged
antfu merged 1 commit into
vercel-labs:mainfrom
antfubot:feat/sync-optional-peer-deps
Oct 9, 2026
Merged

antfu merged 1 commit into
vercel-labs:mainfrom
antfubot:feat/sync-optional-peer-deps

Conversation

@antfubot

@antfubot antfubot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Part of #2323 (RFC: Install skills from npm packages). Carried over from #2348.

What changes

skills experimental_sync now scans every package the project declares in package.json:

  • dependencies and devDependencies, as before
  • optionalDependencies: installed by default and skipped by the package manager when they cannot be installed
  • peerDependencies: 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 discoverNodeModuleSkills back onto the function. Step 7 had left a type alias between the two.

Tests

tests/sync.test.ts covers skills from an optional and a peer dependency, plus a declared optional dependency that is not installed. The test fails on main, and the full suite passes (954).


This PR was created with the help of an agent.

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
antfu merged commit 061260b into vercel-labs:main Oct 9, 2026
10 checks passed
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.

2 participants