fix: preinstall should run after dependencies are installed (#3395)
This commit is contained in:
1 parent
a0894631d0
commit
3e3c3ff714
3 files changed
+8
-19
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/headless": patch
|
||||
"supi": patch
|
||||
---
|
||||
|
||||
`preinstall` scripts should run after installing the dependencies (this is how it works with npm).
|
||||
@@ -164,15 +164,6 @@ export default async (opts: HeadlessOptions) => {
|
||||
unsafePerm: opts.unsafePerm || false,
|
||||
}
|
||||
|
||||
if (!opts.ignoreScripts && !opts.ignorePackageManifest) {
|
||||
await runLifecycleHooksConcurrently(
|
||||
['preinstall'],
|
||||
opts.projects,
|
||||
opts.childConcurrency ?? 5,
|
||||
scriptsOpts
|
||||
)
|
||||
}
|
||||
|
||||
const skipped = opts.skipped || new Set<string>()
|
||||
if (currentLockfile != null && !opts.ignorePackageManifest) {
|
||||
await prune(
|
||||
@@ -434,7 +425,7 @@ export default async (opts: HeadlessOptions) => {
|
||||
|
||||
if (!opts.ignoreScripts && !opts.ignorePackageManifest) {
|
||||
await runLifecycleHooksConcurrently(
|
||||
['install', 'postinstall', 'prepublish', 'prepare'],
|
||||
['preinstall', 'install', 'postinstall', 'prepublish', 'prepare'],
|
||||
opts.projects,
|
||||
opts.childConcurrency ?? 5,
|
||||
scriptsOpts
|
||||
|
||||
@@ -304,14 +304,6 @@ export async function mutateModules (
|
||||
stdio: opts.ownLifecycleHooksStdio,
|
||||
unsafePerm: opts.unsafePerm || false,
|
||||
}
|
||||
if (!opts.ignoreScripts) {
|
||||
await runLifecycleHooksConcurrently(
|
||||
['preinstall'],
|
||||
projectsToBeInstalled,
|
||||
opts.childConcurrency,
|
||||
scriptsOpts
|
||||
)
|
||||
}
|
||||
|
||||
// TODO: make it concurrent
|
||||
for (const project of ctx.projects) {
|
||||
@@ -467,7 +459,7 @@ export async function mutateModules (
|
||||
if (opts.enablePnp) {
|
||||
scriptsOpts.extraEnv = makeNodeRequireOption(path.join(opts.lockfileDir, '.pnp.cjs'))
|
||||
}
|
||||
await runLifecycleHooksConcurrently(['install', 'postinstall', 'prepare'],
|
||||
await runLifecycleHooksConcurrently(['preinstall', 'install', 'postinstall', 'prepare'],
|
||||
projectsToBeInstalled,
|
||||
opts.childConcurrency,
|
||||
scriptsOpts
|
||||
|
||||
Reference in new issue
Block a user