Comparing version 1.0.0-9 to 1.0.0-10
@@ -66,3 +66,3 @@ /** | ||
declare class TSConfckParseError extends Error { | ||
constructor(message: string, code: string, cause?: Error); | ||
constructor(message: string, code: string, tsconfigFile: string, cause?: Error); | ||
/** | ||
@@ -76,2 +76,6 @@ * error code | ||
cause: Error | undefined; | ||
/** | ||
* absolute path of tsconfig file where the error happened | ||
*/ | ||
tsconfigFile: string; | ||
} | ||
@@ -147,3 +151,3 @@ | ||
declare class TSConfckParseNativeError extends Error { | ||
constructor(diagnostic: TSDiagnosticError, result?: any); | ||
constructor(diagnostic: TSDiagnosticError, tsconfigFile: string, result?: any); | ||
/** | ||
@@ -158,2 +162,6 @@ * code of typescript diagnostic, prefixed with "TS " | ||
/** | ||
* absolute path of tsconfig file where the error happened | ||
*/ | ||
tsconfigFile: string; | ||
/** | ||
* native result if present, contains all errors in result.errors | ||
@@ -160,0 +168,0 @@ */ |
@@ -20,2 +20,5 @@ var __defProp = Object.defineProperty; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __require = typeof require !== "undefined" ? require : (x) => { | ||
throw new Error('Dynamic require of "' + x + '" is not supported'); | ||
}; | ||
@@ -366,3 +369,3 @@ // src/find.ts | ||
} catch (e) { | ||
throw new TSConfckParseError(`parsing ${tsconfigFile} failed: ${e}`, "PARSE_FILE", e); | ||
throw new TSConfckParseError(`parsing ${tsconfigFile} failed: ${e}`, "PARSE_FILE", tsconfigFile, e); | ||
} | ||
@@ -398,3 +401,3 @@ } | ||
const circle = extended.concat({ tsconfigFile: extendedTSConfigFile, tsconfig: null }).map((e) => e.tsconfigFile).join(" -> "); | ||
throw new TSConfckParseError(`Circular dependency in "extends": ${circle}`, "EXTENDS_CIRCULAR"); | ||
throw new TSConfckParseError(`Circular dependency in "extends": ${circle}`, "EXTENDS_CIRCULAR", result.tsconfigFile); | ||
} | ||
@@ -412,3 +415,3 @@ extended.push(await parseFile(extendedTSConfigFile, cache)); | ||
} catch (e) { | ||
throw new TSConfckParseError(`failed to resolve "extends":"${extended}" in ${from}`, "EXTENDS_RESOLVE", e); | ||
throw new TSConfckParseError(`failed to resolve "extends":"${extended}" in ${from}`, "EXTENDS_RESOLVE", from, e); | ||
} | ||
@@ -485,3 +488,3 @@ } | ||
var TSConfckParseError = class extends Error { | ||
constructor(message, code, cause) { | ||
constructor(message, code, tsconfigFile, cause) { | ||
super(message); | ||
@@ -492,2 +495,3 @@ Object.setPrototypeOf(this, TSConfckParseError.prototype); | ||
this.cause = cause; | ||
this.tsconfigFile = tsconfigFile; | ||
} | ||
@@ -559,3 +563,3 @@ }; | ||
if (error) { | ||
throw new TSConfckParseNativeError(error, null); | ||
throw new TSConfckParseNativeError(error, tsconfigFile, null); | ||
} | ||
@@ -573,3 +577,3 @@ const host = { | ||
const nativeResult = parseJsonConfigFileContent(config, host, path5.dirname(posixTSConfigFile), void 0, posixTSConfigFile); | ||
checkErrors(nativeResult); | ||
checkErrors(nativeResult, tsconfigFile); | ||
const result = { | ||
@@ -590,3 +594,3 @@ tsconfigFile, | ||
} | ||
function checkErrors(nativeResult) { | ||
function checkErrors(nativeResult, tsconfigFile) { | ||
var _a; | ||
@@ -599,3 +603,3 @@ const ignoredErrorCodes = [ | ||
if (criticalError) { | ||
throw new TSConfckParseNativeError(criticalError, nativeResult); | ||
throw new TSConfckParseNativeError(criticalError, tsconfigFile, nativeResult); | ||
} | ||
@@ -659,3 +663,3 @@ } | ||
var TSConfckParseNativeError = class extends Error { | ||
constructor(diagnostic, result) { | ||
constructor(diagnostic, tsconfigFile, result) { | ||
super(diagnostic.messageText); | ||
@@ -667,2 +671,3 @@ Object.setPrototypeOf(this, TSConfckParseNativeError.prototype); | ||
this.result = result; | ||
this.tsconfigFile = tsconfigFile; | ||
} | ||
@@ -669,0 +674,0 @@ }; |
{ | ||
"name": "tsconfck", | ||
"version": "1.0.0-9", | ||
"version": "1.0.0-10", | ||
"description": "A utility to work with tsconfig.json without typescript", | ||
@@ -52,13 +52,13 @@ "license": "MIT", | ||
"@tsconfig/node12": "^1.0.9", | ||
"@types/node": "^16.7.13", | ||
"@typescript-eslint/eslint-plugin": "^4.31.0", | ||
"@typescript-eslint/parser": "^4.31.0", | ||
"c8": "^7.8.0", | ||
"@types/node": "^16.9.1", | ||
"@typescript-eslint/eslint-plugin": "^4.31.1", | ||
"@typescript-eslint/parser": "^4.31.1", | ||
"c8": "^7.9.0", | ||
"chalk": "^4.1.2", | ||
"conventional-changelog-cli": "^2.1.1", | ||
"enquirer": "^2.3.6", | ||
"esbuild": "^0.12.25", | ||
"esbuild": "^0.12.28", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-markdown": "^2.2.0", | ||
"eslint-plugin-markdown": "^2.2.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
@@ -72,3 +72,3 @@ "eslint-plugin-prettier": "^4.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.3.2", | ||
"prettier": "^2.4.0", | ||
"rimraf": "^3.0.2", | ||
@@ -79,3 +79,3 @@ "semver": "^7.3.5", | ||
"tsup": "^4.14.0", | ||
"typescript": "^4.4.2", | ||
"typescript": "^4.4.3", | ||
"uvu": "^0.5.1", | ||
@@ -82,0 +82,0 @@ "watchlist": "^0.3.1" |
@@ -83,3 +83,3 @@ import path from 'path'; | ||
if (error) { | ||
throw new TSConfckParseNativeError(error, null); | ||
throw new TSConfckParseNativeError(error, tsconfigFile, null); | ||
} | ||
@@ -105,3 +105,3 @@ | ||
); | ||
checkErrors(nativeResult); | ||
checkErrors(nativeResult, tsconfigFile); | ||
@@ -140,3 +140,3 @@ const result: TSConfckParseNativeResult = { | ||
*/ | ||
function checkErrors(nativeResult: any) { | ||
function checkErrors(nativeResult: any, tsconfigFile: string) { | ||
const ignoredErrorCodes = [ | ||
@@ -151,3 +151,3 @@ // see https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json | ||
if (criticalError) { | ||
throw new TSConfckParseNativeError(criticalError, nativeResult); | ||
throw new TSConfckParseNativeError(criticalError, tsconfigFile, nativeResult); | ||
} | ||
@@ -294,3 +294,3 @@ } | ||
export class TSConfckParseNativeError extends Error { | ||
constructor(diagnostic: TSDiagnosticError, result?: any) { | ||
constructor(diagnostic: TSDiagnosticError, tsconfigFile: string, result?: any) { | ||
super(diagnostic.messageText); | ||
@@ -303,2 +303,3 @@ // Set the prototype explicitly. | ||
this.result = result; | ||
this.tsconfigFile = tsconfigFile; | ||
} | ||
@@ -317,2 +318,7 @@ | ||
/** | ||
* absolute path of tsconfig file where the error happened | ||
*/ | ||
tsconfigFile: string; | ||
/** | ||
* native result if present, contains all errors in result.errors | ||
@@ -319,0 +325,0 @@ */ |
@@ -75,3 +75,8 @@ import path from 'path'; | ||
} catch (e) { | ||
throw new TSConfckParseError(`parsing ${tsconfigFile} failed: ${e}`, 'PARSE_FILE', e); | ||
throw new TSConfckParseError( | ||
`parsing ${tsconfigFile} failed: ${e}`, | ||
'PARSE_FILE', | ||
tsconfigFile, | ||
e | ||
); | ||
} | ||
@@ -126,3 +131,4 @@ } | ||
`Circular dependency in "extends": ${circle}`, | ||
'EXTENDS_CIRCULAR' | ||
'EXTENDS_CIRCULAR', | ||
result.tsconfigFile | ||
); | ||
@@ -146,2 +152,3 @@ } | ||
'EXTENDS_RESOLVE', | ||
from, | ||
e | ||
@@ -288,3 +295,3 @@ ); | ||
export class TSConfckParseError extends Error { | ||
constructor(message: string, code: string, cause?: Error) { | ||
constructor(message: string, code: string, tsconfigFile: string, cause?: Error) { | ||
super(message); | ||
@@ -296,2 +303,3 @@ // Set the prototype explicitly. | ||
this.cause = cause; | ||
this.tsconfigFile = tsconfigFile; | ||
} | ||
@@ -307,2 +315,7 @@ | ||
cause: Error | undefined; | ||
/** | ||
* absolute path of tsconfig file where the error happened | ||
*/ | ||
tsconfigFile: string; | ||
} |
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
190706
2609
10