Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Description

This PR updates the scripts.md documentation to remove examples using deprecated and discouraged features.

Changes

  • Examples section: Replaced install/postinstall examples with prepare and est scripts
  • Examples section: Replaced discouraged make commands with modern build tools ( sc, jest)
  • Use Cases section: Changed recommendations from deprecated prepublish to prepare
  • Use Cases section: Updated CoffeeScript example to TypeScript (more current)

Fixes

Closes #3992

Context

The issue reported that the documentation was confusing because it:

  1. Deprecated prepublish but then recommended using it in the Use Cases section
  2. Showed examples using install scripts which are discouraged in the Best Practices section
  3. Used outdated examples (make, uninstall, CoffeeScript)

This update aligns the examples and recommendations with current best practices:

  • Use prepare instead of the deprecated prepublish
  • Avoid install scripts as recommended in Best Practices
  • Use modern tooling that reflects current JavaScript/TypeScript ecosystem

…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
@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner December 3, 2025 01:57
**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.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence is also very strangely composed. Give a go at rephrasing?

* 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you didn't add this, but doing these things feels very 3rd grade vague. Mind rewording it while you are here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] scripts.md promotes the use of deprecated and otherwise discouraged features

2 participants