From 79961d4aba90104c1318044bd99d5296ec7ad1c9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Sat, 23 Mar 2024 22:42:52 -0700 Subject: [PATCH 01/18] Add --noCheck flag, mirroring --noEmit, allowing emitting transpiling/declarations without full checking --- src/compiler/commandLineParser.ts | 9 +++++++++ src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/types.ts | 1 + src/compiler/utilities.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + .../Default initialized TSConfig/tsconfig.json | 1 + .../Initialized TSConfig with --help/tsconfig.json | 1 + .../Initialized TSConfig with --watch/tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../noCheck/tsconfig.json | 5 +++++ .../does-not-add-color-when-NO_COLOR-is-set.js | 5 +++++ ...putsSkipped-when-host-can't-provide-terminal-width.js | 5 +++++ ...-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js | 5 +++++ 20 files changed, 47 insertions(+) create mode 100644 tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index ade646ba086d0..8999a01a8f725 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -776,6 +776,15 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ transpileOptionValue: undefined, defaultValueDescription: false, }, + { + name: "noCheck", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported, + transpileOptionValue: undefined, + defaultValueDescription: false, + }, { name: "importHelpers", type: "boolean", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index dfbb41b3d409d..26de7cf66322a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -6223,6 +6223,10 @@ "category": "Message", "code": 6804 }, + "Disable full type checking (only critical parse and emit errors will be reported).": { + "category": "Message", + "code": 6805 + }, "one of:": { "category": "Message", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index ce6064fbdc409..20c237819e9ee 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7093,6 +7093,7 @@ export interface CompilerOptions { moduleDetection?: ModuleDetectionKind; newLine?: NewLineKind; noEmit?: boolean; + noCheck?: boolean; /** @internal */ noEmitForJsFiles?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 184f68b0c6221..fffdb1ad32738 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -9858,6 +9858,7 @@ export function skipTypeChecking(sourceFile: SourceFile, options: CompilerOption // '/// ' directive. return (options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib) || + options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName); } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 1601e677d29d5..36b56f7aaac7b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6918,6 +6918,7 @@ declare namespace ts { moduleDetection?: ModuleDetectionKind; newLine?: NewLineKind; noEmit?: boolean; + noCheck?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; diff --git a/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json index 81804ba2c2eac..1c54f0a890ad1 100644 --- a/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json index 81804ba2c2eac..1c54f0a890ad1 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json index 81804ba2c2eac..1c54f0a890ad1 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json index b5ac6cc2eb0d4..670e129a22a25 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index e8529643dcbce..dc477af09e324 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 57335d68845aa..0f81fff85ea87 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json index 491aeff0028e0..065ac2ba02dfc 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index f8c514215956d..87e08f0c1620f 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 81804ba2c2eac..1c54f0a890ad1 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index ce7a7c1fd229a..9d79e9f17fa18 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json index 6d0dbd4fb8afd..5ffe017d91741 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -58,6 +58,7 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ + // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json new file mode 100644 index 0000000000000..e115e386cb6e9 --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noCheck": true + } +} diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index 0da50d90ce6d0..9b1d844c23c6b 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -145,6 +145,11 @@ Disable emitting files from a compilation. type: boolean default: false +--noCheck +Disable full type checking (only critical parse and emit errors will be reported). +type: boolean +default: false + --strict Enable all strict type-checking options. type: boolean diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 948f93ad35f21..8ed92d0593cbb 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -145,6 +145,11 @@ Disable emitting files from a compilation. type: boolean default: false +--noCheck +Disable full type checking (only critical parse and emit errors will be reported). +type: boolean +default: false + --strict Enable all strict type-checking options. type: boolean diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 948f93ad35f21..8ed92d0593cbb 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -145,6 +145,11 @@ Disable emitting files from a compilation. type: boolean default: false +--noCheck +Disable full type checking (only critical parse and emit errors will be reported). +type: boolean +default: false + --strict Enable all strict type-checking options. type: boolean From 540ce28dcf5b4b6f902384f1a3e2907b1577e5cf Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Sun, 24 Mar 2024 03:34:46 -0700 Subject: [PATCH 02/18] Test .d.ts emit on noCheck (js is pretty hopelessly broken without disentagling NodeCheckFlags and .referenced from the checkers full traversal) --- src/compiler/emitter.ts | 4 ++-- src/harness/harnessIO.ts | 27 ++++++++++++++++++++++++--- src/testRunner/compilerRunner.ts | 3 +-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 15e1847f72ac3..9b6ae76b67085 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -845,8 +845,8 @@ export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFi const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson); // Setup and perform the transformation to retrieve declarations from the input files const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit; - if (emitOnly && !getEmitDeclarations(compilerOptions)) { - // Checker wont collect the linked aliases since thats only done when declaration is enabled. + if ((emitOnly && !getEmitDeclarations(compilerOptions)) || compilerOptions.noCheck) { + // Checker wont collect the linked aliases since thats only done when declaration is enabled and checking is performed. // Do that here when emitting only dts files filesForEmit.forEach(collectLinkedAliases); } diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 36a138f30aa23..39bc8195e258d 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -370,6 +370,8 @@ export namespace Compiler { fileOptions?: any; } + export type CompileFilesResult = compiler.CompilationResult & { repeat(newOptions: ts.CompilerOptions): CompileFilesResult }; + export function compileFiles( inputFiles: TestFile[], otherFiles: TestFile[], @@ -378,7 +380,7 @@ export namespace Compiler { // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file currentDirectory: string | undefined, symlinks?: vfs.FileSet, - ): compiler.CompilationResult { + ): CompileFilesResult { const options: ts.CompilerOptions & HarnessOptions = compilerOptions ? ts.cloneCompilerOptions(compilerOptions) : { noResolve: false }; options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed; options.noErrorTruncation = true; @@ -427,7 +429,8 @@ export namespace Compiler { const host = new fakes.CompilerHost(fs, options); const result = compiler.compileFiles(host, programFileNames, options, typeScriptVersion); result.symlinks = symlinks; - return result; + (result as CompileFilesResult).repeat = newOptions => compileFiles(inputFiles, otherFiles, harnessSettings, {...compilerOptions, ...newOptions}, currentDirectory, symlinks); + return result as CompileFilesResult; } export interface DeclarationCompilationContext { @@ -919,7 +922,7 @@ export namespace Compiler { return "\n//// https://sokra.github.io/source-map-visualization" + hash + "\n"; } - export function doJsEmitBaseline(baselinePath: string, header: string, options: ts.CompilerOptions, result: compiler.CompilationResult, tsConfigFiles: readonly TestFile[], toBeCompiled: readonly TestFile[], otherFiles: readonly TestFile[], harnessSettings: TestCaseParser.CompilerSettings) { + export function doJsEmitBaseline(baselinePath: string, header: string, options: ts.CompilerOptions, result: CompileFilesResult, tsConfigFiles: readonly TestFile[], toBeCompiled: readonly TestFile[], otherFiles: readonly TestFile[], harnessSettings: TestCaseParser.CompilerSettings) { if (!options.noEmit && !options.emitDeclarationOnly && result.js.size === 0 && result.diagnostics.length === 0) { throw new Error("Expected at least one js file to be emitted or at least one error to be created."); } @@ -971,9 +974,27 @@ export namespace Compiler { jsCode += "\r\n\r\n"; jsCode += getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics); } + else if (!options.noCheck && !options.noEmit) { + const withoutChecking = result.repeat({noCheck: true}); + compareResultFileSets(withoutChecking.dts, result.dts); + } // eslint-disable-next-line no-null/no-null Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ts.Extension.Js), jsCode.length > 0 ? tsCode + "\r\n\r\n" + jsCode : null); + + function compareResultFileSets(a: ReadonlyMap, b: ReadonlyMap) { + a.forEach((doc, key) => { + const original = b.get(key); + if (!original) { + jsCode += `\r\n\r\n!!!! File ${Utils.removeTestPathPrefixes(doc.file)} missing from original emit, but present in noCheck emit\r\n`; + jsCode += fileOutput(doc, harnessSettings); + } + else if (original.text !== doc.text) { + jsCode += `\r\n\r\n!!!! File ${Utils.removeTestPathPrefixes(doc.file)} differs from original emit in noCheck emit\r\n`; + jsCode += fileOutput(doc, harnessSettings); + } + }); + } } function fileOutput(file: documents.TextDocument, harnessSettings: TestCaseParser.CompilerSettings): string { diff --git a/src/testRunner/compilerRunner.ts b/src/testRunner/compilerRunner.ts index 8d4c0b1547c4e..9b950e5dc8bd1 100644 --- a/src/testRunner/compilerRunner.ts +++ b/src/testRunner/compilerRunner.ts @@ -1,4 +1,3 @@ -import * as compiler from "./_namespaces/compiler"; import { Baseline, Compiler, @@ -171,7 +170,7 @@ class CompilerTest { private configuredName: string; private harnessSettings: TestCaseParser.CompilerSettings; private hasNonDtsFiles: boolean; - private result: compiler.CompilationResult; + private result: Compiler.CompileFilesResult; private options: ts.CompilerOptions; private tsConfigFiles: Compiler.TestFile[]; // equivalent to the files that will be passed on the command line From 3f89f5c9fd58a1a22949c8610ada22863bb22c54 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Sun, 24 Mar 2024 04:37:32 -0700 Subject: [PATCH 03/18] Fix harness issues, js declaration emit issues with out of order checking, accept baselines with extra output due to less errors, or union order changes --- src/compiler/checker.ts | 2 + src/harness/harnessIO.ts | 7 +- .../reference/deferredLookupTypeResolution.js | 26 +++ tests/baselines/reference/indexSignatures1.js | 195 ++++++++++++++++++ .../reference/jsDeclarationsCrossfileMerge.js | 6 + tests/baselines/reference/noEmitOnError.js | 11 + tests/baselines/reference/variadicTuples1.js | 178 ++++++++++++++++ .../reference/weakTypesAndLiterals01.js | 18 ++ 8 files changed, 440 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/noEmitOnError.js diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ad13bd597db39..da1d7212379f8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9038,6 +9038,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function serializeSymbol(symbol: Symbol, isPrivate: boolean, propertyAsAlias: boolean): void { + void getPropertiesOfType(getTypeOfSymbol(symbol)); // resolve symbol's type and properties, which should trigger any required merges // cache visited list based on merged symbol, since we want to use the unmerged top-level symbol, but // still skip reserializing it if we encounter the merged product later on const visitedSym = getMergedSymbol(symbol); @@ -48936,6 +48937,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); } + resolveExternalModuleSymbol(sym); // ensures cjs export assignment is setup return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled); }, isImportRequiredByAugmentation, diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 39bc8195e258d..26c32fe963dd3 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -370,7 +370,7 @@ export namespace Compiler { fileOptions?: any; } - export type CompileFilesResult = compiler.CompilationResult & { repeat(newOptions: ts.CompilerOptions): CompileFilesResult }; + export type CompileFilesResult = compiler.CompilationResult & { repeat(newOptions: TestCaseParser.CompilerSettings): CompileFilesResult }; export function compileFiles( inputFiles: TestFile[], @@ -381,6 +381,7 @@ export namespace Compiler { currentDirectory: string | undefined, symlinks?: vfs.FileSet, ): CompileFilesResult { + const originalCurrentDirectory = currentDirectory; const options: ts.CompilerOptions & HarnessOptions = compilerOptions ? ts.cloneCompilerOptions(compilerOptions) : { noResolve: false }; options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed; options.noErrorTruncation = true; @@ -429,7 +430,7 @@ export namespace Compiler { const host = new fakes.CompilerHost(fs, options); const result = compiler.compileFiles(host, programFileNames, options, typeScriptVersion); result.symlinks = symlinks; - (result as CompileFilesResult).repeat = newOptions => compileFiles(inputFiles, otherFiles, harnessSettings, {...compilerOptions, ...newOptions}, currentDirectory, symlinks); + (result as CompileFilesResult).repeat = newOptions => compileFiles(inputFiles, otherFiles, {...harnessSettings, ...newOptions}, compilerOptions, originalCurrentDirectory, symlinks); return result as CompileFilesResult; } @@ -975,7 +976,7 @@ export namespace Compiler { jsCode += getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics); } else if (!options.noCheck && !options.noEmit) { - const withoutChecking = result.repeat({noCheck: true}); + const withoutChecking = result.repeat({noCheck: "true"}); compareResultFileSets(withoutChecking.dts, result.dts); } diff --git a/tests/baselines/reference/deferredLookupTypeResolution.js b/tests/baselines/reference/deferredLookupTypeResolution.js index 8069483245dc1..ef66d2d56cffa 100644 --- a/tests/baselines/reference/deferredLookupTypeResolution.js +++ b/tests/baselines/reference/deferredLookupTypeResolution.js @@ -62,3 +62,29 @@ declare function f3(x: 'a' | 'b'): { b: any; x: any; }; + + +!!!! File deferredLookupTypeResolution.d.ts differs from original emit in noCheck emit +//// [deferredLookupTypeResolution.d.ts] +type StringContains = ({ + [K in S]: 'true'; +} & { + [key: string]: 'false'; +})[L]; +type ObjectHasKey = StringContains, L>; +type First = ObjectHasKey; +type T1 = ObjectHasKey<{ + a: string; +}, 'a'>; +type T2 = ObjectHasKey<{ + a: string; +}, 'b'>; +declare function f1(a: A, b: B): { + [P in A | B]: any; +}; +declare function f2(a: A): { [P in A | "x"]: any; }; +declare function f3(x: 'a' | 'b'): { + x: any; + a: any; + b: any; +}; diff --git a/tests/baselines/reference/indexSignatures1.js b/tests/baselines/reference/indexSignatures1.js index 68035dcd39231..876e3eddfcbe4 100644 --- a/tests/baselines/reference/indexSignatures1.js +++ b/tests/baselines/reference/indexSignatures1.js @@ -680,3 +680,198 @@ type Rec1 = { type Rec2 = Record; type K1 = keyof Rec1; type K2 = keyof Rec2; + + +!!!! File indexSignatures1.d.ts differs from original emit in noCheck emit +//// [indexSignatures1.d.ts] +declare const sym: unique symbol; +declare function gg3(x: { + [key: string]: string; +}, y: { + [key: symbol]: string; +}, z: { + [sym]: number; +}): void; +declare function gg1(x: { + [key: `a${string}`]: string; + [key: `${string}a`]: string; +}, y: { + [key: `a${string}a`]: string; +}): void; +interface IX { + [key: `a${string}`]: string; + [key: `${string}a`]: string; +} +interface IY { + [key: `a${string}a`]: string; +} +declare function gg2(x: IX, y: IY): void; +declare let combo: { + [x: `foo-${string}`]: 'a' | 'b'; +} & { + [x: `${string}-bar`]: 'b' | 'c'; +}; +declare const x1: "a" | "b"; +declare const x2: "b" | "c"; +declare const x3: "b"; +declare var str: string; +declare const x4: "a" | "b"; +declare const x5: "b" | "c"; +declare const x6: "b"; +declare let combo2: { + [x: `${string}xxx${string}` & `${string}yyy${string}`]: string; +}; +declare const x7: string; +declare const x8: string; +declare const x9: any; +declare let dom: { + [x: `data${string}`]: string; +}; +declare const y1: string; +declare const y2: string; +type Funcs = { + [key: `s${string}`]: (x: string) => void; + [key: `n${string}`]: (x: number) => void; +}; +declare const funcs: Funcs; +type Duplicates = { + [key: string | number]: any; + [key: number | symbol]: any; + [key: symbol | `foo${string}`]: any; + [key: `foo${string}`]: any; +}; +type Conflicting = { + [key: `a${string}`]: 'a'; + [key: `${string}a`]: 'b'; + [key: `a${string}a`]: 'c'; +}; +type Invalid = { + [key: 'a' | 'b' | 'c']: string; + [key: T | number]: string; + [key: Error]: string; + [key: T & string]: string; +}; +type Tag1 = { + __tag1__: void; +}; +type Tag2 = { + __tag2__: void; +}; +type TaggedString1 = string & Tag1; +type TaggedString2 = string & Tag2; +declare let s0: string; +declare let s1: TaggedString1; +declare let s2: TaggedString2; +declare let s3: TaggedString1 | TaggedString2; +declare let s4: TaggedString1 & TaggedString2; +interface I1 { + [key: TaggedString1]: string; +} +interface I2 { + [key: TaggedString2]: string; +} +interface I3 { + [key: TaggedString1 | TaggedString2]: string; +} +interface I4 { + [key: TaggedString1 & TaggedString2]: string; +} +declare let i1: I1; +declare let i2: I2; +declare let i3: I3; +declare let i4: I4; +declare let o1: { + [key: TaggedString1]: string; +}; +declare let o2: { + [key: TaggedString2]: string; +}; +declare let o3: { + [key: TaggedString1 | TaggedString2]: string; +}; +declare let o4: { + [key: TaggedString1 & TaggedString2]: string; +}; +declare const obj10: { + [x: string]: 0 | 1; + x: 0; +}; +declare const obj11: { + [x: number]: 2 | 3; + 1: 2; +}; +declare const obj12: { + [x: symbol]: 4 | 5; + [sym]: 4; +}; +declare const obj13: { + [x: string]: 0 | 1 | 2 | 3; + [x: number]: 2 | 3; + [x: symbol]: 4 | 5; + x: 0; + 1: 2; + [sym]: 4; +}; +declare const system: unique symbol; +declare const SomeSytePlugin: unique symbol; +interface Plugs { + [key: symbol]: (...args: any) => unknown; +} +declare const plugins: { + user: Plugs; + [system]: Plugs; +}; +declare var theAnswer: symbol; +declare var obj: Record; +declare const directive: unique symbol; +declare function foo(options: { + [x in string]: (arg: TArg) => TRet; +} & { + [directive]?: TDir; +}): void; +declare let case1: void; +declare let case2: void; +declare let case3: void; +type Pseudo = `&:${string}`; +declare const AmIPseudo1: Pseudo; +declare const AmIPseudo: Pseudo; +type PseudoDeclaration = { + [key in Pseudo]: string; +}; +declare const test: PseudoDeclaration; +type FieldPattern = `/${string}`; +declare const path1: FieldPattern; +declare const path2: FieldPattern; +type PathsObject = { + [P in FieldPattern]: object; +}; +declare const pathObject: PathsObject; +type IdType = `${number}-${number}-${number}-${number}`; +declare const id: IdType; +type A = Record; +declare const a: A; +declare let aid: string; +interface AA { + a?: string; + b?: number; + [key: symbol]: string; +} +declare const aa: AA; +declare const obj1: { + [key: symbol]: string; +}; +declare const obj2: { + [key: string]: string; +}; +declare const obj3: { + [key: number]: string; +}; +type Id = string & { + __tag: 'id '; +}; +type Rec1 = { + [key: Id]: number; +}; +type Rec2 = Record; +type K1 = keyof Rec1; +type K2 = keyof Rec2; diff --git a/tests/baselines/reference/jsDeclarationsCrossfileMerge.js b/tests/baselines/reference/jsDeclarationsCrossfileMerge.js index f4b06e5eaa883..ed5d9dbe7807f 100644 --- a/tests/baselines/reference/jsDeclarationsCrossfileMerge.js +++ b/tests/baselines/reference/jsDeclarationsCrossfileMerge.js @@ -27,3 +27,9 @@ module.exports.memberName = "thing"; declare const _exports: typeof m.default; export = _exports; import m = require("./exporter"); + + +!!!! File out/exporter.d.ts missing from original emit, but present in noCheck emit +//// [exporter.d.ts] +export default validate; +declare function validate(): void; diff --git a/tests/baselines/reference/noEmitOnError.js b/tests/baselines/reference/noEmitOnError.js new file mode 100644 index 0000000000000..d6e53fb9d4662 --- /dev/null +++ b/tests/baselines/reference/noEmitOnError.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/noEmitOnError.ts] //// + +//// [noEmitOnError.ts] +var x: number = ""; + + + + +!!!! File noEmitOnError.d.ts missing from original emit, but present in noCheck emit +//// [noEmitOnError.d.ts] +declare var x: number; diff --git a/tests/baselines/reference/variadicTuples1.js b/tests/baselines/reference/variadicTuples1.js index ddc781c45d674..80c6ef1449bde 100644 --- a/tests/baselines/reference/variadicTuples1.js +++ b/tests/baselines/reference/variadicTuples1.js @@ -833,3 +833,181 @@ type U3 = [...[string, number], boolean]; type ToStringLength1 = `${T['length']}`; type ToStringLength2 = `${[...T]['length']}`; type AnyArr = [...any]; + + +!!!! File variadicTuples1.d.ts differs from original emit in noCheck emit +//// [variadicTuples1.d.ts] +type TV0 = [string, ...T]; +type TV1 = [string, ...T, number]; +type TV2 = [string, ...T, number, ...T]; +type TV3 = [string, ...T, ...number[], ...T]; +type TN1 = TV1<[boolean, string]>; +type TN2 = TV1<[]>; +type TN3 = TV1<[boolean?]>; +type TN4 = TV1; +type TN5 = TV1<[boolean] | [symbol, symbol]>; +type TN6 = TV1; +type TN7 = TV1; +declare function tup2(t: [...T], u: [...U]): readonly [1, ...T, 2, ...U, 3]; +declare const t2: readonly [1, string, 2, number, boolean, 3]; +declare function concat(t: [...T], u: [...U]): [...T, ...U]; +declare const sa: string[]; +declare const tc1: []; +declare const tc2: [string, number]; +declare const tc3: [number, number, number, ...string[]]; +declare const tc4: [...string[], number, number, number]; +declare function concat2(t: T, u: U): (T[number] | U[number])[]; +declare const tc5: (1 | 2 | 3 | 6 | 4 | 5)[]; +declare function foo1(a: number, b: string, c: boolean, ...d: number[]): void; +declare function foo2(t1: [number, string], t2: [boolean], a1: number[]): void; +declare function foo3(x: number, ...args: [...T, number]): T; +declare function foo4(u: U): void; +declare function ft1(t: T): T; +declare function ft2(t: T): readonly [...T]; +declare function ft3(t: [...T]): T; +declare function ft4(t: [...T]): readonly [...T]; +declare function f0(t: [string, ...T], n: number): void; +declare function f1(t: [string, ...T, number], n: number): void; +declare function f2(t: [string, ...T]): void; +declare function f3(t: [string, ...T, number]): void; +type Arrayify = { + [P in keyof T]: T[P][]; +}; +type TM1 = Arrayify; +type TP1 = Partial<[string, ...T, number]>; +type TP2 = Partial<[string, ...T, ...number[]]>; +declare function fm1(t: Arrayify<[string, number, ...T]>): T; +declare let tm1: [boolean, string]; +declare function fx1(a: string, ...args: T): T; +declare function gx1(u: U, v: V): void; +declare function fx2(a: string, ...args: T): T; +declare function gx2(u: U, v: V): void; +declare function f10(x: [string, ...unknown[]], y: [string, ...T], z: [string, ...U]): void; +declare function f11(t: T, m: [...T], r: readonly [...T]): void; +declare function f12(t: T, m: [...T], r: readonly [...T]): void; +declare function f13(t0: T, t1: [...T], t2: [...U]): void; +declare function f14(t0: T, t1: [...T], t2: [...U]): void; +declare function f15(k0: keyof T, k1: keyof [...T], k2: keyof [...U], k3: keyof [1, 2, ...T]): void; +declare function ft16(x: [unknown, unknown], y: [...T, ...T]): void; +declare function ft17(x: [unknown, unknown], y: [...T, ...T]): void; +declare function ft18(x: [unknown, unknown], y: [...T, ...T]): void; +type First = T extends readonly [unknown, ...unknown[]] ? T[0] : T[0] | undefined; +type DropFirst = T extends readonly [unknown?, ...infer U] ? U : [...T]; +type Last = T extends readonly [...unknown[], infer U] ? U : T extends readonly [unknown, ...unknown[]] ? T[number] : T[number] | undefined; +type DropLast = T extends readonly [...infer U, unknown] ? U : [...T]; +type T00 = First<[number, symbol, string]>; +type T01 = First<[symbol, string]>; +type T02 = First<[string]>; +type T03 = First<[number, symbol, ...string[]]>; +type T04 = First<[symbol, ...string[]]>; +type T05 = First<[string?]>; +type T06 = First; +type T07 = First<[]>; +type T08 = First; +type T09 = First; +type T10 = DropFirst<[number, symbol, string]>; +type T11 = DropFirst<[symbol, string]>; +type T12 = DropFirst<[string]>; +type T13 = DropFirst<[number, symbol, ...string[]]>; +type T14 = DropFirst<[symbol, ...string[]]>; +type T15 = DropFirst<[string?]>; +type T16 = DropFirst; +type T17 = DropFirst<[]>; +type T18 = DropFirst; +type T19 = DropFirst; +type T20 = Last<[number, symbol, string]>; +type T21 = Last<[symbol, string]>; +type T22 = Last<[string]>; +type T23 = Last<[number, symbol, ...string[]]>; +type T24 = Last<[symbol, ...string[]]>; +type T25 = Last<[string?]>; +type T26 = Last; +type T27 = Last<[]>; +type T28 = Last; +type T29 = Last; +type T30 = DropLast<[number, symbol, string]>; +type T31 = DropLast<[symbol, string]>; +type T32 = DropLast<[string]>; +type T33 = DropLast<[number, symbol, ...string[]]>; +type T34 = DropLast<[symbol, ...string[]]>; +type T35 = DropLast<[string?]>; +type T36 = DropLast; +type T37 = DropLast<[]>; +type T38 = DropLast; +type T39 = DropLast; +type R00 = First; +type R01 = First; +type R02 = First; +type R03 = First; +type R04 = First; +type R05 = First; +type R06 = First; +type R10 = DropFirst; +type R11 = DropFirst; +type R12 = DropFirst; +type R13 = DropFirst; +type R14 = DropFirst; +type R15 = DropFirst; +type R16 = DropFirst; +type R20 = Last; +type R21 = Last; +type R22 = Last; +type R23 = Last; +type R24 = Last; +type R25 = Last; +type R26 = Last; +type R30 = DropLast; +type R31 = DropLast; +type R32 = DropLast; +type R33 = DropLast; +type R34 = DropLast; +type R35 = DropLast; +type R36 = DropLast; +declare function curry(f: (...args: [...T, ...U]) => R, ...a: T): (...b: U) => R; +declare const fn1: (a: number, b: string, c: boolean, d: string[]) => number; +declare const c0: (a: number, b: string, c: boolean, d: string[]) => number; +declare const c1: (b: string, c: boolean, d: string[]) => number; +declare const c2: (c: boolean, d: string[]) => number; +declare const c3: (d: string[]) => number; +declare const c4: () => number; +declare const fn2: (x: number, b: boolean, ...args: string[]) => number; +declare const c10: (x: number, b: boolean, ...args: string[]) => number; +declare const c11: (b: boolean, ...args: string[]) => number; +declare const c12: (...b: string[]) => number; +declare const c13: (...b: string[]) => number; +declare const fn3: (...args: string[]) => number; +declare const c20: (...b: string[]) => number; +declare const c21: (...b: string[]) => number; +declare const c22: (...b: string[]) => number; +declare function curry2(f: (...args: [...T, ...U]) => R, t: [...T], u: [...U]): R; +declare function fn10(a: string, b: number, c: boolean): string[]; +declare function ft(t1: [...T], t2: [...T, number?]): T; +declare function call(...args: [...T, (...args: T) => R]): [T, R]; +declare function f20(args: [...T, number?]): T; +declare function f21(args: [...U, number?]): void; +declare function f22(args: [...T, number]): T; +declare function f22(args: [...T]): T; +declare function f23(args: [...U, number]): void; +interface Desc { + readonly f: (...args: A) => T; + bind(this: Desc<[...T, ...U], R>, ...args: T): Desc<[...U], R>; +} +declare const a: Desc<[string, number, boolean], object>; +declare const b: Desc<[boolean], object>; +declare function getUser(id: string, options?: { + x?: string; +}): string; +declare function getOrgUser(id: string, orgId: number, options?: { + y?: number; + z?: boolean; +}): void; +declare function callApi(method: (...args: [...T, object]) => U): (...args_0: T) => U; +type Numbers = number[]; +type Unbounded = [...Numbers, boolean]; +declare const data: Unbounded; +type U1 = [string, ...Numbers, boolean]; +type U2 = [...[string, ...Numbers], boolean]; +type U3 = [...[string, number], boolean]; +type ToStringLength1 = `${T['length']}`; +type ToStringLength2 = `${[...T]['length']}`; +type AnyArr = [...any]; diff --git a/tests/baselines/reference/weakTypesAndLiterals01.js b/tests/baselines/reference/weakTypesAndLiterals01.js index 7781da9a9a174..3b4935fce3bfe 100644 --- a/tests/baselines/reference/weakTypesAndLiterals01.js +++ b/tests/baselines/reference/weakTypesAndLiterals01.js @@ -67,3 +67,21 @@ declare const f: (arg: LiteralsOrWeakTypes) => WeakTypes | "A" | "B"; declare const g: (arg: WeakTypes) => WeakTypes; declare const h: (arg: LiteralsOrWeakTypes) => LiteralsOrWeakTypes; declare const i: (arg: WeakTypes) => WeakTypes; + + +!!!! File weakTypesAndLiterals01.d.ts differs from original emit in noCheck emit +//// [weakTypesAndLiterals01.d.ts] +type WeakTypes = { + optional?: true; +} | { + toLowerCase?(): string; +} | { + toUpperCase?(): string; + otherOptionalProp?: number; +}; +type LiteralsOrWeakTypes = "A" | "B" | WeakTypes; +declare let aOrB: "A" | "B"; +declare const f: (arg: LiteralsOrWeakTypes) => "A" | "B" | WeakTypes; +declare const g: (arg: WeakTypes) => WeakTypes; +declare const h: (arg: LiteralsOrWeakTypes) => LiteralsOrWeakTypes; +declare const i: (arg: WeakTypes) => WeakTypes; From bf82544d7ed3703b552fbaf91752fe766ba4ba5a Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 25 Mar 2024 11:32:03 -0700 Subject: [PATCH 04/18] Add errors on using noCheck with noEmit and without emitDeclarationOnly, refine noCheck test conditions to match --- src/compiler/program.ts | 9 +++ src/harness/harnessIO.ts | 4 +- .../reference/noCheckDoesNotReportError.js | 10 ++++ .../noCheckDoesNotReportError.symbols | 6 ++ .../reference/noCheckDoesNotReportError.types | 7 +++ .../reference/noCheckNoEmit.errors.txt | 9 +++ .../baselines/reference/noCheckNoEmit.symbols | 6 ++ tests/baselines/reference/noCheckNoEmit.types | 7 +++ ...heckRequiresEmitDeclarationOnly.errors.txt | 7 +++ .../noCheckRequiresEmitDeclarationOnly.js | 11 ++++ ...noCheckRequiresEmitDeclarationOnly.symbols | 6 ++ .../noCheckRequiresEmitDeclarationOnly.types | 7 +++ .../reference/outModuleConcatCommonjs.js | 23 +++++++ .../baselines/reference/outModuleConcatES6.js | 22 +++++++ .../baselines/reference/outModuleConcatUmd.js | 22 +++++++ .../reference/typeReferenceDirectives11.js | 23 +++++++ .../reference/typeReferenceDirectives12.js | 60 +++++++++++++++++++ .../compiler/noCheckDoesNotReportError.ts | 6 ++ tests/cases/compiler/noCheckNoEmit.ts | 7 +++ .../noCheckRequiresEmitDeclarationOnly.ts | 4 ++ 20 files changed, 254 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/noCheckDoesNotReportError.js create mode 100644 tests/baselines/reference/noCheckDoesNotReportError.symbols create mode 100644 tests/baselines/reference/noCheckDoesNotReportError.types create mode 100644 tests/baselines/reference/noCheckNoEmit.errors.txt create mode 100644 tests/baselines/reference/noCheckNoEmit.symbols create mode 100644 tests/baselines/reference/noCheckNoEmit.types create mode 100644 tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.errors.txt create mode 100644 tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.js create mode 100644 tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.symbols create mode 100644 tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types create mode 100644 tests/baselines/reference/outModuleConcatCommonjs.js create mode 100644 tests/baselines/reference/outModuleConcatES6.js create mode 100644 tests/baselines/reference/outModuleConcatUmd.js create mode 100644 tests/baselines/reference/typeReferenceDirectives11.js create mode 100644 tests/baselines/reference/typeReferenceDirectives12.js create mode 100644 tests/cases/compiler/noCheckDoesNotReportError.ts create mode 100644 tests/cases/compiler/noCheckNoEmit.ts create mode 100644 tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 80ba1d4a5a23d..f824c89e44fa3 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -4347,6 +4347,15 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } } + if (options.noCheck) { + if (options.noEmit) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit"); + } + if (!options.emitDeclarationOnly) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "noCheck", "emitDeclarationOnly"); + } + } + if ( options.emitDecoratorMetadata && !options.experimentalDecorators diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 26c32fe963dd3..c243dd2ef97e0 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -975,8 +975,8 @@ export namespace Compiler { jsCode += "\r\n\r\n"; jsCode += getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics); } - else if (!options.noCheck && !options.noEmit) { - const withoutChecking = result.repeat({noCheck: "true"}); + else if (!options.noCheck && !options.noEmit && (options.composite || options.declaration || options.emitDeclarationOnly)) { + const withoutChecking = result.repeat({noCheck: "true", emitDeclarationOnly: "true"}); compareResultFileSets(withoutChecking.dts, result.dts); } diff --git a/tests/baselines/reference/noCheckDoesNotReportError.js b/tests/baselines/reference/noCheckDoesNotReportError.js new file mode 100644 index 0000000000000..266a7e67b0fda --- /dev/null +++ b/tests/baselines/reference/noCheckDoesNotReportError.js @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/noCheckDoesNotReportError.ts] //// + +//// [noCheckDoesNotReportError.ts] +export const a: number = "not ok"; + + + + +//// [noCheckDoesNotReportError.d.ts] +export declare const a: number; diff --git a/tests/baselines/reference/noCheckDoesNotReportError.symbols b/tests/baselines/reference/noCheckDoesNotReportError.symbols new file mode 100644 index 0000000000000..47785ae771c7a --- /dev/null +++ b/tests/baselines/reference/noCheckDoesNotReportError.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/noCheckDoesNotReportError.ts] //// + +=== noCheckDoesNotReportError.ts === +export const a: number = "not ok"; +>a : Symbol(a, Decl(noCheckDoesNotReportError.ts, 0, 12)) + diff --git a/tests/baselines/reference/noCheckDoesNotReportError.types b/tests/baselines/reference/noCheckDoesNotReportError.types new file mode 100644 index 0000000000000..b78b323feae17 --- /dev/null +++ b/tests/baselines/reference/noCheckDoesNotReportError.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/noCheckDoesNotReportError.ts] //// + +=== noCheckDoesNotReportError.ts === +export const a: number = "not ok"; +>a : number +>"not ok" : "not ok" + diff --git a/tests/baselines/reference/noCheckNoEmit.errors.txt b/tests/baselines/reference/noCheckNoEmit.errors.txt new file mode 100644 index 0000000000000..c7080758de82a --- /dev/null +++ b/tests/baselines/reference/noCheckNoEmit.errors.txt @@ -0,0 +1,9 @@ +error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'. +error TS5053: Option 'noCheck' cannot be specified with option 'noEmit'. + + +!!! error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'. +!!! error TS5053: Option 'noCheck' cannot be specified with option 'noEmit'. +==== noCheckNoEmit.ts (0 errors) ==== + export const a: number = "not ok"; + \ No newline at end of file diff --git a/tests/baselines/reference/noCheckNoEmit.symbols b/tests/baselines/reference/noCheckNoEmit.symbols new file mode 100644 index 0000000000000..ecab8da3b2f0a --- /dev/null +++ b/tests/baselines/reference/noCheckNoEmit.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/noCheckNoEmit.ts] //// + +=== noCheckNoEmit.ts === +export const a: number = "not ok"; +>a : Symbol(a, Decl(noCheckNoEmit.ts, 0, 12)) + diff --git a/tests/baselines/reference/noCheckNoEmit.types b/tests/baselines/reference/noCheckNoEmit.types new file mode 100644 index 0000000000000..77585c851a09b --- /dev/null +++ b/tests/baselines/reference/noCheckNoEmit.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/noCheckNoEmit.ts] //// + +=== noCheckNoEmit.ts === +export const a: number = "not ok"; +>a : number +>"not ok" : "not ok" + diff --git a/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.errors.txt b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.errors.txt new file mode 100644 index 0000000000000..1256c80887fe2 --- /dev/null +++ b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.errors.txt @@ -0,0 +1,7 @@ +error TS5052: Option 'noCheck' cannot be specified without specifying option 'emitDeclarationOnly'. + + +!!! error TS5052: Option 'noCheck' cannot be specified without specifying option 'emitDeclarationOnly'. +==== noCheckRequiresEmitDeclarationOnly.ts (0 errors) ==== + export const a: number = "not ok"; + \ No newline at end of file diff --git a/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.js b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.js new file mode 100644 index 0000000000000..f1cab81605ffe --- /dev/null +++ b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts] //// + +//// [noCheckRequiresEmitDeclarationOnly.ts] +export const a: number = "not ok"; + + +//// [noCheckRequiresEmitDeclarationOnly.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "not ok"; diff --git a/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.symbols b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.symbols new file mode 100644 index 0000000000000..ee29850bbc3ab --- /dev/null +++ b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts] //// + +=== noCheckRequiresEmitDeclarationOnly.ts === +export const a: number = "not ok"; +>a : Symbol(a, Decl(noCheckRequiresEmitDeclarationOnly.ts, 0, 12)) + diff --git a/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types new file mode 100644 index 0000000000000..677f4fd2f0968 --- /dev/null +++ b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts] //// + +=== noCheckRequiresEmitDeclarationOnly.ts === +export const a: number = "not ok"; +>a : number +>"not ok" : "not ok" + diff --git a/tests/baselines/reference/outModuleConcatCommonjs.js b/tests/baselines/reference/outModuleConcatCommonjs.js new file mode 100644 index 0000000000000..c6da7cf3337ea --- /dev/null +++ b/tests/baselines/reference/outModuleConcatCommonjs.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/outModuleConcatCommonjs.ts] //// + +//// [a.ts] +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + + + + +!!!! File all.d.ts missing from original emit, but present in noCheck emit +//// [all.d.ts] +declare module "ref/a" { + export class A { + } +} +declare module "b" { + import { A } from "ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatES6.js b/tests/baselines/reference/outModuleConcatES6.js new file mode 100644 index 0000000000000..f747cc7e351cb --- /dev/null +++ b/tests/baselines/reference/outModuleConcatES6.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/outModuleConcatES6.ts] //// + +//// [a.ts] +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + + + +!!!! File all.d.ts missing from original emit, but present in noCheck emit +//// [all.d.ts] +declare module "ref/a" { + export class A { + } +} +declare module "b" { + import { A } from "ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatUmd.js b/tests/baselines/reference/outModuleConcatUmd.js new file mode 100644 index 0000000000000..44bf3ae850709 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatUmd.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/outModuleConcatUmd.ts] //// + +//// [a.ts] +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + + + +!!!! File all.d.ts missing from original emit, but present in noCheck emit +//// [all.d.ts] +declare module "ref/a" { + export class A { + } +} +declare module "b" { + import { A } from "ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/typeReferenceDirectives11.js b/tests/baselines/reference/typeReferenceDirectives11.js new file mode 100644 index 0000000000000..5853619bf733b --- /dev/null +++ b/tests/baselines/reference/typeReferenceDirectives11.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/typeReferenceDirectives11.ts] //// + +//// [index.d.ts] +interface Lib { x } + +//// [mod1.ts] +export function foo(): Lib { return {x: 1} } + +//// [mod2.ts] +import {foo} from "./mod1"; +export const bar = foo(); + + + + +!!!! File /output.d.ts missing from original emit, but present in noCheck emit +//// [output.d.ts] +declare module "mod1" { + export function foo(): Lib; +} +declare module "mod2" { + export const bar: Lib; +} diff --git a/tests/baselines/reference/typeReferenceDirectives12.js b/tests/baselines/reference/typeReferenceDirectives12.js new file mode 100644 index 0000000000000..dd06ed073a709 --- /dev/null +++ b/tests/baselines/reference/typeReferenceDirectives12.js @@ -0,0 +1,60 @@ +//// [tests/cases/compiler/typeReferenceDirectives12.ts] //// + +//// [index.d.ts] +interface Lib { x } + +//// [main.ts] +export class Cls { + x +} + +//// [mod1.ts] +/// + +import {Cls} from "./main"; +Cls.prototype.foo = function() { return undefined; } + +declare module "./main" { + interface Cls { + foo(): Lib; + } + namespace Cls { + function bar(): Lib; + } +} + +//// [mod2.ts] +import { Cls } from "./main"; +import "./mod1"; + +export const cls = Cls; +export const foo = new Cls().foo(); +export const bar = Cls.bar(); + + + + +!!!! File /output.d.ts missing from original emit, but present in noCheck emit +//// [output.d.ts] +declare module "main" { + export class Cls { + x: any; + } +} +declare module "mod1" { + module "main" { + interface Cls { + foo(): Lib; + } + namespace Cls { + function bar(): Lib; + } + } +} +declare module "mod2" { + import { Cls } from "main"; + import "mod1"; + export const cls: typeof Cls; + export const foo: Lib; + export const bar: Lib; +} diff --git a/tests/cases/compiler/noCheckDoesNotReportError.ts b/tests/cases/compiler/noCheckDoesNotReportError.ts new file mode 100644 index 0000000000000..abb4d79e8f264 --- /dev/null +++ b/tests/cases/compiler/noCheckDoesNotReportError.ts @@ -0,0 +1,6 @@ +// @noCheck: true +// @emitDeclarationOnly: true +// @declaration: true +// @strict: true + +export const a: number = "not ok"; diff --git a/tests/cases/compiler/noCheckNoEmit.ts b/tests/cases/compiler/noCheckNoEmit.ts new file mode 100644 index 0000000000000..019c461d7fabd --- /dev/null +++ b/tests/cases/compiler/noCheckNoEmit.ts @@ -0,0 +1,7 @@ +// @noCheck: true +// @emitDeclarationOnly: true +// @declaration: true +// @noEmit: true +// @strict: true + +export const a: number = "not ok"; diff --git a/tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts b/tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts new file mode 100644 index 0000000000000..f4a1cce81508f --- /dev/null +++ b/tests/cases/compiler/noCheckRequiresEmitDeclarationOnly.ts @@ -0,0 +1,4 @@ +// @noCheck: true +// @strict: true + +export const a: number = "not ok"; From a3d4f73a5b7effa5c238f269331434092075f60d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 25 Mar 2024 11:52:58 -0700 Subject: [PATCH 05/18] Format --- src/harness/harnessIO.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index c243dd2ef97e0..6af418c4ec022 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -370,7 +370,7 @@ export namespace Compiler { fileOptions?: any; } - export type CompileFilesResult = compiler.CompilationResult & { repeat(newOptions: TestCaseParser.CompilerSettings): CompileFilesResult }; + export type CompileFilesResult = compiler.CompilationResult & { repeat(newOptions: TestCaseParser.CompilerSettings): CompileFilesResult; }; export function compileFiles( inputFiles: TestFile[], @@ -430,7 +430,7 @@ export namespace Compiler { const host = new fakes.CompilerHost(fs, options); const result = compiler.compileFiles(host, programFileNames, options, typeScriptVersion); result.symlinks = symlinks; - (result as CompileFilesResult).repeat = newOptions => compileFiles(inputFiles, otherFiles, {...harnessSettings, ...newOptions}, compilerOptions, originalCurrentDirectory, symlinks); + (result as CompileFilesResult).repeat = newOptions => compileFiles(inputFiles, otherFiles, { ...harnessSettings, ...newOptions }, compilerOptions, originalCurrentDirectory, symlinks); return result as CompileFilesResult; } @@ -976,7 +976,7 @@ export namespace Compiler { jsCode += getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics); } else if (!options.noCheck && !options.noEmit && (options.composite || options.declaration || options.emitDeclarationOnly)) { - const withoutChecking = result.repeat({noCheck: "true", emitDeclarationOnly: "true"}); + const withoutChecking = result.repeat({ noCheck: "true", emitDeclarationOnly: "true" }); compareResultFileSets(withoutChecking.dts, result.dts); } From 736eac2eb532f6a305fe79d6ac3062ef0df24a8c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 27 Mar 2024 13:27:58 -0700 Subject: [PATCH 06/18] Update baselines with main --- tests/baselines/reference/noCheckDoesNotReportError.types | 2 ++ tests/baselines/reference/noCheckNoEmit.types | 2 ++ .../reference/noCheckRequiresEmitDeclarationOnly.types | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/baselines/reference/noCheckDoesNotReportError.types b/tests/baselines/reference/noCheckDoesNotReportError.types index b78b323feae17..dc2b679b4fb1c 100644 --- a/tests/baselines/reference/noCheckDoesNotReportError.types +++ b/tests/baselines/reference/noCheckDoesNotReportError.types @@ -3,5 +3,7 @@ === noCheckDoesNotReportError.ts === export const a: number = "not ok"; >a : number +> : ^^^^^^ >"not ok" : "not ok" +> : ^^^^^^^^ diff --git a/tests/baselines/reference/noCheckNoEmit.types b/tests/baselines/reference/noCheckNoEmit.types index 77585c851a09b..4ff6200a0d7e8 100644 --- a/tests/baselines/reference/noCheckNoEmit.types +++ b/tests/baselines/reference/noCheckNoEmit.types @@ -3,5 +3,7 @@ === noCheckNoEmit.ts === export const a: number = "not ok"; >a : number +> : ^^^^^^ >"not ok" : "not ok" +> : ^^^^^^^^ diff --git a/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types index 677f4fd2f0968..561d967a23857 100644 --- a/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types +++ b/tests/baselines/reference/noCheckRequiresEmitDeclarationOnly.types @@ -3,5 +3,7 @@ === noCheckRequiresEmitDeclarationOnly.ts === export const a: number = "not ok"; >a : number +> : ^^^^^^ >"not ok" : "not ok" +> : ^^^^^^^^ From 5c5e8e08be6978c58d46354ec7e21d489648e5bd Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 27 Mar 2024 13:47:17 -0700 Subject: [PATCH 07/18] Remove command-line accesible noCheck option, API only until JS is done --- src/compiler/commandLineParser.ts | 9 --------- src/compiler/types.ts | 2 +- src/harness/harnessIO.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 - .../Default initialized TSConfig/tsconfig.json | 1 - .../Initialized TSConfig with --help/tsconfig.json | 1 - .../Initialized TSConfig with --watch/tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - .../does-not-add-color-when-NO_COLOR-is-set.js | 5 ----- ...putsSkipped-when-host-can't-provide-terminal-width.js | 5 ----- ...-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js | 5 ----- 18 files changed, 2 insertions(+), 37 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 8999a01a8f725..ade646ba086d0 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -776,15 +776,6 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ transpileOptionValue: undefined, defaultValueDescription: false, }, - { - name: "noCheck", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported, - transpileOptionValue: undefined, - defaultValueDescription: false, - }, { name: "importHelpers", type: "boolean", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3455673c4c36f..206a4f73bcbf5 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7121,7 +7121,7 @@ export interface CompilerOptions { moduleDetection?: ModuleDetectionKind; newLine?: NewLineKind; noEmit?: boolean; - noCheck?: boolean; + /** @internal */ noCheck?: boolean; /** @internal */ noEmitForJsFiles?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 5d768c31c23f5..93e128769ec8d 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -303,6 +303,7 @@ export namespace Compiler { { name: "noTypesAndSymbols", type: "boolean", defaultValueDescription: false }, // Emitted js baseline will print full paths for every output file { name: "fullEmitPaths", type: "boolean", defaultValueDescription: false }, + { name: "noCheck", type: "boolean", defaultValueDescription: false }, ]; let optionsIndex: Map; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 6f194d3442497..442ea84640299 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6927,7 +6927,6 @@ declare namespace ts { moduleDetection?: ModuleDetectionKind; newLine?: NewLineKind; noEmit?: boolean; - noCheck?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; diff --git a/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json index 1c54f0a890ad1..81804ba2c2eac 100644 --- a/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json index 1c54f0a890ad1..81804ba2c2eac 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --help/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json index 1c54f0a890ad1..81804ba2c2eac 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with --watch/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json index 670e129a22a25..b5ac6cc2eb0d4 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with advanced options/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index dc477af09e324..e8529643dcbce 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 0f81fff85ea87..57335d68845aa 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json index 065ac2ba02dfc..491aeff0028e0 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with files options/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 87e08f0c1620f..f8c514215956d 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 1c54f0a890ad1..81804ba2c2eac 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index 9d79e9f17fa18..ce7a7c1fd229a 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json index 5ffe017d91741..6d0dbd4fb8afd 100644 --- a/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/config/initTSConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -58,7 +58,6 @@ // "outDir": "./", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ - // "noCheck": true, /* Disable full type checking (only critical parse and emit errors will be reported). */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index 9b1d844c23c6b..0da50d90ce6d0 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -145,11 +145,6 @@ Disable emitting files from a compilation. type: boolean default: false ---noCheck -Disable full type checking (only critical parse and emit errors will be reported). -type: boolean -default: false - --strict Enable all strict type-checking options. type: boolean diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 8ed92d0593cbb..948f93ad35f21 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -145,11 +145,6 @@ Disable emitting files from a compilation. type: boolean default: false ---noCheck -Disable full type checking (only critical parse and emit errors will be reported). -type: boolean -default: false - --strict Enable all strict type-checking options. type: boolean diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 8ed92d0593cbb..948f93ad35f21 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -145,11 +145,6 @@ Disable emitting files from a compilation. type: boolean default: false ---noCheck -Disable full type checking (only critical parse and emit errors will be reported). -type: boolean -default: false - --strict Enable all strict type-checking options. type: boolean From 1a05d9658c7edfefaa4714737856088f8d3f38c3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 27 Mar 2024 14:19:17 -0700 Subject: [PATCH 08/18] Remove unused baseline --- .../Shows tsconfig for single option/noCheck/tsconfig.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json diff --git a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json deleted file mode 100644 index e115e386cb6e9..0000000000000 --- a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "noCheck": true - } -} From 051a1d16e87bb418e44d1dd56a1d689cd3982fe0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 28 Mar 2024 14:20:41 -0700 Subject: [PATCH 09/18] Add private option description so if `build` is invoked via API with `noCheck`, it is serialized correctly --- src/compiler/commandLineParser.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index ade646ba086d0..66ab4fe958e3f 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1578,6 +1578,22 @@ export const optionDeclarations: CommandLineOption[] = [ ...commandOptionsWithoutBuild, ]; +// These aren't available via CLI or config (yet), but we still want to handle them correctly +/** @internal */ +export const privateOptionDeclarations: CommandLineOption[] = [ + { + name: "noCheck", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported, + transpileOptionValue: undefined, + defaultValueDescription: false, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + }, +]; + /** @internal */ export const semanticDiagnosticsOptionDeclarations: readonly CommandLineOption[] = optionDeclarations.filter(option => !!option.affectsSemanticDiagnostics); @@ -1695,7 +1711,7 @@ let optionsNameMapCache: OptionsNameMap; /** @internal */ export function getOptionsNameMap(): OptionsNameMap { - return optionsNameMapCache ||= createOptionNameMap(optionDeclarations); + return optionsNameMapCache ||= createOptionNameMap([...optionDeclarations, ...privateOptionDeclarations]); } const compilerOptionsAlternateMode: AlternateModeDiagnostics = { From 1231be174a2d2a8c825964b0ee4e5627bfba70b3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 28 Mar 2024 14:23:14 -0700 Subject: [PATCH 10/18] Increase comment verbosity --- src/compiler/commandLineParser.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 66ab4fe958e3f..b0c9dc0c9f240 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1579,6 +1579,8 @@ export const optionDeclarations: CommandLineOption[] = [ ]; // These aren't available via CLI or config (yet), but we still want to handle them correctly +// They'll be included in the result of `getOptionsNameMap()`, so they serialize and deserialize correctly, +// but not in any of the category-specific lists or help menus. /** @internal */ export const privateOptionDeclarations: CommandLineOption[] = [ { From 2bda238b4c246984633aadd495c3d704dffa7e61 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 11 Apr 2024 12:42:21 -0700 Subject: [PATCH 11/18] Add -b test for noCheck, change strategy used to make flag api-only --- src/compiler/builder.ts | 5 + src/compiler/commandLineParser.ts | 34 +- src/testRunner/tests.ts | 1 + src/testRunner/unittests/tsbuild/noCheck.ts | 76 ++++ .../noCheck/tsconfig.json | 3 + ...claration-and-incremental-discrepancies.js | 123 ------ ...ndline-with-declaration-and-incremental.js | 266 ++++++++++- ...claration-and-incremental-discrepancies.js | 245 +---------- ...ndline-with-declaration-and-incremental.js | 402 +++++++++++++++-- ...tax-errors-in-config-file-discrepancies.js | 77 +--- .../reports-syntax-errors-in-config-file.js | 63 +++ .../semantic-errors-with-incremental.js | 386 ++++++++++++++++ .../tsbuild/noCheck/semantic-errors.js | 250 +++++++++++ .../noCheck/syntax-errors-with-incremental.js | 416 ++++++++++++++++++ .../tsbuild/noCheck/syntax-errors.js | 276 ++++++++++++ .../noEmit/syntax-errors-with-incremental.js | 12 +- .../syntax-errors-with-incremental.js | 2 + ...iles-belong-to-rootDir-and-is-composite.js | 2 + .../tsc/moduleResolution/alternateResult.js | 16 + 19 files changed, 2126 insertions(+), 529 deletions(-) create mode 100644 src/testRunner/unittests/tsbuild/noCheck.ts create mode 100644 tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json create mode 100644 tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noCheck/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noCheck/syntax-errors.js diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index d2f7b376ddd5b..7009fc87cc515 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -451,6 +451,11 @@ function createBuilderProgramState(newProgram: Program, oldState: Readonly !!option.affectsSemanticDiagnostics); @@ -1713,7 +1709,7 @@ let optionsNameMapCache: OptionsNameMap; /** @internal */ export function getOptionsNameMap(): OptionsNameMap { - return optionsNameMapCache ||= createOptionNameMap([...optionDeclarations, ...privateOptionDeclarations]); + return optionsNameMapCache ||= createOptionNameMap([...optionDeclarations]); } const compilerOptionsAlternateMode: AlternateModeDiagnostics = { diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts index 9857f6b7fb2d7..670c9a227c65e 100644 --- a/src/testRunner/tests.ts +++ b/src/testRunner/tests.ts @@ -86,6 +86,7 @@ import "./unittests/tsbuild/lateBoundSymbol"; import "./unittests/tsbuild/libraryResolution"; import "./unittests/tsbuild/moduleResolution"; import "./unittests/tsbuild/moduleSpecifiers"; +import "./unittests/tsbuild/noCheck"; import "./unittests/tsbuild/noEmit"; import "./unittests/tsbuild/noEmitOnError"; import "./unittests/tsbuild/outFile"; diff --git a/src/testRunner/unittests/tsbuild/noCheck.ts b/src/testRunner/unittests/tsbuild/noCheck.ts new file mode 100644 index 0000000000000..f4d1b846e5f74 --- /dev/null +++ b/src/testRunner/unittests/tsbuild/noCheck.ts @@ -0,0 +1,76 @@ +import { + CommandLineOption, + optionDeclarations, +} from "../../_namespaces/ts"; +import { jsonToReadableText } from "../helpers"; +import { + noChangeRun, + verifyTsc, +} from "../helpers/tsc"; +import { loadProjectFromFiles } from "../helpers/vfs"; + +describe("unittests:: tsbuild:: noCheck", () => { + let validate: CommandLineOption["extraValidation"]; + before(() => { + for (const opt of optionDeclarations) { + if (opt.name === "noCheck") { + validate = opt.extraValidation; + opt.extraValidation = () => undefined; + } + } + }); + after(() => { + for (const opt of optionDeclarations) { + if (opt.name === "noCheck") { + opt.extraValidation = validate; + } + } + }); + function verifyNoCheckWorker(subScenario: string, declAText: string, commandLineArgs: readonly string[]) { + verifyTsc({ + scenario: "noCheck", + subScenario, + fs: () => + loadProjectFromFiles({ + "/src/a.ts": getATsContent(declAText), + "/src/tsconfig.json": jsonToReadableText({ + compilerOptions: { noCheck: true, emitDeclarationOnly: true, declaration: true }, + }), + }), + commandLineArgs, + edits: [ + noChangeRun, + { + caption: "Fix `a` error", + edit: fs => fs.writeFileSync("/src/a.ts", getATsContent(`const a = "hello"`)), + }, + noChangeRun, + { + caption: "Disable noCheck", + edit: fs => + fs.writeFileSync( + "/src/tsconfig.json", + jsonToReadableText({ + compilerOptions: { emitDeclarationOnly: true, declaration: true }, + }), + ), + }, + noChangeRun, + ], + baselinePrograms: true, + }); + + function getATsContent(declAText: string) { + return `const err: number = "error"; +${declAText}`; + } + } + + function verifyNoCheck(subScenario: string, aTsContent: string) { + verifyNoCheckWorker(subScenario, aTsContent, ["--b", "/src/tsconfig.json", "-v"]); + verifyNoCheckWorker(`${subScenario} with incremental`, aTsContent, ["--b", "/src/tsconfig.json", "-v", "--incremental"]); + } + + verifyNoCheck("syntax errors", `const a = "hello`); + verifyNoCheck("semantic errors", `const a: number = "hello"`); +}); diff --git a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json new file mode 100644 index 0000000000000..cd727e8ccdc88 --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/noCheck/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental-discrepancies.js index c69a05e8b1ed4..9f2341625bcef 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental-discrepancies.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental-discrepancies.js @@ -115,127 +115,4 @@ IncrementalBuild: ] }, "version": "FakeTSVersion" -} -TsBuild info text without affectedFilesPendingEmit:: /src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "program": { - "fileInfos": { - "../../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./e.ts": { - "version": "-13789510868-export const e = 10;" - }, - "../../project1/src/a.d.ts": { - "version": "-3497920574-export declare const a = 10;\n" - }, - "./f.ts": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" - }, - "../../project1/src/b.d.ts": { - "version": "-3829150557-export declare const b = 10;\n" - }, - "./g.ts": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "program": { - "fileInfos": { - "../../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./e.ts": { - "version": "-13789510868-export const e = 10;" - }, - "../../project1/src/a.d.ts": { - "version": "-3497920574-export declare const a = 10;\n" - }, - "./f.ts": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" - }, - "../../project1/src/b.d.ts": { - "version": "-3829150557-export declare const b = 10;\n" - }, - "./g.ts": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": false - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion" } \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js index c4de7d9de9d1a..d8d6bade88648 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -428,6 +428,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: change @@ -439,17 +441,17 @@ export const a = 10;const aLocal = 10;const aa = 10; Output:: /lib/tsc --b /src/project2/src --verbose -[12:00:39 AM] Projects in this build: +[12:00:42 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:40 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' +[12:00:43 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' -[12:00:41 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:44 AM] Building project '/src/project1/src/tsconfig.json'... -[12:00:46 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:49 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:47 AM] Building project '/src/project2/src/tsconfig.json'... +[12:00:50 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -618,6 +620,8 @@ No shapes updated in the builder:: "size": 1291 } +//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: emit js files @@ -626,17 +630,17 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly false -[12:00:48 AM] Projects in this build: +[12:00:54 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:49 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions +[12:00:55 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -[12:00:50 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:56 AM] Building project '/src/project1/src/tsconfig.json'... -[12:00:58 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:04 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:59 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:05 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -950,15 +954,15 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:03 AM] Projects in this build: +[12:01:09 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:04 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' +[12:01:10 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' -[12:01:05 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:11 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:06 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:12 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -998,6 +1002,113 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/src/project2/src/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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":"-13789510868-export const e = 10;","signature":false},{"version":"-3497920574-export declare const a = 10;\n","signature":false},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false},{"version":"-3829150557-export declare const b = 10;\n","signature":false},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} + +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../lib/lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "fileNamesList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.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; };", + "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; };", + "affectsGlobalScope": true + }, + "./e.ts": { + "original": { + "version": "-13789510868-export const e = 10;", + "signature": false + }, + "version": "-13789510868-export const e = 10;" + }, + "../../project1/src/a.d.ts": { + "original": { + "version": "-3497920574-export declare const a = 10;\n", + "signature": false + }, + "version": "-3497920574-export declare const a = 10;\n" + }, + "./f.ts": { + "original": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": false + }, + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" + }, + "../../project1/src/b.d.ts": { + "original": { + "version": "-3829150557-export declare const b = 10;\n", + "signature": false + }, + "version": "-3829150557-export declare const b = 10;\n" + }, + "./g.ts": { + "original": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": false + }, + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1260 +} + Change:: no change run with js emit @@ -1006,15 +1117,15 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly false -[12:01:07 AM] Projects in this build: +[12:01:16 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:08 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' +[12:01:17 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' -[12:01:09 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:18 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:10 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:19 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1054,6 +1165,113 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/src/project2/src/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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":"-13789510868-export const e = 10;","signature":false},{"version":"-3497920574-export declare const a = 10;\n","signature":false},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false},{"version":"-3829150557-export declare const b = 10;\n","signature":false},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":false},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} + +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../lib/lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "fileNamesList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.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; };", + "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; };", + "affectsGlobalScope": true + }, + "./e.ts": { + "original": { + "version": "-13789510868-export const e = 10;", + "signature": false + }, + "version": "-13789510868-export const e = 10;" + }, + "../../project1/src/a.d.ts": { + "original": { + "version": "-3497920574-export declare const a = 10;\n", + "signature": false + }, + "version": "-3497920574-export declare const a = 10;\n" + }, + "./f.ts": { + "original": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": false + }, + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" + }, + "../../project1/src/b.d.ts": { + "original": { + "version": "-3829150557-export declare const b = 10;\n", + "signature": false + }, + "version": "-3829150557-export declare const b = 10;\n" + }, + "./g.ts": { + "original": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": false + }, + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": false + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1261 +} + Change:: js emit with change @@ -1065,17 +1283,17 @@ export const b = 10;const bLocal = 10;const blocal = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly false -[12:01:12 AM] Projects in this build: +[12:01:24 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:13 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:25 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:14 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:26 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:20 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:32 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:21 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:33 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1253,3 +1471,5 @@ var blocal = 10; "size": 1309 } +//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js index 30b1333bed8d7..5746168ef3dc1 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js @@ -115,250 +115,7 @@ IncrementalBuild: }, "version": "FakeTSVersion" } -TsBuild info text without affectedFilesPendingEmit:: /src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "program": { - "fileInfos": { - "../../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./e.ts": { - "version": "-13789510868-export const e = 10;" - }, - "../../project1/src/a.d.ts": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" - }, - "./f.ts": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" - }, - "../../project1/src/b.d.ts": { - "version": "-3829150557-export declare const b = 10;\n" - }, - "./g.ts": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "program": { - "fileInfos": { - "../../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./e.ts": { - "version": "-13789510868-export const e = 10;" - }, - "../../project1/src/a.d.ts": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" - }, - "./f.ts": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" - }, - "../../project1/src/b.d.ts": { - "version": "-3829150557-export declare const b = 10;\n" - }, - "./g.ts": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion" -} 6:: local change Clean build tsbuildinfo for project2 will have compilerOptions with composite and emitDeclarationOnly Incremental build will detect that it doesnt need to rebuild project2 so tsbuildinfo for it is from before which has option composite only -TsBuild info text without affectedFilesPendingEmit:: /src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "program": { - "fileInfos": { - "../../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./e.ts": { - "version": "-13789510868-export const e = 10;" - }, - "../../project1/src/a.d.ts": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" - }, - "./f.ts": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" - }, - "../../project1/src/b.d.ts": { - "version": "-3829150557-export declare const b = 10;\n" - }, - "./g.ts": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "program": { - "fileInfos": { - "../../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./e.ts": { - "version": "-13789510868-export const e = 10;" - }, - "../../project1/src/a.d.ts": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" - }, - "./f.ts": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" - }, - "../../project1/src/b.d.ts": { - "version": "-3829150557-export declare const b = 10;\n" - }, - "./g.ts": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion" -} \ No newline at end of file +*** Supplied discrepancy explanation but didnt file any difference \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js index f940f4cfd561d..096d0db81fc10 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -426,6 +426,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: local change @@ -437,17 +439,17 @@ export const a = 10;const aLocal = 10;const aa = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:00:39 AM] Projects in this build: +[12:00:42 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:40 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' +[12:00:43 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' -[12:00:41 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:44 AM] Building project '/src/project1/src/tsconfig.json'... -[12:00:46 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:49 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:47 AM] Building project '/src/project2/src/tsconfig.json'... +[12:00:50 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -616,6 +618,8 @@ No shapes updated in the builder:: "size": 1291 } +//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: non local change @@ -627,17 +631,17 @@ export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:00:49 AM] Projects in this build: +[12:00:55 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:50 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' +[12:00:56 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' -[12:00:51 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:57 AM] Building project '/src/project1/src/tsconfig.json'... -[12:00:57 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:03 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:58 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:04 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -928,17 +932,17 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:02 AM] Projects in this build: +[12:01:08 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:03 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions +[12:01:09 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -[12:01:04 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:10 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:12 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:18 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:13 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:19 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1249,15 +1253,15 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:01:17 AM] Projects in this build: +[12:01:23 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:18 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' +[12:01:24 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' -[12:01:19 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:25 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:20 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:26 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1297,6 +1301,113 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/src/project2/src/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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":"-13789510868-export const e = 10;","signature":false},{"version":"-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n","signature":false},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false},{"version":"-3829150557-export declare const b = 10;\n","signature":false},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} + +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../lib/lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "fileNamesList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.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; };", + "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; };", + "affectsGlobalScope": true + }, + "./e.ts": { + "original": { + "version": "-13789510868-export const e = 10;", + "signature": false + }, + "version": "-13789510868-export const e = 10;" + }, + "../../project1/src/a.d.ts": { + "original": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": false + }, + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" + }, + "./f.ts": { + "original": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": false + }, + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" + }, + "../../project1/src/b.d.ts": { + "original": { + "version": "-3829150557-export declare const b = 10;\n", + "signature": false + }, + "version": "-3829150557-export declare const b = 10;\n" + }, + "./g.ts": { + "original": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": false + }, + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1292 +} + Change:: js emit with change without emitDeclarationOnly @@ -1308,17 +1419,17 @@ export const b = 10;const bLocal = 10;const alocal = 10; Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:22 AM] Projects in this build: +[12:01:31 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:23 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:32 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:24 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:33 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:30 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:39 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:31 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:40 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1493,6 +1604,112 @@ var alocal = 10; "size": 1335 } +//// [/src/project2/src/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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":"-13789510868-export const e = 10;","signature":false},{"version":"-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n","signature":false},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false},{"version":"-3829150557-export declare const b = 10;\n","signature":false},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false}],"root":[2,4,6],"options":{"declaration":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} + +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../lib/lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "fileNamesList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.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; };", + "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; };", + "affectsGlobalScope": true + }, + "./e.ts": { + "original": { + "version": "-13789510868-export const e = 10;", + "signature": false + }, + "version": "-13789510868-export const e = 10;" + }, + "../../project1/src/a.d.ts": { + "original": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": false + }, + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" + }, + "./f.ts": { + "original": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": false + }, + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" + }, + "../../project1/src/b.d.ts": { + "original": { + "version": "-3829150557-export declare const b = 10;\n", + "signature": false + }, + "version": "-3829150557-export declare const b = 10;\n" + }, + "./g.ts": { + "original": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": false + }, + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1265 +} + Change:: local change @@ -1504,17 +1721,17 @@ export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:01:33 AM] Projects in this build: +[12:01:45 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:34 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:46 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:35 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:47 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:40 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:52 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:41 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:53 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1683,6 +1900,113 @@ No shapes updated in the builder:: "size": 1378 } +//// [/src/project2/src/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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":"-13789510868-export const e = 10;","signature":false},{"version":"-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n","signature":false},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false},{"version":"-3829150557-export declare const b = 10;\n","signature":false},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} + +//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../lib/lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "fileNamesList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.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; };", + "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; };", + "affectsGlobalScope": true + }, + "./e.ts": { + "original": { + "version": "-13789510868-export const e = 10;", + "signature": false + }, + "version": "-13789510868-export const e = 10;" + }, + "../../project1/src/a.d.ts": { + "original": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": false + }, + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n" + }, + "./f.ts": { + "original": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": false + }, + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;" + }, + "../../project1/src/b.d.ts": { + "original": { + "version": "-3829150557-export declare const b = 10;\n", + "signature": false + }, + "version": "-3829150557-export declare const b = 10;\n" + }, + "./g.ts": { + "original": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": false + }, + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1292 +} + Change:: non local change @@ -1694,17 +2018,17 @@ export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export c Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:01:43 AM] Projects in this build: +[12:01:58 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:44 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:59 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:45 AM] Building project '/src/project1/src/tsconfig.json'... +[12:02:00 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:51 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:02:06 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:52 AM] Building project '/src/project2/src/tsconfig.json'... +[12:02:07 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1998,17 +2322,17 @@ export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export c Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:57 AM] Projects in this build: +[12:02:12 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:58 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions +[12:02:13 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -[12:01:59 AM] Building project '/src/project1/src/tsconfig.json'... +[12:02:14 AM] Building project '/src/project1/src/tsconfig.json'... -[12:02:09 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:02:24 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:02:10 AM] Building project '/src/project2/src/tsconfig.json'... +[12:02:25 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. diff --git a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js index c9bdc6828e595..926e8f2c362ee 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js @@ -1,79 +1,4 @@ 0:: reports syntax errors after change to config file During incremental build, tsbuildinfo is not emitted, so declaration option is not present Clean build has declaration option in tsbuildinfo -TsBuild info text without affectedFilesPendingEmit:: /src/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "4646078106-export function foo() { }" - }, - "./b.ts": { - "version": "1045484683-export function bar() { }" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "options": { - "composite": true, - "declaration": true - }, - "referencedMap": {}, - "changeFileSet": [ - "../lib/lib.d.ts", - "./a.ts", - "./b.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "4646078106-export function foo() { }" - }, - "./b.ts": { - "version": "1045484683-export function bar() { }" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "options": { - "composite": true - }, - "referencedMap": {}, - "changeFileSet": [ - "../lib/lib.d.ts", - "./a.ts", - "./b.ts" - ] - }, - "version": "FakeTSVersion" -} \ No newline at end of file +*** Supplied discrepancy explanation but didnt file any difference \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js index 94eb44935e92b..5e8a63134cd5d 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js @@ -138,6 +138,67 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"4646078106-export function foo() { }","signature":false},{"version":"1045484683-export function bar() { }","signature":false}],"root":[2,3],"options":{"composite":true,"declaration":true},"referencedMap":[],"changeFileSet":[1,2,3]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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; };", + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "4646078106-export function foo() { }", + "signature": false + }, + "version": "4646078106-export function foo() { }" + }, + "./b.ts": { + "original": { + "version": "1045484683-export function bar() { }", + "signature": false + }, + "version": "1045484683-export function bar() { }" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "composite": true, + "declaration": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion", + "size": 842 +} + Change:: reports syntax errors after change to ts file @@ -240,6 +301,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: builds after fixing config file errors diff --git a/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..9a72fdf16f9b6 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js @@ -0,0 +1,386 @@ +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/a.ts] +const err: number = "error"; +const a: number = "hello" + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts during emit) + + +//// [/src/a.d.ts] +declare const err: number; +declare const a: number; + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"9312413704-const err: number = \"error\";\nconst a: number = \"hello\"","signature":"-22763377875-declare const err: number;\ndeclare const a: number;\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true,"noCheck":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "9312413704-const err: number = \"error\";\nconst a: number = \"hello\"", + "signature": "-22763377875-declare const err: number;\ndeclare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "9312413704-const err: number = \"error\";\nconst a: number = \"hello\"", + "signature": "-22763377875-declare const err: number;\ndeclare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 904 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:15 AM] Projects in this build: + * src/tsconfig.json + +[12:00:16 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:18 AM] Projects in this build: + * src/tsconfig.json + +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/a.ts' + +[12:00:20 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/src/a.ts + +Shape signatures in builder refreshed for:: +/src/a.ts (computed .d.ts) + + +//// [/src/a.d.ts] +declare const err: number; +declare const a = "hello"; + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true,"noCheck":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 900 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:25 AM] Projects in this build: + * src/tsconfig.json + +[12:00:26 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:28 AM] Projects in this build: + * src/tsconfig.json + +[12:00:29 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/tsconfig.json' + +[12:00:30 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./a.ts","start":6,"length":3,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ] + }, + "version": "FakeTSVersion", + "size": 1019 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:34 AM] Projects in this build: + * src/tsconfig.json + +[12:00:35 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noCheck/semantic-errors.js b/tests/baselines/reference/tsbuild/noCheck/semantic-errors.js new file mode 100644 index 0000000000000..5c10389bbb596 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck/semantic-errors.js @@ -0,0 +1,250 @@ +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/a.ts] +const err: number = "error"; +const a: number = "hello" + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts during emit) + + +//// [/src/a.d.ts] +declare const err: number; +declare const a: number; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:12 AM] Projects in this build: + * src/tsconfig.json + +[12:00:13 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/a.d.ts' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:15 AM] Projects in this build: + * src/tsconfig.json + +[12:00:16 AM] Project 'src/tsconfig.json' is out of date because output 'src/a.d.ts' is older than input 'src/a.ts' + +[12:00:17 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts during emit) + + +//// [/src/a.d.ts] +declare const err: number; +declare const a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:19 AM] Projects in this build: + * src/tsconfig.json + +[12:00:20 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/a.d.ts' + +exitCode:: ExitStatus.Success + + + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:22 AM] Projects in this build: + * src/tsconfig.json + +[12:00:23 AM] Project 'src/tsconfig.json' is out of date because output 'src/a.d.ts' is older than input 'src/tsconfig.json' + +[12:00:24 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:25 AM] Projects in this build: + * src/tsconfig.json + +[12:00:26 AM] Project 'src/tsconfig.json' is out of date because output 'src/a.d.ts' is older than input 'src/tsconfig.json' + +[12:00:27 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + diff --git a/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..34a3d1976d1e1 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js @@ -0,0 +1,416 @@ +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/a.ts] +const err: number = "error"; +const a = "hello + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"8018408675-const err: number = \"error\";\nconst a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true,"noCheck":true},"referencedMap":[],"changeFileSet":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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; };", + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "8018408675-const err: number = \"error\";\nconst a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "8018408675-const err: number = \"error\";\nconst a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 835 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:14 AM] Projects in this build: + * src/tsconfig.json + +[12:00:15 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:16 AM] Building project '/src/tsconfig.json'... + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:21 AM] Projects in this build: + * src/tsconfig.json + +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:23 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts) + + +//// [/src/a.d.ts] +declare const err: number; +declare const a = "hello"; + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true,"noCheck":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 900 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:28 AM] Projects in this build: + * src/tsconfig.json + +[12:00:29 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:31 AM] Projects in this build: + * src/tsconfig.json + +[12:00:32 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/tsconfig.json' + +[12:00:33 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./a.ts","start":6,"length":3,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ] + }, + "version": "FakeTSVersion", + "size": 1019 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:37 AM] Projects in this build: + * src/tsconfig.json + +[12:00:38 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noCheck/syntax-errors.js b/tests/baselines/reference/tsbuild/noCheck/syntax-errors.js new file mode 100644 index 0000000000000..ea2b9242669bd --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck/syntax-errors.js @@ -0,0 +1,276 @@ +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/a.ts] +const err: number = "error"; +const a = "hello + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:11 AM] Projects in this build: + * src/tsconfig.json + +[12:00:12 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:13 AM] Building project '/src/tsconfig.json'... + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:15 AM] Projects in this build: + * src/tsconfig.json + +[12:00:16 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:17 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/src/a.ts" +] +Program options: { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts during emit) + + +//// [/src/a.d.ts] +declare const err: number; +declare const a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:19 AM] Projects in this build: + * src/tsconfig.json + +[12:00:20 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/a.d.ts' + +exitCode:: ExitStatus.Success + + + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:22 AM] Projects in this build: + * src/tsconfig.json + +[12:00:23 AM] Project 'src/tsconfig.json' is out of date because output 'src/a.d.ts' is older than input 'src/tsconfig.json' + +[12:00:24 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:25 AM] Projects in this build: + * src/tsconfig.json + +[12:00:26 AM] Project 'src/tsconfig.json' is out of date because output 'src/a.d.ts' is older than input 'src/tsconfig.json' + +[12:00:27 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + diff --git a/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js index d8dc60f363d0d..6152d89f341dd 100644 --- a/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js @@ -151,6 +151,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error @@ -162,12 +164,12 @@ const a = "hello" Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:18 AM] Projects in this build: +[12:00:21 AM] Projects in this build: * src/tsconfig.json -[12:00:19 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:20 AM] Building project '/src/tsconfig.json'... +[12:00:23 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ @@ -253,10 +255,10 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:24 AM] Projects in this build: +[12:00:27 AM] Projects in this build: * src/tsconfig.json -[12:00:25 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[12:00:28 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js index b6200d3561abf..0c0588ba19115 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js @@ -199,6 +199,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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 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 b8581da7adb6a..a4ceae4f16b11 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 @@ -138,6 +138,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Normal build without change, that does not block emit on error to show files that get emitted diff --git a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js index b8d9bc71112cb..edfdf7d883faa 100644 --- a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -687,6 +687,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: delete the ndoe10Result in package/types @@ -926,6 +928,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: add the alternateResult in @types @@ -1155,6 +1159,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: add the ndoe10Result in package/types @@ -1371,6 +1377,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: update package.json from @types so error is fixed @@ -2743,6 +2751,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: delete the ndoe10Result in package/types @@ -2982,6 +2992,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: add the alternateResult in @types @@ -3211,6 +3223,8 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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:: add the ndoe10Result in package/types @@ -3427,3 +3441,5 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/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 From 7332613349bb184552c4e5fb1a61d261c19528ae Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 11 Apr 2024 12:51:48 -0700 Subject: [PATCH 12/18] Comment, capture current normal behavior of build/incremental (an option error) --- src/testRunner/unittests/tsbuild/noCheck.ts | 46 +- .../semantic-errors-with-incremental.js | 473 +++++++++++++++++ .../tsbuild/noCheck-errors/semantic-errors.js | 298 +++++++++++ .../syntax-errors-with-incremental.js | 483 ++++++++++++++++++ .../tsbuild/noCheck-errors/syntax-errors.js | 308 +++++++++++ 5 files changed, 1590 insertions(+), 18 deletions(-) create mode 100644 tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors.js diff --git a/src/testRunner/unittests/tsbuild/noCheck.ts b/src/testRunner/unittests/tsbuild/noCheck.ts index f4d1b846e5f74..665ccc7ffaf58 100644 --- a/src/testRunner/unittests/tsbuild/noCheck.ts +++ b/src/testRunner/unittests/tsbuild/noCheck.ts @@ -9,26 +9,10 @@ import { } from "../helpers/tsc"; import { loadProjectFromFiles } from "../helpers/vfs"; -describe("unittests:: tsbuild:: noCheck", () => { - let validate: CommandLineOption["extraValidation"]; - before(() => { - for (const opt of optionDeclarations) { - if (opt.name === "noCheck") { - validate = opt.extraValidation; - opt.extraValidation = () => undefined; - } - } - }); - after(() => { - for (const opt of optionDeclarations) { - if (opt.name === "noCheck") { - opt.extraValidation = validate; - } - } - }); +function verifyNoCheckFlag(variant: string) { function verifyNoCheckWorker(subScenario: string, declAText: string, commandLineArgs: readonly string[]) { verifyTsc({ - scenario: "noCheck", + scenario: variant, subScenario, fs: () => loadProjectFromFiles({ @@ -73,4 +57,30 @@ ${declAText}`; verifyNoCheck("syntax errors", `const a = "hello`); verifyNoCheck("semantic errors", `const a: number = "hello"`); +} + +describe("unittests:: tsbuild:: noCheck", () => { + // Enable the `noCheck` option on the CLI for testing purposes, to ensure it works with incremental/build + let validate: CommandLineOption["extraValidation"]; + before(() => { + for (const opt of optionDeclarations) { + if (opt.name === "noCheck") { + validate = opt.extraValidation; + opt.extraValidation = () => undefined; + } + } + }); + after(() => { + for (const opt of optionDeclarations) { + if (opt.name === "noCheck") { + opt.extraValidation = validate; + } + } + }); + + verifyNoCheckFlag("noCheck"); }); + +describe("unittests:: tsbuild:: noCheck:: errors", () => { + verifyNoCheckFlag("noCheck-errors"); +}); \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..9f22b760a40f9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js @@ -0,0 +1,473 @@ +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/a.ts] +const err: number = "error"; +const a: number = "hello" + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"9312413704-const err: number = \"error\";\nconst a: number = \"hello\"","signature":false,"affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"changeFileSet":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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; };", + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "9312413704-const err: number = \"error\";\nconst a: number = \"hello\"", + "signature": false, + "affectsGlobalScope": true + }, + "version": "9312413704-const err: number = \"error\";\nconst a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 830 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:14 AM] Projects in this build: + * src/tsconfig.json + +[12:00:15 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:16 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:21 AM] Projects in this build: + * src/tsconfig.json + +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:23 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":false,"affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"changeFileSet":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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; };", + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": false, + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 822 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:27 AM] Projects in this build: + * src/tsconfig.json + +[12:00:28 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:29 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:34 AM] Projects in this build: + * src/tsconfig.json + +[12:00:35 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:36 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts) + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./a.ts","start":6,"length":3,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Dts" + ] + ] + }, + "version": "FakeTSVersion", + "size": 1050 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:40 AM] Projects in this build: + * src/tsconfig.json + +[12:00:41 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:42 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors.js b/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors.js new file mode 100644 index 0000000000000..be37c71338c36 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors.js @@ -0,0 +1,298 @@ +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/a.ts] +const err: number = "error"; +const a: number = "hello" + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:11 AM] Projects in this build: + * src/tsconfig.json + +[12:00:12 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:13 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:15 AM] Projects in this build: + * src/tsconfig.json + +[12:00:16 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:17 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:18 AM] Projects in this build: + * src/tsconfig.json + +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:20 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:22 AM] Projects in this build: + * src/tsconfig.json + +[12:00:23 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:24 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:25 AM] Projects in this build: + * src/tsconfig.json + +[12:00:26 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:27 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + diff --git a/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..355a06f906a14 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js @@ -0,0 +1,483 @@ +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/a.ts] +const err: number = "error"; +const a = "hello + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"8018408675-const err: number = \"error\";\nconst a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"changeFileSet":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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; };", + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "8018408675-const err: number = \"error\";\nconst a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "8018408675-const err: number = \"error\";\nconst a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 820 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:14 AM] Projects in this build: + * src/tsconfig.json + +[12:00:15 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:16 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:21 AM] Projects in this build: + * src/tsconfig.json + +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:23 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":false,"affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"changeFileSet":[1,2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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; };", + "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; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": false, + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 822 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:27 AM] Projects in this build: + * src/tsconfig.json + +[12:00:28 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:29 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/src/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:34 AM] Projects in this build: + * src/tsconfig.json + +[12:00:35 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:36 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (computed .d.ts) + + +//// [/src/tsconfig.tsbuildinfo] +{"program":{"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":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./a.ts","start":6,"length":3,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]},"version":"FakeTSVersion"} + +//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "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": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Dts" + ] + ] + }, + "version": "FakeTSVersion", + "size": 1050 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v --incremental +[12:00:40 AM] Projects in this build: + * src/tsconfig.json + +[12:00:41 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[12:00:42 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors.js b/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors.js new file mode 100644 index 0000000000000..ea1eac55da315 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors.js @@ -0,0 +1,308 @@ +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/a.ts] +const err: number = "error"; +const a = "hello + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "noCheck": true, + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:08 AM] Projects in this build: + * src/tsconfig.json + +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:10 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:11 AM] Projects in this build: + * src/tsconfig.json + +[12:00:12 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:13 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + +src/a.ts:2:17 - error TS1002: Unterminated string literal. + +2 const a = "hello +    + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix `a` error +Input:: +//// [/src/a.ts] +const err: number = "error"; +const a = "hello" + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:15 AM] Projects in this build: + * src/tsconfig.json + +[12:00:16 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:17 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:18 AM] Projects in this build: + * src/tsconfig.json + +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:20 AM] Building project '/src/tsconfig.json'... + +src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. + +3 "noCheck": true, +   ~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Disable noCheck +Input:: +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "emitDeclarationOnly": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:22 AM] Projects in this build: + * src/tsconfig.json + +[12:00:23 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:24 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json -v +[12:00:25 AM] Projects in this build: + * src/tsconfig.json + +[12:00:26 AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.d.ts' does not exist + +[12:00:27 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/src/a.ts (used version) + + From 41f82f18d97bd90ba0e4387bd08f75609c3b44e6 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 11 Apr 2024 13:25:15 -0700 Subject: [PATCH 13/18] Diffs --- src/harness/harnessIO.ts | 8 +- .../reference/deferredLookupTypeResolution.js | 35 ++- tests/baselines/reference/indexSignatures1.js | 205 ++---------------- tests/baselines/reference/variadicTuples1.js | 188 ++-------------- .../reference/weakTypesAndLiterals01.js | 27 ++- 5 files changed, 61 insertions(+), 402 deletions(-) diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 93e128769ec8d..e506ade630212 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -997,7 +997,13 @@ export namespace Compiler { } else if (original.text !== doc.text) { jsCode += `\r\n\r\n!!!! File ${Utils.removeTestPathPrefixes(doc.file)} differs from original emit in noCheck emit\r\n`; - jsCode += fileOutput(doc, harnessSettings); + const Diff = require("diff"); + const expected = original.text; + const actual = doc.text; + const patch = Diff.createTwoFilesPatch("Expected", "Actual", expected, actual, "The full check baseline", "with noCheck set"); + const fileName = harnessSettings.fullEmitPaths ? Utils.removeTestPathPrefixes(doc.file) : ts.getBaseFileName(doc.file); + jsCode += "//// [" + fileName + "]\r\n"; + jsCode += patch; } }); } diff --git a/tests/baselines/reference/deferredLookupTypeResolution.js b/tests/baselines/reference/deferredLookupTypeResolution.js index ef66d2d56cffa..ae52f7f522863 100644 --- a/tests/baselines/reference/deferredLookupTypeResolution.js +++ b/tests/baselines/reference/deferredLookupTypeResolution.js @@ -66,25 +66,16 @@ declare function f3(x: 'a' | 'b'): { !!!! File deferredLookupTypeResolution.d.ts differs from original emit in noCheck emit //// [deferredLookupTypeResolution.d.ts] -type StringContains = ({ - [K in S]: 'true'; -} & { - [key: string]: 'false'; -})[L]; -type ObjectHasKey = StringContains, L>; -type First = ObjectHasKey; -type T1 = ObjectHasKey<{ - a: string; -}, 'a'>; -type T2 = ObjectHasKey<{ - a: string; -}, 'b'>; -declare function f1(a: A, b: B): { - [P in A | B]: any; -}; -declare function f2(a: A): { [P in A | "x"]: any; }; -declare function f3(x: 'a' | 'b'): { - x: any; - a: any; - b: any; -}; +=================================================================== +--- Expected The current baseline ++++ Actual The new version +@@ -15,8 +15,8 @@ + [P in A | B]: any; + }; + declare function f2(a: A): { [P in A | "x"]: any; }; + declare function f3(x: 'a' | 'b'): { ++ x: any; + a: any; + b: any; +- x: any; + }; diff --git a/tests/baselines/reference/indexSignatures1.js b/tests/baselines/reference/indexSignatures1.js index 876e3eddfcbe4..24078c3acac07 100644 --- a/tests/baselines/reference/indexSignatures1.js +++ b/tests/baselines/reference/indexSignatures1.js @@ -684,194 +684,17 @@ type K2 = keyof Rec2; !!!! File indexSignatures1.d.ts differs from original emit in noCheck emit //// [indexSignatures1.d.ts] -declare const sym: unique symbol; -declare function gg3(x: { - [key: string]: string; -}, y: { - [key: symbol]: string; -}, z: { - [sym]: number; -}): void; -declare function gg1(x: { - [key: `a${string}`]: string; - [key: `${string}a`]: string; -}, y: { - [key: `a${string}a`]: string; -}): void; -interface IX { - [key: `a${string}`]: string; - [key: `${string}a`]: string; -} -interface IY { - [key: `a${string}a`]: string; -} -declare function gg2(x: IX, y: IY): void; -declare let combo: { - [x: `foo-${string}`]: 'a' | 'b'; -} & { - [x: `${string}-bar`]: 'b' | 'c'; -}; -declare const x1: "a" | "b"; -declare const x2: "b" | "c"; -declare const x3: "b"; -declare var str: string; -declare const x4: "a" | "b"; -declare const x5: "b" | "c"; -declare const x6: "b"; -declare let combo2: { - [x: `${string}xxx${string}` & `${string}yyy${string}`]: string; -}; -declare const x7: string; -declare const x8: string; -declare const x9: any; -declare let dom: { - [x: `data${string}`]: string; -}; -declare const y1: string; -declare const y2: string; -type Funcs = { - [key: `s${string}`]: (x: string) => void; - [key: `n${string}`]: (x: number) => void; -}; -declare const funcs: Funcs; -type Duplicates = { - [key: string | number]: any; - [key: number | symbol]: any; - [key: symbol | `foo${string}`]: any; - [key: `foo${string}`]: any; -}; -type Conflicting = { - [key: `a${string}`]: 'a'; - [key: `${string}a`]: 'b'; - [key: `a${string}a`]: 'c'; -}; -type Invalid = { - [key: 'a' | 'b' | 'c']: string; - [key: T | number]: string; - [key: Error]: string; - [key: T & string]: string; -}; -type Tag1 = { - __tag1__: void; -}; -type Tag2 = { - __tag2__: void; -}; -type TaggedString1 = string & Tag1; -type TaggedString2 = string & Tag2; -declare let s0: string; -declare let s1: TaggedString1; -declare let s2: TaggedString2; -declare let s3: TaggedString1 | TaggedString2; -declare let s4: TaggedString1 & TaggedString2; -interface I1 { - [key: TaggedString1]: string; -} -interface I2 { - [key: TaggedString2]: string; -} -interface I3 { - [key: TaggedString1 | TaggedString2]: string; -} -interface I4 { - [key: TaggedString1 & TaggedString2]: string; -} -declare let i1: I1; -declare let i2: I2; -declare let i3: I3; -declare let i4: I4; -declare let o1: { - [key: TaggedString1]: string; -}; -declare let o2: { - [key: TaggedString2]: string; -}; -declare let o3: { - [key: TaggedString1 | TaggedString2]: string; -}; -declare let o4: { - [key: TaggedString1 & TaggedString2]: string; -}; -declare const obj10: { - [x: string]: 0 | 1; - x: 0; -}; -declare const obj11: { - [x: number]: 2 | 3; - 1: 2; -}; -declare const obj12: { - [x: symbol]: 4 | 5; - [sym]: 4; -}; -declare const obj13: { - [x: string]: 0 | 1 | 2 | 3; - [x: number]: 2 | 3; - [x: symbol]: 4 | 5; - x: 0; - 1: 2; - [sym]: 4; -}; -declare const system: unique symbol; -declare const SomeSytePlugin: unique symbol; -interface Plugs { - [key: symbol]: (...args: any) => unknown; -} -declare const plugins: { - user: Plugs; - [system]: Plugs; -}; -declare var theAnswer: symbol; -declare var obj: Record; -declare const directive: unique symbol; -declare function foo(options: { - [x in string]: (arg: TArg) => TRet; -} & { - [directive]?: TDir; -}): void; -declare let case1: void; -declare let case2: void; -declare let case3: void; -type Pseudo = `&:${string}`; -declare const AmIPseudo1: Pseudo; -declare const AmIPseudo: Pseudo; -type PseudoDeclaration = { - [key in Pseudo]: string; -}; -declare const test: PseudoDeclaration; -type FieldPattern = `/${string}`; -declare const path1: FieldPattern; -declare const path2: FieldPattern; -type PathsObject = { - [P in FieldPattern]: object; -}; -declare const pathObject: PathsObject; -type IdType = `${number}-${number}-${number}-${number}`; -declare const id: IdType; -type A = Record; -declare const a: A; -declare let aid: string; -interface AA { - a?: string; - b?: number; - [key: symbol]: string; -} -declare const aa: AA; -declare const obj1: { - [key: symbol]: string; -}; -declare const obj2: { - [key: string]: string; -}; -declare const obj3: { - [key: number]: string; -}; -type Id = string & { - __tag: 'id '; -}; -type Rec1 = { - [key: Id]: number; -}; -type Rec2 = Record; -type K1 = keyof Rec1; -type K2 = keyof Rec2; +=================================================================== +--- Expected The current baseline ++++ Actual The new version +@@ -118,9 +118,9 @@ + [x: symbol]: 4 | 5; + [sym]: 4; + }; + declare const obj13: { +- [x: string]: 0 | 2 | 1 | 3; ++ [x: string]: 0 | 1 | 2 | 3; + [x: number]: 2 | 3; + [x: symbol]: 4 | 5; + x: 0; + 1: 2; diff --git a/tests/baselines/reference/variadicTuples1.js b/tests/baselines/reference/variadicTuples1.js index 80c6ef1449bde..e1d4e07293579 100644 --- a/tests/baselines/reference/variadicTuples1.js +++ b/tests/baselines/reference/variadicTuples1.js @@ -837,177 +837,17 @@ type AnyArr = [...any]; !!!! File variadicTuples1.d.ts differs from original emit in noCheck emit //// [variadicTuples1.d.ts] -type TV0 = [string, ...T]; -type TV1 = [string, ...T, number]; -type TV2 = [string, ...T, number, ...T]; -type TV3 = [string, ...T, ...number[], ...T]; -type TN1 = TV1<[boolean, string]>; -type TN2 = TV1<[]>; -type TN3 = TV1<[boolean?]>; -type TN4 = TV1; -type TN5 = TV1<[boolean] | [symbol, symbol]>; -type TN6 = TV1; -type TN7 = TV1; -declare function tup2(t: [...T], u: [...U]): readonly [1, ...T, 2, ...U, 3]; -declare const t2: readonly [1, string, 2, number, boolean, 3]; -declare function concat(t: [...T], u: [...U]): [...T, ...U]; -declare const sa: string[]; -declare const tc1: []; -declare const tc2: [string, number]; -declare const tc3: [number, number, number, ...string[]]; -declare const tc4: [...string[], number, number, number]; -declare function concat2(t: T, u: U): (T[number] | U[number])[]; -declare const tc5: (1 | 2 | 3 | 6 | 4 | 5)[]; -declare function foo1(a: number, b: string, c: boolean, ...d: number[]): void; -declare function foo2(t1: [number, string], t2: [boolean], a1: number[]): void; -declare function foo3(x: number, ...args: [...T, number]): T; -declare function foo4(u: U): void; -declare function ft1(t: T): T; -declare function ft2(t: T): readonly [...T]; -declare function ft3(t: [...T]): T; -declare function ft4(t: [...T]): readonly [...T]; -declare function f0(t: [string, ...T], n: number): void; -declare function f1(t: [string, ...T, number], n: number): void; -declare function f2(t: [string, ...T]): void; -declare function f3(t: [string, ...T, number]): void; -type Arrayify = { - [P in keyof T]: T[P][]; -}; -type TM1 = Arrayify; -type TP1 = Partial<[string, ...T, number]>; -type TP2 = Partial<[string, ...T, ...number[]]>; -declare function fm1(t: Arrayify<[string, number, ...T]>): T; -declare let tm1: [boolean, string]; -declare function fx1(a: string, ...args: T): T; -declare function gx1(u: U, v: V): void; -declare function fx2(a: string, ...args: T): T; -declare function gx2(u: U, v: V): void; -declare function f10(x: [string, ...unknown[]], y: [string, ...T], z: [string, ...U]): void; -declare function f11(t: T, m: [...T], r: readonly [...T]): void; -declare function f12(t: T, m: [...T], r: readonly [...T]): void; -declare function f13(t0: T, t1: [...T], t2: [...U]): void; -declare function f14(t0: T, t1: [...T], t2: [...U]): void; -declare function f15(k0: keyof T, k1: keyof [...T], k2: keyof [...U], k3: keyof [1, 2, ...T]): void; -declare function ft16(x: [unknown, unknown], y: [...T, ...T]): void; -declare function ft17(x: [unknown, unknown], y: [...T, ...T]): void; -declare function ft18(x: [unknown, unknown], y: [...T, ...T]): void; -type First = T extends readonly [unknown, ...unknown[]] ? T[0] : T[0] | undefined; -type DropFirst = T extends readonly [unknown?, ...infer U] ? U : [...T]; -type Last = T extends readonly [...unknown[], infer U] ? U : T extends readonly [unknown, ...unknown[]] ? T[number] : T[number] | undefined; -type DropLast = T extends readonly [...infer U, unknown] ? U : [...T]; -type T00 = First<[number, symbol, string]>; -type T01 = First<[symbol, string]>; -type T02 = First<[string]>; -type T03 = First<[number, symbol, ...string[]]>; -type T04 = First<[symbol, ...string[]]>; -type T05 = First<[string?]>; -type T06 = First; -type T07 = First<[]>; -type T08 = First; -type T09 = First; -type T10 = DropFirst<[number, symbol, string]>; -type T11 = DropFirst<[symbol, string]>; -type T12 = DropFirst<[string]>; -type T13 = DropFirst<[number, symbol, ...string[]]>; -type T14 = DropFirst<[symbol, ...string[]]>; -type T15 = DropFirst<[string?]>; -type T16 = DropFirst; -type T17 = DropFirst<[]>; -type T18 = DropFirst; -type T19 = DropFirst; -type T20 = Last<[number, symbol, string]>; -type T21 = Last<[symbol, string]>; -type T22 = Last<[string]>; -type T23 = Last<[number, symbol, ...string[]]>; -type T24 = Last<[symbol, ...string[]]>; -type T25 = Last<[string?]>; -type T26 = Last; -type T27 = Last<[]>; -type T28 = Last; -type T29 = Last; -type T30 = DropLast<[number, symbol, string]>; -type T31 = DropLast<[symbol, string]>; -type T32 = DropLast<[string]>; -type T33 = DropLast<[number, symbol, ...string[]]>; -type T34 = DropLast<[symbol, ...string[]]>; -type T35 = DropLast<[string?]>; -type T36 = DropLast; -type T37 = DropLast<[]>; -type T38 = DropLast; -type T39 = DropLast; -type R00 = First; -type R01 = First; -type R02 = First; -type R03 = First; -type R04 = First; -type R05 = First; -type R06 = First; -type R10 = DropFirst; -type R11 = DropFirst; -type R12 = DropFirst; -type R13 = DropFirst; -type R14 = DropFirst; -type R15 = DropFirst; -type R16 = DropFirst; -type R20 = Last; -type R21 = Last; -type R22 = Last; -type R23 = Last; -type R24 = Last; -type R25 = Last; -type R26 = Last; -type R30 = DropLast; -type R31 = DropLast; -type R32 = DropLast; -type R33 = DropLast; -type R34 = DropLast; -type R35 = DropLast; -type R36 = DropLast; -declare function curry(f: (...args: [...T, ...U]) => R, ...a: T): (...b: U) => R; -declare const fn1: (a: number, b: string, c: boolean, d: string[]) => number; -declare const c0: (a: number, b: string, c: boolean, d: string[]) => number; -declare const c1: (b: string, c: boolean, d: string[]) => number; -declare const c2: (c: boolean, d: string[]) => number; -declare const c3: (d: string[]) => number; -declare const c4: () => number; -declare const fn2: (x: number, b: boolean, ...args: string[]) => number; -declare const c10: (x: number, b: boolean, ...args: string[]) => number; -declare const c11: (b: boolean, ...args: string[]) => number; -declare const c12: (...b: string[]) => number; -declare const c13: (...b: string[]) => number; -declare const fn3: (...args: string[]) => number; -declare const c20: (...b: string[]) => number; -declare const c21: (...b: string[]) => number; -declare const c22: (...b: string[]) => number; -declare function curry2(f: (...args: [...T, ...U]) => R, t: [...T], u: [...U]): R; -declare function fn10(a: string, b: number, c: boolean): string[]; -declare function ft(t1: [...T], t2: [...T, number?]): T; -declare function call(...args: [...T, (...args: T) => R]): [T, R]; -declare function f20(args: [...T, number?]): T; -declare function f21(args: [...U, number?]): void; -declare function f22(args: [...T, number]): T; -declare function f22(args: [...T]): T; -declare function f23(args: [...U, number]): void; -interface Desc { - readonly f: (...args: A) => T; - bind(this: Desc<[...T, ...U], R>, ...args: T): Desc<[...U], R>; -} -declare const a: Desc<[string, number, boolean], object>; -declare const b: Desc<[boolean], object>; -declare function getUser(id: string, options?: { - x?: string; -}): string; -declare function getOrgUser(id: string, orgId: number, options?: { - y?: number; - z?: boolean; -}): void; -declare function callApi(method: (...args: [...T, object]) => U): (...args_0: T) => U; -type Numbers = number[]; -type Unbounded = [...Numbers, boolean]; -declare const data: Unbounded; -type U1 = [string, ...Numbers, boolean]; -type U2 = [...[string, ...Numbers], boolean]; -type U3 = [...[string, number], boolean]; -type ToStringLength1 = `${T['length']}`; -type ToStringLength2 = `${[...T]['length']}`; -type AnyArr = [...any]; +=================================================================== +--- Expected The current baseline ++++ Actual The new version +@@ -17,9 +17,9 @@ + declare const tc2: [string, number]; + declare const tc3: [number, number, number, ...string[]]; + declare const tc4: [...string[], number, number, number]; + declare function concat2(t: T, u: U): (T[number] | U[number])[]; +-declare const tc5: (2 | 4 | 1 | 3 | 6 | 5)[]; ++declare const tc5: (1 | 2 | 3 | 6 | 4 | 5)[]; + declare function foo1(a: number, b: string, c: boolean, ...d: number[]): void; + declare function foo2(t1: [number, string], t2: [boolean], a1: number[]): void; + declare function foo3(x: number, ...args: [...T, number]): T; + declare function foo4(u: U): void; diff --git a/tests/baselines/reference/weakTypesAndLiterals01.js b/tests/baselines/reference/weakTypesAndLiterals01.js index 3b4935fce3bfe..2ccdc498ecce0 100644 --- a/tests/baselines/reference/weakTypesAndLiterals01.js +++ b/tests/baselines/reference/weakTypesAndLiterals01.js @@ -71,17 +71,16 @@ declare const i: (arg: WeakTypes) => WeakTypes; !!!! File weakTypesAndLiterals01.d.ts differs from original emit in noCheck emit //// [weakTypesAndLiterals01.d.ts] -type WeakTypes = { - optional?: true; -} | { - toLowerCase?(): string; -} | { - toUpperCase?(): string; - otherOptionalProp?: number; -}; -type LiteralsOrWeakTypes = "A" | "B" | WeakTypes; -declare let aOrB: "A" | "B"; -declare const f: (arg: LiteralsOrWeakTypes) => "A" | "B" | WeakTypes; -declare const g: (arg: WeakTypes) => WeakTypes; -declare const h: (arg: LiteralsOrWeakTypes) => LiteralsOrWeakTypes; -declare const i: (arg: WeakTypes) => WeakTypes; +=================================================================== +--- Expected The current baseline ++++ Actual The new version +@@ -7,8 +7,8 @@ + otherOptionalProp?: number; + }; + type LiteralsOrWeakTypes = "A" | "B" | WeakTypes; + declare let aOrB: "A" | "B"; +-declare const f: (arg: LiteralsOrWeakTypes) => WeakTypes | "A" | "B"; ++declare const f: (arg: LiteralsOrWeakTypes) => "A" | "B" | WeakTypes; + declare const g: (arg: WeakTypes) => WeakTypes; + declare const h: (arg: LiteralsOrWeakTypes) => LiteralsOrWeakTypes; + declare const i: (arg: WeakTypes) => WeakTypes; From 5c9c333a9d3df459db82c790f3c8908fb99dcd84 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 11 Apr 2024 13:25:42 -0700 Subject: [PATCH 14/18] Format --- src/testRunner/unittests/tsbuild/noCheck.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testRunner/unittests/tsbuild/noCheck.ts b/src/testRunner/unittests/tsbuild/noCheck.ts index 665ccc7ffaf58..376289aeb7949 100644 --- a/src/testRunner/unittests/tsbuild/noCheck.ts +++ b/src/testRunner/unittests/tsbuild/noCheck.ts @@ -83,4 +83,4 @@ describe("unittests:: tsbuild:: noCheck", () => { describe("unittests:: tsbuild:: noCheck:: errors", () => { verifyNoCheckFlag("noCheck-errors"); -}); \ No newline at end of file +}); From 72bd93cfce333b091ddfd8b447e35be09b77aaf2 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 11 Apr 2024 13:32:24 -0700 Subject: [PATCH 15/18] Actually accept more useful diff names --- tests/baselines/reference/deferredLookupTypeResolution.js | 4 ++-- tests/baselines/reference/indexSignatures1.js | 4 ++-- tests/baselines/reference/variadicTuples1.js | 4 ++-- tests/baselines/reference/weakTypesAndLiterals01.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/baselines/reference/deferredLookupTypeResolution.js b/tests/baselines/reference/deferredLookupTypeResolution.js index ae52f7f522863..e422e226becee 100644 --- a/tests/baselines/reference/deferredLookupTypeResolution.js +++ b/tests/baselines/reference/deferredLookupTypeResolution.js @@ -67,8 +67,8 @@ declare function f3(x: 'a' | 'b'): { !!!! File deferredLookupTypeResolution.d.ts differs from original emit in noCheck emit //// [deferredLookupTypeResolution.d.ts] =================================================================== ---- Expected The current baseline -+++ Actual The new version +--- Expected The full check baseline ++++ Actual with noCheck set @@ -15,8 +15,8 @@ [P in A | B]: any; }; diff --git a/tests/baselines/reference/indexSignatures1.js b/tests/baselines/reference/indexSignatures1.js index 24078c3acac07..e1b61cce64b32 100644 --- a/tests/baselines/reference/indexSignatures1.js +++ b/tests/baselines/reference/indexSignatures1.js @@ -685,8 +685,8 @@ type K2 = keyof Rec2; !!!! File indexSignatures1.d.ts differs from original emit in noCheck emit //// [indexSignatures1.d.ts] =================================================================== ---- Expected The current baseline -+++ Actual The new version +--- Expected The full check baseline ++++ Actual with noCheck set @@ -118,9 +118,9 @@ [x: symbol]: 4 | 5; [sym]: 4; diff --git a/tests/baselines/reference/variadicTuples1.js b/tests/baselines/reference/variadicTuples1.js index e1d4e07293579..cf327f771e2b8 100644 --- a/tests/baselines/reference/variadicTuples1.js +++ b/tests/baselines/reference/variadicTuples1.js @@ -838,8 +838,8 @@ type AnyArr = [...any]; !!!! File variadicTuples1.d.ts differs from original emit in noCheck emit //// [variadicTuples1.d.ts] =================================================================== ---- Expected The current baseline -+++ Actual The new version +--- Expected The full check baseline ++++ Actual with noCheck set @@ -17,9 +17,9 @@ declare const tc2: [string, number]; declare const tc3: [number, number, number, ...string[]]; diff --git a/tests/baselines/reference/weakTypesAndLiterals01.js b/tests/baselines/reference/weakTypesAndLiterals01.js index 2ccdc498ecce0..99b96baa69bec 100644 --- a/tests/baselines/reference/weakTypesAndLiterals01.js +++ b/tests/baselines/reference/weakTypesAndLiterals01.js @@ -72,8 +72,8 @@ declare const i: (arg: WeakTypes) => WeakTypes; !!!! File weakTypesAndLiterals01.d.ts differs from original emit in noCheck emit //// [weakTypesAndLiterals01.d.ts] =================================================================== ---- Expected The current baseline -+++ Actual The new version +--- Expected The full check baseline ++++ Actual with noCheck set @@ -7,8 +7,8 @@ otherOptionalProp?: number; }; From e0d7b4eb665b6ab955d220140e1a327c8cc370ae Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 11 Apr 2024 13:49:17 -0700 Subject: [PATCH 16/18] Cleanup --- src/compiler/commandLineParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1e2dc878605b3..a51e3b1c836d4 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1709,7 +1709,7 @@ let optionsNameMapCache: OptionsNameMap; /** @internal */ export function getOptionsNameMap(): OptionsNameMap { - return optionsNameMapCache ||= createOptionNameMap([...optionDeclarations]); + return optionsNameMapCache ||= createOptionNameMap(optionDeclarations); } const compilerOptionsAlternateMode: AlternateModeDiagnostics = { From 2f655407b6a7558e71b161772899ae03eb55ea54 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 24 Apr 2024 10:45:51 -0700 Subject: [PATCH 17/18] Enable noCheck for transpileDeclaration --- src/services/transpile.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/transpile.ts b/src/services/transpile.ts index a815243923825..b9179bcd2a198 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -75,6 +75,7 @@ export function transpileModule(input: string, transpileOptions: TranspileOption * - noResolve = true * - declaration = true * - emitDeclarationOnly = true + * - noCheck = true * Note that this declaration file may differ from one produced by a full program typecheck, * in that only types in the single input file are available to be used in the generated declarations. */ @@ -141,6 +142,7 @@ function transpileWorker(input: string, transpileOptions: TranspileOptions, decl options.declaration = true; options.emitDeclarationOnly = true; options.isolatedDeclarations = true; + options.noCheck = true; } else { options.declaration = false; From 0f1b4c6fc34995189324548d0b4a778322380960 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 24 Apr 2024 13:43:15 -0700 Subject: [PATCH 18/18] Remove builder change --- src/compiler/builder.ts | 5 - ...claration-and-incremental-discrepancies.js | 135 ++++++ ...ndline-with-declaration-and-incremental.js | 290 +----------- ...claration-and-incremental-discrepancies.js | 269 ++++++++++- ...ndline-with-declaration-and-incremental.js | 438 ++---------------- ...tax-errors-in-config-file-discrepancies.js | 83 +++- .../reports-syntax-errors-in-config-file.js | 69 --- .../semantic-errors-with-incremental.js | 28 +- .../syntax-errors-with-incremental.js | 28 +- ...c-errors-with-incremental-discrepancies.js | 164 +++++++ .../semantic-errors-with-incremental.js | 102 ++-- ...x-errors-with-incremental-discrepancies.js | 164 +++++++ .../noCheck/syntax-errors-with-incremental.js | 120 ++--- .../noEmit/syntax-errors-with-incremental.js | 12 +- .../syntax-errors-with-incremental.js | 2 - ...iles-belong-to-rootDir-and-is-composite.js | 2 - .../tsc/moduleResolution/alternateResult.js | 16 - 17 files changed, 976 insertions(+), 951 deletions(-) create mode 100644 tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental-discrepancies.js diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 7009fc87cc515..d2f7b376ddd5b 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -451,11 +451,6 @@ function createBuilderProgramState(newProgram: Program, oldState: Readonly\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./e.ts": { + "version": "-13789510868-export const e = 10;", + "impliedFormat": "commonjs" + }, + "../../project1/src/a.d.ts": { + "version": "-3497920574-export declare const a = 10;\n", + "impliedFormat": "commonjs" + }, + "./f.ts": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "impliedFormat": "commonjs" + }, + "../../project1/src/b.d.ts": { + "version": "-3829150557-export declare const b = 10;\n", + "impliedFormat": "commonjs" + }, + "./g.ts": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./e.ts": { + "version": "-13789510868-export const e = 10;", + "impliedFormat": "commonjs" + }, + "../../project1/src/a.d.ts": { + "version": "-3497920574-export declare const a = 10;\n", + "impliedFormat": "commonjs" + }, + "./f.ts": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "impliedFormat": "commonjs" + }, + "../../project1/src/b.d.ts": { + "version": "-3829150557-export declare const b = 10;\n", + "impliedFormat": "commonjs" + }, + "./g.ts": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": false + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion" } \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js index 44fb5d5fd11f4..0cfdd001384d3 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -450,8 +450,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: change @@ -463,17 +461,17 @@ export const a = 10;const aLocal = 10;const aa = 10; Output:: /lib/tsc --b /src/project2/src --verbose -[12:00:42 AM] Projects in this build: +[12:00:39 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:43 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' +[12:00:40 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' -[12:00:44 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:41 AM] Building project '/src/project1/src/tsconfig.json'... -[12:00:49 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:46 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:50 AM] Building project '/src/project2/src/tsconfig.json'... +[12:00:47 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -652,8 +650,6 @@ No shapes updated in the builder:: "size": 1381 } -//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: emit js files @@ -662,17 +658,17 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly false -[12:00:54 AM] Projects in this build: +[12:00:48 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:55 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions +[12:00:49 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -[12:00:56 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:50 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:04 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:58 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:05 AM] Building project '/src/project2/src/tsconfig.json'... +[12:00:59 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1008,15 +1004,15 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:09 AM] Projects in this build: +[12:01:03 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:10 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' +[12:01:04 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' -[12:01:11 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:05 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:12 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:06 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1056,125 +1052,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/project2/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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,"impliedFormat":1},{"version":"-13789510868-export const e = 10;","signature":false,"impliedFormat":1},{"version":"-3497920574-export declare const a = 10;\n","signature":false,"impliedFormat":1},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false,"impliedFormat":1},{"version":"-3829150557-export declare const b = 10;\n","signature":false,"impliedFormat":1},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false,"impliedFormat":1}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} - -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../lib/lib.d.ts", - "./e.ts", - "../../project1/src/a.d.ts", - "./f.ts", - "../../project1/src/b.d.ts", - "./g.ts" - ], - "fileNamesList": [ - [ - "../../project1/src/a.d.ts" - ], - [ - "../../project1/src/b.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; };", - "signature": false, - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "./e.ts": { - "original": { - "version": "-13789510868-export const e = 10;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-13789510868-export const e = 10;", - "impliedFormat": "commonjs" - }, - "../../project1/src/a.d.ts": { - "original": { - "version": "-3497920574-export declare const a = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3497920574-export declare const a = 10;\n", - "impliedFormat": "commonjs" - }, - "./f.ts": { - "original": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "impliedFormat": "commonjs" - }, - "../../project1/src/b.d.ts": { - "original": { - "version": "-3829150557-export declare const b = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3829150557-export declare const b = 10;\n", - "impliedFormat": "commonjs" - }, - "./g.ts": { - "original": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1368 -} - Change:: no change run with js emit @@ -1183,15 +1060,15 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly false -[12:01:16 AM] Projects in this build: +[12:01:07 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:17 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' +[12:01:08 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' -[12:01:18 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:09 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:19 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:10 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1231,125 +1108,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/project2/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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,"impliedFormat":1},{"version":"-13789510868-export const e = 10;","signature":false,"impliedFormat":1},{"version":"-3497920574-export declare const a = 10;\n","signature":false,"impliedFormat":1},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false,"impliedFormat":1},{"version":"-3829150557-export declare const b = 10;\n","signature":false,"impliedFormat":1},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false,"impliedFormat":1}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":false},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} - -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../lib/lib.d.ts", - "./e.ts", - "../../project1/src/a.d.ts", - "./f.ts", - "../../project1/src/b.d.ts", - "./g.ts" - ], - "fileNamesList": [ - [ - "../../project1/src/a.d.ts" - ], - [ - "../../project1/src/b.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; };", - "signature": false, - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "./e.ts": { - "original": { - "version": "-13789510868-export const e = 10;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-13789510868-export const e = 10;", - "impliedFormat": "commonjs" - }, - "../../project1/src/a.d.ts": { - "original": { - "version": "-3497920574-export declare const a = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3497920574-export declare const a = 10;\n", - "impliedFormat": "commonjs" - }, - "./f.ts": { - "original": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "impliedFormat": "commonjs" - }, - "../../project1/src/b.d.ts": { - "original": { - "version": "-3829150557-export declare const b = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3829150557-export declare const b = 10;\n", - "impliedFormat": "commonjs" - }, - "./g.ts": { - "original": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": false - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1369 -} - Change:: js emit with change @@ -1361,17 +1119,17 @@ export const b = 10;const bLocal = 10;const blocal = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly false -[12:01:24 AM] Projects in this build: +[12:01:12 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:25 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:13 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:26 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:14 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:32 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:20 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:33 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:21 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:8:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1559,5 +1317,3 @@ var blocal = 10; "size": 1399 } -//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js index 38ed092be0223..84a50b0823c06 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental-discrepancies.js @@ -125,7 +125,274 @@ IncrementalBuild: }, "version": "FakeTSVersion" } +TsBuild info text without affectedFilesPendingEmit:: /src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./e.ts": { + "version": "-13789510868-export const e = 10;", + "impliedFormat": "commonjs" + }, + "../../project1/src/a.d.ts": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedFormat": "commonjs" + }, + "./f.ts": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "impliedFormat": "commonjs" + }, + "../../project1/src/b.d.ts": { + "version": "-3829150557-export declare const b = 10;\n", + "impliedFormat": "commonjs" + }, + "./g.ts": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./e.ts": { + "version": "-13789510868-export const e = 10;", + "impliedFormat": "commonjs" + }, + "../../project1/src/a.d.ts": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedFormat": "commonjs" + }, + "./f.ts": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "impliedFormat": "commonjs" + }, + "../../project1/src/b.d.ts": { + "version": "-3829150557-export declare const b = 10;\n", + "impliedFormat": "commonjs" + }, + "./g.ts": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion" +} 6:: local change Clean build tsbuildinfo for project2 will have compilerOptions with composite and emitDeclarationOnly Incremental build will detect that it doesnt need to rebuild project2 so tsbuildinfo for it is from before which has option composite only -*** Supplied discrepancy explanation but didnt file any difference \ No newline at end of file +TsBuild info text without affectedFilesPendingEmit:: /src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./e.ts": { + "version": "-13789510868-export const e = 10;", + "impliedFormat": "commonjs" + }, + "../../project1/src/a.d.ts": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedFormat": "commonjs" + }, + "./f.ts": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "impliedFormat": "commonjs" + }, + "../../project1/src/b.d.ts": { + "version": "-3829150557-export declare const b = 10;\n", + "impliedFormat": "commonjs" + }, + "./g.ts": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./e.ts": { + "version": "-13789510868-export const e = 10;", + "impliedFormat": "commonjs" + }, + "../../project1/src/a.d.ts": { + "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedFormat": "commonjs" + }, + "./f.ts": { + "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", + "impliedFormat": "commonjs" + }, + "../../project1/src/b.d.ts": { + "version": "-3829150557-export declare const b = 10;\n", + "impliedFormat": "commonjs" + }, + "./g.ts": { + "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./e.ts" + ], + [ + 4, + "./f.ts" + ], + [ + 6, + "./g.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "changeFileSet": [ + "../../../lib/lib.d.ts", + "../../project1/src/a.d.ts", + "../../project1/src/b.d.ts", + "./e.ts", + "./f.ts", + "./g.ts" + ] + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js index 2c459b59463bc..826fcd17624d3 100644 --- a/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -448,8 +448,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: local change @@ -461,17 +459,17 @@ export const a = 10;const aLocal = 10;const aa = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:00:42 AM] Projects in this build: +[12:00:39 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:43 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' +[12:00:40 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' -[12:00:44 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:41 AM] Building project '/src/project1/src/tsconfig.json'... -[12:00:49 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:46 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:50 AM] Building project '/src/project2/src/tsconfig.json'... +[12:00:47 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -650,8 +648,6 @@ No shapes updated in the builder:: "size": 1381 } -//// [/src/project2/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: non local change @@ -663,17 +659,17 @@ export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:00:55 AM] Projects in this build: +[12:00:49 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:00:56 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' +[12:00:50 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/a.ts' -[12:00:57 AM] Building project '/src/project1/src/tsconfig.json'... +[12:00:51 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:03 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:57 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:04 AM] Building project '/src/project2/src/tsconfig.json'... +[12:00:58 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -986,17 +982,17 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:08 AM] Projects in this build: +[12:01:02 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:09 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions +[12:01:03 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -[12:01:10 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:04 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:18 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:12 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:19 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:13 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1329,15 +1325,15 @@ Input:: Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:01:23 AM] Projects in this build: +[12:01:17 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:24 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' +[12:01:18 AM] Project 'src/project1/src/tsconfig.json' is up to date because newest input 'src/project1/src/a.ts' is older than output 'src/project1/src/tsconfig.tsbuildinfo' -[12:01:25 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:19 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:26 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:20 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1377,125 +1373,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/project2/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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,"impliedFormat":1},{"version":"-13789510868-export const e = 10;","signature":false,"impliedFormat":1},{"version":"-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n","signature":false,"impliedFormat":1},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false,"impliedFormat":1},{"version":"-3829150557-export declare const b = 10;\n","signature":false,"impliedFormat":1},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false,"impliedFormat":1}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} - -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../lib/lib.d.ts", - "./e.ts", - "../../project1/src/a.d.ts", - "./f.ts", - "../../project1/src/b.d.ts", - "./g.ts" - ], - "fileNamesList": [ - [ - "../../project1/src/a.d.ts" - ], - [ - "../../project1/src/b.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; };", - "signature": false, - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "./e.ts": { - "original": { - "version": "-13789510868-export const e = 10;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-13789510868-export const e = 10;", - "impliedFormat": "commonjs" - }, - "../../project1/src/a.d.ts": { - "original": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", - "impliedFormat": "commonjs" - }, - "./f.ts": { - "original": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "impliedFormat": "commonjs" - }, - "../../project1/src/b.d.ts": { - "original": { - "version": "-3829150557-export declare const b = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3829150557-export declare const b = 10;\n", - "impliedFormat": "commonjs" - }, - "./g.ts": { - "original": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1400 -} - Change:: js emit with change without emitDeclarationOnly @@ -1507,17 +1384,17 @@ export const b = 10;const bLocal = 10;const alocal = 10; Output:: /lib/tsc --b /src/project2/src --verbose -[12:01:31 AM] Projects in this build: +[12:01:22 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:32 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:23 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:33 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:24 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:39 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:30 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:40 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:31 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -1702,124 +1579,6 @@ var alocal = 10; "size": 1425 } -//// [/src/project2/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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,"impliedFormat":1},{"version":"-13789510868-export const e = 10;","signature":false,"impliedFormat":1},{"version":"-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n","signature":false,"impliedFormat":1},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false,"impliedFormat":1},{"version":"-3829150557-export declare const b = 10;\n","signature":false,"impliedFormat":1},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false,"impliedFormat":1}],"root":[2,4,6],"options":{"declaration":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} - -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../lib/lib.d.ts", - "./e.ts", - "../../project1/src/a.d.ts", - "./f.ts", - "../../project1/src/b.d.ts", - "./g.ts" - ], - "fileNamesList": [ - [ - "../../project1/src/a.d.ts" - ], - [ - "../../project1/src/b.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; };", - "signature": false, - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "./e.ts": { - "original": { - "version": "-13789510868-export const e = 10;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-13789510868-export const e = 10;", - "impliedFormat": "commonjs" - }, - "../../project1/src/a.d.ts": { - "original": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", - "impliedFormat": "commonjs" - }, - "./f.ts": { - "original": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "impliedFormat": "commonjs" - }, - "../../project1/src/b.d.ts": { - "original": { - "version": "-3829150557-export declare const b = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3829150557-export declare const b = 10;\n", - "impliedFormat": "commonjs" - }, - "./g.ts": { - "original": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1373 -} - Change:: local change @@ -1831,17 +1590,17 @@ export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10; Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:01:45 AM] Projects in this build: +[12:01:33 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:46 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:34 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:01:47 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:35 AM] Building project '/src/project1/src/tsconfig.json'... -[12:01:52 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:40 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:01:53 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:41 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -2020,125 +1779,6 @@ No shapes updated in the builder:: "size": 1468 } -//// [/src/project2/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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,"impliedFormat":1},{"version":"-13789510868-export const e = 10;","signature":false,"impliedFormat":1},{"version":"-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n","signature":false,"impliedFormat":1},{"version":"-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;","signature":false,"impliedFormat":1},{"version":"-3829150557-export declare const b = 10;\n","signature":false,"impliedFormat":1},{"version":"-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;","signature":false,"impliedFormat":1}],"root":[2,4,6],"options":{"declaration":true,"emitDeclarationOnly":true},"fileIdsList":[[3],[5]],"referencedMap":[[4,1],[6,2]],"changeFileSet":[1,3,5,2,4,6]},"version":"FakeTSVersion"} - -//// [/src/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../lib/lib.d.ts", - "./e.ts", - "../../project1/src/a.d.ts", - "./f.ts", - "../../project1/src/b.d.ts", - "./g.ts" - ], - "fileNamesList": [ - [ - "../../project1/src/a.d.ts" - ], - [ - "../../project1/src/b.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; };", - "signature": false, - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "./e.ts": { - "original": { - "version": "-13789510868-export const e = 10;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-13789510868-export const e = 10;", - "impliedFormat": "commonjs" - }, - "../../project1/src/a.d.ts": { - "original": { - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-1973399231-export declare const a = 10;\nexport declare const aaa = 10;\n", - "impliedFormat": "commonjs" - }, - "./f.ts": { - "original": { - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2015135303-import { a } from \"../../project1/src/a\"; export const f = a;", - "impliedFormat": "commonjs" - }, - "../../project1/src/b.d.ts": { - "original": { - "version": "-3829150557-export declare const b = 10;\n", - "signature": false, - "impliedFormat": 1 - }, - "version": "-3829150557-export declare const b = 10;\n", - "impliedFormat": "commonjs" - }, - "./g.ts": { - "original": { - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "signature": false, - "impliedFormat": 1 - }, - "version": "-2047954019-import { b } from \"../../project1/src/b\"; export const g = b;", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./e.ts" - ], - [ - 4, - "./f.ts" - ], - [ - 6, - "./g.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": { - "./f.ts": [ - "../../project1/src/a.d.ts" - ], - "./g.ts": [ - "../../project1/src/b.d.ts" - ] - }, - "changeFileSet": [ - "../../../lib/lib.d.ts", - "../../project1/src/a.d.ts", - "../../project1/src/b.d.ts", - "./e.ts", - "./f.ts", - "./g.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1400 -} - Change:: non local change @@ -2150,17 +1790,17 @@ export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export c Output:: /lib/tsc --b /src/project2/src --verbose --emitDeclarationOnly -[12:01:58 AM] Projects in this build: +[12:01:43 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:01:59 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' +[12:01:44 AM] Project 'src/project1/src/tsconfig.json' is out of date because output 'src/project1/src/tsconfig.tsbuildinfo' is older than input 'src/project1/src/b.ts' -[12:02:00 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:45 AM] Building project '/src/project1/src/tsconfig.json'... -[12:02:06 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:01:51 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:02:07 AM] Building project '/src/project2/src/tsconfig.json'... +[12:01:52 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. @@ -2476,17 +2116,17 @@ export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export c Output:: /lib/tsc --b /src/project2/src --verbose -[12:02:12 AM] Projects in this build: +[12:01:57 AM] Projects in this build: * src/project1/src/tsconfig.json * src/project2/src/tsconfig.json -[12:02:13 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions +[12:01:58 AM] Project 'src/project1/src/tsconfig.json' is out of date because buildinfo file 'src/project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions -[12:02:14 AM] Building project '/src/project1/src/tsconfig.json'... +[12:01:59 AM] Building project '/src/project1/src/tsconfig.json'... -[12:02:24 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:02:09 AM] Project 'src/project2/src/tsconfig.json' is out of date because buildinfo file 'src/project2/src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:02:25 AM] Building project '/src/project2/src/tsconfig.json'... +[12:02:10 AM] Building project '/src/project2/src/tsconfig.json'... src/project2/src/tsconfig.json:7:5 - error TS6306: Referenced project '/src/project1/src' must have setting "composite": true. diff --git a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js index 926e8f2c362ee..cb241b5deea71 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file-discrepancies.js @@ -1,4 +1,85 @@ 0:: reports syntax errors after change to config file During incremental build, tsbuildinfo is not emitted, so declaration option is not present Clean build has declaration option in tsbuildinfo -*** Supplied discrepancy explanation but didnt file any difference \ No newline at end of file +TsBuild info text without affectedFilesPendingEmit:: /src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "4646078106-export function foo() { }", + "impliedFormat": "commonjs" + }, + "./b.ts": { + "version": "1045484683-export function bar() { }", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "composite": true, + "declaration": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "4646078106-export function foo() { }", + "impliedFormat": "commonjs" + }, + "./b.ts": { + "version": "1045484683-export function bar() { }", + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": {}, + "changeFileSet": [ + "../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js index c987ce662b451..f868766edc4d1 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js @@ -144,73 +144,6 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -//// [/src/tsconfig.tsbuildinfo] -{"program":{"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,"impliedFormat":1},{"version":"4646078106-export function foo() { }","signature":false,"impliedFormat":1},{"version":"1045484683-export function bar() { }","signature":false,"impliedFormat":1}],"root":[2,3],"options":{"composite":true,"declaration":true},"referencedMap":[],"changeFileSet":[1,2,3]},"version":"FakeTSVersion"} - -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "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; };", - "signature": false, - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "./a.ts": { - "original": { - "version": "4646078106-export function foo() { }", - "signature": false, - "impliedFormat": 1 - }, - "version": "4646078106-export function foo() { }", - "impliedFormat": "commonjs" - }, - "./b.ts": { - "original": { - "version": "1045484683-export function bar() { }", - "signature": false, - "impliedFormat": 1 - }, - "version": "1045484683-export function bar() { }", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./a.ts" - ], - [ - 3, - "./b.ts" - ] - ], - "options": { - "composite": true, - "declaration": true - }, - "referencedMap": {}, - "changeFileSet": [ - "../lib/lib.d.ts", - "./a.ts", - "./b.ts" - ] - }, - "version": "FakeTSVersion", - "size": 896 -} - Change:: reports syntax errors after change to ts file @@ -319,8 +252,6 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: builds after fixing config file errors diff --git a/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js index d512a1408b2a1..6c04121b77f06 100644 --- a/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck-errors/semantic-errors-with-incremental.js @@ -164,8 +164,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix `a` error @@ -178,12 +176,12 @@ const a = "hello" Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:21 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig.json -[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:23 AM] Building project '/src/tsconfig.json'... +[12:00:20 AM] Building project '/src/tsconfig.json'... src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. @@ -275,12 +273,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:27 AM] Projects in this build: +[12:00:24 AM] Projects in this build: * src/tsconfig.json -[12:00:28 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:25 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:29 AM] Building project '/src/tsconfig.json'... +[12:00:26 AM] Building project '/src/tsconfig.json'... src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. @@ -310,8 +308,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Disable noCheck @@ -328,12 +324,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:34 AM] Projects in this build: +[12:00:28 AM] Projects in this build: * src/tsconfig.json -[12:00:35 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:29 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:36 AM] Building project '/src/tsconfig.json'... +[12:00:30 AM] Building project '/src/tsconfig.json'... src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. @@ -448,12 +444,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:40 AM] Projects in this build: +[12:00:34 AM] Projects in this build: * src/tsconfig.json -[12:00:41 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:35 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:42 AM] Building project '/src/tsconfig.json'... +[12:00:36 AM] Building project '/src/tsconfig.json'... src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. diff --git a/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js index c87c61dd72e06..3ac1727d00498 100644 --- a/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck-errors/syntax-errors-with-incremental.js @@ -174,8 +174,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix `a` error @@ -188,12 +186,12 @@ const a = "hello" Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:21 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig.json -[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:23 AM] Building project '/src/tsconfig.json'... +[12:00:20 AM] Building project '/src/tsconfig.json'... src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. @@ -285,12 +283,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:27 AM] Projects in this build: +[12:00:24 AM] Projects in this build: * src/tsconfig.json -[12:00:28 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:25 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:29 AM] Building project '/src/tsconfig.json'... +[12:00:26 AM] Building project '/src/tsconfig.json'... src/tsconfig.json:3:16 - error TS5023: Unknown compiler option 'noCheck'. @@ -320,8 +318,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Disable noCheck @@ -338,12 +334,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:34 AM] Projects in this build: +[12:00:28 AM] Projects in this build: * src/tsconfig.json -[12:00:35 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:29 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:36 AM] Building project '/src/tsconfig.json'... +[12:00:30 AM] Building project '/src/tsconfig.json'... src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. @@ -458,12 +454,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:40 AM] Projects in this build: +[12:00:34 AM] Projects in this build: * src/tsconfig.json -[12:00:41 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:35 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:42 AM] Building project '/src/tsconfig.json'... +[12:00:36 AM] Building project '/src/tsconfig.json'... src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. diff --git a/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..468987b4a1433 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental-discrepancies.js @@ -0,0 +1,164 @@ +3:: Disable noCheck +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion" +} +4:: no-change-run +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js index bb53060060367..ab5535f4933bc 100644 --- a/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js @@ -313,73 +313,6 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] -{"program":{"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,"impliedFormat":1},{"version":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true,"impliedFormat":1}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./a.ts","start":6,"length":3,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]]},"version":"FakeTSVersion"} - -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "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, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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, - "impliedFormat": "commonjs" - }, - "./a.ts": { - "original": { - "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", - "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", - "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": {}, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - [ - "./a.ts", - [ - { - "file": "./a.ts", - "start": 6, - "length": 3, - "code": 2322, - "category": 1, - "messageText": "Type 'string' is not assignable to type 'number'." - } - ] - ] - ] - }, - "version": "FakeTSVersion", - "size": 1055 -} - Change:: no-change-run @@ -388,11 +321,40 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:34 AM] Projects in this build: +[12:00:31 AM] Projects in this build: * src/tsconfig.json -[12:00:35 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[12:00:32 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/tsconfig.json' -exitCode:: ExitStatus.Success +[12:00:33 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..468987b4a1433 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,164 @@ +3:: Disable noCheck +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion" +} +4:: no-change-run +*** Needs explanation +TsBuild info text without affectedFilesPendingEmit:: /src/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./a.ts", + [ + { + "file": "./a.ts", + "start": 6, + "length": 3, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + }, + "./a.ts": { + "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", + "affectsGlobalScope": true, + "impliedFormat": "commonjs" + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "emitDeclarationOnly": true, + "noCheck": true + }, + "referencedMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js index 6f30a6128e978..0a2583af8beec 100644 --- a/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js @@ -167,8 +167,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix `a` error @@ -181,12 +179,12 @@ const a = "hello" Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:21 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig.json -[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:23 AM] Building project '/src/tsconfig.json'... +[12:00:20 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ @@ -282,10 +280,10 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:28 AM] Projects in this build: +[12:00:25 AM] Projects in this build: * src/tsconfig.json -[12:00:29 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[12:00:26 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' exitCode:: ExitStatus.Success @@ -306,12 +304,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:31 AM] Projects in this build: +[12:00:28 AM] Projects in this build: * src/tsconfig.json -[12:00:32 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/tsconfig.json' +[12:00:29 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/tsconfig.json' -[12:00:33 AM] Building project '/src/tsconfig.json'... +[12:00:30 AM] Building project '/src/tsconfig.json'... src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. @@ -343,73 +341,6 @@ Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] -{"program":{"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,"impliedFormat":1},{"version":"6909448549-const err: number = \"error\";\nconst a = \"hello\"","signature":"-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n","affectsGlobalScope":true,"impliedFormat":1}],"root":[2],"options":{"declaration":true,"emitDeclarationOnly":true},"referencedMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./a.ts","start":6,"length":3,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]]},"version":"FakeTSVersion"} - -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "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, - "impliedFormat": 1 - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface 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, - "impliedFormat": "commonjs" - }, - "./a.ts": { - "original": { - "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", - "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "6909448549-const err: number = \"error\";\nconst a = \"hello\"", - "signature": "-22441876417-declare const err: number;\ndeclare const a = \"hello\";\n", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./a.ts" - ] - ], - "options": { - "declaration": true, - "emitDeclarationOnly": true - }, - "referencedMap": {}, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - [ - "./a.ts", - [ - { - "file": "./a.ts", - "start": 6, - "length": 3, - "code": 2322, - "category": 1, - "messageText": "Type 'string' is not assignable to type 'number'." - } - ] - ] - ] - }, - "version": "FakeTSVersion", - "size": 1055 -} - Change:: no-change-run @@ -418,11 +349,40 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:37 AM] Projects in this build: +[12:00:31 AM] Projects in this build: * src/tsconfig.json -[12:00:38 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[12:00:32 AM] Project 'src/tsconfig.json' is out of date because output 'src/tsconfig.tsbuildinfo' is older than input 'src/tsconfig.json' -exitCode:: ExitStatus.Success +[12:00:33 AM] Building project '/src/tsconfig.json'... + +src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const err: number = "error"; +   ~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/src/a.ts" +] +Program options: { + "emitDeclarationOnly": true, + "declaration": true, + "incremental": true, + "configFilePath": "/src/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/src/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/a.ts + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js index 96f52228bc57a..41647268cfb01 100644 --- a/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js @@ -155,8 +155,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error @@ -168,12 +166,12 @@ const a = "hello" Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:21 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig.json -[12:00:22 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted -[12:00:23 AM] Building project '/src/tsconfig.json'... +[12:00:20 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ @@ -263,10 +261,10 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v --incremental -[12:00:27 AM] Projects in this build: +[12:00:24 AM] Projects in this build: * src/tsconfig.json -[12:00:28 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[12:00:25 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js index af22d04a145ac..948263c96839c 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js @@ -207,8 +207,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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 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 d1c550fe12680..5f3d305c97351 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 @@ -144,8 +144,6 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Normal build without change, that does not block emit on error to show files that get emitted diff --git a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js index 3a159ee647aa6..a395679675802 100644 --- a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -693,8 +693,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: delete the ndoe10Result in package/types @@ -937,8 +935,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: add the alternateResult in @types @@ -1171,8 +1167,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: add the ndoe10Result in package/types @@ -1392,8 +1386,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: update package.json from @types so error is fixed @@ -2781,8 +2773,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: delete the ndoe10Result in package/types @@ -3025,8 +3015,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: add the alternateResult in @types @@ -3259,8 +3247,6 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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:: add the ndoe10Result in package/types @@ -3480,5 +3466,3 @@ No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/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