fix: NPM packages dump for scoped packages#275
Open
corderop wants to merge 1 commit intoCodelyTV:mainfrom
Open
fix: NPM packages dump for scoped packages#275corderop wants to merge 1 commit intoCodelyTV:mainfrom
corderop wants to merge 1 commit intoCodelyTV:mainfrom
Conversation
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.
As described in the issue, for scoped packages (like
@google/gemini-cli), the package path innode_modulesfollows the following structure:What with the current version, generates the following package dump
This doesn't contain the whole package name and the import will fail later. With the proposed solution, we will save the whole package name:
Solution explained
In the original ls command, I have excluded any package/folder that start with
@:ls -1 "$HOMEBREW_PREFIX/lib/node_modules" | grep -v npm | grep -v '^@'Then we iterate through the folders that start by
@:for scope in "$HOMEBREW_PREFIX/lib/node_modules/@"*/; doFor every folder, we dump every single directory (actual packages) there with
ls -1, adding the scope (@...(e.g.@google)) at the start of every package.[ -d "$scope" ] && ls -1 "$scope" | sed "s|^|$(basename "$scope")/|"
AI disclaimer
Solution assisted by Claude Code
Closes: #274