@merceyz OK, forget about preinstall
and install
.
npm
postinstall
output
"^1.0.22"
1.0.23
pnpm
postinstall
output
"^1.0.22"
1.0.23
yarnBerry
postinstall
output
"1.0.23"
1.0.23
Both npm
and pnpm
update package.json
version after postinstall
.
But yarnBerry
update package.json
version before postinstall
,
which makes a update function useless.
function update(fromVer, toVer) {
// babel transform `fromVer` to `toVer`
}
[Bug?]: repo's package.json should be updated AFTER dependency postinstall script
Self-service
Describe the bug
Actually, yarn berry update repo's package.json BEFORE dependency preinstall script.
Causing different behavior compared to both
npm
andpnpm
when running scriptTo reproduce
Reproduce
Given
repo
hasfoo
has scriptpreinstall
,install
,postinstall
, to detect update from which versionfoo
from1.0.22
to1.0.23
Actual
yarn berry output
Expected
npm output
pnpm output
Environment
Additional context
No response