mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-18 22:02:53 -04:00
feat: supporting prepare event
Print deprecation notice when `prepublish` is present. Run `prepublish` as well for now. Close #810
This commit is contained in:
@@ -114,6 +114,11 @@ export async function install (maybeOpts?: PnpmOptions) {
|
||||
|
||||
async function run () {
|
||||
const scripts = !opts.ignoreScripts && ctx.pkg && ctx.pkg.scripts || {}
|
||||
|
||||
if (scripts['prepublish']) {
|
||||
logger.warn('`prepublish` scripts are deprecated. Use `prepare` for build steps and `prepublishOnly` for upload-only.')
|
||||
}
|
||||
|
||||
if (scripts['preinstall']) {
|
||||
npmRun('preinstall', ctx.root, opts.userAgent)
|
||||
}
|
||||
@@ -126,6 +131,9 @@ export async function install (maybeOpts?: PnpmOptions) {
|
||||
if (scripts['prepublish']) {
|
||||
npmRun('prepublish', ctx.root, opts.userAgent)
|
||||
}
|
||||
if (scripts['prepare']) {
|
||||
npmRun('prepare', ctx.root, opts.userAgent)
|
||||
}
|
||||
}
|
||||
}, {stale: opts.lockStaleDuration})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user