yalc push
won't update host-yarn/yarn.lock or host-npm/package-lock.json.
yarn
/npm i
won't do that either.
# bootstrap
cd lib
yarn
npx yalc push
cd ..
cd host-npm
npm i
npx yalc add lib
cd ..
cd host-yarn
yarn
npx yalc add lib
cd ..
# modify lib's dependencies
cd lib
yarn add react@^17 # could be any package
npx yalc push
host-yarn/yarn.lock and host-npm/package-lock.json show react@17
has been installed in the hosts.
No changes to host-yarn/yarn.lock and host-npm/package-lock.json.
cd host-yarn
yarn
host-yarn/yarn.lock doesn't change.
cd host-npm
npm i
host-npm/package-lock.json does say lib
now depends on react@^17
but it says it installed react@15
anyway.
# in lib
yarn add yalc@1.0.0-pre.35
npx yalc push
This runs scripts.postupdate
from lib/package.json, which upgrades lib
in the hosts.