add a new option to validate-versions script

pull/10488/head
mehmet-erim 4 years ago
parent 7c97b12515
commit 38e9b90910

@ -41,14 +41,14 @@ program.parse(process.argv);
program.nextVersion,
'--path',
'../ng-packs/packages',
'--excludedPackages',
'@abp/utils',
],
{ stdout: 'inherit', cwd: '../../scripts' },
);
if (program.preview) await replaceWithPreview(program.nextVersion);
return;
await execa('yarn', ['build', '--noInstall', '--skipNgcc'], { stdout: 'inherit' });
await execa('yarn', ['build:schematics'], { stdout: 'inherit' });
} catch (error) {

@ -29,7 +29,7 @@ $commands = (
"yarn replace-with-tilde",
"cd scripts",
"yarn install",
"yarn validate-versions --compareVersion $Version --path ../packs",
"yarn validate-versions --compareVersion $Version --path ../packs --excludedPackages @abp/utils",
"cd ..",
$PacksPublishCommand
)

@ -3,6 +3,8 @@ import fse from 'fs-extra';
import * as path from 'path';
import { log } from './utils/log';
let excludedPackages = [];
(async () => {
initCommander();
await compare();
@ -14,7 +16,14 @@ function initCommander() {
'version to compare'
);
program.requiredOption('-p, --path <path>', 'NPM packages folder path');
program.option(
'-ep, --excludedPackages <excludedpackages>',
'Packages that will not be checked. Can be passed with separeted comma (like @abp/utils,@abp/core)',
''
);
program.parse(process.argv);
excludedPackages = program.opts().excludedPackages.split(',');
}
async function compare() {
@ -30,7 +39,10 @@ async function compare() {
pkgJson = await fse.readJSON(pkgJsonPath);
} catch (error) {}
if (pkgJson.version !== compareVersion) {
if (
!excludedPackages.includes(pkgJson.name) &&
pkgJson.version !== compareVersion
) {
throwError(pkgJsonPath, pkgJson.name);
}
@ -53,6 +65,7 @@ async function compareDependencies(
const entry = entries[i];
if (
!excludedPackages.includes(entry[0]) &&
entry[0].match(/@(abp|volo)/)?.length &&
entry[1] !== `~${compareVersion}`
) {

Loading…
Cancel
Save