Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run devPreinstall even shared-workspace-lockfile=false #8030

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alvis
Copy link
Contributor

@alvis alvis commented Apr 29, 2024

When shared-workspace-lockfile is false, opts.ignoreScripts is set to true since packages are rebuild after recursive install.
However, it will cause pnpm:devPreinstall to be skipped as well since it's not part of the rebuild process.

This fix fixes the issue by checking whether the --ignore-scripts flag is set from the source instead

fix #4503

For the context, it's this line that causes the issue:

When `shared-workspace-lockfile` is false,
opts.ignoreScripts is set to true since packages
are rebuild after recursive install.
However, it will cause `pnpm:devPreinstall` to be
skipped as well since it's not part of the rebuild
process.

This fix fixes the issue by checking whether the
--ignore-scripts flag is set from the source
instead

fix pnpm#4503
@alvis alvis requested a review from zkochan as a code owner April 29, 2024 07:46
@alvis alvis changed the title fix: run devPreinstall fix: run devPreinstall even shared-workspace-lockfile=false Apr 29, 2024
@zkochan
Copy link
Member

zkochan commented Apr 30, 2024

What if instead of ignoreScripts: true, ignoreDepScripts: true will be used?

@alvis
Copy link
Contributor Author

alvis commented Apr 30, 2024

What if instead of ignoreScripts: true, ignoreDepScripts: true will be used?

I'd prefer so. ignoreScripts is confusing in the context of shared-workspace-lockfile=false since it doesn't necessarily identical to the --ignore-scripts passed from the CLI. Probably it will solve lots of issues down the line as well, such as #6976 #7811 which I'm battling with. Somehow in some situation the lifecycle scripts are not executed as intended under shared-workspace-lockfile=false and I suspect ignoreScripts: true is part of the reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pnpm:devPreinstall is not run when shared-workspace-lockfile is false
2 participants