From a947f25bd4576f7ef70fe6b1226e72252fa7a571 Mon Sep 17 00:00:00 2001 From: Sonny <47546413+sonsurim@users.noreply.github.com> Date: Wed, 24 Jul 2024 23:47:02 +0900 Subject: [PATCH] fix: update lifecycle script list in run-script (#7679) 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 ## References The documents I referenced are as follows: - https://docs.npmjs.com/cli/v10/using-npm/scripts --- lib/commands/run-script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/commands/run-script.js b/lib/commands/run-script.js index 180dfa1cdeac5..0a139d08af745 100644 --- a/lib/commands/run-script.js +++ b/lib/commands/run-script.js @@ -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',