From 07d7eb3c213896fd31626d18b01a96b66847804a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 27 Jun 2024 23:32:07 -0700 Subject: [PATCH 1/7] Correctly show original in the baseline --- src/testRunner/unittests/helpers/baseline.ts | 8 ++++++-- .../watchApi/multiFile/semantic-builder-emitOnlyDts.js | 6 ++++-- .../multiFile/when-emitting-with-emitOnlyDtsFiles.js | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/testRunner/unittests/helpers/baseline.ts b/src/testRunner/unittests/helpers/baseline.ts index a86bebaa591d6..767b84078f77e 100644 --- a/src/testRunner/unittests/helpers/baseline.ts +++ b/src/testRunner/unittests/helpers/baseline.ts @@ -139,7 +139,7 @@ export type ReadableIncrementalBuildInfoDiagnosticOfFile = [file: string, diagno export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached"] | ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableIncrementalBuildInfoEmitDiagnostic = ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableBuilderFileEmit = string & { __readableBuilderFileEmit: any; }; -export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [string], emitKind: ReadableBuilderFileEmit]; +export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [file: string] | [file: string, emitKind: ts.BuilderFileEmit], emitKind: ReadableBuilderFileEmit]; export type ReadableIncrementalBuildInfoEmitSignature = string | [file: string, signature: ts.EmitSignature | []]; export type ReadableIncrementalBuildInfoFileInfo = Omit & { impliedFormat: string | undefined; @@ -339,7 +339,11 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI fullEmitForOptions: ts.BuilderFileEmit, ): ReadableIncrementalBuilderInfoFilePendingEmit { return [ - ts.isNumber(value) ? toFileName(value) : [toFileName(value[0])], + ts.isNumber(value) ? + toFileName(value) : + !value[1] ? + [toFileName(value[0])] : + [toFileName(value[0]), value[1]], toReadableBuilderFileEmit(ts.toBuilderFileEmit(value, fullEmitForOptions)), ]; } diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js index 3d715d2b946b0..a3d424757f932 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js @@ -254,13 +254,15 @@ Output:: "affectedFilesPendingEmit": [ [ [ - "./main.ts" + "./main.ts", + 1 ], "Js" ], [ [ - "./other.ts" + "./other.ts", + 1 ], "Js" ] diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js index 84d2a18f6c346..db68ab8bc8793 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js @@ -266,13 +266,15 @@ CreatingProgramWith:: "affectedFilesPendingEmit": [ [ [ - "./a.ts" + "./a.ts", + 1 ], "Js" ], [ [ - "./b.ts" + "./b.ts", + 1 ], "Js" ] From 73d0cafb7d593e40a77668a33869e9f459039083 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 26 Jun 2024 11:43:50 -0700 Subject: [PATCH 2/7] Tests for noEmit and dts errors --- src/testRunner/tests.ts | 1 + src/testRunner/unittests/helpers/noEmit.ts | 441 +++++ .../unittests/helpers/noEmitOnError.ts | 174 +- src/testRunner/unittests/tsbuild/noEmit.ts | 45 +- .../unittests/tsbuild/noEmitOnError.ts | 67 +- .../unittests/tsbuildWatch/noEmit.ts | 5 +- .../unittests/tsbuildWatch/noEmitOnError.ts | 55 +- src/testRunner/unittests/tsc/noEmit.ts | 157 +- src/testRunner/unittests/tsc/noEmitOnError.ts | 64 +- src/testRunner/unittests/tscWatch/noEmit.ts | 5 + .../unittests/tscWatch/noEmitOnError.ts | 55 +- .../changes-composite-discrepancies.js | 1338 +++++++++++++ .../noEmit/multiFile/changes-composite.js | 1681 +++++++++++++++++ .../changes-incremental-declaration.js | 1658 ++++++++++++++++ .../noEmit/multiFile/changes-incremental.js | 1512 +++++++++++++++ ...-initial-noEmit-composite-discrepancies.js | 145 ++ .../changes-with-initial-noEmit-composite.js | 1067 +++++++++++ ...-initial-noEmit-incremental-declaration.js | 1048 ++++++++++ ...changes-with-initial-noEmit-incremental.js | 931 +++++++++ ...th-incremental-as-modules-discrepancies.js | 234 +++ ...ble-changes-with-incremental-as-modules.js | 449 +++++ ...-changes-with-incremental-discrepancies.js | 186 ++ ...aration-enable-changes-with-incremental.js | 398 ++++ ...anges-with-multiple-files-discrepancies.js | 314 +++ ...tion-enable-changes-with-multiple-files.js | 750 ++++++++ ...-errors-with-declaration-enable-changes.js | 440 +++++ .../dts-errors-with-incremental-as-modules.js | 635 +++++++ .../multiFile/dts-errors-with-incremental.js | 553 ++++++ ...dts-enabled-with-incremental-as-modules.js | 572 ++++++ ...rs-without-dts-enabled-with-incremental.js | 506 +++++ .../dts-errors-without-dts-enabled.js | 360 ++++ .../tsbuild/noEmit/multiFile/dts-errors.js | 430 +++++ ...ntic-errors-with-incremental-as-modules.js | 685 +++++++ .../semantic-errors-with-incremental.js | 461 ++++- .../noEmit/multiFile/semantic-errors.js | 331 +++- ...th-incremental-as-modules-discrepancies.js | 56 + ...ntax-errors-with-incremental-as-modules.js | 652 +++++++ ...x-errors-with-incremental-discrepancies.js | 44 + .../syntax-errors-with-incremental.js | 437 ++++- .../tsbuild/noEmit/multiFile/syntax-errors.js | 332 +++- .../changes-composite-discrepancies.js | 740 ++++++++ .../noEmit/outFile/changes-composite.js | 1309 +++++++++++++ .../changes-incremental-declaration.js | 1299 +++++++++++++ .../noEmit/outFile/changes-incremental.js | 1231 ++++++++++++ ...-initial-noEmit-composite-discrepancies.js | 74 + .../changes-with-initial-noEmit-composite.js | 778 ++++++++ ...-initial-noEmit-incremental-declaration.js | 771 ++++++++ ...changes-with-initial-noEmit-incremental.js | 705 +++++++ ...th-incremental-as-modules-discrepancies.js | 202 ++ ...ble-changes-with-incremental-as-modules.js | 400 ++++ ...-changes-with-incremental-discrepancies.js | 154 ++ ...aration-enable-changes-with-incremental.js | 353 ++++ ...anges-with-multiple-files-discrepancies.js | 250 +++ ...tion-enable-changes-with-multiple-files.js | 602 ++++++ ...-errors-with-declaration-enable-changes.js | 433 +++++ .../dts-errors-with-incremental-as-modules.js | 554 ++++++ .../outFile/dts-errors-with-incremental.js | 470 +++++ ...dts-enabled-with-incremental-as-modules.js | 512 +++++ ...rs-without-dts-enabled-with-incremental.js | 433 +++++ .../outFile/dts-errors-without-dts-enabled.js | 355 ++++ .../tsbuild/noEmit/outFile/dts-errors.js | 423 +++++ ...ntic-errors-with-incremental-as-modules.js | 621 ++++++ .../semantic-errors-with-incremental.js | 434 ++++- .../tsbuild/noEmit/outFile/semantic-errors.js | 342 +++- ...th-incremental-as-modules-discrepancies.js | 50 + ...ntax-errors-with-incremental-as-modules.js | 596 ++++++ ...x-errors-with-incremental-discrepancies.js | 38 + .../outFile/syntax-errors-with-incremental.js | 409 +++- .../tsbuild/noEmit/outFile/syntax-errors.js | 343 +++- ...rrors-with-declaration-with-incremental.js | 404 ++++ .../multiFile/dts-errors-with-declaration.js | 278 +++ .../multiFile/dts-errors-with-incremental.js | 323 ++++ .../noEmitOnError/multiFile/dts-errors.js | 210 ++ ...rrors-with-declaration-with-incremental.js | 336 ++++ .../outFile/dts-errors-with-declaration.js | 270 +++ .../outFile/dts-errors-with-incremental.js | 268 +++ .../noEmitOnError/outFile/dts-errors.js | 203 ++ .../dts-errors-with-incremental-as-modules.js | 770 ++++++++ .../multiFile/dts-errors-with-incremental.js | 682 +++++++ ...dts-enabled-with-incremental-as-modules.js | 704 +++++++ ...rs-without-dts-enabled-with-incremental.js | 632 +++++++ .../dts-errors-without-dts-enabled.js | 421 +++++ .../noEmit/multiFile/dts-errors.js | 458 +++++ ...ntic-errors-with-incremental-as-modules.js | 755 ++++++++ .../semantic-errors-with-incremental.js | 686 +++++++ .../noEmit/multiFile/semantic-errors.js | 455 +++++ ...ntax-errors-with-incremental-as-modules.js | 722 +++++++ .../syntax-errors-with-incremental.js | 649 +++++++ .../noEmit/multiFile/syntax-errors.js | 457 +++++ .../dts-errors-with-incremental-as-modules.js | 701 +++++++ .../outFile/dts-errors-with-incremental.js | 605 ++++++ ...dts-enabled-with-incremental-as-modules.js | 656 +++++++ ...rs-without-dts-enabled-with-incremental.js | 565 ++++++ .../outFile/dts-errors-without-dts-enabled.js | 431 +++++ .../tsbuildWatch/noEmit/outFile/dts-errors.js | 466 +++++ ...ntic-errors-with-incremental-as-modules.js | 699 +++++++ .../semantic-errors-with-incremental.js | 619 ++++++ .../noEmit/outFile/semantic-errors.js | 465 +++++ ...ntax-errors-with-incremental-as-modules.js | 674 +++++++ .../outFile/syntax-errors-with-incremental.js | 583 ++++++ .../noEmit/outFile/syntax-errors.js | 468 +++++ ...rror-with-declaration-with-incremental.js} | 442 ++++- ...r.js => noEmitOnError-with-declaration.js} | 387 +++- ...l.js => noEmitOnError-with-incremental.js} | 383 +++- ...r-with-declaration.js => noEmitOnError.js} | 367 +++- ...rror-with-declaration-with-incremental.js} | 400 +++- ...r.js => noEmitOnError-with-declaration.js} | 397 +++- ...l.js => noEmitOnError-with-incremental.js} | 340 +++- ...r-with-declaration.js => noEmitOnError.js} | 367 +++- ...anges-with-multiple-files-discrepancies.js | 79 + ...tion-enable-changes-with-multiple-files.js | 1185 ++++++++++++ .../dts-errors-with-incremental-as-modules.js | 660 +++++++ .../multiFile/dts-errors-with-incremental.js | 570 ++++++ ...dts-enabled-with-incremental-as-modules.js | 593 ++++++ ...rs-without-dts-enabled-with-incremental.js | 519 +++++ .../dts-errors-without-dts-enabled.js | 245 +++ .../tsc/noEmit/multiFile/dts-errors.js | 268 +++ ...ntic-errors-with-incremental-as-modules.js | 664 +++++++ .../semantic-errors-with-incremental.js | 593 ++++++ .../tsc/noEmit/multiFile/semantic-errors.js | 277 +++ ...th-incremental-as-modules-discrepancies.js | 56 + ...ntax-errors-with-incremental-as-modules.js | 631 +++++++ ...x-errors-with-incremental-discrepancies.js | 44 + .../syntax-errors-with-incremental.js | 556 ++++++ .../tsc/noEmit/multiFile/syntax-errors.js | 280 +++ ...anges-with-multiple-files-discrepancies.js | 63 + ...tion-enable-changes-with-multiple-files.js | 890 +++++++++ .../dts-errors-with-incremental-as-modules.js | 587 ++++++ .../outFile/dts-errors-with-incremental.js | 491 +++++ ...dts-enabled-with-incremental-as-modules.js | 541 ++++++ ...rs-without-dts-enabled-with-incremental.js | 450 +++++ .../outFile/dts-errors-without-dts-enabled.js | 256 +++ .../tsc/noEmit/outFile/dts-errors.js | 278 +++ ...ntic-errors-with-incremental-as-modules.js | 604 ++++++ .../semantic-errors-with-incremental.js | 524 +++++ .../tsc/noEmit/outFile/semantic-errors.js | 288 +++ ...th-incremental-as-modules-discrepancies.js | 50 + ...ntax-errors-with-incremental-as-modules.js | 579 ++++++ ...x-errors-with-incremental-discrepancies.js | 38 + .../outFile/syntax-errors-with-incremental.js | 488 +++++ .../tsc/noEmit/outFile/syntax-errors.js | 291 +++ ...rrors-with-declaration-with-incremental.js | 397 ++++ .../multiFile/dts-errors-with-declaration.js | 218 +++ .../multiFile/dts-errors-with-incremental.js | 339 ++++ .../tsc/noEmitOnError/multiFile/dts-errors.js | 182 ++ ...rrors-with-declaration-with-incremental.js | 2 +- .../semantic-errors-with-declaration.js | 2 +- .../semantic-errors-with-incremental.js | 2 +- .../multiFile/semantic-errors.js | 2 +- ...rrors-with-declaration-with-incremental.js | 2 +- .../syntax-errors-with-declaration.js | 2 +- .../syntax-errors-with-incremental.js | 2 +- .../noEmitOnError/multiFile/syntax-errors.js | 2 +- ...rrors-with-declaration-with-incremental.js | 330 ++++ .../outFile/dts-errors-with-declaration.js | 219 +++ .../outFile/dts-errors-with-incremental.js | 286 +++ .../tsc/noEmitOnError/outFile/dts-errors.js | 181 ++ ...rrors-with-declaration-with-incremental.js | 2 +- .../semantic-errors-with-declaration.js | 2 +- .../semantic-errors-with-incremental.js | 2 +- .../noEmitOnError/outFile/semantic-errors.js | 2 +- ...rrors-with-declaration-with-incremental.js | 2 +- .../outFile/syntax-errors-with-declaration.js | 2 +- .../outFile/syntax-errors-with-incremental.js | 2 +- .../noEmitOnError/outFile/syntax-errors.js | 2 +- .../dts-errors-with-incremental-as-modules.js | 747 ++++++++ .../multiFile/dts-errors-with-incremental.js | 659 +++++++ ...dts-enabled-with-incremental-as-modules.js | 681 +++++++ ...rs-without-dts-enabled-with-incremental.js | 609 ++++++ .../dts-errors-without-dts-enabled.js | 378 ++++ .../tscWatch/noEmit/multiFile/dts-errors.js | 401 ++++ ...ntic-errors-with-incremental-as-modules.js | 732 +++++++ .../semantic-errors-with-incremental.js | 663 +++++++ .../noEmit/multiFile/semantic-errors.js | 390 ++++ ...ntax-errors-with-incremental-as-modules.js | 699 +++++++ .../syntax-errors-with-incremental.js | 626 ++++++ .../noEmit/multiFile/syntax-errors.js | 392 ++++ .../dts-errors-with-incremental-as-modules.js | 678 +++++++ .../outFile/dts-errors-with-incremental.js | 582 ++++++ ...dts-enabled-with-incremental-as-modules.js | 633 +++++++ ...rs-without-dts-enabled-with-incremental.js | 542 ++++++ .../outFile/dts-errors-without-dts-enabled.js | 388 ++++ .../tscWatch/noEmit/outFile/dts-errors.js | 409 ++++ ...ntic-errors-with-incremental-as-modules.js | 676 +++++++ .../semantic-errors-with-incremental.js | 596 ++++++ .../noEmit/outFile/semantic-errors.js | 400 ++++ ...ntax-errors-with-incremental-as-modules.js | 651 +++++++ .../outFile/syntax-errors-with-incremental.js | 560 ++++++ .../tscWatch/noEmit/outFile/syntax-errors.js | 403 ++++ ...Error-with-declaration-with-incremental.js | 362 +++- .../noEmitOnError-with-declaration.js | 206 +- .../noEmitOnError-with-incremental.js | 332 +++- .../noEmitOnError/multiFile/noEmitOnError.js | 192 +- ...Error-with-declaration-with-incremental.js | 319 +++- .../outFile/noEmitOnError-with-declaration.js | 233 ++- .../outFile/noEmitOnError-with-incremental.js | 289 ++- .../noEmitOnError/outFile/noEmitOnError.js | 209 +- 197 files changed, 84134 insertions(+), 1178 deletions(-) create mode 100644 src/testRunner/unittests/helpers/noEmit.ts create mode 100644 src/testRunner/unittests/tscWatch/noEmit.ts create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js rename tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/{does-not-emit-any-files-on-error-with-declaration-with-incremental.js => noEmitOnError-with-declaration-with-incremental.js} (63%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/{does-not-emit-any-files-on-error.js => noEmitOnError-with-declaration.js} (55%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/{does-not-emit-any-files-on-error-with-incremental.js => noEmitOnError-with-incremental.js} (65%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/{does-not-emit-any-files-on-error-with-declaration.js => noEmitOnError.js} (59%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/{does-not-emit-any-files-on-error-with-declaration-with-incremental.js => noEmitOnError-with-declaration-with-incremental.js} (63%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/{does-not-emit-any-files-on-error.js => noEmitOnError-with-declaration.js} (57%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/{does-not-emit-any-files-on-error-with-incremental.js => noEmitOnError-with-incremental.js} (65%) rename tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/{does-not-emit-any-files-on-error-with-declaration.js => noEmitOnError.js} (60%) create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts index 8b100774e33f7..9cdb432d5c53e 100644 --- a/src/testRunner/tests.ts +++ b/src/testRunner/tests.ts @@ -138,6 +138,7 @@ export * from "./unittests/tscWatch/incremental.js"; export * from "./unittests/tscWatch/libraryResolution.js"; export * from "./unittests/tscWatch/moduleResolution.js"; export * from "./unittests/tscWatch/nodeNextWatch.js"; +export * from "./unittests/tscWatch/noEmit.js"; export * from "./unittests/tscWatch/noEmitOnError.js"; export * from "./unittests/tscWatch/programUpdates.js"; export * from "./unittests/tscWatch/projectsWithReferences.js"; diff --git a/src/testRunner/unittests/helpers/noEmit.ts b/src/testRunner/unittests/helpers/noEmit.ts new file mode 100644 index 0000000000000..3a84f210eb3ac --- /dev/null +++ b/src/testRunner/unittests/helpers/noEmit.ts @@ -0,0 +1,441 @@ +import { + CompilerOptions, + hasProperty, + ModuleKind, + noop, +} from "../../_namespaces/ts.js"; +import { dedent } from "../../_namespaces/Utils.js"; +import { jsonToReadableText } from "../helpers.js"; +import { + compilerOptionsToConfigJson, + FsContents, + libContent, +} from "./contents.js"; +import { + noChangeRun, + TestTscEdit, + verifyTsc, +} from "./tsc.js"; +import { verifyTscWatch } from "./tscWatch.js"; +import { + loadProjectFromFiles, + replaceText, +} from "./vfs.js"; +import { + createWatchedSystem, + libFile, +} from "./virtualFileSystemWithWatch.js"; + +function forEachNoEmitChangesWorker(commandType: string[], compilerOptions: CompilerOptions) { + const discrepancyExplanation = () => [ + "Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files", + "Incremental will store the past latestChangedDtsFile and emitSignatures", + ]; + const noChangeRunWithNoEmit: TestTscEdit = { + ...noChangeRun, + caption: "No Change run with noEmit", + commandLineArgs: [...commandType, "src/project", "--noEmit"], + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }; + const noChangeRunWithEmit: TestTscEdit = { + ...noChangeRun, + caption: "No Change run with emit", + commandLineArgs: [...commandType, "src/project"], + }; + let optionsString = ""; + for (const key in compilerOptions) { + if (hasProperty(compilerOptions, key) && key !== "outFile" && key !== "module") { + optionsString += ` ${key}`; + } + } + function scenarioName(text: string) { + return `${compilerOptions.outFile ? "outFile" : "multiFile"}/${text}${optionsString}`; + } + + verifyTsc({ + scenario: "noEmit", + subScenario: scenarioName("changes"), + commandLineArgs: [...commandType, "src/project"], + fs, + edits: [ + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + { + caption: "Introduce error but still noEmit", + commandLineArgs: [...commandType, "src/project", "--noEmit"], + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }, + { + caption: "Fix error and emit", + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + { + caption: "Introduce error and emit", + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + { + caption: "Fix error and no emit", + commandLineArgs: [...commandType, "src/project", "--noEmit"], + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + ], + }); + + verifyTsc({ + scenario: "noEmit", + subScenario: scenarioName("changes with initial noEmit"), + commandLineArgs: [...commandType, "src/project", "--noEmit"], + fs, + edits: [ + noChangeRunWithEmit, + { + caption: "Introduce error with emit", + commandLineArgs: [...commandType, "src/project"], + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + }, + { + caption: "Fix error and no emit", + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }, + noChangeRunWithEmit, + ], + }); + + function fs() { + return loadProjectFromFiles({ + "/src/project/src/class.ts": dedent` + export class classC { + prop = 1; + }`, + "/src/project/src/indirectClass.ts": dedent` + import { classC } from './class'; + export class indirectClass { + classC = new classC(); + }`, + "/src/project/src/directUse.ts": dedent` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`, + "/src/project/src/indirectUse.ts": dedent` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`, + "/src/project/src/noChangeFile.ts": dedent` + export function writeLog(s: string) { + }`, + "/src/project/src/noChangeFileWithEmitSpecificError.ts": dedent` + function someFunc(arguments: boolean, ...rest: any[]) { + }`, + "/src/project/tsconfig.json": jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + }); + } +} + +export function forEachNoEmitChanges(commandType: string[]) { + describe("when noEmit changes between compilation", () => { + forEachNoEmitChangesWorker(commandType, { incremental: true }); + forEachNoEmitChangesWorker(commandType, { incremental: true, declaration: true }); + forEachNoEmitChangesWorker(commandType, { composite: true }); + forEachNoEmitChangesWorker(commandType, { incremental: true, outFile: "../outFile.js", module: ModuleKind.AMD }); + forEachNoEmitChangesWorker(commandType, { incremental: true, declaration: true, outFile: "../outFile.js", module: ModuleKind.AMD }); + forEachNoEmitChangesWorker(commandType, { composite: true, outFile: "../outFile.js", module: ModuleKind.AMD }); + }); +} + +function editsForDtsChanges(commandType: string[], aContent: string): TestTscEdit[] { + return [ + noChangeRun, + { + caption: "With declaration enabled noEmit - Should report errors", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration"], + }, + { + caption: "With declaration and declarationMap noEmit - Should report errors", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + }, + noChangeRun, + { + caption: "Dts Emit with error", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--declaration"], + }, + { + caption: "Fix the error", + edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", aContent.replace("private", "public")), + }, + { + caption: "With declaration enabled noEmit", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration"], + }, + { + caption: "With declaration and declarationMap noEmit", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + }, + ]; +} + +export function forEachNoEmitDtsChanges(commandType: string[]) { + describe("dts errors with declaration enable changes", () => { + if (commandType[0] !== "-b") return; // Only test non multiple file errors with -b + [false, true].forEach(asModules => + [undefined, true].forEach(incremental => + [{}, { outFile: "../outFile.js", module: asModules ? "amd" : undefined }].forEach(options => { + if (!incremental && asModules) return; // Not the interesting case + const aContent = asModules ? `export const a = class { private p = 10; };` : `const a = class { private p = 10; };`; + verifyTsc({ + scenario: "noEmit", + subScenario: `${options.outFile ? "outFile" : "multiFile"}/dts errors with declaration enable changes${incremental ? " with incremental" : ""}${asModules ? " as modules" : ""}`, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit"], + fs: () => + loadProjectFromFiles({ + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/tsconfig.json": jsonToReadableText({ + compilerOptions: { ...options, incremental }, + }), + }), + modifyFs: asModules ? + fs => fs.writeFileSync("/home/src/projects/project/b.ts", `export const b = 10;`) : + undefined, + edits: editsForDtsChanges(commandType, aContent), + baselinePrograms: true, + }); + }) + ) + ); + }); + + describe("dts errors with declaration enable changes with errors in multiple files", () => { + [{}, { outFile: "../outFile.js", module: "amd" }].forEach(options => { + const aContent = `export const a = class { private p = 10; };`; + verifyTsc({ + scenario: "noEmit", + subScenario: `${options.outFile ? "outFile" : "multiFile"}/dts errors with declaration enable changes with multiple files`, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit"], + fs: () => + loadProjectFromFiles({ + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/b.ts": `export const b = 10;`, + "/home/src/projects/project/c.ts": aContent.replace("a", "c"), + "/home/src/projects/project/d.ts": aContent.replace("a", "d"), + "/home/src/projects/project/tsconfig.json": jsonToReadableText({ + compilerOptions: { ...options, incremental: true }, + }), + }), + edits: [ + ...editsForDtsChanges(commandType, aContent), + { + caption: "Fix the another ", + edit: fs => fs.writeFileSync("/home/src/projects/project/c.ts", aContent.replace("a", "c").replace("private", "public")), + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + }, + ], + baselinePrograms: true, + }); + }); + }); +} + +function forEachNoEmitAndErrorsWorker( + subScenario: string, + aTsContent: string, + additionalOptions: CompilerOptions | undefined, + action: ( + subScenario: string, + fsContents: FsContents, + aTsContent: string, + fixedATsContent: string, + compilerOptions: object, + ) => void, +) { + [false, true].forEach(asModules => + [undefined, true].forEach(incremental => + [{}, { outFile: "../outFile.js", module: asModules ? "amd" : undefined }].forEach(options => { + if (!incremental && asModules) return; // Not the interesting case + const aContent = asModules ? `export ${aTsContent}` : aTsContent; + const compilerOptions = { + ...options, + incremental, + ...additionalOptions, + }; + const fsContents: FsContents = { + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/tsconfig.json": jsonToReadableText({ + compilerOptions, + }), + }; + if (asModules) fsContents["/home/src/projects/project/b.ts"] = `export const b = 10;`; + action( + `${options.outFile ? "outFile" : "multiFile"}/${subScenario}${incremental ? " with incremental" : ""}${asModules ? " as modules" : ""}`, + fsContents, + aContent, + `${asModules ? "export " : ""}const a = "hello";`, + compilerOptions, + ); + }) + ) + ); +} + +function forEachNoEmitAndErrors( + action: ( + subScenario: string, + fsContents: FsContents, + aTsContent: string, + fixedATsContent: string, + compilerOptions: object, + ) => void, +) { + forEachNoEmitAndErrorsWorker( + "syntax errors", + `const a = "hello`, + /*additionalOptions*/ undefined, + action, + ); + forEachNoEmitAndErrorsWorker( + "semantic errors", + `const a: number = "hello"`, + /*additionalOptions*/ undefined, + action, + ); + [{}, { declaration: true }].forEach(options => { + forEachNoEmitAndErrorsWorker( + `dts errors${!options.declaration ? " without dts enabled" : ""}`, + `const a = class { private p = 10; };`, + options, + action, + ); + }); +} + +export function forEachNoEmitTsc(commandType: string[]) { + forEachNoEmitAndErrors((subScenario, fsContents, aTsContent, fixedATsContent) => + verifyTsc({ + scenario: "noEmit", + subScenario, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit"], + fs: () => loadProjectFromFiles(fsContents), + edits: [ + noChangeRun, + { + caption: "Fix error", + edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", fixedATsContent), + }, + noChangeRun, + { + caption: "Emit after fixing error", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project"], + }, + noChangeRun, + { + caption: "Introduce error", + edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", aTsContent), + }, + { + caption: "Emit when error", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project"], + }, + noChangeRun, + ], + baselinePrograms: true, + }) + ); +} + +export function forEachNoEmitTscWatch(commandType: string[]) { + forEachNoEmitAndErrors((subScenario, fsContents, aTsContent, fixedATsContent, compilerOptions) => + verifyTscWatch({ + scenario: "noEmit", + subScenario, + commandLineArgs: [...commandType, "/home/src/projects/project", "-w"], + sys: () => { + fsContents["/home/src/projects/project/tsconfig.json"] = jsonToReadableText({ + compilerOptions: { + ...compilerOptions, + noEmit: true, + }, + }); + fsContents[libFile.path] = libContent; + return createWatchedSystem(fsContents); + }, + edits: [ + { + caption: "Fix error", + edit: sys => sys.writeFile("/home/src/projects/project/a.ts", fixedATsContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Emit after fixing error", + edit: sys => sys.writeFile("/home/src/projects/project/tsconfig.json", jsonToReadableText({ compilerOptions })), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "no Emit run after fixing error", + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: { + ...compilerOptions, + noEmit: true, + }, + }), + ), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Introduce error", + edit: sys => sys.writeFile("/home/src/projects/project/a.ts", aTsContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Emit when error", + edit: sys => sys.writeFile("/home/src/projects/project/tsconfig.json", jsonToReadableText({ compilerOptions })), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "no Emit run when error", + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: { + ...compilerOptions, + noEmit: true, + }, + }), + ), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ], + }) + ); +} diff --git a/src/testRunner/unittests/helpers/noEmitOnError.ts b/src/testRunner/unittests/helpers/noEmitOnError.ts index 3c7d0d2e87047..38ec1b458d9b0 100644 --- a/src/testRunner/unittests/helpers/noEmitOnError.ts +++ b/src/testRunner/unittests/helpers/noEmitOnError.ts @@ -4,9 +4,26 @@ import { FsContents, libContent, } from "./contents.js"; -import { libFile } from "./virtualFileSystemWithWatch.js"; +import { + noChangeRun, + verifyTsc, +} from "./tsc.js"; +import { + TscWatchCompileChange, + verifyTscWatch, +} from "./tscWatch.js"; +import { loadProjectFromFiles } from "./vfs.js"; +import { + createWatchedSystem, + libFile, +} from "./virtualFileSystemWithWatch.js"; -function getFsContentsForNoEmitOnError(outFile: boolean, declaration: true | undefined, incremental: true | undefined): FsContents { +function getFsContentsForNoEmitOnError( + mainErrorContent: string, + outFile: boolean, + declaration: true | undefined, + incremental: true | undefined, +): FsContents { return { "/user/username/projects/noEmitOnError/tsconfig.json": jsonToReadableText({ compilerOptions: { @@ -21,12 +38,7 @@ function getFsContentsForNoEmitOnError(outFile: boolean, declaration: true | und name: string; } `, - "/user/username/projects/noEmitOnError/src/main.ts": dedent` - import { A } from "../shared/types/db"; - const a = { - lastName: 'sdsd' - ; - `, + "/user/username/projects/noEmitOnError/src/main.ts": mainErrorContent, "/user/username/projects/noEmitOnError/src/other.ts": dedent` console.log("hi"); export { } @@ -35,26 +47,152 @@ function getFsContentsForNoEmitOnError(outFile: boolean, declaration: true | und }; } -export function forEachNoEmitOnErrorScenario( - loadFs: (contents: FsContents, currentDirectory: string, executingFilePath: string) => T, +function forEachNoEmitOnErrorScenario( + subScenario: string, action: ( - scenarioName: (scenario: string) => string, - fs: () => T, + subScenario: string, + fsContents: (mainErrorContent: string) => FsContents, ) => void, ) { for (const outFile of [false, true]) { for (const declaration of [undefined, true] as const) { for (const incremental of [undefined, true] as const) { action( - scenario => `${outFile ? "outFile" : "multiFile"}/${scenario}${declaration ? " with declaration" : ""}${incremental ? " with incremental" : ""}`, - () => - loadFs( - getFsContentsForNoEmitOnError(outFile, declaration, incremental), - "/user/username/projects/noEmitOnError", - libFile.path, + `${outFile ? "outFile" : "multiFile"}/${subScenario}${declaration ? " with declaration" : ""}${incremental ? " with incremental" : ""}`, + mainErrorContent => + getFsContentsForNoEmitOnError( + mainErrorContent, + outFile, + declaration, + incremental, ), ); } } } } + +function getNoEmitOnErrorErrorsType(): [subScenario: string, mainErrorContent: string, fixedErrorContent: string][] { + return [ + [ + "syntax errors", + dedent` + import { A } from "../shared/types/db"; + const a = { + lastName: 'sdsd' + ; + `, + dedent` + import { A } from "../shared/types/db"; + const a = { + lastName: 'sdsd' + };`, + ], + [ + "semantic errors", + dedent` + import { A } from "../shared/types/db"; + const a: string = 10;`, + dedent` + import { A } from "../shared/types/db"; + const a: string = "hello";`, + ], + [ + "dts errors", + dedent` + import { A } from "../shared/types/db"; + export const a = class { private p = 10; }; + `, + dedent` + import { A } from "../shared/types/db"; + export const a = class { p = 10; }; + `, + ], + ]; +} + +export function forEachNoEmitOnErrorScenarioTsc(commandLineArgs: string[]) { + getNoEmitOnErrorErrorsType().forEach(([subScenario, mainErrorContent, fixedErrorContent]) => + forEachNoEmitOnErrorScenario( + subScenario, + (subScenario, fsContents) => { + describe(subScenario, () => { + verifyTsc({ + scenario: "noEmitOnError", + subScenario, + fs: () => + loadProjectFromFiles( + fsContents(mainErrorContent), + { + cwd: "/user/username/projects/noEmitOnError", + executingFilePath: libFile.path, + }, + ), + commandLineArgs, + edits: [ + noChangeRun, + { + caption: "Fix error", + edit: fs => fs.writeFileSync("src/main.ts", fixedErrorContent, "utf-8"), + }, + noChangeRun, + ], + baselinePrograms: true, + }); + }); + }, + ) + ); +} + +export function forEachNoEmitOnErrorScenarioTscWatch(commandLineArgs: string[]) { + const errorTypes = getNoEmitOnErrorErrorsType(); + forEachNoEmitOnErrorScenario( + "noEmitOnError", + (subScenario, fsContents) => + verifyTscWatch({ + scenario: "noEmitOnError", + subScenario, + commandLineArgs: [...commandLineArgs, "--w"], + sys: () => + createWatchedSystem( + fsContents(errorTypes[0][1]), + { currentDirectory: "/user/username/projects/noEmitOnError" }, + ), + edits: getEdits(errorTypes), + }), + ); + + function getEdits(errorTypes: ReturnType): TscWatchCompileChange[] { + const edits: TscWatchCompileChange[] = []; + for (const [subScenario, mainErrorContent, fixedErrorContent] of errorTypes) { + if (edits.length) { + edits.push( + { + caption: subScenario, + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, mainErrorContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ); + } + edits.push( + { + caption: "No change", + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: `Fix ${subScenario}`, + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, fixedErrorContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "No change", + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ); + } + return edits; + } +} diff --git a/src/testRunner/unittests/tsbuild/noEmit.ts b/src/testRunner/unittests/tsbuild/noEmit.ts index 6fb62dbaccb79..6d2b05d4eb002 100644 --- a/src/testRunner/unittests/tsbuild/noEmit.ts +++ b/src/testRunner/unittests/tsbuild/noEmit.ts @@ -1,42 +1,13 @@ -import { jsonToReadableText } from "../helpers.js"; import { - noChangeRun, - verifyTsc, -} from "../helpers/tsc.js"; -import { loadProjectFromFiles } from "../helpers/vfs.js"; + forEachNoEmitChanges, + forEachNoEmitDtsChanges, + forEachNoEmitTsc, +} from "../helpers/noEmit.js"; -describe("unittests:: tsbuild:: noEmit", () => { - function verifyNoEmitWorker(subScenario: string, aTsContent: string, commandLineArgs: readonly string[]) { - [{}, { outFile: "../outFile.js" }].forEach(options => { - verifyTsc({ - scenario: "noEmit", - subScenario: `${options?.outFile ? "outFile" : "multiFile"}/${subScenario}`, - fs: () => - loadProjectFromFiles({ - "/src/a.ts": aTsContent, - "/src/tsconfig.json": jsonToReadableText({ - compilerOptions: { ...options, noEmit: true }, - }), - }), - commandLineArgs, - edits: [ - noChangeRun, - { - caption: "Fix error", - edit: fs => fs.writeFileSync("/src/a.ts", `const a = "hello"`), - }, - noChangeRun, - ], - baselinePrograms: true, - }); - }); - } +describe("unittests:: tsbuild:: noEmit::", () => { + forEachNoEmitChanges(["-b", "-v"]); - function verifyNoEmit(subScenario: string, aTsContent: string) { - verifyNoEmitWorker(subScenario, aTsContent, ["--b", "/src/tsconfig.json", "-v"]); - verifyNoEmitWorker(`${subScenario} with incremental`, aTsContent, ["--b", "/src/tsconfig.json", "-v", "--incremental"]); - } + forEachNoEmitTsc(["--b", "--v"]); - verifyNoEmit("syntax errors", `const a = "hello`); - verifyNoEmit("semantic errors", `const a: number = "hello"`); + forEachNoEmitDtsChanges(["-b", "--v"]); }); diff --git a/src/testRunner/unittests/tsbuild/noEmitOnError.ts b/src/testRunner/unittests/tsbuild/noEmitOnError.ts index d594684a38143..d03fb4378e37c 100644 --- a/src/testRunner/unittests/tsbuild/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuild/noEmitOnError.ts @@ -1,68 +1,5 @@ -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - noChangeRun, - verifyTsc, -} from "../helpers/tsc.js"; -import { loadProjectFromFiles } from "../helpers/vfs.js"; +import { forEachNoEmitOnErrorScenarioTsc } from "../helpers/noEmitOnError.js"; describe("unittests:: tsbuild - with noEmitOnError::", () => { - forEachNoEmitOnErrorScenario( - (fsContents, cwd, executingFilePath) => loadProjectFromFiles(fsContents, { cwd, executingFilePath }), - (scenarioName, fs) => { - describe(scenarioName("verify noEmitOnError"), () => { - verifyTsc({ - scenario: "noEmitOnError", - subScenario: scenarioName("syntax errors"), - fs, - commandLineArgs: ["--b", "--verbose"], - edits: [ - noChangeRun, - { - caption: "Fix error", - edit: fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - "utf-8", - ), - }, - noChangeRun, - ], - baselinePrograms: true, - }); - - verifyTsc({ - scenario: "noEmitOnError", - subScenario: scenarioName("semantic errors"), - fs, - modifyFs: fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - "utf-8", - ), - commandLineArgs: ["--b", "--verbose"], - edits: [ - noChangeRun, - { - caption: "Fix error", - edit: fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - "utf-8", - ), - }, - noChangeRun, - ], - baselinePrograms: true, - }); - }); - }, - ); + forEachNoEmitOnErrorScenarioTsc(["--b", "--verbose"]); }); diff --git a/src/testRunner/unittests/tsbuildWatch/noEmit.ts b/src/testRunner/unittests/tsbuildWatch/noEmit.ts index aca1088a73dab..113f055da343c 100644 --- a/src/testRunner/unittests/tsbuildWatch/noEmit.ts +++ b/src/testRunner/unittests/tsbuildWatch/noEmit.ts @@ -1,12 +1,13 @@ import { jsonToReadableText } from "../helpers.js"; import { libContent } from "../helpers/contents.js"; +import { forEachNoEmitTscWatch } from "../helpers/noEmit.js"; import { verifyTscWatch } from "../helpers/tscWatch.js"; import { createWatchedSystem, libFile, } from "../helpers/virtualFileSystemWithWatch.js"; -describe("unittests:: tsbuildWatch:: watchMode:: with noEmit", () => { +describe("unittests:: tsbuildWatch:: watchMode:: with noEmit::", () => { function verify(outFile?: object) { verifyTscWatch({ scenario: "noEmit", @@ -44,4 +45,6 @@ describe("unittests:: tsbuildWatch:: watchMode:: with noEmit", () => { } verify(); verify({ outFile: "../out.js" }); + + forEachNoEmitTscWatch(["-b", "-verbose"]); }); diff --git a/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts b/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts index d02ba7ced44c9..6546204ef08fd 100644 --- a/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts @@ -1,56 +1,5 @@ -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - TscWatchCompileChange, - verifyTscWatch, -} from "../helpers/tscWatch.js"; -import { createWatchedSystem } from "../helpers/virtualFileSystemWithWatch.js"; +import { forEachNoEmitOnErrorScenarioTscWatch } from "../helpers/noEmitOnError.js"; describe("unittests:: tsbuildWatch:: watchMode:: with noEmitOnError::", () => { - function change(caption: string, content: string): TscWatchCompileChange { - return { - caption, - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, content), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - } - - const noChange: TscWatchCompileChange = { - caption: "No change", - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - forEachNoEmitOnErrorScenario( - (fsContents, currentDirectory) => createWatchedSystem(fsContents, { currentDirectory }), - (scenarioName, sys) => - verifyTscWatch({ - scenario: "noEmitOnError", - subScenario: scenarioName("does not emit any files on error"), - commandLineArgs: ["-b", "-w", "-verbose"], - sys, - edits: [ - noChange, - change( - "Fix Syntax error", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - ), - change( - "Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - ), - noChange, - change( - "Fix Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - ), - noChange, - ], - }), - ); + forEachNoEmitOnErrorScenarioTscWatch(["-b", "-verbose"]); }); diff --git a/src/testRunner/unittests/tsc/noEmit.ts b/src/testRunner/unittests/tsc/noEmit.ts index 6def668433629..ef78255050319 100644 --- a/src/testRunner/unittests/tsc/noEmit.ts +++ b/src/testRunner/unittests/tsc/noEmit.ts @@ -1,154 +1,17 @@ -import * as ts from "../../_namespaces/ts.js"; -import { dedent } from "../../_namespaces/Utils.js"; import { jsonToReadableText } from "../helpers.js"; -import { compilerOptionsToConfigJson } from "../helpers/contents.js"; +import { + forEachNoEmitChanges, + forEachNoEmitDtsChanges, + forEachNoEmitTsc, +} from "../helpers/noEmit.js"; import { noChangeOnlyRuns, - noChangeRun, - TestTscEdit, verifyTsc, } from "../helpers/tsc.js"; -import { - loadProjectFromFiles, - replaceText, -} from "../helpers/vfs.js"; -describe("unittests:: tsc:: noEmit::", () => { - describe("when noEmit changes between compilation", () => { - verifyNoEmitChanges({ incremental: true }); - verifyNoEmitChanges({ incremental: true, declaration: true }); - verifyNoEmitChanges({ composite: true }); - verifyNoEmitChanges({ incremental: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }); - verifyNoEmitChanges({ incremental: true, declaration: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }); - verifyNoEmitChanges({ composite: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }); - - function verifyNoEmitChanges(compilerOptions: ts.CompilerOptions) { - const discrepancyExplanation = () => [ - "Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files", - "Incremental will store the past latestChangedDtsFile and emitSignatures", - ]; - const noChangeRunWithNoEmit: TestTscEdit = { - ...noChangeRun, - caption: "No Change run with noEmit", - commandLineArgs: ["--p", "src/project", "--noEmit"], - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }; - const noChangeRunWithEmit: TestTscEdit = { - ...noChangeRun, - caption: "No Change run with emit", - commandLineArgs: ["--p", "src/project"], - }; - let optionsString = ""; - for (const key in compilerOptions) { - if (ts.hasProperty(compilerOptions, key) && key !== "outFile" && key !== "module") { - optionsString += ` ${key}`; - } - } - function scenarioName(text: string) { - return `${compilerOptions.outFile ? "outFile" : "multiFile"}/${text}${optionsString}`; - } - - verifyTsc({ - scenario: "noEmit", - subScenario: scenarioName("changes"), - commandLineArgs: ["--p", "src/project"], - fs, - edits: [ - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - { - caption: "Introduce error but still noEmit", - commandLineArgs: ["--p", "src/project", "--noEmit"], - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }, - { - caption: "Fix error and emit", - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), - }, - noChangeRunWithEmit, - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - noChangeRunWithEmit, - { - caption: "Introduce error and emit", - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), - }, - noChangeRunWithEmit, - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - noChangeRunWithEmit, - { - caption: "Fix error and no emit", - commandLineArgs: ["--p", "src/project", "--noEmit"], - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }, - noChangeRunWithEmit, - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - noChangeRunWithEmit, - ], - }); - - verifyTsc({ - scenario: "noEmit", - subScenario: scenarioName("changes with initial noEmit"), - commandLineArgs: ["--p", "src/project", "--noEmit"], - fs, - edits: [ - noChangeRunWithEmit, - { - caption: "Introduce error with emit", - commandLineArgs: ["--p", "src/project"], - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), - }, - { - caption: "Fix error and no emit", - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }, - noChangeRunWithEmit, - ], - }); +import { loadProjectFromFiles } from "../helpers/vfs.js"; - function fs() { - return loadProjectFromFiles({ - "/src/project/src/class.ts": dedent` - export class classC { - prop = 1; - }`, - "/src/project/src/indirectClass.ts": dedent` - import { classC } from './class'; - export class indirectClass { - classC = new classC(); - }`, - "/src/project/src/directUse.ts": dedent` - import { indirectClass } from './indirectClass'; - new indirectClass().classC.prop;`, - "/src/project/src/indirectUse.ts": dedent` - import { indirectClass } from './indirectClass'; - new indirectClass().classC.prop;`, - "/src/project/src/noChangeFile.ts": dedent` - export function writeLog(s: string) { - }`, - "/src/project/src/noChangeFileWithEmitSpecificError.ts": dedent` - function someFunc(arguments: boolean, ...rest: any[]) { - }`, - "/src/project/tsconfig.json": jsonToReadableText({ - compilerOptions: compilerOptionsToConfigJson(compilerOptions), - }), - }); - } - } - }); +describe("unittests:: tsc:: noEmit::", () => { + forEachNoEmitChanges(["--p"]); verifyTsc({ scenario: "noEmit", @@ -167,4 +30,8 @@ describe("unittests:: tsc:: noEmit::", () => { edits: noChangeOnlyRuns, baselinePrograms: true, }); + + forEachNoEmitTsc(["-p"]); + + forEachNoEmitDtsChanges(["-p"]); }); diff --git a/src/testRunner/unittests/tsc/noEmitOnError.ts b/src/testRunner/unittests/tsc/noEmitOnError.ts index 4948d332b5b14..6eb7d7c2670f1 100644 --- a/src/testRunner/unittests/tsc/noEmitOnError.ts +++ b/src/testRunner/unittests/tsc/noEmitOnError.ts @@ -1,71 +1,13 @@ import { jsonToReadableText } from "../helpers.js"; -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - noChangeRun, - TestTscEdit, - verifyTsc, -} from "../helpers/tsc.js"; +import { forEachNoEmitOnErrorScenarioTsc } from "../helpers/noEmitOnError.js"; +import { verifyTsc } from "../helpers/tsc.js"; import { loadProjectFromFiles, replaceText, } from "../helpers/vfs.js"; describe("unittests:: tsc:: noEmitOnError::", () => { - forEachNoEmitOnErrorScenario( - (fsContents, cwd, executingFilePath) => loadProjectFromFiles(fsContents, { cwd, executingFilePath }), - (scnearioName, fs) => { - describe(scnearioName("verify noEmitOnError"), () => { - function verifyNoEmitOnError(subScenario: string, fixModifyFs: TestTscEdit["edit"], modifyFs?: TestTscEdit["edit"]) { - verifyTsc({ - scenario: "noEmitOnError", - subScenario: scnearioName(subScenario), - fs, - commandLineArgs: [], - modifyFs, - edits: [ - noChangeRun, - { - caption: "incremental-declaration-doesnt-change", - edit: fixModifyFs, - }, - noChangeRun, - ], - baselinePrograms: true, - }); - } - verifyNoEmitOnError( - "syntax errors", - fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - "utf-8", - ), - ); - - verifyNoEmitOnError( - "semantic errors", - fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - "utf-8", - ), - fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - "utf-8", - ), - ); - }); - }, - ); + forEachNoEmitOnErrorScenarioTsc([]); verifyTsc({ scenario: "noEmitOnError", diff --git a/src/testRunner/unittests/tscWatch/noEmit.ts b/src/testRunner/unittests/tscWatch/noEmit.ts new file mode 100644 index 0000000000000..c40b2dde84e76 --- /dev/null +++ b/src/testRunner/unittests/tscWatch/noEmit.ts @@ -0,0 +1,5 @@ +import { forEachNoEmitTscWatch } from "../helpers/noEmit.js"; + +describe("unittests:: tsc-watch:: noEmit::", () => { + forEachNoEmitTscWatch(["-p"]); +}); diff --git a/src/testRunner/unittests/tscWatch/noEmitOnError.ts b/src/testRunner/unittests/tscWatch/noEmitOnError.ts index 32b154c1f58db..1d89442f176e3 100644 --- a/src/testRunner/unittests/tscWatch/noEmitOnError.ts +++ b/src/testRunner/unittests/tscWatch/noEmitOnError.ts @@ -1,56 +1,5 @@ -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - TscWatchCompileChange, - verifyTscWatch, -} from "../helpers/tscWatch.js"; -import { createWatchedSystem } from "../helpers/virtualFileSystemWithWatch.js"; +import { forEachNoEmitOnErrorScenarioTscWatch } from "../helpers/noEmitOnError.js"; describe("unittests:: tsc-watch:: noEmitOnError::", () => { - function change(caption: string, content: string): TscWatchCompileChange { - return { - caption, - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, content), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - } - const noChange: TscWatchCompileChange = { - caption: "No change", - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - forEachNoEmitOnErrorScenario( - (fsContents, currentDirectory) => createWatchedSystem(fsContents, { currentDirectory }), - (scenarioName, sys) => { - verifyTscWatch({ - scenario: "noEmitOnError", - subScenario: scenarioName("noEmitOnError"), - commandLineArgs: ["--w"], - sys, - edits: [ - noChange, - change( - "Fix Syntax error", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - ), - change( - "Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - ), - noChange, - change( - "Fix Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - ), - noChange, - ], - }); - }, - ); + forEachNoEmitOnErrorScenarioTscWatch([]); }); diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js new file mode 100644 index 0000000000000..426adc8e2ccf9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js @@ -0,0 +1,1338 @@ +0:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +1:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +2:: Introduce error but still noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + [ + "./src/class.ts", + "-9508063301-export declare class classC {\n prop: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +5:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +6:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +10:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +11:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +13:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +15:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +16:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js new file mode 100644 index 0000000000000..96deadf55cbab --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js @@ -0,0 +1,1681 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2135 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-9508063301-export declare class classC {\n prop: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "emitSignatures": [ + [ + "./src/class.ts", + "-9508063301-export declare class classC {\n prop: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2791 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2135 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2671 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2201 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2107 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js new file mode 100644 index 0000000000000..e4d162f2afd3b --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js @@ -0,0 +1,1658 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "version": "FakeTSVersion", + "size": 2570 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] file written with same contents +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2631 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "version": "FakeTSVersion", + "size": 2006 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js new file mode 100644 index 0000000000000..0b803c9110d32 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js @@ -0,0 +1,1512 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1520 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/directuse.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ], + [ + "./src/indirectuse.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 2450 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/directUse.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1747 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2311 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1780 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1747 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js new file mode 100644 index 0000000000000..b7a1a680cd675 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js @@ -0,0 +1,145 @@ +2:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000000..dd726b49be1f9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js @@ -0,0 +1,1067 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + "./src/directuse.ts", + "Js | Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + "./src/indirectuse.ts", + "Js | Dts" + ], + [ + "./src/nochangefile.ts", + "Js | Dts" + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + "Js | Dts" + ] + ], + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion", + "size": 1621 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2135 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2671 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2201 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2107 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000000..7f30d0392af57 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,1048 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + "./src/directuse.ts", + "Js | Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + "./src/indirectuse.ts", + "Js | Dts" + ], + [ + "./src/nochangefile.ts", + "Js | Dts" + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1592 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2631 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "version": "FakeTSVersion", + "size": 2006 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000000..1aa309ce5bdfa --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js @@ -0,0 +1,931 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/directuse.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ], + [ + "./src/indirectuse.ts", + "Js" + ], + [ + "./src/nochangefile.ts", + "Js" + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1561 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1520 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2413 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1780 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1747 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..9263c04ce6d32 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,234 @@ +1:: With declaration enabled noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} +2:: With declaration and declarationMap noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} +6:: With declaration enabled noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js new file mode 100644 index 0000000000000..311afacdaea5d --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -0,0 +1,449 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 719 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 959 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 897 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..1442aa67b8b97 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js @@ -0,0 +1,186 @@ +1:: With declaration enabled noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} +2:: With declaration and declarationMap noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} +6:: With declaration enabled noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9520728827-const a = class { public p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9520728827-const a = class { public p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9520728827-const a = class { public p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9520728827-const a = class { public p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js new file mode 100644 index 0000000000000..bf7650b0a4d1d --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -0,0 +1,398 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 700 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 872 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"9520728827-const a = class { public p = 10; };","signature":"13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + }, + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 793 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..c229207718044 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,314 @@ +1:: With declaration enabled noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} +2:: With declaration and declarationMap noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} +6:: With declaration enabled noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..409cd1902038b --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,750 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) +/home/src/projects/project/c.ts (used version) +/home/src/projects/project/d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ], + [ + "./c.ts", + "Js" + ], + [ + "./d.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 859 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/d.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +exports.d = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1387 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1352 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/c.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/c.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/c.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,[3,24],4,[5,24]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "original": { + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts | DtsMap" + ], + [ + [ + "./b.ts", + 24 + ], + "Dts | DtsMap" + ], + [ + "./c.ts", + "Js | Dts | DtsMap" + ], + [ + [ + "./d.ts", + 24 + ], + "Dts | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1214 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js new file mode 100644 index 0000000000000..684e981082d17 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js @@ -0,0 +1,440 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..a036f087401d9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,635 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 750 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 811 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 847 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1021 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1163 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..2fb730cad0aa0 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,553 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 731 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 772 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 915 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1056 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2973ac52377cb --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,572 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 719 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 921 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 890 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..1ee9d031e5088 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,506 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 700 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 884 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..946cd222c1225 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,360 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..b6efb2d8dc363 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js @@ -0,0 +1,430 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts during emit) + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.d.ts] file changed its modified time +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..90e79c9c3bb46 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,685 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 902 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js index 7c704069bca98..c6b1a96cc5bed 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -46,39 +46,39 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "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; };", "affectsGlobalScope": true @@ -124,7 +124,7 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 833 + "size": 842 } @@ -134,15 +134,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -152,18 +152,18 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: @@ -174,54 +174,54 @@ No shapes updated in the builder:: Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: -/src/a.ts (computed .d.ts) +/home/src/projects/project/a.ts (computed .d.ts) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"4011451714-const a = \"hello\"","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "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; };", "affectsGlobalScope": true @@ -232,11 +232,11 @@ Shape signatures in builder refreshed for:: }, "./a.ts": { "original": { - "version": "4011451714-const a = \"hello\"", + "version": "3528887741-const a = \"hello\";", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true }, - "version": "4011451714-const a = \"hello\"", + "version": "3528887741-const a = \"hello\";", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true } @@ -254,7 +254,101 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 731 + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 } @@ -264,12 +358,261 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' exitCode:: ExitStatus.Success + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 894 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js index 3e122d641dec3..02424f409a902 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js @@ -1,5 +1,13 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +23,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -46,31 +44,31 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -87,15 +85,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -105,74 +103,74 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -188,36 +186,253 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..537ca4e8d4032 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,56 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..bbe302d529ea9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,652 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello", + "signature": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 715 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 789 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 758 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..7f5eda498959b --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,44 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js index d550181a434e6..c06f8b0ceabac 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -46,39 +46,39 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "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; };", "affectsGlobalScope": true @@ -111,7 +111,7 @@ Shape signatures in builder refreshed for:: ], "errors": true, "version": "FakeTSVersion", - "size": 686 + "size": 695 } @@ -121,15 +121,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -139,18 +139,18 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: @@ -161,54 +161,54 @@ No shapes updated in the builder:: Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: -/src/a.ts (computed .d.ts) +/home/src/projects/project/a.ts (computed .d.ts) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"4011451714-const a = \"hello\"","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "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; };", "affectsGlobalScope": true @@ -219,11 +219,11 @@ Shape signatures in builder refreshed for:: }, "./a.ts": { "original": { - "version": "4011451714-const a = \"hello\"", + "version": "3528887741-const a = \"hello\";", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true }, - "version": "4011451714-const a = \"hello\"", + "version": "3528887741-const a = \"hello\";", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true } @@ -241,7 +241,101 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 731 + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 } @@ -251,12 +345,237 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' exitCode:: ExitStatus.Success + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 752 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 721 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js index 800a070d74498..f24c1e0fc5047 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js @@ -1,5 +1,13 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +23,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -46,31 +44,31 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -87,15 +85,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -105,74 +103,74 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -188,36 +186,254 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js new file mode 100644 index 0000000000000..c9ab001058334 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js @@ -0,0 +1,740 @@ +0:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +1:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +2:: Introduce error but still noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +5:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +6:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +10:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +11:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +13:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +15:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +16:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js new file mode 100644 index 0000000000000..8c21f80022704 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js @@ -0,0 +1,1309 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 2643 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] file written with same contents +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop1: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2625 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js new file mode 100644 index 0000000000000..638beda540a81 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js @@ -0,0 +1,1299 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 2094 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] file written with same contents +//// [/src/outFile.js] file written with same contents +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop1: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2074 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 1516 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js new file mode 100644 index 0000000000000..9dfd948bb536f --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js @@ -0,0 +1,1231 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 2075 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] file written with same contents +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2055 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 1497 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js new file mode 100644 index 0000000000000..f85d03c164736 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js @@ -0,0 +1,74 @@ +2:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000000..1217921fba827 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js @@ -0,0 +1,778 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 1514 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop1: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2625 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000000..1f588e8bcf061 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,771 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 1516 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop1: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2074 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 1516 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000000..073903fe6ef67 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js @@ -0,0 +1,705 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +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/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 1497 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2055 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 1497 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "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; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..bbe432aa39d53 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,202 @@ +1:: With declaration enabled noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +2:: With declaration and declarationMap noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +6:: With declaration enabled noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js new file mode 100644 index 0000000000000..b6f497ecadeff --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -0,0 +1,400 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 901 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 728 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..23c57e2882256 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js @@ -0,0 +1,154 @@ +1:: With declaration enabled noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +2:: With declaration and declarationMap noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +6:: With declaration enabled noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js new file mode 100644 index 0000000000000..a986f472deee0 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -0,0 +1,353 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 826 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","9520728827-const a = class { public p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 654 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..36477c07cc9af --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,250 @@ +1:: With declaration enabled noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +2:: With declaration and declarationMap noEmit - Should report errors +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +6:: With declaration enabled noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..70624a90b6918 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,602 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 881 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); +define("c", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = /** @class */ (function () { + function class_2() { + this.p = 10; + } + return class_2; + }()); +}); +define("d", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = /** @class */ (function () { + function class_3() { + this.p = 10; + } + return class_3; + }()); +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1345 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 880 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/c.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-15184115393-export const c = class { public p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts | DtsMap", + false + ], + "version": "FakeTSVersion", + "size": 920 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js new file mode 100644 index 0000000000000..29627485e9f9e --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js @@ -0,0 +1,433 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..96c3ed2e36e72 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,554 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 748 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 733 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 713 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 748 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 901 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..97edf78f06b42 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,470 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 674 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 658 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 638 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 674 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 826 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..fe08d9a9d0b62 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,512 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 709 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..a275bd2d32cc9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,433 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 635 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..9d2fec6014dcf --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,355 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..a29671374d5e0 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js @@ -0,0 +1,423 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] file changed its modified time +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..c9d744d952293 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,621 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js index d46412c48c1ba..7383eaa005bd4 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js @@ -1,5 +1,16 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +26,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -47,44 +47,44 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "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; };", - "./src/a.ts": "1311033573-const a: number = \"hello\"" + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -92,7 +92,7 @@ No shapes updated in the builder:: }, "semanticDiagnosticsPerFile": [ [ - "./src/a.ts", + "./project/a.ts", [ { "start": 6, @@ -109,7 +109,7 @@ No shapes updated in the builder:: false ], "version": "FakeTSVersion", - "size": 786 + "size": 797 } @@ -119,15 +119,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -137,19 +137,19 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: @@ -160,60 +160,60 @@ No shapes updated in the builder:: Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["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; };","4011451714-const a = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "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; };", - "./src/a.ts": "4011451714-const a = \"hello\"" + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -224,7 +224,7 @@ No shapes updated in the builder:: false ], "version": "FakeTSVersion", - "size": 627 + "size": 639 } @@ -234,12 +234,314 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' exitCode:: ExitStatus.Success + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 797 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 777 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js index 43deb618adba6..48bd7911db692 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -47,37 +46,37 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "errors": true, "version": "FakeTSVersion", - "size": 63 + "size": 67 } @@ -87,15 +86,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -105,78 +104,78 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "version": "FakeTSVersion", - "size": 49 + "size": 53 } @@ -186,35 +185,248 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.js' does not exist +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..c9f7d1572e791 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,50 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..a2904169c3e11 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,596 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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 --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 725 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 725 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 705 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..f7e3f91ee9340 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,38 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js index 477384425abf8..47827ede78bd6 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js @@ -1,5 +1,16 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +26,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -47,44 +47,44 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "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; };", - "./src/a.ts": "2464268576-const a = \"hello" + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -96,7 +96,7 @@ No shapes updated in the builder:: ], "errors": true, "version": "FakeTSVersion", - "size": 639 + "size": 650 } @@ -106,15 +106,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -124,19 +124,19 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: @@ -147,60 +147,60 @@ No shapes updated in the builder:: Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["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; };","4011451714-const a = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "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; };", - "./src/a.ts": "4011451714-const a = \"hello\"" + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -211,7 +211,7 @@ No shapes updated in the builder:: false ], "version": "FakeTSVersion", - "size": 627 + "size": 639 } @@ -221,12 +221,291 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'outFile.tsbuildinfo' +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 650 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 630 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js index 23f034b7d7544..8687a80b0ecc8 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -47,37 +46,37 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "errors": true, "version": "FakeTSVersion", - "size": 63 + "size": 67 } @@ -87,15 +86,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -105,78 +104,78 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "version": "FakeTSVersion", - "size": 49 + "size": 53 } @@ -186,35 +185,249 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.js' does not exist +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..472232ad148c1 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,404 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[2,3,4],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js | Dts" + ], + [ + "../src/main.ts", + "Js | Dts" + ], + [ + "../src/other.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 994 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..15084d684c638 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js @@ -0,0 +1,278 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts during emit) +/user/username/projects/noemitonerror/src/other.ts (computed .d.ts during emit) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..f1149ef936e73 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,323 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 940 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js new file mode 100644 index 0000000000000..dd6b6e5c802c4 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js @@ -0,0 +1,210 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output 'dev-build/shared/types/db.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..678b79a6a2a25 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,336 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 954 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..2d662971062fc --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js @@ -0,0 +1,270 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.js' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..03adf3a161ef3 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js @@ -0,0 +1,268 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output '../dev-build.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js new file mode 100644 index 0000000000000..3160ee2beb84d --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js @@ -0,0 +1,203 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output '../dev-build.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..1f8c336ea4cbb --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,770 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 752 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 813 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 849 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1023 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1165 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..f83e3e29d5367 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,682 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 733 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 774 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 743 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 917 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1058 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..115b9ea4aa5cf --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,704 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 721 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 923 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 892 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..99c67ebf4dfa1 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,632 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 702 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 886 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..c5b95323a5fc6 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,421 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..b643a476830fd --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js @@ -0,0 +1,458 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/a.d.ts] file changed its modified time + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2e72323462331 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,755 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 935 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 904 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..e354b8a59cd38 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js @@ -0,0 +1,686 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 844 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 896 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js new file mode 100644 index 0000000000000..775800615b95d --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js @@ -0,0 +1,455 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..4dc1e67e2a64d --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,722 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello", + "signature": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 717 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 791 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 760 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..236d93b3319be --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js @@ -0,0 +1,649 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 697 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 754 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 723 +} + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js new file mode 100644 index 0000000000000..4e6a8f5368a5a --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js @@ -0,0 +1,457 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..5529e3c25b6b1 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,701 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 750 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 735 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 715 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 750 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 903 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..b159902e3ff0f --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,605 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 676 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 660 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 640 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 676 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 828 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2fe818546ef26 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,656 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 711 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..4a812c04a6943 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,565 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 637 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..a00ebe955a717 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,431 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..531e5e13fa1c8 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js @@ -0,0 +1,466 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.d.ts] file changed its modified time + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..24417c1e97e8f --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,699 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..5381c8134e1bb --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js @@ -0,0 +1,619 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 779 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js new file mode 100644 index 0000000000000..91166cbcad536 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js @@ -0,0 +1,465 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..e04d0067a56e8 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,674 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 727 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 727 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 707 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..9d17112e829c5 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js @@ -0,0 +1,583 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 652 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 652 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 632 +} + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js new file mode 100644 index 0000000000000..e87b86d92e4cc --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js @@ -0,0 +1,468 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js similarity index 63% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js index b411926284e6e..3a5a2c4845646 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js @@ -44,7 +44,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -255,7 +255,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -423,7 +423,37 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -432,10 +462,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -587,10 +617,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -640,7 +670,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -649,10 +679,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -786,10 +816,398 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[3],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1245 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js similarity index 55% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js index 508d58bbc73aa..6677cf5130cc6 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js @@ -4,6 +4,7 @@ Input:: { "compilerOptions": { "outDir": "./dev-build", + "declaration": true, "noEmitOnError": true } } @@ -42,7 +43,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -100,6 +101,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -165,6 +167,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -183,7 +186,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -232,6 +235,12 @@ Output:: Object.defineProperty(exports, "__esModule", { value: true }); +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -240,12 +249,20 @@ var a = { }; +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); console.log("hi"); +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + Program root files: [ @@ -255,6 +272,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -275,7 +293,69 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -284,10 +364,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -332,6 +412,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -358,10 +439,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -391,6 +472,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -409,7 +491,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -418,10 +500,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -454,13 +536,16 @@ Output:: } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var a = "hello"; +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -470,6 +555,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -496,10 +582,283 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -519,8 +878,11 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -530,6 +892,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js similarity index 65% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js index be71f83283878..9bd0010b46ea9 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js @@ -43,7 +43,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -251,7 +251,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -399,7 +399,37 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -408,10 +438,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -557,10 +587,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -609,7 +639,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -618,10 +648,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -748,10 +778,339 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1144 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError.js similarity index 59% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError.js index 48ad94fb9638d..7b566a4bb14eb 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError.js @@ -4,7 +4,6 @@ Input:: { "compilerOptions": { "outDir": "./dev-build", - "declaration": true, "noEmitOnError": true } } @@ -43,7 +42,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -101,7 +100,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -167,7 +165,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -186,7 +183,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -235,12 +232,6 @@ Output:: Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -249,20 +240,12 @@ var a = { }; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); console.log("hi"); -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - Program root files: [ @@ -272,7 +255,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -293,7 +275,65 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -302,10 +342,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -350,7 +390,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -377,10 +416,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -410,7 +449,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -429,7 +467,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -438,10 +476,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -474,16 +512,13 @@ Output:: } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var a = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -493,7 +528,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -520,10 +554,267 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -543,11 +834,8 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -557,7 +845,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js similarity index 63% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js index f3ea2d30c4c42..7b063f526cbe0 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js @@ -45,7 +45,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -218,7 +218,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -353,7 +353,37 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -362,10 +392,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -484,10 +514,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -538,7 +568,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -547,10 +577,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -664,10 +694,356 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 954 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js similarity index 57% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js index 91923ee6f5a6d..e373e9ac7ce9b 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js @@ -5,6 +5,7 @@ Input:: "compilerOptions": { "outFile": "../dev-build.js", "module": "amd", + "declaration": true, "noEmitOnError": true } } @@ -43,7 +44,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -102,6 +103,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -164,6 +166,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -182,7 +185,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -245,6 +248,18 @@ define("src/other", ["require", "exports"], function (require, exports) { }); +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { } +declare module "src/other" { + export {}; +} + + Program root files: [ @@ -255,6 +270,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -277,7 +293,66 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time +//// [/user/username/projects/dev-build.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -286,10 +361,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -335,6 +410,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -363,10 +439,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -397,6 +473,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -415,7 +492,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -424,10 +501,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -474,6 +551,7 @@ define("src/other", ["require", "exports"], function (require, exports) { }); +//// [/user/username/projects/dev-build.d.ts] file written with same contents Program root files: [ @@ -484,6 +562,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -512,10 +591,302 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time +//// [/user/username/projects/dev-build.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -535,6 +906,7 @@ Output:: //// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time //// [/user/username/projects/dev-build.js] file changed its modified time +//// [/user/username/projects/dev-build.d.ts] file changed its modified time Program root files: [ @@ -545,6 +917,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js similarity index 65% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js index d18caa3ed1d3a..d08a1e66691d7 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js @@ -44,7 +44,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -214,7 +214,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -335,7 +335,37 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -344,10 +374,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -464,10 +494,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -517,7 +547,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -526,10 +556,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -640,10 +670,296 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError.js similarity index 60% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError.js index 7f9cdee84059d..ebf125e5daf6e 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError.js @@ -5,7 +5,6 @@ Input:: "compilerOptions": { "outFile": "../dev-build.js", "module": "amd", - "declaration": true, "noEmitOnError": true } } @@ -44,7 +43,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -103,7 +102,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -166,7 +164,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -185,7 +182,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -248,18 +245,6 @@ define("src/other", ["require", "exports"], function (require, exports) { }); -//// [/user/username/projects/dev-build.d.ts] -declare module "shared/types/db" { - export interface A { - name: string; - } -} -declare module "src/main" { } -declare module "src/other" { - export {}; -} - - Program root files: [ @@ -270,7 +255,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -293,7 +277,64 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -302,10 +343,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -351,7 +392,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -380,10 +420,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -414,7 +454,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -433,7 +472,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -442,10 +481,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -492,7 +531,6 @@ define("src/other", ["require", "exports"], function (require, exports) { }); -//// [/user/username/projects/dev-build.d.ts] file written with same contents Program root files: [ @@ -503,7 +541,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -532,10 +569,274 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -555,7 +856,6 @@ Output:: //// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time //// [/user/username/projects/dev-build.js] file changed its modified time -//// [/user/username/projects/dev-build.d.ts] file changed its modified time Program root files: [ @@ -566,7 +866,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..265d2d8aafb6d --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,79 @@ +3:: no-change-run +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..e2fdee7337f7d --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1185 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) +/home/src/projects/project/c.ts (used version) +/home/src/projects/project/d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ], + [ + "./c.ts", + "Js" + ], + [ + "./d.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 859 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ], + [ + "./c.ts", + "Js | Dts" + ], + [ + "./d.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 890 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts | DtsMap" + ], + [ + "./b.ts", + "Js | Dts | DtsMap" + ], + [ + "./c.ts", + "Js | Dts | DtsMap" + ], + [ + "./d.ts", + "Js | Dts | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 912 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --declaration +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/d.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +exports.d = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1387 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1352 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"affectedFilesPendingEmit":[2,[3],[4],[5]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + [ + "./b.ts" + ], + "Dts" + ], + [ + [ + "./c.ts" + ], + "Dts" + ], + [ + [ + "./d.ts" + ], + "Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1076 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,[3,24],[4,24],[5,24]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts | DtsMap" + ], + [ + [ + "./b.ts", + 24 + ], + "Dts | DtsMap" + ], + [ + [ + "./c.ts", + 24 + ], + "Dts | DtsMap" + ], + [ + [ + "./d.ts", + 24 + ], + "Dts | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1107 +} + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/c.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/c.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,[3,24],4,[5,24]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "original": { + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts | DtsMap" + ], + [ + [ + "./b.ts", + 24 + ], + "Dts | DtsMap" + ], + [ + "./c.ts", + "Js | Dts | DtsMap" + ], + [ + [ + "./d.ts", + 24 + ], + "Dts | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1214 +} + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..01b537d076709 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,660 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 750 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 811 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 847 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1021 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1163 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..dd6fcc56336ec --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,570 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 731 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 772 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 915 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1056 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..890ebc65eb209 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,593 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 719 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 921 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 890 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..b8c3df7f8a2b6 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,519 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 700 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 884 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..fa160f804e05d --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,245 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..88aa8ab1d78e5 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js @@ -0,0 +1,268 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..cd579888258c4 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,664 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 902 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..e25b3acb72c51 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js @@ -0,0 +1,593 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 842 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 894 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js new file mode 100644 index 0000000000000..03e21e58c42b9 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js @@ -0,0 +1,277 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..537ca4e8d4032 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,56 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..f0ccfd69dac8a --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,631 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello", + "signature": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 715 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 789 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 758 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..7f5eda498959b --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,44 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..333db88b2d8d0 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js @@ -0,0 +1,556 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 695 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 752 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 721 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js new file mode 100644 index 0000000000000..436bf39d063b1 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js @@ -0,0 +1,280 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..cd2f61f6196b1 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,63 @@ +3:: no-change-run +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..a72779db62853 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,890 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 881 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 900 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts | DtsMap", + false + ], + "version": "FakeTSVersion", + "size": 922 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --declaration +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); +define("c", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = /** @class */ (function () { + function class_2() { + this.p = 10; + } + return class_2; + }()); +}); +define("d", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = /** @class */ (function () { + function class_3() { + this.p = 10; + } + return class_3; + }()); +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1345 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 880 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 899 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts | DtsMap", + false + ], + "version": "FakeTSVersion", + "size": 921 +} + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-15184115393-export const c = class { public p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts | DtsMap", + false + ], + "version": "FakeTSVersion", + "size": 920 +} + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..b46db7303a9cd --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,587 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 748 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 733 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 713 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 748 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 901 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..57a511c4d29d7 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,491 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 674 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 658 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 638 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 674 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 826 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..d8d5f00ec7dc2 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,541 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 709 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..3fdea8ba48ccc --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,450 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 635 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..15c59ddf864de --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,256 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..0550ff0817cef --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js @@ -0,0 +1,278 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + +//// [/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/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..922f4809e5563 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,604 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..544e81abdadd7 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js @@ -0,0 +1,524 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 797 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 797 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 777 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js new file mode 100644 index 0000000000000..d3c57be2ae283 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js @@ -0,0 +1,288 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..c9f7d1572e791 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,50 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..8212ccbeda118 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,579 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 725 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 725 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 705 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..f7e3f91ee9340 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,38 @@ +6:: Emit when error +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..364f688275082 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js @@ -0,0 +1,488 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 650 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 650 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 630 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js new file mode 100644 index 0000000000000..668a01c6728c4 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js @@ -0,0 +1,291 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/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/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..f1f662d00bdaa --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,397 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[2,3,4],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js | Dts" + ], + [ + "../src/main.ts", + "Js | Dts" + ], + [ + "../src/other.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 994 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..29f4547d50b31 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js @@ -0,0 +1,218 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..8cf43186500a1 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,339 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 940 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js new file mode 100644 index 0000000000000..7c6569944a212 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js @@ -0,0 +1,182 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js index 413b389b6667d..1b1931ad5e845 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js @@ -222,7 +222,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js index 671b31139b20e..dc759510f7ae6 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js @@ -109,7 +109,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js index eadc938dee4ed..6d38b41472fd9 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js @@ -218,7 +218,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js index 6c4bfefe3fcaa..3381fd82bb2b4 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js @@ -106,7 +106,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js index 59b068da532fd..c05f9443ea587 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js @@ -212,7 +212,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js index ca9035bd7d2a1..f76bfe64c3d89 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js @@ -112,7 +112,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js index d9571ff015651..c035a9f9bdf89 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js @@ -208,7 +208,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js index 2e3dafb7b21ea..eee6ec673fdf7 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js @@ -109,7 +109,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..379191a1ee239 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,330 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 954 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..3b3cabb3db733 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js @@ -0,0 +1,219 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.d.ts] file written with same contents +//// [/user/username/projects/dev-build.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..fdfbee667d69a --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js @@ -0,0 +1,286 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js new file mode 100644 index 0000000000000..e75a254a21c81 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js @@ -0,0 +1,181 @@ +currentDirectory:: /user/username/projects/noEmitOnError 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js index 161b010072f05..4144576918f75 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js @@ -185,7 +185,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js index 66c311cfecd4c..cd44f1f92dcf7 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js @@ -112,7 +112,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js index d003357320399..eb206cb4af378 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js @@ -181,7 +181,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js index 489e348d0140d..b0f2cb9ba3da0 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js @@ -109,7 +109,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js index 355855188eecf..7f6ecf3ec8b40 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js @@ -175,7 +175,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js index 02556588614fd..70144f43bea42 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js @@ -115,7 +115,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js index 078d06e48f93b..ab83767df9dd8 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js @@ -171,7 +171,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js index 601e358318374..fa72048f8d5bf 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js @@ -112,7 +112,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..f27a3129e9b76 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,747 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 752 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ], + [ + "./b.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 813 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 849 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1023 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1165 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..9cd791e43d971 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,659 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 733 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 774 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 743 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 917 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1058 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..fc207d0e61105 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,681 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 721 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 923 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 892 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..a98b6580da090 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,609 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 702 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 886 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..3ef18573710b5 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,378 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..41b878dea3be3 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js @@ -0,0 +1,401 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..64dfa7a7f21c8 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,732 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 935 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 904 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..13ef608541e61 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js @@ -0,0 +1,663 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 844 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 896 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js new file mode 100644 index 0000000000000..156677860decb --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js @@ -0,0 +1,390 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..f80da7e958fd0 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,699 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-14000546910-export const a = \"hello", + "signature": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 717 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 791 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 760 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..25845fb9f4d67 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js @@ -0,0 +1,626 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 697 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 754 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "errors": true, + "version": "FakeTSVersion", + "size": 723 +} + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js new file mode 100644 index 0000000000000..d0391170e6255 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js @@ -0,0 +1,392 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..c05ac4afcab80 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,678 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 750 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 735 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 715 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 750 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 903 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..ab5369b91ee84 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,582 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 676 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 660 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 640 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 676 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 828 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..1b2a8617fe267 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,633 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 711 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..e7156419f19ec --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,542 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 637 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..5f85396fb1306 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,388 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..fed784d49e10d --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js @@ -0,0 +1,409 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..1f04a55c3f391 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,676 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..d7a65071871ef --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js @@ -0,0 +1,596 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 779 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js new file mode 100644 index 0000000000000..43c0642912f7b --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js @@ -0,0 +1,400 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..d9906002df5fc --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,651 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 727 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 727 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 707 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..e5551079e3d2b --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js @@ -0,0 +1,560 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 652 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "errors": true, + "version": "FakeTSVersion", + "size": 652 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "errors": true, + "version": "FakeTSVersion", + "size": 632 +} + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js new file mode 100644 index 0000000000000..15dd4e93463e4 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js @@ -0,0 +1,403 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/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; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js index 0b6c88400ba18..5ae856da46ba1 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js @@ -213,7 +213,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -376,7 +376,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -385,10 +402,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -535,10 +552,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -546,7 +563,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -555,10 +572,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -687,10 +704,333 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[3],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + "Js | Dts" + ] + ], + "version": "FakeTSVersion", + "size": 1245 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js index eb78ea36d043e..c4496aaca4f47 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js @@ -130,7 +130,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -218,7 +218,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -227,10 +244,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -282,10 +299,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -293,7 +310,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -302,10 +319,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -359,10 +376,177 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js index 31c5f0c0ace3a..eede79b45059c 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js @@ -210,7 +210,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -353,7 +353,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -362,10 +379,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -506,10 +523,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -517,7 +534,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -526,10 +543,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -651,10 +668,303 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1144 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js index 16ee93653c6aa..eb6a75a8d78b4 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js @@ -128,7 +128,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -201,7 +201,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -210,10 +227,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -264,10 +281,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -275,7 +292,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -284,10 +301,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -339,10 +356,163 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js index 6dabdc7b179e6..936ce1f6e5bee 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js @@ -175,7 +175,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -305,7 +305,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -314,10 +331,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -431,10 +448,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -442,7 +459,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -451,10 +468,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -563,10 +580,290 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 954 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js index 74af0a1cb605d..58f7b4019b9b4 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js @@ -128,7 +128,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -217,7 +217,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -226,10 +243,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -284,10 +301,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -295,7 +312,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -304,10 +321,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -375,10 +392,204 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js index f3567ce6e7ca7..cce784de66baf 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js @@ -172,7 +172,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -288,7 +288,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -297,10 +314,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -412,10 +429,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -423,7 +440,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -432,10 +449,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -541,10 +558,260 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "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; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js index bdf0b2114cfb3..8449c73c638dc 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js @@ -126,7 +126,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -202,7 +202,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -211,10 +228,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -268,10 +285,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -279,7 +296,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -288,10 +305,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -357,10 +374,180 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 From 61b1933337f74d61fe619a5d2d0c8c0ea9908853 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 27 Jun 2024 14:39:38 -0700 Subject: [PATCH 3/7] Fix syntax errors and noEmit option --- src/compiler/builder.ts | 23 ++- src/compiler/program.ts | 2 - src/compiler/tsbuildPublic.ts | 18 +- src/testRunner/unittests/helpers/baseline.ts | 10 +- src/testRunner/unittests/helpers/noEmit.ts | 48 +++-- src/testRunner/unittests/helpers/tsc.ts | 68 ++++--- .../prepend-reports-deprecation-error.js | 8 +- ...ndline-with-declaration-and-incremental.js | 24 +-- ...ndline-with-declaration-and-incremental.js | 60 +++--- ...ndline-with-declaration-and-incremental.js | 20 +- ...ndline-with-declaration-and-incremental.js | 50 ++--- .../multiFile/dts-errors-with-incremental.js | 20 +- .../semantic-errors-with-incremental.js | 20 +- .../syntax-errors-with-incremental.js | 22 +-- .../outFile/dts-errors-with-incremental.js | 40 ++-- .../semantic-errors-with-incremental.js | 40 ++-- .../outFile/syntax-errors-with-incremental.js | 46 ++--- ...th-incremental-as-modules-discrepancies.js | 128 +++++++------ ...ntax-errors-with-incremental-as-modules.js | 113 +++++++----- ...x-errors-with-incremental-discrepancies.js | 84 ++++----- .../syntax-errors-with-incremental.js | 59 +++--- .../tsbuild/noEmit/multiFile/syntax-errors.js | 32 +--- ...th-incremental-as-modules-discrepancies.js | 50 ----- ...ntax-errors-with-incremental-as-modules.js | 57 +++--- ...x-errors-with-incremental-discrepancies.js | 38 ---- .../outFile/syntax-errors-with-incremental.js | 50 ++--- .../tsbuild/noEmit/outFile/syntax-errors.js | 16 +- ...iles-belong-to-rootDir-and-is-composite.js | 6 +- ...ror-if-input-file-is-missing-with-force.js | 6 +- .../reports-error-if-input-file-is-missing.js | 6 +- ...ntax-errors-with-incremental-as-modules.js | 111 +++++++----- .../syntax-errors-with-incremental.js | 57 +++--- .../noEmit/multiFile/syntax-errors.js | 17 +- ...ntax-errors-with-incremental-as-modules.js | 55 +++--- .../outFile/syntax-errors-with-incremental.js | 48 ++--- .../noEmit/outFile/syntax-errors.js | 12 +- ...tches-config-files-that-are-not-present.js | 10 +- .../when-emitting-buildInfo.js | 171 +++++------------- .../tsc/cancellationToken/when-using-state.js | 11 +- ...file-is-added-to-the-referenced-project.js | 4 +- .../libraryResolution/when-noLib-toggles.js | 4 +- .../tsc/moduleResolution/alternateResult.js | 48 ++--- .../multiFile/dts-errors-with-incremental.js | 20 +- .../semantic-errors-with-incremental.js | 20 +- .../syntax-errors-with-incremental.js | 22 +-- .../outFile/dts-errors-with-incremental.js | 40 ++-- .../semantic-errors-with-incremental.js | 40 ++-- .../outFile/syntax-errors-with-incremental.js | 46 ++--- ...th-incremental-as-modules-discrepancies.js | 128 +++++++------ ...ntax-errors-with-incremental-as-modules.js | 113 +++++++----- ...x-errors-with-incremental-discrepancies.js | 84 ++++----- .../syntax-errors-with-incremental.js | 59 +++--- ...th-incremental-as-modules-discrepancies.js | 50 ----- ...ntax-errors-with-incremental-as-modules.js | 57 +++--- ...x-errors-with-incremental-discrepancies.js | 38 ---- .../outFile/syntax-errors-with-incremental.js | 50 ++--- .../errors-when-declaration-=-false.js | 4 +- ...hen-the-referenced-project-doesnt-exist.js | 4 +- ...eferenced-project-doesnt-have-composite.js | 4 +- .../moduleResolution/alternateResult.js | 48 ++--- ...ntax-errors-with-incremental-as-modules.js | 111 +++++++----- .../syntax-errors-with-incremental.js | 57 +++--- .../noEmit/multiFile/syntax-errors.js | 17 +- ...ntax-errors-with-incremental-as-modules.js | 55 +++--- .../outFile/syntax-errors-with-incremental.js | 48 ++--- .../tscWatch/noEmit/outFile/syntax-errors.js | 12 +- ...file-is-added-to-the-referenced-project.js | 4 +- ...ing-useSourceOfProjectReferenceRedirect.js | 4 +- 68 files changed, 1371 insertions(+), 1476 deletions(-) delete mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js delete mode 100644 tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js delete mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js delete mode 100644 tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 81ea3942c59ec..27dcc5bc2c561 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -59,6 +59,7 @@ import { isJsonSourceFile, isNumber, isString, + map, mapDefinedIterator, maybeBind, noop, @@ -1090,6 +1091,7 @@ export interface IncrementalBuildInfoBase extends BuildInfo { options: CompilerOptions | undefined; semanticDiagnosticsPerFile: IncrementalBuildInfoDiagnostic[] | undefined; emitDiagnosticsPerFile: IncrementalBuildInfoEmitDiagnostic[] | undefined; + changeFileSet: readonly IncrementalBuildInfoFileId[] | undefined; // Because this is only output file in the program, we dont need fileId to deduplicate name latestChangedDtsFile?: string | undefined; errors: true | undefined; @@ -1224,8 +1226,9 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { root, resolvedRoot: toResolvedRoot(), options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions), - semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(), + semanticDiagnosticsPerFile: !state.changedFilesSet.size ? toIncrementalBuildInfoDiagnostics() : undefined, emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(), + changeFileSet: toChangeFileSet(), outSignature: state.outSignature, latestChangedDtsFile, pendingEmit: !state.programEmitPending ? @@ -1321,6 +1324,7 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { referencedMap, semanticDiagnosticsPerFile, emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(), + changeFileSet: toChangeFileSet(), affectedFilesPendingEmit, emitSignatures, latestChangedDtsFile, @@ -1427,7 +1431,7 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { state.fileInfos.forEach((_value, key) => { const value = state.semanticDiagnosticsPerFile.get(key); if (!value) { - result = append(result, toFileId(key)); + if (!state.changedFilesSet.has(key)) result = append(result, toFileId(key)); } else if (value.length) { result = append(result, [ @@ -1507,6 +1511,16 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { return result; }) || array; } + + function toChangeFileSet() { + let changeFileSet: IncrementalBuildInfoFileId[] | undefined; + if (state.changedFilesSet.size) { + for (const path of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) { + changeFileSet = append(changeFileSet, toFileId(path)); + } + } + return changeFileSet; + } } /** @internal */ @@ -2097,6 +2111,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( let filePathsSetList: Set[] | undefined; const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : undefined; const fileInfos = new Map(); + const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath)); if (isIncrementalBundleEmitBuildInfo(buildInfo)) { buildInfo.fileInfos.forEach((fileInfo, index) => { const path = toFilePath(index + 1 as IncrementalBuildInfoFileId); @@ -2108,6 +2123,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile), hasReusableDiagnostic: true, + changedFilesSet, latestChangedDtsFile, outSignature: buildInfo.outSignature, programEmitPending: buildInfo.pendingEmit === undefined ? undefined : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options), @@ -2145,6 +2161,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile), hasReusableDiagnostic: true, + changedFilesSet, affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, value => toFilePath(isNumber(value) ? value : value[0]), value => toBuilderFileEmit(value, fullEmitForOptions!)), latestChangedDtsFile, emitSignatures: emitSignatures?.size ? emitSignatures : undefined, @@ -2206,7 +2223,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( const semanticDiagnostics = new Map( mapDefinedIterator( fileInfos.keys(), - key => [key, emptyArray], + key => !changedFilesSet.has(key) ? [key, emptyArray] : undefined, ), ); diagnostics?.forEach(value => { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 0b26847b20b12..e34c604ee1318 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -5360,8 +5360,6 @@ export function handleNoEmitOptions( ): EmitResult | undefined { const options = program.getCompilerOptions(); if (options.noEmit) { - // Cache the semantic diagnostics - program.getSemanticDiagnostics(sourceFile, cancellationToken); return sourceFile ? emitSkippedWithNoDiagnostics : program.emitBuildInfo(writeFile, cancellationToken); diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index b3bab89503dd7..8f8e2f9b7c8d3 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1511,8 +1511,15 @@ function getUpToDateStatusWorker(state: SolutionBuilde // If there are errors, we need to build project again to report it if ( !project.options.noCheck && - (incrementalBuildInfo.semanticDiagnosticsPerFile?.length || - (!project.options.noEmit && getEmitDeclarations(project.options) && incrementalBuildInfo.emitDiagnosticsPerFile?.length)) + ( + incrementalBuildInfo.changeFileSet?.length || + incrementalBuildInfo.semanticDiagnosticsPerFile?.length || + ( + !project.options.noEmit && + getEmitDeclarations(project.options) && + incrementalBuildInfo.emitDiagnosticsPerFile?.length + ) + ) ) { return { type: UpToDateStatusType.OutOfDateBuildInfoWithErrors, @@ -1523,8 +1530,11 @@ function getUpToDateStatusWorker(state: SolutionBuilde // If there are pending changes that are not emitted, project is out of date if ( !project.options.noEmit && - ((incrementalBuildInfo as IncrementalMultiFileEmitBuildInfo).affectedFilesPendingEmit?.length || - (incrementalBuildInfo as IncrementalBundleEmitBuildInfo).pendingEmit !== undefined) + ( + incrementalBuildInfo.changeFileSet?.length || + (incrementalBuildInfo as IncrementalMultiFileEmitBuildInfo).affectedFilesPendingEmit?.length || + (incrementalBuildInfo as IncrementalBundleEmitBuildInfo).pendingEmit !== undefined + ) ) { return { type: UpToDateStatusType.OutOfDateBuildInfoWithPendingEmit, diff --git a/src/testRunner/unittests/helpers/baseline.ts b/src/testRunner/unittests/helpers/baseline.ts index 767b84078f77e..25a2470d3e376 100644 --- a/src/testRunner/unittests/helpers/baseline.ts +++ b/src/testRunner/unittests/helpers/baseline.ts @@ -136,7 +136,7 @@ export function generateSourceMapBaselineFiles(sys: ts.System & { writtenFiles: } export type ReadableIncrementalBuildInfoDiagnosticOfFile = [file: string, diagnostics: readonly ts.ReusableDiagnostic[]]; -export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached"] | ReadableIncrementalBuildInfoDiagnosticOfFile; +export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached or not changed"] | ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableIncrementalBuildInfoEmitDiagnostic = ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableBuilderFileEmit = string & { __readableBuilderFileEmit: any; }; export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [file: string] | [file: string, emitKind: ts.BuilderFileEmit], emitKind: ReadableBuilderFileEmit]; @@ -161,12 +161,14 @@ export type ReadableIncrementalBuildInfoBase = | "resolvedRoot" | "semanticDiagnosticsPerFile" | "emitDiagnosticsPerFile" + | "changeFileSet" > & { root: readonly ReadableIncrementalBuildInfoRoot[]; resolvedRoot: readonly ReadableIncrementalBuildInfoResolvedRoot[] | undefined; semanticDiagnosticsPerFile: readonly ReadableIncrementalBuildInfoDiagnostic[] | undefined; emitDiagnosticsPerFile: readonly ReadableIncrementalBuildInfoEmitDiagnostic[] | undefined; + changeFileSet: readonly string[] | undefined; } & ReadableBuildInfo; export type ReadableIncrementalMultiFileEmitBuildInfo = @@ -179,6 +181,7 @@ export type ReadableIncrementalMultiFileEmitBuildInfo = | "referencedMap" | "semanticDiagnosticsPerFile" | "emitDiagnosticsPerFile" + | "changeFileSet" | "affectedFilesPendingEmit" | "emitSignatures" > @@ -199,6 +202,7 @@ export type ReadableIncrementalBundleEmitBuildInfo = | "resolvedRoot" | "semanticDiagnosticsPerFile" | "emitDiagnosticsPerFile" + | "changeFileSet" | "pendingEmit" > & ReadableIncrementalBuildInfoBase @@ -247,6 +251,7 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI resolvedRoot: buildInfo.resolvedRoot?.map(toReadableIncrementalBuildInfoResolvedRoot), semanticDiagnosticsPerFile: toReadableIncrementalBuildInfoDiagnostic(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toReadableIncrementalBuildInfoEmitDiagnostic(buildInfo.emitDiagnosticsPerFile), + changeFileSet: buildInfo.changeFileSet?.map(toFileName), pendingEmit: pendingEmit === undefined ? undefined : [ @@ -271,6 +276,7 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI referencedMap: toMapOfReferencedSet(buildInfo.referencedMap), semanticDiagnosticsPerFile: toReadableIncrementalBuildInfoDiagnostic(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toReadableIncrementalBuildInfoEmitDiagnostic(buildInfo.emitDiagnosticsPerFile), + changeFileSet: buildInfo.changeFileSet?.map(toFileName), affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit?.map(value => toReadableIncrementalBuilderInfoFilePendingEmit(value, fullEmitForOptions!)), emitSignatures: buildInfo.emitSignatures?.map(s => ts.isNumber(s) ? @@ -368,7 +374,7 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI ): readonly ReadableIncrementalBuildInfoDiagnostic[] | undefined { return diagnostics?.map(d => ts.isNumber(d) ? - [toFileName(d), "not cached"] : + [toFileName(d), "not cached or not changed"] : [toFileName(d[0]), d[1]] ); } diff --git a/src/testRunner/unittests/helpers/noEmit.ts b/src/testRunner/unittests/helpers/noEmit.ts index 3a84f210eb3ac..f4c151ae44e35 100644 --- a/src/testRunner/unittests/helpers/noEmit.ts +++ b/src/testRunner/unittests/helpers/noEmit.ts @@ -271,12 +271,12 @@ function forEachNoEmitAndErrorsWorker( fsContents: FsContents, aTsContent: string, fixedATsContent: string, - compilerOptions: object, + compilerOptions: CompilerOptions, ) => void, ) { [false, true].forEach(asModules => [undefined, true].forEach(incremental => - [{}, { outFile: "../outFile.js", module: asModules ? "amd" : undefined }].forEach(options => { + [{}, { outFile: "../outFile.js", module: asModules ? ModuleKind.AMD : undefined }].forEach(options => { if (!incremental && asModules) return; // Not the interesting case const aContent = asModules ? `export ${aTsContent}` : aTsContent; const compilerOptions = { @@ -287,7 +287,7 @@ function forEachNoEmitAndErrorsWorker( const fsContents: FsContents = { "/home/src/projects/project/a.ts": aContent, "/home/src/projects/project/tsconfig.json": jsonToReadableText({ - compilerOptions, + compilerOptions: compilerOptionsToConfigJson(compilerOptions), }), }; if (asModules) fsContents["/home/src/projects/project/b.ts"] = `export const b = 10;`; @@ -309,7 +309,7 @@ function forEachNoEmitAndErrors( fsContents: FsContents, aTsContent: string, fixedATsContent: string, - compilerOptions: object, + compilerOptions: CompilerOptions, ) => void, ) { forEachNoEmitAndErrorsWorker( @@ -335,7 +335,7 @@ function forEachNoEmitAndErrors( } export function forEachNoEmitTsc(commandType: string[]) { - forEachNoEmitAndErrors((subScenario, fsContents, aTsContent, fixedATsContent) => + forEachNoEmitAndErrors((subScenario, fsContents, aTsContent, fixedATsContent, compilerOptions) => verifyTsc({ scenario: "noEmit", subScenario, @@ -357,13 +357,21 @@ export function forEachNoEmitTsc(commandType: string[]) { { caption: "Introduce error", edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", aTsContent), + discrepancyExplanation: compilerOptions.incremental && subScenario.indexOf("multiFile/syntax") !== -1 ? () => [ + "DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version", + ] : undefined, }, { caption: "Emit when error", edit: noop, commandLineArgs: [...commandType, "/home/src/projects/project"], }, - noChangeRun, + compilerOptions.incremental && subScenario.indexOf("multiFile/syntax") !== -1 ? { + ...noChangeRun, + discrepancyExplanation: () => [ + "DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version", + ], + } : noChangeRun, ], baselinePrograms: true, }) @@ -378,10 +386,10 @@ export function forEachNoEmitTscWatch(commandType: string[]) { commandLineArgs: [...commandType, "/home/src/projects/project", "-w"], sys: () => { fsContents["/home/src/projects/project/tsconfig.json"] = jsonToReadableText({ - compilerOptions: { + compilerOptions: compilerOptionsToConfigJson({ ...compilerOptions, noEmit: true, - }, + }), }); fsContents[libFile.path] = libContent; return createWatchedSystem(fsContents); @@ -394,7 +402,13 @@ export function forEachNoEmitTscWatch(commandType: string[]) { }, { caption: "Emit after fixing error", - edit: sys => sys.writeFile("/home/src/projects/project/tsconfig.json", jsonToReadableText({ compilerOptions })), + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + ), timeouts: sys => sys.runQueuedTimeoutCallbacks(), }, { @@ -403,10 +417,10 @@ export function forEachNoEmitTscWatch(commandType: string[]) { sys.writeFile( "/home/src/projects/project/tsconfig.json", jsonToReadableText({ - compilerOptions: { + compilerOptions: compilerOptionsToConfigJson({ ...compilerOptions, noEmit: true, - }, + }), }), ), timeouts: sys => sys.runQueuedTimeoutCallbacks(), @@ -418,7 +432,13 @@ export function forEachNoEmitTscWatch(commandType: string[]) { }, { caption: "Emit when error", - edit: sys => sys.writeFile("/home/src/projects/project/tsconfig.json", jsonToReadableText({ compilerOptions })), + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + ), timeouts: sys => sys.runQueuedTimeoutCallbacks(), }, { @@ -427,10 +447,10 @@ export function forEachNoEmitTscWatch(commandType: string[]) { sys.writeFile( "/home/src/projects/project/tsconfig.json", jsonToReadableText({ - compilerOptions: { + compilerOptions: compilerOptionsToConfigJson({ ...compilerOptions, noEmit: true, - }, + }), }), ), timeouts: sys => sys.runQueuedTimeoutCallbacks(), diff --git a/src/testRunner/unittests/helpers/tsc.ts b/src/testRunner/unittests/helpers/tsc.ts index 92ae893bb50db..078b7bc74e131 100644 --- a/src/testRunner/unittests/helpers/tsc.ts +++ b/src/testRunner/unittests/helpers/tsc.ts @@ -298,12 +298,18 @@ function verifyTscEditDiscrepancies({ (cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.fileInfos, (key, incrementalFileInfo, cleanFileInfo) => { const dtsForKey = dtsSignaures?.get(key); - if (!incrementalFileInfo || !cleanFileInfo || incrementalFileInfo.signature !== cleanFileInfo.signature && (dtsForKey === undefined || incrementalFileInfo.signature !== dtsForKey)) { + if ( + !incrementalFileInfo || + !cleanFileInfo || + incrementalFileInfo.signature !== cleanFileInfo.signature && + incrementalFileInfo.signature !== cleanFileInfo.version && + (dtsForKey === undefined || incrementalFileInfo.signature !== dtsForKey) + ) { return [ `Incremental signature is neither dts signature nor file version for File:: ${key}`, `Incremental:: ${jsonToReadableText(incrementalFileInfo)}`, `Clean:: ${jsonToReadableText(cleanFileInfo)}`, - `Dts Signature:: $${jsonToReadableText(dtsForKey)}`, + `Dts Signature:: ${jsonToReadableText(dtsForKey)}`, ]; } }, @@ -312,32 +318,21 @@ function verifyTscEditDiscrepancies({ if (isReadableIncrementalMultiFileEmitBuildInfo(incrementalReadableBuildInfo)) { ts.Debug.assert(!isReadableIncrementalBundleEmitBuildInfo(cleanReadableBuildInfo)); // Verify that incrementally pending affected file emit are in clean build since clean build can contain more files compared to incremental depending of noEmitOnError option - if (incrementalReadableBuildInfo.affectedFilesPendingEmit) { - if ((cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.affectedFilesPendingEmit === undefined) { + incrementalReadableBuildInfo.affectedFilesPendingEmit?.forEach(([actualFileOrArray]) => { + const actualFile = ts.isString(actualFileOrArray) ? actualFileOrArray : actualFileOrArray[0]; + if ( + !ts.find( + (cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.affectedFilesPendingEmit, + ([expectedFileOrArray]) => actualFile === (ts.isString(expectedFileOrArray) ? expectedFileOrArray : expectedFileOrArray[0]), + ) + ) { addBaseline( - `Incremental build contains affectedFilesPendingEmit, clean build does not have it: ${outputFile}::`, + `Incremental build contains ${actualFile} file as pending emit, clean build does not have it: ${outputFile}::`, `Incremental buildInfoText:: ${incrementalBuildText}`, `Clean buildInfoText:: ${cleanBuildText}`, ); } - let expectedIndex = 0; - incrementalReadableBuildInfo.affectedFilesPendingEmit.forEach(([actualFileOrArray]) => { - const actualFile = ts.isString(actualFileOrArray) ? actualFileOrArray : actualFileOrArray[0]; - expectedIndex = ts.findIndex( - (cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.affectedFilesPendingEmit, - ([expectedFileOrArray]) => actualFile === (ts.isString(expectedFileOrArray) ? expectedFileOrArray : expectedFileOrArray[0]), - expectedIndex, - ); - if (expectedIndex === -1) { - addBaseline( - `Incremental build contains ${actualFile} file as pending emit, clean build does not have it: ${outputFile}::`, - `Incremental buildInfoText:: ${incrementalBuildText}`, - `Clean buildInfoText:: ${cleanBuildText}`, - ); - } - expectedIndex++; - }); - } + }); } else { ts.Debug.assert(!isReadableIncrementalMultiFileEmitBuildInfo(cleanReadableBuildInfo)); @@ -354,6 +349,20 @@ function verifyTscEditDiscrepancies({ } const readableIncrementalBuildInfo = incrementalReadableBuildInfo as ReadableIncrementalBuildInfo | undefined; const readableCleanBuildInfo = cleanReadableBuildInfo as ReadableIncrementalBuildInfo | undefined; + readableIncrementalBuildInfo?.changeFileSet?.forEach(actualFile => { + if ( + !ts.find( + readableCleanBuildInfo?.changeFileSet, + expectedFile => actualFile === expectedFile, + ) + ) { + addBaseline( + `Incremental build contains ${actualFile} file in changeFileSet, clean build does not have it: ${outputFile}::`, + `Incremental buildInfoText:: ${incrementalBuildText}`, + `Clean buildInfoText:: ${cleanBuildText}`, + ); + } + }); readableIncrementalBuildInfo?.semanticDiagnosticsPerFile?.forEach(( [actualFile, notCachedORDiagnostics], ) => { @@ -362,7 +371,17 @@ function verifyTscEditDiscrepancies({ ([expectedFile]) => actualFile === expectedFile, ); // Incremental build should have same diagnostics as clean build - if (cleanFileDiagnostics && JSON.stringify(notCachedORDiagnostics) === JSON.stringify(cleanFileDiagnostics[1])) return; + if ( + cleanFileDiagnostics && + JSON.stringify(notCachedORDiagnostics) === JSON.stringify(cleanFileDiagnostics[1]) + ) return; + // If the diagnostics are marked as not cached in incremental build, + // and clean build doesnt mark it that way because its in its change file set, its ok + if ( + !cleanFileDiagnostics && + ts.isString(notCachedORDiagnostics) && + ts.contains(readableCleanBuildInfo?.changeFileSet, actualFile) + ) return; // Otherwise marked as "not Cached" in clean build with errors in incremental build is ok if ( ts.isString(cleanFileDiagnostics?.[1]) && @@ -509,6 +528,7 @@ function getBuildInfoForIncrementalCorrectnessCheck(text: string | undefined): { emitDiagnosticsPerFile: undefined, latestChangedDtsFile: readableBuildInfo.latestChangedDtsFile ? "FakeFileName" : undefined, semanticDiagnosticsPerFile: undefined, + changeFileSet: undefined, } : undefined), size: undefined, // Size doesnt need to be equal }), diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js index e9a403c6dba0a..f396a45bfbda3 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js @@ -294,19 +294,19 @@ sourceFile:file4.ts "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../lib/module.d.ts", - "not cached" + "not cached or not changed" ], [ "./file3.ts", - "not cached" + "not cached or not changed" ], [ "./file4.ts", - "not cached" + "not cached or not changed" ] ], "outSignature": "-23302177839-declare module \"file3\" {\n export const z = 30;\n}\ndeclare const myVar = 30;\n", diff --git a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js index bce8eb5a8d6e4..8722ad0616b2d 100644 --- a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -369,27 +369,27 @@ export declare const g = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -962,27 +962,27 @@ exports.g = b_1.b; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js index 7574186a74135..3cf42df1f8e07 100644 --- a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -367,27 +367,27 @@ export declare const g = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -920,27 +920,27 @@ export declare const aaa = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1270,27 +1270,27 @@ exports.g = b_1.b; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2012,27 +2012,27 @@ export declare const aaaaa = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2340,27 +2340,27 @@ exports.a2 = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js index 5752ed4eb3f46..fb8b51e87275a 100644 --- a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -262,23 +262,23 @@ declare module "g" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -704,23 +704,23 @@ define("g", ["require", "exports", "b"], function (require, exports, b_1) { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js index 2a57d8b3ae4d3..a4685b9e70d32 100644 --- a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -260,23 +260,23 @@ declare module "g" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -676,23 +676,23 @@ declare module "d" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -918,23 +918,23 @@ define("g", ["require", "exports", "b"], function (require, exports, b_1) { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1503,23 +1503,23 @@ declare module "d" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1756,23 +1756,23 @@ define("d", ["require", "exports", "b"], function (require, exports, b_1) { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js index 2f6f44ae81f6f..2b8ec7f8baafb 100644 --- a/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js @@ -146,15 +146,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -298,15 +298,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -572,7 +572,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -828,7 +828,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1201,7 +1201,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1353,7 +1353,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js index 000ede0aa7fb8..0db2beabf0352 100644 --- a/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js @@ -141,15 +141,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -273,15 +273,15 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -532,7 +532,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -771,7 +771,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1129,7 +1129,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1264,7 +1264,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js index 85f585dcf114a..8c140292d9402 100644 --- a/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js @@ -149,15 +149,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -284,15 +284,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -554,7 +554,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -677,7 +677,7 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -788,7 +788,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1157,7 +1157,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1295,7 +1295,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js index 182e55c469099..508d4c8ee1f81 100644 --- a/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js @@ -128,15 +128,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -274,15 +274,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -518,15 +518,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -754,15 +754,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1105,19 +1105,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -1244,19 +1244,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js index d9bdf4d0876b1..947872b0eaf31 100644 --- a/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js @@ -124,15 +124,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -242,15 +242,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -468,15 +468,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -684,15 +684,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1014,19 +1014,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1130,19 +1130,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js index 4e166f4382a2e..94f814560585f 100644 --- a/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js @@ -132,15 +132,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -256,15 +256,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -496,15 +496,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -608,15 +608,15 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -715,15 +715,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1062,19 +1062,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1187,19 +1187,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js index 537ca4e8d4032..c64d714e303a6 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -1,56 +1,72 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-14000546910-export const a = \"hello" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-14000546910-export const a = \"hello" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js index bbe302d529ea9..c161e69c35405 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -64,19 +64,13 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) -/home/src/projects/project/b.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[2,3,1],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -89,19 +83,25 @@ Shape signatures in builder refreshed for:: "../../../../lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { - "version": "-14000546910-export const a = \"hello", - "signature": "-14000546910-export const a = \"hello" + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" }, "./b.ts": { - "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" } }, "root": [ @@ -114,19 +114,13 @@ Shape signatures in builder refreshed for:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ], - [ - "./b.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts", + "./b.ts", + "../../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 715 + "size": 770 } @@ -169,7 +163,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -210,14 +204,18 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts /home/src/projects/project/a.ts +/home/src/projects/project/b.ts Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) +/lib/lib.d.ts (used version) //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -245,8 +243,12 @@ Shape signatures in builder refreshed for:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -270,7 +272,7 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 780 + "size": 849 } @@ -340,7 +342,7 @@ exports.b = 10; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -368,8 +370,12 @@ exports.b = 10; "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -383,7 +389,7 @@ exports.b = 10; ] ], "version": "FakeTSVersion", - "size": 747 + "size": 816 } @@ -448,12 +454,11 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -481,8 +486,12 @@ Shape signatures in builder refreshed for:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -495,15 +504,11 @@ Shape signatures in builder refreshed for:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 789 + "size": 833 } @@ -546,8 +551,10 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) //// [/home/src/projects/project/a.js] @@ -558,7 +565,7 @@ exports.a = "hello; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -586,8 +593,12 @@ exports.a = "hello; "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -600,9 +611,14 @@ exports.a = "hello; "./b.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 758 + "size": 846 } @@ -646,6 +662,7 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js index 7f5eda498959b..9d051064d9d0f 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js @@ -1,44 +1,46 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "2464268576-const a = \"hello", - "affectsGlobalScope": true - } +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "version": "FakeTSVersion" + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true } -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "2464268576-const a = \"hello", - "affectsGlobalScope": true - } +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true +} +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js index c06f8b0ceabac..5153fdee483f6 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js @@ -59,17 +59,13 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[2,1],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -81,19 +77,19 @@ Shape signatures in builder refreshed for:: "../../../../lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { "original": { "version": "2464268576-const a = \"hello", + "signature": false, "affectsGlobalScope": true }, "version": "2464268576-const a = \"hello", - "signature": "2464268576-const a = \"hello", "affectsGlobalScope": true } }, @@ -103,15 +99,12 @@ Shape signatures in builder refreshed for:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts", + "../../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 695 + "size": 708 } @@ -152,7 +145,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -196,6 +189,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (computed .d.ts) +/lib/lib.d.ts (used version) //// [/home/src/projects/project/tsconfig.tsbuildinfo] @@ -398,12 +392,11 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -438,15 +431,11 @@ Shape signatures in builder refreshed for:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 752 + "size": 727 } @@ -487,8 +476,10 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) //// [/home/src/projects/project/a.js] @@ -496,7 +487,7 @@ var a = "hello; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -531,9 +522,14 @@ var a = "hello; "./a.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 721 + "size": 740 } @@ -575,6 +571,7 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js index f24c1e0fc5047..99f86c6c2361f 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js @@ -56,13 +56,9 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] @@ -115,13 +111,9 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents @@ -318,13 +310,9 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] @@ -426,13 +414,9 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js deleted file mode 100644 index c9f7d1572e791..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js +++ /dev/null @@ -1,50 +0,0 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-14000546910-export const a = \"hello", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-14000546910-export const a = \"hello", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js index a2904169c3e11..2c0120f536633 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -68,16 +68,13 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2,3,1],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -105,13 +102,13 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts", + "./project/b.ts", + "../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 725 + "size": 715 } @@ -156,7 +153,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -406,16 +403,13 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -443,13 +437,11 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 725 + "size": 711 } @@ -493,7 +485,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -514,7 +506,7 @@ define("b", ["require", "exports"], function (require, exports) { //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -542,9 +534,22 @@ define("b", ["require", "exports"], function (require, exports) { "module": 2, "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 705 + "size": 728 } @@ -589,7 +594,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js deleted file mode 100644 index f7e3f91ee9340..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js +++ /dev/null @@ -1,38 +0,0 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "2464268576-const a = \"hello" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "2464268576-const a = \"hello" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js index 47827ede78bd6..d7758f7775a15 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js @@ -61,15 +61,13 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2,1],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -90,13 +88,12 @@ No shapes updated in the builder:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts", + "../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 650 + "size": 638 } @@ -138,7 +135,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -353,15 +350,13 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -382,13 +377,11 @@ No shapes updated in the builder:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 650 + "size": 636 } @@ -429,7 +422,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -439,7 +432,7 @@ var a = "hello; //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -460,9 +453,18 @@ var a = "hello; "options": { "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 630 + "size": 651 } @@ -504,7 +506,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js index 8687a80b0ecc8..deff88ac9ea92 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js @@ -59,9 +59,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -117,9 +115,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -316,9 +312,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -422,9 +416,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index b306ec35b3f00..7232eb9ca02e7 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -117,15 +117,15 @@ exports.x = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/index.ts", - "not cached" + "not cached or not changed" ], [ "./types/type.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./types/type.d.ts", diff --git a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js index 0f3994fcc2835..8514a056595df 100644 --- a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js +++ b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js @@ -210,15 +210,15 @@ function multiply(a, b) { return a * b; } "semanticDiagnosticsPerFile": [ [ "../../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.ts", - "not cached" + "not cached or not changed" ], [ "./some_decl.d.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./index.d.ts", diff --git a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js index 1205bcc402ec9..6868f16652c74 100644 --- a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js +++ b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js @@ -210,15 +210,15 @@ function multiply(a, b) { return a * b; } "semanticDiagnosticsPerFile": [ [ "../../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.ts", - "not cached" + "not cached or not changed" ], [ "./some_decl.d.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./index.d.ts", diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js index 4dc1e67e2a64d..a26c0ea9a2d28 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -52,7 +52,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -65,19 +65,25 @@ Output:: "../../../../a/lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { - "version": "-14000546910-export const a = \"hello", - "signature": "-14000546910-export const a = \"hello" + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" }, "./b.ts": { - "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" } }, "root": [ @@ -90,19 +96,13 @@ Output:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ], - [ - "./b.ts", - "Js" - ] + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 717 + "size": 772 } @@ -135,15 +135,9 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) -/home/src/projects/project/b.ts (used version) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -175,7 +169,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -203,8 +197,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -228,7 +226,7 @@ Output:: ] ], "version": "FakeTSVersion", - "size": 782 + "size": 851 } @@ -251,10 +249,14 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts /home/src/projects/project/a.ts +/home/src/projects/project/b.ts Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) /home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -290,7 +292,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -318,8 +320,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -333,7 +339,7 @@ Output:: ] ], "version": "FakeTSVersion", - "size": 749 + "size": 818 } //// [/home/src/projects/project/a.js] @@ -464,7 +470,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -492,8 +498,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -506,15 +516,11 @@ Output:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 791 + "size": 835 } @@ -539,8 +545,7 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -581,7 +586,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -609,8 +614,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -623,9 +632,14 @@ Output:: "./b.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 760 + "size": 848 } //// [/home/src/projects/project/a.js] @@ -654,8 +668,10 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -716,6 +732,7 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js index 236d93b3319be..c9b930d15768d 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js @@ -49,7 +49,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -61,19 +61,19 @@ Output:: "../../../../a/lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { "original": { "version": "2464268576-const a = \"hello", + "signature": false, "affectsGlobalScope": true }, "version": "2464268576-const a = \"hello", - "signature": "2464268576-const a = \"hello", "affectsGlobalScope": true } }, @@ -83,15 +83,12 @@ Output:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 697 + "size": 710 } @@ -120,13 +117,9 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -225,6 +218,7 @@ Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) /home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -414,7 +408,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -449,15 +443,11 @@ Output:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 754 + "size": 729 } @@ -480,8 +470,7 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -522,7 +511,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -557,9 +546,14 @@ Output:: "./a.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 723 + "size": 742 } //// [/home/src/projects/project/a.js] @@ -583,8 +577,10 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -643,6 +639,7 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js index 4e6a8f5368a5a..bf02fbc07707a 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js @@ -85,13 +85,9 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -155,6 +151,7 @@ Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) /home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -332,8 +329,7 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -393,8 +389,10 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -451,6 +449,7 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js index e04d0067a56e8..b1a813a166ec0 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -54,7 +54,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -82,13 +82,13 @@ Output:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 727 + "size": 717 } @@ -123,10 +123,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -427,7 +424,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -455,13 +452,11 @@ Output:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 727 + "size": 713 } @@ -485,10 +480,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -533,7 +525,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -561,9 +553,22 @@ Output:: "module": 2, "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 707 + "size": 730 } //// [/home/src/projects/outFile.js] @@ -601,7 +606,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -667,7 +672,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js index 9d17112e829c5..eaf9b3de72367 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js @@ -50,7 +50,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -71,13 +71,12 @@ Output:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 652 + "size": 640 } @@ -107,9 +106,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -373,7 +370,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -394,13 +391,11 @@ Output:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 652 + "size": 638 } @@ -421,9 +416,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -467,7 +460,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -488,9 +481,18 @@ Output:: "options": { "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 632 + "size": 653 } //// [/home/src/projects/outFile.js] @@ -514,7 +516,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -576,7 +578,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js index e87b86d92e4cc..53e695a99426a 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js @@ -87,9 +87,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -335,9 +333,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -401,7 +397,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -461,7 +457,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js b/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js index 579b229a02948..144f299a0df67 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js @@ -321,23 +321,23 @@ export declare const m: typeof mod; "semanticDiagnosticsPerFile": [ [ "../../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../core/index.d.ts", - "not cached" + "not cached or not changed" ], [ "../core/anothermodule.d.ts", - "not cached" + "not cached or not changed" ], [ "../logic/index.ts", - "not cached" + "not cached or not changed" ], [ "./index.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./index.d.ts", diff --git a/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js b/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js index bd7d0b0f629d6..c1b71f2d6ce45 100644 --- a/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js +++ b/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js @@ -256,7 +256,7 @@ Operation ws cancelled:: true //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -343,14 +343,11 @@ Operation ws cancelled:: true "./c.ts" ] }, - "semanticDiagnosticsPerFile": [ - [ - "./c.ts", - "not cached" - ] + "changeFileSet": [ + "./c.ts" ], "version": "FakeTSVersion", - "size": 1283 + "size": 1270 } @@ -384,8 +381,34 @@ Change:: Normal build Input:: +//// [/user/username/projects/myproject/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.C = void 0; +exports.foo = foo; +exports.C = /** @class */ (function () { + function CReal() { + this.d = 1; + } + return CReal; +}()); +function foo() { } + + +//// [/user/username/projects/myproject/c.d.ts] +export declare var C: { + new (): { + d: number; + }; +}; +export declare function foo(): void; + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -417,10 +440,10 @@ Input:: "./c.ts": { "original": { "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n" + "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" }, "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n" + "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" }, "./b.ts": { "original": { @@ -473,7 +496,7 @@ Input:: ] }, "version": "FakeTSVersion", - "size": 1250 + "size": 1287 } @@ -498,8 +521,13 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/c.ts (computed .d.ts) +/user/username/projects/myproject/b.ts (computed .d.ts) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) exitCode:: ExitStatus.undefined @@ -507,127 +535,16 @@ Change:: Clean build Input:: -//// [/user/username/projects/myproject/c.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.C = void 0; -exports.foo = foo; -exports.C = /** @class */ (function () { - function CReal() { - this.d = 1; - } - return CReal; -}()); -function foo() { } - - -//// [/user/username/projects/myproject/c.d.ts] -export declare var C: { - new (): { - d: number; - }; -}; -export declare function foo(): void; - - +//// [/user/username/projects/myproject/c.js] file written with same contents +//// [/user/username/projects/myproject/c.d.ts] file written with same contents //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.js] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/d.js] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./c.ts", - "./b.ts", - "./a.ts", - "./d.ts" - ], - "fileIdsList": [ - [ - "./b.ts" - ], - [ - "./c.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "original": { - "version": "-7698705165-/// \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; }", - "affectsGlobalScope": true - }, - "version": "-7698705165-/// \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; }", - "signature": "-7698705165-/// \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; }", - "affectsGlobalScope": true - }, - "./c.ts": { - "original": { - "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" - }, - "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" - }, - "./b.ts": { - "original": { - "version": "-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}", - "signature": "-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n" - }, - "version": "-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}", - "signature": "-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n" - }, - "./a.ts": { - "original": { - "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "-3531856636-export {};\n" - }, - "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "-3531856636-export {};\n" - }, - "./d.ts": { - "original": { - "version": "-7804761415-export class D { }", - "signature": "-8611429667-export declare class D {\n}\n" - }, - "version": "-7804761415-export class D { }", - "signature": "-8611429667-export declare class D {\n}\n" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./c.ts", - "./b.ts", - "./a.ts", - "./d.ts" - ] - ] - ], - "options": { - "declaration": true - }, - "referencedMap": { - "./a.ts": [ - "./b.ts" - ], - "./b.ts": [ - "./c.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1287 -} - +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Program root files: [ "/user/username/projects/myproject/a.ts", diff --git a/tests/baselines/reference/tsc/cancellationToken/when-using-state.js b/tests/baselines/reference/tsc/cancellationToken/when-using-state.js index a19074b6ee326..e401a1d0123d8 100644 --- a/tests/baselines/reference/tsc/cancellationToken/when-using-state.js +++ b/tests/baselines/reference/tsc/cancellationToken/when-using-state.js @@ -256,7 +256,7 @@ Operation ws cancelled:: true //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -343,14 +343,11 @@ Operation ws cancelled:: true "./c.ts" ] }, - "semanticDiagnosticsPerFile": [ - [ - "./c.ts", - "not cached" - ] + "changeFileSet": [ + "./c.ts" ], "version": "FakeTSVersion", - "size": 1283 + "size": 1270 } diff --git a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js index 63d85312cd294..b4104dc3ffc22 100644 --- a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js @@ -385,11 +385,11 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated "semanticDiagnosticsPerFile": [ [ "../project1/class1.d.ts", - "not cached" + "not cached or not changed" ], [ "./class2.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./class2.d.ts", diff --git a/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js b/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js index f143d7bb7aacb..85d12f97ddfdf 100644 --- a/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js +++ b/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js @@ -254,11 +254,11 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "./a.d.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js index ed6ecc8a79b32..c4cd0a925744b 100644 --- a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -461,19 +461,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1682,23 +1682,23 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1972,27 +1972,27 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2290,23 +2290,23 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2621,19 +2621,19 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js index 64b3ac7202b89..8ac646bbe7409 100644 --- a/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js @@ -139,15 +139,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -307,15 +307,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -611,7 +611,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -877,7 +877,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1229,7 +1229,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1374,7 +1374,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js index cd489f67e805b..988534557d630 100644 --- a/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js @@ -134,15 +134,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -274,15 +274,15 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -563,7 +563,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -804,7 +804,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1141,7 +1141,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1269,7 +1269,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js index 6ba0dc278841c..241d24b640de7 100644 --- a/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js @@ -142,15 +142,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -293,15 +293,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -593,7 +593,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -733,7 +733,7 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -837,7 +837,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1185,7 +1185,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1316,7 +1316,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js index 847da3c02eef1..bc64ad79f1fd3 100644 --- a/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js @@ -121,15 +121,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -285,15 +285,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -565,15 +565,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -812,15 +812,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1142,19 +1142,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -1274,19 +1274,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js index 6b6b8e7c6b040..dec9376c9ef9a 100644 --- a/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js @@ -117,15 +117,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -245,15 +245,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -507,15 +507,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -726,15 +726,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1035,19 +1035,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1144,19 +1144,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js index 28fe71ecec3bc..f47216ccfcb7d 100644 --- a/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js @@ -125,15 +125,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -267,15 +267,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -543,15 +543,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -673,15 +673,15 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -773,15 +773,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1099,19 +1099,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1217,19 +1217,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js index 537ca4e8d4032..c64d714e303a6 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -1,56 +1,72 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-14000546910-export const a = \"hello" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-14000546910-export const a = \"hello" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js index f0ccfd69dac8a..af2ab2c1637e3 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -57,19 +57,13 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) -/home/src/projects/project/b.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[2,3,1],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -82,19 +76,25 @@ Shape signatures in builder refreshed for:: "../../../../lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { - "version": "-14000546910-export const a = \"hello", - "signature": "-14000546910-export const a = \"hello" + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" }, "./b.ts": { - "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" } }, "root": [ @@ -107,19 +107,13 @@ Shape signatures in builder refreshed for:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ], - [ - "./b.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts", + "./b.ts", + "../../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 715 + "size": 770 } @@ -155,7 +149,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -189,14 +183,18 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts /home/src/projects/project/a.ts +/home/src/projects/project/b.ts Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) +/lib/lib.d.ts (used version) //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -224,8 +222,12 @@ Shape signatures in builder refreshed for:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -249,7 +251,7 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 780 + "size": 849 } @@ -326,7 +328,7 @@ exports.b = 10; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -354,8 +356,12 @@ exports.b = 10; "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -369,7 +375,7 @@ exports.b = 10; ] ], "version": "FakeTSVersion", - "size": 747 + "size": 816 } @@ -441,12 +447,11 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -474,8 +479,12 @@ Shape signatures in builder refreshed for:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -488,15 +497,11 @@ Shape signatures in builder refreshed for:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 789 + "size": 833 } @@ -532,8 +537,10 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) //// [/home/src/projects/project/a.js] @@ -544,7 +551,7 @@ exports.a = "hello; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -572,8 +579,12 @@ exports.a = "hello; "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -586,9 +597,14 @@ exports.a = "hello; "./b.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 758 + "size": 846 } @@ -625,6 +641,7 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js index 7f5eda498959b..9d051064d9d0f 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js @@ -1,44 +1,46 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "2464268576-const a = \"hello", - "affectsGlobalScope": true - } +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "version": "FakeTSVersion" + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true } -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "2464268576-const a = \"hello", - "affectsGlobalScope": true - } +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true +} +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js index 333db88b2d8d0..362d2ab1206fa 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js @@ -52,17 +52,13 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[2,1],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -74,19 +70,19 @@ Shape signatures in builder refreshed for:: "../../../../lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { "original": { "version": "2464268576-const a = \"hello", + "signature": false, "affectsGlobalScope": true }, "version": "2464268576-const a = \"hello", - "signature": "2464268576-const a = \"hello", "affectsGlobalScope": true } }, @@ -96,15 +92,12 @@ Shape signatures in builder refreshed for:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts", + "../../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 695 + "size": 708 } @@ -138,7 +131,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -175,6 +168,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (computed .d.ts) +/lib/lib.d.ts (used version) //// [/home/src/projects/project/tsconfig.tsbuildinfo] @@ -387,12 +381,11 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -427,15 +420,11 @@ Shape signatures in builder refreshed for:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 752 + "size": 727 } @@ -469,8 +458,10 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) //// [/home/src/projects/project/a.js] @@ -478,7 +469,7 @@ var a = "hello; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -513,9 +504,14 @@ var a = "hello; "./a.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 721 + "size": 740 } @@ -550,6 +546,7 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js deleted file mode 100644 index c9f7d1572e791..0000000000000 --- a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules-discrepancies.js +++ /dev/null @@ -1,50 +0,0 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-14000546910-export const a = \"hello", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-14000546910-export const a = \"hello", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js index 8212ccbeda118..9cad28bb9c3e5 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -61,16 +61,13 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2,3,1],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -98,13 +95,13 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts", + "./project/b.ts", + "../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 725 + "size": 715 } @@ -142,7 +139,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -403,16 +400,13 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -440,13 +434,11 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 725 + "size": 711 } @@ -483,7 +475,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -504,7 +496,7 @@ define("b", ["require", "exports"], function (require, exports) { //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -532,9 +524,22 @@ define("b", ["require", "exports"], function (require, exports) { "module": 2, "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 705 + "size": 728 } @@ -572,7 +577,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js deleted file mode 100644 index f7e3f91ee9340..0000000000000 --- a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-discrepancies.js +++ /dev/null @@ -1,38 +0,0 @@ -6:: Emit when error -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "2464268576-const a = \"hello" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "2464268576-const a = \"hello" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "errors": true, - "version": "FakeTSVersion" -} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js index 364f688275082..864f1fdff4f37 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js @@ -54,15 +54,13 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2,1],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -83,13 +81,12 @@ No shapes updated in the builder:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts", + "../../../lib/lib.d.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 650 + "size": 638 } @@ -124,7 +121,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -344,15 +341,13 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -373,13 +368,11 @@ No shapes updated in the builder:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 650 + "size": 636 } @@ -413,7 +406,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -423,7 +416,7 @@ var a = "hello; //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -444,9 +437,18 @@ var a = "hello; "options": { "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 630 + "size": 651 } @@ -481,7 +483,7 @@ Program files:: /lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js index 64ac0c89f1e1a..ab744c69527e5 100644 --- a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js @@ -94,11 +94,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../a.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./a.d.ts", diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js index 3675089c127a7..15f94406b70a4 100644 --- a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js @@ -100,11 +100,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../a.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./a.d.ts", diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js index 7f7d445a2bbd5..3a8191e97e687 100644 --- a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js @@ -115,11 +115,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../b.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./b.d.ts", diff --git a/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js b/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js index d150b7613d9d6..c9a1190333dc7 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js @@ -453,19 +453,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1360,23 +1360,23 @@ File '/package.json' does not exist according to earlier cached lookups. "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1654,27 +1654,27 @@ Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/node_modu "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1992,23 +1992,23 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modu "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2289,19 +2289,19 @@ FileWatcher:: Close:: WatchInfo: /home/src/projects/project/node_modules/foo2/in "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js index f80da7e958fd0..5460a4b100d52 100644 --- a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -45,7 +45,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -58,19 +58,25 @@ Output:: "../../../../a/lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { - "version": "-14000546910-export const a = \"hello", - "signature": "-14000546910-export const a = \"hello" + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" }, "./b.ts": { - "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" } }, "root": [ @@ -83,19 +89,13 @@ Output:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ], - [ - "./b.ts", - "Js" - ] + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 717 + "size": 772 } @@ -136,15 +136,9 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) -/home/src/projects/project/b.ts (used version) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -172,7 +166,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -200,8 +194,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -225,7 +223,7 @@ Output:: ] ], "version": "FakeTSVersion", - "size": 782 + "size": 851 } @@ -248,10 +246,14 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts /home/src/projects/project/a.ts +/home/src/projects/project/b.ts Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) /home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -283,7 +285,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -311,8 +313,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -326,7 +332,7 @@ Output:: ] ], "version": "FakeTSVersion", - "size": 749 + "size": 818 } //// [/home/src/projects/project/a.js] @@ -449,7 +455,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -477,8 +483,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -491,15 +501,11 @@ Output:: "./b.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 791 + "size": 835 } @@ -524,8 +530,7 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -562,7 +567,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -590,8 +595,12 @@ Output:: "signature": "-2692717255-export declare const a = \"hello\";\n" }, "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, "version": "-13368947479-export const b = 10;", - "signature": "-13368947479-export const b = 10;" + "signature": "-3829150557-export declare const b = 10;\n" } }, "root": [ @@ -604,9 +613,14 @@ Output:: "./b.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 760 + "size": 848 } //// [/home/src/projects/project/a.js] @@ -635,8 +649,10 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -693,6 +709,7 @@ Program files:: /home/src/projects/project/b.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js index 25845fb9f4d67..edc65a3406bf8 100644 --- a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js @@ -42,7 +42,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -54,19 +54,19 @@ Output:: "../../../../a/lib/lib.d.ts": { "original": { "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": false, "affectsGlobalScope": true }, "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 }, "./a.ts": { "original": { "version": "2464268576-const a = \"hello", + "signature": false, "affectsGlobalScope": true }, "version": "2464268576-const a = \"hello", - "signature": "2464268576-const a = \"hello", "affectsGlobalScope": true } }, @@ -76,15 +76,12 @@ Output:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 697 + "size": 710 } @@ -121,13 +118,9 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -222,6 +215,7 @@ Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) /home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -399,7 +393,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -434,15 +428,11 @@ Output:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ - [ - "./a.ts", - "Js" - ] + "changeFileSet": [ + "./a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 754 + "size": 729 } @@ -465,8 +455,7 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -503,7 +492,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -538,9 +527,14 @@ Output:: "./a.ts" ] ], - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 723 + "size": 742 } //// [/home/src/projects/project/a.js] @@ -564,8 +558,10 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -620,6 +616,7 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js index d0391170e6255..76c81a0665104 100644 --- a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js @@ -73,13 +73,9 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/home/src/projects/project/a.ts (used version) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -127,6 +123,7 @@ Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) /home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -277,8 +274,7 @@ Program files:: Semantic diagnostics in builder refreshed for:: /home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: exitCode:: ExitStatus.undefined @@ -332,8 +328,10 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) exitCode:: ExitStatus.undefined @@ -386,6 +384,7 @@ Program files:: /home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js index d9906002df5fc..c536f7f6025d6 100644 --- a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -47,7 +47,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -75,13 +75,13 @@ Output:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 727 + "size": 717 } @@ -124,10 +124,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -412,7 +409,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -440,13 +437,11 @@ Output:: "module": 2, "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 727 + "size": 713 } @@ -470,10 +465,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts -/home/src/projects/project/b.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -514,7 +506,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -542,9 +534,22 @@ Output:: "module": 2, "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 707 + "size": 730 } //// [/home/src/projects/outFile.js] @@ -582,7 +587,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -644,7 +649,7 @@ Program files:: /home/src/projects/project/a.ts /home/src/projects/project/b.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js index e5551079e3d2b..95b55d1534e51 100644 --- a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js @@ -43,7 +43,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -64,13 +64,12 @@ Output:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 652 + "size": 640 } @@ -108,9 +107,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -358,7 +355,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -379,13 +376,11 @@ Output:: "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "changeFileSet": [ + "./project/a.ts" ], - "errors": true, "version": "FakeTSVersion", - "size": 652 + "size": 638 } @@ -406,9 +401,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -448,7 +441,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"errors":true,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -469,9 +462,18 @@ Output:: "options": { "outFile": "./outFile.js" }, - "errors": true, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], "version": "FakeTSVersion", - "size": 632 + "size": 653 } //// [/home/src/projects/outFile.js] @@ -495,7 +497,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -553,7 +555,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js index 15dd4e93463e4..1cb36caf87d54 100644 --- a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js @@ -75,9 +75,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -280,9 +278,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/home/src/projects/project/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -340,7 +336,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: @@ -396,7 +392,7 @@ Program files:: /a/lib/lib.d.ts /home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js index e20784b3f1145..1f68b6322120e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js @@ -685,11 +685,11 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/projects/proj "semanticDiagnosticsPerFile": [ [ "../project1/class1.d.ts", - "not cached" + "not cached or not changed" ], [ "./class2.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./class2.d.ts", diff --git a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js index 35b372f84ef20..4bea0917c04d9 100644 --- a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js +++ b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js @@ -679,11 +679,11 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/projects/proj "semanticDiagnosticsPerFile": [ [ "../project1/class1.d.ts", - "not cached" + "not cached or not changed" ], [ "./class2.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./class2.d.ts", From 8b6cc163ada14e154b91765ec592bae7a7c37ce3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 27 Jun 2024 15:58:32 -0700 Subject: [PATCH 4/7] Report declaration diagnostics if noEmit through tsc --- src/compiler/builder.ts | 267 +++-- src/compiler/tsbuildPublic.ts | 16 +- src/compiler/watch.ts | 15 +- src/testRunner/unittests/helpers/baseline.ts | 8 +- src/testRunner/unittests/helpers/noEmit.ts | 24 +- .../noEmit/multiFile/changes-composite.js | 28 +- .../changes-incremental-declaration.js | 28 +- .../changes-with-initial-noEmit-composite.js | 74 +- ...-initial-noEmit-incremental-declaration.js | 74 +- ...th-incremental-as-modules-discrepancies.js | 127 +-- ...ble-changes-with-incremental-as-modules.js | 292 +++++- ...-changes-with-incremental-discrepancies.js | 103 +- ...aration-enable-changes-with-incremental.js | 246 ++++- ...anges-with-multiple-files-discrepancies.js | 240 +---- ...tion-enable-changes-with-multiple-files.js | 911 ++++++++++++++---- ...-errors-with-declaration-enable-changes.js | 53 +- .../dts-errors-with-incremental-as-modules.js | 167 +++- .../multiFile/dts-errors-with-incremental.js | 149 ++- .../tsbuild/noEmit/multiFile/dts-errors.js | 109 ++- .../noEmit/outFile/changes-composite.js | 8 +- .../changes-incremental-declaration.js | 8 +- .../changes-with-initial-noEmit-composite.js | 16 +- ...-initial-noEmit-incremental-declaration.js | 16 +- ...th-incremental-as-modules-discrepancies.js | 109 +-- ...ble-changes-with-incremental-as-modules.js | 244 ++++- ...-changes-with-incremental-discrepancies.js | 85 +- ...aration-enable-changes-with-incremental.js | 214 +++- ...anges-with-multiple-files-discrepancies.js | 192 +--- ...tion-enable-changes-with-multiple-files.js | 542 ++++++++++- ...-errors-with-declaration-enable-changes.js | 53 +- .../dts-errors-with-incremental-as-modules.js | 148 ++- .../outFile/dts-errors-with-incremental.js | 142 ++- .../tsbuild/noEmit/outFile/dts-errors.js | 109 ++- ...rrors-with-declaration-with-incremental.js | 43 +- .../multiFile/dts-errors-with-declaration.js | 25 +- ...rrors-with-declaration-with-incremental.js | 26 +- .../outFile/dts-errors-with-declaration.js | 25 +- .../dts-errors-with-incremental-as-modules.js | 102 +- .../multiFile/dts-errors-with-incremental.js | 88 +- .../noEmit/multiFile/dts-errors.js | 74 +- .../dts-errors-with-incremental-as-modules.js | 79 +- .../outFile/dts-errors-with-incremental.js | 79 +- .../tsbuildWatch/noEmit/outFile/dts-errors.js | 74 +- ...Error-with-declaration-with-incremental.js | 29 +- .../noEmitOnError-with-declaration.js | 37 +- ...Error-with-declaration-with-incremental.js | 26 +- .../outFile/noEmitOnError-with-declaration.js | 37 +- .../tsc/noEmit/multiFile/changes-composite.js | 28 +- .../changes-incremental-declaration.js | 28 +- .../changes-with-initial-noEmit-composite.js | 74 +- ...-initial-noEmit-incremental-declaration.js | 74 +- ...anges-with-multiple-files-discrepancies.js | 3 +- ...tion-enable-changes-with-multiple-files.js | 245 ++++- .../dts-errors-with-incremental-as-modules.js | 115 ++- .../multiFile/dts-errors-with-incremental.js | 101 +- .../tsc/noEmit/multiFile/dts-errors.js | 40 +- .../tsc/noEmit/outFile/changes-composite.js | 8 +- .../changes-incremental-declaration.js | 8 +- .../changes-with-initial-noEmit-composite.js | 16 +- ...-initial-noEmit-incremental-declaration.js | 16 +- ...anges-with-multiple-files-discrepancies.js | 3 +- ...tion-enable-changes-with-multiple-files.js | 276 +++++- .../dts-errors-with-incremental-as-modules.js | 92 +- .../outFile/dts-errors-with-incremental.js | 92 +- .../tsc/noEmit/outFile/dts-errors.js | 40 +- ...rrors-with-declaration-with-incremental.js | 39 +- ...rrors-with-declaration-with-incremental.js | 22 +- .../dts-errors-with-incremental-as-modules.js | 96 +- .../multiFile/dts-errors-with-incremental.js | 82 +- .../tscWatch/noEmit/multiFile/dts-errors.js | 21 +- .../dts-errors-with-incremental-as-modules.js | 73 +- .../outFile/dts-errors-with-incremental.js | 73 +- .../tscWatch/noEmit/outFile/dts-errors.js | 21 +- ...Error-with-declaration-with-incremental.js | 25 +- ...Error-with-declaration-with-incremental.js | 22 +- ...noEmit-with-composite-with-emit-builder.js | 29 +- ...it-with-composite-with-semantic-builder.js | 29 +- ...noEmit-with-composite-with-emit-builder.js | 16 +- ...it-with-composite-with-semantic-builder.js | 16 +- 79 files changed, 5480 insertions(+), 1904 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 27dcc5bc2c561..545306400bded 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -100,6 +100,13 @@ export interface ReusableDiagnostic extends ReusableDiagnosticRelatedInformation skippedOn?: keyof CompilerOptions; } +/** @internal */ +export interface ReusableDiagnosticWithLocation extends ReusableDiagnostic { + file: string | undefined; + start: number; + length: number; +} + /** @internal */ export interface ReusableDiagnosticRelatedInformation { category: DiagnosticCategory; @@ -138,7 +145,7 @@ export interface ReusableBuilderProgramState extends BuilderState { */ semanticDiagnosticsPerFile: Map; /** Cache of dts emit diagnostics for files with their Path being the key */ - emitDiagnosticsPerFile?: Map | undefined; + emitDiagnosticsPerFile?: Map | undefined; /** * The map has key by source file's path that has been changed */ @@ -188,10 +195,13 @@ export const enum BuilderFileEmit { Js = 1 << 0, // emit js file JsMap = 1 << 1, // emit js.map file JsInlineMap = 1 << 2, // emit inline source map in js file - Dts = 1 << 3, // emit d.ts file - DtsMap = 1 << 4, // emit d.ts.map file + DtsErrors = 1 << 3, // emit dts errors + DtsEmit = 1 << 4, // emit d.ts file + DtsMap = 1 << 5, // emit d.ts.map file + Dts = DtsErrors | DtsEmit, AllJs = Js | JsMap | JsInlineMap, + AllDtsEmit = DtsEmit | DtsMap, AllDts = Dts | DtsMap, All = AllJs | AllDts, } @@ -208,7 +218,7 @@ export interface BuilderProgramState extends BuilderState, ReusableBuilderProgra */ semanticDiagnosticsPerFile: Map; /** Cache of dts emit diagnostics for files with their Path being the key */ - emitDiagnosticsPerFile?: Map | undefined; + emitDiagnosticsPerFile?: Map | undefined; /** * The map has key by source file's path that has been changed */ @@ -284,12 +294,7 @@ export function getBuilderFileEmit(options: CompilerOptions) { return result; } -/** - * Determining what all is pending to be emitted based on previous options or previous file emit flags - * - * @internal - */ -export function getPendingEmitKind( +function getPendingEmitKind( optionsOrEmitKind: CompilerOptions | BuilderFileEmit, oldOptionsOrEmitKind: CompilerOptions | BuilderFileEmit | undefined, ): BuilderFileEmit { @@ -301,8 +306,10 @@ export function getPendingEmitKind( let result = BuilderFileEmit.None; // If there is diff in Js emit, pending emit is js emit flags if (diff & BuilderFileEmit.AllJs) result = emitKind & BuilderFileEmit.AllJs; + // If dts errors pending, add dts errors flag + if (diff & BuilderFileEmit.DtsErrors) result = result | (emitKind & BuilderFileEmit.DtsErrors); // If there is diff in Dts emit, pending emit is dts emit flags - if (diff & BuilderFileEmit.AllDts) result = result | (emitKind & BuilderFileEmit.AllDts); + if (diff & BuilderFileEmit.AllDtsEmit) result = result | (emitKind & BuilderFileEmit.AllDtsEmit); return result; } @@ -690,32 +697,61 @@ function getNextAffectedFile( } } -function clearAffectedFilesPendingEmit(state: BuilderProgramState, emitOnlyDtsFiles: boolean | undefined) { +function clearAffectedFilesPendingEmit( + state: BuilderProgramState, + emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, +) { if (!state.affectedFilesPendingEmit?.size && !state.programEmitPending) return; - if (!emitOnlyDtsFiles) { + if (!emitOnlyDtsFiles && !isForDtsErrors) { state.affectedFilesPendingEmit = undefined; state.programEmitPending = undefined; } state.affectedFilesPendingEmit?.forEach((emitKind, path) => { // Mark the files as pending only if they are pending on js files, remove the dts emit pending flag - const pending = emitKind & BuilderFileEmit.AllJs; + const pending = !isForDtsErrors ? + emitKind & BuilderFileEmit.AllJs : + emitKind & (BuilderFileEmit.AllJs | BuilderFileEmit.AllDtsEmit); if (!pending) state.affectedFilesPendingEmit!.delete(path); else state.affectedFilesPendingEmit!.set(path, pending); }); // Mark the program as pending only if its pending on js files, remove the dts emit pending flag if (state.programEmitPending) { - const pending = state.programEmitPending & BuilderFileEmit.AllJs; + const pending = !isForDtsErrors ? + state.programEmitPending & BuilderFileEmit.AllJs : + state.programEmitPending & (BuilderFileEmit.AllJs | BuilderFileEmit.AllDtsEmit); if (!pending) state.programEmitPending = undefined; else state.programEmitPending = pending; } } +/** + * Determining what all is pending to be emitted based on previous options or previous file emit flags + * @internal + */ +export function getPendingEmitKindWithSeen( + optionsOrEmitKind: CompilerOptions | BuilderFileEmit, + seenOldOptionsOrEmitKind: CompilerOptions | BuilderFileEmit | undefined, + emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, +) { + let pendingKind = getPendingEmitKind(optionsOrEmitKind, seenOldOptionsOrEmitKind); + if (emitOnlyDtsFiles) pendingKind = pendingKind & BuilderFileEmit.AllDts; + if (isForDtsErrors) pendingKind = pendingKind & BuilderFileEmit.DtsErrors; + return pendingKind; +} + +function getBuilderFileEmitAllDts(isForDtsErrors: boolean) { + return !isForDtsErrors ? BuilderFileEmit.AllDts : BuilderFileEmit.DtsErrors; +} + /** * Returns next file to be emitted from files that retrieved semantic diagnostics but did not emit yet */ function getNextAffectedFilePendingEmit( state: BuilderProgramStateWithDefinedProgram, emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, ) { if (!state.affectedFilesPendingEmit?.size) return undefined; return forEachEntry(state.affectedFilesPendingEmit, (emitKind, path) => { @@ -725,13 +761,22 @@ function getNextAffectedFilePendingEmit( return undefined; } const seenKind = state.seenEmittedFiles?.get(affectedFile.resolvedPath); - let pendingKind = getPendingEmitKind(emitKind, seenKind); - if (emitOnlyDtsFiles) pendingKind = pendingKind & BuilderFileEmit.AllDts; - if (pendingKind) return { affectedFile, emitKind: pendingKind }; + const pendingKind = getPendingEmitKindWithSeen( + emitKind, + seenKind, + emitOnlyDtsFiles, + isForDtsErrors, + ); + if (pendingKind) { + return { affectedFile, emitKind: pendingKind }; + } }); } -function getNextPendingEmitDiagnosticsFile(state: BuilderProgramStateWithDefinedProgram) { +function getNextPendingEmitDiagnosticsFile( + state: BuilderProgramStateWithDefinedProgram, + isForDtsErrors: boolean, +) { if (!state.emitDiagnosticsPerFile?.size) return undefined; return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path) => { const affectedFile = state.program.getSourceFileByPath(path); @@ -740,7 +785,7 @@ function getNextPendingEmitDiagnosticsFile(state: BuilderProgramStateWithDefined return undefined; } const seenKind = state.seenEmittedFiles?.get(affectedFile.resolvedPath) || BuilderFileEmit.None; - if (!(seenKind & BuilderFileEmit.AllDts)) return { affectedFile, diagnostics, seenKind }; + if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) return { affectedFile, diagnostics, seenKind }; }); } @@ -1034,11 +1079,13 @@ export type IncrementalBuildInfoFileIdListId = number & { __incrementalBuildInfo /** @internal */ export type IncrementalBuildInfoDiagnosticOfFile = [fileId: IncrementalBuildInfoFileId, diagnostics: readonly ReusableDiagnostic[]]; /** @internal */ +export type IncrementalBuildInfoEmitDiagnosticOfFile = [fileId: IncrementalBuildInfoFileId, diagnostics: readonly ReusableDiagnosticWithLocation[]]; +/** @internal */ export type IncrementalBuildInfoDiagnostic = | IncrementalBuildInfoFileId // File is not in changedSet and still doesnt have cached diagnostics | IncrementalBuildInfoDiagnosticOfFile; // Diagnostics for file /** @internal */ -export type IncrementalBuildInfoEmitDiagnostic = IncrementalBuildInfoDiagnosticOfFile; // Diagnostics for the file +export type IncrementalBuildInfoEmitDiagnostic = IncrementalBuildInfoEmitDiagnosticOfFile; // Diagnostics for file /** * fileId if pending emit is same as what compilerOptions suggest @@ -1450,7 +1497,7 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { const value = state.emitDiagnosticsPerFile.get(key)!; result = append(result, [ toFileId(key), - toReusableDiagnostic(value, key), + toReusableDiagnostic(value, key) as ReusableDiagnosticWithLocation[], ]); } return result; @@ -1657,6 +1704,7 @@ export function createBuilderProgram( sourceFile, ); builderProgram.getSemanticDiagnostics = getSemanticDiagnostics; + builderProgram.getDeclarationDiagnostics = getDeclarationDiagnostics; builderProgram.emit = emit; builderProgram.releaseProgram = () => releaseCache(state); @@ -1694,28 +1742,42 @@ export function createBuilderProgram( * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host * in that order would be used to write the files */ - function emitNextAffectedFile( + function emitNextAffectedFileOrDtsErrors( writeFile: WriteFileCallback | undefined, cancellationToken: CancellationToken | undefined, emitOnlyDtsFiles: boolean | undefined, customTransformers: CustomTransformers | undefined, + isForDtsErrors: boolean, ): AffectedFileResult { Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); let affected = getNextAffectedFile(state, cancellationToken, host); const programEmitKind = getBuilderFileEmit(state.compilerOptions); - let emitKind: BuilderFileEmit = emitOnlyDtsFiles ? - programEmitKind & BuilderFileEmit.AllDts : programEmitKind; + let emitKind: BuilderFileEmit = !isForDtsErrors ? + emitOnlyDtsFiles ? + programEmitKind & BuilderFileEmit.AllDts : + programEmitKind : + BuilderFileEmit.DtsErrors; if (!affected) { if (!state.compilerOptions.outFile) { - const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles); + const pendingAffectedFile = getNextAffectedFilePendingEmit( + state, + emitOnlyDtsFiles, + isForDtsErrors, + ); if (pendingAffectedFile) { // Emit pending affected file ({ affectedFile: affected, emitKind } = pendingAffectedFile); } else { - const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state); + const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile( + state, + isForDtsErrors, + ); if (pendingForDiagnostics) { - (state.seenEmittedFiles ??= new Map()).set(pendingForDiagnostics.affectedFile.resolvedPath, pendingForDiagnostics.seenKind | BuilderFileEmit.AllDts); + (state.seenEmittedFiles ??= new Map()).set( + pendingForDiagnostics.affectedFile.resolvedPath, + pendingForDiagnostics.seenKind | getBuilderFileEmitAllDts(isForDtsErrors), + ); return { result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics }, affected: pendingForDiagnostics.affectedFile, @@ -1726,15 +1788,19 @@ export function createBuilderProgram( else { // Emit program if it was pending emit if (state.programEmitPending) { - emitKind = state.programEmitPending; - if (emitOnlyDtsFiles) emitKind = emitKind & BuilderFileEmit.AllDts; + emitKind = getPendingEmitKindWithSeen( + state.programEmitPending, + state.seenProgramEmit, + emitOnlyDtsFiles, + isForDtsErrors, + ); if (emitKind) affected = state.program!; } // Pending emit diagnostics if (!affected && state.emitDiagnosticsPerFile?.size) { const seenKind = state.seenProgramEmit || BuilderFileEmit.None; - if (!(seenKind & BuilderFileEmit.AllDts)) { - state.seenProgramEmit = BuilderFileEmit.AllDts | seenKind; + if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) { + state.seenProgramEmit = getBuilderFileEmitAllDts(isForDtsErrors) | seenKind; const diagnostics: Diagnostic[] = []; state.emitDiagnosticsPerFile.forEach(d => addRange(diagnostics, d)); return { @@ -1747,7 +1813,7 @@ export function createBuilderProgram( if (!affected) { // Emit buildinfo if pending - if (!getBuildInfoEmitPending(state)) return undefined; + if (isForDtsErrors || !getBuildInfoEmitPending(state)) return undefined; const affected = state.program; const result = affected.emitBuildInfo( writeFile || maybeBind(host, host.writeFile), @@ -1762,15 +1828,23 @@ export function createBuilderProgram( if (emitKind & BuilderFileEmit.AllJs) emitOnly = EmitOnly.Js; if (emitKind & BuilderFileEmit.AllDts) emitOnly = emitOnly === undefined ? EmitOnly.Dts : undefined; // Actual emit without buildInfo as we want to emit it later so the state is updated - const result = state.program.emit( - affected === state.program ? undefined : affected as SourceFile, - getWriteFileCallback(writeFile, customTransformers), - cancellationToken, - emitOnly, - customTransformers, - /*forceDtsEmit*/ undefined, - /*skipBuildInfo*/ true, - ); + const result = !isForDtsErrors ? + state.program.emit( + affected === state.program ? undefined : affected as SourceFile, + getWriteFileCallback(writeFile, customTransformers), + cancellationToken, + emitOnly, + customTransformers, + /*forceDtsEmit*/ undefined, + /*skipBuildInfo*/ true, + ) : + { + emitSkipped: true, + diagnostics: state.program.getDeclarationDiagnostics( + affected === state.program ? undefined : affected as SourceFile, + cancellationToken, + ), + }; if (affected !== state.program) { // update affected files const affectedSourceFile = affected as SourceFile; @@ -1797,21 +1871,45 @@ export function createBuilderProgram( getPendingEmitKind(state.programEmitPending, emitKind) : undefined; state.seenProgramEmit = emitKind | (state.seenProgramEmit || BuilderFileEmit.None); - // Update the d.ts diagnostics since they always come with Location, skip diagnsotics without file, - // they could be semantic diagnsotic with noEmitOnError or other kind of diagnostics - let emitDiagnosticsPerFile: Map | undefined; - result.diagnostics.forEach(d => { - if (!d.file) return; // Dont cache without fileName - let diagnostics = emitDiagnosticsPerFile?.get(d.file.resolvedPath); - if (!diagnostics) (emitDiagnosticsPerFile ??= new Map()).set(d.file.resolvedPath, diagnostics = []); - diagnostics.push(d); - }); - if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile; + setEmitDiagnosticsPerFile(result.diagnostics as readonly DiagnosticWithLocation[]); state.buildInfoEmitPending = true; } return { result, affected }; } + function setEmitDiagnosticsPerFile(diagnostics: readonly DiagnosticWithLocation[]) { + // Update the d.ts diagnostics since they always come with Location, skip diagnsotics without file, + // they could be semantic diagnsotic with noEmitOnError or other kind of diagnostics + let emitDiagnosticsPerFile: Map | undefined; + diagnostics.forEach(d => { + if (!d.file) return; // Dont cache without fileName + let diagnostics = emitDiagnosticsPerFile?.get(d.file.resolvedPath); + if (!diagnostics) (emitDiagnosticsPerFile ??= new Map()).set(d.file.resolvedPath, diagnostics = []); + diagnostics.push(d); + }); + if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile; + } + + /** + * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + function emitNextAffectedFile( + writeFile: WriteFileCallback | undefined, + cancellationToken: CancellationToken | undefined, + emitOnlyDtsFiles: boolean | undefined, + customTransformers: CustomTransformers | undefined, + ): AffectedFileResult { + return emitNextAffectedFileOrDtsErrors( + writeFile, + cancellationToken, + emitOnlyDtsFiles, + customTransformers, + /*isForDtsErrors*/ false, + ); + } + function getWriteFileCallback( writeFile: WriteFileCallback | undefined, customTransformers: CustomTransformers | undefined, @@ -1954,16 +2052,75 @@ export function createBuilderProgram( } // In non Emit builder, clear affected files pending emit else { - clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles); + clearAffectedFilesPendingEmit( + state, + emitOnlyDtsFiles, + /*isForDtsErrors*/ false, + ); } } - return state.program.emit( + const emitResult = state.program.emit( targetSourceFile, getWriteFileCallback(writeFile, customTransformers), cancellationToken, emitOnlyDtsFiles, customTransformers, ); + handleNonEmitBuilderWithEmitOrDtsErrors( + targetSourceFile, + emitOnlyDtsFiles, + /*isForDtsErrors*/ false, + emitResult.diagnostics as readonly DiagnosticWithLocation[], + ); + return emitResult; + } + + function handleNonEmitBuilderWithEmitOrDtsErrors( + targetSourceFile: SourceFile | undefined, + emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, + diagnostics: EmitResult["diagnostics"], + ) { + if (!targetSourceFile && kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors); + setEmitDiagnosticsPerFile(diagnostics as readonly DiagnosticWithLocation[]); + } + } + + function getDeclarationDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken, + ): readonly DiagnosticWithLocation[] { + Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + let affectedEmitResult: AffectedFileResult; + let diagnostics: DiagnosticWithLocation[] | undefined; + while ( + affectedEmitResult = emitNextAffectedFileOrDtsErrors( + /*writeFile*/ undefined, + cancellationToken, + /*emitOnlyDtsFiles*/ undefined, + /*customTransformers*/ undefined, + /*isForDtsErrors*/ true, + ) + ) { + if (!sourceFile) diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics as DiagnosticWithLocation[]); + } + return !sourceFile ? + diagnostics || emptyArray : + state.emitDiagnosticsPerFile?.get(sourceFile.resolvedPath) || emptyArray; + } + else { + const result = state.program.getDeclarationDiagnostics(sourceFile, cancellationToken); + handleNonEmitBuilderWithEmitOrDtsErrors( + sourceFile, + /*emitOnlyDtsFiles*/ undefined, + /*isForDtsErrors*/ true, + result, + ); + return result; + } } /** @@ -2233,7 +2390,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( return semanticDiagnostics; } - function toPerFileEmitDiagnostics(diagnostics: readonly IncrementalBuildInfoEmitDiagnostic[] | undefined): Map | undefined { + function toPerFileEmitDiagnostics(diagnostics: readonly IncrementalBuildInfoEmitDiagnostic[] | undefined): Map | undefined { return diagnostics && arrayToMap(diagnostics, value => toFilePath(value[0]), value => value[1]); } } diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 8f8e2f9b7c8d3..7b9b398cf2d0a 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -66,7 +66,7 @@ import { getNonIncrementalBuildInfoRoots, getNormalizedAbsolutePath, getParsedCommandLineOfConfigFile, - getPendingEmitKind, + getPendingEmitKindWithSeen, getSourceFileVersionAsHashFromText, getTsBuildInfoEmitOutputFilePath, getWatchErrorSummaryDiagnosticMessage, @@ -1515,7 +1515,6 @@ function getUpToDateStatusWorker(state: SolutionBuilde incrementalBuildInfo.changeFileSet?.length || incrementalBuildInfo.semanticDiagnosticsPerFile?.length || ( - !project.options.noEmit && getEmitDeclarations(project.options) && incrementalBuildInfo.emitDiagnosticsPerFile?.length ) @@ -1543,7 +1542,18 @@ function getUpToDateStatusWorker(state: SolutionBuilde } // Has not emitted some of the files, project is out of date - if (!project.options.noEmit && getPendingEmitKind(project.options, incrementalBuildInfo.options || {})) { + if ( + ( + !project.options.noEmit || + (project.options.noEmit && getEmitDeclarations(project.options)) + ) && + getPendingEmitKindWithSeen( + project.options, + incrementalBuildInfo.options || {}, + /*emitOnlyDtsFiles*/ undefined, + !!project.options.noEmit, + ) + ) { return { type: UpToDateStatusType.OutOfDateOptions, buildInfoFile: buildInfoPath, diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 2bdeded0e6a7b..618545564c592 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -55,6 +55,7 @@ import { generateDjb2Hash, getDefaultLibFileName, getDirectoryPath, + getEmitDeclarations, getEmitScriptTarget, getLineAndCharacterOfPosition, getNameOfScriptTarget, @@ -570,7 +571,7 @@ export function emitFilesAndReportErrors( emitResult: EmitResult; diagnostics: SortedReadonlyArray; } { - const isListFilesOnly = !!program.getCompilerOptions().listFilesOnly; + const options = program.getCompilerOptions(); // First get and report any syntactic errors. const allDiagnostics = program.getConfigFileParsingDiagnostics().slice(); @@ -582,17 +583,25 @@ export function emitFilesAndReportErrors( if (allDiagnostics.length === configFileParsingDiagnosticsLength) { addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken)); - if (!isListFilesOnly) { + if (!options.listFilesOnly) { addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken)); if (allDiagnostics.length === configFileParsingDiagnosticsLength) { addRange(allDiagnostics, program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken)); } + + if ( + options.noEmit && + getEmitDeclarations(options) && + allDiagnostics.length === configFileParsingDiagnosticsLength + ) { + addRange(allDiagnostics, program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken)); + } } } // Emit and report any errors we ran into. - const emitResult = isListFilesOnly + const emitResult = options.listFilesOnly ? { emitSkipped: true, diagnostics: emptyArray } : program.emit(/*targetSourceFile*/ undefined, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); addRange(allDiagnostics, emitResult.diagnostics); diff --git a/src/testRunner/unittests/helpers/baseline.ts b/src/testRunner/unittests/helpers/baseline.ts index 25a2470d3e376..6eea4febf8f07 100644 --- a/src/testRunner/unittests/helpers/baseline.ts +++ b/src/testRunner/unittests/helpers/baseline.ts @@ -137,7 +137,7 @@ export function generateSourceMapBaselineFiles(sys: ts.System & { writtenFiles: export type ReadableIncrementalBuildInfoDiagnosticOfFile = [file: string, diagnostics: readonly ts.ReusableDiagnostic[]]; export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached or not changed"] | ReadableIncrementalBuildInfoDiagnosticOfFile; -export type ReadableIncrementalBuildInfoEmitDiagnostic = ReadableIncrementalBuildInfoDiagnosticOfFile; +export type ReadableIncrementalBuildInfoEmitDiagnostic = [file: string, diagnostics: readonly ts.ReusableDiagnosticWithLocation[]]; export type ReadableBuilderFileEmit = string & { __readableBuilderFileEmit: any; }; export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [file: string] | [file: string, emitKind: ts.BuilderFileEmit], emitKind: ReadableBuilderFileEmit]; export type ReadableIncrementalBuildInfoEmitSignature = string | [file: string, signature: ts.EmitSignature | []]; @@ -360,7 +360,11 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI if (emit & ts.BuilderFileEmit.Js) addFlags("Js"); if (emit & ts.BuilderFileEmit.JsMap) addFlags("JsMap"); if (emit & ts.BuilderFileEmit.JsInlineMap) addFlags("JsInlineMap"); - if (emit & ts.BuilderFileEmit.Dts) addFlags("Dts"); + if ((emit & ts.BuilderFileEmit.Dts) === ts.BuilderFileEmit.Dts) addFlags("Dts"); + else { + if (emit & ts.BuilderFileEmit.DtsEmit) addFlags("DtsEmit"); + if (emit & ts.BuilderFileEmit.DtsErrors) addFlags("DtsErrors"); + } if (emit & ts.BuilderFileEmit.DtsMap) addFlags("DtsMap"); } return (result || "None") as ReadableBuilderFileEmit; diff --git a/src/testRunner/unittests/helpers/noEmit.ts b/src/testRunner/unittests/helpers/noEmit.ts index f4c151ae44e35..3278f00bf6532 100644 --- a/src/testRunner/unittests/helpers/noEmit.ts +++ b/src/testRunner/unittests/helpers/noEmit.ts @@ -165,7 +165,12 @@ export function forEachNoEmitChanges(commandType: string[]) { }); } -function editsForDtsChanges(commandType: string[], aContent: string): TestTscEdit[] { +function editsForDtsChanges( + commandType: string[], + aContent: string, + incremental: boolean | undefined, + multiFile: boolean, +): TestTscEdit[] { return [ noChangeRun, { @@ -178,7 +183,13 @@ function editsForDtsChanges(commandType: string[], aContent: string): TestTscEdi edit: noop, commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], }, - noChangeRun, + incremental ? { + ...noChangeRun, + discrepancyExplanation: () => [ + "Clean build will not have declaration and declarationMap", + "Incremental build will have previous buildInfo so will have dts and declaration and declarationMap", + ], + } : noChangeRun, { caption: "Dts Emit with error", edit: noop, @@ -197,6 +208,11 @@ function editsForDtsChanges(commandType: string[], aContent: string): TestTscEdi caption: "With declaration and declarationMap noEmit", edit: noop, commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + // Multi file still needs to report error so will emit build info (for pending dtsMap) + discrepancyExplanation: incremental && !multiFile ? () => [ + "Clean build will have declaration and declarationMap", + "Incremental build will have previous buildInfo so will have declaration and declarationMap", + ] : undefined, }, ]; } @@ -223,7 +239,7 @@ export function forEachNoEmitDtsChanges(commandType: string[]) { modifyFs: asModules ? fs => fs.writeFileSync("/home/src/projects/project/b.ts", `export const b = 10;`) : undefined, - edits: editsForDtsChanges(commandType, aContent), + edits: editsForDtsChanges(commandType, aContent, incremental, false), baselinePrograms: true, }); }) @@ -249,7 +265,7 @@ export function forEachNoEmitDtsChanges(commandType: string[]) { }), }), edits: [ - ...editsForDtsChanges(commandType, aContent), + ...editsForDtsChanges(commandType, aContent, /*incremental*/ true, /*multiFile*/ true), { caption: "Fix the another ", edit: fs => fs.writeFileSync("/home/src/projects/project/c.ts", aContent.replace("a", "c").replace("private", "public")), diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js index 96deadf55cbab..367e2c7217fbf 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js @@ -1278,7 +1278,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1399,24 +1399,32 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "emitSignatures": [ @@ -1435,7 +1443,7 @@ exitCode:: ExitStatus.Success ], "latestChangedDtsFile": "./src/class.d.ts", "version": "FakeTSVersion", - "size": 2201 + "size": 2217 } diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js index e4d162f2afd3b..e20f40b9f4cae 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js @@ -1268,7 +1268,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1389,28 +1389,36 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 2006 + "size": 2022 } diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js index dd726b49be1f9..5353a2726378e 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js @@ -64,7 +64,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -172,28 +172,46 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/directuse.ts", - "Js | Dts" + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectuse.ts", - "Js | Dts" + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefile.ts", - "Js | Dts" + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefilewithemitspecificerror.ts", - "Js | Dts" + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -205,7 +223,7 @@ exitCode:: ExitStatus.Success "./src/nochangefilewithemitspecificerror.ts" ], "version": "FakeTSVersion", - "size": 1621 + "size": 1651 } @@ -726,7 +744,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -847,24 +865,32 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "emitSignatures": [ @@ -883,7 +909,7 @@ exitCode:: ExitStatus.Success ], "latestChangedDtsFile": "./src/class.d.ts", "version": "FakeTSVersion", - "size": 2201 + "size": 2217 } diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js index 7f30d0392af57..f0963ba92e24c 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js @@ -65,7 +65,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -173,32 +173,50 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/directuse.ts", - "Js | Dts" + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectuse.ts", - "Js | Dts" + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefile.ts", - "Js | Dts" + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefilewithemitspecificerror.ts", - "Js | Dts" + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1592 + "size": 1622 } @@ -720,7 +738,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -841,28 +859,36 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 2006 + "size": 2022 } diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js index 9263c04ce6d32..441b93d786a32 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js @@ -1,5 +1,6 @@ -1:: With declaration enabled noEmit - Should report errors -*** Needs explanation +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -25,41 +26,9 @@ CleanBuild: "./b.ts" ] ], - "options": { - "declaration": true - }, "version": "FakeTSVersion" } IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9502176711-export const a = class { private p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "version": "FakeTSVersion" -} -2:: With declaration and declarationMap noEmit - Should report errors -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: { "fileInfos": { "../../../../lib/lib.d.ts": { @@ -89,92 +58,9 @@ CleanBuild: }, "version": "FakeTSVersion" } -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9502176711-export const a = class { private p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "version": "FakeTSVersion" -} -6:: With declaration enabled noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9483521475-export const a = class { public p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "options": { - "declaration": true - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9483521475-export const a = class { public p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "version": "FakeTSVersion" -} 7:: With declaration and declarationMap noEmit -*** Needs explanation +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -230,5 +116,8 @@ IncrementalBuild: "./b.ts" ] ], + "options": { + "declaration": true + }, "version": "FakeTSVersion" } \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js index 311afacdaea5d..3243a484d0b02 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -147,11 +147,117 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -163,11 +269,97 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,49]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + Change:: no-change-run @@ -426,11 +618,103 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,16]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 16 + ], + "DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 940 +} + Change:: With declaration and declarationMap noEmit diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js index 1442aa67b8b97..5a28c012f3184 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js @@ -1,5 +1,6 @@ -1:: With declaration enabled noEmit - Should report errors -*** Needs explanation +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -19,35 +20,9 @@ CleanBuild: "./a.ts" ] ], - "options": { - "declaration": true - }, "version": "FakeTSVersion" } IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "7752727223-const a = class { private p = 10; };", - "affectsGlobalScope": true - } - }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "version": "FakeTSVersion" -} -2:: With declaration and declarationMap noEmit - Should report errors -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: { "fileInfos": { "../../../../lib/lib.d.ts": { @@ -71,74 +46,9 @@ CleanBuild: }, "version": "FakeTSVersion" } -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "7752727223-const a = class { private p = 10; };", - "affectsGlobalScope": true - } - }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "version": "FakeTSVersion" -} -6:: With declaration enabled noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "9520728827-const a = class { public p = 10; };", - "affectsGlobalScope": true - } - }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "options": { - "declaration": true - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "9520728827-const a = class { public p = 10; };", - "affectsGlobalScope": true - } - }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "version": "FakeTSVersion" -} 7:: With declaration and declarationMap noEmit -*** Needs explanation +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -182,5 +92,8 @@ IncrementalBuild: "./a.ts" ] ], + "options": { + "declaration": true + }, "version": "FakeTSVersion" } \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js index bf7650b0a4d1d..3933ef21d638a 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -132,11 +132,104 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 908 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -148,11 +241,84 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 758 +} + Change:: no-change-run @@ -375,11 +541,83 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"9520728827-const a = class { public p = 10; };","signature":"13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + }, + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 829 +} + Change:: With declaration and declarationMap noEmit diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js index c229207718044..78dd9aa846cf0 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -1,5 +1,6 @@ -1:: With declaration enabled noEmit - Should report errors -*** Needs explanation +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -35,51 +36,9 @@ CleanBuild: ] ] ], - "options": { - "declaration": true - }, "version": "FakeTSVersion" } IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9502176711-export const a = class { private p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - }, - "./c.ts": { - "version": "-17233149573-export const c = class { private p = 10; };" - }, - "./d.ts": { - "version": "2523684124-export const d = class { private p = 10; };" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts" - ] - ] - ], - "version": "FakeTSVersion" -} -2:: With declaration and declarationMap noEmit - Should report errors -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: { "fileInfos": { "../../../../lib/lib.d.ts": { @@ -118,197 +77,4 @@ CleanBuild: "declarationMap": true }, "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9502176711-export const a = class { private p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - }, - "./c.ts": { - "version": "-17233149573-export const c = class { private p = 10; };" - }, - "./d.ts": { - "version": "2523684124-export const d = class { private p = 10; };" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts" - ] - ] - ], - "version": "FakeTSVersion" -} -6:: With declaration enabled noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9483521475-export const a = class { public p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - }, - "./c.ts": { - "version": "-17233149573-export const c = class { private p = 10; };" - }, - "./d.ts": { - "version": "2523684124-export const d = class { private p = 10; };" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts" - ] - ] - ], - "options": { - "declaration": true - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9483521475-export const a = class { public p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - }, - "./c.ts": { - "version": "-17233149573-export const c = class { private p = 10; };" - }, - "./d.ts": { - "version": "2523684124-export const d = class { private p = 10; };" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts" - ] - ] - ], - "version": "FakeTSVersion" -} -7:: With declaration and declarationMap noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9483521475-export const a = class { public p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - }, - "./c.ts": { - "version": "-17233149573-export const c = class { private p = 10; };" - }, - "./d.ts": { - "version": "2523684124-export const d = class { private p = 10; };" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts" - ] - ] - ], - "options": { - "declaration": true, - "declarationMap": true - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "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; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "-9483521475-export const a = class { public p = 10; };" - }, - "./b.ts": { - "version": "-13368947479-export const b = 10;" - }, - "./c.ts": { - "version": "-17233149573-export const c = class { private p = 10; };" - }, - "./d.ts": { - "version": "2523684124-export const d = class { private p = 10; };" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts" - ] - ] - ], - "version": "FakeTSVersion" } \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js index 409cd1902038b..5294f6174b6ff 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -183,11 +183,183 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./c.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./d.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1375 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -199,47 +371,511 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts +Semantic diagnostics in builder refreshed for:: - - -Change:: no-change-run -Input:: +No shapes updated in the builder:: -Output:: -/lib/tsc -b --v /home/src/projects/project --noEmit -[HH:MM:SS AM] Projects in this build: - * home/src/projects/project/tsconfig.json +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]],"version":"FakeTSVersion"} -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 932 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/d.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +exports.d = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1387 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "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; };", + "affectsGlobalScope": true + }, + "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 + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1352 +} -exitCode:: ExitStatus.Success - - -Change:: Dts Emit with error +Change:: With declaration enabled noEmit Input:: Output:: -/lib/tsc -b --v /home/src/projects/project --declaration +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. - -1 export const a = class { private p = 10; }; -   ~ - home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. 1 export const c = class { private p = 10; }; @@ -251,7 +887,7 @@ Output::    ~ -Found 3 errors. +Found 2 errors. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ @@ -263,6 +899,7 @@ Program root files: [ Program options: { "incremental": true, "declaration": true, + "noEmit": true, "tscBuild": true, "configFilePath": "/home/src/projects/project/tsconfig.json" } @@ -279,55 +916,8 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/home/src/projects/project/a.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.a = void 0; -exports.a = /** @class */ (function () { - function class_1() { - this.p = 10; - } - return class_1; -}()); - - -//// [/home/src/projects/project/b.d.ts] -export declare const b = 10; - - -//// [/home/src/projects/project/b.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = void 0; -exports.b = 10; - - -//// [/home/src/projects/project/c.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.c = void 0; -exports.c = /** @class */ (function () { - function class_1() { - this.p = 10; - } - return class_1; -}()); - - -//// [/home/src/projects/project/d.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.d = void 0; -exports.d = /** @class */ (function () { - function class_1() { - this.p = 10; - } - return class_1; -}()); - - //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -349,8 +939,12 @@ exports.d = /** @class */ (function () { "affectsGlobalScope": true }, "./a.ts": { - "version": "-9502176711-export const a = class { private p = 10; };", - "signature": "-9502176711-export const a = class { private p = 10; };" + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" }, "./b.ts": { "original": { @@ -388,7 +982,7 @@ exports.d = /** @class */ (function () { }, "emitDiagnosticsPerFile": [ [ - "./a.ts", + "./c.ts", [ { "start": 13, @@ -400,7 +994,7 @@ exports.d = /** @class */ (function () { ] ], [ - "./c.ts", + "./d.ts", [ { "start": 13, @@ -410,39 +1004,54 @@ exports.d = /** @class */ (function () { "code": 4094 } ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./d.ts", [ - { - "start": 13, - "length": 1, - "messageText": "Property 'p' of exported class expression may not be private or protected.", - "category": 1, - "code": 4094 - } - ] + "./b.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./c.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./d.ts", + 16 + ], + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1387 + "size": 1409 } -Change:: Fix the error +Change:: With declaration and declarationMap noEmit Input:: -//// [/home/src/projects/project/a.ts] -export const a = class { public p = 10; }; - Output:: -/lib/tsc -b --v /home/src/projects/project --noEmit +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -455,6 +1064,8 @@ Program root files: [ ] Program options: { "incremental": true, + "declaration": true, + "declarationMap": true, "noEmit": true, "tscBuild": true, "configFilePath": "/home/src/projects/project/tsconfig.json" @@ -468,14 +1079,12 @@ Program files:: /home/src/projects/project/d.ts Semantic diagnostics in builder refreshed for:: -/home/src/projects/project/a.ts -Shape signatures in builder refreshed for:: -/home/src/projects/project/a.ts (computed .d.ts) +No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -535,76 +1144,46 @@ Shape signatures in builder refreshed for:: ] ] ], - "emitDiagnosticsPerFile": [ + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ [ - "./c.ts", [ - { - "start": 13, - "length": 1, - "messageText": "Property 'p' of exported class expression may not be private or protected.", - "category": 1, - "code": 4094 - } - ] + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ - "./d.ts", [ - { - "start": 13, - "length": 1, - "messageText": "Property 'p' of exported class expression may not be private or protected.", - "category": 1, - "code": 4094 - } - ] - ] - ], - "affectedFilesPendingEmit": [ + "./b.ts", + 48 + ], + "DtsEmit | DtsMap" + ], [ - "./a.ts", - "Js" + [ + "./c.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 48 + ], + "DtsEmit | DtsMap" ] ], "version": "FakeTSVersion", - "size": 1352 + "size": 1112 } -Change:: With declaration enabled noEmit -Input:: - - -Output:: -/lib/tsc -b --v /home/src/projects/project --noEmit --declaration -[HH:MM:SS AM] Projects in this build: - * home/src/projects/project/tsconfig.json - -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' - -exitCode:: ExitStatus.Success - - - - -Change:: With declaration and declarationMap noEmit -Input:: - - -Output:: -/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap -[HH:MM:SS AM] Projects in this build: - * home/src/projects/project/tsconfig.json - -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' - -exitCode:: ExitStatus.Success - - - - Change:: Fix the another Input:: //// [/home/src/projects/project/c.ts] @@ -652,7 +1231,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,[3,24],4,[5,24]],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -722,29 +1301,35 @@ Shape signatures in builder refreshed for:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts | DtsMap" + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ [ "./b.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ], [ - "./c.ts", - "Js | Dts | DtsMap" + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ [ "./d.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ] ], "version": "FakeTSVersion", - "size": 1214 + "size": 1224 } diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js index 684e981082d17..079a2e65c561a 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js @@ -124,7 +124,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -148,8 +156,19 @@ Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (used version) -//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -161,11 +180,19 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -203,7 +230,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -230,8 +257,18 @@ Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (used version) -//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + Change:: Dts Emit with error diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js index a036f087401d9..096c05cebd2c9 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -40,7 +40,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -70,7 +78,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -111,18 +119,38 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 750 + "size": 933 } @@ -136,9 +164,39 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: @@ -155,7 +213,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -185,7 +243,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -232,16 +290,22 @@ Shape signatures in builder refreshed for:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 811 + "size": 821 } @@ -407,7 +471,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -433,7 +505,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -482,14 +554,31 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1021 + "size": 1199 } @@ -503,7 +592,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -628,8 +717,38 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js index 2fb730cad0aa0..8fa2618b0637c 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js @@ -37,7 +37,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -63,7 +71,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -100,14 +108,31 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 731 + "size": 908 } @@ -121,9 +146,37 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: @@ -140,7 +193,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -169,7 +222,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -209,12 +262,15 @@ Shape signatures in builder refreshed for:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 772 + "size": 777 } @@ -353,7 +409,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -378,7 +442,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -416,14 +480,31 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 915 + "size": 1092 } @@ -437,7 +518,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -546,8 +627,36 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js index b6efb2d8dc363..e466c16b3b0fb 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js @@ -36,7 +36,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -61,15 +69,16 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"root":["./a.ts"],"version":"FakeTSVersion"} +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" ], + "errors": true, "version": "FakeTSVersion", - "size": 45 + "size": 59 } @@ -83,11 +92,19 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -127,7 +144,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -155,8 +172,18 @@ Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (used version) -//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + Change:: no-change-run @@ -280,7 +307,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -304,8 +339,19 @@ Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (used version) -//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + Change:: Emit when error @@ -317,7 +363,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -364,19 +410,8 @@ var a = /** @class */ (function () { }()); -//// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} - -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "root": [ - "./a.ts" - ], - "errors": true, - "version": "FakeTSVersion", - "size": 59 -} - +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: no-change-run @@ -392,7 +427,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -416,15 +459,5 @@ Shape signatures in builder refreshed for:: /home/src/projects/project/a.ts (used version) -//// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"root":["./a.ts"],"version":"FakeTSVersion"} - -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "root": [ - "./a.ts" - ], - "version": "FakeTSVersion", - "size": 45 -} - +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js index 8c21f80022704..e50c90e141898 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js @@ -1016,7 +1016,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -1077,11 +1077,11 @@ exitCode:: ExitStatus.Success "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 2067 + "size": 2064 } diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js index 638beda540a81..2f37581bb3a64 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js @@ -1010,7 +1010,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -1069,11 +1069,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js index 1217921fba827..a01cad1d6a7bb 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js @@ -66,7 +66,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -125,11 +125,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1514 + "size": 1511 } @@ -547,7 +547,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -608,11 +608,11 @@ exitCode:: ExitStatus.Success "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 2067 + "size": 2064 } diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js index 1f588e8bcf061..693dca5d5836a 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js @@ -67,7 +67,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -126,11 +126,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } @@ -544,7 +544,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -603,11 +603,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js index bbe432aa39d53..3dea92d919feb 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js @@ -1,5 +1,6 @@ -1:: With declaration enabled noEmit - Should report errors -*** Needs explanation +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -19,39 +20,12 @@ CleanBuild: ] ], "options": { - "declaration": true, "module": 2, "outFile": "./outFile.js" }, "version": "FakeTSVersion" } IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -2:: With declaration and declarationMap noEmit - Should report errors -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: { "fileInfos": { "../../../lib/lib.d.ts": "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; };", @@ -76,81 +50,9 @@ CleanBuild: }, "version": "FakeTSVersion" } -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -6:: With declaration enabled noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "declaration": true, - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;" - }, - "root": [ - [ - 2, - "./project/a.ts" - ], - [ - 3, - "./project/b.ts" - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} 7:: With declaration and declarationMap noEmit -*** Needs explanation +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -195,6 +97,7 @@ IncrementalBuild: ] ], "options": { + "declaration": true, "module": 2, "outFile": "./outFile.js" }, diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js index b6f497ecadeff..db2986c4b3d4b 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -132,11 +132,95 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +Semantic diagnostics in builder refreshed for:: +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 918 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -148,11 +232,97 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +No shapes updated in the builder:: + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 940 +} + Change:: no-change-run @@ -180,7 +350,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -377,11 +547,73 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 744 +} + Change:: With declaration and declarationMap noEmit diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js index 23c57e2882256..799b3448ba452 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js @@ -1,5 +1,6 @@ -1:: With declaration enabled noEmit - Should report errors -*** Needs explanation +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -14,32 +15,11 @@ CleanBuild: ] ], "options": { - "declaration": true, "outFile": "./outFile.js" }, "version": "FakeTSVersion" } IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "7752727223-const a = class { private p = 10; };" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -2:: With declaration and declarationMap noEmit - Should report errors -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: { "fileInfos": { "../../../lib/lib.d.ts": "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; };", @@ -58,63 +38,9 @@ CleanBuild: }, "version": "FakeTSVersion" } -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "7752727223-const a = class { private p = 10; };" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -6:: With declaration enabled noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "9520728827-const a = class { public p = 10; };" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "declaration": true, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "9520728827-const a = class { public p = 10; };" - }, - "root": [ - [ - 2, - "./project/a.ts" - ] - ], - "options": { - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} 7:: With declaration and declarationMap noEmit -*** Needs explanation +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -148,6 +74,7 @@ IncrementalBuild: ] ], "options": { + "declaration": true, "outFile": "./outFile.js" }, "version": "FakeTSVersion" diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js index a986f472deee0..1c057f6ec493a 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -117,11 +117,85 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 843 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -133,11 +207,87 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"declarationMap":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 865 +} + Change:: no-change-run @@ -165,7 +315,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -330,11 +480,63 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","9520728827-const a = class { public p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 670 +} + Change:: With declaration and declarationMap noEmit diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js index 36477c07cc9af..dedd245a71f22 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -1,5 +1,6 @@ -1:: With declaration enabled noEmit - Should report errors -*** Needs explanation +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: CleanBuild: { @@ -25,45 +26,12 @@ CleanBuild: ] ], "options": { - "declaration": true, "module": 2, "outFile": "./outFile.js" }, "version": "FakeTSVersion" } IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;", - "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", - "./project/d.ts": "2523684124-export const d = class { private p = 10; };" - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./project/a.ts", - "./project/b.ts", - "./project/c.ts", - "./project/d.ts" - ] - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -2:: With declaration and declarationMap noEmit - Should report errors -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: { "fileInfos": { "../../../lib/lib.d.ts": "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; };", @@ -93,158 +61,4 @@ CleanBuild: "outFile": "./outFile.js" }, "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;", - "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", - "./project/d.ts": "2523684124-export const d = class { private p = 10; };" - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./project/a.ts", - "./project/b.ts", - "./project/c.ts", - "./project/d.ts" - ] - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -6:: With declaration enabled noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;", - "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", - "./project/d.ts": "2523684124-export const d = class { private p = 10; };" - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./project/a.ts", - "./project/b.ts", - "./project/c.ts", - "./project/d.ts" - ] - ] - ], - "options": { - "declaration": true, - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;", - "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", - "./project/d.ts": "2523684124-export const d = class { private p = 10; };" - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./project/a.ts", - "./project/b.ts", - "./project/c.ts", - "./project/d.ts" - ] - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -7:: With declaration and declarationMap noEmit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;", - "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", - "./project/d.ts": "2523684124-export const d = class { private p = 10; };" - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./project/a.ts", - "./project/b.ts", - "./project/c.ts", - "./project/d.ts" - ] - ] - ], - "options": { - "declaration": true, - "declarationMap": true, - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../lib/lib.d.ts": "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; };", - "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", - "./project/b.ts": "-13368947479-export const b = 10;", - "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", - "./project/d.ts": "2523684124-export const d = class { private p = 10; };" - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./project/a.ts", - "./project/b.ts", - "./project/c.ts", - "./project/d.ts" - ] - ] - ], - "options": { - "module": 2, - "outFile": "./outFile.js" - }, - "version": "FakeTSVersion" } \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js index 70624a90b6918..102e0ea355f6a 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -152,11 +152,141 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1362 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -168,11 +298,143 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1384 +} + Change:: no-change-run @@ -200,7 +462,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -479,11 +741,124 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1215 +} + Change:: With declaration and declarationMap noEmit @@ -495,11 +870,126 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +No shapes updated in the builder:: + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "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; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1237 +} + Change:: Fix the another @@ -514,11 +1004,19 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/c.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -554,7 +1052,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -592,11 +1090,25 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts | DtsMap", - false + "Js | DtsEmit | DtsMap", + 49 ], "version": "FakeTSVersion", - "size": 920 + "size": 1090 } diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js index 29627485e9f9e..3370cfbd077c1 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js @@ -124,7 +124,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -147,8 +155,19 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + Change:: With declaration and declarationMap noEmit - Should report errors @@ -160,11 +179,19 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -201,7 +228,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -227,8 +254,18 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + Change:: Dts Emit with error diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js index 96c3ed2e36e72..8350ee6f74419 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -42,7 +42,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -71,7 +79,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -100,12 +108,26 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 748 + "size": 918 } @@ -119,9 +141,41 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: @@ -138,7 +192,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -171,7 +225,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -201,11 +255,11 @@ No shapes updated in the builder:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 733 + "size": 730 } @@ -355,7 +409,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -384,7 +446,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -413,12 +475,26 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 748 + "size": 918 } @@ -432,7 +508,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -547,8 +623,40 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js index 97edf78f06b42..52096d340eda5 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js @@ -38,7 +38,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -63,7 +71,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -85,12 +93,26 @@ No shapes updated in the builder:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 674 + "size": 843 } @@ -104,9 +126,38 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: @@ -123,7 +174,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -152,7 +203,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -175,11 +226,11 @@ No shapes updated in the builder:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 658 + "size": 655 } @@ -303,7 +354,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -328,7 +387,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -350,12 +409,26 @@ No shapes updated in the builder:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 674 + "size": 843 } @@ -369,7 +442,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -463,8 +536,37 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js index a29671374d5e0..2ccad5295c726 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js @@ -37,7 +37,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -61,15 +69,16 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"root":["./project/a.ts"],"version":"FakeTSVersion"} +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ "./project/a.ts" ], + "errors": true, "version": "FakeTSVersion", - "size": 53 + "size": 67 } @@ -83,11 +92,19 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -126,7 +143,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -153,8 +170,18 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + Change:: no-change-run @@ -276,7 +303,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -299,8 +334,19 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + Change:: Emit when error @@ -312,7 +358,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -358,19 +404,8 @@ var a = /** @class */ (function () { }()); -//// [/home/src/projects/outFile.tsbuildinfo] -{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} - -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] -{ - "root": [ - "./project/a.ts" - ], - "errors": true, - "version": "FakeTSVersion", - "size": 67 -} - +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: no-change-run @@ -386,7 +421,15 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -409,15 +452,5 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/home/src/projects/outFile.tsbuildinfo] -{"root":["./project/a.ts"],"version":"FakeTSVersion"} - -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] -{ - "root": [ - "./project/a.ts" - ], - "version": "FakeTSVersion", - "size": 53 -} - +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js index 472232ad148c1..c7a71ad86a284 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js @@ -95,7 +95,7 @@ Shape signatures in builder refreshed for:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[2,3,4],"version":"FakeTSVersion"} +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]],"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -156,22 +156,45 @@ Shape signatures in builder refreshed for:: "../shared/types/db.ts" ] }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "affectedFilesPendingEmit": [ [ - "../shared/types/db.ts", - "Js | Dts" + [ + "../shared/types/db.ts", + 17 + ], + "Js | DtsEmit" ], [ - "../src/main.ts", - "Js | Dts" + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" ], [ - "../src/other.ts", - "Js | Dts" + [ + "../src/other.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 994 + "size": 1182 } @@ -185,7 +208,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -239,7 +262,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js index 15084d684c638..d6f15f28e9f10 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js @@ -93,7 +93,7 @@ Shape signatures in builder refreshed for:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"errors":true,"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -102,8 +102,9 @@ Shape signatures in builder refreshed for:: "../src/main.ts", "../src/other.ts" ], + "errors": true, "version": "FakeTSVersion", - "size": 95 + "size": 109 } @@ -117,7 +118,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -180,7 +181,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -258,8 +259,20 @@ Object.defineProperty(exports, "__esModule", { value: true }); console.log("hi"); -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + Change:: no-change-run diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js index 678b79a6a2a25..4b4d464949594 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js @@ -93,7 +93,7 @@ No shapes updated in the builder:: //// [/user/username/projects/dev-build.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] { @@ -128,12 +128,26 @@ No shapes updated in the builder:: "noEmitOnError": true, "outFile": "./dev-build.js" }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 954 + "size": 1124 } @@ -147,7 +161,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -202,7 +216,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js index 2d662971062fc..2de91ad7b61b0 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js @@ -91,7 +91,7 @@ No shapes updated in the builder:: //// [/user/username/projects/dev-build.tsbuildinfo] -{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"errors":true,"version":"FakeTSVersion"} //// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] { @@ -100,8 +100,9 @@ No shapes updated in the builder:: "./noemitonerror/src/main.ts", "./noemitonerror/src/other.ts" ], + "errors": true, "version": "FakeTSVersion", - "size": 134 + "size": 148 } @@ -115,7 +116,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.js' does not exist +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -175,7 +176,7 @@ Output:: [HH:MM:SS AM] Projects in this build: * tsconfig.json -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -250,8 +251,20 @@ define("src/other", ["require", "exports"], function (require, exports) { }); -//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents -//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + Change:: no-change-run diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js index 1f8c336ea4cbb..ae395d7305dff 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -43,12 +43,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -89,18 +94,38 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 752 + "size": 935 } @@ -165,7 +190,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -174,7 +199,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -221,16 +246,22 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 813 + "size": 823 } @@ -476,12 +507,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -530,14 +566,31 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1023 + "size": 1201 } @@ -592,7 +645,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -735,11 +788,16 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js index f83e3e29d5367..ce5289e38085b 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js @@ -40,12 +40,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -82,14 +87,31 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 733 + "size": 910 } @@ -148,7 +170,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -157,7 +179,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -197,12 +219,15 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 774 + "size": 779 } @@ -418,12 +443,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -461,14 +491,31 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 917 + "size": 1094 } @@ -522,7 +569,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -649,11 +696,16 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js index b643a476830fd..307218a51481b 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js @@ -39,20 +39,26 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"root":["./a.ts"],"version":"FakeTSVersion"} +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" ], + "errors": true, "version": "FakeTSVersion", - "size": 45 + "size": 59 } @@ -110,7 +116,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -118,8 +124,18 @@ Output:: -//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + Program root files: [ @@ -287,12 +303,28 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. -//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + Program root files: [ @@ -342,7 +374,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -357,19 +389,8 @@ Output:: -//// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} - -//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "root": [ - "./a.ts" - ], - "errors": true, - "version": "FakeTSVersion", - "size": 59 -} - +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents //// [/home/src/projects/project/a.js] var a = /** @class */ (function () { function class_1() { @@ -430,7 +451,12 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js index 5529e3c25b6b1..375bad2f20102 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -45,12 +45,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -79,12 +84,26 @@ Output:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 750 + "size": 920 } @@ -148,7 +167,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -157,7 +176,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -187,11 +206,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 735 + "size": 732 } @@ -430,12 +449,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -464,12 +488,26 @@ Output:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 750 + "size": 920 } @@ -529,7 +567,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -664,11 +702,16 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js index b159902e3ff0f..9e7f9ade2a504 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js @@ -41,12 +41,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -68,12 +73,26 @@ Output:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 676 + "size": 845 } @@ -131,7 +150,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -140,7 +159,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -163,11 +182,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 660 + "size": 657 } @@ -371,12 +390,17 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -398,12 +422,26 @@ Output:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 676 + "size": 845 } @@ -458,7 +496,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -571,11 +609,16 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js index 531e5e13fa1c8..67ea67b59906c 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js @@ -40,20 +40,26 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"root":["./project/a.ts"],"version":"FakeTSVersion"} +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ "./project/a.ts" ], + "errors": true, "version": "FakeTSVersion", - "size": 53 + "size": 67 } @@ -110,7 +116,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -118,8 +124,18 @@ Output:: -//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + Program root files: [ @@ -291,12 +307,28 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. -//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + Program root files: [ @@ -347,7 +379,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... @@ -362,19 +394,8 @@ Output:: -//// [/home/src/projects/outFile.tsbuildinfo] -{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} - -//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] -{ - "root": [ - "./project/a.ts" - ], - "errors": true, - "version": "FakeTSVersion", - "size": 67 -} - +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents //// [/home/src/projects/outFile.js] var a = /** @class */ (function () { function class_1() { @@ -437,7 +458,12 @@ Output:: [HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js index 3a5a2c4845646..2ae6b355e94c3 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js @@ -875,7 +875,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[3],"version":"FakeTSVersion"} +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[3,17]],"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -944,14 +944,31 @@ Output:: "../shared/types/db.ts" ] }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "../src/main.ts", - "Js | Dts" + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1245 + "size": 1423 } @@ -1002,7 +1019,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -1065,7 +1082,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js index 6677cf5130cc6..3173036158946 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js @@ -672,8 +672,21 @@ Output:: -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 109 +} + Program root files: [ @@ -721,7 +734,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -783,7 +796,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -793,8 +806,20 @@ Output:: -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js index 7b063f526cbe0..ac08fc8677ccd 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js @@ -753,7 +753,7 @@ Output:: //// [/user/username/projects/dev-build.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] { @@ -788,12 +788,26 @@ Output:: "noEmitOnError": true, "outFile": "./dev-build.js" }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 954 + "size": 1124 } @@ -847,7 +861,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -911,7 +925,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that some of the changes were not emitted +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js index e373e9ac7ce9b..4a0320fd7f999 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js @@ -678,8 +678,21 @@ Output:: -//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents -//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 148 +} + Program root files: [ @@ -730,7 +743,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -793,7 +806,7 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. [HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... @@ -801,8 +814,20 @@ Output:: -//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents -//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + //// [/user/username/projects/dev-build.js] define("shared/types/db", ["require", "exports"], function (require, exports) { "use strict"; diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js index a616debd0d119..f3934fa98128e 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js @@ -1194,7 +1194,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1315,24 +1315,32 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "emitSignatures": [ @@ -1351,7 +1359,7 @@ exitCode:: ExitStatus.Success ], "latestChangedDtsFile": "./src/class.d.ts", "version": "FakeTSVersion", - "size": 2201 + "size": 2217 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js index 3134ab9e7e8f6..45b56adfac945 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js @@ -1184,7 +1184,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1305,28 +1305,36 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 2006 + "size": 2022 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js index 7ae85225560ff..6db7cc7f040e6 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js @@ -57,7 +57,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -165,28 +165,46 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/directuse.ts", - "Js | Dts" + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectuse.ts", - "Js | Dts" + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefile.ts", - "Js | Dts" + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefilewithemitspecificerror.ts", - "Js | Dts" + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -198,7 +216,7 @@ exitCode:: ExitStatus.Success "./src/nochangefilewithemitspecificerror.ts" ], "version": "FakeTSVersion", - "size": 1621 + "size": 1651 } @@ -702,7 +720,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -823,24 +841,32 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "emitSignatures": [ @@ -859,7 +885,7 @@ exitCode:: ExitStatus.Success ], "latestChangedDtsFile": "./src/class.d.ts", "version": "FakeTSVersion", - "size": 2201 + "size": 2217 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js index 61d770b672845..445c5855b4722 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js @@ -58,7 +58,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -166,32 +166,50 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/directuse.ts", - "Js | Dts" + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectuse.ts", - "Js | Dts" + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefile.ts", - "Js | Dts" + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefilewithemitspecificerror.ts", - "Js | Dts" + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1592 + "size": 1622 } @@ -696,7 +714,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -817,28 +835,36 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 2006 + "size": 2022 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js index 265d2d8aafb6d..78dd9aa846cf0 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -1,5 +1,6 @@ 3:: no-change-run -*** Needs explanation +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: CleanBuild: { diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js index e2fdee7337f7d..c6cd75c791aff 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -191,7 +191,29 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -219,7 +241,7 @@ No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -274,26 +296,76 @@ No shapes updated in the builder:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" - ], - [ - "./b.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] ], [ "./c.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] ], [ "./d.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./c.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./d.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 890 + "size": 1375 } @@ -333,7 +405,7 @@ No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -391,24 +463,36 @@ No shapes updated in the builder:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts | DtsMap" + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ - "./b.ts", - "Js | Dts | DtsMap" + [ + "./b.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ - "./c.ts", - "Js | Dts | DtsMap" + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ - "./d.ts", - "Js | Dts | DtsMap" + [ + "./d.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ] ], "version": "FakeTSVersion", - "size": 912 + "size": 932 } @@ -794,7 +878,23 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration -exitCode:: ExitStatus.Success +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -822,7 +922,7 @@ No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"affectedFilesPendingEmit":[2,[3],[4],[5]],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -885,32 +985,64 @@ No shapes updated in the builder:: "options": { "declaration": true }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./b.ts" + "./b.ts", + 16 ], - "Dts" + "DtsEmit" ], [ [ - "./c.ts" + "./c.ts", + 16 ], - "Dts" + "DtsEmit" ], [ [ - "./d.ts" + "./d.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1076 + "size": 1409 } @@ -950,7 +1082,7 @@ No shapes updated in the builder:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,[3,24],[4,24],[5,24]],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1016,33 +1148,36 @@ No shapes updated in the builder:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts | DtsMap" + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ [ "./b.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ], [ [ "./c.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ], [ [ "./d.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ] ], "version": "FakeTSVersion", - "size": 1107 + "size": 1112 } @@ -1087,7 +1222,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[2,[3,24],4,[5,24]],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1157,29 +1292,35 @@ Shape signatures in builder refreshed for:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts | DtsMap" + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ [ "./b.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ], [ - "./c.ts", - "Js | Dts | DtsMap" + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" ], [ [ "./d.ts", - 24 + 48 ], - "Dts | DtsMap" + "DtsEmit | DtsMap" ] ], "version": "FakeTSVersion", - "size": 1214 + "size": 1224 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js index 01b537d076709..2c1ecdcfa8529 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -33,7 +33,15 @@ declare const console: { log(msg: any): void; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -63,7 +71,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -104,18 +112,38 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 750 + "size": 933 } @@ -126,7 +154,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -186,7 +222,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -233,16 +269,22 @@ Shape signatures in builder refreshed for:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 811 + "size": 821 } @@ -424,7 +466,15 @@ export const a = class { private p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -450,7 +500,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -499,14 +549,31 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1021 + "size": 1199 } @@ -635,7 +702,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js index dd6fcc56336ec..5357908bb250d 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js @@ -30,7 +30,15 @@ declare const console: { log(msg: any): void; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -56,7 +64,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -93,14 +101,31 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 731 + "size": 908 } @@ -111,7 +136,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -168,7 +201,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -208,12 +241,15 @@ Shape signatures in builder refreshed for:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 772 + "size": 777 } @@ -364,7 +400,15 @@ const a = class { private p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -389,7 +433,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -427,14 +471,31 @@ Shape signatures in builder refreshed for:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 915 + "size": 1092 } @@ -547,7 +608,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js index 88aa8ab1d78e5..aa82569939323 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js @@ -29,7 +29,15 @@ declare const console: { log(msg: any): void; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -53,7 +61,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -186,7 +202,15 @@ const a = class { private p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -250,7 +274,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js index fccce1b0aca1a..c5e7835dfe2a1 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js @@ -932,7 +932,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -993,11 +993,11 @@ exitCode:: ExitStatus.Success "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 2067 + "size": 2064 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js index 8f1f23c63cb36..22d2cdf78693b 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js @@ -926,7 +926,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -985,11 +985,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js index 2800317eec331..1d61ea8d75c16 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js @@ -59,7 +59,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -118,11 +118,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1514 + "size": 1511 } @@ -523,7 +523,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -584,11 +584,11 @@ exitCode:: ExitStatus.Success "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 2067 + "size": 2064 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js index 2529fa735c64f..2a01de3cdc67c 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js @@ -60,7 +60,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -119,11 +119,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } @@ -520,7 +520,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["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; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -579,11 +579,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js index cd2f61f6196b1..dedd245a71f22 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -1,5 +1,6 @@ 3:: no-change-run -*** Needs explanation +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: CleanBuild: { diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js index a72779db62853..690283be6b9ae 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -162,7 +162,29 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -192,7 +214,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -229,12 +251,50 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 900 + "size": 1362 } @@ -245,7 +305,29 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -276,7 +358,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -314,12 +396,50 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts | DtsMap", - false + "Js | DtsEmit | DtsMap", + 49 ], "version": "FakeTSVersion", - "size": 922 + "size": 1384 } @@ -635,7 +755,23 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration -exitCode:: ExitStatus.Success +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -665,7 +801,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -702,12 +838,38 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 899 + "size": 1215 } @@ -718,7 +880,23 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap -exitCode:: ExitStatus.Success +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -749,7 +927,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -787,12 +965,38 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts | DtsMap", - false + "Js | DtsEmit | DtsMap", + 49 ], "version": "FakeTSVersion", - "size": 921 + "size": 1237 } @@ -806,7 +1010,15 @@ export const c = class { public p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap -exitCode:: ExitStatus.Success +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/d.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts", @@ -842,7 +1054,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["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; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -880,11 +1092,25 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts | DtsMap", - false + "Js | DtsEmit | DtsMap", + 49 ], "version": "FakeTSVersion", - "size": 920 + "size": 1090 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js index b46db7303a9cd..e775985e62a97 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -35,7 +35,15 @@ declare const console: { log(msg: any): void; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -64,7 +72,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -93,12 +101,26 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 748 + "size": 918 } @@ -109,7 +131,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -174,7 +204,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -204,11 +234,11 @@ No shapes updated in the builder:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 733 + "size": 730 } @@ -378,7 +408,15 @@ export const a = class { private p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" @@ -407,7 +445,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -436,12 +474,26 @@ No shapes updated in the builder:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 748 + "size": 918 } @@ -560,7 +612,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts", "/home/src/projects/project/b.ts" diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js index 57a511c4d29d7..3c6f932c43fa1 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js @@ -31,7 +31,15 @@ declare const console: { log(msg: any): void; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -56,7 +64,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -78,12 +86,26 @@ No shapes updated in the builder:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 674 + "size": 843 } @@ -94,7 +116,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] @@ -152,7 +182,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -175,11 +205,11 @@ No shapes updated in the builder:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 658 + "size": 655 } @@ -317,7 +347,15 @@ const a = class { private p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -342,7 +380,7 @@ No shapes updated in the builder:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -364,12 +402,26 @@ No shapes updated in the builder:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 674 + "size": 843 } @@ -467,7 +519,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ "/home/src/projects/project/a.ts" ] diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js index 0550ff0817cef..d1bbaee52a143 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js @@ -30,7 +30,15 @@ declare const console: { log(msg: any): void; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -55,7 +63,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -193,7 +209,15 @@ const a = class { private p = 10; }; Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] @@ -259,7 +283,15 @@ Input:: Output:: /lib/tsc -p /home/src/projects/project --noEmit -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: [ "/home/src/projects/project/a.ts" ] diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js index f1f662d00bdaa..847f269056ac9 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js @@ -87,7 +87,7 @@ Shape signatures in builder refreshed for:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[2,3,4],"version":"FakeTSVersion"} +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]],"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -148,22 +148,45 @@ Shape signatures in builder refreshed for:: "../shared/types/db.ts" ] }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "affectedFilesPendingEmit": [ [ - "../shared/types/db.ts", - "Js | Dts" + [ + "../shared/types/db.ts", + 17 + ], + "Js | DtsEmit" ], [ - "../src/main.ts", - "Js | Dts" + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" ], [ - "../src/other.ts", - "Js | Dts" + [ + "../src/other.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 994 + "size": 1182 } diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js index 379191a1ee239..d3cadfee88a02 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js @@ -85,7 +85,7 @@ No shapes updated in the builder:: //// [/user/username/projects/dev-build.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] { @@ -120,12 +120,26 @@ No shapes updated in the builder:: "noEmitOnError": true, "outFile": "./dev-build.js" }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 954 + "size": 1124 } diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js index f27a3129e9b76..85fbaf20fada4 100644 --- a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -36,12 +36,17 @@ Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -82,18 +87,38 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 752 + "size": 935 } @@ -171,7 +196,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -218,16 +243,22 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./b.ts", - "Js | Dts" + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 813 + "size": 823 } @@ -461,12 +492,17 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -515,14 +551,31 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1023 + "size": 1201 } @@ -716,7 +769,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js index 9cd791e43d971..2900fea6b2905 100644 --- a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js @@ -33,12 +33,17 @@ Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -75,14 +80,31 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 733 + "size": 910 } @@ -154,7 +176,7 @@ Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -194,12 +216,15 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./a.ts", - "Js | Dts" + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 774 + "size": 779 } @@ -403,12 +428,17 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"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; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -446,14 +476,31 @@ Output:: "options": { "declaration": true }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "./a.ts", - "Js | Dts" + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 917 + "size": 1094 } @@ -630,7 +677,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js index 41b878dea3be3..b684b5e5ac509 100644 --- a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js @@ -32,7 +32,12 @@ Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -256,7 +261,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -373,7 +383,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js index c05ac4afcab80..69d678475c081 100644 --- a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -38,12 +38,17 @@ Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -72,12 +77,26 @@ Output:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 750 + "size": 920 } @@ -154,7 +173,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -184,11 +203,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 735 + "size": 732 } @@ -415,12 +434,17 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["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; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -449,12 +473,26 @@ Output:: "module": 2, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 750 + "size": 920 } @@ -645,7 +683,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js index ab5369b91ee84..77e8634b377cc 100644 --- a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js @@ -34,12 +34,17 @@ Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -61,12 +66,26 @@ Output:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 676 + "size": 845 } @@ -137,7 +156,7 @@ Output:: //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -160,11 +179,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 660 + "size": 657 } @@ -356,12 +375,17 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["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; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -383,12 +407,26 @@ Output:: "declaration": true, "outFile": "./outFile.js" }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 676 + "size": 845 } @@ -552,7 +590,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js index fed784d49e10d..ec750180d6af2 100644 --- a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js @@ -33,7 +33,12 @@ Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -260,7 +265,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -380,7 +390,12 @@ Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... -[HH:MM:SS AM] Found 0 errors. Watching for file changes. +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js index 5ae856da46ba1..e547ba209f917 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js @@ -746,7 +746,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"affectedFilesPendingEmit":[3],"version":"FakeTSVersion"} +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"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; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[3,17]],"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -815,14 +815,31 @@ Output:: "../shared/types/db.ts" ] }, - "affectedFilesPendingEmit": [ + "emitDiagnosticsPerFile": [ [ "../src/main.ts", - "Js | Dts" + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1245 + "size": 1423 } diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js index 936ce1f6e5bee..b8d246c4cbba8 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js @@ -622,7 +622,7 @@ Output:: //// [/user/username/projects/dev-build.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["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; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] { @@ -657,12 +657,26 @@ Output:: "noEmitOnError": true, "outFile": "./dev-build.js" }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 954 + "size": 1124 } diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js index 3776cacb25e13..a41ac165d9053 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js @@ -37,7 +37,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2,3],"emitSignatures":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"emitSignatures":[2,3],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -80,12 +80,18 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./other.ts", - "Js | Dts" + [ + "./other.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -93,7 +99,7 @@ Output:: "./other.ts" ], "version": "FakeTSVersion", - "size": 678 + "size": 688 } @@ -329,7 +335,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17]],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -380,13 +386,16 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ] ], "latestChangedDtsFile": "./other.d.ts", "version": "FakeTSVersion", - "size": 845 + "size": 850 } diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js index cf6d3b461bd45..2fbc61c6b4f37 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js @@ -37,7 +37,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2,3],"emitSignatures":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"emitSignatures":[2,3],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -80,12 +80,18 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./other.ts", - "Js | Dts" + [ + "./other.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -93,7 +99,7 @@ Output:: "./other.ts" ], "version": "FakeTSVersion", - "size": 678 + "size": 688 } @@ -343,7 +349,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \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; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17]],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -394,13 +400,16 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ] ], "latestChangedDtsFile": "./other.d.ts", "version": "FakeTSVersion", - "size": 845 + "size": 850 } diff --git a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js index dfe16f26a87b1..3f894449e27a1 100644 --- a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js @@ -39,7 +39,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -69,11 +69,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 657 + "size": 654 } @@ -293,7 +293,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -325,11 +325,11 @@ Output:: "outSignature": "3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 855 + "size": 852 } diff --git a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js index 120dead41e909..d8f63bf18236b 100644 --- a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js @@ -39,7 +39,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -69,11 +69,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 657 + "size": 654 } @@ -307,7 +307,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \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; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -339,11 +339,11 @@ Output:: "outSignature": "3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 855 + "size": 852 } From 32a807519fb96b8caab52603bf2931369d536ff6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 28 Jun 2024 09:55:39 -0700 Subject: [PATCH 5/7] Refactor getDeclarationDiagnostics to cache the diagnostics since they are anyways calculated per file --- src/compiler/program.ts | 71 ++++++++--------------- src/compiler/transformers/declarations.ts | 27 +++++---- src/compiler/types.ts | 2 +- 3 files changed, 41 insertions(+), 59 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index e34c604ee1318..cf0322c320b72 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1165,11 +1165,6 @@ function getLibFileNameFromLibReference(libReference: FileReference) { return libMap.get(libName); } -interface DiagnosticCache { - perFile?: Map; - allDiagnostics?: readonly T[]; -} - /** @internal */ export function isReferencedFile(reason: FileIncludeReason | undefined): reason is ReferencedFile { switch (reason?.kind) { @@ -1555,8 +1550,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg let filesWithReferencesProcessed: Set | undefined; let fileReasonsToChain: Map | undefined; let reasonToRelatedInfo: Map | undefined; - const cachedBindAndCheckDiagnosticsForFile: DiagnosticCache = {}; - const cachedDeclarationDiagnosticsForFile: DiagnosticCache = {}; + let cachedBindAndCheckDiagnosticsForFile: Map | undefined; + let cachedDeclarationDiagnosticsForFile: Map | undefined; let fileProcessingDiagnostics: FilePreprocessingDiagnostics[] | undefined; let automaticTypeDirectiveNames: string[] | undefined; @@ -2921,10 +2916,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg ); } - function getCachedSemanticDiagnostics(sourceFile?: SourceFile): readonly Diagnostic[] | undefined { - return sourceFile - ? cachedBindAndCheckDiagnosticsForFile.perFile?.get(sourceFile.path) - : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; + function getCachedSemanticDiagnostics(sourceFile: SourceFile): readonly Diagnostic[] | undefined { + return cachedBindAndCheckDiagnosticsForFile?.get(sourceFile.path); } function getBindAndCheckDiagnostics(sourceFile: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[] { @@ -2945,14 +2938,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } function getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[] { - const options = program.getCompilerOptions(); - // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit) - if (!sourceFile || options.outFile) { - return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); - } - else { - return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); - } + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); } function getSyntacticDiagnosticsForFile(sourceFile: SourceFile): readonly DiagnosticWithLocation[] { @@ -3001,7 +2987,14 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg if (nodesToCheck) { return getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck); } - return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache); + let result = cachedBindAndCheckDiagnosticsForFile?.get(sourceFile.path); + if (!result) { + (cachedBindAndCheckDiagnosticsForFile ??= new Map()).set( + sourceFile.path, + result = getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken), + ); + } + return result; } function getBindAndCheckDiagnosticsForFileNoCache( @@ -3361,11 +3354,18 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function getDeclarationDiagnosticsWorker(sourceFile: SourceFile | undefined, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { - return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + function getDeclarationDiagnosticsWorker(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { + let result = cachedDeclarationDiagnosticsForFile?.get(sourceFile.path); + if (!result) { + (cachedDeclarationDiagnosticsForFile ??= new Map()).set( + sourceFile.path, + result = getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken), + ); + } + return result; } - function getDeclarationDiagnosticsForFileNoCache(sourceFile: SourceFile | undefined, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { + function getDeclarationDiagnosticsForFileNoCache(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { return runWithCancellationToken(() => { const resolver = getTypeChecker().getEmitResolver(sourceFile, cancellationToken); // Don't actually write any files since we're just getting diagnostics. @@ -3373,31 +3373,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function getAndCacheDiagnostics( - sourceFile: T, - cancellationToken: CancellationToken | undefined, - cache: DiagnosticCache, - getDiagnostics: (sourceFile: T, cancellationToken: CancellationToken | undefined) => readonly U[], - ): readonly U[] { - const cachedResult = sourceFile - ? cache.perFile?.get(sourceFile.path) - : cache.allDiagnostics; - - if (cachedResult) { - return cachedResult; - } - const result = getDiagnostics(sourceFile, cancellationToken); - if (sourceFile) { - (cache.perFile || (cache.perFile = new Map())).set(sourceFile.path, result); - } - else { - cache.allDiagnostics = result; - } - return result; - } - function getDeclarationDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { - return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); + return sourceFile.isDeclarationFile ? emptyArray : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } function getOptionsDiagnostics(): SortedReadonlyArray { diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 14c90c911039e..97d3d4626e600 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -214,19 +214,24 @@ import { } from "../_namespaces/ts.js"; /** @internal */ -export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): DiagnosticWithLocation[] | undefined { +export function getDeclarationDiagnostics( + host: EmitHost, + resolver: EmitResolver, + file: SourceFile, +): DiagnosticWithLocation[] | undefined { const compilerOptions = host.getCompilerOptions(); const files = filter(getSourceFilesToEmit(host, file), isSourceFileNotJson); - const result = transformNodes( - resolver, - host, - factory, - compilerOptions, - file ? contains(files, file) ? [file] : emptyArray : files, - [transformDeclarations], - /*allowDtsFiles*/ false, - ); - return result.diagnostics; + return contains(files, file) ? + transformNodes( + resolver, + host, + factory, + compilerOptions, + [file], + [transformDeclarations], + /*allowDtsFiles*/ false, + ).diagnostics : + undefined; } const declarationEmitNodeBuilderFlags = NodeBuilderFlags.MultilineObjectLiterals | diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 62fae4c0e57c2..508042f69bee8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4733,7 +4733,7 @@ export interface Program extends ScriptReferenceHost { /** @internal */ getCommonSourceDirectory(): string; - /** @internal */ getCachedSemanticDiagnostics(sourceFile?: SourceFile): readonly Diagnostic[] | undefined; + /** @internal */ getCachedSemanticDiagnostics(sourceFile: SourceFile): readonly Diagnostic[] | undefined; /** @internal */ getClassifiableNames(): Set<__String>; From 4eae97418b9a30052a19c5f7207dd403fce60485 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 28 Jun 2024 11:42:44 -0700 Subject: [PATCH 6/7] Remove unnecessary changes --- src/compiler/builder.ts | 43 ++++++++------------ src/testRunner/unittests/helpers/baseline.ts | 2 +- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 545306400bded..6784485d21cac 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -100,13 +100,6 @@ export interface ReusableDiagnostic extends ReusableDiagnosticRelatedInformation skippedOn?: keyof CompilerOptions; } -/** @internal */ -export interface ReusableDiagnosticWithLocation extends ReusableDiagnostic { - file: string | undefined; - start: number; - length: number; -} - /** @internal */ export interface ReusableDiagnosticRelatedInformation { category: DiagnosticCategory; @@ -145,7 +138,7 @@ export interface ReusableBuilderProgramState extends BuilderState { */ semanticDiagnosticsPerFile: Map; /** Cache of dts emit diagnostics for files with their Path being the key */ - emitDiagnosticsPerFile?: Map | undefined; + emitDiagnosticsPerFile?: Map | undefined; /** * The map has key by source file's path that has been changed */ @@ -218,7 +211,7 @@ export interface BuilderProgramState extends BuilderState, ReusableBuilderProgra */ semanticDiagnosticsPerFile: Map; /** Cache of dts emit diagnostics for files with their Path being the key */ - emitDiagnosticsPerFile?: Map | undefined; + emitDiagnosticsPerFile?: Map | undefined; /** * The map has key by source file's path that has been changed */ @@ -767,9 +760,7 @@ function getNextAffectedFilePendingEmit( emitOnlyDtsFiles, isForDtsErrors, ); - if (pendingKind) { - return { affectedFile, emitKind: pendingKind }; - } + if (pendingKind) return { affectedFile, emitKind: pendingKind }; }); } @@ -1079,13 +1070,11 @@ export type IncrementalBuildInfoFileIdListId = number & { __incrementalBuildInfo /** @internal */ export type IncrementalBuildInfoDiagnosticOfFile = [fileId: IncrementalBuildInfoFileId, diagnostics: readonly ReusableDiagnostic[]]; /** @internal */ -export type IncrementalBuildInfoEmitDiagnosticOfFile = [fileId: IncrementalBuildInfoFileId, diagnostics: readonly ReusableDiagnosticWithLocation[]]; -/** @internal */ export type IncrementalBuildInfoDiagnostic = | IncrementalBuildInfoFileId // File is not in changedSet and still doesnt have cached diagnostics | IncrementalBuildInfoDiagnosticOfFile; // Diagnostics for file /** @internal */ -export type IncrementalBuildInfoEmitDiagnostic = IncrementalBuildInfoEmitDiagnosticOfFile; // Diagnostics for file +export type IncrementalBuildInfoEmitDiagnostic = IncrementalBuildInfoDiagnosticOfFile; // Diagnostics for the file /** * fileId if pending emit is same as what compilerOptions suggest @@ -1497,7 +1486,7 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { const value = state.emitDiagnosticsPerFile.get(key)!; result = append(result, [ toFileId(key), - toReusableDiagnostic(value, key) as ReusableDiagnosticWithLocation[], + toReusableDiagnostic(value, key), ]); } return result; @@ -1871,16 +1860,16 @@ export function createBuilderProgram( getPendingEmitKind(state.programEmitPending, emitKind) : undefined; state.seenProgramEmit = emitKind | (state.seenProgramEmit || BuilderFileEmit.None); - setEmitDiagnosticsPerFile(result.diagnostics as readonly DiagnosticWithLocation[]); + setEmitDiagnosticsPerFile(result.diagnostics); state.buildInfoEmitPending = true; } return { result, affected }; } - function setEmitDiagnosticsPerFile(diagnostics: readonly DiagnosticWithLocation[]) { + function setEmitDiagnosticsPerFile(diagnostics: readonly Diagnostic[]) { // Update the d.ts diagnostics since they always come with Location, skip diagnsotics without file, // they could be semantic diagnsotic with noEmitOnError or other kind of diagnostics - let emitDiagnosticsPerFile: Map | undefined; + let emitDiagnosticsPerFile: Map | undefined; diagnostics.forEach(d => { if (!d.file) return; // Dont cache without fileName let diagnostics = emitDiagnosticsPerFile?.get(d.file.resolvedPath); @@ -2070,7 +2059,7 @@ export function createBuilderProgram( targetSourceFile, emitOnlyDtsFiles, /*isForDtsErrors*/ false, - emitResult.diagnostics as readonly DiagnosticWithLocation[], + emitResult.diagnostics, ); return emitResult; } @@ -2083,7 +2072,7 @@ export function createBuilderProgram( ) { if (!targetSourceFile && kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors); - setEmitDiagnosticsPerFile(diagnostics as readonly DiagnosticWithLocation[]); + setEmitDiagnosticsPerFile(diagnostics); } } @@ -2095,7 +2084,7 @@ export function createBuilderProgram( if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); let affectedEmitResult: AffectedFileResult; - let diagnostics: DiagnosticWithLocation[] | undefined; + let diagnostics: Diagnostic[] | undefined; while ( affectedEmitResult = emitNextAffectedFileOrDtsErrors( /*writeFile*/ undefined, @@ -2105,11 +2094,11 @@ export function createBuilderProgram( /*isForDtsErrors*/ true, ) ) { - if (!sourceFile) diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics as DiagnosticWithLocation[]); + if (!sourceFile) diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics); } - return !sourceFile ? - diagnostics || emptyArray : - state.emitDiagnosticsPerFile?.get(sourceFile.resolvedPath) || emptyArray; + return ( + !sourceFile ? diagnostics : state.emitDiagnosticsPerFile?.get(sourceFile.resolvedPath) + ) as readonly DiagnosticWithLocation[] | undefined || emptyArray; } else { const result = state.program.getDeclarationDiagnostics(sourceFile, cancellationToken); @@ -2390,7 +2379,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( return semanticDiagnostics; } - function toPerFileEmitDiagnostics(diagnostics: readonly IncrementalBuildInfoEmitDiagnostic[] | undefined): Map | undefined { + function toPerFileEmitDiagnostics(diagnostics: readonly IncrementalBuildInfoEmitDiagnostic[] | undefined): Map | undefined { return diagnostics && arrayToMap(diagnostics, value => toFilePath(value[0]), value => value[1]); } } diff --git a/src/testRunner/unittests/helpers/baseline.ts b/src/testRunner/unittests/helpers/baseline.ts index 6eea4febf8f07..7f5cc3e7390cd 100644 --- a/src/testRunner/unittests/helpers/baseline.ts +++ b/src/testRunner/unittests/helpers/baseline.ts @@ -137,7 +137,7 @@ export function generateSourceMapBaselineFiles(sys: ts.System & { writtenFiles: export type ReadableIncrementalBuildInfoDiagnosticOfFile = [file: string, diagnostics: readonly ts.ReusableDiagnostic[]]; export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached or not changed"] | ReadableIncrementalBuildInfoDiagnosticOfFile; -export type ReadableIncrementalBuildInfoEmitDiagnostic = [file: string, diagnostics: readonly ts.ReusableDiagnosticWithLocation[]]; +export type ReadableIncrementalBuildInfoEmitDiagnostic = ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableBuilderFileEmit = string & { __readableBuilderFileEmit: any; }; export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [file: string] | [file: string, emitKind: ts.BuilderFileEmit], emitKind: ReadableBuilderFileEmit]; export type ReadableIncrementalBuildInfoEmitSignature = string | [file: string, signature: ts.EmitSignature | []]; From ad2102d9b47a3cb7a68bf4c1c8ed61d2abe5a147 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 28 Jun 2024 13:36:24 -0700 Subject: [PATCH 7/7] lint!!! --- src/testRunner/unittests/helpers/noEmit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testRunner/unittests/helpers/noEmit.ts b/src/testRunner/unittests/helpers/noEmit.ts index 3278f00bf6532..b097144ec9f0e 100644 --- a/src/testRunner/unittests/helpers/noEmit.ts +++ b/src/testRunner/unittests/helpers/noEmit.ts @@ -239,7 +239,7 @@ export function forEachNoEmitDtsChanges(commandType: string[]) { modifyFs: asModules ? fs => fs.writeFileSync("/home/src/projects/project/b.ts", `export const b = 10;`) : undefined, - edits: editsForDtsChanges(commandType, aContent, incremental, false), + edits: editsForDtsChanges(commandType, aContent, incremental, /*multiFile*/ false), baselinePrograms: true, }); })