Repository navigation
feat: add --npm-workspaces option - #550
Open
christoph-sg wants to merge 1 commit into
Open
christoph-sg wants to merge 1 commit into
christoph-sg wants to merge 1 commit into
Conversation
Index every package listed in the root package.json `workspaces` field, expanded with Node's built-in fs.globSync the same way npm does. Fixes #394 Co-authored-by: jojosenthusiast <179510577+jojosenthusiast@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-b98ba159-b3e7-454b-ba90-7d8ef49d71b3
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.
scip-typescript had
--yarn-workspacesand--pnpm-workspacesbut nothing for npm, so npm monorepos indexed nothing unless every package was listed by hand. This adds--npm-workspaces, which reads theworkspacesfield from the rootpackage.json(either the array or the{ packages: [...] }form) and indexes every directory that has apackage.jsonmatching one of those patterns. It expands the patterns with Node's built-infs.globSyncand skipsnode_modules, which is how npm itself resolves workspaces, so**and braces work and no install or extra dependency is needed.This is a smaller version of #459. The fixture and README section come from that PR, with credit to @jojosenthusiast.
Fixes #394