Skip to content

Commit

Permalink
fix: update lifecycle script list in run-script (#7679)
Browse files Browse the repository at this point in the history
This change updates the list of lifecycle scripts in the RunScript class
to include important npm scripts that were previously missing.

- add `prepare`, `prepublishOnly` scripts
- add `dependencies` scripts
- add `prepack` and `postpack` scripts
- todo comments removed due to changes reflected

<!-- What / Why -->
<!-- Describe the request in detail. What it does and why it's being
changed. -->


## References
The documents I referenced are as follows:
- https://docs.npmjs.com/cli/v10/using-npm/scripts

<!-- Examples:
  Related to #0
  Depends on #0
  Blocked by #0
  Fixes #0
  Closes #0
-->
  • Loading branch information
sonsurim authored Jul 24, 2024
1 parent 9214be9 commit a947f25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/commands/run-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ class RunScript extends BaseCommand {
return
}

// TODO this is missing things like prepare, prepublishOnly, and dependencies
const cmdList = [
'prepare', 'prepublishOnly',
'prepack', 'postpack',
'dependencies',
'preinstall', 'install', 'postinstall',
'prepublish', 'publish', 'postpublish',
'prerestart', 'restart', 'postrestart',
Expand Down

0 comments on commit a947f25

Please sign in to comment.