-
-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pnpm store usages <package>... #1529
Conversation
- Add documentation for `pnpm store usages` - Refactor docs for `pnpm store` to be more readable
Introduces functionality to search the package store for packages. Reports all matching packages and the node projects they are used in. Allows for searching a specific version, or all versions.
Exposes an API for finding package usages in the store.
…nality Publicly exposes the findPackageUsages function in the store-controller. Also exposes the expected response type, allowing clients to be type-safe.
Publicly exposes the findPackageUsages function SUPI.
Enabled CLI command to find usages of a package in the global store. Pretty-prints a tree with queries and results.
Removed semicolons to follow style guide.
…info # Conflicts: # packages/pnpm/package.json # packages/pnpm/src/cmd/store.ts # packages/server/src/createServer.ts
pnpm#1528 was merged, modified test to use new SUPI API.
Everything should be merged and all issues should be fixed. I can add some more tests if this code structure looks good to you. Could you take a look at the failing AppVeyor build? I'm not entirely sure what that error means, I don't think I touched that part of the project. |
AppVeyor was failing on master as well. I fixed it (For some reason tslint catches more issues on Windows. I don't know why) |
Better naming of the types returned in the pnpm store usages feature.
@etamponi is it OK for Glitch to have this new command or do you need a config to disable it? Like the |
If it is just informative, it's okay... I would still be happier with a config option to disable it but it's not super urgent :) thanks! |
Add tests to `supi` to ensure datamodel returned by `package-store` is correct. Fix test messages in `server`
@zkochan added tests, should be ready to merge if all checks pass |
* docs(pnpm): docs for the package usages feature - Add documentation for `pnpm store usages` - Refactor docs for `pnpm store` to be more readable * feat(package-store): implement findPackageUsages Introduces functionality to search the package store for packages. Reports all matching packages and the node projects they are used in. Allows for searching a specific version, or all versions. * feat(server): expose findPackageUsages API Exposes an API for finding package usages in the store. * feat(store-controller-types): Exposes findPackageUsages store functionality Publicly exposes the findPackageUsages function in the store-controller. Also exposes the expected response type, allowing clients to be type-safe. * feat(supi): implement findStoreUsages functionality, add API Publicly exposes the findPackageUsages function SUPI. * feat(pnpm): pnpm store usages Enabled CLI command to find usages of a package in the global store. Pretty-prints a tree with queries and results. * style: remove semicolons Removed semicolons to follow style guide. * refactor(supi): change test after merge of #1528 * refactor: rename findPackageUsages return type Better naming of the types returned in the pnpm store usages feature. * tests: add tests for `pnpm store usages` Add tests to `supi` to ensure datamodel returned by `package-store` is correct. Fix test messages in `server` PR #1529
I was too fast to merge it. I will fix some things myself because I don't want to revert now |
@zkochan do you have a list of things that were broken? Just curious so I can prevent making the same mistakes next time |
you can see in this PR the changes I've made. using And I somewhat simplified the search function in the store controller Anyway, next time I will spend more time on review Thanks for the contribution! |
Thanks, looked over them and that looks much cleaner. This is my first big project with js/ts, so glad to see those changes and I'm learning a lot from them! |
Closes #1527
Overview
Adds a new CLI command to find all pnpm projects that link to specific packages in the global store.
#1527 outlines the user experience, use case, and limitations. This PR implements the feature exactly as described.
Implementation Details
The commits below describe the changes made to each package to enable this feature.
When a user makes a query against
pnpm store usages <query>
, the query flows in the following format:pnpm
user query via the CLIsupi
programmatic query against the store API or the store serverpackage-store
internal traversal of store to fulfill queryTesting Done
Added minimal tests to a few of the submodules. Plan on adding more tests after the code in
src
is approved.Comments
I added a few comments to my PR about areas I'm unsure about.