feat: support third-party NPM package guidelines and skills - #935
Open
calebdw wants to merge 1 commit into
Open
Conversation
Previously, only first-party NPM packages (@laravel/*, @inertiajs/*)
could ship guidelines and skills via node_modules. Third-party Composer
packages already had this capability through getThirdPartyGuidelines()
and getThirdPartySkills(), but the equivalent NPM discovery methods
(Npm::packagesDirectoriesWithBoostGuidelines/Skills) were never wired
into those code paths.
This adds NPM third-party discovery to GuidelineComposer,
SkillComposer, and ThirdPartyPackage::discover(), mirroring how
Composer third-party packages are already handled. Any NPM package
can now ship guidelines at node_modules/{pkg}/resources/boost/guidelines
and skills at node_modules/{pkg}/resources/boost/skills.
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.
Problem
Third-party Composer packages can already ship Boost guidelines and skills (via
vendor/{pkg}/resources/boost/guidelines/andresources/boost/skills/), but third-party NPM packages cannot. The discovery methods (Npm::packagesDirectoriesWithBoostGuidelines()/Npm::packagesDirectoriesWithBoostSkills()) exist but are never called in the third-party resolution paths — only first-party NPM packages (@laravel/*,@inertiajs/*) are discovered, through the separate Roster-based code path.Solution
Wire NPM third-party discovery into the three places that currently only use
Composer:::GuidelineComposer::getThirdPartyGuidelines()— mergeNpm::packagesDirectoriesWithBoostGuidelines()(rejecting first-party NPM packages) alongside the existing Composer discovery.SkillComposer::getThirdPartySkills()— mergeNpm::packagesDirectoriesWithBoostSkills()into the collection beforeflatMap.ThirdPartyPackage::discover()— merge both Composer and NPM directories, rejecting first-party packages from both systems.How it works
Any NPM package can now ship guidelines and skills at:
These are discovered automatically, the same way
vendor/{package}/resources/boost/already works for Composer packages.