chore(repo): print version at the end of nx-release script (#21346)
This commit is contained in:
parent
2faaaf3a19
commit
fc8cca44c5
@ -7,6 +7,7 @@ import { URL } from 'node:url';
|
|||||||
import { isRelativeVersionKeyword } from 'nx/src/command-line/release/utils/semver';
|
import { isRelativeVersionKeyword } from 'nx/src/command-line/release/utils/semver';
|
||||||
import { ReleaseType, inc, major, parse } from 'semver';
|
import { ReleaseType, inc, major, parse } from 'semver';
|
||||||
import * as yargs from 'yargs';
|
import * as yargs from 'yargs';
|
||||||
|
import * as chalk from 'chalk';
|
||||||
|
|
||||||
const LARGE_BUFFER = 1024 * 1000000;
|
const LARGE_BUFFER = 1024 * 1000000;
|
||||||
|
|
||||||
@ -119,7 +120,7 @@ const LARGE_BUFFER = 1024 * 1000000;
|
|||||||
// If publishing locally, force all projects to not be private first
|
// If publishing locally, force all projects to not be private first
|
||||||
if (options.local) {
|
if (options.local) {
|
||||||
console.log(
|
console.log(
|
||||||
'\nPublishing locally, so setting all resolved packages to not be private'
|
chalk.dim`\n Publishing locally, so setting all resolved packages to not be private`
|
||||||
);
|
);
|
||||||
const projectGraph = await createProjectGraphAsync();
|
const projectGraph = await createProjectGraphAsync();
|
||||||
for (const proj of Object.values(projectGraph.nodes)) {
|
for (const proj of Object.values(projectGraph.nodes)) {
|
||||||
@ -160,6 +161,20 @@ const LARGE_BUFFER = 1024 * 1000000;
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let version;
|
||||||
|
if (['minor', 'major', 'patch'].includes(options.version)) {
|
||||||
|
const currentLatestVersion = execSync('npm view nx@latest version')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
version = inc(currentLatestVersion, options.version, undefined);
|
||||||
|
} else {
|
||||||
|
version = options.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(chalk.green` > Published version: ` + version);
|
||||||
|
console.log(chalk.dim` Use: npx create-nx-workspace@${version}\n`);
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user