From 5b3bc60465b748f3a923209975924fd675f6fc87 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 15 Jul 2020 14:00:01 -0700 Subject: [PATCH 1/3] Add tests corresponding to repro from #37928 --- src/testRunner/tsconfig.json | 1 + .../unittests/tsbuild/declarationEmit.ts | 93 ++++++++ ...d-through-triple-slash-and-uses-baseUrl.js | 209 +++++++++++++++++ ...ugh-triple-slash-but-uses-no-references.js | 175 ++++++++++++++ ...file-is-referenced-through-triple-slash.js | 214 ++++++++++++++++++ 5 files changed, 692 insertions(+) create mode 100644 src/testRunner/unittests/tsbuild/declarationEmit.ts create mode 100644 tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js create mode 100644 tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js create mode 100644 tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 00764792e70ac..8b0123e1ef9be 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -110,6 +110,7 @@ "unittests/tsbuild/amdModulesWithOut.ts", "unittests/tsbuild/configFileErrors.ts", "unittests/tsbuild/containerOnlyReferenced.ts", + "unittests/tsbuild/declarationEmit.ts", "unittests/tsbuild/demo.ts", "unittests/tsbuild/emitDeclarationOnly.ts", "unittests/tsbuild/emptyFiles.ts", diff --git a/src/testRunner/unittests/tsbuild/declarationEmit.ts b/src/testRunner/unittests/tsbuild/declarationEmit.ts new file mode 100644 index 0000000000000..35c1c7eaf4ec8 --- /dev/null +++ b/src/testRunner/unittests/tsbuild/declarationEmit.ts @@ -0,0 +1,93 @@ +namespace ts { + describe("unittests:: tsbuild:: declarationEmit", () => { + function getFiles(): vfs.FileSet { + return { + "/src/solution/tsconfig.base.json": JSON.stringify({ + compilerOptions: { + rootDir: "./", + outDir: "lib" + } + }), + "/src/solution/tsconfig.json": JSON.stringify({ + compilerOptions: { composite: true }, + references: [{ path: "./src" }], + include: [] + }), + "/src/solution/src/tsconfig.json": JSON.stringify({ + compilerOptions: { composite: true }, + references: [{ path: "./subProject" }, { path: "./subProject2" }], + include: [] + }), + "/src/solution/src/subProject/tsconfig.json": JSON.stringify({ + extends: "../../tsconfig.base.json", + compilerOptions: { composite: true }, + references: [{ path: "../common" }], + include: ["./index.ts"] + }), + "/src/solution/src/subProject/index.ts": Utils.dedent` +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal;`, + "/src/solution/src/subProject2/tsconfig.json": JSON.stringify({ + extends: "../../tsconfig.base.json", + compilerOptions: { composite: true }, + references: [{ path: "../subProject" }], + include: ["./index.ts"] + }), + "/src/solution/src/subProject2/index.ts": Utils.dedent` +import { MyNominal } from '../subProject/index'; +const variable = { + key: 'value' as MyNominal, +}; +export function getVar(): keyof typeof variable { + return 'key'; +}`, + "/src/solution/src/common/tsconfig.json": JSON.stringify({ + extends: "../../tsconfig.base.json", + compilerOptions: { composite: true }, + include: ["./nominal.ts"] + }), + "/src/solution/src/common/nominal.ts": Utils.dedent` +/// +export declare type Nominal = MyNominal;`, + "/src/solution/src/common/types.d.ts": Utils.dedent` +declare type MyNominal = T & { + specialKey: Name; +};`, + }; + } + verifyTsc({ + scenario: "declarationEmit", + subScenario: "when declaration file is referenced through triple slash", + fs: () => loadProjectFromFiles(getFiles()), + commandLineArgs: ["--b", "/src/solution/tsconfig.json", "--verbose"] + }); + + verifyTsc({ + scenario: "declarationEmit", + subScenario: "when declaration file is referenced through triple slash and uses baseUrl", + fs: () => loadProjectFromFiles({ + ...getFiles(), + "/src/solution/src/common/tsconfig.json": JSON.stringify({ + extends: "../../tsconfig.base.json", + compilerOptions: { composite: true, baseUrl: "./" }, + include: ["./nominal.ts"] + }), + }), + commandLineArgs: ["--b", "/src/solution/tsconfig.json", "--verbose"] + }); + + verifyTsc({ + scenario: "declarationEmit", + subScenario: "when declaration file is referenced through triple slash but uses no references", + fs: () => loadProjectFromFiles({ + ...getFiles(), + "/src/solution/tsconfig.json": JSON.stringify({ + extends: "./tsconfig.base.json", + compilerOptions: { composite: true }, + include: ["./src/**/*.ts"] + }), + }), + commandLineArgs: ["--b", "/src/solution/tsconfig.json", "--verbose"] + }); + }); +} diff --git a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js new file mode 100644 index 0000000000000..ea303b1df363e --- /dev/null +++ b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js @@ -0,0 +1,209 @@ +Input:: +//// [/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; }; + +//// [/src/solution/src/common/nominal.ts] +/// +export declare type Nominal = MyNominal; + +//// [/src/solution/src/common/tsconfig.json] +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true,"baseUrl":"./"},"include":["./nominal.ts"]} + +//// [/src/solution/src/common/types.d.ts] +declare type MyNominal = T & { + specialKey: Name; +}; + +//// [/src/solution/src/subProject/index.ts] +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; + +//// [/src/solution/src/subProject/tsconfig.json] +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../common"}],"include":["./index.ts"]} + +//// [/src/solution/src/subProject2/index.ts] + + +//// [/src/solution/src/subProject2/tsconfig.json] +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../subProject"}],"include":["./index.ts"]} + +//// [/src/solution/src/tsconfig.json] +{"compilerOptions":{"composite":true},"references":[{"path":"./subProject"},{"path":"./subProject2"}],"include":[]} + +//// [/src/solution/tsconfig.base.json] +{"compilerOptions":{"rootDir":"./","outDir":"lib"}} + +//// [/src/solution/tsconfig.json] +{"compilerOptions":{"composite":true},"references":[{"path":"./src"}],"include":[]} + + + +Output:: +/lib/tsc --b /src/solution/tsconfig.json --verbose +[12:00:00 AM] Projects in this build: + * src/solution/src/common/tsconfig.json + * src/solution/src/subProject/tsconfig.json + * src/solution/src/subProject2/tsconfig.json + * src/solution/src/tsconfig.json + * src/solution/tsconfig.json + +[12:00:00 AM] Project 'src/solution/src/common/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist + +[12:00:00 AM] Building project '/src/solution/src/common/tsconfig.json'... + +[12:00:00 AM] Project 'src/solution/src/subProject/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject/index.js' does not exist + +[12:00:00 AM] Building project '/src/solution/src/subProject/tsconfig.json'... + +src/solution/lib/src/common/nominal.d.ts:2:55 - error TS2304: Cannot find name 'MyNominal'. + +2 export declare type Nominal = MyNominal; +   ~~~~~~~~~ + +src/solution/lib/src/common/nominal.d.ts:1:23 - error TS2688: Cannot find type definition file for 'types'. + +1 /// +   ~~~~~ + +[12:00:00 AM] Project 'src/solution/src/subProject2/tsconfig.json' can't be built because its dependency 'src/solution/src/subProject' has errors + +[12:00:00 AM] Skipping build of project '/src/solution/src/subProject2/tsconfig.json' because its dependency '/src/solution/src/subProject' has errors + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/solution/lib/src/common/nominal.d.ts] +/// +export declare type Nominal = MyNominal; + + +//// [/src/solution/lib/src/common/nominal.js] +"use strict"; +exports.__esModule = true; +/// + + +//// [/src/solution/lib/src/common/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../lib/lib.d.ts": { + "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../../src/common/types.d.ts": { + "version": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true + }, + "../../../src/common/nominal.ts": { + "version": "4107369137-/// \nexport declare type Nominal = MyNominal;", + "signature": "-2060908103-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "baseUrl": "../../../src/common", + "configFilePath": "../../../src/common/tsconfig.json" + }, + "referencedMap": { + "../../../src/common/nominal.ts": [ + "../../../src/common/types.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../lib/lib.d.ts", + "../../../src/common/nominal.ts", + "../../../src/common/types.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../lib/lib.d.ts": { + "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../common/nominal.d.ts": { + "version": "-2060908103-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "signature": "-2060908103-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "affectsGlobalScope": false + }, + "../../../src/subproject/index.ts": { + "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/subProject/tsconfig.json" + }, + "referencedMap": { + "../../../src/subproject/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "exportedModulesMap": { + "../../../src/subproject/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../lib/lib.d.ts", + [ + "../common/nominal.d.ts", + [ + { + "file": "../common/nominal.d.ts", + "start": 87, + "length": 9, + "messageText": "Cannot find name 'MyNominal'.", + "category": 1, + "code": 2304 + } + ] + ], + "../../../src/subproject/index.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../common/nominal.d.ts", + 1 + ], + [ + "../../../src/subproject/index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js new file mode 100644 index 0000000000000..1505191c5bd2b --- /dev/null +++ b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js @@ -0,0 +1,175 @@ +Input:: +//// [/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; }; + +//// [/src/solution/src/common/nominal.ts] +/// +export declare type Nominal = MyNominal; + +//// [/src/solution/src/common/tsconfig.json] + + +//// [/src/solution/src/common/types.d.ts] +declare type MyNominal = T & { + specialKey: Name; +}; + +//// [/src/solution/src/subProject/index.ts] +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; + +//// [/src/solution/src/subProject/tsconfig.json] + + +//// [/src/solution/src/subProject2/index.ts] +import { MyNominal } from '../subProject/index'; +const variable = { + key: 'value' as MyNominal, +}; +export function getVar(): keyof typeof variable { + return 'key'; +} + +//// [/src/solution/src/subProject2/tsconfig.json] + + +//// [/src/solution/src/tsconfig.json] + + +//// [/src/solution/tsconfig.base.json] +{"compilerOptions":{"rootDir":"./","outDir":"lib"}} + +//// [/src/solution/tsconfig.json] +{"extends":"./tsconfig.base.json","compilerOptions":{"composite":true},"include":["./src/**/*.ts"]} + + + +Output:: +/lib/tsc --b /src/solution/tsconfig.json --verbose +[12:00:00 AM] Projects in this build: + * src/solution/tsconfig.json + +[12:00:00 AM] Project 'src/solution/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist + +[12:00:00 AM] Building project '/src/solution/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/solution/lib/src/common/nominal.d.ts] +/// +export declare type Nominal = MyNominal; + + +//// [/src/solution/lib/src/common/nominal.js] +"use strict"; +exports.__esModule = true; +/// + + +//// [/src/solution/lib/src/subProject/index.d.ts] +import { Nominal } from '../common/nominal'; +export declare type MyNominal = Nominal; + + +//// [/src/solution/lib/src/subProject/index.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/solution/lib/src/subProject2/index.d.ts] +declare const variable: { + key: globalThis.MyNominal; +}; +export declare function getVar(): keyof typeof variable; +export {}; + + +//// [/src/solution/lib/src/subProject2/index.js] +"use strict"; +exports.__esModule = true; +exports.getVar = void 0; +var variable = { + key: 'value' +}; +function getVar() { + return 'key'; +} +exports.getVar = getVar; + + +//// [/src/solution/lib/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../src/common/types.d.ts": { + "version": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true + }, + "../src/common/nominal.ts": { + "version": "4107369137-/// \nexport declare type Nominal = MyNominal;", + "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "affectsGlobalScope": false + }, + "../src/subproject/index.ts": { + "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", + "affectsGlobalScope": false + }, + "../src/subproject2/index.ts": { + "version": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "-448645961-declare const variable: {\r\n key: globalThis.MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "..", + "outDir": "./", + "composite": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/common/nominal.ts": [ + "../src/common/types.d.ts" + ], + "../src/subproject/index.ts": [ + "../src/common/nominal.ts" + ], + "../src/subproject2/index.ts": [ + "../src/subproject/index.ts" + ] + }, + "exportedModulesMap": { + "../src/subproject/index.ts": [ + "../src/common/nominal.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../lib/lib.d.ts", + "../src/common/nominal.ts", + "../src/common/types.d.ts", + "../src/subproject/index.ts", + "../src/subproject2/index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js new file mode 100644 index 0000000000000..64de0ecb5790d --- /dev/null +++ b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js @@ -0,0 +1,214 @@ +Input:: +//// [/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; }; + +//// [/src/solution/src/common/nominal.ts] +/// +export declare type Nominal = MyNominal; + +//// [/src/solution/src/common/tsconfig.json] +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"include":["./nominal.ts"]} + +//// [/src/solution/src/common/types.d.ts] +declare type MyNominal = T & { + specialKey: Name; +}; + +//// [/src/solution/src/subProject/index.ts] +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; + +//// [/src/solution/src/subProject/tsconfig.json] +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../common"}],"include":["./index.ts"]} + +//// [/src/solution/src/subProject2/index.ts] + + +//// [/src/solution/src/subProject2/tsconfig.json] +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../subProject"}],"include":["./index.ts"]} + +//// [/src/solution/src/tsconfig.json] +{"compilerOptions":{"composite":true},"references":[{"path":"./subProject"},{"path":"./subProject2"}],"include":[]} + +//// [/src/solution/tsconfig.base.json] +{"compilerOptions":{"rootDir":"./","outDir":"lib"}} + +//// [/src/solution/tsconfig.json] +{"compilerOptions":{"composite":true},"references":[{"path":"./src"}],"include":[]} + + + +Output:: +/lib/tsc --b /src/solution/tsconfig.json --verbose +[12:00:00 AM] Projects in this build: + * src/solution/src/common/tsconfig.json + * src/solution/src/subProject/tsconfig.json + * src/solution/src/subProject2/tsconfig.json + * src/solution/src/tsconfig.json + * src/solution/tsconfig.json + +[12:00:00 AM] Project 'src/solution/src/common/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist + +[12:00:00 AM] Building project '/src/solution/src/common/tsconfig.json'... + +[12:00:00 AM] Project 'src/solution/src/subProject/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject/index.js' does not exist + +[12:00:00 AM] Building project '/src/solution/src/subProject/tsconfig.json'... + +src/solution/lib/src/common/nominal.d.ts:2:55 - error TS2304: Cannot find name 'MyNominal'. + +2 export declare type Nominal = MyNominal; +   ~~~~~~~~~ + +src/solution/lib/src/common/nominal.d.ts:1:22 - error TS6053: File '/src/src/common/types.d.ts' not found. + +1 /// +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[12:00:00 AM] Project 'src/solution/src/subProject2/tsconfig.json' can't be built because its dependency 'src/solution/src/subProject' has errors + +[12:00:00 AM] Skipping build of project '/src/solution/src/subProject2/tsconfig.json' because its dependency '/src/solution/src/subProject' has errors + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/solution/lib/src/common/nominal.d.ts] +/// +export declare type Nominal = MyNominal; + + +//// [/src/solution/lib/src/common/nominal.js] +"use strict"; +exports.__esModule = true; +/// + + +//// [/src/solution/lib/src/common/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../lib/lib.d.ts": { + "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../../src/common/types.d.ts": { + "version": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true + }, + "../../../src/common/nominal.ts": { + "version": "4107369137-/// \nexport declare type Nominal = MyNominal;", + "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/common/tsconfig.json" + }, + "referencedMap": { + "../../../src/common/nominal.ts": [ + "../../../src/common/types.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../lib/lib.d.ts", + "../../../src/common/nominal.ts", + "../../../src/common/types.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../lib/lib.d.ts": { + "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../common/nominal.d.ts": { + "version": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "affectsGlobalScope": false + }, + "../../../src/subproject/index.ts": { + "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/subProject/tsconfig.json" + }, + "referencedMap": { + "../common/nominal.d.ts": [ + "../../../src/common/types.d.ts" + ], + "../../../src/subproject/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "exportedModulesMap": { + "../common/nominal.d.ts": [ + "../../../src/common/types.d.ts" + ], + "../../../src/subproject/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../lib/lib.d.ts", + [ + "../common/nominal.d.ts", + [ + { + "file": "../common/nominal.d.ts", + "start": 111, + "length": 9, + "messageText": "Cannot find name 'MyNominal'.", + "category": 1, + "code": 2304 + } + ] + ], + "../../../src/subproject/index.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../common/nominal.d.ts", + 1 + ], + [ + "../../../src/subproject/index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + From 6505a1d06656c273602bc25b0171ff5f05d48c10 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 15 Jul 2020 14:41:33 -0700 Subject: [PATCH 2/3] Triple slash references must resolve against the resolved file name (.d.ts and not original source file) since they are rewritten in the .d.ts emit --- src/compiler/checker.ts | 2 +- src/compiler/program.ts | 2 +- ...file-is-referenced-through-triple-slash.js | 150 +++++++++++++----- 3 files changed, 114 insertions(+), 40 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e0dea081f67e8..815b29454fd4b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -37470,7 +37470,7 @@ namespace ts { if (fileToDirective.has(file.path)) return; fileToDirective.set(file.path, key); for (const { fileName } of file.referencedFiles) { - const resolvedFile = resolveTripleslashReference(fileName, file.originalFileName); + const resolvedFile = resolveTripleslashReference(fileName, file.fileName); const referencedFile = host.getSourceFile(resolvedFile); if (referencedFile) { addReferencedFilesToTypeDirective(referencedFile, key); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 7ac32c14a7e3d..132938d5fb8c7 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2667,7 +2667,7 @@ namespace ts { return; } forEach(file.referencedFiles, (ref, index) => { - const referencedFileName = resolveTripleslashReference(ref.fileName, file.originalFileName); + const referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName); processSourceFile( referencedFileName, isDefaultLib, diff --git a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js index 64de0ecb5790d..b7d7dd16ac6b4 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash.js @@ -34,7 +34,13 @@ export type MyNominal = Nominal; {"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../common"}],"include":["./index.ts"]} //// [/src/solution/src/subProject2/index.ts] - +import { MyNominal } from '../subProject/index'; +const variable = { + key: 'value' as MyNominal, +}; +export function getVar(): keyof typeof variable { + return 'key'; +} //// [/src/solution/src/subProject2/tsconfig.json] {"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../subProject"}],"include":["./index.ts"]} @@ -67,24 +73,11 @@ Output:: [12:00:00 AM] Building project '/src/solution/src/subProject/tsconfig.json'... -src/solution/lib/src/common/nominal.d.ts:2:55 - error TS2304: Cannot find name 'MyNominal'. - -2 export declare type Nominal = MyNominal; -   ~~~~~~~~~ - -src/solution/lib/src/common/nominal.d.ts:1:22 - error TS6053: File '/src/src/common/types.d.ts' not found. - -1 /// -   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[12:00:00 AM] Project 'src/solution/src/subProject2/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject2/index.js' does not exist -[12:00:00 AM] Project 'src/solution/src/subProject2/tsconfig.json' can't be built because its dependency 'src/solution/src/subProject' has errors +[12:00:00 AM] Building project '/src/solution/src/subProject2/tsconfig.json'... -[12:00:00 AM] Skipping build of project '/src/solution/src/subProject2/tsconfig.json' because its dependency '/src/solution/src/subProject' has errors - - -Found 2 errors. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +exitCode:: ExitStatus.Success //// [/src/solution/lib/src/common/nominal.d.ts] @@ -139,6 +132,16 @@ exports.__esModule = true; "version": "FakeTSVersion" } +//// [/src/solution/lib/src/subProject/index.d.ts] +import { Nominal } from '../common/nominal'; +export declare type MyNominal = Nominal; + + +//// [/src/solution/lib/src/subProject/index.js] +"use strict"; +exports.__esModule = true; + + //// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo] { "program": { @@ -148,6 +151,11 @@ exports.__esModule = true; "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true }, + "../../../src/common/types.d.ts": { + "version": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true + }, "../common/nominal.d.ts": { "version": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", @@ -183,30 +191,96 @@ exports.__esModule = true; }, "semanticDiagnosticsPerFile": [ "../../../../../lib/lib.d.ts", - [ - "../common/nominal.d.ts", - [ - { - "file": "../common/nominal.d.ts", - "start": 111, - "length": 9, - "messageText": "Cannot find name 'MyNominal'.", - "category": 1, - "code": 2304 - } - ] - ], + "../common/nominal.d.ts", + "../../../src/common/types.d.ts", "../../../src/subproject/index.ts" - ], - "affectedFilesPendingEmit": [ - [ - "../common/nominal.d.ts", - 1 + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/solution/lib/src/subProject2/index.d.ts] +declare const variable: { + key: globalThis.MyNominal; +}; +export declare function getVar(): keyof typeof variable; +export {}; + + +//// [/src/solution/lib/src/subProject2/index.js] +"use strict"; +exports.__esModule = true; +exports.getVar = void 0; +var variable = { + key: 'value' +}; +function getVar() { + return 'key'; +} +exports.getVar = getVar; + + +//// [/src/solution/lib/src/subProject2/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../lib/lib.d.ts": { + "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../../src/common/types.d.ts": { + "version": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true + }, + "../common/nominal.d.ts": { + "version": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n", + "affectsGlobalScope": false + }, + "../subproject/index.d.ts": { + "version": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", + "affectsGlobalScope": false + }, + "../../../src/subproject2/index.ts": { + "version": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "-448645961-declare const variable: {\r\n key: globalThis.MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/subProject2/tsconfig.json" + }, + "referencedMap": { + "../common/nominal.d.ts": [ + "../../../src/common/types.d.ts" ], - [ - "../../../src/subproject/index.ts", - 1 + "../subproject/index.d.ts": [ + "../common/nominal.d.ts" + ], + "../../../src/subproject2/index.ts": [ + "../subproject/index.d.ts" ] + }, + "exportedModulesMap": { + "../common/nominal.d.ts": [ + "../../../src/common/types.d.ts" + ], + "../subproject/index.d.ts": [ + "../common/nominal.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../lib/lib.d.ts", + "../common/nominal.d.ts", + "../subproject/index.d.ts", + "../../../src/common/types.d.ts", + "../../../src/subproject2/index.ts" ] }, "version": "FakeTSVersion" From 61027a187fb75c9aac22e6910f91c5b8f38d788d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 17 Jul 2020 14:41:55 -0700 Subject: [PATCH 3/3] Remove the scenario not fixed in this PR --- .../unittests/tsbuild/declarationEmit.ts | 14 -- ...d-through-triple-slash-and-uses-baseUrl.js | 209 ------------------ 2 files changed, 223 deletions(-) delete mode 100644 tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js diff --git a/src/testRunner/unittests/tsbuild/declarationEmit.ts b/src/testRunner/unittests/tsbuild/declarationEmit.ts index 35c1c7eaf4ec8..6139f585b9663 100644 --- a/src/testRunner/unittests/tsbuild/declarationEmit.ts +++ b/src/testRunner/unittests/tsbuild/declarationEmit.ts @@ -62,20 +62,6 @@ declare type MyNominal = T & { commandLineArgs: ["--b", "/src/solution/tsconfig.json", "--verbose"] }); - verifyTsc({ - scenario: "declarationEmit", - subScenario: "when declaration file is referenced through triple slash and uses baseUrl", - fs: () => loadProjectFromFiles({ - ...getFiles(), - "/src/solution/src/common/tsconfig.json": JSON.stringify({ - extends: "../../tsconfig.base.json", - compilerOptions: { composite: true, baseUrl: "./" }, - include: ["./nominal.ts"] - }), - }), - commandLineArgs: ["--b", "/src/solution/tsconfig.json", "--verbose"] - }); - verifyTsc({ scenario: "declarationEmit", subScenario: "when declaration file is referenced through triple slash but uses no references", diff --git a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js b/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js deleted file mode 100644 index ea303b1df363e..0000000000000 --- a/tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-is-referenced-through-triple-slash-and-uses-baseUrl.js +++ /dev/null @@ -1,209 +0,0 @@ -Input:: -//// [/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; }; - -//// [/src/solution/src/common/nominal.ts] -/// -export declare type Nominal = MyNominal; - -//// [/src/solution/src/common/tsconfig.json] -{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true,"baseUrl":"./"},"include":["./nominal.ts"]} - -//// [/src/solution/src/common/types.d.ts] -declare type MyNominal = T & { - specialKey: Name; -}; - -//// [/src/solution/src/subProject/index.ts] -import { Nominal } from '../common/nominal'; -export type MyNominal = Nominal; - -//// [/src/solution/src/subProject/tsconfig.json] -{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../common"}],"include":["./index.ts"]} - -//// [/src/solution/src/subProject2/index.ts] - - -//// [/src/solution/src/subProject2/tsconfig.json] -{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../subProject"}],"include":["./index.ts"]} - -//// [/src/solution/src/tsconfig.json] -{"compilerOptions":{"composite":true},"references":[{"path":"./subProject"},{"path":"./subProject2"}],"include":[]} - -//// [/src/solution/tsconfig.base.json] -{"compilerOptions":{"rootDir":"./","outDir":"lib"}} - -//// [/src/solution/tsconfig.json] -{"compilerOptions":{"composite":true},"references":[{"path":"./src"}],"include":[]} - - - -Output:: -/lib/tsc --b /src/solution/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: - * src/solution/src/common/tsconfig.json - * src/solution/src/subProject/tsconfig.json - * src/solution/src/subProject2/tsconfig.json - * src/solution/src/tsconfig.json - * src/solution/tsconfig.json - -[12:00:00 AM] Project 'src/solution/src/common/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist - -[12:00:00 AM] Building project '/src/solution/src/common/tsconfig.json'... - -[12:00:00 AM] Project 'src/solution/src/subProject/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject/index.js' does not exist - -[12:00:00 AM] Building project '/src/solution/src/subProject/tsconfig.json'... - -src/solution/lib/src/common/nominal.d.ts:2:55 - error TS2304: Cannot find name 'MyNominal'. - -2 export declare type Nominal = MyNominal; -   ~~~~~~~~~ - -src/solution/lib/src/common/nominal.d.ts:1:23 - error TS2688: Cannot find type definition file for 'types'. - -1 /// -   ~~~~~ - -[12:00:00 AM] Project 'src/solution/src/subProject2/tsconfig.json' can't be built because its dependency 'src/solution/src/subProject' has errors - -[12:00:00 AM] Skipping build of project '/src/solution/src/subProject2/tsconfig.json' because its dependency '/src/solution/src/subProject' has errors - - -Found 2 errors. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - -//// [/src/solution/lib/src/common/nominal.d.ts] -/// -export declare type Nominal = MyNominal; - - -//// [/src/solution/lib/src/common/nominal.js] -"use strict"; -exports.__esModule = true; -/// - - -//// [/src/solution/lib/src/common/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../../../lib/lib.d.ts": { - "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../../../src/common/types.d.ts": { - "version": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", - "signature": "23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};", - "affectsGlobalScope": true - }, - "../../../src/common/nominal.ts": { - "version": "4107369137-/// \nexport declare type Nominal = MyNominal;", - "signature": "-2060908103-/// \r\nexport declare type Nominal = MyNominal;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "rootDir": "../../..", - "outDir": "../..", - "composite": true, - "baseUrl": "../../../src/common", - "configFilePath": "../../../src/common/tsconfig.json" - }, - "referencedMap": { - "../../../src/common/nominal.ts": [ - "../../../src/common/types.d.ts" - ] - }, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../../../../lib/lib.d.ts", - "../../../src/common/nominal.ts", - "../../../src/common/types.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../../../lib/lib.d.ts": { - "version": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../common/nominal.d.ts": { - "version": "-2060908103-/// \r\nexport declare type Nominal = MyNominal;\r\n", - "signature": "-2060908103-/// \r\nexport declare type Nominal = MyNominal;\r\n", - "affectsGlobalScope": false - }, - "../../../src/subproject/index.ts": { - "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", - "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "rootDir": "../../..", - "outDir": "../..", - "composite": true, - "configFilePath": "../../../src/subProject/tsconfig.json" - }, - "referencedMap": { - "../../../src/subproject/index.ts": [ - "../common/nominal.d.ts" - ] - }, - "exportedModulesMap": { - "../../../src/subproject/index.ts": [ - "../common/nominal.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../lib/lib.d.ts", - [ - "../common/nominal.d.ts", - [ - { - "file": "../common/nominal.d.ts", - "start": 87, - "length": 9, - "messageText": "Cannot find name 'MyNominal'.", - "category": 1, - "code": 2304 - } - ] - ], - "../../../src/subproject/index.ts" - ], - "affectedFilesPendingEmit": [ - [ - "../common/nominal.d.ts", - 1 - ], - [ - "../../../src/subproject/index.ts", - 1 - ] - ] - }, - "version": "FakeTSVersion" -} -