Browse Source

ci: add replace with preview script for @abp/utils package version replacement

pull/4746/head
mehmet-erim 6 years ago
parent
commit
4cafcfefc2
  1. 3
      npm/ng-packs/scripts/publish.ts
  2. 19
      npm/ng-packs/scripts/replace-with-preview.ts

3
npm/ng-packs/scripts/publish.ts

@ -1,6 +1,7 @@
import execa from 'execa';
import fse from 'fs-extra';
import program from 'commander';
import replaceWithPreview from './replace-with-preview';
program
.option(
@ -48,6 +49,8 @@ const publish = async () => {
await execa('yarn', ['replace-with-tilde']);
if (program.preview) await replaceWithPreview(program.nextVersion);
await execa('yarn', ['build', '--noInstall'], { stdout: 'inherit' });
await fse.rename('../lerna.publish.json', '../lerna.json');

19
npm/ng-packs/scripts/replace-with-preview.ts

@ -0,0 +1,19 @@
import fse from 'fs-extra';
export default async function(version: string) {
const corePkgPath = '../packages/core/package.json';
try {
const corePkg = await fse.readJSON(corePkgPath);
await fse.writeJSON(
corePkgPath,
{
...corePkg,
dependencies: { ...corePkg.dependencies, '@abp/utils': version },
},
{ spaces: 2 },
);
} catch (error) {
console.error(error);
}
}
Loading…
Cancel
Save