@@ -34,7 +34,13 @@ export type MyNominal = Nominal<string, 'MyNominal'>;
34
34
{ "extends" :"../../tsconfig.base.json" , "compilerOptions" :{ "composite" :true } , "references" :[ { "path" :"../common" } ] , "include" :[ "./index.ts" ] }
35
35
36
36
//// [/src/solution/src/subProject2/index.ts]
37
-
37
+ import { MyNominal } from '../subProject/index' ;
38
+ const variable = {
39
+ key : 'value' as MyNominal ,
40
+ } ;
41
+ export function getVar ( ) : keyof typeof variable {
42
+ return 'key' ;
43
+ }
38
44
39
45
//// [/src/solution/src/subProject2/tsconfig.json]
40
46
{ "extends" :"../../tsconfig.base.json" , "compilerOptions" :{ "composite" :true } , "references" :[ { "path" :"../subProject" } ] , "include" :[ "./index.ts" ] }
@@ -67,24 +73,11 @@ Output::
67
73
68
74
[ [ 90 m12 :00 :00 AM [ 0 m ] Building project '/src/solution/src/subProject/tsconfig.json' . . .
69
75
70
- [ 96 msrc / solution / lib / src / common / nominal . d . ts [ 0 m :[ 93 m2 [ 0 m :[ 93 m55 [ 0 m - [ 91 merror [ 0 m [ 90 m TS2304 : [ 0 mCannot find name 'MyNominal' .
71
-
72
- [ 7 m2 [ 0 m export declare type Nominal < T , Name extends string > = MyNominal < T , Name > ;
73
- [ 7 m [ 0 m [ 91 m ~ ~ ~ ~ ~ ~ ~ ~ ~ [ 0 m
74
-
75
- [ 96 msrc / solution / lib / src / common / nominal . d . ts [ 0 m :[ 93 m1 [ 0 m :[ 93 m23 [ 0 m - [ 91 merror [ 0 m [ 90 m TS2688 : [ 0 mCannot find type definition file for 'types' .
76
-
77
- [ 7 m1 [ 0 m /// <reference types="types" />
78
- [ 7 m [ 0 m [ 91 m ~ ~ ~ ~ ~ [ 0 m
79
-
80
- [ [ 90 m12 :00 :00 AM [ 0 m ] Project 'src/solution/src/subProject2/tsconfig.json' can 't be built because its dependency ' src / solution / src / subProject ' has errors
76
+ [ [ 90 m12 :00 :00 AM [ 0 m ] Project 'src/solution/src/subProject2/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject2/index.js' does not exist
81
77
82
- [ [ 90 m12 :00 :00 AM [ 0 m ] Skipping build of project '/src/solution/src/subProject2/tsconfig.json' because its dependency '/src/solution/src/subProject' has errors
78
+ [ [ 90 m12 :00 :00 AM [ 0 m ] Building project '/src/solution/src/subProject2/tsconfig.json' . . .
83
79
84
-
85
- Found 2 errors .
86
-
87
- exitCode :: ExitStatus . DiagnosticsPresent_OutputsGenerated
80
+ exitCode :: ExitStatus . Success
88
81
89
82
90
83
//// [/src/solution/lib/src/common/nominal.d.ts]
@@ -140,6 +133,16 @@ exports.__esModule = true;
140
133
"version" : "FakeTSVersion"
141
134
}
142
135
136
+ //// [/src/solution/lib/src/subProject/index.d.ts]
137
+ import { Nominal } from '. . / common / nominal ';
138
+ export declare type MyNominal = Nominal < string , 'MyNominal' > ;
139
+
140
+
141
+ //// [/src/solution/lib/src/subProject/index.js]
142
+ "use strict" ;
143
+ exports . __esModule = true ;
144
+
145
+
143
146
//// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo]
144
147
{
145
148
"program" : {
@@ -149,6 +152,11 @@ exports.__esModule = true;
149
152
"signature" : "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };" ,
150
153
"affectsGlobalScope" : true
151
154
} ,
155
+ "../../../src/common/types.d.ts" : {
156
+ "version" : "23815050294-declare type MyNominal<T, Name extends string> = T & {\n specialKey: Name;\n};" ,
157
+ "signature" : "23815050294-declare type MyNominal<T, Name extends string> = T & {\n specialKey: Name;\n};" ,
158
+ "affectsGlobalScope" : true
159
+ } ,
152
160
"../common/nominal.d.ts" : {
153
161
"version" : "-2060908103-/// <reference types=\"types\" />\r\nexport declare type Nominal<T, Name extends string> = MyNominal<T, Name>;\r\n" ,
154
162
"signature" : "-2060908103-/// <reference types=\"types\" />\r\nexport declare type Nominal<T, Name extends string> = MyNominal<T, Name>;\r\n" ,
@@ -167,41 +175,114 @@ exports.__esModule = true;
167
175
"configFilePath" : "../../../src/subProject/tsconfig.json"
168
176
} ,
169
177
"referencedMap" : {
178
+ "../common/nominal.d.ts" : [
179
+ "../../../src/common/types.d.ts"
180
+ ] ,
170
181
"../../../src/subproject/index.ts" : [
171
182
"../common/nominal.d.ts"
172
183
]
173
184
} ,
174
185
"exportedModulesMap" : {
186
+ "../common/nominal.d.ts" : [
187
+ "../../../src/common/types.d.ts"
188
+ ] ,
175
189
"../../../src/subproject/index.ts" : [
176
190
"../common/nominal.d.ts"
177
191
]
178
192
} ,
179
193
"semanticDiagnosticsPerFile" : [
180
194
"../../../../../lib/lib.d.ts" ,
181
- [
182
- "../common/nominal.d.ts" ,
183
- [
184
- {
185
- "file" : "../common/nominal.d.ts" ,
186
- "start" : 87 ,
187
- "length" : 9 ,
188
- "messageText" : "Cannot find name 'MyNominal'." ,
189
- "category" : 1 ,
190
- "code" : 2304
191
- }
192
- ]
193
- ] ,
195
+ "../common/nominal.d.ts" ,
196
+ "../../../src/common/types.d.ts" ,
194
197
"../../../src/subproject/index.ts"
195
- ] ,
196
- "affectedFilesPendingEmit" : [
197
- [
198
- "../common/nominal.d.ts" ,
199
- 1
198
+ ]
199
+ } ,
200
+ "version" : "FakeTSVersion"
201
+ }
202
+
203
+ //// [/src/solution/lib/src/subProject2/index.d.ts]
204
+ /// <reference types="types" />
205
+ declare const variable : {
206
+ key : globalThis . MyNominal < string , "MyNominal" > ;
207
+ } ;
208
+ export declare function getVar ( ) : keyof typeof variable ;
209
+ export { } ;
210
+
211
+
212
+ //// [/src/solution/lib/src/subProject2/index.js]
213
+ "use strict" ;
214
+ exports . __esModule = true ;
215
+ exports . getVar = void 0 ;
216
+ var variable = {
217
+ key : 'value'
218
+ } ;
219
+ function getVar ( ) {
220
+ return 'key' ;
221
+ }
222
+ exports . getVar = getVar ;
223
+
224
+
225
+ //// [/src/solution/lib/src/subProject2/tsconfig.tsbuildinfo]
226
+ {
227
+ "program" : {
228
+ "fileInfos" : {
229
+ "../../../../../lib/lib.d.ts" : {
230
+ "version" : "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };" ,
231
+ "signature" : "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };" ,
232
+ "affectsGlobalScope" : true
233
+ } ,
234
+ "../../../src/common/types.d.ts" : {
235
+ "version" : "23815050294-declare type MyNominal<T, Name extends string> = T & {\n specialKey: Name;\n};" ,
236
+ "signature" : "23815050294-declare type MyNominal<T, Name extends string> = T & {\n specialKey: Name;\n};" ,
237
+ "affectsGlobalScope" : true
238
+ } ,
239
+ "../common/nominal.d.ts" : {
240
+ "version" : "-2060908103-/// <reference types=\"types\" />\r\nexport declare type Nominal<T, Name extends string> = MyNominal<T, Name>;\r\n" ,
241
+ "signature" : "-2060908103-/// <reference types=\"types\" />\r\nexport declare type Nominal<T, Name extends string> = MyNominal<T, Name>;\r\n" ,
242
+ "affectsGlobalScope" : false
243
+ } ,
244
+ "../subproject/index.d.ts" : {
245
+ "version" : "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal<string, 'MyNominal'>;\r\n" ,
246
+ "signature" : "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal<string, 'MyNominal'>;\r\n" ,
247
+ "affectsGlobalScope" : false
248
+ } ,
249
+ "../../../src/subproject2/index.ts" : {
250
+ "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}" ,
251
+ "signature" : "-8779403458-/// <reference types=\"types\" />\r\ndeclare const variable: {\r\n key: globalThis.MyNominal<string, \"MyNominal\">;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n" ,
252
+ "affectsGlobalScope" : false
253
+ }
254
+ } ,
255
+ "options" : {
256
+ "rootDir" : "../../.." ,
257
+ "outDir" : "../.." ,
258
+ "composite" : true ,
259
+ "configFilePath" : "../../../src/subProject2/tsconfig.json"
260
+ } ,
261
+ "referencedMap" : {
262
+ "../common/nominal.d.ts" : [
263
+ "../../../src/common/types.d.ts"
264
+ ] ,
265
+ "../subproject/index.d.ts" : [
266
+ "../common/nominal.d.ts"
267
+ ] ,
268
+ "../../../src/subproject2/index.ts" : [
269
+ "../subproject/index.d.ts"
270
+ ]
271
+ } ,
272
+ "exportedModulesMap" : {
273
+ "../common/nominal.d.ts" : [
274
+ "../../../src/common/types.d.ts"
200
275
] ,
201
- [
202
- "../../../src/subproject/index.ts" ,
203
- 1
276
+ "../subproject/index.d.ts" : [
277
+ "../common/nominal.d.ts"
204
278
]
279
+ } ,
280
+ "semanticDiagnosticsPerFile" : [
281
+ "../../../../../lib/lib.d.ts" ,
282
+ "../common/nominal.d.ts" ,
283
+ "../subproject/index.d.ts" ,
284
+ "../../../src/common/types.d.ts" ,
285
+ "../../../src/subproject2/index.ts"
205
286
]
206
287
} ,
207
288
"version" : "FakeTSVersion"
0 commit comments