我在lerna和演示网站上拥有monorepo。
我想发布更改的软件包,并通过npm run release
之类的1条命令在演示中自动对其进行更新。
package.json:
...
"scripts": {
"release": "node ./release.js",
...
}
release.js
const { spawnSync } = require('child_process');
const cmd = `npx lerna publish`;
const updatedPackages = spawnSync(cmd, { stdio: 'inherit', shell: true }); // there i want get list of successfully published packages.
udpdateDemo(updatedPackages); // custom function, which get list of packages and update it for demo