-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: add npm set-script #2237
feat: add npm set-script #2237
Conversation
What happens if a package uses |
Any suggestions on how to detect or identify if it is being called from |
Right, I've read through the original RFC discussion to find that there was no definitive stance on it so it didn't make it to the RFC itself - I'm ok with that extra check being there since it's unlikely to be an issue to 99% of users.
You can check for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @Yash-Singh1 for picking this up from the RFCs and turning it into actual code 😄 This is looking very good, I think it just needs to adjust some details I left in the review + addressing lifecycle check from @ljharb 😊
For tests and docs you can refer to other commands for examples but definitively let us know if you need help/guidance. Thanks again! 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like it has actual tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good to me, but i don't see any unit tests.
@ljharb @ruyadorno I am ready to merge from my end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some very minor suggestions to polish things up even more but otherwise we're looking good to ship it!
Introduces the set-script command. It accepts two arguments, the script name and the command ref: https://github.com/npm/rfcs/blob/latest/accepted/0016-set-script-command.md PR-URL: #2237 Credit: @Yash-Singh1 Close: #2237 Reviewed-by: @ruyadorno
Summary
This PR introduces the
set-script
command. It accepts two arguments, the script name and the command as said in RFC 0016References
Adds in RFC 0016: https://github.com/npm/rfcs/blob/latest/accepted/0016-set-script-command.md