docs(scripts): replace deprecated prepublish and install examples with prepare#8810
Conversation
| **Use Cases** | ||
|
|
||
| If you need to perform operations on your package before it is used, in a way that is not dependent on the operating system or architecture of the target system, use a `prepublish` script. | ||
| If you need to perform operations on your package before it is used, in a way that is not dependent on the operating system or architecture of the target system, use a `prepare` script. |
There was a problem hiding this comment.
This sentence is also very strangely composed. Give a go at rephrasing?
There was a problem hiding this comment.
Thanks for the feedback! I've rephrased both sentences:
Line 85: Changed from "If you need to perform operations on your package before it is used, in a way that is not dependent on the operating system or architecture of the target system, use a prepare script" to "Use a prepare script to perform build tasks that are platform-independent and need to run before your package is used."
The new wording is more direct and specific.
| * Fetching remote resources that your package will use. | ||
|
|
||
| The advantage of doing these things at `prepublish` time is that they can be done once, in a single place, thus reducing complexity and variability. | ||
| The advantage of doing these things at `prepare` time is that they can be done once, in a single place, thus reducing complexity and variability. |
There was a problem hiding this comment.
I know you didn't add this, but doing these things feels very 3rd grade vague. Mind rewording it while you are here?
There was a problem hiding this comment.
Thanks for the feedback! I've rephrased both sentences:
Line 92: Changed from "The advantage of doing these things at prepare time is that they can be done once, in a single place, thus reducing complexity and variability" to "Running these build tasks in the prepare script ensures they happen once, in a single place, reducing complexity and variability."
The new wording is more direct and specific.
…h prepare - Updated examples section to use prepare and test scripts instead of discouraged install/postinstall - Changed use case recommendations from prepublish to prepare - Replaced CoffeeScript example with TypeScript (more current) - Replaced make commands with modern build tools (tsc, jest) - Fixes npm#3992
0ce48da to
5dcfdbe
Compare
|
Thanks for the feedback! I've rephrased both sentences:
The new wording is more direct and specific. |
Description
This PR updates the scripts.md documentation to remove examples using deprecated and discouraged features.
Changes
Fixes
Closes #3992
Context
The issue reported that the documentation was confusing because it:
This update aligns the examples and recommendations with current best practices: