dependents-editor-backend
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -23,2 +23,4 @@ #!/usr/bin/env node | ||
.option('--lookup', 'perform a partial lookup for the jump to dependency feature') | ||
.option('--lookup-position', 'jump to dependency: location of the clicked character of the target') | ||
.option('--find-dependents', 'get the dependents of the current file') | ||
@@ -25,0 +27,0 @@ .option('--find-drivers', 'get the driver scripts relevant to current file') |
var Config = require('./Config'); | ||
var getPath = require('./getPath'); | ||
var getClickedImport = require('./getClickedImport'); | ||
@@ -19,7 +20,6 @@ var cabinet = require('filing-cabinet'); | ||
if (program.debug) { | ||
// TODO: Try setting process.env.DEBUG instead | ||
debug = console.log.bind(console); | ||
} | ||
debug('given program options', program); | ||
var config; | ||
@@ -48,13 +48,13 @@ try { | ||
if (program.lookup) { | ||
options.target = program.args[0].replace(/["|'|;]/g, ''); | ||
debug('performing a lookup'); | ||
if (!program.lookupPosition) { | ||
options.partial = program.args[0].replace(/["|'|;]/g, ''); | ||
} else { | ||
debug('given a lookup location: ', program.lookupPosition); | ||
options.partial = getClickedImport(program.args[0], Number(program.lookupPosition)); | ||
} | ||
var result = cabinet({ | ||
partial: options.target, | ||
filename: options.filename, | ||
directory: options.directory, | ||
config: options.config, | ||
webpackConfig: options.webpackConfig | ||
}); | ||
debug('performing a lookup with options: ', options); | ||
var result = cabinet(options); | ||
debug('lookup result: ' + result); | ||
@@ -129,2 +129,5 @@ deferred.resolve(result); | ||
deferred.resolve(config.toJSON()); | ||
} else { | ||
deferred.reject('No valid command given'); | ||
} | ||
@@ -131,0 +134,0 @@ |
{ | ||
"name": "dependents-editor-backend", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "The brains behind Dependents editor plugins", | ||
@@ -5,0 +5,0 @@ "main": "lib/cli.js", |
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
11002
8
276