Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/heft > IHeftLifecycleSession

IHeftLifecycleSession interface

The lifecycle session is responsible for providing session-specific information to Heft lifecycle plugins. The session provides access to the hooks that Heft will run as part of lifecycle execution, as well as access to parameters provided via the CLI. The session is also how you request access to other lifecycle plugins.

Signature:

export interface IHeftLifecycleSession

Properties

PropertyModifiersTypeDescription
hooksreadonlyIHeftLifecycleHooksThe hooks available to the lifecycle plugin.
loggerreadonlyIScopedLoggerThe scoped logger for the lifecycle plugin. Messages logged with this logger will be prefixed with the plugin name, in the format [lifecycle:<pluginName>]. 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.
parametersreadonlyIHeftParametersContains default parameters provided by Heft, as well as CLI parameters requested by the lifecycle plugin.
tempFolderPathreadonlystringThe temp folder for the lifecycle plugin. This folder is unique for each lifecycle plugin, and will be cleaned when Heft is run with --clean.

Methods

MethodDescription
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 lifecycle plugin that exists within the same phase.