Socket
Socket
Sign inDemoInstall

@beemo/core

Package Overview
Dependencies
160
Maintainers
2
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-rc.1 to 2.0.0-rc.2

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

### 2.0.0-rc.2 - 2021-05-07
#### 🛠 Internals
- Migrate to Yarn 2. (#130) ([d0d6332](https://github.com/beemojs/beemo/commit/d0d6332)), closes [#130](https://github.com/beemojs/beemo/issues/130)
- Switch to @beemo/dev for configs. (#131) ([8996d55](https://github.com/beemojs/beemo/commit/8996d55)), closes [#131](https://github.com/beemojs/beemo/issues/131)
**Note:** Version bump only for package @beemo/core
### 2.0.0-rc.1 - 2021-04-13

@@ -8,0 +21,0 @@

2

dts/Config.d.ts
import { Blueprint, Predicates } from '@boost/common';
import { Configuration } from '@boost/config';
import { ConfigFile } from './types';
export default class Config extends Configuration<ConfigFile> {
export declare class Config extends Configuration<ConfigFile> {
blueprint(predicates: Predicates, onConstruction: boolean): Blueprint<ConfigFile>;

@@ -6,0 +6,0 @@ bootstrap(): void;

@@ -1,4 +0,4 @@

import Driver from '../Driver';
import Context from './Context';
export default class ConfigContext<O extends object = {}> extends Context<O, string[]> {
import { Driver } from '../Driver';
import { Context } from './Context';
export declare class ConfigContext<O extends object = {}> extends Context<O, string[]> {
drivers: Set<Driver>;

@@ -5,0 +5,0 @@ /**

@@ -9,3 +9,3 @@ import { PrimitiveType } from '@boost/args';

}
export default class Context<O extends object = {}, P extends PrimitiveType[] = PrimitiveType[]> extends BaseContext {
export declare class Context<O extends object = {}, P extends PrimitiveType[] = PrimitiveType[]> extends BaseContext {
args: Arguments<O, P>;

@@ -12,0 +12,0 @@ argv: Argv;

@@ -1,4 +0,4 @@

import Driver from '../Driver';
import { Driver } from '../Driver';
import { Arguments, Argv, StdioType } from '../types';
import ConfigContext from './ConfigContext';
import { ConfigContext } from './ConfigContext';
export interface DriverContextOptions {

@@ -11,3 +11,3 @@ concurrency: number;

export declare type DriverContextParams = [string];
export default class DriverContext<O extends DriverContextOptions = DriverContextOptions> extends ConfigContext<O> {
export declare class DriverContext<O extends DriverContextOptions = DriverContextOptions> extends ConfigContext<O> {
driverName: string;

@@ -14,0 +14,0 @@ parallelArgv: Argv[];

import { Arguments } from '../types';
import Context from './Context';
import { Context } from './Context';
export interface ScaffoldContextOptions {

@@ -7,3 +7,3 @@ dry: boolean;

export declare type ScaffoldContextParams = [string, string, string];
export default class ScaffoldContext extends Context<ScaffoldContextOptions, ScaffoldContextParams> {
export declare class ScaffoldContext extends Context<ScaffoldContextOptions, ScaffoldContextParams> {
action: string;

@@ -10,0 +10,0 @@ generator: string;

@@ -1,4 +0,4 @@

import Script from '../Script';
import { Script } from '../Script';
import { Arguments, StdioType } from '../types';
import Context from './Context';
import { Context } from './Context';
export interface ScriptContextOptions {

@@ -11,3 +11,3 @@ concurrency: number;

export declare type ScriptContextParams = [string];
export default class ScriptContext extends Context<ScriptContextOptions, ScriptContextParams> {
export declare class ScriptContext extends Context<ScriptContextOptions, ScriptContextParams> {
script: Script | null;

@@ -14,0 +14,0 @@ scriptName: string;

@@ -5,6 +5,6 @@ import { PrimitiveType } from '@boost/args';

import { Plugin } from '@boost/plugin';
import ConfigContext from './contexts/ConfigContext';
import DriverContext from './contexts/DriverContext';
import { Argv, BeemoTool, Driverable, DriverCommandConfig, DriverCommandRegistration, DriverCommandRunner, DriverMetadata, DriverOptions, DriverOutput, Execution } from './types';
export default abstract class Driver<Config extends object = {}, Options extends DriverOptions = DriverOptions> extends Plugin<BeemoTool, Options> implements Driverable {
import { ConfigContext } from './contexts/ConfigContext';
import { DriverContext } from './contexts/DriverContext';
import { Argv, BeemoTool, ConfigObject, Driverable, DriverCommandConfig, DriverCommandRegistration, DriverCommandRunner, DriverMetadata, DriverOptions, DriverOutput, Execution } from './types';
export declare abstract class Driver<Config extends object = {}, Options extends DriverOptions = DriverOptions> extends Plugin<BeemoTool, Options> implements Driverable {
commands: DriverCommandRegistration<any, any>[];

@@ -21,3 +21,3 @@ config: Config;

readonly onReferenceConfigFile: Event<[ConfigContext<{}>, Path, Config], string>;
readonly onTemplateConfigFile: Event<[ConfigContext<{}>, Path, string | Record<string, unknown>], string>;
readonly onTemplateConfigFile: Event<[ConfigContext<{}>, Path, string | ConfigObject], string>;
readonly onDeleteConfigFile: Event<[ConfigContext<{}>, Path], string>;

@@ -24,0 +24,0 @@ readonly onBeforeExecute: ConcurrentEvent<[DriverContext<import("./contexts/DriverContext").DriverContextOptions>, Argv], string>;

import { Argv } from '../types';
export interface OptionMap {
[option: string]: boolean;
}
export declare type OptionMap = Record<string, boolean>;
export interface FilterArgOptions {

@@ -9,3 +7,3 @@ allow?: OptionMap;

}
export default function filterArgs(argv: Argv, { allow, block }: FilterArgOptions): {
export declare function filterArgs(argv: Argv, { allow, block }: FilterArgOptions): {
filteredArgv: Argv;

@@ -12,0 +10,0 @@ unknownArgv: Argv;

@@ -6,3 +6,3 @@ export interface ExecLike {

}
export default function formatExecReturn<T extends ExecLike>(obj: T): Pick<T, Exclude<keyof T, 'command' | 'stderr' | 'stdout'>>;
export declare function formatExecReturn<T extends ExecLike>(obj: T): Pick<T, Exclude<keyof T, 'command' | 'stderr' | 'stdout'>>;
//# sourceMappingURL=formatExecReturn.d.ts.map

@@ -1,2 +0,2 @@

export default function isClassInstance<T>(value: unknown): value is T;
export declare function isClassInstance<T>(value: unknown): value is T;
//# sourceMappingURL=isClassInstance.d.ts.map
import micromatch from 'micromatch';
export default function isPatternMatch(string: string, pattern: string, options?: micromatch.Options): boolean;
export declare function isPatternMatch(string: string, pattern: string, options?: micromatch.Options): boolean;
//# sourceMappingURL=isPatternMatch.d.ts.map

@@ -6,14 +6,14 @@ /**

import { Blueprint, PackageStructure, Path, PortablePath, Predicates } from '@boost/common';
import ConfigContext from './contexts/ConfigContext';
import Context from './contexts/Context';
import DriverContext, { DriverContextOptions, DriverContextParams } from './contexts/DriverContext';
import ScaffoldContext, { ScaffoldContextOptions, ScaffoldContextParams } from './contexts/ScaffoldContext';
import ScriptContext, { ScriptContextOptions, ScriptContextParams } from './contexts/ScriptContext';
import Driver from './Driver';
import Script from './Script';
import Tool from './Tool';
export { ConfigContext, Context, Driver, DriverContext, Path, ScaffoldContext, Script, ScriptContext, Tool, };
export type { Blueprint, DriverContextOptions, DriverContextParams, PackageStructure, PortablePath, Predicates, ScaffoldContextOptions, ScaffoldContextParams, ScriptContextOptions, ScriptContextParams, };
export * from './constants';
export * from './contexts/ConfigContext';
export * from './contexts/Context';
export * from './contexts/DriverContext';
export * from './contexts/ScaffoldContext';
export * from './contexts/ScriptContext';
export * from './Driver';
export * from './Script';
export * from './Tool';
export * from './types';
export { Path };
export type { Blueprint, PackageStructure, PortablePath, Predicates };
//# sourceMappingURL=index.d.ts.map
import { Blueprint, Predicates } from '@boost/common';
import { Routine } from '@boost/pipeline';
import DriverContext from '../contexts/DriverContext';
import { DriverContext } from '../contexts/DriverContext';
import { RoutineOptions } from '../types';
export default class CleanupConfigsRoutine extends Routine<unknown, unknown, RoutineOptions> {
export declare class CleanupConfigsRoutine extends Routine<unknown, unknown, RoutineOptions> {
blueprint({ instance }: Predicates): Blueprint<RoutineOptions>;

@@ -7,0 +7,0 @@ execute(context: DriverContext): Promise<void>;

import { Blueprint, Path, Predicates } from '@boost/common';
import { Routine } from '@boost/pipeline';
import ConfigContext from '../contexts/ConfigContext';
import Driver from '../Driver';
import { ConfigContext } from '../contexts/ConfigContext';
import { Driver } from '../Driver';
import { ConfigObject, RoutineOptions } from '../types';

@@ -9,3 +9,3 @@ export interface CreateConfigOptions extends RoutineOptions {

}
export default class CreateConfigRoutine<Ctx extends ConfigContext> extends Routine<Path, unknown, CreateConfigOptions> {
export declare class CreateConfigRoutine<Ctx extends ConfigContext> extends Routine<Path, unknown, CreateConfigOptions> {
blueprint({ instance }: Predicates): Blueprint<CreateConfigOptions>;

@@ -53,4 +53,4 @@ execute(context: Ctx): Promise<Path>;

*/
setEnvVars(context: Ctx, configs: ConfigObject[]): Promise<ConfigObject[]>;
setEnvVars(context: Ctx, configs: ConfigObject[]): ConfigObject[];
}
//# sourceMappingURL=CreateConfigRoutine.d.ts.map
import execa from 'execa';
import { Blueprint, Predicates } from '@boost/common';
import { AnyWorkUnit, Routine } from '@boost/pipeline';
import DriverContext from '../../contexts/DriverContext';
import { DriverContext } from '../../contexts/DriverContext';
import { OptionMap } from '../../helpers/filterArgs';

@@ -13,3 +13,3 @@ import { Argv, Execution, RoutineOptions } from '../../types';

}
export default class ExecuteCommandRoutine extends Routine<unknown, unknown, ExecuteCommandOptions> {
export declare class ExecuteCommandRoutine extends Routine<unknown, unknown, ExecuteCommandOptions> {
blueprint({ array, bool, instance, string }: Predicates): Blueprint<ExecuteCommandOptions>;

@@ -20,3 +20,3 @@ execute(context: DriverContext): Promise<Execution>;

*/
captureOutput(context: DriverContext, stream: execa.ExecaChildProcess): "buffer" | "inherit" | "stream" | "watch";
captureOutput(context: DriverContext, stream: execa.ExecaChildProcess): import("../../types").StdioType | "watch";
/**

@@ -23,0 +23,0 @@ * When workspaces are enabled, some drivers require the config to be within each workspace,

import { Blueprint, Path, Predicates } from '@boost/common';
import { Routine } from '@boost/pipeline';
import ConfigContext from '../contexts/ConfigContext';
import { ConfigContext } from '../contexts/ConfigContext';
import { RoutineOptions } from '../types';
import CreateConfigRoutine from './CreateConfigRoutine';
export default class ResolveConfigsRoutine<Ctx extends ConfigContext = ConfigContext> extends Routine<Path[], unknown, RoutineOptions> {
import { CreateConfigRoutine } from './CreateConfigRoutine';
export declare class ResolveConfigsRoutine<Ctx extends ConfigContext = ConfigContext> extends Routine<Path[], unknown, RoutineOptions> {
blueprint({ instance }: Predicates): Blueprint<RoutineOptions>;

@@ -8,0 +8,0 @@ execute(context: Ctx): Promise<Path[]>;

@@ -1,5 +0,5 @@

import DriverContext from '../contexts/DriverContext';
import { DriverContext } from '../contexts/DriverContext';
import { ExecuteCommandOptions } from './driver/ExecuteCommandRoutine';
import RunInWorkspacesRoutine from './RunInWorkspacesRoutine';
export default class ExecuteDriverRoutine extends RunInWorkspacesRoutine<DriverContext> {
import { RunInWorkspacesRoutine } from './RunInWorkspacesRoutine';
export declare class RunDriverRoutine extends RunInWorkspacesRoutine<DriverContext> {
pipeRoutine(context: DriverContext, packageName?: string, packageRoot?: string): void;

@@ -6,0 +6,0 @@ /**

import { Blueprint, Predicates, WorkspacePackage } from '@boost/common';
import { Routine } from '@boost/pipeline';
import Context from '../contexts/Context';
import { Context } from '../contexts/Context';
import { RoutineOptions } from '../types';

@@ -11,3 +11,3 @@ export declare type AnyRoutine = Routine<any, any>;

}
export default abstract class RunInWorkspacesRoutine<Ctx extends Context<RunInWorkspacesContextArgs>> extends Routine<unknown, unknown, RoutineOptions> {
export declare abstract class RunInWorkspacesRoutine<Ctx extends Context<RunInWorkspacesContextArgs>> extends Routine<unknown, unknown, RoutineOptions> {
routines: AnyRoutine[];

@@ -14,0 +14,0 @@ workspacePackages: WorkspacePackage[];

@@ -1,5 +0,5 @@

import ScriptContext from '../contexts/ScriptContext';
import Script from '../Script';
import RunInWorkspacesRoutine from './RunInWorkspacesRoutine';
export default class RunScriptRoutine extends RunInWorkspacesRoutine<ScriptContext> {
import { ScriptContext } from '../contexts/ScriptContext';
import { Script } from '../Script';
import { RunInWorkspacesRoutine } from './RunInWorkspacesRoutine';
export declare class RunScriptRoutine extends RunInWorkspacesRoutine<ScriptContext> {
errors: Error[];

@@ -6,0 +6,0 @@ getInitialValue(context: ScriptContext): Promise<Script>;

import { Blueprint, Predicates } from '@boost/common';
import { Routine } from '@boost/pipeline';
import ScaffoldContext from '../contexts/ScaffoldContext';
import { ScaffoldContext } from '../contexts/ScaffoldContext';
import { RoutineOptions } from '../types';
export default class ScaffoldRoutine extends Routine<unknown, unknown, RoutineOptions> {
export declare class ScaffoldRoutine extends Routine<unknown, unknown, RoutineOptions> {
blueprint({ instance }: Predicates): Blueprint<RoutineOptions>;

@@ -7,0 +7,0 @@ execute(context: ScaffoldContext): Promise<void>;

import { Blueprint, Predicates } from '@boost/common';
import { Routine } from '@boost/pipeline';
import ScriptContext from '../../contexts/ScriptContext';
import Script from '../../Script';
import { ScriptContext } from '../../contexts/ScriptContext';
import { Script } from '../../Script';
import { RoutineOptions } from '../../types';

@@ -9,3 +9,3 @@ export interface ExecuteScriptOptions extends RoutineOptions {

}
export default class ExecuteScriptRoutine extends Routine<unknown, Script, ExecuteScriptOptions> {
export declare class ExecuteScriptRoutine extends Routine<unknown, Script, ExecuteScriptOptions> {
blueprint({ instance, string }: Predicates): Blueprint<ExecuteScriptOptions>;

@@ -12,0 +12,0 @@ /**

@@ -6,5 +6,5 @@ import execa, { Options as ExecaOptions } from 'execa';

import { Plugin } from '@boost/plugin';
import ScriptContext from './contexts/ScriptContext';
import { ScriptContext } from './contexts/ScriptContext';
import { Argv, BeemoTool, Scriptable } from './types';
export default abstract class Script<O extends object = {}, Options extends object = {}> extends Plugin<BeemoTool, Options> implements Scriptable<O> {
export declare abstract class Script<O extends object = {}, Options extends object = {}> extends Plugin<BeemoTool, Options> implements Scriptable<O> {
tool: BeemoTool;

@@ -11,0 +11,0 @@ readonly onBeforeExecute: ConcurrentEvent<[ScriptContext, Argv], string>;

@@ -6,3 +6,3 @@ /// <reference types="node" />

}
export default class BatchStream extends Transform {
export declare class BatchStream extends Transform {
bufferedBatch: Buffer | null;

@@ -9,0 +9,0 @@ timeout: NodeJS.Timeout | null;

@@ -1,2 +0,1 @@

/// <reference types="node" />
/// <reference types="jest" />

@@ -7,3 +6,3 @@ import execa from 'execa';

import { mockDebugger } from '@boost/debug/test';
import { ConfigContext, ConfigFile, Context, Driver, DriverContext, DriverContextOptions, DriverMetadata, ScaffoldContext, ScaffoldContextOptions, Script, ScriptContext, ScriptContextOptions, Tool } from './index';
import { ConfigContext, ConfigFile, Context, Driver, DriverContext, DriverContextOptions, DriverMetadata, ScaffoldContext, ScaffoldContextOptions, Script, ScriptContext, ScriptContextOptions, Tool } from '.';
export { mockDebugger };

@@ -10,0 +9,0 @@ export declare class TestDriver<O extends object = {}> extends Driver<O> {

@@ -6,10 +6,10 @@ import { Blueprint, Contract, PackageStructure, Path, PortablePath, Predicates, Project } from '@boost/common';

import { Translator } from '@boost/translate';
import Config from './Config';
import ConfigContext from './contexts/ConfigContext';
import Context from './contexts/Context';
import DriverContext from './contexts/DriverContext';
import ScaffoldContext from './contexts/ScaffoldContext';
import ScriptContext from './contexts/ScriptContext';
import Driver from './Driver';
import Script from './Script';
import { Config } from './Config';
import { ConfigContext } from './contexts/ConfigContext';
import { Context } from './contexts/Context';
import { DriverContext } from './contexts/DriverContext';
import { ScaffoldContext } from './contexts/ScaffoldContext';
import { ScriptContext } from './contexts/ScriptContext';
import { Driver } from './Driver';
import { Script } from './Script';
import { Argv, ConfigFile } from './types';

@@ -22,3 +22,3 @@ export interface ToolOptions {

}
export default class Tool extends Contract<ToolOptions> {
export declare class Tool extends Contract<ToolOptions> {
config: ConfigFile;

@@ -25,0 +25,0 @@ context?: Context;

@@ -6,6 +6,6 @@ import { ExecaError, ExecaReturnValue } from 'execa';

import { Pluggable } from '@boost/plugin';
import type Context from './contexts/Context';
import type ScriptContext from './contexts/ScriptContext';
import type Tool from './Tool';
export { Arguments, Argv, ParserOptions };
import type { Context } from './contexts/Context';
import type { ScriptContext } from './contexts/ScriptContext';
import type { Tool } from './Tool';
export type { Arguments, Argv, ParserOptions };
export declare type BeemoTool = Tool;

@@ -12,0 +12,0 @@ export interface BeemoProcess<C extends Context = Context> {

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var config = require('@boost/config');

@@ -42,3 +46,3 @@

module.exports = Config;
exports.Config = Config;
//# sourceMappingURL=Config.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var Driver = require('../Driver.js');

@@ -10,3 +14,3 @@

class ConfigContext extends Context {
class ConfigContext extends Context.Context {
constructor(...args) {

@@ -22,3 +26,3 @@ super(...args);

addDriverDependency(driver) {
if (driver instanceof Driver) {
if (driver instanceof Driver.Driver) {
this.drivers.add(driver);

@@ -34,3 +38,3 @@ } else {

module.exports = ConfigContext;
exports.ConfigContext = ConfigContext;
//# sourceMappingURL=ConfigContext.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var camelCase = require('lodash/camelCase');

@@ -63,6 +67,7 @@

let value = defaultValue;
let equals = useEquals;
if (option.includes('=')) {
[option, value] = option.split('=');
useEquals = true;
equals = true;
}

@@ -88,3 +93,3 @@

this.argv.push(option);
} else if (useEquals) {
} else if (equals) {
this.argv.push(`${option}=${value}`);

@@ -156,3 +161,2 @@ } else {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
let opt = this.getOption(name);

@@ -177,3 +181,3 @@

module.exports = Context;
exports.Context = Context;
//# sourceMappingURL=Context.js.map

@@ -5,5 +5,9 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var ConfigContext = require('./ConfigContext.js');
class DriverContext extends ConfigContext {
class DriverContext extends ConfigContext.ConfigContext {
// Name defined on the plugin (kebab case)

@@ -35,3 +39,3 @@ // Nested list of argv for each parallel execution

module.exports = DriverContext;
exports.DriverContext = DriverContext;
//# sourceMappingURL=DriverContext.js.map

@@ -5,5 +5,9 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var Context = require('./Context.js');
class ScaffoldContext extends Context {
class ScaffoldContext extends Context.Context {
constructor(args, generator, action, name = '') {

@@ -21,3 +25,3 @@ super(args);

module.exports = ScaffoldContext;
exports.ScaffoldContext = ScaffoldContext;
//# sourceMappingURL=ScaffoldContext.js.map

@@ -5,5 +5,9 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var Context = require('./Context.js');
class ScriptContext extends Context {
class ScriptContext extends Context.Context {
// Script instance

@@ -29,3 +33,3 @@ // Name passed on the command line and the plugin name (kebab case)

module.exports = ScriptContext;
exports.ScriptContext = ScriptContext;
//# sourceMappingURL=ScriptContext.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var execa = require('execa');

@@ -55,3 +59,3 @@

static validate(driver) {
const name = isClassInstance(driver) && driver.constructor.name || 'Driver';
const name = isClassInstance.isClassInstance(driver) && driver.constructor.name || 'Driver';

@@ -92,3 +96,4 @@ if (!common.isObject(driver.options)) {

if (Array.isArray(prevValue) && Array.isArray(nextValue)) {
return Array.from(new Set(prevValue.concat(nextValue)));
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
return [...new Set([...prevValue, ...nextValue])];
}

@@ -167,3 +172,5 @@

} = this.metadata;
const version = (((_execa__default$defau = execa__default['default'].sync(bin, [versionOption])) == null ? void 0 : _execa__default$defau.stdout) || '').trim();
const version = (((_execa__default$defau = execa__default['default'].sync(bin, [versionOption], {
preferLocal: true
})) == null ? void 0 : _execa__default$defau.stdout) || '').trim();
const match = version.match(/(\d+)\.(\d+)\.(\d+)/u);

@@ -270,3 +277,3 @@ return match ? match[0] : '0.0.0';

module.exports = Driver;
exports.Driver = Driver;
//# sourceMappingURL=Driver.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
function filterArgs(argv, {

@@ -54,3 +58,3 @@ allow,

module.exports = filterArgs;
exports.filterArgs = filterArgs;
//# sourceMappingURL=filterArgs.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
function formatExecReturn(obj) {

@@ -21,3 +25,3 @@ if (!obj || typeof obj !== 'object') {

module.exports = formatExecReturn;
exports.formatExecReturn = formatExecReturn;
//# sourceMappingURL=formatExecReturn.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var common = require('@boost/common');

@@ -12,3 +16,3 @@

module.exports = isClassInstance;
exports.isClassInstance = isClassInstance;
//# sourceMappingURL=isClassInstance.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var micromatch = require('micromatch');

@@ -35,3 +39,3 @@

module.exports = isPatternMatch;
exports.isPatternMatch = isPatternMatch;
//# sourceMappingURL=isPatternMatch.js.map

@@ -11,2 +11,4 @@ // Generated with Packemon: https://packemon.dev

var constants = require('./constants.js');
var ConfigContext = require('./contexts/ConfigContext.js');

@@ -28,6 +30,2 @@

var constants = require('./constants.js');
var args = require('@boost/args');
Object.defineProperty(exports, 'Path', {

@@ -39,10 +37,2 @@ enumerable: true,

});
exports.ConfigContext = ConfigContext;
exports.Context = Context;
exports.DriverContext = DriverContext;
exports.ScaffoldContext = ScaffoldContext;
exports.ScriptContext = ScriptContext;
exports.Driver = Driver;
exports.Script = Script;
exports.Tool = Tool;
exports.EXECUTE_OPTIONS = constants.EXECUTE_OPTIONS;

@@ -56,20 +46,10 @@ exports.KEBAB_PATTERN = constants.KEBAB_PATTERN;

exports.STRATEGY_TEMPLATE = constants.STRATEGY_TEMPLATE;
Object.defineProperty(exports, 'Arguments', {
enumerable: true,
get: function () {
return args.Arguments;
}
});
Object.defineProperty(exports, 'Argv', {
enumerable: true,
get: function () {
return args.Argv;
}
});
Object.defineProperty(exports, 'ParserOptions', {
enumerable: true,
get: function () {
return args.ParserOptions;
}
});
exports.ConfigContext = ConfigContext.ConfigContext;
exports.Context = Context.Context;
exports.DriverContext = DriverContext.DriverContext;
exports.ScaffoldContext = ScaffoldContext.ScaffoldContext;
exports.ScriptContext = ScriptContext.ScriptContext;
exports.Driver = Driver.Driver;
exports.Script = Script.Script;
exports.Tool = Tool.Tool;
//# sourceMappingURL=index.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');

@@ -35,3 +39,3 @@

execute(context) {
async execute(context) {
return this.createWaterfallPipeline(context).pipe(this.options.tool.msg('app:configCleanup'), this.deleteConfigFiles).run();

@@ -53,3 +57,3 @@ }

}, _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "deleteConfigFiles", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "deleteConfigFiles"), _class.prototype), _class));
module.exports = CleanupConfigsRoutine;
exports.CleanupConfigsRoutine = CleanupConfigsRoutine;
//# sourceMappingURL=CleanupConfigsRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');

@@ -40,3 +44,3 @@

// @ts-expect-error Errors because Driver is abstract
driver: instance(Driver).required().notNullable(),
driver: instance(Driver.Driver).required().notNullable(),
tool: instance().required().notNullable()

@@ -46,3 +50,3 @@ };

execute(context) {
async execute(context) {
const {

@@ -270,3 +274,3 @@ driver,

mergeConfigs(context, configs) {
async mergeConfigs(context, configs) {
const {

@@ -301,3 +305,3 @@ driver

loadConfigFromConsumer(context, prevConfigs) {
async loadConfigFromConsumer(context, prevConfigs) {
const sourcePath = this.getConfigPath(context, true);

@@ -319,3 +323,3 @@ const configs = [...prevConfigs];

loadConfigFromProvider(context, prevConfigs) {
async loadConfigFromProvider(context, prevConfigs) {
const sourcePath = this.getConfigPath(context);

@@ -374,7 +378,7 @@ const configs = [...prevConfigs];

});
return Promise.resolve(configs);
return configs;
}
}, (_rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "copyConfigFile", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "copyConfigFile"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "createConfigFile", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "createConfigFile"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "createConfigFileFromTemplate", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "createConfigFileFromTemplate"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "mergeConfigs", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, "mergeConfigs"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "loadConfigFromConsumer", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, "loadConfigFromConsumer"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "loadConfigFromProvider", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, "loadConfigFromProvider"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "referenceConfigFile", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, "referenceConfigFile"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "setEnvVars", [_dec8], Object.getOwnPropertyDescriptor(_class.prototype, "setEnvVars"), _class.prototype)), _class));
module.exports = CreateConfigRoutine;
exports.CreateConfigRoutine = CreateConfigRoutine;
//# sourceMappingURL=CreateConfigRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');

@@ -65,3 +69,3 @@

execute(context) {
async execute(context) {
const {

@@ -128,6 +132,6 @@ tool

stream.stdout.pipe(new BatchStream({
stream.stdout.pipe(new BatchStream.BatchStream({
wait
})).on('data', handler);
stream.stderr.pipe(new BatchStream({
stream.stderr.pipe(new BatchStream.BatchStream({
wait

@@ -178,3 +182,3 @@ })).on('data', handler);

argv.forEach(arg => {
if (arg.charAt(0) !== '-' && isGlob__default['default'](arg)) {
if (!arg.startsWith('-') && isGlob__default['default'](arg)) {
const paths = glob__default['default'].sync(arg, {

@@ -199,2 +203,4 @@ cwd: String(context.cwd),

async extractNativeOptions(context) {
var _stdout$match;
const driver = context.primaryDriver;

@@ -219,6 +225,7 @@ const {

} = await this.executeCommand(driver.metadata.bin, driver.metadata.helpOption.split(' '), {
env
env,
preferLocal: true
});
const nativeOptions = {};
const matches = stdout.match(OPTION_PATTERN) || [];
const matches = (_stdout$match = stdout.match(OPTION_PATTERN)) != null ? _stdout$match : [];
matches.forEach(option => {

@@ -242,3 +249,3 @@ // Trim trailing comma or space

unknownArgv
} = filterArgs(argv, {
} = filterArgs.filterArgs(argv, {
allow: nativeOptions

@@ -340,6 +347,7 @@ });

env: driver.options.env,
preferLocal: true,
workUnit,
wrap: stream => this.captureOutput(context, stream)
});
this.debug(' Success: %o', formatExecReturn(result));
this.debug(' Success: %o', formatExecReturn.formatExecReturn(result));
driver.processSuccess(result);

@@ -350,3 +358,3 @@ await driver.onAfterExecute.emit([context, result]);

const result = error;
this.debug(' Failure: %o', formatExecReturn(result));
this.debug(' Failure: %o', formatExecReturn.formatExecReturn(result));
this.debug(' Error message: %s', internal.color.fail(result.message));

@@ -368,3 +376,3 @@

throw result.exitCode === null && result.signal === 'SIGKILL' ? new common.ExitError('Out of memory!', 1) : new common.ExitError((driver.extractErrorMessage(result) || '').trim(), error.exitCode);
throw result.exitCode === null && result.signal === 'SIGKILL' ? new common.ExitError('Out of memory!', 1) : new common.ExitError((driver.extractErrorMessage(result) || '').trim(), result.exitCode);
}

@@ -374,3 +382,3 @@ }

}, (_rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "captureOutput", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "captureOutput"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "copyConfigToWorkspacePackage", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "copyConfigToWorkspacePackage"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "expandGlobPatterns", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "expandGlobPatterns"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "filterUnknownOptions", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, "filterUnknownOptions"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "gatherArgs", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, "gatherArgs"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "includeConfigOption", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, "includeConfigOption"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "runCommandWithArgs", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, "runCommandWithArgs"), _class.prototype)), _class));
module.exports = ExecuteCommandRoutine;
exports.ExecuteCommandRoutine = ExecuteCommandRoutine;
//# sourceMappingURL=ExecuteCommandRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var internal = require('@boost/internal');

@@ -44,3 +48,3 @@

names.push(driver.getName());
return new CreateConfigRoutine(driver.getName(), driver.metadata.configName, {
return new CreateConfigRoutine.CreateConfigRoutine(driver.getName(), driver.metadata.configName, {
driver,

@@ -77,3 +81,3 @@ tool: this.options.tool

tool.onResolveDependencies.emit([context, Array.from(context.drivers)]);
tool.onResolveDependencies.emit([context, [...context.drivers]]);
}

@@ -83,3 +87,3 @@

module.exports = ResolveConfigsRoutine;
exports.ResolveConfigsRoutine = ResolveConfigsRoutine;
//# sourceMappingURL=ResolveConfigsRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var constants = require('../constants.js');

@@ -14,3 +18,3 @@

class ExecuteDriverRoutine extends RunInWorkspacesRoutine {
class RunDriverRoutine extends RunInWorkspacesRoutine.RunInWorkspacesRoutine {
pipeRoutine(context, packageName, packageRoot) {

@@ -40,3 +44,3 @@ if (packageName) {

filteredArgv
} = filterArgs(argv, {
} = filterArgs.filterArgs(argv, {
block: constants.EXECUTE_OPTIONS

@@ -51,3 +55,3 @@ }); // Remove the driver name from `beemo <name>` since it

const command = `${primaryDriver.metadata.bin} ${filteredArgv.join(' ')}`.trim();
this.routines.push(new ExecuteCommandRoutine(key, command, { ...options,
this.routines.push(new ExecuteCommandRoutine.ExecuteCommandRoutine(key, command, { ...options,
argv: filteredArgv,

@@ -57,3 +61,3 @@ tool: this.options.tool

parallelArgv.forEach(pargv => {
this.routines.push(new ExecuteCommandRoutine(key, `${command} ${pargv.join(' ')}`.trim(), { ...options,
this.routines.push(new ExecuteCommandRoutine.ExecuteCommandRoutine(key, `${command} ${pargv.join(' ')}`.trim(), { ...options,
additionalArgv: pargv,

@@ -68,3 +72,3 @@ argv: filteredArgv,

module.exports = ExecuteDriverRoutine;
exports.RunDriverRoutine = RunDriverRoutine;
//# sourceMappingURL=RunDriverRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var common = require('@boost/common');

@@ -59,3 +63,3 @@

const allResults = [];
const concurrency = context.args.options.concurrency || tool.config.execute.concurrency || undefined; // eslint-disable-next-line no-restricted-syntax
const concurrency = context.args.options.concurrency || tool.config.execute.concurrency || undefined;

@@ -129,3 +133,3 @@ for (const batch of batches) {

getFilteredWorkspacePackages(context) {
return this.workspacePackages.filter(pkg => isPatternMatch(pkg.package.name, context.args.options.workspaces));
return this.workspacePackages.filter(pkg => isPatternMatch.isPatternMatch(pkg.package.name, context.args.options.workspaces));
}

@@ -180,3 +184,3 @@ /**

module.exports = RunInWorkspacesRoutine;
exports.RunInWorkspacesRoutine = RunInWorkspacesRoutine;
//# sourceMappingURL=RunInWorkspacesRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');

@@ -32,5 +36,5 @@

var _dec, _dec2, _dec3, _class, _temp;
var _dec, _dec2, _dec3, _class;
let RunScriptRoutine = (_dec = common.Bind(), _dec2 = common.Bind(), _dec3 = common.Bind(), (_class = (_temp = class RunScriptRoutine extends RunInWorkspacesRoutine {
let RunScriptRoutine = (_dec = common.Bind(), _dec2 = common.Bind(), _dec3 = common.Bind(), (_class = class RunScriptRoutine extends RunInWorkspacesRoutine.RunInWorkspacesRoutine {
constructor(...args) {

@@ -41,3 +45,3 @@ super(...args);

getInitialValue(context) {
async getInitialValue(context) {
const {

@@ -57,3 +61,3 @@ tool

filteredArgv
} = filterArgs(argv, {
} = filterArgs.filterArgs(argv, {
block: constants.EXECUTE_OPTIONS

@@ -64,3 +68,3 @@ });

if (packageName) {
this.routines.push(new ExecuteScriptRoutine(packageName, command, {
this.routines.push(new ExecuteScriptRoutine.ExecuteScriptRoutine(packageName, command, {
packageRoot,

@@ -70,3 +74,3 @@ tool: this.options.tool

} else {
this.routines.push(new ExecuteScriptRoutine(scriptName, command, {
this.routines.push(new ExecuteScriptRoutine.ExecuteScriptRoutine(scriptName, command, {
packageRoot: cwd.path(),

@@ -91,5 +95,8 @@ tool: this.options.tool

} catch (error) {
this.errors.push(new Error(this.options.tool.msg('app:fromTool', {
message: error.message
})));
if (common.instanceOf(error, Error)) {
this.errors.push(new Error(this.options.tool.msg('app:fromTool', {
message: error.message
})));
}
return null;

@@ -128,11 +135,14 @@ }

} = resolver.resolve();
script = await tool.scriptRegistry.load(resolvedPath.path());
context.setScript(script);
const loadedScript = await tool.scriptRegistry.load(resolvedPath.path());
context.setScript(loadedScript);
return loadedScript;
} catch (error) {
this.errors.push(new Error(tool.msg('app:fromModule', {
message: error.message
})));
if (common.instanceOf(error, Error)) {
this.errors.push(new Error(tool.msg('app:fromModule', {
message: error.message
})));
}
return null;
}
return script || null;
}

@@ -155,4 +165,4 @@ /**

}, _temp), (_rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "loadScriptFromTool", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "loadScriptFromTool"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "loadScriptFromModule", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "loadScriptFromModule"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "postLoad", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "postLoad"), _class.prototype)), _class));
module.exports = RunScriptRoutine;
}, (_rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "loadScriptFromTool", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "loadScriptFromTool"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "loadScriptFromModule", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "loadScriptFromModule"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "postLoad", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "postLoad"), _class.prototype)), _class));
exports.RunScriptRoutine = RunScriptRoutine;
//# sourceMappingURL=RunScriptRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');

@@ -16,5 +20,5 @@

var _dec, _class, _temp;
var _dec, _class;
let ScaffoldRoutine = (_dec = common.Bind(), (_class = (_temp = class ScaffoldRoutine extends pipeline.Routine {
let ScaffoldRoutine = (_dec = common.Bind(), (_class = class ScaffoldRoutine extends pipeline.Routine {
constructor(...args) {

@@ -25,2 +29,3 @@ super(...args);

input,
preferLocal: true,
shell: true

@@ -45,3 +50,3 @@ });

execute(context) {
async execute(context) {
return this.createWaterfallPipeline(context).pipe(this.options.tool.msg('app:scaffoldRunGenerator'), this.runGenerator).run();

@@ -73,3 +78,3 @@ }

// Intercept hygen error to provide a better error message
if (error.message.startsWith("I can't find action")) {
if (common.instanceOf(error, Error) && error.message.startsWith("I can't find action")) {
throw new Error(tool.msg('errors:scaffoldNoTemplates', {

@@ -88,4 +93,4 @@ path: args.join('/')

}, _temp), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "runGenerator", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "runGenerator"), _class.prototype), _class));
module.exports = ScaffoldRoutine;
}, _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "runGenerator", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "runGenerator"), _class.prototype), _class));
exports.ScaffoldRoutine = ScaffoldRoutine;
//# sourceMappingURL=ScaffoldRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var args = require('@boost/args');

@@ -50,8 +54,11 @@

result = await script.execute(context, args$1);
this.debug(' Success: %o', formatExecReturn(result));
this.debug(' Success: %o', formatExecReturn.formatExecReturn(result));
await script.onAfterExecute.emit([context, result]);
} catch (error) {
this.debug(' Failure: %o', formatExecReturn(error));
this.debug(' Error message: %s', error.message);
await script.onFailedExecute.emit([context, error]);
if (common.instanceOf(error, Error)) {
this.debug(' Failure: %o', formatExecReturn.formatExecReturn(error));
this.debug(' Error message: %s', error.message);
await script.onFailedExecute.emit([context, error]);
}
throw error;

@@ -65,3 +72,3 @@ }

module.exports = ExecuteScriptRoutine;
exports.ExecuteScriptRoutine = ExecuteScriptRoutine;
//# sourceMappingURL=ExecuteScriptRoutine.js.map

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var execa = require('execa');

@@ -32,3 +36,3 @@

static validate(script) {
const name = isClassInstance(script) && script.constructor.name || 'Script';
const name = isClassInstance.isClassInstance(script) && script.constructor.name || 'Script';

@@ -73,3 +77,6 @@ if (typeof script.parse !== 'function') {

{
return execa__default['default'](command, args, options);
return execa__default['default'](command, args, {
preferLocal: true,
...options
});
}

@@ -83,3 +90,3 @@ /**

module.exports = Script;
exports.Script = Script;
//# sourceMappingURL=Script.js.map

@@ -5,4 +5,8 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var stream = require('stream');
/* eslint-disable no-underscore-dangle */
/* eslint-disable promise/prefer-await-to-callbacks */

@@ -14,2 +18,4 @@

constructor(options = {}) {
var _options$wait;
super();

@@ -19,3 +25,3 @@ this.bufferedBatch = null;

this.waitThreshold = 0;
this.waitThreshold = options.wait || WAIT_THRESHOLD;
this.waitThreshold = (_options$wait = options.wait) != null ? _options$wait : WAIT_THRESHOLD;
}

@@ -36,7 +42,3 @@

_transform(chunk, encoding, callback) {
if (this.bufferedBatch) {
this.bufferedBatch = Buffer.concat([this.bufferedBatch, chunk]);
} else {
this.bufferedBatch = chunk;
}
this.bufferedBatch = this.bufferedBatch ? Buffer.concat([this.bufferedBatch, chunk]) : chunk;

@@ -60,3 +62,3 @@ if (this.timeout) {

module.exports = BatchStream;
exports.BatchStream = BatchStream;
//# sourceMappingURL=BatchStream.js.map

@@ -5,2 +5,4 @@ // Generated with Packemon: https://packemon.dev

var _process$env$BEEMO_TE;
Object.defineProperty(exports, '__esModule', {

@@ -15,7 +17,5 @@ value: true

var index_ts = require('./index.js');
/* eslint-disable unicorn/import-index */
const TEST_ROOT = new common.Path((_process$env$BEEMO_TE = process.env.BEEMO_TEST_ROOT) != null ? _process$env$BEEMO_TE : process.cwd());
const TEST_ROOT = new common.Path(process.env.BEEMO_TEST_ROOT || process.cwd());
class TestDriver extends index_ts.Driver {

@@ -78,3 +78,3 @@ constructor(...args) {

driver.name = name;
driver.tool = tool || mockTool();
driver.tool = tool != null ? tool : mockTool();
driver.setMetadata({

@@ -93,3 +93,3 @@ bin: name.toLowerCase(),

script.name = name;
script.tool = tool || mockTool();
script.tool = tool != null ? tool : mockTool();
return script;

@@ -158,3 +158,3 @@ }

function stubDriverContext(driver) {
return applyContext(new index_ts.DriverContext(stubDriverArgs(), driver || new TestDriver()));
return applyContext(new index_ts.DriverContext(stubDriverArgs(), driver != null ? driver : new TestDriver()));
}

@@ -161,0 +161,0 @@

@@ -5,2 +5,6 @@ // Generated with Packemon: https://packemon.dev

Object.defineProperty(exports, '__esModule', {
value: true
});
var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');

@@ -58,5 +62,5 @@

var _dec, _dec2, _class, _temp;
var _dec, _dec2, _class;
let Tool = (_dec = common.Memoize(), _dec2 = common.Bind(), (_class = (_temp = class Tool extends common.Contract {
let Tool = (_dec = common.Memoize(), _dec2 = common.Bind(), (_class = class Tool extends common.Contract {
constructor(options) {

@@ -82,14 +86,13 @@ super(options);

this.cwd = common.Path.create(this.options.cwd);
this.debug = debug.createDebugger('core'); // eslint-disable-next-line global-require
this.debug = debug.createDebugger('core');
this.debug('Using beemo v%s', require('../package.json').version);
this.msg = translate.createTranslator(['app', 'common', 'errors'], [new common.Path(__dirname, '../resources'), ...this.options.resourcePaths]);
this.driverRegistry = new plugin.Registry('beemo', 'driver', {
validate: Driver.validate
validate: Driver.Driver.validate
});
this.scriptRegistry = new plugin.Registry('beemo', 'script', {
validate: Script.validate
validate: Script.Script.validate
});
this.project = new common.Project(this.cwd);
this.configManager = new Config(this.options.projectName);
this.configManager = new Config.Config(this.options.projectName);
}

@@ -134,3 +137,3 @@

async bootstrapConfigModule() {
var _bootstrapModule, _bootstrapModule2;
var _ref, _bootstrapModule$boot, _bootstrapModule, _bootstrapModule2;

@@ -160,3 +163,3 @@ this.debug('Bootstrapping configuration module');

const bootstrap = ((_bootstrapModule = bootstrapModule) == null ? void 0 : _bootstrapModule.bootstrap) || ((_bootstrapModule2 = bootstrapModule) == null ? void 0 : _bootstrapModule2.default) || bootstrapModule;
const bootstrap = (_ref = (_bootstrapModule$boot = (_bootstrapModule = bootstrapModule) == null ? void 0 : _bootstrapModule.bootstrap) != null ? _bootstrapModule$boot : (_bootstrapModule2 = bootstrapModule) == null ? void 0 : _bootstrapModule2.default) != null ? _ref : bootstrapModule;
const isFunction = typeof bootstrap === 'function';

@@ -233,3 +236,3 @@ this.debug.invariant(isFunction, 'Executing bootstrap function', 'Found', 'Not found');

createConfigurePipeline(args, driverNames = []) {
const context = this.prepareContext(new ConfigContext(args)); // Create for all enabled drivers
const context = this.prepareContext(new ConfigContext.ConfigContext(args)); // Create for all enabled drivers

@@ -250,3 +253,3 @@ if (driverNames.length === 0) {

this.onRunCreateConfig.emit([context, driverNames]);
return new pipeline.WaterfallPipeline(context).pipe(new ResolveConfigsRoutine('config', this.msg('app:configGenerate'), {
return new pipeline.WaterfallPipeline(context).pipe(new ResolveConfigsRoutine.ResolveConfigsRoutine('config', this.msg('app:configGenerate'), {
tool: this

@@ -262,9 +265,9 @@ }));

const driver = this.driverRegistry.get(driverName);
const context = this.prepareContext(new DriverContext(args, driver, parallelArgv));
const context = this.prepareContext(new DriverContext.DriverContext(args, driver, parallelArgv));
const version = driver.getVersion();
this.onRunDriver.emit([context, driver], driverName);
this.debug('Running with %s v%s driver', driverName, version);
return new pipeline.WaterfallPipeline(context, driverName).pipe(new ResolveConfigsRoutine('config', this.msg('app:configGenerate'), {
return new pipeline.WaterfallPipeline(context, driverName).pipe(new ResolveConfigsRoutine.ResolveConfigsRoutine('config', this.msg('app:configGenerate'), {
tool: this
})).pipe(new RunDriverRoutine('driver', this.msg('app:driverRun', {
})).pipe(new RunDriverRoutine.RunDriverRoutine('driver', this.msg('app:driverRun', {
name: driver.metadata.title,

@@ -274,3 +277,3 @@ version

tool: this
})).pipe(new CleanupConfigsRoutine('cleanup', this.msg('app:cleanup'), {
})).pipe(new CleanupConfigsRoutine.CleanupConfigsRoutine('cleanup', this.msg('app:cleanup'), {
tool: this

@@ -290,6 +293,6 @@ }) // Only add cleanup routine if we need it

const context = this.prepareContext(new ScriptContext(args, scriptName));
const context = this.prepareContext(new ScriptContext.ScriptContext(args, scriptName));
this.onRunScript.emit([context], scriptName);
this.debug('Running with %s script', context.scriptName);
return new pipeline.WaterfallPipeline(context).pipe(new RunScriptRoutine('script', this.msg('app:scriptRun', {
return new pipeline.WaterfallPipeline(context).pipe(new RunScriptRoutine.RunScriptRoutine('script', this.msg('app:scriptRun', {
name: scriptName

@@ -306,6 +309,6 @@ }), {

createScaffoldPipeline(args, generator, action, name = '') {
const context = this.prepareContext(new ScaffoldContext(args, generator, action, name));
const context = this.prepareContext(new ScaffoldContext.ScaffoldContext(args, generator, action, name));
this.onRunScaffold.emit([context, generator, action, name]);
this.debug('Creating scaffold pipeline');
return new pipeline.WaterfallPipeline(context).pipe(new ScaffoldRoutine('scaffold', this.msg('app:scaffoldGenerate'), {
return new pipeline.WaterfallPipeline(context).pipe(new ScaffoldRoutine.ScaffoldRoutine('scaffold', this.msg('app:scaffoldGenerate'), {
tool: this

@@ -335,4 +338,4 @@ }));

}, _temp), (_rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "getConfigModuleRoot", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getConfigModuleRoot"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "cleanupOnFailure", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "cleanupOnFailure"), _class.prototype)), _class));
module.exports = Tool;
}, (_rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "getConfigModuleRoot", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getConfigModuleRoot"), _class.prototype), _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "cleanupOnFailure", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "cleanupOnFailure"), _class.prototype)), _class));
exports.Tool = Tool;
//# sourceMappingURL=Tool.js.map
{
"name": "@beemo/core",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"release": "1614239076609",

@@ -57,3 +57,3 @@ "description": "Manage all dev tool configurations in a single centralized repository.",

"fs-extra": "^9.1.0",
"hygen": "^6.0.4",
"hygen": "^6.1.0",
"is-glob": "^4.0.1",

@@ -78,3 +78,3 @@ "lodash": "^4.17.21",

},
"gitHead": "e5c78a11557af3cab63e27b23623cfc446260ced"
"gitHead": "2fd4279c0f781ff82062d28ac2656c63383390d2"
}

@@ -5,3 +5,3 @@ import { Blueprint, Predicates } from '@boost/common';

export default class Config extends Configuration<ConfigFile> {
export class Config extends Configuration<ConfigFile> {
blueprint(predicates: Predicates, onConstruction: boolean): Blueprint<ConfigFile> {

@@ -8,0 +8,0 @@ const { bool, number, object, shape, string } = predicates;

@@ -1,5 +0,5 @@

import Driver from '../Driver';
import Context from './Context';
import { Driver } from '../Driver';
import { Context } from './Context';
export default class ConfigContext<O extends object = {}> extends Context<O, string[]> {
export class ConfigContext<O extends object = {}> extends Context<O, string[]> {
// List of drivers involved in the current pipeline

@@ -6,0 +6,0 @@ drivers: Set<Driver> = new Set();

@@ -13,3 +13,3 @@ import camelCase from 'lodash/camelCase';

export default class Context<
export class Context<
O extends object = {},

@@ -65,6 +65,7 @@ P extends PrimitiveType[] = PrimitiveType[]

let value = defaultValue;
let equals = useEquals;
if (option.includes('=')) {
[option, value] = option.split('=');
useEquals = true;
equals = true;
}

@@ -90,3 +91,3 @@

this.argv.push(option);
} else if (useEquals) {
} else if (equals) {
this.argv.push(`${option}=${value}`);

@@ -153,4 +154,3 @@ } else {

getRiskyOption(name: string, raw: boolean = false): PrimitiveType | null {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let opt: any = this.getOption(name as keyof O);
let opt = (this.getOption(name as keyof O) as unknown) as PrimitiveType;

@@ -157,0 +157,0 @@ if (opt !== null) {

@@ -1,4 +0,4 @@

import Driver from '../Driver';
import { Driver } from '../Driver';
import { Arguments, Argv, StdioType } from '../types';
import ConfigContext from './ConfigContext';
import { ConfigContext } from './ConfigContext';

@@ -14,3 +14,3 @@ export interface DriverContextOptions {

export default class DriverContext<
export class DriverContext<
O extends DriverContextOptions = DriverContextOptions

@@ -17,0 +17,0 @@ > extends ConfigContext<O> {

import { Arguments } from '../types';
import Context from './Context';
import { Context } from './Context';

@@ -10,6 +10,3 @@ export interface ScaffoldContextOptions {

export default class ScaffoldContext extends Context<
ScaffoldContextOptions,
ScaffoldContextParams
> {
export class ScaffoldContext extends Context<ScaffoldContextOptions, ScaffoldContextParams> {
action: string;

@@ -16,0 +13,0 @@

@@ -1,4 +0,4 @@

import Script from '../Script';
import { Script } from '../Script';
import { Arguments, StdioType } from '../types';
import Context from './Context';
import { Context } from './Context';

@@ -14,3 +14,3 @@ export interface ScriptContextOptions {

export default class ScriptContext extends Context<ScriptContextOptions, ScriptContextParams> {
export class ScriptContext extends Context<ScriptContextOptions, ScriptContextParams> {
// Script instance

@@ -17,0 +17,0 @@ script: Script | null = null;

@@ -15,5 +15,5 @@ import execa from 'execa';

} from './constants';
import ConfigContext from './contexts/ConfigContext';
import DriverContext from './contexts/DriverContext';
import isClassInstance from './helpers/isClassInstance';
import { ConfigContext } from './contexts/ConfigContext';
import { DriverContext } from './contexts/DriverContext';
import { isClassInstance } from './helpers/isClassInstance';
import {

@@ -34,3 +34,3 @@ Argv,

export default abstract class Driver<
export abstract class Driver<
Config extends object = {},

@@ -122,3 +122,4 @@ Options extends DriverOptions = DriverOptions

if (Array.isArray(prevValue) && Array.isArray(nextValue)) {
return Array.from(new Set(prevValue.concat(nextValue)));
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
return [...new Set([...prevValue, ...nextValue])] as unknown;
}

@@ -160,3 +161,3 @@

getArgs(): Argv {
return Array.isArray(this.options.args) ? this.options.args : [];
return (Array.isArray(this.options.args) ? this.options.args : []) as Argv;
}

@@ -192,3 +193,3 @@

const { bin, versionOption } = this.metadata;
const version = (execa.sync(bin, [versionOption])?.stdout || '').trim();
const version = (execa.sync(bin, [versionOption], { preferLocal: true })?.stdout || '').trim();
const match = version.match(/(\d+)\.(\d+)\.(\d+)/u);

@@ -195,0 +196,0 @@

import { Argv } from '../types';
export interface OptionMap {
[option: string]: boolean;
}
export type OptionMap = Record<string, boolean>;

@@ -12,3 +10,3 @@ export interface FilterArgOptions {

export default function filterArgs(argv: Argv, { allow, block }: FilterArgOptions) {
export function filterArgs(argv: Argv, { allow, block }: FilterArgOptions) {
const filteredArgv: Argv = [];

@@ -15,0 +13,0 @@ const unknownArgv: Argv = [];

@@ -7,3 +7,3 @@ export interface ExecLike {

export default function formatExecReturn<T extends ExecLike>(
export function formatExecReturn<T extends ExecLike>(
obj: T,

@@ -10,0 +10,0 @@ ): Pick<T, Exclude<keyof T, 'command' | 'stderr' | 'stdout'>> {

import { isObject } from '@boost/common';
export default function isClassInstance<T>(value: unknown): value is T {
export function isClassInstance<T>(value: unknown): value is T {
return isObject(value) && value.constructor !== Object;
}
import micromatch from 'micromatch';
export default function isPatternMatch(
export function isPatternMatch(
string: string,

@@ -5,0 +5,0 @@ pattern: string,

@@ -7,40 +7,15 @@ /**

import { Blueprint, PackageStructure, Path, PortablePath, Predicates } from '@boost/common';
import ConfigContext from './contexts/ConfigContext';
import Context from './contexts/Context';
import DriverContext, { DriverContextOptions, DriverContextParams } from './contexts/DriverContext';
import ScaffoldContext, {
ScaffoldContextOptions,
ScaffoldContextParams,
} from './contexts/ScaffoldContext';
import ScriptContext, { ScriptContextOptions, ScriptContextParams } from './contexts/ScriptContext';
import Driver from './Driver';
import Script from './Script';
import Tool from './Tool';
export {
ConfigContext,
Context,
Driver,
DriverContext,
Path,
ScaffoldContext,
Script,
ScriptContext,
Tool,
};
export type {
Blueprint,
DriverContextOptions,
DriverContextParams,
PackageStructure,
PortablePath,
Predicates,
ScaffoldContextOptions,
ScaffoldContextParams,
ScriptContextOptions,
ScriptContextParams,
};
export * from './constants';
export * from './contexts/ConfigContext';
export * from './contexts/Context';
export * from './contexts/DriverContext';
export * from './contexts/ScaffoldContext';
export * from './contexts/ScriptContext';
export * from './Driver';
export * from './Script';
export * from './Tool';
export * from './types';
export { Path };
export type { Blueprint, PackageStructure, PortablePath, Predicates };

@@ -7,7 +7,7 @@ /* eslint-disable @typescript-eslint/member-ordering */

import { Routine } from '@boost/pipeline';
import DriverContext from '../contexts/DriverContext';
import type Tool from '../Tool';
import { DriverContext } from '../contexts/DriverContext';
import type { Tool } from '../Tool';
import { RoutineOptions } from '../types';
export default class CleanupConfigsRoutine extends Routine<unknown, unknown, RoutineOptions> {
export class CleanupConfigsRoutine extends Routine<unknown, unknown, RoutineOptions> {
blueprint({ instance }: Predicates): Blueprint<RoutineOptions> {

@@ -19,3 +19,3 @@ return {

execute(context: DriverContext) {
async execute(context: DriverContext) {
return this.createWaterfallPipeline(context)

@@ -22,0 +22,0 @@ .pipe(this.options.tool.msg('app:configCleanup'), this.deleteConfigFiles)

@@ -15,5 +15,5 @@ /* eslint-disable @typescript-eslint/member-ordering */

} from '../constants';
import ConfigContext from '../contexts/ConfigContext';
import Driver from '../Driver';
import type Tool from '../Tool';
import { ConfigContext } from '../contexts/ConfigContext';
import { Driver } from '../Driver';
import type { Tool } from '../Tool';
import { ConfigObject, ConfigTemplate, RoutineOptions } from '../types';

@@ -25,3 +25,3 @@

export default class CreateConfigRoutine<Ctx extends ConfigContext> extends Routine<
export class CreateConfigRoutine<Ctx extends ConfigContext> extends Routine<
Path,

@@ -39,3 +39,3 @@ unknown,

execute(context: Ctx): Promise<Path> {
async execute(context: Ctx): Promise<Path> {
const { driver, tool } = this.options;

@@ -269,3 +269,3 @@ const { metadata, options } = driver;

@Bind()
mergeConfigs(context: Ctx, configs: ConfigObject[]): Promise<ConfigObject> {
async mergeConfigs(context: Ctx, configs: ConfigObject[]): Promise<ConfigObject> {
const { driver } = this.options;

@@ -306,3 +306,3 @@

@Bind()
loadConfigFromConsumer(context: Ctx, prevConfigs: ConfigObject[]): Promise<ConfigObject[]> {
async loadConfigFromConsumer(context: Ctx, prevConfigs: ConfigObject[]): Promise<ConfigObject[]> {
const sourcePath = this.getConfigPath(context, true);

@@ -326,3 +326,3 @@ const configs = [...prevConfigs];

@Bind()
loadConfigFromProvider(context: Ctx, prevConfigs: ConfigObject[]): Promise<ConfigObject[]> {
async loadConfigFromProvider(context: Ctx, prevConfigs: ConfigObject[]): Promise<ConfigObject[]> {
const sourcePath = this.getConfigPath(context);

@@ -376,3 +376,3 @@ const configs = [...prevConfigs];

@Bind()
setEnvVars(context: Ctx, configs: ConfigObject[]): Promise<ConfigObject[]> {
setEnvVars(context: Ctx, configs: ConfigObject[]): ConfigObject[] {
const { env } = this.options.driver.options;

@@ -385,4 +385,4 @@

return Promise.resolve(configs);
return configs;
}
}

@@ -13,7 +13,7 @@ /* eslint-disable @typescript-eslint/member-ordering */

import { STRATEGY_COPY } from '../../constants';
import DriverContext from '../../contexts/DriverContext';
import filterArgs, { OptionMap } from '../../helpers/filterArgs';
import formatExecReturn from '../../helpers/formatExecReturn';
import BatchStream from '../../streams/BatchStream';
import type Tool from '../../Tool';
import { DriverContext } from '../../contexts/DriverContext';
import { filterArgs, OptionMap } from '../../helpers/filterArgs';
import { formatExecReturn } from '../../helpers/formatExecReturn';
import { BatchStream } from '../../streams/BatchStream';
import type { Tool } from '../../Tool';
import { Argv, Execution, RoutineOptions } from '../../types';

@@ -30,7 +30,3 @@

export default class ExecuteCommandRoutine extends Routine<
unknown,
unknown,
ExecuteCommandOptions
> {
export class ExecuteCommandRoutine extends Routine<unknown, unknown, ExecuteCommandOptions> {
blueprint({ array, bool, instance, string }: Predicates): Blueprint<ExecuteCommandOptions> {

@@ -46,3 +42,3 @@ return {

execute(context: DriverContext) {
async execute(context: DriverContext) {
const { tool } = this.options;

@@ -157,3 +153,3 @@ const { forceConfigOption, packageRoot } = this.options;

argv.forEach((arg) => {
if (arg.charAt(0) !== '-' && isGlob(arg)) {
if (!arg.startsWith('-') && isGlob(arg)) {
const paths = glob

@@ -210,2 +206,3 @@ .sync(arg, {

env,
preferLocal: true,
},

@@ -215,3 +212,3 @@ );

const nativeOptions: OptionMap = {};
const matches = stdout.match(OPTION_PATTERN) || [];
const matches = stdout.match(OPTION_PATTERN) ?? [];

@@ -359,2 +356,3 @@ matches.forEach((option) => {

env: driver.options.env,
preferLocal: true,
workUnit,

@@ -371,3 +369,3 @@ wrap: (stream) => this.captureOutput(context, stream),

return result;
} catch (error) {
} catch (error: unknown) {
const result = error as ExecaError;

@@ -396,5 +394,5 @@

? new ExitError('Out of memory!', 1)
: new ExitError((driver.extractErrorMessage(result) || '').trim(), error.exitCode);
: new ExitError((driver.extractErrorMessage(result) || '').trim(), result.exitCode);
}
}
}
import { Blueprint, Path, Predicates } from '@boost/common';
import { color } from '@boost/internal';
import { Routine } from '@boost/pipeline';
import ConfigContext from '../contexts/ConfigContext';
import type Tool from '../Tool';
import { ConfigContext } from '../contexts/ConfigContext';
import type { Tool } from '../Tool';
import { RoutineOptions } from '../types';
import CreateConfigRoutine from './CreateConfigRoutine';
import { CreateConfigRoutine } from './CreateConfigRoutine';
export default class ResolveConfigsRoutine<
Ctx extends ConfigContext = ConfigContext
> extends Routine<Path[], unknown, RoutineOptions> {
export class ResolveConfigsRoutine<Ctx extends ConfigContext = ConfigContext> extends Routine<
Path[],
unknown,
RoutineOptions
> {
blueprint({ instance }: Predicates): Blueprint<RoutineOptions> {

@@ -90,4 +92,4 @@ return {

tool.onResolveDependencies.emit([context, Array.from(context.drivers)]);
tool.onResolveDependencies.emit([context, [...context.drivers]]);
}
}
import { EXECUTE_OPTIONS } from '../constants';
import DriverContext from '../contexts/DriverContext';
import filterArgs from '../helpers/filterArgs';
import ExecuteCommandRoutine, { ExecuteCommandOptions } from './driver/ExecuteCommandRoutine';
import RunInWorkspacesRoutine from './RunInWorkspacesRoutine';
import { DriverContext } from '../contexts/DriverContext';
import { filterArgs } from '../helpers/filterArgs';
import { ExecuteCommandOptions, ExecuteCommandRoutine } from './driver/ExecuteCommandRoutine';
import { RunInWorkspacesRoutine } from './RunInWorkspacesRoutine';
export default class ExecuteDriverRoutine extends RunInWorkspacesRoutine<DriverContext> {
export class RunDriverRoutine extends RunInWorkspacesRoutine<DriverContext> {
pipeRoutine(context: DriverContext, packageName?: string, packageRoot?: string) {

@@ -9,0 +9,0 @@ if (packageName) {

@@ -10,5 +10,5 @@ import {

import { stripAnsi, style } from '@boost/terminal';
import Context from '../contexts/Context';
import isPatternMatch from '../helpers/isPatternMatch';
import type Tool from '../Tool';
import { Context } from '../contexts/Context';
import { isPatternMatch } from '../helpers/isPatternMatch';
import type { Tool } from '../Tool';
import { ExecutionError, RoutineOptions } from '../types';

@@ -27,3 +27,3 @@

export default abstract class RunInWorkspacesRoutine<
export abstract class RunInWorkspacesRoutine<
Ctx extends Context<RunInWorkspacesContextArgs>

@@ -67,3 +67,2 @@ > extends Routine<unknown, unknown, RoutineOptions> {

// eslint-disable-next-line no-restricted-syntax
for (const batch of batches) {

@@ -164,3 +163,3 @@ const pipeline = batch.reduce(

const packages: PackageStructure[] = []; // Without metadata
const metadata: { [name: string]: WorkspacePackage['metadata'] } = {}; // By package name
const metadata: Record<string, WorkspacePackage['metadata']> = {}; // By package name

@@ -167,0 +166,0 @@ this.workspacePackages.forEach((wsp) => {

@@ -5,14 +5,14 @@ /* eslint-disable @typescript-eslint/member-ordering */

import upperFirst from 'lodash/upperFirst';
import { Bind, PathResolver } from '@boost/common';
import { Bind, instanceOf, PathResolver } from '@boost/common';
import { EXECUTE_OPTIONS } from '../constants';
import ScriptContext from '../contexts/ScriptContext';
import filterArgs from '../helpers/filterArgs';
import Script from '../Script';
import RunInWorkspacesRoutine from './RunInWorkspacesRoutine';
import ExecuteScriptRoutine from './script/ExecuteScriptRoutine';
import { ScriptContext } from '../contexts/ScriptContext';
import { filterArgs } from '../helpers/filterArgs';
import { Script } from '../Script';
import { RunInWorkspacesRoutine } from './RunInWorkspacesRoutine';
import { ExecuteScriptRoutine } from './script/ExecuteScriptRoutine';
export default class RunScriptRoutine extends RunInWorkspacesRoutine<ScriptContext> {
export class RunScriptRoutine extends RunInWorkspacesRoutine<ScriptContext> {
errors: Error[] = [];
getInitialValue(context: ScriptContext): Promise<Script> {
async getInitialValue(context: ScriptContext): Promise<Script> {
const { tool } = this.options;

@@ -65,6 +65,8 @@

return script;
} catch (error) {
this.errors.push(
new Error(this.options.tool.msg('app:fromTool', { message: error.message })),
);
} catch (error: unknown) {
if (instanceOf(error, Error)) {
this.errors.push(
new Error(this.options.tool.msg('app:fromTool', { message: error.message })),
);
}

@@ -115,11 +117,14 @@ return null;

const { resolvedPath } = resolver.resolve();
const loadedScript = await tool.scriptRegistry.load(resolvedPath.path());
script = await tool.scriptRegistry.load(resolvedPath.path());
context.setScript(loadedScript);
context.setScript(script);
} catch (error) {
this.errors.push(new Error(tool.msg('app:fromModule', { message: error.message })));
return loadedScript;
} catch (error: unknown) {
if (instanceOf(error, Error)) {
this.errors.push(new Error(tool.msg('app:fromModule', { message: error.message })));
}
return null;
}
return script || null;
}

@@ -126,0 +131,0 @@

/* eslint-disable no-console, @typescript-eslint/member-ordering */
import { engine, Logger } from 'hygen';
import { Bind, Blueprint, Predicates } from '@boost/common';
import { Bind, Blueprint, instanceOf, Predicates } from '@boost/common';
import { color } from '@boost/internal';
import { Routine } from '@boost/pipeline';
import ScaffoldContext from '../contexts/ScaffoldContext';
import type Tool from '../Tool';
import { ScaffoldContext } from '../contexts/ScaffoldContext';
import type { Tool } from '../Tool';
import { RoutineOptions } from '../types';
export default class ScaffoldRoutine extends Routine<unknown, unknown, RoutineOptions> {
export class ScaffoldRoutine extends Routine<unknown, unknown, RoutineOptions> {
blueprint({ instance }: Predicates): Blueprint<RoutineOptions> {

@@ -18,3 +18,3 @@ return {

execute(context: ScaffoldContext) {
async execute(context: ScaffoldContext) {
return this.createWaterfallPipeline(context)

@@ -50,5 +50,5 @@ .pipe(this.options.tool.msg('app:scaffoldRunGenerator'), this.runGenerator)

});
} catch (error) {
} catch (error: unknown) {
// Intercept hygen error to provide a better error message
if (error.message.startsWith("I can't find action")) {
if (instanceOf(error, Error) && error.message.startsWith("I can't find action")) {
throw new Error(tool.msg('errors:scaffoldNoTemplates', { path: args.join('/') }));

@@ -67,2 +67,3 @@ }

input,
preferLocal: true,
shell: true,

@@ -69,0 +70,0 @@ });

import { parse } from '@boost/args';
import { Blueprint, Path, Predicates } from '@boost/common';
import { Blueprint, instanceOf, Path, Predicates } from '@boost/common';
import { Routine } from '@boost/pipeline';
import ScriptContext from '../../contexts/ScriptContext';
import formatExecReturn, { ExecLike } from '../../helpers/formatExecReturn';
import Script from '../../Script';
import type Tool from '../../Tool';
import { ScriptContext } from '../../contexts/ScriptContext';
import { ExecLike, formatExecReturn } from '../../helpers/formatExecReturn';
import { Script } from '../../Script';
import type { Tool } from '../../Tool';
import { RoutineOptions } from '../../types';

@@ -14,3 +14,3 @@

export default class ExecuteScriptRoutine extends Routine<unknown, Script, ExecuteScriptOptions> {
export class ExecuteScriptRoutine extends Routine<unknown, Script, ExecuteScriptOptions> {
blueprint({ instance, string }: Predicates): Blueprint<ExecuteScriptOptions> {

@@ -53,7 +53,9 @@ return {

await script.onAfterExecute.emit([context, result]);
} catch (error) {
this.debug(' Failure: %o', formatExecReturn(error));
this.debug(' Error message: %s', error.message);
} catch (error: unknown) {
if (instanceOf(error, Error)) {
this.debug(' Failure: %o', formatExecReturn(error as ExecLike));
this.debug(' Error message: %s', error.message);
await script.onFailedExecute.emit([context, error]);
await script.onFailedExecute.emit([context, error]);
}

@@ -60,0 +62,0 @@ throw error;

@@ -6,7 +6,7 @@ import execa, { Options as ExecaOptions } from 'execa';

import { Plugin } from '@boost/plugin';
import ScriptContext from './contexts/ScriptContext';
import isClassInstance from './helpers/isClassInstance';
import { ScriptContext } from './contexts/ScriptContext';
import { isClassInstance } from './helpers/isClassInstance';
import { Argv, BeemoTool, Scriptable } from './types';
export default abstract class Script<O extends object = {}, Options extends object = {}>
export abstract class Script<O extends object = {}, Options extends object = {}>
extends Plugin<BeemoTool, Options>

@@ -60,3 +60,6 @@ implements Scriptable<O> {

async executeCommand(command: string, args: string[], options: ExecaOptions = {}) /* infer */ {
return execa(command, args, options);
return execa(command, args, {
preferLocal: true,
...options,
});
}

@@ -63,0 +66,0 @@

@@ -0,1 +1,2 @@

/* eslint-disable promise/prefer-await-to-callbacks */
/* eslint-disable no-underscore-dangle */

@@ -11,3 +12,3 @@

export default class BatchStream extends Transform {
export class BatchStream extends Transform {
bufferedBatch: Buffer | null = null;

@@ -22,3 +23,3 @@

this.waitThreshold = options.wait || WAIT_THRESHOLD;
this.waitThreshold = options.wait ?? WAIT_THRESHOLD;
}

@@ -39,7 +40,3 @@

_transform(chunk: Buffer, encoding: string, callback: TransformCallback) {
if (this.bufferedBatch) {
this.bufferedBatch = Buffer.concat([this.bufferedBatch, chunk]);
} else {
this.bufferedBatch = chunk;
}
this.bufferedBatch = this.bufferedBatch ? Buffer.concat([this.bufferedBatch, chunk]) : chunk;

@@ -46,0 +43,0 @@ if (this.timeout) {

@@ -1,3 +0,1 @@

/* eslint-disable unicorn/import-index */
import execa from 'execa';

@@ -21,7 +19,7 @@ import { ArgList, Arguments, Argv } from '@boost/args';

Tool,
} from './index';
} from '.';
export { mockDebugger };
const TEST_ROOT = new Path(process.env.BEEMO_TEST_ROOT || process.cwd());
const TEST_ROOT = new Path(process.env.BEEMO_TEST_ROOT ?? process.cwd());

@@ -85,3 +83,3 @@ export class TestDriver<O extends object = {}> extends Driver<O> {

driver.name = name;
driver.tool = tool || mockTool();
driver.tool = tool ?? mockTool();

@@ -103,3 +101,3 @@ driver.setMetadata({

script.name = name;
script.tool = tool || mockTool();
script.tool = tool ?? mockTool();

@@ -173,3 +171,3 @@ return script;

export function stubDriverContext(driver?: Driver): DriverContext {
return applyContext(new DriverContext(stubDriverArgs(), driver || new TestDriver()));
return applyContext(new DriverContext(stubDriverArgs(), driver ?? new TestDriver()));
}

@@ -176,0 +174,0 @@

@@ -23,16 +23,16 @@ /* eslint-disable @typescript-eslint/member-ordering */

import { createTranslator, Translator } from '@boost/translate';
import Config from './Config';
import { Config } from './Config';
import { KEBAB_PATTERN } from './constants';
import ConfigContext from './contexts/ConfigContext';
import Context from './contexts/Context';
import DriverContext from './contexts/DriverContext';
import ScaffoldContext from './contexts/ScaffoldContext';
import ScriptContext from './contexts/ScriptContext';
import Driver from './Driver';
import CleanupConfigsRoutine from './routines/CleanupConfigsRoutine';
import ResolveConfigsRoutine from './routines/ResolveConfigsRoutine';
import RunDriverRoutine from './routines/RunDriverRoutine';
import RunScriptRoutine from './routines/RunScriptRoutine';
import ScaffoldRoutine from './routines/ScaffoldRoutine';
import Script from './Script';
import { ConfigContext } from './contexts/ConfigContext';
import { Context } from './contexts/Context';
import { DriverContext } from './contexts/DriverContext';
import { ScaffoldContext } from './contexts/ScaffoldContext';
import { ScriptContext } from './contexts/ScriptContext';
import { Driver } from './Driver';
import { CleanupConfigsRoutine } from './routines/CleanupConfigsRoutine';
import { ResolveConfigsRoutine } from './routines/ResolveConfigsRoutine';
import { RunDriverRoutine } from './routines/RunDriverRoutine';
import { RunScriptRoutine } from './routines/RunScriptRoutine';
import { ScaffoldRoutine } from './routines/ScaffoldRoutine';
import { Script } from './Script';
import { Argv, BootstrapFile, ConfigFile } from './types';

@@ -47,3 +47,3 @@

export default class Tool extends Contract<ToolOptions> {
export class Tool extends Contract<ToolOptions> {
config!: ConfigFile;

@@ -88,4 +88,3 @@

this.debug = createDebugger('core');
// eslint-disable-next-line global-require
this.debug('Using beemo v%s', require('../package.json').version);
this.debug('Using beemo v%s', (require('../package.json') as PackageStructure).version);

@@ -163,3 +162,3 @@ this.msg = createTranslator(

const bootstrap = bootstrapModule?.bootstrap || bootstrapModule?.default || bootstrapModule;
const bootstrap = bootstrapModule?.bootstrap ?? bootstrapModule?.default ?? bootstrapModule;
const isFunction = typeof bootstrap === 'function';

@@ -166,0 +165,0 @@

@@ -15,7 +15,7 @@ import { ExecaError, ExecaReturnValue } from 'execa';

import { Pluggable } from '@boost/plugin';
import type Context from './contexts/Context';
import type ScriptContext from './contexts/ScriptContext';
import type Tool from './Tool';
import type { Context } from './contexts/Context';
import type { ScriptContext } from './contexts/ScriptContext';
import type { Tool } from './Tool';
export { Arguments, Argv, ParserOptions };
export type { Arguments, Argv, ParserOptions };

@@ -179,3 +179,2 @@ export type BeemoTool = Tool;

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {

@@ -182,0 +181,0 @@ interface Process {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc