@connectedcars/setup
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
import { babelBuild, tscBuildTypings } from '../src/build' | ||
import { babelBuild, BuildErrorOutput, tscBuildTypings } from '../src/build' | ||
@@ -44,3 +44,8 @@ async function main(argv: string[]): Promise<number> { | ||
.catch(e => { | ||
console.error(e) | ||
if (e instanceof BuildErrorOutput) { | ||
console.error(e.message) | ||
} else { | ||
console.error(e) | ||
} | ||
process.exit(255) | ||
}) |
@@ -42,4 +42,10 @@ #!/usr/bin/env node | ||
}).catch(e => { | ||
console.error(e); | ||
if (e instanceof _build.BuildErrorOutput) { | ||
console.error(e.message); | ||
} else { | ||
console.error(e); | ||
} | ||
process.exit(255); | ||
}); | ||
//# sourceMappingURL=build.js.map |
@@ -11,1 +11,5 @@ export interface BuildEntry { | ||
export declare function tscBuildTypings(): Promise<void>; | ||
export declare class BuildErrorOutput extends Error { | ||
error: Error; | ||
constructor(message: string, e: Error); | ||
} |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.tscBuildTypings = tscBuildTypings; | ||
exports.BuildErrorOutput = void 0; | ||
@@ -26,2 +27,4 @@ var babel = _interopRequireWildcard(require("@babel/core")); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
const readdirAsync = _util.default.promisify(_fs.default.readdir); | ||
@@ -140,4 +143,22 @@ | ||
async function tscBuildTypings() { | ||
await execFile('tsc', ['--emitDeclarationOnly']); | ||
try { | ||
await execFile('tsc', ['--emitDeclarationOnly']); | ||
} catch (e) { | ||
const execError = e; | ||
throw new BuildErrorOutput(execError.stdout, e); | ||
} | ||
} | ||
class BuildErrorOutput extends Error { | ||
constructor(message, e) { | ||
super(message); | ||
_defineProperty(this, "error", void 0); | ||
this.error = e; | ||
} | ||
} | ||
exports.BuildErrorOutput = BuildErrorOutput; | ||
//# sourceMappingURL=build.js.map |
{ | ||
"name": "@connectedcars/setup", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Connected Cars JavaScript/TypeScript development setup", | ||
@@ -5,0 +5,0 @@ "main": "build/dist/src/index.js", |
@@ -102,4 +102,26 @@ import * as babel from '@babel/core' | ||
interface ExecFileError extends Error { | ||
killed: boolean | ||
code: number | ||
signal: null | string | ||
cmd: string | ||
stdout: string | ||
stderr: string | ||
} | ||
export async function tscBuildTypings(): Promise<void> { | ||
await execFile('tsc', ['--emitDeclarationOnly']) | ||
try { | ||
await execFile('tsc', ['--emitDeclarationOnly']) | ||
} catch (e) { | ||
const execError = e as ExecFileError | ||
throw new BuildErrorOutput(execError.stdout, e) | ||
} | ||
} | ||
export class BuildErrorOutput extends Error { | ||
public error: Error | ||
public constructor(message: string, e: Error) { | ||
super(message) | ||
this.error = e | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
746887
16613
1