From 5a37263f25deb8f8d4b66035516fe2dc422ba1f8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 26 Jul 2024 10:29:35 -0700 Subject: [PATCH 1/4] Tests --- .../helpers/sampleProjectReferences.ts | 22 +- src/testRunner/unittests/tsbuild/sample.ts | 17 + .../unittests/tsbuildWatch/programUpdates.ts | 19 + ...Error-when-test-does-not-reference-core.js | 606 ++++++++++ ...ts-have-errors-with-noDownstreamOnError.js | 609 ++++++++++ ...streamOnError-is-passed-on-command-line.js | 1035 +++++++++++++++++ ...Error-when-test-does-not-reference-core.js | 716 ++++++++++++ ...ts-have-errors-with-noDownstreamOnError.js | 724 ++++++++++++ 8 files changed, 3739 insertions(+), 9 deletions(-) create mode 100644 tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js create mode 100644 tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js create mode 100644 tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js create mode 100644 tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js create mode 100644 tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js diff --git a/src/testRunner/unittests/helpers/sampleProjectReferences.ts b/src/testRunner/unittests/helpers/sampleProjectReferences.ts index 7c5634c0120e3..f6a6352398a36 100644 --- a/src/testRunner/unittests/helpers/sampleProjectReferences.ts +++ b/src/testRunner/unittests/helpers/sampleProjectReferences.ts @@ -26,7 +26,7 @@ export function getFsContentsForSampleProjectReferencesLogicConfig(withNodeNext? ], }); } -export function getFsContentsForSampleProjectReferences(withNodeNext?: boolean): FsContents { +export function getFsContentsForSampleProjectReferences(withNodeNext?: boolean, skipReferenceCoreFromTest?: boolean): FsContents { return { [libFile.path]: libFile.content, "/user/username/projects/sample1/core/tsconfig.json": jsonToReadableText({ @@ -55,10 +55,14 @@ export function getFsContentsForSampleProjectReferences(withNodeNext?: boolean): export const m = mod; `, "/user/username/projects/sample1/tests/tsconfig.json": jsonToReadableText({ - references: [ - { path: "../core" }, - { path: "../logic" }, - ], + references: !skipReferenceCoreFromTest ? + [ + { path: "../core" }, + { path: "../logic" }, + ] : + [ + { path: "../logic" }, + ], files: ["index.ts"], compilerOptions: { ...getProjectConfigWithNodeNext(withNodeNext), @@ -81,9 +85,9 @@ export function getFsContentsForSampleProjectReferences(withNodeNext?: boolean): }; } -export function getFsForSampleProjectReferences() { +export function getFsForSampleProjectReferences(withNodeNext?: boolean, skipReferenceCoreFromTest?: boolean) { return loadProjectFromFiles( - getFsContentsForSampleProjectReferences(), + getFsContentsForSampleProjectReferences(withNodeNext, skipReferenceCoreFromTest), { cwd: "/user/username/projects/sample1", executingFilePath: libFile.path, @@ -91,9 +95,9 @@ export function getFsForSampleProjectReferences() { ); } -export function getSysForSampleProjectReferences(withNodeNext?: boolean) { +export function getSysForSampleProjectReferences(withNodeNext?: boolean, skipReferenceCoreFromTest?: boolean) { return createWatchedSystem( - getFsContentsForSampleProjectReferences(withNodeNext), + getFsContentsForSampleProjectReferences(withNodeNext, skipReferenceCoreFromTest), { currentDirectory: "/user/username/projects/sample1", }, diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index 7b5498ecec553..e9c10c70fb1b7 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -359,6 +359,23 @@ describe("unittests:: tsbuild:: on 'sample1' project", () => { modifyFs: fs => replaceText(fs, "logic/index.ts", "c.multiply(10, 15)", `c.muitply()`), edits: noChangeOnlyRuns, }); + + [false, true].forEach(skipReferenceCoreFromTest => + verifyTsc({ + scenario: "sample1", + subScenario: `skips builds downstream projects if upstream projects have errors with noDownstreamOnError${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, + fs: () => getFsForSampleProjectReferences(/*withNodeNext*/ undefined, skipReferenceCoreFromTest), + commandLineArgs: ["--b", "tests", "--verbose"], + modifyFs: fs => appendText(fs, "core/index.ts", `multiply();`), + edits: [ + noChangeRun, + { + caption: "fix error", + edit: fs => replaceText(fs, "core/index.ts", "multiply();", ""), + }, + ], + }) + ); }); describe("project invalidation", () => { diff --git a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts index d5dfc7d2742db..a6aabf17e80a2 100644 --- a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts +++ b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts @@ -316,6 +316,25 @@ createSomeObject().message;`, } verifyIncrementalErrors("when preserveWatchOutput is not used", ts.emptyArray); verifyIncrementalErrors("when preserveWatchOutput is passed on command line", ["--preserveWatchOutput"]); + verifyIncrementalErrors("when noDownstreamOnError is passed on command line", []); + + [false, true].forEach(skipReferenceCoreFromTest => + verifyTscWatch({ + scenario: "programUpdates", + subScenario: `skips builds downstream projects if upstream projects have errors with noDownstreamOnError${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, + sys: () => { + const sys = getSysForSampleProjectReferences(/*withNodeNext*/ undefined, skipReferenceCoreFromTest); + sys.appendFile("core/index.ts", `multiply();`); + return sys; + }, + commandLineArgs: ["--b", "-w", "tests", "--verbose"], + edits: [{ + caption: "fix error", + edit: sys => sys.replaceFileText("core/index.ts", "multiply();", ""), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }], + }) + ); describe("when declaration emit errors are present", () => { const solution = "solution"; diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js new file mode 100644 index 0000000000000..e9a2a7a3e9c93 --- /dev/null +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js @@ -0,0 +1,606 @@ +currentDirectory:: /user/username/projects/sample1 useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/sample1/core/anotherModule.ts] +export const World = "hello"; + +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +multiply(); + +//// [/user/username/projects/sample1/core/some_decl.d.ts] +declare const dts: any; + +//// [/user/username/projects/sample1/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { + "path": "../core" + } + ] +} + +//// [/user/username/projects/sample1/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.json] +{ + "references": [ + { + "path": "../logic" + } + ], + "files": [ + "index.ts" + ], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + + +Output:: +/a/lib/tsc --b tests --verbose +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map + +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} + +//// [/user/username/projects/sample1/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/user/username/projects/sample1/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map + +//// [/user/username/projects/sample1/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +multiply(); + + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"start":178,"length":8,"messageText":"Expected 2 arguments, but got 0.","category":1,"code":2554,"relatedInformation":[{"start":138,"length":9,"messageText":"An argument for 'a' was not provided.","category":3,"code":6210}]}]]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "start": 178, + "length": 8, + "messageText": "Expected 2 arguments, but got 0.", + "category": 1, + "code": 2554, + "relatedInformation": [ + { + "start": 138, + "length": 9, + "messageText": "An argument for 'a' was not provided.", + "category": 3, + "code": 6210 + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1654 +} + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1427 +} + +//// [/user/username/projects/sample1/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/tests/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileIdsList":[[3],[2,3,4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[5],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "original": { + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 5, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1565 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b tests --verbose +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time + + +Change:: fix error +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + + +Output:: +/a/lib/tsc --b tests --verbose +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1380 +} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js new file mode 100644 index 0000000000000..334896fe3f9b3 --- /dev/null +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js @@ -0,0 +1,609 @@ +currentDirectory:: /user/username/projects/sample1 useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/sample1/core/anotherModule.ts] +export const World = "hello"; + +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +multiply(); + +//// [/user/username/projects/sample1/core/some_decl.d.ts] +declare const dts: any; + +//// [/user/username/projects/sample1/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { + "path": "../core" + } + ] +} + +//// [/user/username/projects/sample1/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.json] +{ + "references": [ + { + "path": "../core" + }, + { + "path": "../logic" + } + ], + "files": [ + "index.ts" + ], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + + +Output:: +/a/lib/tsc --b tests --verbose +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map + +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} + +//// [/user/username/projects/sample1/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/user/username/projects/sample1/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map + +//// [/user/username/projects/sample1/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +multiply(); + + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"start":178,"length":8,"messageText":"Expected 2 arguments, but got 0.","category":1,"code":2554,"relatedInformation":[{"start":138,"length":9,"messageText":"An argument for 'a' was not provided.","category":3,"code":6210}]}]]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "start": 178, + "length": 8, + "messageText": "Expected 2 arguments, but got 0.", + "category": 1, + "code": 2554, + "relatedInformation": [ + { + "start": 138, + "length": 9, + "messageText": "An argument for 'a' was not provided.", + "category": 3, + "code": 6210 + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1654 +} + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1427 +} + +//// [/user/username/projects/sample1/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/tests/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileIdsList":[[3],[2,3,4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[5],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "original": { + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 5, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1565 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b tests --verbose +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time + + +Change:: fix error +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + + +Output:: +/a/lib/tsc --b tests --verbose +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1380 +} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js new file mode 100644 index 0000000000000..cb252142da09b --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js @@ -0,0 +1,1035 @@ +currentDirectory:: /user/username/projects/sample1 useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/user/username/projects/sample1/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/user/username/projects/sample1/core/some_decl.d.ts] +declare const dts: any; + +//// [/user/username/projects/sample1/core/anotherModule.ts] +export const World = "hello"; + +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { + "path": "../core" + } + ] +} + +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.json] +{ + "references": [ + { + "path": "../core" + }, + { + "path": "../logic" + } + ], + "files": [ + "index.ts" + ], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + + +/a/lib/tsc.js -b -w tests +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/sample1/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} + +//// [/user/username/projects/sample1/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1300 +} + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1347 +} + +//// [/user/username/projects/sample1/tests/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/user/username/projects/sample1/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileIdsList":[[3],[2,3,4]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[5],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "original": { + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 5, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1485 +} + + +FsWatches:: +/user/username/projects/sample1/core/anotherModule.ts: *new* + {} +/user/username/projects/sample1/core/index.ts: *new* + {} +/user/username/projects/sample1/core/some_decl.d.ts: *new* + {} +/user/username/projects/sample1/core/tsconfig.json: *new* + {} +/user/username/projects/sample1/logic/index.ts: *new* + {} +/user/username/projects/sample1/logic/tsconfig.json: *new* + {} +/user/username/projects/sample1/tests/index.ts: *new* + {} +/user/username/projects/sample1/tests/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/sample1/core: *new* + {} +/user/username/projects/sample1/logic: *new* + {} + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/some_decl.d.ts (used version) + +Program root files: [ + "/user/username/projects/sample1/logic/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/index.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.d.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) + +Program root files: [ + "/user/username/projects/sample1/tests/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/tests/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/index.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.d.ts (used version) +/user/username/projects/sample1/logic/index.d.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) + +exitCode:: ExitStatus.undefined + +Change:: change logic + +Input:: +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + +let y: string = 10; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +logic/index.ts:8:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +8 let y: string = 10; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AAErB,IAAI,CAAC,GAAW,EAAE,CAAC"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +var y = 10; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-5319769398-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n\nlet y: string = 10;","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"start":178,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-5319769398-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n\nlet y: string = 10;", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-5319769398-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n\nlet y: string = 10;", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "start": 178, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1521 +} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time + + +Program root files: [ + "/user/username/projects/sample1/logic/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/logic/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/sample1/logic/index.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: change core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +let x: string = 10; + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 1 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +core/index.ts:5:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +5 let x: string = 10; +   ~ + + + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +var x = 10; + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15390729096-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n\nlet x: string = 10;","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"start":183,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15390729096-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n\nlet x: string = 10;", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15390729096-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n\nlet x: string = 10;", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "start": 183, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1474 +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +logic/index.ts:8:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +8 let y: string = 10; +   ~ + +[HH:MM:SS AM] Found 2 errors. Watching for file changes. + + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time + + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/sample1/core/index.ts (computed .d.ts) + +Program root files: [ + "/user/username/projects/sample1/logic/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: fix error in logic + +Input:: +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +core/index.ts:5:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +5 let x: string = 10; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1347 +} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time + + +Program root files: [ + "/user/username/projects/sample1/logic/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/logic/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/sample1/logic/index.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js new file mode 100644 index 0000000000000..8677887f2e072 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js @@ -0,0 +1,716 @@ +currentDirectory:: /user/username/projects/sample1 useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/user/username/projects/sample1/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +multiply(); + +//// [/user/username/projects/sample1/core/some_decl.d.ts] +declare const dts: any; + +//// [/user/username/projects/sample1/core/anotherModule.ts] +export const World = "hello"; + +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { + "path": "../core" + } + ] +} + +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.json] +{ + "references": [ + { + "path": "../logic" + } + ], + "files": [ + "index.ts" + ], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + + +/a/lib/tsc.js --b -w tests --verbose +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/sample1/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +multiply(); + + +//// [/user/username/projects/sample1/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} + +//// [/user/username/projects/sample1/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"start":178,"length":8,"messageText":"Expected 2 arguments, but got 0.","category":1,"code":2554,"relatedInformation":[{"start":138,"length":9,"messageText":"An argument for 'a' was not provided.","category":3,"code":6210}]}]]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "start": 178, + "length": 8, + "messageText": "Expected 2 arguments, but got 0.", + "category": 1, + "code": 2554, + "relatedInformation": [ + { + "start": 138, + "length": 9, + "messageText": "An argument for 'a' was not provided.", + "category": 3, + "code": 6210 + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1574 +} + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1347 +} + +//// [/user/username/projects/sample1/tests/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/user/username/projects/sample1/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileIdsList":[[3],[2,3,4]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[5],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "original": { + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 5, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1485 +} + + +FsWatches:: +/user/username/projects/sample1/core/anotherModule.ts: *new* + {} +/user/username/projects/sample1/core/index.ts: *new* + {} +/user/username/projects/sample1/core/some_decl.d.ts: *new* + {} +/user/username/projects/sample1/core/tsconfig.json: *new* + {} +/user/username/projects/sample1/logic/index.ts: *new* + {} +/user/username/projects/sample1/logic/tsconfig.json: *new* + {} +/user/username/projects/sample1/tests/index.ts: *new* + {} +/user/username/projects/sample1/tests/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/sample1/core: *new* + {} +/user/username/projects/sample1/logic: *new* + {} + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/some_decl.d.ts (used version) + +Program root files: [ + "/user/username/projects/sample1/logic/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/index.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.d.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) + +Program root files: [ + "/user/username/projects/sample1/tests/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/tests/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/index.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.d.ts (used version) +/user/username/projects/sample1/logic/index.d.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) + +exitCode:: ExitStatus.undefined + +Change:: fix error + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1300 +} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time + + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/sample1/core/index.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js new file mode 100644 index 0000000000000..c8274437a50f3 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js @@ -0,0 +1,724 @@ +currentDirectory:: /user/username/projects/sample1 useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/user/username/projects/sample1/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +multiply(); + +//// [/user/username/projects/sample1/core/some_decl.d.ts] +declare const dts: any; + +//// [/user/username/projects/sample1/core/anotherModule.ts] +export const World = "hello"; + +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { + "path": "../core" + } + ] +} + +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.json] +{ + "references": [ + { + "path": "../core" + }, + { + "path": "../logic" + } + ], + "files": [ + "index.ts" + ], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + + +/a/lib/tsc.js --b -w tests --verbose +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/sample1/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +multiply(); + + +//// [/user/username/projects/sample1/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} + +//// [/user/username/projects/sample1/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"start":178,"length":8,"messageText":"Expected 2 arguments, but got 0.","category":1,"code":2554,"relatedInformation":[{"start":138,"length":9,"messageText":"An argument for 'a' was not provided.","category":3,"code":6210}]}]]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-12887218413-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nmultiply();", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "start": 178, + "length": 8, + "messageText": "Expected 2 arguments, but got 0.", + "category": 1, + "code": 2554, + "relatedInformation": [ + { + "start": 138, + "length": 9, + "messageText": "An argument for 'a' was not provided.", + "category": 3, + "code": 6210 + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1574 +} + +//// [/user/username/projects/sample1/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 4, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1347 +} + +//// [/user/username/projects/sample1/tests/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/user/username/projects/sample1/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileIdsList":[[3],[2,3,4]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[5],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileIdsList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "../core/anothermodule.d.ts": { + "version": "-9234818176-export declare const World = \"hello\";\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "original": { + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "version": "-11950676699-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "root": [ + [ + 5, + "./index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1485 +} + + +FsWatches:: +/user/username/projects/sample1/core/anotherModule.ts: *new* + {} +/user/username/projects/sample1/core/index.ts: *new* + {} +/user/username/projects/sample1/core/some_decl.d.ts: *new* + {} +/user/username/projects/sample1/core/tsconfig.json: *new* + {} +/user/username/projects/sample1/logic/index.ts: *new* + {} +/user/username/projects/sample1/logic/tsconfig.json: *new* + {} +/user/username/projects/sample1/tests/index.ts: *new* + {} +/user/username/projects/sample1/tests/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/sample1/core: *new* + {} +/user/username/projects/sample1/logic: *new* + {} + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/some_decl.d.ts (used version) + +Program root files: [ + "/user/username/projects/sample1/logic/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/index.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.d.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) + +Program root files: [ + "/user/username/projects/sample1/tests/index.ts" +] +Program options: { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/tests/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/index.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.d.ts (used version) +/user/username/projects/sample1/logic/index.d.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) + +exitCode:: ExitStatus.undefined + +Change:: fix error + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1300 +} + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time + + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/sample1/core/index.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined From a1d68ebb094dde48e15f56a9d23017f8780c8cd3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 26 Jul 2024 10:29:53 -0700 Subject: [PATCH 2/4] Add option --- src/compiler/commandLineParser.ts | 7 +++++++ src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/tsbuildPublic.ts | 1 + src/testRunner/unittests/tsbuild/sample.ts | 2 +- src/testRunner/unittests/tsbuildWatch/programUpdates.ts | 4 ++-- tests/baselines/reference/api/typescript.d.ts | 1 + ...oDownstreamOnError-when-test-does-not-reference-core.js | 6 +++--- ...stream-projects-have-errors-with-noDownstreamOnError.js | 6 +++--- .../when-noDownstreamOnError-is-passed-on-command-line.js | 2 +- ...oDownstreamOnError-when-test-does-not-reference-core.js | 2 +- ...stream-projects-have-errors-with-noDownstreamOnError.js | 2 +- 11 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1376455494303..62d25daca8490 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1694,6 +1694,13 @@ export const optionsForBuild: CommandLineOption[] = [ type: "boolean", defaultValueDescription: false, }, + { + name: "noDownstreamOnError", + category: Diagnostics.Command_line_Options, + description: Diagnostics.Skip_building_downstream_projects_on_error_in_upstream_project, + type: "boolean", + defaultValueDescription: false, + }, ]; /** @internal */ diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 850d5ca1022af..8ef8008776db1 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -6095,6 +6095,10 @@ "category": "Message", "code": 6639 }, + "Skip building downstream projects on error in upstream project.": { + "category": "Message", + "code": 6640 + }, "Specify a list of glob patterns that match files to be included in compilation.": { "category": "Message", "code": 6641 diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 7b9b398cf2d0a..cd53ffb24ca66 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -135,6 +135,7 @@ export interface BuildOptions { dry?: boolean; force?: boolean; verbose?: boolean; + noDownstreamOnError?: boolean; /** @internal */ clean?: boolean; /** @internal */ watch?: boolean; diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index e9c10c70fb1b7..b7dd61154deb3 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -365,7 +365,7 @@ describe("unittests:: tsbuild:: on 'sample1' project", () => { scenario: "sample1", subScenario: `skips builds downstream projects if upstream projects have errors with noDownstreamOnError${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, fs: () => getFsForSampleProjectReferences(/*withNodeNext*/ undefined, skipReferenceCoreFromTest), - commandLineArgs: ["--b", "tests", "--verbose"], + commandLineArgs: ["--b", "tests", "--verbose", "--noDownstreamOnError"], modifyFs: fs => appendText(fs, "core/index.ts", `multiply();`), edits: [ noChangeRun, diff --git a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts index a6aabf17e80a2..b8a6e0bbd5be4 100644 --- a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts +++ b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts @@ -316,7 +316,7 @@ createSomeObject().message;`, } verifyIncrementalErrors("when preserveWatchOutput is not used", ts.emptyArray); verifyIncrementalErrors("when preserveWatchOutput is passed on command line", ["--preserveWatchOutput"]); - verifyIncrementalErrors("when noDownstreamOnError is passed on command line", []); + verifyIncrementalErrors("when noDownstreamOnError is passed on command line", ["--noDownstreamOnError"]); [false, true].forEach(skipReferenceCoreFromTest => verifyTscWatch({ @@ -327,7 +327,7 @@ createSomeObject().message;`, sys.appendFile("core/index.ts", `multiply();`); return sys; }, - commandLineArgs: ["--b", "-w", "tests", "--verbose"], + commandLineArgs: ["--b", "-w", "tests", "--verbose", "--noDownstreamOnError"], edits: [{ caption: "fix error", edit: sys => sys.replaceFileText("core/index.ts", "multiply();", ""), diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8275e4222820c..a05e4a9c22914 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -9799,6 +9799,7 @@ declare namespace ts { dry?: boolean; force?: boolean; verbose?: boolean; + noDownstreamOnError?: boolean; incremental?: boolean; assumeChangesOnlyAffectDirectDependencies?: boolean; declaration?: boolean; diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js index e9a2a7a3e9c93..0d5e9b8f9e8c6 100644 --- a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js @@ -94,7 +94,7 @@ export const m = mod; Output:: -/a/lib/tsc --b tests --verbose +/a/lib/tsc --b tests --verbose --noDownstreamOnError [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -449,7 +449,7 @@ Input:: Output:: -/a/lib/tsc --b tests --verbose +/a/lib/tsc --b tests --verbose --noDownstreamOnError [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -498,7 +498,7 @@ export function multiply(a: number, b: number) { return a * b; } Output:: -/a/lib/tsc --b tests --verbose +/a/lib/tsc --b tests --verbose --noDownstreamOnError [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js index 334896fe3f9b3..1491584d4dbf4 100644 --- a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js @@ -97,7 +97,7 @@ export const m = mod; Output:: -/a/lib/tsc --b tests --verbose +/a/lib/tsc --b tests --verbose --noDownstreamOnError [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -452,7 +452,7 @@ Input:: Output:: -/a/lib/tsc --b tests --verbose +/a/lib/tsc --b tests --verbose --noDownstreamOnError [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -501,7 +501,7 @@ export function multiply(a: number, b: number) { return a * b; } Output:: -/a/lib/tsc --b tests --verbose +/a/lib/tsc --b tests --verbose --noDownstreamOnError [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js index cb252142da09b..1a2dbd5919679 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js @@ -93,7 +93,7 @@ export const m = mod; -/a/lib/tsc.js -b -w tests +/a/lib/tsc.js -b -w tests --noDownstreamOnError Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js index 8677887f2e072..2f2a9559266c7 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js @@ -90,7 +90,7 @@ export const m = mod; -/a/lib/tsc.js --b -w tests --verbose +/a/lib/tsc.js --b -w tests --verbose --noDownstreamOnError Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js index c8274437a50f3..cfc1200265a1d 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js @@ -93,7 +93,7 @@ export const m = mod; -/a/lib/tsc.js --b -w tests --verbose +/a/lib/tsc.js --b -w tests --verbose --noDownstreamOnError Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... From 01938e8499ec7e3068e938db48f6ba98172b2717 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 26 Jul 2024 11:12:05 -0700 Subject: [PATCH 3/4] Actually add handling of the option --- src/compiler/diagnosticMessages.json | 16 + src/compiler/tsbuild.ts | 11 + src/compiler/tsbuildPublic.ts | 48 +++ .../unittests/tsbuildWatch/programUpdates.ts | 5 +- ...Error-when-test-does-not-reference-core.js | 330 ++++++++------- ...ts-have-errors-with-noDownstreamOnError.js | 330 ++++++++------- ...streamOnError-is-passed-on-command-line.js | 167 +------- ...Error-when-test-does-not-reference-core.js | 381 ++++++++--------- ...ts-have-errors-with-noDownstreamOnError.js | 386 +++++++++--------- 9 files changed, 812 insertions(+), 862 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8ef8008776db1..37298e71295de 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -5716,6 +5716,14 @@ "category": "Message", "code": 6361 }, + "Skipping build of project '{0}' because its dependency '{1}' has errors": { + "category": "Message", + "code": 6362 + }, + "Project '{0}' can't be built because its dependency '{1}' has errors": { + "category": "Message", + "code": 6363 + }, "Build one or more projects and their dependencies, if out of date": { "category": "Message", "code": 6364 @@ -5760,6 +5768,14 @@ "category": "Message", "code": 6381 }, + "Skipping build of project '{0}' because its dependency '{1}' was not built": { + "category": "Message", + "code": 6382 + }, + "Project '{0}' can't be built because its dependency '{1}' was not built": { + "category": "Message", + "code": 6383 + }, "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.": { "category": "Message", "code": 6384 diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index abb6c83e30978..74ec7be532261 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -25,6 +25,7 @@ export enum UpToDateStatusType { OutOfDateOptions, OutOfDateRoots, UpstreamOutOfDate, + UpstreamBlocked, ComputingUpstream, TsVersionOutputOfDate, UpToDateWithInputFileText, @@ -47,6 +48,7 @@ export type UpToDateStatus = | Status.OutOfDateBuildInfo | Status.OutOfDateRoots | Status.UpstreamOutOfDate + | Status.UpstreamBlocked | Status.ComputingUpstream | Status.TsVersionOutOfDate | Status.ContainerOnly @@ -135,6 +137,15 @@ export namespace Status { upstreamProjectName: string; } + /** + * This project depends an upstream project with build errors + */ + export interface UpstreamBlocked { + type: UpToDateStatusType.UpstreamBlocked; + upstreamProjectName: string; + upstreamProjectBlocked: boolean; + } + /** * Computing status of upstream projects referenced */ diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index cd53ffb24ca66..0fb18cca115a4 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1255,6 +1255,23 @@ function getNextInvalidatedProjectCreateInfo( } } + if (status.type === UpToDateStatusType.UpstreamBlocked) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); + projectPendingBuild.delete(projectPath); + if (options.verbose) { + reportStatus( + state, + status.upstreamProjectBlocked ? + Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : + Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, + project, + status.upstreamProjectName, + ); + } + continue; + } + if (status.type === UpToDateStatusType.ContainerOnly) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); @@ -1456,6 +1473,20 @@ function getUpToDateStatusWorker(state: SolutionBuilde continue; } + // An upstream project is blocked + if ( + state.options.noDownstreamOnError && ( + refStatus.type === UpToDateStatusType.Unbuildable || + refStatus.type === UpToDateStatusType.UpstreamBlocked + ) + ) { + return { + type: UpToDateStatusType.UpstreamBlocked, + upstreamProjectName: ref.path, + upstreamProjectBlocked: refStatus.type === UpToDateStatusType.UpstreamBlocked, + }; + } + if (!force) (referenceStatuses ||= []).push({ ref, refStatus, resolvedRefPath, resolvedConfig }); } } @@ -1849,6 +1880,8 @@ function queueReferencingProjects( buildOrder: readonly ResolvedConfigFileName[], buildResult: BuildResultFlags, ) { + // Queue only if there are no errors + if (state.options.noDownstreamOnError && (buildResult & BuildResultFlags.AnyErrors)) return; // Only composite projects can be referenced by other projects if (!config.options.composite) return; // Always use build order to queue projects @@ -1884,6 +1917,12 @@ function queueReferencingProjects( }); } break; + + case UpToDateStatusType.UpstreamBlocked: + if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { + clearProjectStatus(state, nextProjectPath); + } + break; } } addProjToQueue(state, nextProjectPath, ProgramUpdateLevel.Update); @@ -2387,6 +2426,15 @@ function reportUpToDateStatus(state: SolutionBuilderSt relName(state, configFileName), relName(state, status.upstreamProjectName), ); + case UpToDateStatusType.UpstreamBlocked: + return reportStatus( + state, + status.upstreamProjectBlocked ? + Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : + Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, + relName(state, configFileName), + relName(state, status.upstreamProjectName), + ); case UpToDateStatusType.Unbuildable: return reportStatus( state, diff --git a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts index b8a6e0bbd5be4..758a1ed0041d2 100644 --- a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts +++ b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts @@ -331,7 +331,10 @@ createSomeObject().message;`, edits: [{ caption: "fix error", edit: sys => sys.replaceFileText("core/index.ts", "multiply();", ""), - timeouts: sys => sys.runQueuedTimeoutCallbacks(), + timeouts: sys => { + sys.runQueuedTimeoutCallbacks(); + sys.runQueuedTimeoutCallbacks(); + }, }], }) ); diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js index 0d5e9b8f9e8c6..4dd5fe0b4781a 100644 --- a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js @@ -114,18 +114,18 @@ Output::    ~~~~~~~~~ An argument for 'a' was not provided. -[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors -[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/logic/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors -[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'logic' was not built -[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/tests/tsconfig.json' because its dependency '/user/username/projects/sample1/logic' was not built Found 1 error. -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped //// [/user/username/projects/sample1/core/anotherModule.d.ts] @@ -257,6 +257,164 @@ multiply(); "size": 1654 } + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b tests --verbose --noDownstreamOnError +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/logic/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors + +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'logic' was not built + +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/tests/tsconfig.json' because its dependency '/user/username/projects/sample1/logic' was not built + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: fix error +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + + +Output:: +/a/lib/tsc --b tests --verbose --noDownstreamOnError +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1380 +} + //// [/user/username/projects/sample1/logic/index.d.ts] export declare function getSecondsInDay(): number; import * as mod from '../core/anotherModule'; @@ -442,165 +600,3 @@ exports.m = mod; "size": 1565 } - - -Change:: no-change-run -Input:: - - -Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError -[HH:MM:SS AM] Projects in this build: - * core/tsconfig.json - * logic/tsconfig.json - * tests/tsconfig.json - -[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. - -[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... - -core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. - -4 multiply(); -  ~~~~~~~~ - - core/index.ts:3:26 - 3 export function multiply(a: number, b: number) { return a * b; } -    ~~~~~~~~~ - An argument for 'a' was not provided. - -[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... - -[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time - - -Change:: fix error -Input:: -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - - - -Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError -[HH:MM:SS AM] Projects in this build: - * core/tsconfig.json - * logic/tsconfig.json - * tests/tsconfig.json - -[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. - -[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... - -[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... - -[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents -//// [/user/username/projects/sample1/core/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.someString = void 0; -exports.leftPad = leftPad; -exports.multiply = multiply; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -function multiply(a, b) { return a * b; } - - -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} - -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../../a/lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ], - "fileInfos": { - "../../../../../a/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "original": { - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "./index.ts": { - "original": { - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "./some_decl.d.ts": { - "original": { - "version": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - }, - "version": "-7959511260-declare const dts: any;", - "signature": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - } - }, - "root": [ - [ - [ - 2, - 4 - ], - [ - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - ] - ], - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true - }, - "latestChangedDtsFile": "./index.d.ts", - "version": "FakeTSVersion", - "size": 1380 -} - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js index 1491584d4dbf4..89b81a5388f70 100644 --- a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js @@ -117,18 +117,18 @@ Output::    ~~~~~~~~~ An argument for 'a' was not provided. -[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors -[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/logic/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors -[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'core' has errors -[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/tests/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors Found 1 error. -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped //// [/user/username/projects/sample1/core/anotherModule.d.ts] @@ -260,6 +260,164 @@ multiply(); "size": 1654 } + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b tests --verbose --noDownstreamOnError +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. + +4 multiply(); +  ~~~~~~~~ + + core/index.ts:3:26 + 3 export function multiply(a: number, b: number) { return a * b; } +    ~~~~~~~~~ + An argument for 'a' was not provided. + +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/logic/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors + +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/tests/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: fix error +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + + +Output:: +/a/lib/tsc --b tests --verbose --noDownstreamOnError +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1380 +} + //// [/user/username/projects/sample1/logic/index.d.ts] export declare function getSecondsInDay(): number; import * as mod from '../core/anotherModule'; @@ -445,165 +603,3 @@ exports.m = mod; "size": 1565 } - - -Change:: no-change-run -Input:: - - -Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError -[HH:MM:SS AM] Projects in this build: - * core/tsconfig.json - * logic/tsconfig.json - * tests/tsconfig.json - -[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. - -[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... - -core/index.ts:4:1 - error TS2554: Expected 2 arguments, but got 0. - -4 multiply(); -  ~~~~~~~~ - - core/index.ts:3:26 - 3 export function multiply(a: number, b: number) { return a * b; } -    ~~~~~~~~~ - An argument for 'a' was not provided. - -[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... - -[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time - - -Change:: fix error -Input:: -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - - - -Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError -[HH:MM:SS AM] Projects in this build: - * core/tsconfig.json - * logic/tsconfig.json - * tests/tsconfig.json - -[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. - -[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... - -[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... - -[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents -//// [/user/username/projects/sample1/core/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.someString = void 0; -exports.leftPad = leftPad; -exports.multiply = multiply; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -function multiply(a, b) { return a * b; } - - -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} - -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../../a/lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ], - "fileInfos": { - "../../../../../a/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "original": { - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "./index.ts": { - "original": { - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "./some_decl.d.ts": { - "original": { - "version": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - }, - "version": "-7959511260-declare const dts: any;", - "signature": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - } - }, - "root": [ - [ - [ - 2, - 4 - ], - [ - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - ] - ], - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true - }, - "latestChangedDtsFile": "./index.d.ts", - "version": "FakeTSVersion", - "size": 1380 -} - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js index 1a2dbd5919679..c4d5ce2baf0e4 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js @@ -651,7 +651,6 @@ var y = 10; "size": 1521 } -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time Program root files: [ @@ -700,7 +699,7 @@ Before running Timeout callback:: count: 1 2: timerToBuildInvalidatedProject Host is moving to new time -After running Timeout callback:: count: 1 +After running Timeout callback:: count: 0 Output:: >> Screen clear [HH:MM:SS AM] File change detected. Starting incremental compilation... @@ -710,6 +709,13 @@ Output:: 5 let x: string = 10;    ~ +logic/index.ts:8:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +8 let y: string = 10; +   ~ + +[HH:MM:SS AM] Found 2 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.js] @@ -811,26 +817,9 @@ var x = 10; } -Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* - -Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +Before running Timeout callback:: count: 0 -Host is moving to new time After running Timeout callback:: count: 0 -Output:: -logic/index.ts:8:5 - error TS2322: Type 'number' is not assignable to type 'string'. - -8 let y: string = 10; -   ~ - -[HH:MM:SS AM] Found 2 errors. Watching for file changes. - - - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time Program root files: [ @@ -860,30 +849,6 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.ts (computed .d.ts) -Program root files: [ - "/user/username/projects/sample1/logic/index.ts" -] -Program options: { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "watch": true, - "tscBuild": true, - "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" -} -Program structureReused: Not -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: - exitCode:: ExitStatus.undefined Change:: fix error in logic @@ -900,10 +865,10 @@ export const m = mod; Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +3: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +3: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -920,116 +885,6 @@ Output:: -//// [/user/username/projects/sample1/logic/index.js.map] -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} - -//// [/user/username/projects/sample1/logic/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.m = void 0; -exports.getSecondsInDay = getSecondsInDay; -var c = require("../core/index"); -function getSecondsInDay() { - return c.multiply(10, 15); -} -var mod = require("../core/anotherModule"); -exports.m = mod; -//# sourceMappingURL=index.js.map - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileIdsList":[[2,3]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"root":[4],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../../a/lib/lib.d.ts", - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "./index.ts" - ], - "fileIdsList": [ - [ - "../core/index.d.ts", - "../core/anothermodule.d.ts" - ] - ], - "fileInfos": { - "../../../../../a/lib/lib.d.ts": { - "original": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "../core/anothermodule.d.ts": { - "version": "-9234818176-export declare const World = \"hello\";\n", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "./index.ts": { - "original": { - "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", - "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" - }, - "version": "-9623801128-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\n", - "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" - } - }, - "root": [ - [ - 4, - "./index.ts" - ] - ], - "options": { - "composite": true, - "declaration": true, - "skipDefaultLibCheck": true, - "sourceMap": true - }, - "referencedMap": { - "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts" - ] - }, - "latestChangedDtsFile": "./index.d.ts", - "version": "FakeTSVersion", - "size": 1347 -} - -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time - -Program root files: [ - "/user/username/projects/sample1/logic/index.ts" -] -Program options: { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "watch": true, - "tscBuild": true, - "configFilePath": "/user/username/projects/sample1/logic/tsconfig.json" -} -Program structureReused: Not -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/logic/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/sample1/logic/index.ts (computed .d.ts) exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js index 2f2a9559266c7..6f6aa8deff1ab 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js @@ -114,13 +114,13 @@ Output::    ~~~~~~~~~ An argument for 'a' was not provided. -[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors -[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/logic/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors -[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'logic' was not built -[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/tests/tsconfig.json' because its dependency '/user/username/projects/sample1/logic' was not built [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -255,6 +255,199 @@ export declare function multiply(a: number, b: number): number; "size": 1574 } + +FsWatches:: +/user/username/projects/sample1/core/anotherModule.ts: *new* + {} +/user/username/projects/sample1/core/index.ts: *new* + {} +/user/username/projects/sample1/core/some_decl.d.ts: *new* + {} +/user/username/projects/sample1/core/tsconfig.json: *new* + {} +/user/username/projects/sample1/logic/index.ts: *new* + {} +/user/username/projects/sample1/logic/tsconfig.json: *new* + {} +/user/username/projects/sample1/tests/index.ts: *new* + {} +/user/username/projects/sample1/tests/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/sample1/core: *new* + {} +/user/username/projects/sample1/logic: *new* + {} + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/some_decl.d.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: fix error + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 1 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + + + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1300 +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -441,29 +634,6 @@ export declare const m: typeof mod; } -FsWatches:: -/user/username/projects/sample1/core/anotherModule.ts: *new* - {} -/user/username/projects/sample1/core/index.ts: *new* - {} -/user/username/projects/sample1/core/some_decl.d.ts: *new* - {} -/user/username/projects/sample1/core/tsconfig.json: *new* - {} -/user/username/projects/sample1/logic/index.ts: *new* - {} -/user/username/projects/sample1/logic/tsconfig.json: *new* - {} -/user/username/projects/sample1/tests/index.ts: *new* - {} -/user/username/projects/sample1/tests/tsconfig.json: *new* - {} - -FsWatchesRecursive:: -/user/username/projects/sample1/core: *new* - {} -/user/username/projects/sample1/logic: *new* - {} Program root files: [ "/user/username/projects/sample1/core/anotherModule.ts", @@ -487,16 +657,10 @@ Program files:: /user/username/projects/sample1/core/some_decl.d.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/some_decl.d.ts Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) -/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) -/user/username/projects/sample1/core/some_decl.d.ts (used version) +/user/username/projects/sample1/core/index.ts (computed .d.ts) Program root files: [ "/user/username/projects/sample1/logic/index.ts" @@ -565,152 +729,3 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) exitCode:: ExitStatus.undefined - -Change:: fix error - -Input:: -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - - -Timeout callback:: count: 1 -1: timerToBuildInvalidatedProject *new* - -Before running Timeout callback:: count: 1 -1: timerToBuildInvalidatedProject - -Host is moving to new time -After running Timeout callback:: count: 0 -Output:: ->> Screen clear -[HH:MM:SS AM] File change detected. Starting incremental compilation... - -[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. - -[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... - -[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... - -[HH:MM:SS AM] Found 0 errors. Watching for file changes. - - - -//// [/user/username/projects/sample1/core/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.someString = void 0; -exports.leftPad = leftPad; -exports.multiply = multiply; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -function multiply(a, b) { return a * b; } - - -//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} - -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../../a/lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ], - "fileInfos": { - "../../../../../a/lib/lib.d.ts": { - "original": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "original": { - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "./index.ts": { - "original": { - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "./some_decl.d.ts": { - "original": { - "version": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - }, - "version": "-7959511260-declare const dts: any;", - "signature": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - } - }, - "root": [ - [ - [ - 2, - 4 - ], - [ - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - ] - ], - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true - }, - "latestChangedDtsFile": "./index.d.ts", - "version": "FakeTSVersion", - "size": 1300 -} - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time - - -Program root files: [ - "/user/username/projects/sample1/core/anotherModule.ts", - "/user/username/projects/sample1/core/index.ts", - "/user/username/projects/sample1/core/some_decl.d.ts" -] -Program options: { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "watch": true, - "tscBuild": true, - "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" -} -Program structureReused: Not -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/some_decl.d.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/sample1/core/index.ts (computed .d.ts) - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js index cfc1200265a1d..069e9d127614f 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js @@ -117,13 +117,13 @@ Output::    ~~~~~~~~~ An argument for 'a' was not provided. -[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors -[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/logic/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors -[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'core' has errors -[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... +[HH:MM:SS AM] Skipping build of project '/user/username/projects/sample1/tests/tsconfig.json' because its dependency '/user/username/projects/sample1/core' has errors [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -258,6 +258,199 @@ export declare function multiply(a: number, b: number): number; "size": 1574 } + +FsWatches:: +/user/username/projects/sample1/core/anotherModule.ts: *new* + {} +/user/username/projects/sample1/core/index.ts: *new* + {} +/user/username/projects/sample1/core/some_decl.d.ts: *new* + {} +/user/username/projects/sample1/core/tsconfig.json: *new* + {} +/user/username/projects/sample1/logic/index.ts: *new* + {} +/user/username/projects/sample1/logic/tsconfig.json: *new* + {} +/user/username/projects/sample1/tests/index.ts: *new* + {} +/user/username/projects/sample1/tests/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/sample1/core: *new* + {} +/user/username/projects/sample1/logic: *new* + {} + +Program root files: [ + "/user/username/projects/sample1/core/anotherModule.ts", + "/user/username/projects/sample1/core/index.ts", + "/user/username/projects/sample1/core/some_decl.d.ts" +] +Program options: { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/some_decl.d.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: fix error + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 1 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + + + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + + +//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "original": { + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "version": "-3090574810-export const World = \"hello\";", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "original": { + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "original": { + "version": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + }, + "version": "-7959511260-declare const dts: any;", + "signature": "-7959511260-declare const dts: any;", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "version": "FakeTSVersion", + "size": 1300 +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0CAEC;AAHD,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -444,29 +637,6 @@ export declare const m: typeof mod; } -FsWatches:: -/user/username/projects/sample1/core/anotherModule.ts: *new* - {} -/user/username/projects/sample1/core/index.ts: *new* - {} -/user/username/projects/sample1/core/some_decl.d.ts: *new* - {} -/user/username/projects/sample1/core/tsconfig.json: *new* - {} -/user/username/projects/sample1/logic/index.ts: *new* - {} -/user/username/projects/sample1/logic/tsconfig.json: *new* - {} -/user/username/projects/sample1/tests/index.ts: *new* - {} -/user/username/projects/sample1/tests/tsconfig.json: *new* - {} - -FsWatchesRecursive:: -/user/username/projects/sample1/core: *new* - {} -/user/username/projects/sample1/logic: *new* - {} Program root files: [ "/user/username/projects/sample1/core/anotherModule.ts", @@ -490,16 +660,10 @@ Program files:: /user/username/projects/sample1/core/some_decl.d.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/some_decl.d.ts Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) -/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) -/user/username/projects/sample1/core/some_decl.d.ts (used version) +/user/username/projects/sample1/core/index.ts (computed .d.ts) Program root files: [ "/user/username/projects/sample1/logic/index.ts" @@ -568,157 +732,3 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) exitCode:: ExitStatus.undefined - -Change:: fix error - -Input:: -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - - -Timeout callback:: count: 1 -1: timerToBuildInvalidatedProject *new* - -Before running Timeout callback:: count: 1 -1: timerToBuildInvalidatedProject - -Host is moving to new time -After running Timeout callback:: count: 0 -Output:: ->> Screen clear -[HH:MM:SS AM] File change detected. Starting incremental compilation... - -[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. - -[HH:MM:SS AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... - -[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/logic/tsconfig.json'... - -[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... - -[HH:MM:SS AM] Found 0 errors. Watching for file changes. - - - -//// [/user/username/projects/sample1/core/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.someString = void 0; -exports.leftPad = leftPad; -exports.multiply = multiply; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -function multiply(a, b) { return a * b; } - - -//// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3090574810-export const World = \"hello\";","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-7959511260-declare const dts: any;","affectsGlobalScope":true}],"root":[[2,4]],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts","version":"FakeTSVersion"} - -//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../../a/lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ], - "fileInfos": { - "../../../../../a/lib/lib.d.ts": { - "original": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "original": { - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "version": "-3090574810-export const World = \"hello\";", - "signature": "-9234818176-export declare const World = \"hello\";\n" - }, - "./index.ts": { - "original": { - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "version": "-15745098553-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\n", - "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" - }, - "./some_decl.d.ts": { - "original": { - "version": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - }, - "version": "-7959511260-declare const dts: any;", - "signature": "-7959511260-declare const dts: any;", - "affectsGlobalScope": true - } - }, - "root": [ - [ - [ - 2, - 4 - ], - [ - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - ] - ], - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true - }, - "latestChangedDtsFile": "./index.d.ts", - "version": "FakeTSVersion", - "size": 1300 -} - -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time - - -Program root files: [ - "/user/username/projects/sample1/core/anotherModule.ts", - "/user/username/projects/sample1/core/index.ts", - "/user/username/projects/sample1/core/some_decl.d.ts" -] -Program options: { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "watch": true, - "tscBuild": true, - "configFilePath": "/user/username/projects/sample1/core/tsconfig.json" -} -Program structureReused: Not -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/some_decl.d.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/sample1/core/index.ts (computed .d.ts) - -exitCode:: ExitStatus.undefined From 713510feffc108818633dc17b2832f6248b0ee09 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Aug 2024 16:24:46 -0700 Subject: [PATCH 4/4] Change the name of flag to --stopBuildOnErrors --- src/compiler/commandLineParser.ts | 2 +- src/compiler/tsbuildPublic.ts | 6 +++--- src/testRunner/unittests/tsbuild/sample.ts | 4 ++-- src/testRunner/unittests/tsbuildWatch/programUpdates.ts | 6 +++--- tests/baselines/reference/api/typescript.d.ts | 2 +- ...-stopBuildOnErrors-when-test-does-not-reference-core.js} | 6 +++--- ...upstream-projects-have-errors-with-stopBuildOnErrors.js} | 6 +++--- ... => when-stopBuildOnErrors-is-passed-on-command-line.js} | 2 +- ...-stopBuildOnErrors-when-test-does-not-reference-core.js} | 2 +- ...upstream-projects-have-errors-with-stopBuildOnErrors.js} | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) rename tests/baselines/reference/tsbuild/sample1/{skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js => skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js} (98%) rename tests/baselines/reference/tsbuild/sample1/{skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js => skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js} (98%) rename tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/{when-noDownstreamOnError-is-passed-on-command-line.js => when-stopBuildOnErrors-is-passed-on-command-line.js} (99%) rename tests/baselines/reference/tsbuildWatch/programUpdates/{skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js => skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js} (99%) rename tests/baselines/reference/tsbuildWatch/programUpdates/{skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js => skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js} (99%) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index fb78960f1d7e3..9797d9f96cc66 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1697,7 +1697,7 @@ export const optionsForBuild: CommandLineOption[] = [ defaultValueDescription: false, }, { - name: "noDownstreamOnError", + name: "stopBuildOnErrors", category: Diagnostics.Command_line_Options, description: Diagnostics.Skip_building_downstream_projects_on_error_in_upstream_project, type: "boolean", diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 0fb18cca115a4..3230699eba3c0 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -135,7 +135,7 @@ export interface BuildOptions { dry?: boolean; force?: boolean; verbose?: boolean; - noDownstreamOnError?: boolean; + stopBuildOnErrors?: boolean; /** @internal */ clean?: boolean; /** @internal */ watch?: boolean; @@ -1475,7 +1475,7 @@ function getUpToDateStatusWorker(state: SolutionBuilde // An upstream project is blocked if ( - state.options.noDownstreamOnError && ( + state.options.stopBuildOnErrors && ( refStatus.type === UpToDateStatusType.Unbuildable || refStatus.type === UpToDateStatusType.UpstreamBlocked ) @@ -1881,7 +1881,7 @@ function queueReferencingProjects( buildResult: BuildResultFlags, ) { // Queue only if there are no errors - if (state.options.noDownstreamOnError && (buildResult & BuildResultFlags.AnyErrors)) return; + if (state.options.stopBuildOnErrors && (buildResult & BuildResultFlags.AnyErrors)) return; // Only composite projects can be referenced by other projects if (!config.options.composite) return; // Always use build order to queue projects diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index b7dd61154deb3..7cffa6cede35b 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -363,9 +363,9 @@ describe("unittests:: tsbuild:: on 'sample1' project", () => { [false, true].forEach(skipReferenceCoreFromTest => verifyTsc({ scenario: "sample1", - subScenario: `skips builds downstream projects if upstream projects have errors with noDownstreamOnError${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, + subScenario: `skips builds downstream projects if upstream projects have errors with stopBuildOnErrors${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, fs: () => getFsForSampleProjectReferences(/*withNodeNext*/ undefined, skipReferenceCoreFromTest), - commandLineArgs: ["--b", "tests", "--verbose", "--noDownstreamOnError"], + commandLineArgs: ["--b", "tests", "--verbose", "--stopBuildOnErrors"], modifyFs: fs => appendText(fs, "core/index.ts", `multiply();`), edits: [ noChangeRun, diff --git a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts index 758a1ed0041d2..9759e27e9fe6a 100644 --- a/src/testRunner/unittests/tsbuildWatch/programUpdates.ts +++ b/src/testRunner/unittests/tsbuildWatch/programUpdates.ts @@ -316,18 +316,18 @@ createSomeObject().message;`, } verifyIncrementalErrors("when preserveWatchOutput is not used", ts.emptyArray); verifyIncrementalErrors("when preserveWatchOutput is passed on command line", ["--preserveWatchOutput"]); - verifyIncrementalErrors("when noDownstreamOnError is passed on command line", ["--noDownstreamOnError"]); + verifyIncrementalErrors("when stopBuildOnErrors is passed on command line", ["--stopBuildOnErrors"]); [false, true].forEach(skipReferenceCoreFromTest => verifyTscWatch({ scenario: "programUpdates", - subScenario: `skips builds downstream projects if upstream projects have errors with noDownstreamOnError${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, + subScenario: `skips builds downstream projects if upstream projects have errors with stopBuildOnErrors${skipReferenceCoreFromTest ? " when test does not reference core" : ""}`, sys: () => { const sys = getSysForSampleProjectReferences(/*withNodeNext*/ undefined, skipReferenceCoreFromTest); sys.appendFile("core/index.ts", `multiply();`); return sys; }, - commandLineArgs: ["--b", "-w", "tests", "--verbose", "--noDownstreamOnError"], + commandLineArgs: ["--b", "-w", "tests", "--verbose", "--stopBuildOnErrors"], edits: [{ caption: "fix error", edit: sys => sys.replaceFileText("core/index.ts", "multiply();", ""), diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 248c472f98cb2..e5607bd839993 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -9802,7 +9802,7 @@ declare namespace ts { dry?: boolean; force?: boolean; verbose?: boolean; - noDownstreamOnError?: boolean; + stopBuildOnErrors?: boolean; incremental?: boolean; assumeChangesOnlyAffectDirectDependencies?: boolean; declaration?: boolean; diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js similarity index 98% rename from tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js rename to tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 4dd5fe0b4781a..4aea56338cca0 100644 --- a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -94,7 +94,7 @@ export const m = mod; Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError +/a/lib/tsc --b tests --verbose --stopBuildOnErrors [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -264,7 +264,7 @@ Input:: Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError +/a/lib/tsc --b tests --verbose --stopBuildOnErrors [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -311,7 +311,7 @@ export function multiply(a: number, b: number) { return a * b; } Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError +/a/lib/tsc --b tests --verbose --stopBuildOnErrors [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json diff --git a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js similarity index 98% rename from tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js rename to tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 89b81a5388f70..8f0a3da4d677c 100644 --- a/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js +++ b/tests/baselines/reference/tsbuild/sample1/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -97,7 +97,7 @@ export const m = mod; Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError +/a/lib/tsc --b tests --verbose --stopBuildOnErrors [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -267,7 +267,7 @@ Input:: Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError +/a/lib/tsc --b tests --verbose --stopBuildOnErrors [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -314,7 +314,7 @@ export function multiply(a: number, b: number) { return a * b; } Output:: -/a/lib/tsc --b tests --verbose --noDownstreamOnError +/a/lib/tsc --b tests --verbose --stopBuildOnErrors [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-stopBuildOnErrors-is-passed-on-command-line.js similarity index 99% rename from tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js rename to tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-stopBuildOnErrors-is-passed-on-command-line.js index c4d5ce2baf0e4..cccf6cf96d7f7 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-noDownstreamOnError-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-stopBuildOnErrors-is-passed-on-command-line.js @@ -93,7 +93,7 @@ export const m = mod; -/a/lib/tsc.js -b -w tests --noDownstreamOnError +/a/lib/tsc.js -b -w tests --stopBuildOnErrors Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js similarity index 99% rename from tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js rename to tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 6f6aa8deff1ab..024873da5647c 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError-when-test-does-not-reference-core.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -90,7 +90,7 @@ export const m = mod; -/a/lib/tsc.js --b -w tests --verbose --noDownstreamOnError +/a/lib/tsc.js --b -w tests --verbose --stopBuildOnErrors Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js similarity index 99% rename from tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js rename to tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 069e9d127614f..5e025aa04a28d 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-noDownstreamOnError.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -93,7 +93,7 @@ export const m = mod; -/a/lib/tsc.js --b -w tests --verbose --noDownstreamOnError +/a/lib/tsc.js --b -w tests --verbose --stopBuildOnErrors Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode...