Comparing version 0.1.17 to 0.1.18
@@ -145,5 +145,10 @@ "use strict"; | ||
commandUsage('new'); | ||
return; | ||
} | ||
return neon_new_1.default(this.cwd, options.name); | ||
else if (!options.name) { | ||
console.error(cliUsage(spec.new.usage)); | ||
} | ||
else { | ||
return neon_new_1.default(this.cwd, options.name); | ||
} | ||
return; | ||
} | ||
@@ -194,3 +199,3 @@ }, | ||
} | ||
_a = parseModules(this.cwd, options.modules, options.path), modules = _a.modules, multiple = _a.multiple; | ||
_a = parseModules(this.cwd, (options.modules || []), !!options.path), modules = _a.modules, multiple = _a.multiple; | ||
_i = 0, modules_1 = modules; | ||
@@ -202,3 +207,3 @@ _b.label = 1; | ||
logIf(multiple, "building", this.cwd, module_1); | ||
return [4 /*yield*/, neon_build_1.default(module_1, options.rust, !options.debug, options.node_module_version)]; | ||
return [4 /*yield*/, neon_build_1.default(module_1, options.rust, !options.debug, String(options.node_module_version))]; | ||
case 2: | ||
@@ -246,3 +251,3 @@ _b.sent(); | ||
} | ||
_a = parseModules(this.cwd, options.modules, options.path), modules = _a.modules, multiple = _a.multiple; | ||
_a = parseModules(this.cwd, (options.modules || []), !!options.path), modules = _a.modules, multiple = _a.multiple; | ||
_i = 0, modules_2 = modules; | ||
@@ -323,2 +328,4 @@ _b.label = 1; | ||
console.error(style.error(e_1.message)); | ||
console.error(); | ||
console.error(e_1.stack); | ||
return [3 /*break*/, 4]; | ||
@@ -325,0 +332,0 @@ case 4: return [2 /*return*/]; |
{ | ||
"name": "neon-cli", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "Build and load native Rust/Neon modules.", | ||
@@ -55,2 +55,3 @@ "author": "Dave Herman <dherman@mozilla.com>", | ||
"ts-node": "^3.0.2", | ||
"ts-unknown": "^0.2.0", | ||
"typescript": "^2.2.2" | ||
@@ -57,0 +58,0 @@ }, |
@@ -13,2 +13,4 @@ import * as path from 'path'; | ||
import * as JSON from 'ts-typed-json'; | ||
import unknown from 'ts-unknown'; | ||
import { Toolchain } from './rust'; | ||
@@ -40,3 +42,3 @@ let metadata = JSON.loadSync(path.resolve(__dirname, '..', '..', 'package.json')); | ||
function parseModules(cwd: string, names: string[], paths: string[]) { | ||
function parseModules(cwd: string, names: string[], paths: boolean) { | ||
let modules = names.length | ||
@@ -53,3 +55,3 @@ ? names.map(m => paths ? path.resolve(cwd, m) | ||
type Action = (this: CLI, options: Dict<any>, usage: string) => void; | ||
type Action = (this: CLI, options: Dict<unknown>, usage: string) => void; | ||
@@ -87,3 +89,3 @@ type Command = { | ||
} else if (options.help !== undefined) { | ||
commandUsage(options.help); | ||
commandUsage(options.help as string); | ||
} else { | ||
@@ -107,3 +109,3 @@ console.error(usage); | ||
if (options && options.command) { | ||
commandUsage(options.command); | ||
commandUsage(options.command as string); | ||
} else if (options && options.help) { | ||
@@ -130,6 +132,8 @@ commandUsage('help'); | ||
commandUsage('new'); | ||
return; | ||
} else if (!options.name) { | ||
console.error(cliUsage(spec.new.usage)); | ||
} else { | ||
return neon_new(this.cwd, options.name as string); | ||
} | ||
return neon_new(this.cwd, options.name); | ||
return; | ||
} | ||
@@ -177,3 +181,5 @@ }, | ||
let { modules, multiple } = parseModules(this.cwd, options.modules, options.path); | ||
let { modules, multiple } = parseModules(this.cwd, | ||
(options.modules || []) as string[], | ||
!!options.path); | ||
@@ -183,3 +189,6 @@ for (let module of modules) { | ||
await neon_build(module, options.rust, !options.debug, options.node_module_version); | ||
await neon_build(module, | ||
options.rust as Toolchain, | ||
!options.debug, | ||
String(options.node_module_version)); | ||
} | ||
@@ -215,3 +224,5 @@ } | ||
let { modules, multiple } = parseModules(this.cwd, options.modules, options.path); | ||
let { modules, multiple } = parseModules(this.cwd, | ||
(options.modules || []) as string[], | ||
!!options.path); | ||
@@ -286,4 +297,6 @@ for (let module of modules) { | ||
console.error(style.error(e.message)); | ||
console.error(); | ||
console.error(e.stack); | ||
} | ||
} | ||
} |
@@ -47,2 +47,3 @@ declare module 'command-line-usage' { | ||
import Dict from 'ts-dict'; | ||
import unknown from 'ts-unknown'; | ||
@@ -70,5 +71,5 @@ namespace internal { | ||
options?: internal.CommandLineArgsOptions) | ||
: Dict<any>; | ||
: Dict<unknown>; | ||
export = internal; | ||
} |
@@ -0,1 +1,6 @@ | ||
# Version 0.1.18 | ||
* CLI bugfix (#59). | ||
* JsArrayBuffer (neon-bindings/neon#210). | ||
# Version 0.1.17 | ||
@@ -2,0 +7,0 @@ |
Sorry, the diff of this file is not supported yet
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
116994
2704
21