make some enchancements for publishing scripts

pull/8345/head
mehmet-erim 5 years ago
parent af1d96ce56
commit fc6cbe7068

2464
npm/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -5,6 +5,7 @@ const { program } = require('commander');
program.version('0.0.1'); program.version('0.0.1');
program.option('-r, --rc', 'whether version is rc'); program.option('-r, --rc', 'whether version is rc');
program.option('-rg, --registry <registry>', 'target npm server registry')
program.parse(process.argv); program.parse(process.argv);
const packages = (process.argv[3] || 'abp').split(',').join('|'); const packages = (process.argv[3] || 'abp').split(',').join('|');
@ -14,8 +15,8 @@ const check = (pkgJsonPath) => {
return childProcess return childProcess
.execSync( .execSync(
`ncu "/^@(${packages}).*$/" --packageFile ${pkgJsonPath} -u${ `ncu "/^@(${packages}).*$/" --packageFile ${pkgJsonPath} -u${
program.rc ? ' --greatest' : '' program.rc ? ' --target greatest' : ''
}` }${program.registry ? ` --registry ${program.registry}` : ''}`
) )
.toString(); .toString();
} catch (error) { } catch (error) {

@ -11,7 +11,7 @@
"@types/fs-extra": "^8.0.1", "@types/fs-extra": "^8.0.1",
"glob": "^7.1.5", "glob": "^7.1.5",
"lerna": "^3.18.4", "lerna": "^3.18.4",
"npm-check-updates": "^3.1.25" "npm-check-updates": "^11.3.0"
}, },
"dependencies": { "dependencies": {
"commander": "^6.0.0", "commander": "^6.0.0",

@ -4,6 +4,7 @@ const fse = require('fs-extra');
program.version('0.0.1'); program.version('0.0.1');
program.option('-n, --nextVersion', 'version in common.props'); program.option('-n, --nextVersion', 'version in common.props');
program.option('-r, --rc', 'whether version is rc'); program.option('-r, --rc', 'whether version is rc');
program.option('-cv, --customVersion <customVersion>', 'set exact version');
program.parse(process.argv); program.parse(process.argv);
@ -12,6 +13,7 @@ if (program.nextVersion) console.log(getVersion());
if (program.rc) console.log(getVersion().includes('rc')); if (program.rc) console.log(getVersion().includes('rc'));
function getVersion() { function getVersion() {
if (program.customVersion) return program.customVersion;
const commonProps = fse.readFileSync('../common.props').toString(); const commonProps = fse.readFileSync('../common.props').toString();
const versionTag = '<Version>'; const versionTag = '<Version>';
const versionEndTag = '</Version>'; const versionEndTag = '</Version>';

@ -19,9 +19,11 @@ if (-Not $Registry) {
$NgPacksPublishCommand = "npm run publish-packages -- --nextVersion $Version --skipGit --registry $Registry" $NgPacksPublishCommand = "npm run publish-packages -- --nextVersion $Version --skipGit --registry $Registry"
$PacksPublishCommand = "npm run lerna -- exec 'npm publish --registry $Registry'" $PacksPublishCommand = "npm run lerna -- exec 'npm publish --registry $Registry'"
$UpdateGulpCommand = "npm run update-gulp" $UpdateGulpCommand = "npm run update-gulp"
$UpdateNgPacksCommand = "yarn update" $UpdateNgPacksCommand = "yarn update --registry $Registry"
$IsRc = $(node publish-utils.js --rc --customVersion $Version) -eq "true";
$IsRc = $(node publish-utils.js --rc) -eq "true";
if ($IsRc) { if ($IsRc) {
$NgPacksPublishCommand += " --rc" $NgPacksPublishCommand += " --rc"

Loading…
Cancel
Save