Home > @rushstack/heft > IHeftTaskSession
IHeftTaskSession interface
The task session is responsible for providing session-specific information to Heft task plugins. The session provides access to the hooks that Heft will run as part of task execution, as well as access to parameters provided via the CLI. The session is also how you request access to other task plugins.
Signature:
export interface IHeftTaskSession
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
hooks | readonly | IHeftTaskHooks | The hooks available to the task plugin. |
logger | readonly | IScopedLogger | The scoped logger for the task. Messages logged with this logger will be prefixed with the phase and task name, in the format [<phaseName>:<taskName>] . It is highly recommended that writing to the console be performed via the logger, as it will ensure that logging messages are labeled with the source of the message. |
parameters | readonly | IHeftParameters | Contains default parameters provided by Heft, as well as CLI parameters requested by the task plugin. |
parsedCommandLine | readonly | IHeftParsedCommandLine | Exposes details about the command line that was used to invoke Heft. This value is initially undefined and later filled in after the command line has been parsed. |
taskName | readonly | string | The name of the task. This is defined in "heft.json". |
tempFolderPath | readonly | string | The temp folder for the task. This folder is unique for each task, and will be cleaned when Heft is run with --clean . |
Methods
Method | Description |
---|---|
requestAccessToPluginByName(pluginToAccessPackage, pluginToAccessName, pluginApply) | Set a a callback which will be called if and after the specified plugin has been applied. This can be used to tap hooks on another plugin that exists within the same phase. |