fix: don't run prepublishOnly of git-hosted dependencies (#7096)

close #7026
This commit is contained in:
Zoltan Kochan
2023-09-15 17:04:28 +03:00
committed by GitHub
parent a6f5e5c9c0
commit 17d2ddb056
3 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/prepare-package": patch
"pnpm": patch
---
Don't run the `prepublishOnly` scripts of git-hosted dependencies [#7026](https://github.com/pnpm/pnpm/issues/7026).

View File

@@ -7,9 +7,11 @@ import rimraf from '@zkochan/rimraf'
import preferredPM from 'preferred-pm'
import omit from 'ramda/src/omit'
// We don't run prepublishOnly to prepare the dependency.
// This might be counterintuitive as prepublishOnly is where a lot of packages put their build scripts.
// However, neither npm nor Yarn run prepublishOnly of git-hosted dependencies (checked on npm v10 and Yarn v3).
const PREPUBLISH_SCRIPTS = [
'prepublish',
'prepublishOnly',
'prepack',
'publish',
]

View File

@@ -278,7 +278,6 @@ test('run prepare script for git-hosted dependencies', async () => {
'install',
'postinstall',
'prepare',
'prepublishOnly',
'preinstall',
'install',
'postinstall',