@ionic/cli-framework
Advanced tools
Comparing version 1.0.0-rc.10 to 1.0.0-rc.11
{ | ||
"name": "@ionic/cli-framework", | ||
"version": "1.0.0-rc.10", | ||
"version": "1.0.0-rc.11", | ||
"description": "The foundation framework of the Ionic CLI", | ||
@@ -5,0 +5,0 @@ "homepage": "https://ionicframework.com/", |
import { PackageJson } from '../definitions'; | ||
export declare const ERROR_INVALID_PACKAGE_JSON = "INVALID_PACKAGE_JSON"; | ||
export declare const ERROR_BIN_NOT_FOUND = "BIN_NOT_FOUND"; | ||
/** | ||
@@ -9,2 +10,5 @@ * Lightweight version of https://github.com/npm/validate-npm-package-name | ||
export declare function compileNodeModulesPaths(filePath: string): string[]; | ||
export interface ResolveOptions { | ||
paths?: string[]; | ||
} | ||
/** | ||
@@ -19,5 +23,3 @@ * Poorly implemented shim for Node 8+ `require.resolve()`, with `paths` | ||
*/ | ||
export declare function resolve(m: string, options?: { | ||
paths?: string[]; | ||
}): string; | ||
export declare function resolve(m: string, options?: ResolveOptions): string; | ||
export declare namespace resolve { | ||
@@ -28,1 +30,2 @@ function LOAD_AS_FILE(x: string): string | undefined; | ||
} | ||
export declare function resolveBin(m: string, bin: string, options?: ResolveOptions): string; |
@@ -10,2 +10,3 @@ "use strict"; | ||
exports.ERROR_INVALID_PACKAGE_JSON = 'INVALID_PACKAGE_JSON'; | ||
exports.ERROR_BIN_NOT_FOUND = 'BIN_NOT_FOUND'; | ||
/** | ||
@@ -113,2 +114,15 @@ * Lightweight version of https://github.com/npm/validate-npm-package-name | ||
})(resolve = exports.resolve || (exports.resolve = {})); | ||
function resolveBin(m, bin, options) { | ||
const packageJsonPath = resolve(`${m}/package`, options); | ||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' })); | ||
if (!guards_1.isPackageJson(packageJson) || !packageJson.bin) { | ||
throw exports.ERROR_INVALID_PACKAGE_JSON; | ||
} | ||
const desiredBin = packageJson.bin[bin]; | ||
if (!desiredBin) { | ||
throw exports.ERROR_BIN_NOT_FOUND; | ||
} | ||
return path.resolve(path.dirname(packageJsonPath), desiredBin); | ||
} | ||
exports.resolveBin = resolveBin; | ||
function safeStatSync(filePath) { | ||
@@ -115,0 +129,0 @@ try { |
@@ -33,2 +33,6 @@ export declare const ERROR_TIMEOUT_REACHED = "TIMEOUT_REACHED"; | ||
/** | ||
* Never resolves. | ||
*/ | ||
export declare function sleepForever(): Promise<never>; | ||
/** | ||
* Register a synchronous function to be called once the process exits. | ||
@@ -35,0 +39,0 @@ */ |
@@ -55,2 +55,11 @@ "use strict"; | ||
/** | ||
* Never resolves. | ||
*/ | ||
function sleepForever() { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return new Promise(() => { }); | ||
}); | ||
} | ||
exports.sleepForever = sleepForever; | ||
/** | ||
* Register a synchronous function to be called once the process exits. | ||
@@ -57,0 +66,0 @@ */ |
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
194184
4604