@@ -2,7 +2,9 @@ import { getNewVersion } from "./get-new-version";
22import { getOldVersion } from "./get-old-version" ;
33import { gitCommit , gitPush , gitTag } from "./git" ;
44import { Operation } from "./operation" ;
5+ import { runNpmScript } from "./run-npm-script" ;
56import { VersionBumpOptions } from "./types/version-bump-options" ;
7+ import { NpmScript } from "./types/version-bump-progress" ;
68import { VersionBumpResults } from "./types/version-bump-results" ;
79import { updateFiles } from "./update-files" ;
810
@@ -46,12 +48,23 @@ export async function versionBump(arg: VersionBumpOptions | string = {}): Promis
4648 await getOldVersion ( operation ) ;
4749 await getNewVersion ( operation ) ;
4850
51+ // Run npm preversion script, if any
52+ await runNpmScript ( NpmScript . PreVersion , operation ) ;
53+
4954 // Update the version number in all files
5055 await updateFiles ( operation ) ;
5156
52- // Git commit, tag, push (if enabled)
57+ // Run npm version script, if any
58+ await runNpmScript ( NpmScript . Version , operation ) ;
59+
60+ // Git commit and tag, if enabled
5361 await gitCommit ( operation ) ;
5462 await gitTag ( operation ) ;
63+
64+ // Run npm postversion script, if any
65+ await runNpmScript ( NpmScript . PostVersion , operation ) ;
66+
67+ // Push the git commit and tag, if enabled
5568 await gitPush ( operation ) ;
5669
5770 return operation . results ;
0 commit comments