Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rushstack/heft

Package Overview
Dependencies
Maintainers
2
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/heft - npm Package Compare versions

Comparing version 0.41.1 to 0.41.2

lib/cli/HeftCommandLine.d.ts

9

CHANGELOG.md
# Change Log - @rushstack/heft
This log was last generated on Wed, 06 Oct 2021 02:41:48 GMT and should not be manually modified.
This log was last generated on Wed, 06 Oct 2021 15:08:25 GMT and should not be manually modified.
## 0.41.2
Wed, 06 Oct 2021 15:08:25 GMT
### Patches
- Improve the HeftSession.commandLine.register<Type>Parameter interface and add support for choice and choice list parameters.
## 0.41.1

@@ -6,0 +13,0 @@ Wed, 06 Oct 2021 02:41:48 GMT

143

dist/heft.d.ts

@@ -11,3 +11,8 @@ import { AsyncParallelHook } from 'tapable';

import { IBaseCommandLineDefinition } from '@rushstack/ts-command-line';
import { IBaseCommandLineDefinitionWithArgument } from '@rushstack/ts-command-line';
import { ICommandLineChoiceDefinition } from '@rushstack/ts-command-line';
import { ICommandLineChoiceListDefinition } from '@rushstack/ts-command-line';
import { ICommandLineFlagDefinition } from '@rushstack/ts-command-line';
import { ICommandLineIntegerDefinition } from '@rushstack/ts-command-line';
import { ICommandLineStringDefinition } from '@rushstack/ts-command-line';
import { ICommandLineStringListDefinition } from '@rushstack/ts-command-line';
import { IPackageJson } from '@rushstack/node-core-library';

@@ -98,22 +103,34 @@ import { ITerminal } from '@rushstack/node-core-library';

