update build scripts for new generator code

pull/16725/head
Mahmut Gundogdu 2 years ago
parent 7b2d7a57cf
commit c564e54918

@ -39,7 +39,9 @@
"ci": "yarn affected:lint && yarn affected:build && yarn affected:test",
"lerna": "lerna",
"migrate-nx": "yarn nx migrate --run-migrations",
"copy-to:app": "cd scripts && yarn && yarn copy-to-templates -t app"
"copy-to:app": "cd scripts && yarn && yarn copy-to-templates -t app",
"update-version": "nx generate @abp/nx.generators:update-version"
},
"private": true,
"devDependencies": {

@ -15,13 +15,8 @@
},
"leptonXVersion": {
"type": "string",
"description": "",
"$default": {
"$source": "argv",
"index": 1
},
"x-prompt": "What Lepton X version would you like to use?"
}
"description": ""
}
},
"required": ["abpVersion"]
}

@ -25,6 +25,7 @@ export function applyWithOverwrite(source: Source, rules: Rule[]): Rule {
export function mergeAndAllowDelete(host: Tree, rule: Rule) {
return async (tree: Tree, context: SchematicContext) => {
const nextTree = await callRule(rule, tree, context).toPromise();
if(!nextTree) return;
host.merge(nextTree, MergeStrategy.AllowDeleteConflict);
};
}

@ -7,7 +7,6 @@
"build": "ts-node -r tsconfig-paths/register build.ts",
"build:prod": "ts-node -r tsconfig-paths/register prod-build.ts",
"build:schematics": "ts-node -r tsconfig-paths/register build-schematics.ts",
"update-version": "ts-node -r tsconfig-paths/register update-version.ts",
"publish-packages": "ts-node -r tsconfig-paths/register publish.ts",
"replace-with-tilde": "ts-node -r tsconfig-paths/register replace-with-tilde.ts",
"remove-tilde-or-caret": "ts-node -r tsconfig-paths/register remove-tilde-or-caret.ts",

@ -34,6 +34,7 @@ program.parse(process.argv);
await execa('yarn', ['install'], { stdout: 'inherit', cwd: '../' });
await updateVersion(program.nextVersion);
return;
if (!program.skipVersionValidation) {
await execa(
@ -102,15 +103,12 @@ program.parse(process.argv);
})();
async function updateVersion(version: string) {
await fse.rename('../lerna.version.json', '../lerna.json');
await execa(
'yarn',
['lerna', 'version', version, '--yes', '--no-commit-hooks', '--skip-git', '--force-publish'],
['update-version', 'abpVersion', version],
{ stdout: 'inherit', cwd: '../' },
);
await fse.rename('../lerna.json', '../lerna.version.json');
await execa('yarn', ['replace-with-tilde']);
}

@ -1,34 +0,0 @@
import fse from 'fs-extra';
import execa from 'execa';
import program from 'commander';
program
.option(
'-v, --nextVersion <version>',
'next semantic version. Available versions: ["major", "minor", "patch", "premajor", "preminor", "prepatch", "prerelease", "or type a custom version"]',
);
program.parse(process.argv);
(async () => {
await updateVersion(program.nextVersion);
})();
async function updateVersion(version: string) {
if(!version){
console.error('Please provide a version with --nextVersion attribute');
return;
}
await fse.rename('../lerna.version.json', '../lerna.json');
await execa(
'yarn',
['lerna', 'version', version, '--yes', '--no-commit-hooks', '--skip-git', '--force-publish'],
{ stdout: 'inherit', cwd: '../' },
);
await fse.rename('../lerna.json', '../lerna.version.json');
await execa('yarn', ['replace-with-tilde']);
}

@ -16,7 +16,6 @@ if (-Not $Registry) {
$Registry = "https://registry.npmjs.org";
}
$UpdateNgPacksCommand = "yarn update ./ng-packs abp --registry $Registry"
$UpdateNgPacksUpdateVersionCommand = "yarn update-version -v $Version"
$NgPacksPublishCommand = "npm run publish-packages -- --nextVersion $Version --skipGit --registry $Registry --skipVersionValidation"
$UpdateGulpCommand = "yarn update-gulp --registry $Registry"
@ -29,17 +28,16 @@ if ($IsPrerelease) {
}
$commands = (
$UpdateNgPacksCommand,
"cd ng-packs\scripts",
"yarn install",
# $UpdateNgPacksUpdateVersionCommand,
"yarn remove-tilde-or-caret",
#"yarn remove-tilde-or-caret",
$NgPacksPublishCommand,
"cd ../../",
"cd scripts",
"yarn remove-lock-files",
"cd ..",
$UpdateGulpCommand
"cd .."
#$UpdateGulpCommand
)
foreach ($command in $commands) {

Loading…
Cancel
Save