Skip to content

Commit d2cb05a

Browse files
authored
Emit readable BuilderFileEmit kind (microsoft#43221)
1 parent 82bfe5a commit d2cb05a

File tree

25 files changed

+111
-109
lines changed

25 files changed

+111
-109
lines changed

src/testRunner/unittests/tsbuild/helpers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ interface Symbol {
238238

239239
function generateBuildInfoProgramBaseline(sys: System, originalWriteFile: System["writeFile"], buildInfoPath: string, buildInfo: BuildInfo) {
240240
type ProgramBuildInfoDiagnostic = string | [string, readonly ReusableDiagnostic[]];
241-
type ProgramBuilderInfoFilePendingEmit = [string, BuilderFileEmit];
241+
type ProgramBuilderInfoFilePendingEmit = [string, "DtsOnly" | "Full"];
242242
interface ProgramBuildInfo {
243243
fileNames: readonly string[];
244244
fileNamesList: readonly (readonly string[])[] | undefined;
@@ -266,7 +266,9 @@ interface Symbol {
266266
),
267267
affectedFilesPendingEmit: buildInfo.program.affectedFilesPendingEmit?.map(([fileId, emitKind]) => [
268268
toFileName(fileId),
269-
emitKind
269+
emitKind === BuilderFileEmit.DtsOnly ? "DtsOnly" :
270+
emitKind === BuilderFileEmit.Full ? "Full" :
271+
Debug.assertNever(emitKind)
270272
]),
271273
};
272274
const version = buildInfo.version === ts.version ? fakes.version : buildInfo.version;

tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,19 +325,19 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
325325
"affectedFilesPendingEmit": [
326326
[
327327
"../../animals/animal.ts",
328-
1
328+
"Full"
329329
],
330330
[
331331
"../../animals/dog.ts",
332-
1
332+
"Full"
333333
],
334334
[
335335
"../../animals/index.ts",
336-
1
336+
"Full"
337337
],
338338
[
339339
"../../core/utilities.ts",
340-
1
340+
"Full"
341341
]
342342
]
343343
},

tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,15 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
390390
"affectedFilesPendingEmit": [
391391
[
392392
"../bar.ts",
393-
1
393+
"Full"
394394
],
395395
[
396396
"../index.ts",
397-
0
397+
"DtsOnly"
398398
],
399399
[
400400
"../lazyindex.ts",
401-
0
401+
"DtsOnly"
402402
]
403403
]
404404
},

tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ Semantic diagnostics in builder refreshed for::
137137
"affectedFilesPendingEmit": [
138138
[
139139
"../shared/types/db.ts",
140-
1
140+
"Full"
141141
],
142142
[
143143
"../src/main.ts",
144-
1
144+
"Full"
145145
],
146146
[
147147
"../src/other.ts",
148-
1
148+
"Full"
149149
]
150150
]
151151
},

tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
137137
"affectedFilesPendingEmit": [
138138
[
139139
"../src/hello.json",
140-
1
140+
"Full"
141141
],
142142
[
143143
"../src/index.ts",
144-
1
144+
"Full"
145145
]
146146
]
147147
},

tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,15 @@ exports.multiply = multiply;
289289
"affectedFilesPendingEmit": [
290290
[
291291
"../core/anothermodule.d.ts",
292-
1
292+
"Full"
293293
],
294294
[
295295
"../core/index.d.ts",
296-
1
296+
"Full"
297297
],
298298
[
299299
"./index.ts",
300-
1
300+
"Full"
301301
]
302302
]
303303
},

tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ exports.A = A;
171171
"affectedFilesPendingEmit": [
172172
[
173173
"./b.ts",
174-
1
174+
"Full"
175175
]
176176
]
177177
},

tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,19 +385,19 @@ exitCode:: ExitStatus.undefined
385385
"affectedFilesPendingEmit": [
386386
[
387387
"../../animals/animal.ts",
388-
1
388+
"Full"
389389
],
390390
[
391391
"../../animals/dog.ts",
392-
1
392+
"Full"
393393
],
394394
[
395395
"../../animals/index.ts",
396-
1
396+
"Full"
397397
],
398398
[
399399
"../../core/utilities.ts",
400-
1
400+
"Full"
401401
]
402402
]
403403
},
@@ -648,19 +648,19 @@ exitCode:: ExitStatus.undefined
648648
"affectedFilesPendingEmit": [
649649
[
650650
"../../animals/animal.ts",
651-
1
651+
"Full"
652652
],
653653
[
654654
"../../animals/dog.ts",
655-
1
655+
"Full"
656656
],
657657
[
658658
"../../animals/index.ts",
659-
1
659+
"Full"
660660
],
661661
[
662662
"../../core/utilities.ts",
663-
1
663+
"Full"
664664
]
665665
]
666666
},

tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ exitCode:: ExitStatus.undefined
418418
"affectedFilesPendingEmit": [
419419
[
420420
"../src/main.ts",
421-
1
421+
"Full"
422422
]
423423
]
424424
},

tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ exitCode:: ExitStatus.undefined
615615
"affectedFilesPendingEmit": [
616616
[
617617
"./index.ts",
618-
1
618+
"Full"
619619
]
620620
]
621621
},
@@ -748,7 +748,7 @@ exitCode:: ExitStatus.undefined
748748
"affectedFilesPendingEmit": [
749749
[
750750
"./index.ts",
751-
1
751+
"Full"
752752
]
753753
]
754754
},

0 commit comments

Comments
 (0)