*/
export declare class HeftCommandLineUtilities {
export declare class HeftCommandLine {
private readonly _commandLineParser;
private readonly _terminal;
/**
* @internal
*/
constructor(commandLineParser: CommandLineParser, terminal: ITerminal);
/**
* Utility method used by Heft plugins to register a flag type parameter.
* Utility method used by Heft plugins to register a choice type parameter.
*/
registerFlagParameter(options: IRegisterParameterOptions): IHeftFlagParameter;
registerChoiceParameter(options: IHeftRegisterParameterOptions<ICommandLineChoiceDefinition>): IHeftChoiceParameter;
/**
* Utility method used by Heft plugins to register a string type parameter.
* Utility method used by Heft plugins to register a choiceList type parameter.
*/
registerStringParameter(options: IRegisterParameterWithArgumentOptions): IHeftStringParameter;
registerChoiceListParameter(options: IHeftRegisterParameterOptions<ICommandLineChoiceListDefinition>): IHeftChoiceListParameter;
/**
* Utility method used by Heft plugins to register a flag type parameter.
*/
registerFlagParameter(options: IHeftRegisterParameterOptions<ICommandLineFlagDefinition>): IHeftFlagParameter;
/**
* Utility method used by Heft plugins to register an integer type parameter.
*/
registerIntegerParameter(options: IRegisterParameterWithArgumentOptions): IHeftIntegerParameter;
registerIntegerParameter(options: IHeftRegisterParameterOptions<ICommandLineIntegerDefinition>): IHeftIntegerParameter;
/**
* Utility method used by Heft plugins to register a string type parameter.
*/
registerStringParameter(options: IHeftRegisterParameterOptions<ICommandLineStringDefinition>): IHeftStringParameter;
/**
* Utility method used by Heft plugins to register a stringList type parameter.
*/
registerStringListParameter(options: IRegisterParameterWithArgumentOptions): IHeftStringListParameter;
registerStringListParameter(options: IHeftRegisterParameterOptions<ICommandLineStringListDefinition>): IHeftStringListParameter;
private _registerParameter;
private _getActions;

@@ -211,5 +228,5 @@ private _verifyUniqueParameterName;

* @beta
* {@inheritDoc HeftCommandLineUtilities}
* {@inheritDoc HeftCommandLine}
*/
readonly commandLine: HeftCommandLineUtilities;
readonly commandLine: HeftCommandLine;
/**

@@ -413,14 +430,39 @@ * Call this function to receive a callback with the plugin if and after the specified plugin

*/
export declare interface IHeftBaseParameter {
export declare interface IHeftBaseParameter<TValue, TCommandLineDefinition extends IBaseCommandLineDefinition> {
/**
* The currently selected action was associated with the parameter.
* The value specified on the command line for this parameter.
*/
readonly value?: TValue;
/**
* If true, then the user has invoked Heft with a command line action that supports this parameter
* (as defined by the {@link IParameterAssociatedActionNames.associatedActionNames} option).
*
* @remarks
* For example, if `build` is one of the associated action names for `--my-integer-parameter`,
* then `actionAssociated` will be true if the user invokes `heft build`.
*
* To test whether the parameter was actually included (e.g. `heft build --my-integer-parameter 123`),
* verify the {@link IHeftBaseParameter.value} property is not `undefined`.
*/
readonly actionAssociated: boolean;
/**
* The parameter was specified on the command line.
* The options {@link IHeftRegisterParameterOptions} used to create and register the parameter with
* a Heft command line action.
*/
readonly valueProvided: boolean;
readonly definition: IHeftRegisterParameterOptions<TCommandLineDefinition>;
}
/**
* @beta
* The object returned when registering a choiceList type parameter.
*/
export declare type IHeftChoiceListParameter = IHeftBaseParameter<readonly string[], ICommandLineChoiceListDefinition>;
/**
* @beta
* The object returned when registering a choice type parameter.
*/
export declare type IHeftChoiceParameter = IHeftBaseParameter<string, ICommandLineChoiceDefinition>;
/**
* @internal

@@ -443,8 +485,3 @@ */

*/
export declare interface IHeftFlagParameter extends IHeftBaseParameter {
/**
* The boolean value `true` if specified on the command line.
*/
readonly value?: boolean;
}
export declare type IHeftFlagParameter = IHeftBaseParameter<boolean, ICommandLineFlagDefinition>;

@@ -455,8 +492,3 @@ /**

*/
export declare interface IHeftIntegerParameter extends IHeftBaseParameter {
/**
* The integer value specified on the command line.
*/
readonly value?: number;
}
export declare type IHeftIntegerParameter = IHeftBaseParameter<number, ICommandLineIntegerDefinition>;

@@ -479,2 +511,9 @@ /** @internal */

/**
* @beta
* The options object provided to the command line parser when registering a parameter
* in addition to the action names used to associate the parameter with.
*/
export declare type IHeftRegisterParameterOptions<TCommandLineDefinition extends IBaseCommandLineDefinition> = TCommandLineDefinition & IParameterAssociatedActionNames;
/**
* @public

@@ -503,8 +542,3 @@ */

*/
export declare interface IHeftStringListParameter extends IHeftBaseParameter {
/**
* The array of string values specified on the command line.
*/
readonly values?: string[];
}
export declare type IHeftStringListParameter = IHeftBaseParameter<readonly string[], ICommandLineStringListDefinition>;

@@ -515,8 +549,3 @@ /**

*/
export declare interface IHeftStringParameter extends IHeftBaseParameter {
/**
* The string value specified on the command line.
*/
readonly value?: string;
}
export declare type IHeftStringParameter = IHeftBaseParameter<string, ICommandLineStringDefinition>;

@@ -535,3 +564,3 @@ /**

registerAction: RegisterAction;
commandLine: HeftCommandLineUtilities;
commandLine: HeftCommandLine;
}

@@ -586,2 +615,14 @@

/**
* @beta
* The configuration interface for associating a parameter definition with a Heft
* command line action in {@link IHeftRegisterParameterOptions}.
*/
export declare interface IParameterAssociatedActionNames {
/**
* A string list of one or more action names to associate the parameter with.
*/
associatedActionNames: string[];
}
/**
* @internal

@@ -607,26 +648,2 @@ */

/**
* @beta
* The options object provided to the command line parser when registering a parameter
* in addition to the action names used to associate the parameter with.
*/
export declare interface IRegisterParameterOptions extends IBaseCommandLineDefinition {
/**
* A string list of one or more action names to associate the parameter with.
*/
associatedActionNames: string[];
}
/**
* @beta
* The options object provided to the command line parser when registering a parameter
* in addition to the action names used to associate the parameter with.
*/
export declare interface IRegisterParameterWithArgumentOptions extends IBaseCommandLineDefinitionWithArgument {
/**
* A string list of one or more action names to associate the parameter with.
*/
associatedActionNames: string[];
}
/**
* Options provided to scripts that are run using the RunScriptPlugin.

@@ -633,0 +650,0 @@ *

@@ -25,3 +25,3 @@ "use strict";

const HeftLifecycle_1 = require("../pluginFramework/HeftLifecycle");
const HeftCommandLineUtilities_1 = require("./HeftCommandLineUtilities");
const HeftCommandLine_1 = require("./HeftCommandLine");
class HeftCommandLineParser extends ts_command_line_1.CommandLineParser {

@@ -64,3 +64,3 @@ constructor() {

this.addAction(action);
}, commandLine: new HeftCommandLineUtilities_1.HeftCommandLineUtilities(this, this._terminal) }));
}, commandLine: new HeftCommandLine_1.HeftCommandLine(this, this._terminal) }));
this._pluginManager = new PluginManager_1.PluginManager({

@@ -67,0 +67,0 @@ terminal: this._terminal,

@@ -7,3 +7,3 @@ export { IHeftPlugin } from './pluginFramework/IHeftPlugin';

export { ICustomActionOptions, ICustomActionParameterFlag, ICustomActionParameterInteger, ICustomActionParameterString, ICustomActionParameterStringList, ICustomActionParameterBase, ICustomActionParameter, CustomActionParameterType } from './cli/actions/CustomAction';
export { IHeftBaseParameter, IHeftFlagParameter, IHeftStringParameter, IHeftIntegerParameter, IHeftStringListParameter, IRegisterParameterOptions, IRegisterParameterWithArgumentOptions, HeftCommandLineUtilities } from './cli/HeftCommandLineUtilities';
export { HeftCommandLine, IHeftBaseParameter, IHeftChoiceParameter, IHeftChoiceListParameter, IHeftFlagParameter, IHeftIntegerParameter, IHeftStringParameter, IHeftStringListParameter, IParameterAssociatedActionNames, IHeftRegisterParameterOptions } from './cli/HeftCommandLine';
export { StageHooksBase, IStageContext } from './stages/StageBase';

@@ -10,0 +10,0 @@ export { BuildStageHooks, BuildSubstageHooksBase, CompileSubstageHooks, BundleSubstageHooks, IBuildStageContext, IBuildStageProperties, IBuildSubstage, IBundleSubstage, IBundleSubstageProperties, ICompileSubstage, ICompileSubstageProperties, IPostBuildSubstage, IPreCompileSubstage } from './stages/BuildStage';

@@ -5,3 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports._HeftLifecycleHooks = exports.TestStageHooks = exports.CleanStageHooks = exports.BundleSubstageHooks = exports.CompileSubstageHooks = exports.BuildSubstageHooksBase = exports.BuildStageHooks = exports.StageHooksBase = exports.HeftCommandLineUtilities = exports.ScopedLogger = exports._MetricsCollector = exports.MetricsCollectorHooks = exports.HeftSession = exports.HeftConfiguration = void 0;
exports._HeftLifecycleHooks = exports.TestStageHooks = exports.CleanStageHooks = exports.BundleSubstageHooks = exports.CompileSubstageHooks = exports.BuildSubstageHooksBase = exports.BuildStageHooks = exports.StageHooksBase = exports.HeftCommandLine = exports.ScopedLogger = exports._MetricsCollector = exports.MetricsCollectorHooks = exports.HeftSession = exports.HeftConfiguration = void 0;
var HeftConfiguration_1 = require("./configuration/HeftConfiguration");

@@ -16,4 +16,4 @@ Object.defineProperty(exports, "HeftConfiguration", { enumerable: true, get: function () { return HeftConfiguration_1.HeftConfiguration; } });

Object.defineProperty(exports, "ScopedLogger", { enumerable: true, get: function () { return ScopedLogger_1.ScopedLogger; } });
var HeftCommandLineUtilities_1 = require("./cli/HeftCommandLineUtilities");
Object.defineProperty(exports, "HeftCommandLineUtilities", { enumerable: true, get: function () { return HeftCommandLineUtilities_1.HeftCommandLineUtilities; } });
var HeftCommandLine_1 = require("./cli/HeftCommandLine");
Object.defineProperty(exports, "HeftCommandLine", { enumerable: true, get: function () { return HeftCommandLine_1.HeftCommandLine; } });
// Stages

@@ -20,0 +20,0 @@ var StageBase_1 = require("./stages/StageBase");

@@ -11,3 +11,3 @@ import { SyncHook } from 'tapable';

import { IHeftLifecycle } from './HeftLifecycle';
import { HeftCommandLineUtilities } from '../cli/HeftCommandLineUtilities';
import { HeftCommandLine } from '../cli/HeftCommandLine';
/** @beta */

@@ -57,5 +57,5 @@ export declare type RegisterAction = <TParameters>(action: ICustomActionOptions<TParameters>) => void;

* @beta
* {@inheritDoc HeftCommandLineUtilities}
* {@inheritDoc HeftCommandLine}
*/
readonly commandLine: HeftCommandLineUtilities;
readonly commandLine: HeftCommandLine;
/**

@@ -62,0 +62,0 @@ * Call this function to receive a callback with the plugin if and after the specified plugin

@@ -10,3 +10,3 @@ import { SyncHook } from 'tapable';

import { IHeftLifecycle } from './HeftLifecycle';
import { HeftCommandLineUtilities } from '../cli/HeftCommandLineUtilities';
import { HeftCommandLine } from '../cli/HeftCommandLine';
/**

@@ -24,3 +24,3 @@ * @internal

registerAction: RegisterAction;
commandLine: HeftCommandLineUtilities;
commandLine: HeftCommandLine;
}

@@ -27,0 +27,0 @@ /**

{
"name": "@rushstack/heft",
"version": "0.41.1",
"version": "0.41.2",
"description": "Build all your JavaScript projects the same way: A way that works.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc