@rushstack/heft
Version:
Build all your JavaScript projects the same way: A way that works.
50 lines • 1.86 kB
TypeScript
import type { IHeftTaskPlugin } from '../pluginFramework/IHeftPlugin';
import type { HeftConfiguration } from '../configuration/HeftConfiguration';
import type { IHeftTaskSession } from '../pluginFramework/HeftTaskSession';
export interface INodeServicePluginCompleteConfiguration {
commandName: string;
ignoreMissingScript: boolean;
waitForTerminateMs: number;
waitForKillMs: number;
}
export interface INodeServicePluginConfiguration extends Partial<INodeServicePluginCompleteConfiguration> {
}
export default class NodeServicePlugin implements IHeftTaskPlugin {
private static readonly _isWindows;
private _activeChildProcess;
private _childProcessExitPromise;
private _childProcessExitPromiseResolveFn;
private _childProcessExitPromiseRejectFn;
private _state;
private _logger;
/**
* The state machine schedules at most one setInterval() timeout at any given time. It is for:
*
* - waitForTerminateMs in State.Stopping
* - waitForKillMs in State.Killing
*/
private _timeout;
/**
* The data read from the node-service.json config file, or "undefined" if the file is missing.
*/
private _rawConfiguration;
/**
* The effective configuration, with defaults applied.
*/
private _configuration;
/**
* The script body obtained from the "scripts" section in the project's package.json.
*/
private _shellCommand;
private _pluginEnabled;
apply(taskSession: IHeftTaskSession, heftConfiguration: HeftConfiguration): void;
private _loadStageConfigurationAsync;
private _runCommandAsync;
private _stopChildAsync;
private _transitionToKilling;
private _transitionToStopped;
private _startChild;
private _clearTimeout;
private _formatCodeOrSignal;
}
//# sourceMappingURL=NodeServicePlugin.d.ts.map