Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onMergeConfig = new Event<[ConfigContext, Config]>('merge-config');
onCreateConfigFile = new Event<[ConfigContext, Path, Config]>('create-config-file');
onCopyConfigFile = new Event<[ConfigContext, Path, Config]>('copy-config-file');
onReferenceConfigFile = new Event<[ConfigContext, Path, Config]>('reference-config-file');
onDeleteConfigFile = new Event<[ConfigContext, Path]>('delete-config-file');
onBeforeExecute = new ConcurrentEvent<[DriverContext, Argv]>('before-execute');
onAfterExecute = new ConcurrentEvent<[DriverContext, unknown]>('after-execute');
onFailedExecute = new ConcurrentEvent<[DriverContext, Error]>('failed-execute');
blueprint(predicates: Predicates) /* infer */ {
// eslint-disable-next-line
return {
args: array(string()),
dependencies: array(string()),
env: object(string()),
strategy: string(STRATEGY_NATIVE).oneOf([
STRATEGY_NATIVE,
STRATEGY_CREATE,
STRATEGY_REFERENCE,
STRATEGY_COPY,
STRATEGY_NONE,
]),
} as $FixMe;
}
onLoadPackageConfig = new Event<[ConfigContext, Config]>('load-package-config');
onMergeConfig = new Event<[ConfigContext, Config]>('merge-config');
onCreateConfigFile = new Event<[ConfigContext, Path, Config]>('create-config-file');
onCopyConfigFile = new Event<[ConfigContext, Path, Config]>('copy-config-file');
onReferenceConfigFile = new Event<[ConfigContext, Path, Config]>('reference-config-file');
onDeleteConfigFile = new Event<[ConfigContext, Path]>('delete-config-file');
onBeforeExecute = new ConcurrentEvent<[DriverContext, Argv]>('before-execute');
onAfterExecute = new ConcurrentEvent<[DriverContext, unknown]>('after-execute');
onFailedExecute = new ConcurrentEvent<[DriverContext, Error]>('failed-execute');
blueprint(predicates: Predicates) /* infer */ {
// eslint-disable-next-line
return {
args: array(string()),
dependencies: array(string()),
env: object(string()),
strategy: string(STRATEGY_NATIVE).oneOf([
STRATEGY_NATIVE,
STRATEGY_CREATE,
STRATEGY_REFERENCE,
STRATEGY_COPY,
STRATEGY_NONE,
]),
onLoadModuleConfig = new Event<[ConfigContext, Path, Config]>('load-module-config');
onLoadPackageConfig = new Event<[ConfigContext, Config]>('load-package-config');
onMergeConfig = new Event<[ConfigContext, Config]>('merge-config');
onCreateConfigFile = new Event<[ConfigContext, Path, Config]>('create-config-file');
onCopyConfigFile = new Event<[ConfigContext, Path, Config]>('copy-config-file');
onReferenceConfigFile = new Event<[ConfigContext, Path, Config]>('reference-config-file');
onDeleteConfigFile = new Event<[ConfigContext, Path]>('delete-config-file');
onBeforeExecute = new ConcurrentEvent<[DriverContext, Argv]>('before-execute');
onAfterExecute = new ConcurrentEvent<[DriverContext, unknown]>('after-execute');
onFailedExecute = new ConcurrentEvent<[DriverContext, Error]>('failed-execute');
blueprint(predicates: Predicates) /* infer */ {
// eslint-disable-next-line
return {
args: array(string()),
dependencies: array(string()),
env: object(string()),
strategy: string(STRATEGY_NATIVE).oneOf([
STRATEGY_NATIVE,
STRATEGY_CREATE,
STRATEGY_REFERENCE,
STRATEGY_COPY,
import { Plugin, Task, TaskAction } from '@boost/core';
import { ConcurrentEvent } from '@boost/event';
import { Options } from 'yargs-parser';
import execa, { Options as ExecaOptions, ExecaReturnValue } from 'execa';
import ScriptContext from './contexts/ScriptContext';
import { Argv, ExecuteType, ExecuteQueue } from './types';
export default abstract class Script<
Args extends object = {},
Opts extends object = {}
> extends Plugin {
tasks: Task[] = [];
onBeforeExecute = new ConcurrentEvent<[ScriptContext, Argv]>('before-execute');
onAfterExecute = new ConcurrentEvent<[ScriptContext, unknown]>('after-execute');
onFailedExecute = new ConcurrentEvent<[ScriptContext, Error]>('failed-execute');
/**
* Define a configuration object to parse args with.
*/
args(): Options {
return {};
}
/**
* Execute the script with the context and parsed args.
*/
async execute(context: ScriptContext, args: Args): Promise {
import { Plugin, Task, TaskAction } from '@boost/core';
import { ConcurrentEvent } from '@boost/event';
import { Options } from 'yargs-parser';
import execa, { Options as ExecaOptions, ExecaReturnValue } from 'execa';
import ScriptContext from './contexts/ScriptContext';
import { Argv, ExecuteType, ExecuteQueue } from './types';
export default abstract class Script<
Args extends object = {},
Opts extends object = {}
> extends Plugin {
tasks: Task[] = [];
onBeforeExecute = new ConcurrentEvent<[ScriptContext, Argv]>('before-execute');
onAfterExecute = new ConcurrentEvent<[ScriptContext, unknown]>('after-execute');
onFailedExecute = new ConcurrentEvent<[ScriptContext, Error]>('failed-execute');
/**
* Define a configuration object to parse args with.
*/
args(): Options {
return {};
}
/**
* Execute the script with the context and parsed args.
*/
async execute(context: ScriptContext, args: Args): Promise {
return this.executeTasks('serial');
}
import { Options } from 'yargs-parser';
import execa, { Options as ExecaOptions, ExecaReturnValue } from 'execa';
import ScriptContext from './contexts/ScriptContext';
import { Argv, ExecuteType, ExecuteQueue } from './types';
export default abstract class Script<
Args extends object = {},
Opts extends object = {}
> extends Plugin {
tasks: Task[] = [];
onBeforeExecute = new ConcurrentEvent<[ScriptContext, Argv]>('before-execute');
onAfterExecute = new ConcurrentEvent<[ScriptContext, unknown]>('after-execute');
onFailedExecute = new ConcurrentEvent<[ScriptContext, Error]>('failed-execute');
/**
* Define a configuration object to parse args with.
*/
args(): Options {
return {};
}
/**
* Execute the script with the context and parsed args.
*/
async execute(context: ScriptContext, args: Args): Promise {
return this.executeTasks('serial');
}
/**