base-runtimes
Advanced tools
Comparing version 0.1.1 to 0.1.2
64
index.js
@@ -10,16 +10,62 @@ /*! | ||
var utils = require('./utils'); | ||
module.exports = function(options) { | ||
var runtimes = require('composer-runtimes'); | ||
return function(app) { | ||
if (this.isRegistered('base-runtimes')) return; | ||
this.use(runtimes({ | ||
displayName: function(key) { | ||
if (typeof app.generator === 'function' && app.name !== key) { | ||
return app.name + ':' + key; | ||
} | ||
return key; | ||
var time = new utils.Time(); | ||
this.on('starting', function(build) { | ||
starting(namespace(build)); | ||
}); | ||
this.on('finished', function(build) { | ||
finished(namespace(build)); | ||
}); | ||
this.on('task:starting', function(task) { | ||
starting(namespace(app), name(task)); | ||
}); | ||
this.on('task:finished', function(task) { | ||
finished(namespace(app), name(task)); | ||
}); | ||
this.once('done', function() { | ||
console.error(utils.green(utils.check), 'finished'); | ||
}); | ||
function starting(namespace, name) { | ||
var key = toKey(namespace, name); | ||
time.start(key); | ||
utils.timestamp('starting', key); | ||
} | ||
function finished(namespace, name) { | ||
var key = toKey(namespace, name); | ||
var prefix = key ? key + ' ' : ''; | ||
utils.timestamp('finished', prefix + utils.magenta(time.end(key))); | ||
} | ||
function name(app) { | ||
return app.name || ''; | ||
} | ||
function namespace(app) { | ||
return app.namespace || ''; | ||
} | ||
function toKey(namespace, name) { | ||
if (namespace && name) { | ||
return utils.cyan(namespace + ':' + name); | ||
} | ||
})); | ||
if (namespace) { | ||
return utils.cyan(namespace); | ||
} | ||
if (name) { | ||
return utils.cyan(name); | ||
} | ||
return ''; | ||
} | ||
}; | ||
}; |
{ | ||
"name": "base-runtimes", | ||
"description": "Plugin for adding composer-runtimes to base applications, complementing the base-tasks and base-generators plugins.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jonschlinkert/base-runtimes", | ||
@@ -13,3 +13,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -24,7 +25,13 @@ "main": "index.js", | ||
"dependencies": { | ||
"composer-runtimes": "^0.7.0" | ||
"ansi-cyan": "^0.1.1", | ||
"ansi-green": "^0.1.1", | ||
"ansi-magenta": "^0.1.1", | ||
"fancy-log": "github:jonschlinkert/fancy-log#timestamp", | ||
"lazy-cache": "^1.0.3", | ||
"success-symbol": "^0.1.0", | ||
"time-diff": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"base": "^0.6.7", | ||
"base-tasks": "^0.1.4", | ||
"base-tasks": "^0.3.0", | ||
"gulp-format-md": "*", | ||
@@ -31,0 +38,0 @@ "mocha": "^2.4.2" |
@@ -77,2 +77,2 @@ # base-runtimes [![NPM version](https://img.shields.io/npm/v/base-runtimes.svg)](https://www.npmjs.com/package/base-runtimes) [![Build Status](https://img.shields.io/travis/jonschlinkert/base-runtimes.svg)](https://travis-ci.org/jonschlinkert/base-runtimes) | ||
_This file was generated by [verb](https://github.com/verbose/verb) on January 27, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb) on January 29, 2016._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8086
5
78
7
1
2
+ Addedansi-cyan@^0.1.1
+ Addedansi-green@^0.1.1
+ Addedansi-magenta@^0.1.1
+ Addedlazy-cache@^1.0.3
+ Addedsuccess-symbol@^0.1.0
+ Addedtime-diff@^0.1.0
+ Addedansi-red@0.1.1(transitive)
+ Addedtime-diff@0.1.0(transitive)
- Removedcomposer-runtimes@^0.7.0
- Removedansi-gray@0.1.1(transitive)
- Removedcomposer-runtimes@0.7.0(transitive)
- Removedextend-shallow@2.0.1(transitive)
- Removedis-extendable@0.1.1(transitive)
- Removedtime-stamp@0.1.3(transitive)