From a4095197c742ecc229eef996385553ba1dcc5ebd Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Fri, 19 Dec 2025 06:41:00 +0000 Subject: [PATCH 1/2] fix(ng-dev): add CLI version output The version previously was not set correctly. --- ng-dev/cli.ts | 3 ++- ng-dev/utils/version-check.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ng-dev/cli.ts b/ng-dev/cli.ts index 66a68e20e..83fa293e4 100644 --- a/ng-dev/cli.ts +++ b/ng-dev/cli.ts @@ -19,7 +19,7 @@ import {buildPullapproveParser} from './pullapprove/cli.js'; import {buildReleaseParser} from './release/cli.js'; import {tsCircularDependenciesBuilder} from './ts-circular-dependencies/index.js'; import {captureLogOutputForCommand} from './utils/logging.js'; -import {ngDevVersionMiddleware} from './utils/version-check.js'; +import {localVersion, ngDevVersionMiddleware} from './utils/version-check.js'; import {buildAuthParser} from './auth/cli.js'; import {buildPerfParser} from './perf/cli.js'; import {buildConfigParser} from './config/cli.js'; @@ -46,6 +46,7 @@ runParserWithCompletedFunctions((yargs: Argv) => { .command('perf ', '', buildPerfParser) .command('ai ', '', buildAiParser) .command('config ', false, buildConfigParser) + .version(localVersion) .wrap(120) .strict(); }); diff --git a/ng-dev/utils/version-check.ts b/ng-dev/utils/version-check.ts index 17b048ad9..664fd7f4a 100644 --- a/ng-dev/utils/version-check.ts +++ b/ng-dev/utils/version-check.ts @@ -19,7 +19,7 @@ import {GitClient} from './git/git-client.js'; * The currently executing version of ng-dev * Note: The placeholder will be replaced by the `pkg_npm` substitutions. */ -const localVersion = `0.0.0-{SCM_HEAD_SHA}`; +export const localVersion = `0.0.0-{SCM_HEAD_SHA}`; /** Whether ngDevVersionMiddleware verification has already occured. */ let verified = false; From f28b4243e293b5b141d9a52b2bfd47d03bda6929 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Fri, 19 Dec 2025 06:43:05 +0000 Subject: [PATCH 2/2] fix(ng-dev): remove redundant `run` from `pnpm` commands Simplifies commands by using `pnpm` directly. Unlike `pnpm run`, the shorthand can execute both scripts and binaries not explicitly listed in `package.json` --- ng-dev/release/publish/external-commands.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ng-dev/release/publish/external-commands.ts b/ng-dev/release/publish/external-commands.ts index 580093a14..8bfe2ae4b 100644 --- a/ng-dev/release/publish/external-commands.ts +++ b/ng-dev/release/publish/external-commands.ts @@ -256,20 +256,20 @@ export abstract class ExternalCommands { spawnOptions: SpawnOptions = {}, ): Promise { if (PnpmVersioning.isUsingPnpm(projectDir)) { - return ChildProcess.spawn('npx', ['--yes', 'pnpm', '-s', 'run', ...args], { - ...spawnOptions, - cwd: projectDir, - }); - } else { - // Note: We cannot use `yarn` directly as command because we might operate in - // a different publish branch and the current `PATH` will point to the Yarn version - // that invoked the release tool. More details in the function description. - const yarnCommand = await resolveYarnScriptForProject(projectDir); - return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], { + return ChildProcess.spawn('npx', ['--yes', 'pnpm', '-s', ...args], { ...spawnOptions, cwd: projectDir, }); } + + // Note: We cannot use `yarn` directly as command because we might operate in + // a different publish branch and the current `PATH` will point to the Yarn version + // that invoked the release tool. More details in the function description. + const yarnCommand = await resolveYarnScriptForProject(projectDir); + return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], { + ...spawnOptions, + cwd: projectDir, + }); } /**