Skip to content

Conversation

ruyadorno
Copy link
Contributor

@ruyadorno ruyadorno commented Jun 30, 2021

feat: npm pkg

Implements npm pkg get|set|delete support. It enables retrieving and
modifying values in a package.json file of any given project.

Included are the implementation based on npm/rfcs#402
along with extensive tests and user documentation.

Relates to: npm/rfcs#402
Fixes: npm/statusboard#368

@ruyadorno
Copy link
Contributor Author

cc @ljharb

@ruyadorno ruyadorno force-pushed the ruyadorno/npm-pkg branch from abe65be to e4e480e Compare July 2, 2021 20:36
@ruyadorno
Copy link
Contributor Author

ruyadorno commented Jul 2, 2021

in this first pass I'm also making it so that we just JSON.parse values when using npm pkg set --json (as suggested by @ljharb), I know during discussions @isaacs mentioned it may be a source of user frustration since it's hard to handle json input across different cli/shell envs but after @wraithgar pointed out it would enable stuff like:

npm pkg set scripts="$(npm pkg get scripts --prefix=../some-other-project)" --json

I'm now sold on it and want it to happen 😍

Implements `npm pkg get|set|delete` support. It enables retrieving and
modifying values in a `package.json` file of any given project.

Included are the implementation based on npm/rfcs#402
along with extensive tests and user documentation.

Relates to: npm/rfcs#402
Fixes: npm/statusboard#368
@ruyadorno ruyadorno force-pushed the ruyadorno/npm-pkg branch from 04d466d to 674e3c5 Compare July 2, 2021 21:33
@ruyadorno ruyadorno marked this pull request as ready for review July 2, 2021 21:33
@ruyadorno ruyadorno requested a review from a team as a code owner July 2, 2021 21:33
Copy link
Member

@wraithgar wraithgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big thanks to @ljharb for helping review this. Gave it another look and the code itself looks well laid out and maintainable, docs are all good. Functionality is as planned.

@darcyclarke darcyclarke added Release 7.x work is associated with a specific npm 7 release semver:minor new backwards-compatible feature release: next These items should be addressed in the next release labels Jul 12, 2021
ruyadorno added a commit that referenced this pull request Jul 12, 2021
Implements `npm pkg get|set|delete` support. It enables retrieving and
modifying values in a `package.json` file of any given project.

Included are the implementation based on npm/rfcs#402
along with extensive tests and user documentation.

Relates to: npm/rfcs#402
Fixes: npm/statusboard#368

PR-URL: #3487
Credit: @ruyadorno
Close: #3487
Reviewed-by: @wraithgar
@ruyadorno
Copy link
Contributor Author

Landed in f17aca5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: next These items should be addressed in the next release Release 7.x work is associated with a specific npm 7 release semver:minor new backwards-compatible feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants