dependents-editor-backend
Advanced tools
Comparing version 1.4.1 to 1.5.0
@@ -5,5 +5,7 @@ #!/usr/bin/env node | ||
var program = require('commander'); | ||
var cli = require('../lib/cli'); | ||
var program = require('commander'); | ||
var isPlainObject = require('is-plain-object'); | ||
program | ||
@@ -35,2 +37,3 @@ .version(require('../package.json').version) | ||
cli(program) | ||
// TODO: consider moving into a cli.print method for testing | ||
.then(function(result) { | ||
@@ -42,2 +45,6 @@ if (!(result instanceof Array)) { | ||
result.forEach(function(r) { | ||
if (isPlainObject(r)) { | ||
r = JSON.stringify(r); | ||
} | ||
console.log(r); | ||
@@ -44,0 +51,0 @@ }); |
@@ -7,2 +7,3 @@ var Config = require('./Config'); | ||
var callers = require('callers'); | ||
var tree = require('dependency-tree'); | ||
@@ -45,4 +46,11 @@ var q = require('q'); | ||
debug('performing a lookup'); | ||
var result = lookup(options); | ||
var result = cabinet({ | ||
partial: options.target, | ||
filename: options.filename, | ||
directory: options.directory, | ||
config: options.config, | ||
webpackConfig: options.webpackConfig | ||
}); | ||
if (!fileExists(result)) { | ||
@@ -96,2 +104,13 @@ var fileDir = path.dirname(result); | ||
callers(options); | ||
} else if (program.getTree) { | ||
options.root = options.directory; | ||
var results = tree(options); | ||
try { | ||
deferred.resolve(results); | ||
} catch (e) { | ||
deferred.reject(e.message); | ||
} | ||
} | ||
@@ -101,11 +120,1 @@ | ||
}; | ||
function lookup(options) { | ||
return cabinet({ | ||
partial: options.target, | ||
filename: options.filename, | ||
directory: options.directory, | ||
config: options.config, | ||
webpackConfig: options.webpackConfig | ||
}); | ||
}; |
@@ -59,2 +59,6 @@ var fs = require('fs'); | ||
if (!this.directory) { | ||
throw new Error('Either a root or styles_root must be defined in your .deprc file'); | ||
} | ||
this.exclude = config.exclude || []; | ||
@@ -61,0 +65,0 @@ |
{ | ||
"name": "dependents-editor-backend", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "The brains behind Dependents editor plugins", | ||
@@ -39,2 +39,3 @@ "main": "lib/cli.js", | ||
"debug": "~2.2.0", | ||
"dependency-tree": "~5.1.0", | ||
"dependents": "~3.1.1", | ||
@@ -44,2 +45,3 @@ "file-exists": "~1.0.0", | ||
"find": "~0.2.4", | ||
"is-plain-object": "~2.0.1", | ||
"object-assign": "~4.1.0", | ||
@@ -46,0 +48,0 @@ "q": "~1.4.1" |
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
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
9726
235
11
+ Addeddependency-tree@~5.1.0
+ Addedis-plain-object@~2.0.1
+ Addeddeep-is@0.1.4(transitive)
+ Addeddependency-tree@5.1.0(transitive)
+ Addeddetective-amd@2.4.0(transitive)
+ Addeddetective-cjs@1.0.5(transitive)
+ Addeddetective-es6@1.2.0(transitive)
+ Addeddetective-sass@1.2.2(transitive)
+ Addeddetective-stylus@1.0.3(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedget-amd-module-type@2.0.5(transitive)
+ Addedgonzales-pe@3.4.7(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedjust-parse@1.0.5(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedminimist@1.1.3(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedprecinct@2.5.1(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedword-wrap@1.2.5(transitive)