Skip to content

Commit 7467fa5

Browse files
iclantonCopilot
andcommitted
Address PR feedback: rename isPluginOnly to providedByPlugin
Rename isPluginOnly → providedByPlugin for clarity per review feedback. Also update the first changefile comment to reflect the globalPlugin design. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a6e3a36 commit 7467fa5

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

common/changes/@microsoft/rush/rush-published-versions-plugin_2026-03-15-04-22.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"changes": [
33
{
44
"packageName": "@microsoft/rush",
5-
"comment": "Add `customParametersByLongName` and `setHandled()` to `IGlobalCommand`, enabling Rush plugins to implement native global commands. Plugins can now define global commands with an empty `shellCommand`, handle execution via the `runGlobalCustomCommand` hook, and access parsed command-line parameters.",
5+
"comment": "Add `getCustomParametersByLongName()` and `setHandled()` to `IGlobalCommand`, enabling Rush plugins to implement native global commands. Add a new `\"globalPlugin\"` command kind for plugin-provided command-line.json files that requires no `shellCommand`.",
66
"type": "none"
77
}
88
],

libraries/rush-lib/src/api/CommandLineConfiguration.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ export interface IPhasedCommandConfig extends IPhasedCommandWithoutPhasesJson, I
129129

130130
export interface IGlobalCommandConfig extends IGlobalCommandJson, ICommandWithParameters {
131131
/**
132-
* If true, this command was declared with commandKind "globalPlugin" and must be handled
133-
* entirely by a Rush plugin. There is no shell command to execute.
132+
* If true, this command was declared with commandKind "globalPlugin" and its implementation
133+
* is provided by a Rush plugin via the `runGlobalCustomCommand` hook. There is no shell
134+
* command to execute.
134135
*/
135-
isPluginOnly: boolean;
136+
providedByPlugin: boolean;
136137
}
137138

138139
export type Command = IGlobalCommandConfig | IPhasedCommandConfig;
@@ -414,7 +415,7 @@ export class CommandLineConfiguration {
414415
case RushConstants.globalCommandKind: {
415416
normalizedCommand = {
416417
...command,
417-
isPluginOnly: false,
418+
providedByPlugin: false,
418419
associatedParameters: new Set<IParameterJson>()
419420
};
420421
break;
@@ -427,7 +428,7 @@ export class CommandLineConfiguration {
427428
...command,
428429
commandKind: RushConstants.globalCommandKind,
429430
shellCommand: '',
430-
isPluginOnly: true,
431+
providedByPlugin: true,
431432
associatedParameters: new Set<IParameterJson>()
432433
};
433434
break;

libraries/rush-lib/src/cli/RushCommandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export class RushCommandLineParser extends CommandLineParser {
435435
commandLineConfiguration: CommandLineConfiguration,
436436
command: IGlobalCommandConfig
437437
): void {
438-
const { name, shellCommand, autoinstallerName, isPluginOnly } = command;
438+
const { name, shellCommand, autoinstallerName, providedByPlugin } = command;
439439

440440
if (name === RushConstants.buildCommandName || name === RushConstants.rebuildCommandName) {
441441
throw new Error(
@@ -454,7 +454,7 @@ export class RushCommandLineParser extends CommandLineParser {
454454

455455
shellCommand,
456456
autoinstallerName,
457-
isPluginOnly
457+
providedByPlugin
458458
})
459459
);
460460
}

libraries/rush-lib/src/cli/scriptActions/GlobalScriptAction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { measureAsyncFn } from '../../utilities/performance';
3030
export interface IGlobalScriptActionOptions extends IBaseScriptActionOptions<IGlobalCommandConfig> {
3131
shellCommand: string;
3232
autoinstallerName: string | undefined;
33-
isPluginOnly: boolean;
33+
providedByPlugin: boolean;
3434
}
3535

3636
/**
@@ -47,16 +47,16 @@ export class GlobalScriptAction extends BaseScriptAction<IGlobalCommandConfig> {
4747
private readonly _shellCommand: string;
4848
private readonly _autoinstallerName: string;
4949
private readonly _autoinstallerFullPath: string;
50-
private readonly _isPluginOnly: boolean;
50+
private readonly _providedByPlugin: boolean;
5151

5252
private _customParametersByLongName: ReadonlyMap<string, CommandLineParameter> | undefined;
5353
private _isHandled: boolean = false;
5454

5555
public constructor(options: IGlobalScriptActionOptions) {
5656
super(options);
57-
const { shellCommand, isPluginOnly, autoinstallerName = '' } = options;
57+
const { shellCommand, providedByPlugin, autoinstallerName = '' } = options;
5858
this._shellCommand = shellCommand;
59-
this._isPluginOnly = isPluginOnly;
59+
this._providedByPlugin = providedByPlugin;
6060
this._autoinstallerName = autoinstallerName;
6161

6262
if (this._autoinstallerName) {
@@ -163,7 +163,7 @@ export class GlobalScriptAction extends BaseScriptAction<IGlobalCommandConfig> {
163163
return;
164164
}
165165

166-
if (this._isPluginOnly) {
166+
if (this._providedByPlugin) {
167167
throw new Error(
168168
`The custom command "${this.actionName}" is a "${RushConstants.globalPluginCommandKind}" command, ` +
169169
'meaning its implementation must be provided entirely by a Rush plugin. However, no plugin ' +

0 commit comments

Comments
 (0)