mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1012 B
30 lines
1012 B
// ESM syntax is supported.
|
|
import fse from 'fs-extra';
|
|
import execa from 'execa';
|
|
|
|
(async () => {
|
|
const { projects } = await fse.readJSON('../angular.json');
|
|
const projectNames = Object.keys(projects);
|
|
|
|
projectNames.forEach(async project => {
|
|
const { dependencies: distDependencies, version } = await fse.readJSON(`../dist/${project}/package.json`);
|
|
const srcPackagePath = `../packages/${project}/package.json`;
|
|
const srcPackage = await fse.readJSON(srcPackagePath);
|
|
|
|
if (distDependencies) {
|
|
for (const key in srcPackage.dependencies) {
|
|
if (distDependencies.hasOwnProperty(key)) {
|
|
srcPackage.dependencies[key] = distDependencies[key];
|
|
}
|
|
}
|
|
}
|
|
|
|
await fse.writeJSON(srcPackagePath, { ...srcPackage, version }, { spaces: 2 });
|
|
});
|
|
|
|
await execa('git', ['add', '../packages/*', '../package.json'], { stdout: 'inherit' });
|
|
await execa('git', ['commit', '-m', 'Update source packages versions'], { stdout: 'inherit' });
|
|
|
|
process.exit(0);
|
|
})();
|