From 7b1a84825a836557619e100565d51d71d98b1494 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 1 Apr 2024 14:50:45 -0700 Subject: [PATCH 1/3] Fix some of the baseline to use correct API --- .../config/configurationExtension.ts | 2 +- src/testRunner/unittests/config/helpers.ts | 8 +- src/testRunner/unittests/tscWatch/watchApi.ts | 2 +- ...r a case insensitive host with json api.js | 103 ++++++++++++------ ...nsensitive host with jsonSourceFile api.js | 103 ++++++++++++------ ...der a case sensitive host with json api.js | 103 ++++++++++++------ ... sensitive host with jsonSourceFile api.js | 103 ++++++++++++------ ...ailing comments with jsonSourceFile api.js | 2 +- ...ile as an array with jsonSourceFile api.js | 2 +- ...ding characters with jsonSourceFile api.js | 2 +- ...ling characters with jsonSourceFile api.js | 2 +- ....json to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...false to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ....json to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...false to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ....json to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ....json to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...fixes to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...array to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...ingle to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...fixes to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...f jsx to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...odule to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...ution to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...wLine to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...arget to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ....json to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ....json to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ... numbers in tsconfig.json with json api.js | 2 +- ...n tsconfig.json with jsonSourceFile api.js | 2 +- ... libs to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...fixes to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...invalid strings with jsonSourceFile api.js | 2 +- ...t object at all with jsonSourceFile api.js | 2 +- ...ompilerOptions' with jsonSourceFile api.js | 2 +- ...compilerOptions with jsonSourceFile api.js | 2 +- 61 files changed, 336 insertions(+), 196 deletions(-) diff --git a/src/testRunner/unittests/config/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts index 99f2021c16147..ce191f5f59ccb 100644 --- a/src/testRunner/unittests/config/configurationExtension.ts +++ b/src/testRunner/unittests/config/configurationExtension.ts @@ -317,7 +317,7 @@ describe("unittests:: config:: configurationExtension", () => { baseline.push("CompilerOptions::"); baseline.push(jsonToReadableText(parsed.options)); baseline.push("FileNames::"); - baseline.push(parsed.fileNames.join()); + baseline.push(...parsed.fileNames); }, })), skipFs: true, diff --git a/src/testRunner/unittests/config/helpers.ts b/src/testRunner/unittests/config/helpers.ts index 17cac54e7931a..dd219e84afe39 100644 --- a/src/testRunner/unittests/config/helpers.ts +++ b/src/testRunner/unittests/config/helpers.ts @@ -15,9 +15,9 @@ function getParsedCommandJson( return ts.parseJsonConfigFileContent( parsed.config, host, - basePath ?? host.sys.getCurrentDirectory(), + basePath ?? ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), host.sys.getCurrentDirectory()), existingOptions, - configFileName, + ts.getNormalizedAbsolutePath(configFileName, host.sys.getCurrentDirectory()), /*resolutionStack*/ undefined, /*extraFileExtensions*/ undefined, /*extendedConfigCache*/ undefined, @@ -37,9 +37,9 @@ function getParsedCommandJsonSourceFile( return ts.parseJsonSourceFileConfigFileContent( parsed, host, - basePath ?? host.sys.getCurrentDirectory(), + basePath ?? ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), host.sys.getCurrentDirectory()), existingOptions, - configFileName, + ts.getNormalizedAbsolutePath(configFileName, host.sys.getCurrentDirectory()), /*resolutionStack*/ undefined, /*extraFileExtensions*/ undefined, /*extendedConfigCache*/ undefined, diff --git a/src/testRunner/unittests/tscWatch/watchApi.ts b/src/testRunner/unittests/tscWatch/watchApi.ts index 9565b608b5186..0498d83869ed9 100644 --- a/src/testRunner/unittests/tscWatch/watchApi.ts +++ b/src/testRunner/unittests/tscWatch/watchApi.ts @@ -46,7 +46,7 @@ describe("unittests:: tsc-watch:: watchAPI:: tsc-watch with custom module resolu system: sys, cb, }); - const parsedCommandResult = ts.parseJsonConfigFileContent(configFileJson, sys, config.path); + const parsedCommandResult = ts.parseJsonConfigFileContent(configFileJson, sys, ts.getDirectoryPath(config.path)); host.resolveModuleNames = (moduleNames, containingFile) => moduleNames.map(m => { const result = ts.resolveModuleName(m, containingFile, parsedCommandResult.options, host); diff --git a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js index 3fee8ffedb325..6598d8799d7d4 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js @@ -382,10 +382,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "tsconfig.json" + "configFilePath": "c:/dev/tsconfig.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts +c:/dev/main.ts +c:/dev/supplemental.ts Errors:: @@ -396,10 +397,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": false, - "configFilePath": "tsconfig.nostrictnull.json" + "configFilePath": "c:/dev/tsconfig.nostrictnull.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts +c:/dev/main.ts +c:/dev/supplemental.ts Errors:: @@ -408,10 +410,14 @@ configFileName:: circular.json CompilerOptions:: { "module": 2, - "configFilePath": "circular.json" + "configFilePath": "c:/dev/circular.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS18000: Circularity detected while resolving configuration: c:/dev/circular.json -> c:/dev/circular2.json -> c:/dev/circular.json @@ -421,10 +427,14 @@ configFileName:: missing.json CompilerOptions:: { "types": [], - "configFilePath": "missing.json" + "configFilePath": "c:/dev/missing.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS6053: File './missing2' not found. @@ -434,10 +444,14 @@ configFileName:: failure.json CompilerOptions:: { "typeRoots": [], - "configFilePath": "failure.json" + "configFilePath": "c:/dev/failure.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: failure2.json:2:3 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? @@ -449,10 +463,14 @@ can error when 'extends' is not a string or Array configFileName:: extends.json CompilerOptions:: { - "configFilePath": "extends.json" + "configFilePath": "c:/dev/extends.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS5024: Compiler option 'extends' requires a value of type string or Array. @@ -461,10 +479,14 @@ can error when 'extends' is given an empty string configFileName:: extends3.json CompilerOptions:: { - "configFilePath": "extends3.json" + "configFilePath": "c:/dev/extends3.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -473,10 +495,14 @@ can error when 'extends' is given an empty string in an array configFileName:: extends4.json CompilerOptions:: { - "configFilePath": "extends4.json" + "configFilePath": "c:/dev/extends4.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -488,7 +514,7 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "configs/third.json" + "configFilePath": "c:/dev/configs/third.json" } FileNames:: c:/dev/supplemental.ts @@ -503,10 +529,11 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fourth.json" + "configFilePath": "c:/dev/configs/fourth.json" } FileNames:: c:/dev/main.ts +c:/dev/supplemental.ts Errors:: @@ -518,7 +545,7 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fifth.json" + "configFilePath": "c:/dev/configs/fifth.json" } FileNames:: c:/dev/tests/utils.ts @@ -530,7 +557,7 @@ configFileName:: tsconfig.extendsBox.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBox.json" + "configFilePath": "c:/dev/tsconfig.extendsBox.json" } FileNames:: c:/dev/main.ts @@ -542,7 +569,7 @@ configFileName:: tsconfig.extendsStrict.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrict.json" + "configFilePath": "c:/dev/tsconfig.extendsStrict.json" } FileNames:: c:/dev/main.ts @@ -554,7 +581,7 @@ configFileName:: tsconfig.extendsUnStrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsUnStrict.json" + "configFilePath": "c:/dev/tsconfig.extendsUnStrict.json" } FileNames:: c:/dev/main.ts @@ -566,7 +593,7 @@ configFileName:: tsconfig.extendsStrictExtension.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrictExtension.json" + "configFilePath": "c:/dev/tsconfig.extendsStrictExtension.json" } FileNames:: c:/dev/main.ts @@ -578,7 +605,7 @@ configFileName:: tsconfig.extendsBoxImplied.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImplied.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImplied.json" } FileNames:: c:/dev/main.ts @@ -590,7 +617,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImpliedUnstrict.json" } FileNames:: c:/dev/main.ts @@ -602,7 +629,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json" } FileNames:: c:/dev/main.ts @@ -614,7 +641,7 @@ configFileName:: tsconfig.extendsBoxImpliedPath.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImpliedPath.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImpliedPath.json" } FileNames:: c:/dev/main.ts @@ -626,7 +653,7 @@ configFileName:: tsconfig.extendsFoo.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsFoo.json" + "configFilePath": "c:/dev/tsconfig.extendsFoo.json" } FileNames:: c:/dev/main.ts @@ -641,10 +668,10 @@ CompilerOptions:: "noImplicitAny": false, "strictNullChecks": false, "module": 4, - "configFilePath": "configs/extendsArrayFifth.json" + "configFilePath": "c:/dev/configs/extendsArrayFifth.json" } FileNames:: - +c:/dev/supplemental.ts Errors:: @@ -653,10 +680,14 @@ configFileName:: extendsArrayFails.json CompilerOptions:: { "types": [], - "configFilePath": "extendsArrayFails.json" + "configFilePath": "c:/dev/extendsArrayFails.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS6053: File './missingFile' not found. @@ -665,10 +696,14 @@ can error when 'extends' is not a string or Array2 configFileName:: extendsArrayFails2.json CompilerOptions:: { - "configFilePath": "extendsArrayFails2.json" + "configFilePath": "c:/dev/extendsArrayFails2.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS5024: Compiler option 'extends' requires a value of type string. diff --git a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js index 70421f19a5b6a..edfedcd208a18 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js @@ -382,10 +382,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "tsconfig.json" + "configFilePath": "c:/dev/tsconfig.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts +c:/dev/main.ts +c:/dev/supplemental.ts Errors:: @@ -396,10 +397,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": false, - "configFilePath": "tsconfig.nostrictnull.json" + "configFilePath": "c:/dev/tsconfig.nostrictnull.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts +c:/dev/main.ts +c:/dev/supplemental.ts Errors:: @@ -408,10 +410,14 @@ configFileName:: circular.json CompilerOptions:: { "module": 2, - "configFilePath": "circular.json" + "configFilePath": "c:/dev/circular.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: error TS18000: Circularity detected while resolving configuration: c:/dev/circular.json -> c:/dev/circular2.json -> c:/dev/circular.json @@ -421,10 +427,14 @@ configFileName:: missing.json CompilerOptions:: { "types": [], - "configFilePath": "missing.json" + "configFilePath": "c:/dev/missing.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: missing.json:2:14 - error TS6053: File './missing2' not found. @@ -437,10 +447,14 @@ configFileName:: failure.json CompilerOptions:: { "typeRoots": [], - "configFilePath": "failure.json" + "configFilePath": "c:/dev/failure.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: failure2.json:2:3 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? @@ -452,10 +466,14 @@ can error when 'extends' is not a string or Array configFileName:: extends.json CompilerOptions:: { - "configFilePath": "extends.json" + "configFilePath": "c:/dev/extends.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: extends.json:2:14 - error TS5024: Compiler option 'extends' requires a value of type string or Array. @@ -467,10 +485,14 @@ can error when 'extends' is given an empty string configFileName:: extends3.json CompilerOptions:: { - "configFilePath": "extends3.json" + "configFilePath": "c:/dev/extends3.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: extends3.json:2:14 - error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -482,10 +504,14 @@ can error when 'extends' is given an empty string in an array configFileName:: extends4.json CompilerOptions:: { - "configFilePath": "extends4.json" + "configFilePath": "c:/dev/extends4.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: extends4.json:3:5 - error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -500,7 +526,7 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "configs/third.json" + "configFilePath": "c:/dev/configs/third.json" } FileNames:: c:/dev/supplemental.ts @@ -515,10 +541,11 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fourth.json" + "configFilePath": "c:/dev/configs/fourth.json" } FileNames:: c:/dev/main.ts +c:/dev/supplemental.ts Errors:: @@ -530,7 +557,7 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fifth.json" + "configFilePath": "c:/dev/configs/fifth.json" } FileNames:: c:/dev/tests/utils.ts @@ -542,7 +569,7 @@ configFileName:: tsconfig.extendsBox.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBox.json" + "configFilePath": "c:/dev/tsconfig.extendsBox.json" } FileNames:: c:/dev/main.ts @@ -554,7 +581,7 @@ configFileName:: tsconfig.extendsStrict.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrict.json" + "configFilePath": "c:/dev/tsconfig.extendsStrict.json" } FileNames:: c:/dev/main.ts @@ -566,7 +593,7 @@ configFileName:: tsconfig.extendsUnStrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsUnStrict.json" + "configFilePath": "c:/dev/tsconfig.extendsUnStrict.json" } FileNames:: c:/dev/main.ts @@ -578,7 +605,7 @@ configFileName:: tsconfig.extendsStrictExtension.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrictExtension.json" + "configFilePath": "c:/dev/tsconfig.extendsStrictExtension.json" } FileNames:: c:/dev/main.ts @@ -590,7 +617,7 @@ configFileName:: tsconfig.extendsBoxImplied.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImplied.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImplied.json" } FileNames:: c:/dev/main.ts @@ -602,7 +629,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImpliedUnstrict.json" } FileNames:: c:/dev/main.ts @@ -614,7 +641,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json" } FileNames:: c:/dev/main.ts @@ -626,7 +653,7 @@ configFileName:: tsconfig.extendsBoxImpliedPath.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImpliedPath.json" + "configFilePath": "c:/dev/tsconfig.extendsBoxImpliedPath.json" } FileNames:: c:/dev/main.ts @@ -638,7 +665,7 @@ configFileName:: tsconfig.extendsFoo.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsFoo.json" + "configFilePath": "c:/dev/tsconfig.extendsFoo.json" } FileNames:: c:/dev/main.ts @@ -653,10 +680,10 @@ CompilerOptions:: "noImplicitAny": false, "strictNullChecks": false, "module": 4, - "configFilePath": "configs/extendsArrayFifth.json" + "configFilePath": "c:/dev/configs/extendsArrayFifth.json" } FileNames:: - +c:/dev/supplemental.ts Errors:: @@ -665,10 +692,14 @@ configFileName:: extendsArrayFails.json CompilerOptions:: { "types": [], - "configFilePath": "extendsArrayFails.json" + "configFilePath": "c:/dev/extendsArrayFails.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: extendsArrayFails.json:3:5 - error TS6053: File './missingFile' not found. @@ -680,10 +711,14 @@ can error when 'extends' is not a string or Array2 configFileName:: extendsArrayFails2.json CompilerOptions:: { - "configFilePath": "extendsArrayFails2.json" + "configFilePath": "c:/dev/extendsArrayFails2.json" } FileNames:: -c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +c:/dev/main.ts +c:/dev/supplemental.ts +c:/dev/tests/utils.ts +c:/dev/tests/baselines/first/output.ts +c:/dev/tests/unit/spec.ts Errors:: extendsArrayFails2.json:3:5 - error TS5024: Compiler option 'extends' requires a value of type string. diff --git a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js index b0d9dd7826fa1..15d00a7f345b7 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js @@ -382,10 +382,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "tsconfig.json" + "configFilePath": "/dev/tsconfig.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts +/dev/main.ts +/dev/supplemental.ts Errors:: @@ -396,10 +397,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": false, - "configFilePath": "tsconfig.nostrictnull.json" + "configFilePath": "/dev/tsconfig.nostrictnull.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts +/dev/main.ts +/dev/supplemental.ts Errors:: @@ -408,10 +410,14 @@ configFileName:: circular.json CompilerOptions:: { "module": 2, - "configFilePath": "circular.json" + "configFilePath": "/dev/circular.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS18000: Circularity detected while resolving configuration: /dev/circular.json -> /dev/circular2.json -> /dev/circular.json @@ -421,10 +427,14 @@ configFileName:: missing.json CompilerOptions:: { "types": [], - "configFilePath": "missing.json" + "configFilePath": "/dev/missing.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS6053: File './missing2' not found. @@ -434,10 +444,14 @@ configFileName:: failure.json CompilerOptions:: { "typeRoots": [], - "configFilePath": "failure.json" + "configFilePath": "/dev/failure.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: failure2.json:2:3 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? @@ -449,10 +463,14 @@ can error when 'extends' is not a string or Array configFileName:: extends.json CompilerOptions:: { - "configFilePath": "extends.json" + "configFilePath": "/dev/extends.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS5024: Compiler option 'extends' requires a value of type string or Array. @@ -461,10 +479,14 @@ can error when 'extends' is given an empty string configFileName:: extends3.json CompilerOptions:: { - "configFilePath": "extends3.json" + "configFilePath": "/dev/extends3.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -473,10 +495,14 @@ can error when 'extends' is given an empty string in an array configFileName:: extends4.json CompilerOptions:: { - "configFilePath": "extends4.json" + "configFilePath": "/dev/extends4.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -488,7 +514,7 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "configs/third.json" + "configFilePath": "/dev/configs/third.json" } FileNames:: /dev/supplemental.ts @@ -503,10 +529,11 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fourth.json" + "configFilePath": "/dev/configs/fourth.json" } FileNames:: /dev/main.ts +/dev/supplemental.ts Errors:: @@ -518,7 +545,7 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fifth.json" + "configFilePath": "/dev/configs/fifth.json" } FileNames:: /dev/tests/utils.ts @@ -530,7 +557,7 @@ configFileName:: tsconfig.extendsBox.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBox.json" + "configFilePath": "/dev/tsconfig.extendsBox.json" } FileNames:: /dev/main.ts @@ -542,7 +569,7 @@ configFileName:: tsconfig.extendsStrict.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrict.json" + "configFilePath": "/dev/tsconfig.extendsStrict.json" } FileNames:: /dev/main.ts @@ -554,7 +581,7 @@ configFileName:: tsconfig.extendsUnStrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsUnStrict.json" + "configFilePath": "/dev/tsconfig.extendsUnStrict.json" } FileNames:: /dev/main.ts @@ -566,7 +593,7 @@ configFileName:: tsconfig.extendsStrictExtension.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrictExtension.json" + "configFilePath": "/dev/tsconfig.extendsStrictExtension.json" } FileNames:: /dev/main.ts @@ -578,7 +605,7 @@ configFileName:: tsconfig.extendsBoxImplied.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImplied.json" + "configFilePath": "/dev/tsconfig.extendsBoxImplied.json" } FileNames:: /dev/main.ts @@ -590,7 +617,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" + "configFilePath": "/dev/tsconfig.extendsBoxImpliedUnstrict.json" } FileNames:: /dev/main.ts @@ -602,7 +629,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" + "configFilePath": "/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json" } FileNames:: /dev/main.ts @@ -614,7 +641,7 @@ configFileName:: tsconfig.extendsBoxImpliedPath.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImpliedPath.json" + "configFilePath": "/dev/tsconfig.extendsBoxImpliedPath.json" } FileNames:: /dev/main.ts @@ -626,7 +653,7 @@ configFileName:: tsconfig.extendsFoo.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsFoo.json" + "configFilePath": "/dev/tsconfig.extendsFoo.json" } FileNames:: /dev/main.ts @@ -641,10 +668,10 @@ CompilerOptions:: "noImplicitAny": false, "strictNullChecks": false, "module": 4, - "configFilePath": "configs/extendsArrayFifth.json" + "configFilePath": "/dev/configs/extendsArrayFifth.json" } FileNames:: - +/dev/supplemental.ts Errors:: @@ -653,10 +680,14 @@ configFileName:: extendsArrayFails.json CompilerOptions:: { "types": [], - "configFilePath": "extendsArrayFails.json" + "configFilePath": "/dev/extendsArrayFails.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS6053: File './missingFile' not found. @@ -665,10 +696,14 @@ can error when 'extends' is not a string or Array2 configFileName:: extendsArrayFails2.json CompilerOptions:: { - "configFilePath": "extendsArrayFails2.json" + "configFilePath": "/dev/extendsArrayFails2.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS5024: Compiler option 'extends' requires a value of type string. diff --git a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js index 260443b0c0f80..6e7a3c42700a9 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js @@ -382,10 +382,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "tsconfig.json" + "configFilePath": "/dev/tsconfig.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts +/dev/main.ts +/dev/supplemental.ts Errors:: @@ -396,10 +397,11 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": false, - "configFilePath": "tsconfig.nostrictnull.json" + "configFilePath": "/dev/tsconfig.nostrictnull.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts +/dev/main.ts +/dev/supplemental.ts Errors:: @@ -408,10 +410,14 @@ configFileName:: circular.json CompilerOptions:: { "module": 2, - "configFilePath": "circular.json" + "configFilePath": "/dev/circular.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: error TS18000: Circularity detected while resolving configuration: /dev/circular.json -> /dev/circular2.json -> /dev/circular.json @@ -421,10 +427,14 @@ configFileName:: missing.json CompilerOptions:: { "types": [], - "configFilePath": "missing.json" + "configFilePath": "/dev/missing.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: missing.json:2:14 - error TS6053: File './missing2' not found. @@ -437,10 +447,14 @@ configFileName:: failure.json CompilerOptions:: { "typeRoots": [], - "configFilePath": "failure.json" + "configFilePath": "/dev/failure.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: failure2.json:2:3 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? @@ -452,10 +466,14 @@ can error when 'extends' is not a string or Array configFileName:: extends.json CompilerOptions:: { - "configFilePath": "extends.json" + "configFilePath": "/dev/extends.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: extends.json:2:14 - error TS5024: Compiler option 'extends' requires a value of type string or Array. @@ -467,10 +485,14 @@ can error when 'extends' is given an empty string configFileName:: extends3.json CompilerOptions:: { - "configFilePath": "extends3.json" + "configFilePath": "/dev/extends3.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: extends3.json:2:14 - error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -482,10 +504,14 @@ can error when 'extends' is given an empty string in an array configFileName:: extends4.json CompilerOptions:: { - "configFilePath": "extends4.json" + "configFilePath": "/dev/extends4.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: extends4.json:3:5 - error TS18051: Compiler option 'extends' cannot be given an empty string. @@ -500,7 +526,7 @@ CompilerOptions:: "allowJs": true, "noImplicitAny": true, "strictNullChecks": true, - "configFilePath": "configs/third.json" + "configFilePath": "/dev/configs/third.json" } FileNames:: /dev/supplemental.ts @@ -515,10 +541,11 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fourth.json" + "configFilePath": "/dev/configs/fourth.json" } FileNames:: /dev/main.ts +/dev/supplemental.ts Errors:: @@ -530,7 +557,7 @@ CompilerOptions:: "noImplicitAny": true, "strictNullChecks": true, "module": 4, - "configFilePath": "configs/fifth.json" + "configFilePath": "/dev/configs/fifth.json" } FileNames:: /dev/tests/utils.ts @@ -542,7 +569,7 @@ configFileName:: tsconfig.extendsBox.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBox.json" + "configFilePath": "/dev/tsconfig.extendsBox.json" } FileNames:: /dev/main.ts @@ -554,7 +581,7 @@ configFileName:: tsconfig.extendsStrict.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrict.json" + "configFilePath": "/dev/tsconfig.extendsStrict.json" } FileNames:: /dev/main.ts @@ -566,7 +593,7 @@ configFileName:: tsconfig.extendsUnStrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsUnStrict.json" + "configFilePath": "/dev/tsconfig.extendsUnStrict.json" } FileNames:: /dev/main.ts @@ -578,7 +605,7 @@ configFileName:: tsconfig.extendsStrictExtension.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsStrictExtension.json" + "configFilePath": "/dev/tsconfig.extendsStrictExtension.json" } FileNames:: /dev/main.ts @@ -590,7 +617,7 @@ configFileName:: tsconfig.extendsBoxImplied.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImplied.json" + "configFilePath": "/dev/tsconfig.extendsBoxImplied.json" } FileNames:: /dev/main.ts @@ -602,7 +629,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrict.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" + "configFilePath": "/dev/tsconfig.extendsBoxImpliedUnstrict.json" } FileNames:: /dev/main.ts @@ -614,7 +641,7 @@ configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json CompilerOptions:: { "strict": false, - "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" + "configFilePath": "/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json" } FileNames:: /dev/main.ts @@ -626,7 +653,7 @@ configFileName:: tsconfig.extendsBoxImpliedPath.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsBoxImpliedPath.json" + "configFilePath": "/dev/tsconfig.extendsBoxImpliedPath.json" } FileNames:: /dev/main.ts @@ -638,7 +665,7 @@ configFileName:: tsconfig.extendsFoo.json CompilerOptions:: { "strict": true, - "configFilePath": "tsconfig.extendsFoo.json" + "configFilePath": "/dev/tsconfig.extendsFoo.json" } FileNames:: /dev/main.ts @@ -653,10 +680,10 @@ CompilerOptions:: "noImplicitAny": false, "strictNullChecks": false, "module": 4, - "configFilePath": "configs/extendsArrayFifth.json" + "configFilePath": "/dev/configs/extendsArrayFifth.json" } FileNames:: - +/dev/supplemental.ts Errors:: @@ -665,10 +692,14 @@ configFileName:: extendsArrayFails.json CompilerOptions:: { "types": [], - "configFilePath": "extendsArrayFails.json" + "configFilePath": "/dev/extendsArrayFails.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: extendsArrayFails.json:3:5 - error TS6053: File './missingFile' not found. @@ -680,10 +711,14 @@ can error when 'extends' is not a string or Array2 configFileName:: extendsArrayFails2.json CompilerOptions:: { - "configFilePath": "extendsArrayFails2.json" + "configFilePath": "/dev/extendsArrayFails2.json" } FileNames:: -/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +/dev/main.ts +/dev/supplemental.ts +/dev/tests/utils.ts +/dev/tests/baselines/first/output.ts +/dev/tests/unit/spec.ts Errors:: extendsArrayFails2.json:3:5 - error TS5024: Compiler option 'extends' requires a value of type string. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js index 1540688aeb520..f5e7684c03bd5 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js @@ -12,7 +12,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js index 90fa66bb14fc7..b08dcf5dbe664 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js @@ -17,7 +17,7 @@ configFileName:: tsconfig.json CompilerOptions:: { "target": 99, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js index 84ae731089bf3..238805514532f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js @@ -17,7 +17,7 @@ configFileName:: tsconfig.json CompilerOptions:: { "target": 99, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:1:1 - error TS1136: Property assignment expected. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js index 5b96f9b0eb8d4..9540b9625fe0f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js @@ -17,7 +17,7 @@ configFileName:: tsconfig.json CompilerOptions:: { "target": 99, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js index 0879e79e7177c..17e9d16983b0f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js @@ -38,7 +38,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js index 0879e79e7177c..17e9d16983b0f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js @@ -38,7 +38,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js index 5b9debc51a06b..9e75e6c5b2183 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js @@ -39,7 +39,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js index 5b9debc51a06b..9e75e6c5b2183 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js @@ -39,7 +39,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js index c037bbfc6e645..f3cd45bb0c341 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js @@ -33,7 +33,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js index c037bbfc6e645..f3cd45bb0c341 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js @@ -33,7 +33,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js index a2cdca3964103..9bc3ff2556f17 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js @@ -35,7 +35,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js index a2cdca3964103..9bc3ff2556f17 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js @@ -35,7 +35,7 @@ CompilerOptions:: "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js index cb4cd771c7a9b..52e1b30909b07 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js @@ -17,7 +17,7 @@ CompilerOptions:: "allowSyntheticDefaultImports": true, "skipLibCheck": true, "noEmit": true, - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js index cb4cd771c7a9b..52e1b30909b07 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js @@ -17,7 +17,7 @@ CompilerOptions:: "allowSyntheticDefaultImports": true, "skipLibCheck": true, "noEmit": true, - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js index 35bf143090a47..360c9492733a4 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js @@ -12,7 +12,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js index 35bf143090a47..360c9492733a4 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js @@ -12,7 +12,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js index ca5e5fb2d69a2..e28ef48ec639c 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js @@ -25,7 +25,7 @@ CompilerOptions:: "noImplicitAny": false, "sourceMap": false, "lib": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js index ca5e5fb2d69a2..e28ef48ec639c 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js @@ -25,7 +25,7 @@ CompilerOptions:: "noImplicitAny": false, "sourceMap": false, "lib": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js index cb440a9a82d1e..188fa7ec355a0 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js @@ -17,7 +17,7 @@ configFileName:: tsconfig.json CompilerOptions:: { "moduleSuffixes": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js index cb440a9a82d1e..188fa7ec355a0 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js @@ -17,7 +17,7 @@ configFileName:: tsconfig.json CompilerOptions:: { "moduleSuffixes": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js index 8d6d02b83da03..04028e2fda1d2 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js @@ -27,7 +27,7 @@ CompilerOptions:: "noImplicitAny": false, "sourceMap": false, "lib": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js index 9d5d31df45654..768504a015812 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js @@ -27,7 +27,7 @@ CompilerOptions:: "noImplicitAny": false, "sourceMap": false, "lib": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js index ab06ce373a023..12cd9f9a69f6e 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js @@ -30,7 +30,7 @@ CompilerOptions:: "lib": [ "lib.es5.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js index d703ffd1c9188..b220f686852a8 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "lib": [ "lib.es5.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js index ca3303bf9ec7c..f30e48aac630b 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js @@ -21,7 +21,7 @@ CompilerOptions:: "moduleSuffixes": [ "" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js index ca3303bf9ec7c..f30e48aac630b 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js @@ -21,7 +21,7 @@ CompilerOptions:: "moduleSuffixes": [ "" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js index b5a7418acbc06..b6111d6e2d365 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js @@ -23,7 +23,7 @@ CompilerOptions:: ".ios", "" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js index b5a7418acbc06..b6111d6e2d365 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js @@ -23,7 +23,7 @@ CompilerOptions:: ".ios", "" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js index 3f866a5e8f25e..78e37a9814700 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js @@ -24,7 +24,7 @@ CompilerOptions:: "target": 1, "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js index 728db743229c7..0c38a81d4e2d9 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js @@ -24,7 +24,7 @@ CompilerOptions:: "target": 1, "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:7:12 - error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js index c7f64f917ece5..53df38f31b261 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js @@ -32,7 +32,7 @@ CompilerOptions:: "lib.es5.d.ts", "lib.es2015.core.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js index 28ab911808787..d528f18a59522 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js @@ -32,7 +32,7 @@ CompilerOptions:: "lib.es5.d.ts", "lib.es2015.core.d.ts" ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js index 256ff72a951f8..13680f74379e6 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js @@ -22,7 +22,7 @@ CompilerOptions:: "target": 1, "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext', 'preserve'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js index c37fd14ef9cc6..e687f319a7b13 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js @@ -22,7 +22,7 @@ CompilerOptions:: "target": 1, "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:3:15 - error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext', 'preserve'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js index 5204cf0d28744..3ca29cf41cf23 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js @@ -20,7 +20,7 @@ CompilerOptions:: { "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--moduleResolution' option must be: 'node10', 'classic', 'node16', 'nodenext', 'bundler'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js index b2f2b2263ca90..e180d422e0f3e 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js @@ -20,7 +20,7 @@ CompilerOptions:: { "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:3:25 - error TS6046: Argument for '--moduleResolution' option must be: 'node10', 'classic', 'node16', 'nodenext', 'bundler'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js index cb6b2c119694f..2666d2098ad76 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js @@ -22,7 +22,7 @@ CompilerOptions:: "target": 1, "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--newLine' option must be: 'crlf', 'lf'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js index eb7498cff0220..4ffb29653414a 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js @@ -22,7 +22,7 @@ CompilerOptions:: "target": 1, "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:3:16 - error TS6046: Argument for '--newLine' option must be: 'crlf', 'lf'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js index 57c0d1a0336c3..50a4513416c72 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js @@ -20,7 +20,7 @@ CompilerOptions:: { "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--target' option must be: 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js index 69558be1110af..689328c54746c 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js @@ -20,7 +20,7 @@ CompilerOptions:: { "noImplicitAny": false, "sourceMap": false, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:3:15 - error TS6046: Argument for '--target' option must be: 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js index 7994e903e05a9..254f00aa0a649 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js @@ -21,7 +21,7 @@ CompilerOptions:: "allowSyntheticDefaultImports": true, "skipLibCheck": true, "noEmit": true, - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: error TS5023: Unknown compiler option 'modu'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js index 5a35f7a40261d..23d4eaca40cca 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js @@ -21,7 +21,7 @@ CompilerOptions:: "allowSyntheticDefaultImports": true, "skipLibCheck": true, "noEmit": true, - "configFilePath": "jsconfig.json" + "configFilePath": "/apath/jsconfig.json" } Errors:: jsconfig.json:3:5 - error TS5023: Unknown compiler option 'modu'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js index c3e9e9df54a55..946cc5ede2620 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js @@ -16,7 +16,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS5023: Unknown compiler option 'modu'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js index dea38289c15d3..c6ab74a128249 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js @@ -16,7 +16,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:3:5 - error TS5023: Unknown compiler option 'modu'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js index 120701d86ace1..9c80ddcf65864 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js @@ -19,7 +19,7 @@ CompilerOptions:: { "allowJs": true, "maxNodeModuleJsDepth": -1, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js index 120701d86ace1..9c80ddcf65864 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js @@ -19,7 +19,7 @@ CompilerOptions:: { "allowJs": true, "maxNodeModuleJsDepth": -1, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js index 764db5904b07c..910344faabca5 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js @@ -27,7 +27,7 @@ CompilerOptions:: "noImplicitAny": false, "sourceMap": false, "lib": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js index fc3469de92bf0..0878868862dc7 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js @@ -27,7 +27,7 @@ CompilerOptions:: "noImplicitAny": false, "sourceMap": false, "lib": [], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js index 0305e62a881ce..428ff44714d4f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js @@ -21,7 +21,7 @@ CompilerOptions:: "moduleSuffixes": [ " " ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js index 0305e62a881ce..428ff44714d4f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js @@ -21,7 +21,7 @@ CompilerOptions:: "moduleSuffixes": [ " " ], - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js index 009f13cf4e714..0e82b8c32d6b0 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js @@ -33,7 +33,7 @@ CompilerOptions:: { "module": 99, "experimentalDecorators": true, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js index dcbb9d1d452fc..ed28076ddba8e 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js @@ -12,7 +12,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js index 171b47e984e2f..b54423a5fdd72 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js @@ -18,7 +18,7 @@ configFileName:: tsconfig.json CompilerOptions:: { "module": 99, - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js index 8dac8661f4bb6..518b136204fc1 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js @@ -14,7 +14,7 @@ Fs:: configFileName:: tsconfig.json CompilerOptions:: { - "configFilePath": "tsconfig.json" + "configFilePath": "/apath/tsconfig.json" } Errors:: tsconfig.json:2:13 - error TS6258: 'module' should be set inside the 'compilerOptions' object of the config json file From 9fcd0d6739066e98b8093d05431db7add7d80ee7 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Apr 2024 12:12:50 -0700 Subject: [PATCH 2/3] Allow $configDir as a string to be substituted in config file options --- src/compiler/commandLineParser.ts | 165 ++++- src/compiler/types.ts | 6 +- src/compiler/watch.ts | 7 +- src/server/editorServices.ts | 38 +- src/testRunner/tests.ts | 1 + .../config/configurationExtension.ts | 43 ++ src/testRunner/unittests/config/showConfig.ts | 15 + .../config/tsconfigParsingWatchOptions.ts | 12 + src/testRunner/unittests/helpers/extends.ts | 68 ++ src/testRunner/unittests/tsbuild/extends.ts | 14 +- .../unittests/tsbuildWatch/extends.ts | 20 + src/testRunner/unittests/tsc/extends.ts | 28 +- src/testRunner/unittests/tscWatch/extends.ts | 19 +- src/testRunner/unittests/tsserver/extends.ts | 25 +- ...only once under a case insensitive host.js | 75 +++ ...y only once under a case sensitive host.js | 75 +++ ...only once under a case insensitive host.js | 75 +++ ...s only once under a case sensitive host.js | 75 +++ ...r a case insensitive host with json api.js | 138 ++++ ...nsensitive host with jsonSourceFile api.js | 138 ++++ ...der a case sensitive host with json api.js | 138 ++++ ... sensitive host with jsonSourceFile api.js | 138 ++++ .../tsconfig.json | 27 + ...ig file with watchOptions with json api.js | 29 + ...th watchOptions with jsonSourceFile api.js | 29 + .../tsbuild/extends/configDir-template.js | 189 ++++++ .../extends/configDir-template.js | 386 +++++++++++ .../extends/configDir-template-showConfig.js | 144 +++++ .../configDir-template-with-commandline.js | 182 ++++++ .../tsc/extends/configDir-template.js | 182 ++++++ .../tscWatch/extends/configDir-template.js | 444 +++++++++++++ .../tsserver/tsserver/configDir-template.js | 598 ++++++++++++++++++ 32 files changed, 3489 insertions(+), 34 deletions(-) create mode 100644 src/testRunner/unittests/tsbuildWatch/extends.ts create mode 100644 tests/baselines/reference/config/showConfig/Show TSConfig with configDir template template/tsconfig.json create mode 100644 tests/baselines/reference/tsbuild/extends/configDir-template.js create mode 100644 tests/baselines/reference/tsbuildWatch/extends/configDir-template.js create mode 100644 tests/baselines/reference/tsc/extends/configDir-template-showConfig.js create mode 100644 tests/baselines/reference/tsc/extends/configDir-template-with-commandline.js create mode 100644 tests/baselines/reference/tsc/extends/configDir-template.js create mode 100644 tests/baselines/reference/tscWatch/extends/configDir-template.js create mode 100644 tests/baselines/reference/tsserver/tsserver/configDir-template.js diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index ade646ba086d0..b14a97dc1a37e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -53,6 +53,7 @@ import { getFileMatcherPatterns, getLocaleSpecificMessage, getNormalizedAbsolutePath, + getOwnKeys, getRegexFromPattern, getRegularExpressionForWildcard, getRegularExpressionsForWildcards, @@ -313,6 +314,7 @@ export const optionsForWatch: CommandLineOption[] = [ isFilePath: true, extraValidation: specToDiagnostic, }, + allowConfigDirTemplateSubstitution: true, category: Diagnostics.Watch_and_Build_Modes, description: Diagnostics.Remove_a_list_of_directories_from_the_watch_process, }, @@ -325,6 +327,7 @@ export const optionsForWatch: CommandLineOption[] = [ isFilePath: true, extraValidation: specToDiagnostic, }, + allowConfigDirTemplateSubstitution: true, category: Diagnostics.Watch_and_Build_Modes, description: Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing, }, @@ -1033,6 +1036,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ name: "paths", type: "object", affectsModuleResolution: true, + allowConfigDirTemplateSubstitution: true, isTSConfigOnly: true, category: Diagnostics.Modules, description: Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations, @@ -1050,6 +1054,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ isFilePath: true, }, affectsModuleResolution: true, + allowConfigDirTemplateSubstitution: true, category: Diagnostics.Modules, description: Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules, transpileOptionValue: undefined, @@ -1064,6 +1069,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ isFilePath: true, }, affectsModuleResolution: true, + allowConfigDirTemplateSubstitution: true, category: Diagnostics.Modules, description: Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types, }, @@ -1599,6 +1605,15 @@ export const optionsAffectingProgramStructure: readonly CommandLineOption[] = op /** @internal */ export const transpileOptionValueCompilerOptions: readonly CommandLineOption[] = optionDeclarations.filter(option => hasProperty(option, "transpileOptionValue")); +/** @internal */ +export const configDirTemplateSubstitutionOptions: readonly CommandLineOption[] = optionDeclarations.filter( + option => option.allowConfigDirTemplateSubstitution || (!option.isCommandLineOnly && option.isFilePath), +); +/** @internal */ +export const configDirTemplateSubstitutionWatchOptions: readonly CommandLineOption[] = optionsForWatch.filter( + option => option.allowConfigDirTemplateSubstitution || (!option.isCommandLineOnly && option.isFilePath), +); + // Build related options /** @internal */ export const optionsForBuild: CommandLineOption[] = [ @@ -2627,6 +2642,9 @@ function serializeOptionBaseObject( if (pathOptions && optionDefinition.isFilePath) { result.set(name, getRelativePathFromFile(pathOptions.configFilePath, getNormalizedAbsolutePath(value as string, getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName!)); } + else if (pathOptions && optionDefinition.type === "list" && optionDefinition.element.isFilePath) { + result.set(name, (value as string[]).map(v => getRelativePathFromFile(pathOptions.configFilePath, getNormalizedAbsolutePath(v, getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName!))); + } else { result.set(name, value); } @@ -2890,16 +2908,17 @@ function parseJsonConfigFileContentWorker( const parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache); const { raw } = parsedConfig; const options = extend(existingOptions, parsedConfig.options || {}); - const watchOptions = existingWatchOptions && parsedConfig.watchOptions ? + let watchOptions = existingWatchOptions && parsedConfig.watchOptions ? extend(existingWatchOptions, parsedConfig.watchOptions) : parsedConfig.watchOptions || existingWatchOptions; - + handleOptionConfigDirTemplateSubstitution(options, configDirTemplateSubstitutionOptions, basePath); + watchOptions = handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, basePath, !existingWatchOptions || !parsedConfig.watchOptions); options.configFilePath = configFileName && normalizeSlashes(configFileName); + const basePathForFileNames = normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath); const configFileSpecs = getConfigFileSpecs(); if (sourceFile) sourceFile.configFileSpecs = configFileSpecs; setConfigFileInOptions(options, sourceFile); - const basePathForFileNames = normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath); return { options, watchOptions, @@ -2954,6 +2973,7 @@ function parseJsonConfigFileContentWorker( includeSpecs = [defaultIncludeSpec]; isDefaultIncludeSpec = true; } + let validatedIncludeSpecsBeforeSubstitution: readonly string[] | undefined, validatedExcludeSpecsBeforeSubstitution: readonly string[] | undefined; let validatedIncludeSpecs: readonly string[] | undefined, validatedExcludeSpecs: readonly string[] | undefined; // The exclude spec list is converted into a regular expression, which allows us to quickly @@ -2961,20 +2981,40 @@ function parseJsonConfigFileContentWorker( // file system. if (includeSpecs) { - validatedIncludeSpecs = validateSpecs(includeSpecs, errors, /*disallowTrailingRecursion*/ true, sourceFile, "include"); + validatedIncludeSpecsBeforeSubstitution = validateSpecs(includeSpecs, errors, /*disallowTrailingRecursion*/ true, sourceFile, "include"); + validatedIncludeSpecs = getSubstitutedStringArrayWithConfigDirTemplate( + validatedIncludeSpecsBeforeSubstitution, + basePathForFileNames, + /*createCopyOnSubstitute*/ true, + ) || validatedIncludeSpecsBeforeSubstitution; } if (excludeSpecs) { - validatedExcludeSpecs = validateSpecs(excludeSpecs, errors, /*disallowTrailingRecursion*/ false, sourceFile, "exclude"); + validatedExcludeSpecsBeforeSubstitution = validateSpecs(excludeSpecs, errors, /*disallowTrailingRecursion*/ false, sourceFile, "exclude"); + validatedExcludeSpecs = getSubstitutedStringArrayWithConfigDirTemplate( + validatedExcludeSpecsBeforeSubstitution, + basePathForFileNames, + /*createCopyOnSubstitute*/ true, + ) || validatedExcludeSpecsBeforeSubstitution; } + const validatedFilesSpecBeforeSubstitution = filter(filesSpecs, isString); + const validatedFilesSpec = getSubstitutedStringArrayWithConfigDirTemplate( + validatedFilesSpecBeforeSubstitution, + basePathForFileNames, + /*createCopyOnSubstitute*/ true, + ) || validatedFilesSpecBeforeSubstitution; + return { filesSpecs, includeSpecs, excludeSpecs, - validatedFilesSpec: filter(filesSpecs, isString), + validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs, + validatedFilesSpecBeforeSubstitution, + validatedIncludeSpecsBeforeSubstitution, + validatedExcludeSpecsBeforeSubstitution, pathPatterns: undefined, // Initialized on first use isDefaultIncludeSpec, }; @@ -3042,6 +3082,98 @@ function parseJsonConfigFileContentWorker( } } +/** @internal */ +export function handleWatchOptionsConfigDirTemplateSubstitution( + watchOptions: WatchOptions | undefined, + basePath: string, + createCopyOnSubstitute?: boolean, +) { + return handleOptionConfigDirTemplateSubstitution(watchOptions, configDirTemplateSubstitutionWatchOptions, basePath, createCopyOnSubstitute) as WatchOptions | undefined; +} + +function handleOptionConfigDirTemplateSubstitution( + options: OptionsBase | undefined, + optionDeclarations: readonly CommandLineOption[], + basePath: string, + createCopyOnSubstitute?: boolean, +) { + if (!options) return options; + let result: OptionsBase | undefined; + for (const option of optionDeclarations) { + if (options[option.name] !== undefined) { + const value = options[option.name]; + switch (option.type) { + case "string": + Debug.assert(option.isFilePath); + if (startsWithConfigDirTemplate(value)) { + setOptionValue(option, getSubstitutedPathWithConfigDirTemplate(value, basePath)); + } + break; + case "list": + Debug.assert(option.element.isFilePath); + const listResult = getSubstitutedStringArrayWithConfigDirTemplate(value as string[], basePath, createCopyOnSubstitute); + if (listResult) setOptionValue(option, listResult); + break; + case "object": + Debug.assert(option.name === "paths"); + const objectResult = getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(value as MapLike, basePath, createCopyOnSubstitute); + if (objectResult) setOptionValue(option, objectResult); + break; + default: + Debug.fail("option type not supported"); + } + } + } + return result || options; + + function setOptionValue(option: CommandLineOption, value: CompilerOptionsValue) { + if (createCopyOnSubstitute) { + if (!result) result = assign({}, options); + result[option.name] = value; + } + else { + options![option.name] = value; + } + } +} + +const configDirTemplate = `\${configDir}`; +function startsWithConfigDirTemplate(value: any): value is string { + return isString(value) && startsWith(value, configDirTemplate, /*ignoreCase*/ true); +} + +function getSubstitutedPathWithConfigDirTemplate(value: string, basePath: string) { + return getNormalizedAbsolutePath(value.replace(configDirTemplate, "./"), basePath); +} + +function getSubstitutedStringArrayWithConfigDirTemplate(list: string[] | undefined, basePath: string, createCopyOnSubstitute?: boolean): string[] | undefined; +function getSubstitutedStringArrayWithConfigDirTemplate(list: readonly string[] | undefined, basePath: string, createCopyOnSubstitute: true): string[] | undefined; +function getSubstitutedStringArrayWithConfigDirTemplate(list: readonly string[] | string[] | undefined, basePath: string, createCopyOnSubstitute?: boolean) { + if (!list) return list; + let result: string[] | undefined; + list.forEach((element, index) => { + if (!startsWithConfigDirTemplate(element)) return; + if (createCopyOnSubstitute) result ??= list.slice(); + else result ??= list as unknown as string[]; + result[index] = getSubstitutedPathWithConfigDirTemplate(element, basePath); + }); + return result; +} + +function getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(mapLike: MapLike, basePath: string, createCopyOnSubstitute?: boolean) { + let result: MapLike | undefined; + const ownKeys = getOwnKeys(mapLike); + ownKeys.forEach(key => { + if (!isArray(mapLike[key])) return; + const subStitution = getSubstitutedStringArrayWithConfigDirTemplate(mapLike[key], basePath, createCopyOnSubstitute); + if (!subStitution) return; + if (createCopyOnSubstitute) result ??= assign({}, mapLike); + else result ??= mapLike; + mapLike[key] = subStitution; + }); + return result; +} + function isErrorNoInputFiles(error: Diagnostic) { return error.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; } @@ -3143,9 +3275,10 @@ function parseConfig( else { ownConfig.extendedConfigPath.forEach(extendedConfigPath => applyExtendedConfig(result, extendedConfigPath)); } - if (!ownConfig.raw.include && result.include) ownConfig.raw.include = result.include; - if (!ownConfig.raw.exclude && result.exclude) ownConfig.raw.exclude = result.exclude; - if (!ownConfig.raw.files && result.files) ownConfig.raw.files = result.files; + if (result.include) ownConfig.raw.include = result.include; + if (result.exclude) ownConfig.raw.exclude = result.exclude; + if (result.files) ownConfig.raw.files = result.files; + if (ownConfig.raw.compileOnSave === undefined && result.compileOnSave) ownConfig.raw.compileOnSave = result.compileOnSave; if (sourceFile && result.extendedSourceFiles) sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys()); @@ -3162,12 +3295,15 @@ function parseConfig( const extendsRaw = extendedConfig.raw; let relativeDifference: string | undefined; const setPropertyInResultIfNotUndefined = (propertyName: "include" | "exclude" | "files") => { + if (ownConfig.raw[propertyName]) return; // No need to calculate if already set in own config if (extendsRaw[propertyName]) { result[propertyName] = map(extendsRaw[propertyName], (path: string) => - isRootedDiskPath(path) ? path : combinePaths( - relativeDifference ||= convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames)), - path, - )); + startsWithConfigDirTemplate(path) || isRootedDiskPath(path) ? + path : + combinePaths( + relativeDifference ||= convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames)), + path, + )); } }; setPropertyInResultIfNotUndefined("include"); @@ -3526,7 +3662,8 @@ export function convertJsonOption( function normalizeNonListOptionValue(option: CommandLineOption, basePath: string, value: any): CompilerOptionsValue { if (option.isFilePath) { - value = getNormalizedAbsolutePath(value, basePath); + value = normalizeSlashes(value); + value = !startsWithConfigDirTemplate(value) ? getNormalizedAbsolutePath(value, basePath) : value; if (value === "") { value = "."; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 63b77f84dbcc9..2c57c8fb69cb6 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7360,6 +7360,9 @@ export interface ConfigFileSpecs { validatedFilesSpec: readonly string[] | undefined; validatedIncludeSpecs: readonly string[] | undefined; validatedExcludeSpecs: readonly string[] | undefined; + validatedFilesSpecBeforeSubstitution: readonly string[] | undefined; + validatedIncludeSpecsBeforeSubstitution: readonly string[] | undefined; + validatedExcludeSpecsBeforeSubstitution: readonly string[] | undefined; pathPatterns: readonly (string | Pattern)[] | undefined; isDefaultIncludeSpec: boolean; } @@ -7406,7 +7409,8 @@ export interface CommandLineOptionBase { affectsBuildInfo?: true; // true if this options should be emitted in buildInfo transpileOptionValue?: boolean | undefined; // If set this means that the option should be set to this value when transpiling extraValidation?: (value: CompilerOptionsValue) => [DiagnosticMessage, ...string[]] | undefined; // Additional validation to be performed for the value to be valid - disallowNullOrUndefined?: true; // If set option does not allow setting null + disallowNullOrUndefined?: true; // If set option does not allow setting null + allowConfigDirTemplateSubstitution?: true; // If set option allows substitution of `${configDir}` in the value } /** @internal */ diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 2e89d636e0c71..1b35f1cdb0f54 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -44,6 +44,7 @@ import { FileWatcher, filter, find, + findIndex, flattenDiagnosticMessageText, forEach, forEachEntry, @@ -416,7 +417,8 @@ export function getMatchedFileSpec(program: Program, fileName: string) { const filePath = program.getCanonicalFileName(fileName); const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); - return find(configFile.configFileSpecs.validatedFilesSpec, fileSpec => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath); + const index = findIndex(configFile.configFileSpecs.validatedFilesSpec, fileSpec => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath); + return index !== -1 ? configFile.configFileSpecs.validatedFilesSpecBeforeSubstitution![index] : undefined; } /** @internal */ @@ -430,11 +432,12 @@ export function getMatchedIncludeSpec(program: Program, fileName: string) { const isJsonFile = fileExtensionIs(fileName, Extension.Json); const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); const useCaseSensitiveFileNames = program.useCaseSensitiveFileNames(); - return find(configFile?.configFileSpecs?.validatedIncludeSpecs, includeSpec => { + const index = findIndex(configFile?.configFileSpecs?.validatedIncludeSpecs, includeSpec => { if (isJsonFile && !endsWith(includeSpec, Extension.Json)) return false; const pattern = getPatternFromSpec(includeSpec, basePath, "files"); return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames).test(fileName); }); + return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution![index] : undefined; } /** @internal */ diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 1a27eae83c1cf..f1721e458bbd1 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -58,6 +58,7 @@ import { getPathComponents, getSnapshotText, getWatchFactory, + handleWatchOptionsConfigDirTemplateSubstitution, hasExtension, hasProperty, hasTSFileExtension, @@ -515,6 +516,7 @@ export interface HostConfiguration { hostInfo: string; extraFileExtensions?: FileExtensionInfo[]; watchOptions?: WatchOptions; + /** @internal */ beforeSubstitution?: WatchOptions; } export interface OpenConfiguredProjectResult { @@ -1721,7 +1723,7 @@ export class ProjectService { }); }, flags, - this.getWatchOptionsFromProjectWatchOptions(config.parsedCommandLine!.watchOptions), + this.getWatchOptionsFromProjectWatchOptions(config.parsedCommandLine!.watchOptions, getDirectoryPath(configFileName)), WatchType.WildcardDirectory, configFileName, ); @@ -2058,7 +2060,7 @@ export class ProjectService { configFileName, (_fileName, eventKind) => this.onConfigFileChanged(canonicalConfigFilePath, eventKind), PollingInterval.High, - this.getWatchOptionsFromProjectWatchOptions(configFileExistenceInfo?.config?.parsedCommandLine?.watchOptions), + this.getWatchOptionsFromProjectWatchOptions(configFileExistenceInfo?.config?.parsedCommandLine?.watchOptions, getDirectoryPath(configFileName)), WatchType.ConfigFile, forProject, ); @@ -2581,13 +2583,14 @@ export class ProjectService { const configFile = parseJsonText(configFilename, isString(configFileContent) ? configFileContent : "") as TsConfigSourceFile; const configFileErrors = configFile.parseDiagnostics as Diagnostic[]; if (!isString(configFileContent)) configFileErrors.push(configFileContent); + const configDir = getDirectoryPath(configFilename); const parsedCommandLine = parseJsonSourceFileConfigFileContent( configFile, cachedDirectoryStructureHost, - getDirectoryPath(configFilename), - /*existingOptions*/ {}, + configDir, + /*existingOptions*/ undefined, configFilename, - /*resolutionStack*/ [], + /*resolutionStack*/ undefined, this.hostConfiguration.extraFileExtensions, this.extendedConfigCache, ); @@ -2623,9 +2626,9 @@ export class ProjectService { if ( !oldCommandLine && !isJsonEqual( // Old options - this.getWatchOptionsFromProjectWatchOptions(/*projectOptions*/ undefined), + this.getWatchOptionsFromProjectWatchOptions(/*projectOptions*/ undefined, configDir), // New options - this.getWatchOptionsFromProjectWatchOptions(parsedCommandLine.watchOptions), + this.getWatchOptionsFromProjectWatchOptions(parsedCommandLine.watchOptions, configDir), ) ) { // Reset the config file watcher @@ -3460,7 +3463,10 @@ export class ProjectService { } if (args.watchOptions) { - this.hostConfiguration.watchOptions = convertWatchOptions(args.watchOptions)?.watchOptions; + const watchOptions = convertWatchOptions(args.watchOptions)?.watchOptions; + const substitution = handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, this.currentDirectory, /*createCopyOnSubstitute*/ true); + this.hostConfiguration.watchOptions = substitution; + this.hostConfiguration.beforeSubstitution = substitution === watchOptions ? undefined : watchOptions; this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`); } } @@ -3468,14 +3474,20 @@ export class ProjectService { /** @internal */ getWatchOptions(project: Project) { - return this.getWatchOptionsFromProjectWatchOptions(project.getWatchOptions()); + return this.getWatchOptionsFromProjectWatchOptions(project.getWatchOptions(), project.getCurrentDirectory()); } /** @internal */ - private getWatchOptionsFromProjectWatchOptions(projectOptions: WatchOptions | undefined) { - return projectOptions && this.hostConfiguration.watchOptions ? - { ...this.hostConfiguration.watchOptions, ...projectOptions } : - projectOptions || this.hostConfiguration.watchOptions; + private getWatchOptionsFromProjectWatchOptions(projectOptions: WatchOptions | undefined, basePath: string) { + const hostWatchOptions = !this.hostConfiguration.beforeSubstitution ? this.hostConfiguration.watchOptions : + handleWatchOptionsConfigDirTemplateSubstitution( + this.hostConfiguration.beforeSubstitution, + basePath, + /*createCopyOnSubstitute*/ true, + ); + return projectOptions && hostWatchOptions ? + { ...hostWatchOptions, ...projectOptions } : + projectOptions || hostWatchOptions; } closeLog() { diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts index 9857f6b7fb2d7..fd6f34d435bdb 100644 --- a/src/testRunner/tests.ts +++ b/src/testRunner/tests.ts @@ -98,6 +98,7 @@ import "./unittests/tsbuild/sample"; import "./unittests/tsbuild/transitiveReferences"; import "./unittests/tsbuildWatch/configFileErrors"; import "./unittests/tsbuildWatch/demo"; +import "./unittests/tsbuildWatch/extends"; import "./unittests/tsbuildWatch/libraryResolution"; import "./unittests/tsbuildWatch/moduleResolution"; import "./unittests/tsbuildWatch/noEmit"; diff --git a/src/testRunner/unittests/config/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts index ce191f5f59ccb..aa1b46beb99c0 100644 --- a/src/testRunner/unittests/config/configurationExtension.ts +++ b/src/testRunner/unittests/config/configurationExtension.ts @@ -253,6 +253,46 @@ function createFileSystem(ignoreCase: boolean, cwd: string, root: string) { }, }), "dev/extendsArrayFails2.json": jsonToReadableText({ extends: [42] }), + "dev/configs/template.json": jsonToReadableText({ + include: ["${configDir}/../supplemental.*"], // eslint-disable-line no-template-curly-in-string + files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string, + compilerOptions: { + declarationDir: "${configDir}/decls", // eslint-disable-line no-template-curly-in-string + rootDirs: ["root1", "${configDir}/root2", "root3"], // eslint-disable-line no-template-curly-in-string + paths: { + "something": ["${configDir}/something"], // eslint-disable-line no-template-curly-in-string + "something/*": ["${configDir}/something/*"], // eslint-disable-line no-template-curly-in-string + "other/*": ["./other/*"], + }, + }, + }), + + "dev/configs/templateandextends.json": jsonToReadableText({ + extends: "./first/templateextends.json", + compilerOptions: { + strict: true, + baseUrl: "./src", + }, + }), + "dev/configs/first/templateextends.json": jsonToReadableText({ + extends: "../second/templateextends.json", + include: ["${configDir}/../supplemental.*"], // eslint-disable-line no-template-curly-in-string + compilerOptions: { + rootDirs: ["root1", "${configDir}/root2", "root3"], // eslint-disable-line no-template-curly-in-string + }, + }), + "dev/configs/second/templateextends.json": jsonToReadableText({ + files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string, + compilerOptions: { + outDir: "./insecond", + declarationDir: "${configDir}/decls", // eslint-disable-line no-template-curly-in-string + paths: { + "something": ["${configDir}/something"], // eslint-disable-line no-template-curly-in-string + "something/*": ["${configDir}/something/*"], // eslint-disable-line no-template-curly-in-string + "other/*": ["./other/*"], + }, + }, + }), }, }, }); @@ -302,6 +342,9 @@ describe("unittests:: config:: configurationExtension", () => { baselineParsedCommandLine("can report missing configurations", "extendsArrayFails.json"); baselineParsedCommandLine("can error when 'extends' is not a string or Array2", "extendsArrayFails2.json"); + baselineParsedCommandLine("handle configDir template", "configs/template.json"); + baselineParsedCommandLine("handle configDir template", "configs/templateandextends.json"); + baselineParseConfig({ scenario: "configurationExtension", subScenario: testName, diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index f870707801cd3..b36023a479eb9 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -115,6 +115,21 @@ describe("unittests:: config:: showConfig", () => { ], }); + showTSConfigCorrectly("Show TSConfig with configDir template template", ["-p", "tsconfig.json"], { + compilerOptions: { + outDir: "${configDir}/outDir", // eslint-disable-line no-template-curly-in-string + typeRoots: ["root1", "${configDir}/root2", "root3"], // eslint-disable-line no-template-curly-in-string + paths: { + "@myscope/*": ["${configDir}/types/*"], // eslint-disable-line no-template-curly-in-string + "other/*": ["other/*"], + }, + }, + include: [ + "${configDir}/src/**/*", // eslint-disable-line no-template-curly-in-string + ], + files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string + }); + // Bulk validation of all option declarations for (const option of ts.optionDeclarations) { baselineOption(option, /*isCompilerOptions*/ true); diff --git a/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts b/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts index 0474846384905..24837791623a7 100644 --- a/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts +++ b/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts @@ -97,6 +97,18 @@ describe("unittests:: config:: tsconfigParsingWatchOptions:: parseConfigFileText }), }, }, + { + json: { + extends: "./base/tsconfig.json", + }, + additionalFiles: { + "/base/tsconfig.json": jsonToReadableText({ + watchOptions: { + excludeFiles: ["${configDir}/temp/*.ts"], // eslint-disable-line no-template-curly-in-string + }, + }), + }, + }, ]); verifyWatchOptions("different options", () => [ diff --git a/src/testRunner/unittests/helpers/extends.ts b/src/testRunner/unittests/helpers/extends.ts index 0ab23e2bf368c..e9398ab4b4708 100644 --- a/src/testRunner/unittests/helpers/extends.ts +++ b/src/testRunner/unittests/helpers/extends.ts @@ -1,5 +1,6 @@ import { dedent } from "../../_namespaces/Utils"; import { jsonToReadableText } from "../helpers"; +import { FsContents } from "./contents"; import { createServerHost, createWatchedSystem, @@ -31,3 +32,70 @@ export function getSymlinkedExtendsSys(forTsserver?: true): TestServerHost { [libFile.path]: libFile.content, }, { currentDirectory: "/users/user/projects/myproject" }); } + +export function getConfigDirExtendsSys(): FsContents { + return { + "/home/src/projects/configs/first/tsconfig.json": jsonToReadableText({ + extends: "../second/tsconfig.json", + include: ["${configDir}/src"], // eslint-disable-line no-template-curly-in-string + compilerOptions: { + typeRoots: ["root1", "${configDir}/root2", "root3"], // eslint-disable-line no-template-curly-in-string + types: [], + }, + }), + "/home/src/projects/configs/second/tsconfig.json": jsonToReadableText({ + files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string, + compilerOptions: { + declarationDir: "${configDir}/decls", // eslint-disable-line no-template-curly-in-string + paths: { + "@myscope/*": ["${configDir}/types/*"], // eslint-disable-line no-template-curly-in-string + "other/*": ["other/*"], + }, + baseUrl: "${configDir}", // eslint-disable-line no-template-curly-in-string + }, + watchOptions: { + excludeFiles: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string + }, + }), + "/home/src/projects/myproject/tsconfig.json": jsonToReadableText({ + extends: "../configs/first/tsconfig.json", + compilerOptions: { + declaration: true, + outDir: "outDir", + traceResolution: true, + }, + }), + + "/home/src/projects/myproject/main.ts": dedent` + // some comment + export const y = 10; + import { x } from "@myscope/sometype"; + `, + "/home/src/projects/myproject/src/secondary.ts": dedent` + // some comment + export const z = 10; + import { k } from "other/sometype2"; + `, + "/home/src/projects/myproject/types/sometype.ts": dedent` + export const x = 10; + `, + "/home/src/projects/myproject/root2/other/sometype2/index.d.ts": dedent` + export const k = 10; + `, + [libFile.path]: libFile.content, + }; +} + +export function modifyFirstExtendedConfigOfConfigDirExtendsSys(sys: TestServerHost) { + sys.modifyFile( + "/home/src/projects/configs/first/tsconfig.json", + jsonToReadableText({ + extends: "../second/tsconfig.json", + include: ["${configDir}/src"], // eslint-disable-line no-template-curly-in-string + compilerOptions: { + typeRoots: ["${configDir}/root2"], // eslint-disable-line no-template-curly-in-string + types: [], + }, + }), + ); +} diff --git a/src/testRunner/unittests/tsbuild/extends.ts b/src/testRunner/unittests/tsbuild/extends.ts index dbf2512e7502a..5a2341306ce4a 100644 --- a/src/testRunner/unittests/tsbuild/extends.ts +++ b/src/testRunner/unittests/tsbuild/extends.ts @@ -1,5 +1,10 @@ -import { getSymlinkedExtendsSys } from "../helpers/extends"; +import { + getConfigDirExtendsSys, + getSymlinkedExtendsSys, +} from "../helpers/extends"; +import { verifyTsc } from "../helpers/tsc"; import { verifyTscWatch } from "../helpers/tscWatch"; +import { loadProjectFromFiles } from "../helpers/vfs"; describe("unittests:: tsbuild:: extends::", () => { verifyTscWatch({ @@ -8,4 +13,11 @@ describe("unittests:: tsbuild:: extends::", () => { sys: getSymlinkedExtendsSys, commandLineArgs: ["-b", "src", "--extendedDiagnostics"], }); + + verifyTsc({ + scenario: "extends", + subScenario: "configDir template", + fs: () => loadProjectFromFiles(getConfigDirExtendsSys(), { cwd: "/home/src/projects/myproject" }), + commandLineArgs: ["-b", "/home/src/projects/myproject", "--explainFiles", "--v"], + }); }); diff --git a/src/testRunner/unittests/tsbuildWatch/extends.ts b/src/testRunner/unittests/tsbuildWatch/extends.ts new file mode 100644 index 0000000000000..5fc08c2795b0f --- /dev/null +++ b/src/testRunner/unittests/tsbuildWatch/extends.ts @@ -0,0 +1,20 @@ +import { + getConfigDirExtendsSys, + modifyFirstExtendedConfigOfConfigDirExtendsSys, +} from "../helpers/extends"; +import { verifyTscWatch } from "../helpers/tscWatch"; +import { createWatchedSystem } from "../helpers/virtualFileSystemWithWatch"; + +describe("unittests:: tsbuildWatch:: watchMode:: extends::", () => { + verifyTscWatch({ + scenario: "extends", + subScenario: "configDir template", + sys: () => createWatchedSystem(getConfigDirExtendsSys(), { currentDirectory: "/home/src/projects/myproject" }), + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--explainFiles", "-v"], + edits: [{ + caption: "edit extended config file", + edit: modifyFirstExtendedConfigOfConfigDirExtendsSys, + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }], + }); +}); diff --git a/src/testRunner/unittests/tsc/extends.ts b/src/testRunner/unittests/tsc/extends.ts index d1e8226517076..19cb499db6472 100644 --- a/src/testRunner/unittests/tsc/extends.ts +++ b/src/testRunner/unittests/tsc/extends.ts @@ -1,5 +1,10 @@ -import { getSymlinkedExtendsSys } from "../helpers/extends"; +import { + getConfigDirExtendsSys, + getSymlinkedExtendsSys, +} from "../helpers/extends"; +import { verifyTsc } from "../helpers/tsc"; import { verifyTscWatch } from "../helpers/tscWatch"; +import { loadProjectFromFiles } from "../helpers/vfs"; describe("unittests:: tsc:: extends::", () => { verifyTscWatch({ @@ -8,4 +13,25 @@ describe("unittests:: tsc:: extends::", () => { sys: getSymlinkedExtendsSys, commandLineArgs: ["-p", "src", "--extendedDiagnostics"], }); + + verifyTsc({ + scenario: "extends", + subScenario: "configDir template", + fs: () => loadProjectFromFiles(getConfigDirExtendsSys(), { cwd: "/home/src/projects/myproject" }), + commandLineArgs: ["-p", "/home/src/projects/myproject", "--explainFiles"], + }); + + verifyTsc({ + scenario: "extends", + subScenario: "configDir template showConfig", + fs: () => loadProjectFromFiles(getConfigDirExtendsSys(), { cwd: "/home/src/projects/myproject" }), + commandLineArgs: ["-p", "/home/src/projects/myproject", "--showConfig"], + }); + + verifyTsc({ + scenario: "extends", + subScenario: "configDir template with commandline", + fs: () => loadProjectFromFiles(getConfigDirExtendsSys(), { cwd: "/home/src/projects/myproject" }), + commandLineArgs: ["-p", "/home/src/projects/myproject", "--explainFiles", "--outDir", "${configDir}/outDir"], // eslint-disable-line no-template-curly-in-string + }); }); diff --git a/src/testRunner/unittests/tscWatch/extends.ts b/src/testRunner/unittests/tscWatch/extends.ts index 86d3fdf2c217d..e325aaede2856 100644 --- a/src/testRunner/unittests/tscWatch/extends.ts +++ b/src/testRunner/unittests/tscWatch/extends.ts @@ -1,5 +1,10 @@ -import { getSymlinkedExtendsSys } from "../helpers/extends"; +import { + getConfigDirExtendsSys, + getSymlinkedExtendsSys, + modifyFirstExtendedConfigOfConfigDirExtendsSys, +} from "../helpers/extends"; import { verifyTscWatch } from "../helpers/tscWatch"; +import { createWatchedSystem } from "../helpers/virtualFileSystemWithWatch"; describe("unittests:: tsc-watch:: extends::", () => { verifyTscWatch({ @@ -8,4 +13,16 @@ describe("unittests:: tsc-watch:: extends::", () => { sys: getSymlinkedExtendsSys, commandLineArgs: ["-w", "-p", "src", "--extendedDiagnostics"], }); + + verifyTscWatch({ + scenario: "extends", + subScenario: "configDir template", + sys: () => createWatchedSystem(getConfigDirExtendsSys(), { currentDirectory: "/home/src/projects/myproject" }), + commandLineArgs: ["-w", "--extendedDiagnostics", "--explainFiles"], + edits: [{ + caption: "edit extended config file", + edit: modifyFirstExtendedConfigOfConfigDirExtendsSys, + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }], + }); }); diff --git a/src/testRunner/unittests/tsserver/extends.ts b/src/testRunner/unittests/tsserver/extends.ts index a722c8a0dfb0e..d3ad57a291f72 100644 --- a/src/testRunner/unittests/tsserver/extends.ts +++ b/src/testRunner/unittests/tsserver/extends.ts @@ -1,9 +1,15 @@ -import { getSymlinkedExtendsSys } from "../helpers/extends"; +import * as ts from "../../_namespaces/ts"; +import { + getConfigDirExtendsSys, + getSymlinkedExtendsSys, + modifyFirstExtendedConfigOfConfigDirExtendsSys, +} from "../helpers/extends"; import { baselineTsserverLogs, openFilesForSession, TestSession, } from "../helpers/tsserver"; +import { createServerHost } from "../helpers/virtualFileSystemWithWatch"; describe("unittests:: tsserver:: extends::", () => { it("resolves the symlink path", () => { @@ -12,4 +18,21 @@ describe("unittests:: tsserver:: extends::", () => { openFilesForSession(["/users/user/projects/myproject/src/index.ts"], session); baselineTsserverLogs("tsserver", "resolves the symlink path", session); }); + + it("configDir template", () => { + const host = createServerHost(getConfigDirExtendsSys(), { currentDirectory: "/home/src/projects/myproject" }); + const session = new TestSession(host); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.Configure, + arguments: { + watchOptions: { + excludeDirectories: ["${configDir}/node_modules"], // eslint-disable-line no-template-curly-in-string + }, + }, + }); + openFilesForSession(["/home/src/projects/myproject/src/secondary.ts"], session); + modifyFirstExtendedConfigOfConfigDirExtendsSys(host); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("tsserver", "configDir template", session); + }); }); diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js index 0a5004eb33118..e76ae1fac0957 100644 --- a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [c:/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [c:/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [c:/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [c:/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [c:/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [c:/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [c:/dev/configs/tests.json] { "compilerOptions": { diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js index 7bfedca3af8f4..3746b79c69c4b 100644 --- a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [/dev/configs/tests.json] { "compilerOptions": { diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js index 6436a84efb14a..ac5f10fd9f017 100644 --- a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [c:/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [c:/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [c:/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [c:/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [c:/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [c:/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [c:/dev/configs/tests.json] { "compilerOptions": { diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js index 896d69b9586c3..034c82e526941 100644 --- a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [/dev/configs/tests.json] { "compilerOptions": { diff --git a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js index 6598d8799d7d4..1308bab2636e3 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [c:/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [c:/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [c:/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [c:/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [c:/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [c:/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [c:/dev/configs/tests.json] { "compilerOptions": { @@ -707,3 +782,66 @@ c:/dev/tests/unit/spec.ts Errors:: error TS5024: Compiler option 'extends' requires a value of type string. + +handle configDir template +configFileName:: configs/template.json +CompilerOptions:: +{ + "declarationDir": "c:/dev/configs/decls", + "rootDirs": [ + "c:/dev/configs/root1", + "c:/dev/configs/root2", + "c:/dev/configs/root3" + ], + "paths": { + "something": [ + "c:/dev/configs/something" + ], + "something/*": [ + "c:/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "configFilePath": "c:/dev/configs/template.json", + "pathsBasePath": "c:/dev/configs" +} +FileNames:: +c:/dev/configs/main.ts +c:/dev/supplemental.ts +Errors:: + + +handle configDir template +configFileName:: configs/templateandextends.json +CompilerOptions:: +{ + "outDir": "c:/dev/configs/second/insecond", + "declarationDir": "c:/dev/configs/decls", + "paths": { + "something": [ + "c:/dev/configs/something" + ], + "something/*": [ + "c:/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "pathsBasePath": "c:/dev/configs/second", + "rootDirs": [ + "c:/dev/configs/first/root1", + "c:/dev/configs/root2", + "c:/dev/configs/first/root3" + ], + "strict": true, + "baseUrl": "c:/dev/configs/src", + "configFilePath": "c:/dev/configs/templateandextends.json" +} +FileNames:: +c:/dev/configs/main.ts +c:/dev/supplemental.ts +Errors:: + diff --git a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js index edfedcd208a18..6ffa29fef1cb1 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [c:/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [c:/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [c:/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [c:/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [c:/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [c:/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [c:/dev/configs/tests.json] { "compilerOptions": { @@ -725,3 +800,66 @@ Errors:: 3 42    ~~ + +handle configDir template +configFileName:: configs/template.json +CompilerOptions:: +{ + "declarationDir": "c:/dev/configs/decls", + "rootDirs": [ + "c:/dev/configs/root1", + "c:/dev/configs/root2", + "c:/dev/configs/root3" + ], + "paths": { + "something": [ + "c:/dev/configs/something" + ], + "something/*": [ + "c:/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "pathsBasePath": "c:/dev/configs", + "configFilePath": "c:/dev/configs/template.json" +} +FileNames:: +c:/dev/configs/main.ts +c:/dev/supplemental.ts +Errors:: + + +handle configDir template +configFileName:: configs/templateandextends.json +CompilerOptions:: +{ + "outDir": "c:/dev/configs/second/insecond", + "declarationDir": "c:/dev/configs/decls", + "paths": { + "something": [ + "c:/dev/configs/something" + ], + "something/*": [ + "c:/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "pathsBasePath": "c:/dev/configs/second", + "rootDirs": [ + "c:/dev/configs/first/root1", + "c:/dev/configs/root2", + "c:/dev/configs/first/root3" + ], + "strict": true, + "baseUrl": "c:/dev/configs/src", + "configFilePath": "c:/dev/configs/templateandextends.json" +} +FileNames:: +c:/dev/configs/main.ts +c:/dev/supplemental.ts +Errors:: + diff --git a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js index 15d00a7f345b7..750f0993edc33 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [/dev/configs/tests.json] { "compilerOptions": { @@ -707,3 +782,66 @@ FileNames:: Errors:: error TS5024: Compiler option 'extends' requires a value of type string. + +handle configDir template +configFileName:: configs/template.json +CompilerOptions:: +{ + "declarationDir": "/dev/configs/decls", + "rootDirs": [ + "/dev/configs/root1", + "/dev/configs/root2", + "/dev/configs/root3" + ], + "paths": { + "something": [ + "/dev/configs/something" + ], + "something/*": [ + "/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "configFilePath": "/dev/configs/template.json", + "pathsBasePath": "/dev/configs" +} +FileNames:: +/dev/configs/main.ts +/dev/supplemental.ts +Errors:: + + +handle configDir template +configFileName:: configs/templateandextends.json +CompilerOptions:: +{ + "outDir": "/dev/configs/second/insecond", + "declarationDir": "/dev/configs/decls", + "paths": { + "something": [ + "/dev/configs/something" + ], + "something/*": [ + "/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "pathsBasePath": "/dev/configs/second", + "rootDirs": [ + "/dev/configs/first/root1", + "/dev/configs/root2", + "/dev/configs/first/root3" + ], + "strict": true, + "baseUrl": "/dev/configs/src", + "configFilePath": "/dev/configs/templateandextends.json" +} +FileNames:: +/dev/configs/main.ts +/dev/supplemental.ts +Errors:: + diff --git a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js index 6e7a3c42700a9..551bd5a8d00a2 100644 --- a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js +++ b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js @@ -87,6 +87,21 @@ Fs:: "files": [] } +//// [/dev/configs/first/templateextends.json] +{ + "extends": "../second/templateextends.json", + "include": [ + "${configDir}/../supplemental.*" + ], + "compilerOptions": { + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ] + } +} + //// [/dev/configs/first.json] { "extends": "./base", @@ -110,6 +125,28 @@ Fs:: ] } +//// [/dev/configs/second/templateextends.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "outDir": "./insecond", + "declarationDir": "${configDir}/decls", + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + //// [/dev/configs/second.json] { "extends": "./base", @@ -121,6 +158,44 @@ Fs:: ] } +//// [/dev/configs/template.json] +{ + "include": [ + "${configDir}/../supplemental.*" + ], + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "rootDirs": [ + "root1", + "${configDir}/root2", + "root3" + ], + "paths": { + "something": [ + "${configDir}/something" + ], + "something/*": [ + "${configDir}/something/*" + ], + "other/*": [ + "./other/*" + ] + } + } +} + +//// [/dev/configs/templateandextends.json] +{ + "extends": "./first/templateextends.json", + "compilerOptions": { + "strict": true, + "baseUrl": "./src" + } +} + //// [/dev/configs/tests.json] { "compilerOptions": { @@ -725,3 +800,66 @@ Errors:: 3 42    ~~ + +handle configDir template +configFileName:: configs/template.json +CompilerOptions:: +{ + "declarationDir": "/dev/configs/decls", + "rootDirs": [ + "/dev/configs/root1", + "/dev/configs/root2", + "/dev/configs/root3" + ], + "paths": { + "something": [ + "/dev/configs/something" + ], + "something/*": [ + "/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "pathsBasePath": "/dev/configs", + "configFilePath": "/dev/configs/template.json" +} +FileNames:: +/dev/configs/main.ts +/dev/supplemental.ts +Errors:: + + +handle configDir template +configFileName:: configs/templateandextends.json +CompilerOptions:: +{ + "outDir": "/dev/configs/second/insecond", + "declarationDir": "/dev/configs/decls", + "paths": { + "something": [ + "/dev/configs/something" + ], + "something/*": [ + "/dev/configs/something/*" + ], + "other/*": [ + "./other/*" + ] + }, + "pathsBasePath": "/dev/configs/second", + "rootDirs": [ + "/dev/configs/first/root1", + "/dev/configs/root2", + "/dev/configs/first/root3" + ], + "strict": true, + "baseUrl": "/dev/configs/src", + "configFilePath": "/dev/configs/templateandextends.json" +} +FileNames:: +/dev/configs/main.ts +/dev/supplemental.ts +Errors:: + diff --git a/tests/baselines/reference/config/showConfig/Show TSConfig with configDir template template/tsconfig.json b/tests/baselines/reference/config/showConfig/Show TSConfig with configDir template template/tsconfig.json new file mode 100644 index 0000000000000..0838d90611258 --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Show TSConfig with configDir template template/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "outDir": "./outDir", + "typeRoots": [ + "./root1", + "./root2", + "./root3" + ], + "paths": { + "@myscope/*": [ + "/Show TSConfig with configDir template template/types/*" + ], + "other/*": [ + "other/*" + ] + } + }, + "files": [ + "./main.ts" + ], + "include": [ + "/Show TSConfig with configDir template template/src/**/*" + ], + "exclude": [ + "/Show TSConfig with configDir template template/outDir" + ] +} diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js index b95fe3e4a4aa6..847ca32c2fe7f 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js @@ -54,3 +54,32 @@ Result: WatchOptions:: } Errors:: + +Fs:: +//// [/a.ts] + + +//// [/base/tsconfig.json] +{ + "watchOptions": { + "excludeFiles": [ + "${configDir}/temp/*.ts" + ] + } +} + +//// [/tsconfig.json] +{ + "extends": "./base/tsconfig.json" +} + + +configFileName:: tsconfig.json +Result: WatchOptions:: +{ + "excludeFiles": [ + "/temp/*.ts" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js index b95fe3e4a4aa6..847ca32c2fe7f 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js @@ -54,3 +54,32 @@ Result: WatchOptions:: } Errors:: + +Fs:: +//// [/a.ts] + + +//// [/base/tsconfig.json] +{ + "watchOptions": { + "excludeFiles": [ + "${configDir}/temp/*.ts" + ] + } +} + +//// [/tsconfig.json] +{ + "extends": "./base/tsconfig.json" +} + + +configFileName:: tsconfig.json +Result: WatchOptions:: +{ + "excludeFiles": [ + "/temp/*.ts" + ] +} +Errors:: + diff --git a/tests/baselines/reference/tsbuild/extends/configDir-template.js b/tests/baselines/reference/tsbuild/extends/configDir-template.js new file mode 100644 index 0000000000000..e310d8be8b5b7 --- /dev/null +++ b/tests/baselines/reference/tsbuild/extends/configDir-template.js @@ -0,0 +1,189 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b /home/src/projects/myproject --explainFiles --v +[12:00:27 AM] Projects in this build: + * tsconfig.json + +[12:00:28 AM] Project 'tsconfig.json' is out of date because output file 'outDir/main.js' does not exist + +[12:00:29 AM] Building project '/home/src/projects/myproject/tsconfig.json'... + +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/configs/first/root1' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +../../../../lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +exitCode:: ExitStatus.Success + + +//// [/home/src/projects/myproject/decls/main.d.ts] +export declare const y = 10; + + +//// [/home/src/projects/myproject/decls/src/secondary.d.ts] +export declare const z = 10; + + +//// [/home/src/projects/myproject/decls/types/sometype.d.ts] +export declare const x = 10; + + +//// [/home/src/projects/myproject/outDir/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +// some comment +exports.y = 10; + + +//// [/home/src/projects/myproject/outDir/src/secondary.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +// some comment +exports.z = 10; + + +//// [/home/src/projects/myproject/outDir/types/sometype.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + diff --git a/tests/baselines/reference/tsbuildWatch/extends/configDir-template.js b/tests/baselines/reference/tsbuildWatch/extends/configDir-template.js new file mode 100644 index 0000000000000..081d145ad5ec4 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/extends/configDir-template.js @@ -0,0 +1,386 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -b -w --extendedDiagnostics --explainFiles -v +Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'outDir/main.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/myproject/tsconfig.json'... + +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/configs/first/root1' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +../../../../a/lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Config file /home/src/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file +FileWatcher:: Added:: WatchInfo: /home/src/projects/configs/second/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Wild card directory /home/src/projects/myproject/tsconfig.json +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Wild card directory /home/src/projects/myproject/tsconfig.json +ExcludeWatcher:: Added:: WatchInfo: /home/src/projects/myproject/main.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file /home/src/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src/secondary.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file /home/src/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2/other/sometype2/package.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} package.json file /home/src/projects/myproject/tsconfig.json + + +//// [/home/src/projects/myproject/outDir/types/sometype.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + +//// [/home/src/projects/myproject/decls/types/sometype.d.ts] +export declare const x = 10; + + +//// [/home/src/projects/myproject/outDir/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +// some comment +exports.y = 10; + + +//// [/home/src/projects/myproject/decls/main.d.ts] +export declare const y = 10; + + +//// [/home/src/projects/myproject/outDir/src/secondary.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +// some comment +exports.z = 10; + + +//// [/home/src/projects/myproject/decls/src/secondary.d.ts] +export declare const z = 10; + + + +PolledWatches:: +/home/src/projects/myproject/root2/other/sometype2/package.json: *new* + {"pollingInterval":2000} + +FsWatches:: +/home/src/projects/configs/first/tsconfig.json: *new* + {} +/home/src/projects/configs/second/tsconfig.json: *new* + {} +/home/src/projects/myproject/src/secondary.ts: *new* + {} +/home/src/projects/myproject/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/myproject/src: *new* + {} + +Program root files: [ + "/home/src/projects/myproject/main.ts", + "/home/src/projects/myproject/src/secondary.ts" +] +Program options: { + "declarationDir": "/home/src/projects/myproject/decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "/home/src/projects/myproject", + "pathsBasePath": "/home/src/projects/configs/second", + "typeRoots": [ + "/home/src/projects/configs/first/root1", + "/home/src/projects/myproject/root2", + "/home/src/projects/configs/first/root3" + ], + "types": [], + "declaration": true, + "outDir": "/home/src/projects/myproject/outDir", + "traceResolution": true, + "watch": true, + "explainFiles": true, + "extendedDiagnostics": true, + "configFilePath": "/home/src/projects/myproject/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/myproject/types/sometype.ts +/home/src/projects/myproject/main.ts +/home/src/projects/myproject/root2/other/sometype2/index.d.ts +/home/src/projects/myproject/src/secondary.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/myproject/types/sometype.ts +/home/src/projects/myproject/main.ts +/home/src/projects/myproject/root2/other/sometype2/index.d.ts +/home/src/projects/myproject/src/secondary.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/myproject/types/sometype.ts (computed .d.ts during emit) +/home/src/projects/myproject/main.ts (computed .d.ts during emit) +/home/src/projects/myproject/root2/other/sometype2/index.d.ts (used version) +/home/src/projects/myproject/src/secondary.ts (computed .d.ts during emit) + +exitCode:: ExitStatus.undefined + +Change:: edit extended config file + +Input:: +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "${configDir}/root2" + ], + "types": [] + } +} + + +Output:: +FileWatcher:: Triggered with /home/src/projects/configs/first/tsconfig.json 1:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file +Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/configs/first/tsconfig.json 1:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +After running Timeout callback:: count: 0 +Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'outDir/main.js' is older than input '../configs/first/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/myproject/tsconfig.json'... + +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/myproject/tsconfig.json'... + +../../../../a/lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/myproject/outDir/main.js] file changed its modified time +//// [/home/src/projects/myproject/decls/main.d.ts] file changed its modified time +//// [/home/src/projects/myproject/outDir/src/secondary.js] file changed its modified time +//// [/home/src/projects/myproject/decls/src/secondary.d.ts] file changed its modified time + + +Program root files: [ + "/home/src/projects/myproject/main.ts", + "/home/src/projects/myproject/src/secondary.ts" +] +Program options: { + "declarationDir": "/home/src/projects/myproject/decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "/home/src/projects/myproject", + "pathsBasePath": "/home/src/projects/configs/second", + "typeRoots": [ + "/home/src/projects/myproject/root2" + ], + "types": [], + "declaration": true, + "outDir": "/home/src/projects/myproject/outDir", + "traceResolution": true, + "watch": true, + "explainFiles": true, + "extendedDiagnostics": true, + "configFilePath": "/home/src/projects/myproject/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/myproject/types/sometype.ts +/home/src/projects/myproject/main.ts +/home/src/projects/myproject/root2/other/sometype2/index.d.ts +/home/src/projects/myproject/src/secondary.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsc/extends/configDir-template-showConfig.js b/tests/baselines/reference/tsc/extends/configDir-template-showConfig.js new file mode 100644 index 0000000000000..3d1415760d93d --- /dev/null +++ b/tests/baselines/reference/tsc/extends/configDir-template-showConfig.js @@ -0,0 +1,144 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/myproject --showConfig +{ + "compilerOptions": { + "declarationDir": "./decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "./", + "typeRoots": [ + "../configs/first/root1", + "./root2", + "../configs/first/root3" + ], + "types": [], + "declaration": true, + "outDir": "./outDir", + "traceResolution": true + }, + "watchOptions": { + "excludeFiles": [ + "/home/src/projects/myproject/main.ts" + ] + }, + "files": [ + "./main.ts" + ], + "include": [ + "/home/src/projects/myproject/src" + ], + "exclude": [ + "outDir" + ] +} +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/extends/configDir-template-with-commandline.js b/tests/baselines/reference/tsc/extends/configDir-template-with-commandline.js new file mode 100644 index 0000000000000..e2da2d7747018 --- /dev/null +++ b/tests/baselines/reference/tsc/extends/configDir-template-with-commandline.js @@ -0,0 +1,182 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/myproject --explainFiles --outDir ${configDir}/outDir +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/configs/first/root1' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +../../../../lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +exitCode:: ExitStatus.Success + + +//// [/home/src/projects/myproject/${configDir}/outDir/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +// some comment +exports.y = 10; + + +//// [/home/src/projects/myproject/${configDir}/outDir/src/secondary.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +// some comment +exports.z = 10; + + +//// [/home/src/projects/myproject/${configDir}/outDir/types/sometype.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + +//// [/home/src/projects/myproject/decls/main.d.ts] +export declare const y = 10; + + +//// [/home/src/projects/myproject/decls/src/secondary.d.ts] +export declare const z = 10; + + +//// [/home/src/projects/myproject/decls/types/sometype.d.ts] +export declare const x = 10; + + diff --git a/tests/baselines/reference/tsc/extends/configDir-template.js b/tests/baselines/reference/tsc/extends/configDir-template.js new file mode 100644 index 0000000000000..1d9956dd25663 --- /dev/null +++ b/tests/baselines/reference/tsc/extends/configDir-template.js @@ -0,0 +1,182 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/myproject --explainFiles +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/configs/first/root1' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +../../../../lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +exitCode:: ExitStatus.Success + + +//// [/home/src/projects/myproject/decls/main.d.ts] +export declare const y = 10; + + +//// [/home/src/projects/myproject/decls/src/secondary.d.ts] +export declare const z = 10; + + +//// [/home/src/projects/myproject/decls/types/sometype.d.ts] +export declare const x = 10; + + +//// [/home/src/projects/myproject/outDir/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +// some comment +exports.y = 10; + + +//// [/home/src/projects/myproject/outDir/src/secondary.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +// some comment +exports.z = 10; + + +//// [/home/src/projects/myproject/outDir/types/sometype.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + diff --git a/tests/baselines/reference/tscWatch/extends/configDir-template.js b/tests/baselines/reference/tscWatch/extends/configDir-template.js new file mode 100644 index 0000000000000..6f00b3e8baf60 --- /dev/null +++ b/tests/baselines/reference/tscWatch/extends/configDir-template.js @@ -0,0 +1,444 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w --extendedDiagnostics --explainFiles +Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +Current directory: /home/src/projects/myproject CaseSensitiveFileNames: false +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Config file +Synchronizing program +CreatingProgramWith:: + roots: ["/home/src/projects/myproject/main.ts","/home/src/projects/myproject/src/secondary.ts"] + options: {"declarationDir":"/home/src/projects/myproject/decls","paths":{"@myscope/*":["/home/src/projects/myproject/types/*"],"other/*":["other/*"]},"baseUrl":"/home/src/projects/myproject","pathsBasePath":"/home/src/projects/configs/second","typeRoots":["/home/src/projects/configs/first/root1","/home/src/projects/myproject/root2","/home/src/projects/configs/first/root3"],"types":[],"declaration":true,"outDir":"/home/src/projects/myproject/outDir","traceResolution":true,"watch":true,"extendedDiagnostics":true,"explainFiles":true,"configFilePath":"/home/src/projects/myproject/tsconfig.json"} +ExcludeWatcher:: Added:: WatchInfo: /home/src/projects/myproject/main.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/types/sometype.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src/secondary.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/configs/first/root1' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2/other/sometype2/index.d.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Source file +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/other 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/other 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/node_modules 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/node_modules 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/configs 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/configs 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +../../../../a/lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + +DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Wild card directory +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Wild card directory +FileWatcher:: Added:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file +FileWatcher:: Added:: WatchInfo: /home/src/projects/configs/second/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file + + +//// [/home/src/projects/myproject/outDir/types/sometype.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + +//// [/home/src/projects/myproject/decls/types/sometype.d.ts] +export declare const x = 10; + + +//// [/home/src/projects/myproject/outDir/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +// some comment +exports.y = 10; + + +//// [/home/src/projects/myproject/decls/main.d.ts] +export declare const y = 10; + + +//// [/home/src/projects/myproject/outDir/src/secondary.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +// some comment +exports.z = 10; + + +//// [/home/src/projects/myproject/decls/src/secondary.d.ts] +export declare const z = 10; + + + +PolledWatches:: +/home/src/projects/myproject/node_modules: *new* + {"pollingInterval":500} +/home/src/projects/myproject/other: *new* + {"pollingInterval":500} +/home/src/projects/node_modules: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/configs/first/tsconfig.json: *new* + {} +/home/src/projects/configs/second/tsconfig.json: *new* + {} +/home/src/projects/myproject/root2/other/sometype2/index.d.ts: *new* + {} +/home/src/projects/myproject/src/secondary.ts: *new* + {} +/home/src/projects/myproject/tsconfig.json: *new* + {} +/home/src/projects/myproject/types/sometype.ts: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/configs: *new* + {} +/home/src/projects/myproject/root2: *new* + {} +/home/src/projects/myproject/src: *new* + {} + +Program root files: [ + "/home/src/projects/myproject/main.ts", + "/home/src/projects/myproject/src/secondary.ts" +] +Program options: { + "declarationDir": "/home/src/projects/myproject/decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "/home/src/projects/myproject", + "pathsBasePath": "/home/src/projects/configs/second", + "typeRoots": [ + "/home/src/projects/configs/first/root1", + "/home/src/projects/myproject/root2", + "/home/src/projects/configs/first/root3" + ], + "types": [], + "declaration": true, + "outDir": "/home/src/projects/myproject/outDir", + "traceResolution": true, + "watch": true, + "extendedDiagnostics": true, + "explainFiles": true, + "configFilePath": "/home/src/projects/myproject/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/myproject/types/sometype.ts +/home/src/projects/myproject/main.ts +/home/src/projects/myproject/root2/other/sometype2/index.d.ts +/home/src/projects/myproject/src/secondary.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/myproject/types/sometype.ts +/home/src/projects/myproject/main.ts +/home/src/projects/myproject/root2/other/sometype2/index.d.ts +/home/src/projects/myproject/src/secondary.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/myproject/types/sometype.ts (computed .d.ts during emit) +/home/src/projects/myproject/main.ts (computed .d.ts during emit) +/home/src/projects/myproject/root2/other/sometype2/index.d.ts (used version) +/home/src/projects/myproject/src/secondary.ts (computed .d.ts during emit) + +exitCode:: ExitStatus.undefined + +Change:: edit extended config file + +Input:: +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "${configDir}/root2" + ], + "types": [] + } +} + + +Output:: +FileWatcher:: Triggered with /home/src/projects/configs/first/tsconfig.json 1:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/configs/first/tsconfig.json 1:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Extended config file + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +After running Timeout callback:: count: 0 +Output:: +Reloading config file: /home/src/projects/myproject/tsconfig.json +Synchronizing program +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/home/src/projects/myproject/main.ts","/home/src/projects/myproject/src/secondary.ts"] + options: {"declarationDir":"/home/src/projects/myproject/decls","paths":{"@myscope/*":["/home/src/projects/myproject/types/*"],"other/*":["other/*"]},"baseUrl":"/home/src/projects/myproject","pathsBasePath":"/home/src/projects/configs/second","typeRoots":["/home/src/projects/myproject/root2"],"types":[],"declaration":true,"outDir":"/home/src/projects/myproject/outDir","traceResolution":true,"watch":true,"extendedDiagnostics":true,"explainFiles":true,"configFilePath":"/home/src/projects/myproject/tsconfig.json"} +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Node10'. +'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/configs 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/configs 1 {"excludeFiles":["/home/src/projects/myproject/main.ts"]} Failed Lookup Locations +../../../../a/lib/lib.d.ts + Default library for target 'es5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' +src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/myproject/node_modules: + {"pollingInterval":500} +/home/src/projects/myproject/other: + {"pollingInterval":500} +/home/src/projects/node_modules: + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: + {} +/home/src/projects/configs/first/tsconfig.json: + {} +/home/src/projects/configs/second/tsconfig.json: + {} +/home/src/projects/myproject/root2/other/sometype2/index.d.ts: + {} +/home/src/projects/myproject/src/secondary.ts: + {} +/home/src/projects/myproject/tsconfig.json: + {} +/home/src/projects/myproject/types/sometype.ts: + {} + +FsWatchesRecursive:: +/home/src/projects/myproject/root2: + {} +/home/src/projects/myproject/src: + {} + +FsWatchesRecursive *deleted*:: +/home/src/projects/configs: + {} + + +Program root files: [ + "/home/src/projects/myproject/main.ts", + "/home/src/projects/myproject/src/secondary.ts" +] +Program options: { + "declarationDir": "/home/src/projects/myproject/decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "/home/src/projects/myproject", + "pathsBasePath": "/home/src/projects/configs/second", + "typeRoots": [ + "/home/src/projects/myproject/root2" + ], + "types": [], + "declaration": true, + "outDir": "/home/src/projects/myproject/outDir", + "traceResolution": true, + "watch": true, + "extendedDiagnostics": true, + "explainFiles": true, + "configFilePath": "/home/src/projects/myproject/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/myproject/types/sometype.ts +/home/src/projects/myproject/main.ts +/home/src/projects/myproject/root2/other/sometype2/index.d.ts +/home/src/projects/myproject/src/secondary.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsserver/tsserver/configDir-template.js b/tests/baselines/reference/tsserver/tsserver/configDir-template.js new file mode 100644 index 0000000000000..e22ebbe6c84cc --- /dev/null +++ b/tests/baselines/reference/tsserver/tsserver/configDir-template.js @@ -0,0 +1,598 @@ +currentDirectory:: /home/src/projects/myproject useCaseSensitiveFileNames: false +Info seq [hh:mm:ss:mss] Provided types map file "/typesMap.json" doesn't exist +Before request +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "root1", + "${configDir}/root2", + "root3" + ], + "types": [] + } +} + +//// [/home/src/projects/configs/second/tsconfig.json] +{ + "files": [ + "${configDir}/main.ts" + ], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": [ + "${configDir}/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "${configDir}" + }, + "watchOptions": { + "excludeFiles": [ + "${configDir}/main.ts" + ] + } +} + +//// [/home/src/projects/myproject/tsconfig.json] +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true + } +} + +//// [/home/src/projects/myproject/main.ts] +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; + + +//// [/home/src/projects/myproject/src/secondary.ts] +// some comment +export const z = 10; +import { k } from "other/sometype2"; + + +//// [/home/src/projects/myproject/types/sometype.ts] +export const x = 10; + + +//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] +export const k = 10; + + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +Info seq [hh:mm:ss:mss] request: + { + "command": "configure", + "arguments": { + "watchOptions": { + "excludeDirectories": [ + "${configDir}/node_modules" + ] + } + }, + "seq": 1, + "type": "request" + } +Info seq [hh:mm:ss:mss] Host watch options changed to {"excludeDirectories":["/home/src/projects/myproject/node_modules"]}, it will be take effect for next watches. +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] response: + { + "responseRequired": false + } +After request + +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "open", + "arguments": { + "file": "/home/src/projects/myproject/src/secondary.ts" + }, + "seq": 2, + "type": "request" + } +Info seq [hh:mm:ss:mss] Search path: /home/src/projects/myproject/src +Info seq [hh:mm:ss:mss] For info: /home/src/projects/myproject/src/secondary.ts :: Config file name: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Creating configuration project /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/projects/myproject/tsconfig.json", + "reason": "Creating possible configured project for /home/src/projects/myproject/src/secondary.ts to open" + } + } +Info seq [hh:mm:ss:mss] Config: /home/src/projects/myproject/tsconfig.json : { + "rootNames": [ + "/home/src/projects/myproject/main.ts", + "/home/src/projects/myproject/src/secondary.ts" + ], + "options": { + "declarationDir": "/home/src/projects/myproject/decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "/home/src/projects/myproject", + "pathsBasePath": "/home/src/projects/configs/second", + "typeRoots": [ + "/home/src/projects/configs/first/root1", + "/home/src/projects/myproject/root2", + "/home/src/projects/configs/first/root3" + ], + "types": [], + "declaration": true, + "outDir": "/home/src/projects/myproject/outDir", + "traceResolution": true, + "configFilePath": "/home/src/projects/myproject/tsconfig.json" + }, + "watchOptions": { + "excludeFiles": [ + "/home/src/projects/myproject/main.ts" + ] + } +} +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/projects/myproject/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} Config: /home/src/projects/myproject/tsconfig.json WatchType: Extended config file +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/configs/second/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} Config: /home/src/projects/myproject/tsconfig.json WatchType: Extended config file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Config: /home/src/projects/myproject/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Config: /home/src/projects/myproject/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/main.ts 500 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] ======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node10'. +Info seq [hh:mm:ss:mss] 'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +Info seq [hh:mm:ss:mss] 'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Info seq [hh:mm:ss:mss] Module name '@myscope/sometype', matched pattern '@myscope/*'. +Info seq [hh:mm:ss:mss] Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] ======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/types/sometype.ts 500 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} WatchType: Closed Script info +Info seq [hh:mm:ss:mss] ======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node10'. +Info seq [hh:mm:ss:mss] 'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +Info seq [hh:mm:ss:mss] 'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Info seq [hh:mm:ss:mss] Module name 'other/sometype2', matched pattern 'other/*'. +Info seq [hh:mm:ss:mss] Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/configs/first/root1' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +Info seq [hh:mm:ss:mss] ======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2/other/sometype2/index.d.ts 500 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/other 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/other 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/src 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] ExcludeWatcher:: Added:: WatchInfo: /home/src/projects/myproject/node_modules 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/configs 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/configs 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/myproject/root2 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/myproject/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /home/src/projects/myproject/types/sometype.ts Text-1 "export const x = 10;\n" + /home/src/projects/myproject/main.ts Text-1 "// some comment\nexport const y = 10;\nimport { x } from \"@myscope/sometype\";\n" + /home/src/projects/myproject/root2/other/sometype2/index.d.ts Text-1 "export const k = 10;\n" + /home/src/projects/myproject/src/secondary.ts SVC-1-0 "// some comment\nexport const z = 10;\nimport { k } from \"other/sometype2\";\n" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' + main.ts + Part of 'files' list in tsconfig.json + root2/other/sometype2/index.d.ts + Imported via "other/sometype2" from file 'src/secondary.ts' + src/secondary.ts + Matched by include pattern '${configDir}/src' in 'tsconfig.json' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/projects/myproject/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "telemetry", + "body": { + "telemetryEventName": "projectInfo", + "payload": { + "projectId": "c082244e14d80420126a10c084f20f9b41809e79e7f5a330fc4d923f1197daa1", + "fileStats": { + "js": 0, + "jsSize": 0, + "jsx": 0, + "jsxSize": 0, + "ts": 3, + "tsSize": 171, + "tsx": 0, + "tsxSize": 0, + "dts": 2, + "dtsSize": 355, + "deferred": 0, + "deferredSize": 0 + }, + "compilerOptions": { + "declarationDir": "", + "paths": "", + "baseUrl": "", + "typeRoots": [ + "", + "", + "" + ], + "types": [], + "declaration": true, + "outDir": "", + "traceResolution": true + }, + "typeAcquisition": { + "enable": false, + "include": false, + "exclude": false + }, + "extends": true, + "files": true, + "include": true, + "exclude": false, + "compileOnSave": false, + "configFileName": "tsconfig.json", + "projectType": "configured", + "languageServiceEnabled": true, + "version": "FakeVersion" + } + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/projects/myproject/src/secondary.ts", + "configFile": "/home/src/projects/myproject/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/projects/myproject/src/secondary.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/home/src/projects/myproject/other: *new* + {"pollingInterval":500} +/home/src/projects/node_modules: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/configs/first/tsconfig.json: *new* + {} +/home/src/projects/configs/second/tsconfig.json: *new* + {} +/home/src/projects/myproject/main.ts: *new* + {} +/home/src/projects/myproject/root2/other/sometype2/index.d.ts: *new* + {} +/home/src/projects/myproject/tsconfig.json: *new* + {} +/home/src/projects/myproject/types/sometype.ts: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/configs: *new* + {} +/home/src/projects/myproject/root2: *new* + {} +/home/src/projects/myproject/src: *new* + {} + +Projects:: +/home/src/projects/myproject/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + +ScriptInfos:: +/a/lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/projects/myproject/tsconfig.json +/home/src/projects/myproject/main.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/projects/myproject/tsconfig.json +/home/src/projects/myproject/root2/other/sometype2/index.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/projects/myproject/tsconfig.json +/home/src/projects/myproject/src/secondary.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/projects/myproject/tsconfig.json *default* +/home/src/projects/myproject/types/sometype.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/projects/myproject/tsconfig.json + +Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/configs/first/tsconfig.json 1:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} Config: /home/src/projects/myproject/tsconfig.json WatchType: Extended config file +Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/configs/first/tsconfig.json 1:: WatchInfo: /home/src/projects/configs/first/tsconfig.json 2000 {"excludeDirectories":["/home/src/projects/myproject/node_modules"]} Config: /home/src/projects/myproject/tsconfig.json WatchType: Extended config file +Before running Timeout callback:: count: 2 +1: /home/src/projects/myproject/tsconfig.json +2: *ensureProjectForOpenFiles* +//// [/home/src/projects/configs/first/tsconfig.json] +{ + "extends": "../second/tsconfig.json", + "include": [ + "${configDir}/src" + ], + "compilerOptions": { + "typeRoots": [ + "${configDir}/root2" + ], + "types": [] + } +} + + +Timeout callback:: count: 2 +1: /home/src/projects/myproject/tsconfig.json *new* +2: *ensureProjectForOpenFiles* *new* + +Projects:: +/home/src/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 2 *changed* + projectProgramVersion: 1 + dirty: true *changed* + +Info seq [hh:mm:ss:mss] Running: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Reloading configured project /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/projects/myproject/tsconfig.json", + "reason": "Change in extended config file /home/src/projects/configs/first/tsconfig.json detected" + } + } +Info seq [hh:mm:ss:mss] Config: /home/src/projects/myproject/tsconfig.json : { + "rootNames": [ + "/home/src/projects/myproject/main.ts", + "/home/src/projects/myproject/src/secondary.ts" + ], + "options": { + "declarationDir": "/home/src/projects/myproject/decls", + "paths": { + "@myscope/*": [ + "/home/src/projects/myproject/types/*" + ], + "other/*": [ + "other/*" + ] + }, + "baseUrl": "/home/src/projects/myproject", + "pathsBasePath": "/home/src/projects/configs/second", + "typeRoots": [ + "/home/src/projects/myproject/root2" + ], + "types": [], + "declaration": true, + "outDir": "/home/src/projects/myproject/outDir", + "traceResolution": true, + "configFilePath": "/home/src/projects/myproject/tsconfig.json" + }, + "watchOptions": { + "excludeFiles": [ + "/home/src/projects/myproject/main.ts" + ] + } +} +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] ======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node10'. +Info seq [hh:mm:ss:mss] 'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name '@myscope/sometype'. +Info seq [hh:mm:ss:mss] 'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Info seq [hh:mm:ss:mss] Module name '@myscope/sometype', matched pattern '@myscope/*'. +Info seq [hh:mm:ss:mss] Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] ======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +Info seq [hh:mm:ss:mss] ======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node10'. +Info seq [hh:mm:ss:mss] 'baseUrl' option is set to '/home/src/projects/myproject', using this value to resolve non-relative module name 'other/sometype2'. +Info seq [hh:mm:ss:mss] 'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Info seq [hh:mm:ss:mss] Module name 'other/sometype2', matched pattern 'other/*'. +Info seq [hh:mm:ss:mss] Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/myproject/other/sometype2', target file types: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/node_modules' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/root2/other/sometype2.d.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/root2/other/sometype2/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/projects/myproject/root2/other/sometype2/index.d.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/projects/myproject/root2/other/sometype2/index.d.ts', result '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. +Info seq [hh:mm:ss:mss] ======== Module name 'other/sometype2' was successfully resolved to '/home/src/projects/myproject/root2/other/sometype2/index.d.ts'. ======== +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/configs 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/configs 1 {"excludeDirectories":["/home/src/projects/myproject/node_modules"],"excludeFiles":["/home/src/projects/myproject/main.ts"]} Project: /home/src/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/myproject/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /home/src/projects/myproject/types/sometype.ts Text-1 "export const x = 10;\n" + /home/src/projects/myproject/main.ts Text-1 "// some comment\nexport const y = 10;\nimport { x } from \"@myscope/sometype\";\n" + /home/src/projects/myproject/root2/other/sometype2/index.d.ts Text-1 "export const k = 10;\n" + /home/src/projects/myproject/src/secondary.ts SVC-1-0 "// some comment\nexport const z = 10;\nimport { k } from \"other/sometype2\";\n" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/projects/myproject/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/projects/myproject/tsconfig.json", + "configFile": "/home/src/projects/myproject/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/home/src/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/projects/myproject/src/secondary.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/home/src/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/projects/myproject/src/secondary.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background /home/src/projects/myproject/src/secondary.ts +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectsUpdatedInBackground", + "body": { + "openFiles": [ + "/home/src/projects/myproject/src/secondary.ts" + ] + } + } +After running Timeout callback:: count: 0 + +PolledWatches:: +/home/src/projects/myproject/other: + {"pollingInterval":500} +/home/src/projects/node_modules: + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: + {} +/home/src/projects/configs/first/tsconfig.json: + {} +/home/src/projects/configs/second/tsconfig.json: + {} +/home/src/projects/myproject/main.ts: + {} +/home/src/projects/myproject/root2/other/sometype2/index.d.ts: + {} +/home/src/projects/myproject/tsconfig.json: + {} +/home/src/projects/myproject/types/sometype.ts: + {} + +FsWatchesRecursive:: +/home/src/projects/myproject/root2: + {} +/home/src/projects/myproject/src: + {} + +FsWatchesRecursive *deleted*:: +/home/src/projects/configs: + {} + +Projects:: +/home/src/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 2 + projectProgramVersion: 2 *changed* + dirty: false *changed* From e6d9e4e952c6b3847f570a4ea221ff41d5b58859 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 12 Apr 2024 15:55:21 -0700 Subject: [PATCH 3/3] Always createCopyOnSubstitute --- src/compiler/commandLineParser.ts | 52 ++++++++++++------------------- src/server/editorServices.ts | 3 +- 2 files changed, 21 insertions(+), 34 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index b14a97dc1a37e..3dec1990a1ee7 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -2907,12 +2907,17 @@ function parseJsonConfigFileContentWorker( const parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache); const { raw } = parsedConfig; - const options = extend(existingOptions, parsedConfig.options || {}); - let watchOptions = existingWatchOptions && parsedConfig.watchOptions ? - extend(existingWatchOptions, parsedConfig.watchOptions) : - parsedConfig.watchOptions || existingWatchOptions; - handleOptionConfigDirTemplateSubstitution(options, configDirTemplateSubstitutionOptions, basePath); - watchOptions = handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, basePath, !existingWatchOptions || !parsedConfig.watchOptions); + const options = handleOptionConfigDirTemplateSubstitution( + extend(existingOptions, parsedConfig.options || {}), + configDirTemplateSubstitutionOptions, + basePath, + ) as CompilerOptions; + const watchOptions = handleWatchOptionsConfigDirTemplateSubstitution( + existingWatchOptions && parsedConfig.watchOptions ? + extend(existingWatchOptions, parsedConfig.watchOptions) : + parsedConfig.watchOptions || existingWatchOptions, + basePath, + ); options.configFilePath = configFileName && normalizeSlashes(configFileName); const basePathForFileNames = normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath); const configFileSpecs = getConfigFileSpecs(); @@ -2985,7 +2990,6 @@ function parseJsonConfigFileContentWorker( validatedIncludeSpecs = getSubstitutedStringArrayWithConfigDirTemplate( validatedIncludeSpecsBeforeSubstitution, basePathForFileNames, - /*createCopyOnSubstitute*/ true, ) || validatedIncludeSpecsBeforeSubstitution; } @@ -2994,7 +2998,6 @@ function parseJsonConfigFileContentWorker( validatedExcludeSpecs = getSubstitutedStringArrayWithConfigDirTemplate( validatedExcludeSpecsBeforeSubstitution, basePathForFileNames, - /*createCopyOnSubstitute*/ true, ) || validatedExcludeSpecsBeforeSubstitution; } @@ -3002,7 +3005,6 @@ function parseJsonConfigFileContentWorker( const validatedFilesSpec = getSubstitutedStringArrayWithConfigDirTemplate( validatedFilesSpecBeforeSubstitution, basePathForFileNames, - /*createCopyOnSubstitute*/ true, ) || validatedFilesSpecBeforeSubstitution; return { @@ -3086,16 +3088,14 @@ function parseJsonConfigFileContentWorker( export function handleWatchOptionsConfigDirTemplateSubstitution( watchOptions: WatchOptions | undefined, basePath: string, - createCopyOnSubstitute?: boolean, ) { - return handleOptionConfigDirTemplateSubstitution(watchOptions, configDirTemplateSubstitutionWatchOptions, basePath, createCopyOnSubstitute) as WatchOptions | undefined; + return handleOptionConfigDirTemplateSubstitution(watchOptions, configDirTemplateSubstitutionWatchOptions, basePath) as WatchOptions | undefined; } function handleOptionConfigDirTemplateSubstitution( options: OptionsBase | undefined, optionDeclarations: readonly CommandLineOption[], basePath: string, - createCopyOnSubstitute?: boolean, ) { if (!options) return options; let result: OptionsBase | undefined; @@ -3111,12 +3111,12 @@ function handleOptionConfigDirTemplateSubstitution( break; case "list": Debug.assert(option.element.isFilePath); - const listResult = getSubstitutedStringArrayWithConfigDirTemplate(value as string[], basePath, createCopyOnSubstitute); + const listResult = getSubstitutedStringArrayWithConfigDirTemplate(value as string[], basePath); if (listResult) setOptionValue(option, listResult); break; case "object": Debug.assert(option.name === "paths"); - const objectResult = getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(value as MapLike, basePath, createCopyOnSubstitute); + const objectResult = getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(value as MapLike, basePath); if (objectResult) setOptionValue(option, objectResult); break; default: @@ -3127,13 +3127,7 @@ function handleOptionConfigDirTemplateSubstitution( return result || options; function setOptionValue(option: CommandLineOption, value: CompilerOptionsValue) { - if (createCopyOnSubstitute) { - if (!result) result = assign({}, options); - result[option.name] = value; - } - else { - options![option.name] = value; - } + (result ??= assign({}, options))[option.name] = value; } } @@ -3146,30 +3140,24 @@ function getSubstitutedPathWithConfigDirTemplate(value: string, basePath: string return getNormalizedAbsolutePath(value.replace(configDirTemplate, "./"), basePath); } -function getSubstitutedStringArrayWithConfigDirTemplate(list: string[] | undefined, basePath: string, createCopyOnSubstitute?: boolean): string[] | undefined; -function getSubstitutedStringArrayWithConfigDirTemplate(list: readonly string[] | undefined, basePath: string, createCopyOnSubstitute: true): string[] | undefined; -function getSubstitutedStringArrayWithConfigDirTemplate(list: readonly string[] | string[] | undefined, basePath: string, createCopyOnSubstitute?: boolean) { +function getSubstitutedStringArrayWithConfigDirTemplate(list: readonly string[] | undefined, basePath: string) { if (!list) return list; let result: string[] | undefined; list.forEach((element, index) => { if (!startsWithConfigDirTemplate(element)) return; - if (createCopyOnSubstitute) result ??= list.slice(); - else result ??= list as unknown as string[]; - result[index] = getSubstitutedPathWithConfigDirTemplate(element, basePath); + (result ??= list.slice())[index] = getSubstitutedPathWithConfigDirTemplate(element, basePath); }); return result; } -function getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(mapLike: MapLike, basePath: string, createCopyOnSubstitute?: boolean) { +function getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(mapLike: MapLike, basePath: string) { let result: MapLike | undefined; const ownKeys = getOwnKeys(mapLike); ownKeys.forEach(key => { if (!isArray(mapLike[key])) return; - const subStitution = getSubstitutedStringArrayWithConfigDirTemplate(mapLike[key], basePath, createCopyOnSubstitute); + const subStitution = getSubstitutedStringArrayWithConfigDirTemplate(mapLike[key], basePath); if (!subStitution) return; - if (createCopyOnSubstitute) result ??= assign({}, mapLike); - else result ??= mapLike; - mapLike[key] = subStitution; + (result ??= assign({}, mapLike))[key] = subStitution; }); return result; } diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index f1721e458bbd1..68ffcbcd07f9f 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -3464,7 +3464,7 @@ export class ProjectService { if (args.watchOptions) { const watchOptions = convertWatchOptions(args.watchOptions)?.watchOptions; - const substitution = handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, this.currentDirectory, /*createCopyOnSubstitute*/ true); + const substitution = handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, this.currentDirectory); this.hostConfiguration.watchOptions = substitution; this.hostConfiguration.beforeSubstitution = substitution === watchOptions ? undefined : watchOptions; this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`); @@ -3483,7 +3483,6 @@ export class ProjectService { handleWatchOptionsConfigDirTemplateSubstitution( this.hostConfiguration.beforeSubstitution, basePath, - /*createCopyOnSubstitute*/ true, ); return projectOptions && hostWatchOptions ? { ...hostWatchOptions, ...projectOptions } :