@rushstack/rush-sdk
Advanced tools
@@ -96,2 +96,8 @@ import type { CommandLineParameter } from '@rushstack/ts-command-line'; | ||
| export interface IGlobalCommandConfig extends IGlobalCommandJson, ICommandWithParameters { | ||
| /** | ||
| * If true, this command was declared with commandKind "globalPlugin" and its implementation | ||
| * is provided by a Rush plugin via the `runGlobalCustomCommand` hook. There is no shell | ||
| * command to execute. | ||
| */ | ||
| providedByPlugin: boolean; | ||
| } | ||
@@ -98,0 +104,0 @@ export type Command = IGlobalCommandConfig | IPhasedCommandConfig; |
@@ -5,3 +5,3 @@ /** | ||
| export interface IBaseCommandJson { | ||
| commandKind: 'bulk' | 'global' | 'phased'; | ||
| commandKind: 'bulk' | 'global' | 'globalPlugin' | 'phased'; | ||
| name: string; | ||
@@ -62,4 +62,12 @@ summary: string; | ||
| } | ||
| export type CommandJson = IBulkCommandJson | IGlobalCommandJson | IPhasedCommandJson; | ||
| /** | ||
| * "globalPluginCommand" from command-line.schema.json. | ||
| * A global command whose implementation is provided entirely by a Rush plugin. | ||
| * This command kind can only be used in command-line.json files provided by Rush plugins. | ||
| */ | ||
| export interface IGlobalPluginCommandJson extends IBaseCommandJson { | ||
| commandKind: 'globalPlugin'; | ||
| } | ||
| export type CommandJson = IBulkCommandJson | IGlobalCommandJson | IGlobalPluginCommandJson | IPhasedCommandJson; | ||
| /** | ||
| * The dependencies of a phase. | ||
@@ -66,0 +74,0 @@ * @alpha |
@@ -0,1 +1,2 @@ | ||
| import type { CommandLineParameter } from '@rushstack/ts-command-line'; | ||
| import { BaseScriptAction, type IBaseScriptActionOptions } from './BaseScriptAction'; | ||
@@ -9,2 +10,3 @@ import type { IGlobalCommandConfig } from '../../api/CommandLineConfiguration'; | ||
| autoinstallerName: string | undefined; | ||
| providedByPlugin: boolean; | ||
| } | ||
@@ -25,3 +27,14 @@ /** | ||
| private readonly _autoinstallerFullPath; | ||
| private readonly _providedByPlugin; | ||
| private _customParametersByLongName; | ||
| private _isHandled; | ||
| constructor(options: IGlobalScriptActionOptions); | ||
| /** | ||
| * {@inheritDoc IGlobalCommand.setHandled} | ||
| */ | ||
| setHandled(): void; | ||
| /** | ||
| * {@inheritDoc IGlobalCommand.getCustomParametersByLongName} | ||
| */ | ||
| getCustomParametersByLongName<TParameter extends CommandLineParameter>(longName: string): TParameter; | ||
| private _prepareAutoinstallerNameAsync; | ||
@@ -28,0 +41,0 @@ runAsync(): Promise<void>; |
@@ -221,2 +221,7 @@ /** | ||
| /** | ||
| * The value of the "commandKind" property for a plugin-only global command in command-line.json. | ||
| * This command kind can only be used in command-line.json files provided by Rush plugins. | ||
| */ | ||
| static readonly globalPluginCommandKind: 'globalPlugin'; | ||
| /** | ||
| * The value of the "commandKind" property for a phased command in command-line.json | ||
@@ -223,0 +228,0 @@ */ |
| import { AsyncParallelHook, AsyncSeriesHook, HookMap } from 'tapable'; | ||
| import type { CommandLineParameter } from '@rushstack/ts-command-line'; | ||
| import type { ITelemetryData } from '../logic/Telemetry'; | ||
@@ -20,2 +21,12 @@ import type { PhasedCommandHooks } from './PhasedCommandHooks'; | ||
| export interface IGlobalCommand extends IRushCommand { | ||
| /** | ||
| * Get a parameter by its long name (e.g. "--output-path") that was defined in command-line.json for this command. | ||
| * If the parameter was not defined or not provided on the command line, this will throw. | ||
| */ | ||
| getCustomParametersByLongName<TParameter extends CommandLineParameter>(longName: string): TParameter; | ||
| /** | ||
| * Call this from a plugin hook to indicate that the command has been fully handled | ||
| * by the plugin. When set, the default shell command execution will be skipped. | ||
| */ | ||
| setHandled(): void; | ||
| } | ||
@@ -69,3 +80,3 @@ /** | ||
| readonly beforeInstall: AsyncSeriesHook<[ | ||
| command: IGlobalCommand, | ||
| command: IRushCommand, | ||
| subspace: Subspace, | ||
@@ -72,0 +83,0 @@ variant: string | undefined |
+8
-8
| { | ||
| "name": "@rushstack/rush-sdk", | ||
| "version": "5.171.0", | ||
| "version": "5.172.0", | ||
| "description": "An API for interacting with the Rush engine", | ||
@@ -42,7 +42,7 @@ "repository": { | ||
| "tapable": "2.2.1", | ||
| "@rushstack/node-core-library": "5.20.3", | ||
| "@rushstack/credential-cache": "0.2.7", | ||
| "@rushstack/terminal": "0.22.3", | ||
| "@rushstack/lookup-by-path": "0.9.7", | ||
| "@rushstack/terminal": "0.22.3", | ||
| "@rushstack/package-deps-hash": "4.7.7", | ||
| "@rushstack/node-core-library": "5.20.3" | ||
| "@rushstack/package-deps-hash": "4.7.7" | ||
| }, | ||
@@ -54,9 +54,9 @@ "devDependencies": { | ||
| "webpack": "~5.105.2", | ||
| "@microsoft/rush-lib": "5.171.0", | ||
| "@microsoft/rush-lib": "5.172.0", | ||
| "@rushstack/heft": "1.2.7", | ||
| "@rushstack/heft-webpack5-plugin": "1.3.7", | ||
| "@rushstack/stream-collator": "4.2.7", | ||
| "@rushstack/ts-command-line": "5.3.3", | ||
| "@rushstack/stream-collator": "4.2.7", | ||
| "@rushstack/webpack-preserve-dynamic-require-plugin": "0.12.8", | ||
| "local-node-rig": "1.0.0" | ||
| "local-node-rig": "1.0.0", | ||
| "@rushstack/webpack-preserve-dynamic-require-plugin": "0.12.8" | ||
| }, | ||
@@ -63,0 +63,0 @@ "sideEffects": false, |
Sorry, the diff of this file is too big to display
946959
0.3%19777
0.29%