Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boost

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boost - npm Package Compare versions

Comparing version 0.0.6 to 0.0.8

lib/Console.js

66

lib/Pipeline.js

@@ -7,28 +7,20 @@ 'use strict';

var _promise = require('babel-runtime/core-js/promise');
var _Routine = require('./Routine');
var _promise2 = _interopRequireDefault(_promise);
var _Routine2 = _interopRequireDefault(_Routine);
var _chalk = require('chalk');
var _Console = require('./Console');
var _chalk2 = _interopRequireDefault(_chalk);
var _Console2 = _interopRequireDefault(_Console);
var _readline = require('readline');
var _readline2 = _interopRequireDefault(_readline);
var _Routine = require('./Routine');
var _Routine2 = _interopRequireDefault(_Routine);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*:: import type { RoutineConfig, Result, ResultPromise } from './types';*/ /**
* @copyright 2017, Miles Johnson
* @license https://opensource.org/licenses/MIT
* @flow
*/
/**
* @copyright 2017, Miles Johnson
* @license https://opensource.org/licenses/MIT
* @flow
*/
/*:: import type { RoutineConfig, Result, ResultPromise } from './types';*/
class Pipeline extends _Routine2.default {
constructor(name /*: string*/, config /*: RoutineConfig*/ = {}) {

@@ -40,12 +32,8 @@ super(name, config);

this.console = _readline2.default.createInterface({
input: process.stdin,
output: process.stdout
});
// Initialize the root console
this.console = new _Console2.default(config);
}
/**
* Execute the routines in sequential order while passing the result
* from the previous routine to the next routine. The initial value can
* be passed by the consumer.
* Execute all subroutines in order.
*/

@@ -55,31 +43,3 @@ execute(initialValue /*: Result<*>*/ = null) /*: ResultPromise<*>*/ {

}
/**
* Request input from the console.
*/
askQuestion(question /*: string*/) /*: Promise<string>*/ {
return new _promise2.default((resolve /*: (string) => void*/) => {
this.console.question(_chalk2.default.magenta(question), (answer /*: string*/) => {
resolve(answer);
this.console.close();
});
});
}
/**
* Output a message to the console.
*/
log(message /*: string*/) /*: this*/ {
this.console.write(message);
return this;
}
/**
* Output a title for the current routing phase.
*/
logTitle(step /*: string*/, message /*: string*/) /*: this*/ {
return this.log(`${_chalk2.default.gray(`[${step}]`)} ${_chalk2.default.reset(message)}`);
}
}
exports.default = Pipeline;

@@ -23,11 +23,14 @@ 'use strict';

var _Console = require('./Console');
var _Console2 = _interopRequireDefault(_Console);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @copyright 2017, Miles Johnson
* @license https://opensource.org/licenses/MIT
* @flow
*/
/*:: import type { RoutineConfig, Result, ResultPromise, ResultAccumulator, Task } from './types';*/ /**
* @copyright 2017, Miles Johnson
* @license https://opensource.org/licenses/MIT
* @flow
*/
/*:: import type { RoutineConfig, Result, ResultPromise, ResultAccumulator, Task } from './types';*/
class Routine {

@@ -59,2 +62,3 @@

// Inherit config from parent
const config = parentConfig[this.name];

@@ -67,2 +71,5 @@

// Initialize setup
this.setup();
return this;

@@ -112,3 +119,8 @@ }

if (routine instanceof Routine) {
this.subroutines.push(routine.configure(this.config, this.globalConfig));
routine.configure(this.config, this.globalConfig);
// eslint-disable-next-line no-param-reassign
routine.console = this.console;
this.subroutines.push(routine);
} else {

@@ -146,2 +158,7 @@ throw new TypeError('Routine must be an instance of `Routine`.');

/**
* Called once the routine has been configured and is ready to execute.
*/
setup() {}
/**
* Wrap a value in a promise if it has not already been.

@@ -148,0 +165,0 @@ */

@@ -10,5 +10,3 @@ "use strict";

/*:: export type PrimitiveType = string | number | boolean;*/
/*:: export type RoutineConfig = {
[key: string]: PrimitiveType | PrimitiveType[] | RoutineConfig,
};*/
/*:: export type RoutineConfig = { [key: string]: PrimitiveType | PrimitiveType[] | RoutineConfig };*/
/*:: export type Result<T> = T;*/

@@ -15,0 +13,0 @@ /*:: export type ResultPromise<T> = Promise<Result<T>>;*/

{
"name": "boost",
"version": "0.0.6",
"version": "0.0.8",
"description": "Robust pipeline for creating build tools that separate logic into routines and tasks.",

@@ -59,4 +59,5 @@ "keywords": [],

"engines": {
"node": "^6.0.0"
}
"node": ">=6.0.0"
},
"engineStrict": true
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc