From 786e0ff8047d0d3e0a7504c5702b5b4b96a9923a Mon Sep 17 00:00:00 2001 From: Dimitar Bounov Date: Mon, 23 May 2022 10:41:37 -1000 Subject: [PATCH 1/2] Fix nit in CompileResult for compileJSONData - report each unit absolute path as remapped to itself --- src/compile/utils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compile/utils.ts b/src/compile/utils.ts index bd4a0e0b..6893516d 100644 --- a/src/compile/utils.ts +++ b/src/compile/utils.ts @@ -46,7 +46,8 @@ export interface CompileResult { * Map from file-names appearing in the `files` map, to the * actual resolved paths on disk (if any). * - * For `compileJSONData()` this map is empty (since nothing was resolved on disk). + * For `compileJSONData()` this maps each unit absolutePath to itself as no resolution is done. + * */ resolvedFileNames: Map; @@ -364,6 +365,7 @@ export async function compileJsonData( } const sources: { [fileName: string]: any } = data.sources; + const resolvedFileNames = new Map(Object.keys(sources).map((x) => [x, x])); if (consistentlyContainsOneOf(sources, "ast", "legacyAST", "AST")) { const compilerVersion = undefined; @@ -379,7 +381,7 @@ export async function compileJsonData( data, compilerVersion, files, - resolvedFileNames: new Map(), + resolvedFileNames, inferredRemappings: new Map() }; } @@ -409,7 +411,7 @@ export async function compileJsonData( data: compileData, compilerVersion, files, - resolvedFileNames: new Map(), + resolvedFileNames, inferredRemappings: new Map() }; } From 0a9d3df5feff95ecf573f5890c55fc6b5af6d6f7 Mon Sep 17 00:00:00 2001 From: Dimitar Bounov Date: Mon, 23 May 2022 10:45:04 -1000 Subject: [PATCH 2/2] nit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 114f09ab..6204c38a 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build-type-parser": "tspegjs -o src/types/typeStrings/typeString_parser.ts --custom-header-file src/types/typeStrings/typeString_parser_header.ts --cache src/types/typeStrings/typeString_grammar.pegjs", "build-file-level-definitions-parser": "tspegjs -o src/compile/inference/file_level_definitions_parser.ts --custom-header-file src/compile/inference/file_level_definitions_parser_header.ts --cache src/compile/inference/file_level_definitions.pegjs", "build-parsers": "npm run build-type-parser && npm run build-file-level-definitions-parser", - "build": "npm run clean && npm run build-parsers && npm run transpile", + "build": "npm run clean && npm run build-parsers && npm run transpile && chmod u+x dist/bin/compile.js", "lint": "eslint src/ test/ --ext=ts", "lint:fix": "eslint src/ test/ --ext=ts --fix", "test": "NODE_OPTIONS='--max-old-space-size=2048' nyc mocha",