Comparing version
@@ -13,2 +13,9 @@ "use strict"; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -23,3 +30,3 @@ var chalk_1 = __importDefault(require("chalk")); | ||
var pluralize_1 = __importDefault(require("pluralize")); | ||
var optimal_1 = __importDefault(require("optimal")); | ||
var optimal_1 = __importStar(require("optimal")); | ||
var formatModuleName_1 = __importDefault(require("./helpers/formatModuleName")); | ||
@@ -125,2 +132,3 @@ var isObject_1 = __importDefault(require("./helpers/isObject")); | ||
ConfigLoader.prototype.loadConfig = function () { | ||
var _a, _b; | ||
if (isEmptyObject_1.default(this.package) || !this.package.name) { | ||
@@ -130,3 +138,3 @@ throw new Error('Cannot load configuration as "package.json" has not been loaded.'); | ||
this.debug('Locating configuration'); | ||
var _a = this.tool.options, configBlueprint = _a.configBlueprint, pluginAlias = _a.pluginAlias, root = _a.root; | ||
var _c = this.tool.options, configBlueprint = _c.configBlueprint, pluginAlias = _c.pluginAlias, root = _c.root; | ||
var config = this.findConfigInPackageJSON(this.package) || | ||
@@ -138,7 +146,6 @@ this.findConfigInLocalFiles(root) || | ||
} | ||
return optimal_1.default(this.parseAndExtend(config), __assign({}, configBlueprint, (_b = { debug: optimal_1.bool(), extends: optimal_1.array(optimal_1.string()), reporters: optimal_1.array(optimal_1.union([optimal_1.string(), optimal_1.shape({ reporter: optimal_1.string() })])) }, _b[pluralize_1.default(pluginAlias)] = optimal_1.array(optimal_1.union([optimal_1.string(), optimal_1.shape((_c = {}, _c[pluginAlias] = optimal_1.string(), _c))])), _b)), { | ||
return optimal_1.default(this.parseAndExtend(config), __assign({}, configBlueprint, (_a = { debug: optimal_1.bool(), extends: optimal_1.array(optimal_1.string()), reporters: optimal_1.array(optimal_1.union([optimal_1.string(), optimal_1.shape({ reporter: optimal_1.string() })])) }, _a[pluralize_1.default(pluginAlias)] = optimal_1.array(optimal_1.union([optimal_1.string(), optimal_1.shape((_b = {}, _b[pluginAlias] = optimal_1.string(), _b))])), _a)), { | ||
name: 'ConfigLoader', | ||
unknown: true, | ||
}); | ||
var _b, _c; | ||
}; | ||
@@ -145,0 +152,0 @@ ConfigLoader.prototype.loadPackageJSON = function () { |
import { Struct } from 'optimal'; | ||
import Context from './Context'; | ||
import { RoutineInterface } from './Routine'; | ||
@@ -11,7 +12,7 @@ import { TaskInterface } from './Task'; | ||
export default class Executor<To extends Struct = {}> { | ||
context: any; | ||
context: Context; | ||
debug: Debugger; | ||
options: To; | ||
tool: ToolInterface; | ||
constructor(tool: ToolInterface, context: any, options?: Partial<To>); | ||
constructor(tool: ToolInterface, context: Context, options?: Partial<To>); | ||
aggregateResponse(responses: any[]): AggregatedResponse; | ||
@@ -18,0 +19,0 @@ execute<T>(task: TaskInterface | RoutineInterface, value?: T, wasParallel?: boolean): Promise<any>; |
@@ -0,1 +1,2 @@ | ||
import Context from '../Context'; | ||
import Executor, { AggregatedResponse } from '../Executor'; | ||
@@ -16,3 +17,3 @@ import { TaskInterface } from '../Task'; | ||
timeoutTimer: number; | ||
constructor(tool: ToolInterface, context: any, options?: Partial<PoolExecutorOptions>); | ||
constructor(tool: ToolInterface, context: Context, options?: Partial<PoolExecutorOptions>); | ||
run<T>(tasks: TaskInterface[], value?: T): Promise<AggregatedResponse>; | ||
@@ -19,0 +20,0 @@ runTask<T>(value?: T): Promise<void>; |
@@ -15,5 +15,12 @@ "use strict"; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var os_1 = __importDefault(require("os")); | ||
var optimal_1 = __importDefault(require("optimal")); | ||
var optimal_1 = __importStar(require("optimal")); | ||
var Executor_1 = __importDefault(require("../Executor")); | ||
@@ -20,0 +27,0 @@ exports.TIMEOUT = 60000; |
import ConfigLoader from './ConfigLoader'; | ||
import { ConsoleInterface } from './Console'; | ||
import Context from './Context'; | ||
import Emitter, { EmitterInterface, EventArguments, EventListener } from './Emitter'; | ||
@@ -12,3 +13,3 @@ import Module, { ModuleInterface } from './Module'; | ||
import Tool, { ToolInterface, ToolOptions } from './Tool'; | ||
export { ConfigLoader, ConsoleInterface, Emitter, EmitterInterface, EventArguments, EventListener, Module, ModuleInterface, ModuleLoader, Pipeline, Plugin, PluginInterface, Reporter, ReporterInterface, ReporterOptions, Routine, RoutineInterface, TaskInterface, Tool, ToolInterface, ToolOptions }; | ||
export { ConfigLoader, ConsoleInterface, Context, Emitter, EmitterInterface, EventArguments, EventListener, Module, ModuleInterface, ModuleLoader, Pipeline, Plugin, PluginInterface, Reporter, ReporterInterface, ReporterOptions, Routine, RoutineInterface, TaskInterface, Tool, ToolInterface, ToolOptions, }; | ||
export * from './types'; |
@@ -8,2 +8,4 @@ "use strict"; | ||
exports.ConfigLoader = ConfigLoader_1.default; | ||
var Context_1 = __importDefault(require("./Context")); | ||
exports.Context = Context_1.default; | ||
var Emitter_1 = __importDefault(require("./Emitter")); | ||
@@ -10,0 +12,0 @@ exports.Emitter = Emitter_1.default; |
@@ -0,8 +1,9 @@ | ||
import Context from './Context'; | ||
import Routine from './Routine'; | ||
import { ToolInterface } from './Tool'; | ||
import { PluginInterface } from './Plugin'; | ||
import { Context, ToolConfig } from './types'; | ||
import { ToolConfig } from './types'; | ||
export default class Pipeline<Tp extends PluginInterface, Tx extends Context> extends Routine<ToolConfig, Tx> { | ||
constructor(tool: ToolInterface, context?: Tx); | ||
constructor(tool: ToolInterface, context: Tx); | ||
run<T>(initialValue?: T): Promise<any>; | ||
} |
@@ -30,5 +30,3 @@ "use strict"; | ||
_this.tool.debug('Instantiating pipeline'); | ||
if (context) { | ||
_this.setContext(context); | ||
} | ||
_this.setContext(context); | ||
return _this; | ||
@@ -35,0 +33,0 @@ } |
@@ -15,5 +15,12 @@ "use strict"; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chalk_1 = __importDefault(require("chalk")); | ||
var optimal_1 = __importDefault(require("optimal")); | ||
var optimal_1 = __importStar(require("optimal")); | ||
var Module_1 = __importDefault(require("./Module")); | ||
@@ -20,0 +27,0 @@ var themes_1 = __importDefault(require("./themes")); |
@@ -1,7 +0,7 @@ | ||
/// <reference types="execa" /> | ||
import { Options as ExecaOptions, SyncOptions as ExecaSyncOptions, ExecaChildProcess, ExecaReturns } from 'execa'; | ||
import { Struct } from 'optimal'; | ||
import Context from './Context'; | ||
import Task, { TaskAction, TaskInterface } from './Task'; | ||
import { ToolInterface } from './Tool'; | ||
import { Debugger, Context } from './types'; | ||
import { Debugger } from './types'; | ||
import { AggregatedResponse } from './Executor'; | ||
@@ -18,3 +18,3 @@ import { PoolExecutorOptions } from './executors/Pool'; | ||
tool: ToolInterface; | ||
run<T>(context: any, initialValue?: T | null, wasParallel?: boolean): Promise<any>; | ||
run<T>(context: Context, initialValue?: T | null, wasParallel?: boolean): Promise<any>; | ||
} | ||
@@ -21,0 +21,0 @@ export default class Routine<To extends Struct, Tx extends Context> extends Task<To, Tx> implements RoutineInterface { |
import { Struct } from 'optimal'; | ||
import { Context, Status } from './types'; | ||
import Context from './Context'; | ||
import { Status } from './types'; | ||
export interface TaskInterface { | ||
@@ -15,3 +16,3 @@ startTime: number; | ||
hasPassed(): boolean; | ||
run<T>(context: any, initialValue?: T | null): Promise<any>; | ||
run<T>(context: Context, initialValue?: T | null): Promise<any>; | ||
skip(condition?: boolean): this; | ||
@@ -18,0 +19,0 @@ } |
@@ -23,2 +23,9 @@ "use strict"; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -29,3 +36,3 @@ var util_1 = __importDefault(require("util")); | ||
var pluralize_1 = __importDefault(require("pluralize")); | ||
var optimal_1 = __importDefault(require("optimal")); | ||
var optimal_1 = __importStar(require("optimal")); | ||
var ConfigLoader_1 = __importDefault(require("./ConfigLoader")); | ||
@@ -32,0 +39,0 @@ var Console_1 = __importDefault(require("./Console")); |
@@ -7,5 +7,2 @@ import debug from 'debug'; | ||
} | ||
export interface Context { | ||
[key: string]: any; | ||
} | ||
export interface PluginConfig { | ||
@@ -12,0 +9,0 @@ plugin: string; |
{ | ||
"name": "boost", | ||
"version": "0.59.2", | ||
"version": "0.60.0", | ||
"description": "Robust pipeline for creating build tools that separate logic into routines and tasks.", | ||
@@ -64,3 +64,3 @@ "keywords": [], | ||
"devDependencies": { | ||
"@milesj/build-tool-config": "0.99.0", | ||
"@milesj/build-tool-config": "0.100.1", | ||
"fs-extra": "^6.0.1" | ||
@@ -67,0 +67,0 @@ }, |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
409964
0.65%63
3.28%2376
1.84%0
-100%