Report config file parsing diagnostics correctly with tsc --b (#36520)

* Refactor the test

* Add tests for syntax errors in tsconfig not being reported

* Report config file parsing diagnostics correctly
Fixes #36515

* Fix errors in existing tests for unintended tsconfig parse errors

* Fix lint
This commit is contained in:
Sheetal Nandi 2020-01-30 11:18:06 -08:00 committed by GitHub
parent c1e45ac8af
commit 4c378c09dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 543 additions and 84 deletions

View file

@ -828,7 +828,7 @@ namespace ts {
if (state.options.verbose) reportStatus(state, Diagnostics.Building_project_0, project);
if (config.fileNames.length === 0) {
reportAndStoreErrors(state, projectPath, config.errors);
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
// Nothing to build - must be a solution file, basically
buildResult = BuildResultFlags.None;
step = Step.QueueReferencingProjects;
@ -846,7 +846,7 @@ namespace ts {
config.options,
compilerHost,
getOldProgram(state, projectPath, config),
config.errors,
getConfigFileParsingDiagnostics(config),
config.projectReferences
);
step++;
@ -1118,7 +1118,7 @@ namespace ts {
function needsBuild({ options }: SolutionBuilderState, status: UpToDateStatus, config: ParsedCommandLine) {
if (status.type !== UpToDateStatusType.OutOfDateWithPrepend || options.force) return true;
return config.fileNames.length === 0 ||
!!config.errors.length ||
!!getConfigFileParsingDiagnostics(config).length ||
!isIncrementalCompilation(config.options);
}
@ -1172,7 +1172,7 @@ namespace ts {
verboseReportProjectStatus(state, project, status);
if (!options.force) {
if (status.type === UpToDateStatusType.UpToDate) {
reportAndStoreErrors(state, projectPath, config.errors);
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
projectPendingBuild.delete(projectPath);
// Up to date, skip
if (options.dry) {
@ -1183,7 +1183,7 @@ namespace ts {
}
if (status.type === UpToDateStatusType.UpToDateWithUpstreamTypes) {
reportAndStoreErrors(state, projectPath, config.errors);
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
return createUpdateOutputFileStampsProject(
state,
project,
@ -1195,7 +1195,7 @@ namespace ts {
}
if (status.type === UpToDateStatusType.UpstreamBlocked) {
reportAndStoreErrors(state, projectPath, config.errors);
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
projectPendingBuild.delete(projectPath);
if (options.verbose) {
reportStatus(
@ -1211,7 +1211,7 @@ namespace ts {
}
if (status.type === UpToDateStatusType.ContainerOnly) {
reportAndStoreErrors(state, projectPath, config.errors);
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
projectPendingBuild.delete(projectPath);
// Do nothing
continue;

View file

@ -107,6 +107,7 @@
"unittests/services/textChanges.ts",
"unittests/services/transpile.ts",
"unittests/tsbuild/amdModulesWithOut.ts",
"unittests/tsbuild/configFileErrors.ts",
"unittests/tsbuild/containerOnlyReferenced.ts",
"unittests/tsbuild/demo.ts",
"unittests/tsbuild/emitDeclarationOnly.ts",
@ -116,7 +117,6 @@
"unittests/tsbuild/inferredTypeFromTransitiveModule.ts",
"unittests/tsbuild/javascriptProjectEmit.ts",
"unittests/tsbuild/lateBoundSymbol.ts",
"unittests/tsbuild/missingExtendedFile.ts",
"unittests/tsbuild/moduleSpecifiers.ts",
"unittests/tsbuild/noEmitOnError.ts",
"unittests/tsbuild/outFile.ts",

View file

@ -0,0 +1,57 @@
namespace ts {
describe("unittests:: tsbuild:: configFileErrors:: when tsconfig extends the missing file", () => {
verifyTsc({
scenario: "configFileErrors",
subScenario: "when tsconfig extends the missing file",
fs: () => loadProjectFromDisk("tests/projects/missingExtendedConfig"),
commandLineArgs: ["--b", "/src/tsconfig.json"],
});
});
describe("unittests:: tsbuild:: configFileErrors:: reports syntax errors in config file", () => {
verifyTscIncrementalEdits({
scenario: "configFileErrors",
subScenario: "reports syntax errors in config file",
fs: () => loadProjectFromFiles({
"/src/a.ts": "export function foo() { }",
"/src/b.ts": "export function bar() { }",
"/src/tsconfig.json": Utils.dedent`
{
"compilerOptions": {
"composite": true,
},
"files": [
"a.ts"
"b.ts"
]
}`
}),
commandLineArgs: ["--b", "/src/tsconfig.json"],
incrementalScenarios: [
{
buildKind: BuildKind.IncrementalDtsUnchanged,
modifyFs: fs => replaceText(fs, "/src/tsconfig.json", ",", `,
"declaration": true,`),
subScenario: "reports syntax errors after change to config file"
},
{
buildKind: BuildKind.IncrementalDtsUnchanged,
modifyFs: fs => appendText(fs, "/src/a.ts", "export function fooBar() { }"),
subScenario: "reports syntax errors after change to ts file"
},
noChangeRun,
{
buildKind: BuildKind.IncrementalDtsChange,
modifyFs: fs => fs.writeFileSync(
"/src/tsconfig.json",
JSON.stringify({
compilerOptions: { composite: true, declaration: true },
files: ["a.ts", "b.ts"]
})
),
subScenario: "builds after fixing config file errors"
},
]
});
});
}

View file

@ -1,18 +1,9 @@
namespace ts {
describe("unittests:: tsbuild:: when containerOnly project is referenced", () => {
let projFs: vfs.FileSystem;
before(() => {
projFs = loadProjectFromDisk("tests/projects/containerOnlyReferenced");
});
after(() => {
projFs = undefined!; // Release the contents
});
verifyTscIncrementalEdits({
scenario: "containerOnlyReferenced",
subScenario: "verify that subsequent builds after initial build doesnt build anything",
fs: () => projFs,
fs: () => loadProjectFromDisk("tests/projects/containerOnlyReferenced"),
commandLineArgs: ["--b", "/src", "--verbose"],
incrementalScenarios: [noChangeRun]
});

View file

@ -212,7 +212,7 @@ namespace ts {
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": null
"outDir": null,
"composite": true
},
"include": ["index.ts", "obj.json"]

View file

@ -1,16 +1,8 @@
namespace ts {
describe("unittests:: tsbuild:: lateBoundSymbol:: interface is merged and contains late bound member", () => {
let projFs: vfs.FileSystem;
before(() => {
projFs = loadProjectFromDisk("tests/projects/lateBoundSymbol");
});
after(() => {
projFs = undefined!; // Release the contents
});
verifyTscIncrementalEdits({
subScenario: "interface is merged and contains late bound member",
fs: () => projFs,
fs: () => loadProjectFromDisk("tests/projects/lateBoundSymbol"),
scenario: "lateBoundSymbol",
commandLineArgs: ["--b", "/src/tsconfig.json", "--verbose"],
incrementalScenarios: [{

View file

@ -1,17 +0,0 @@
namespace ts {
describe("unittests:: tsbuild:: when tsconfig extends the missing file", () => {
let projFs: vfs.FileSystem;
before(() => {
projFs = loadProjectFromDisk("tests/projects/missingExtendedConfig");
});
after(() => {
projFs = undefined!;
});
verifyTsc({
scenario: "missingExtendedConfig",
subScenario: "when tsconfig extends the missing file",
fs: () => projFs,
commandLineArgs: ["--b", "/src/tsconfig.json"],
});
});
}

View file

@ -1,16 +1,9 @@
namespace ts {
describe("unittests:: tsbuild - with noEmitOnError", () => {
let projFs: vfs.FileSystem;
before(() => {
projFs = loadProjectFromDisk("tests/projects/noEmitOnError");
});
after(() => {
projFs = undefined!;
});
verifyTsc({
scenario: "noEmitOnError",
subScenario: "has empty files diagnostic when files is empty and no references are provided",
fs: () => projFs,
fs: () => loadProjectFromDisk("tests/projects/noEmitOnError"),
commandLineArgs: ["--b", "/src/tsconfig.json"],
});
});

View file

@ -453,7 +453,7 @@ namespace ts {
function stripInternalOfThird(fs: vfs.FileSystem) {
replaceText(fs, sources[project.third][source.config], `"declaration": true,`, `"declaration": true,
"stripInternal": true`);
"stripInternal": true,`);
}
function stripInternalScenario(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) {

View file

@ -71,19 +71,10 @@ export default hello.hello`);
});
describe("unittests:: tsbuild:: with resolveJsonModule option on project importJsonFromProjectReference", () => {
let projFs: vfs.FileSystem;
before(() => {
projFs = loadProjectFromDisk("tests/projects/importJsonFromProjectReference");
});
after(() => {
projFs = undefined!; // Release the contents
});
verifyTscIncrementalEdits({
scenario: "resolveJsonModule",
subScenario: "importing json module from project reference",
fs: () => projFs,
fs: () => loadProjectFromDisk("tests/projects/importJsonFromProjectReference"),
commandLineArgs: ["--b", "src/tsconfig.json", "--verbose"],
incrementalScenarios: [noChangeRun]
});

View file

@ -1266,8 +1266,7 @@ const a = {
),
changes: [
sys => {
const content = sys.readFile(`${projectsLocation}/reexport/src/pure/session.ts`)!;
sys.writeFile(`${projectsLocation}/reexport/src/pure/session.ts`, content.replace("// ", ""));
replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "// ", "");
sys.checkTimeoutQueueLengthAndRun(1); // build src/pure
sys.checkTimeoutQueueLengthAndRun(1); // build src/main
sys.checkTimeoutQueueLengthAndRun(1); // build src
@ -1275,8 +1274,7 @@ const a = {
return "Introduce error";
},
sys => {
const content = sys.readFile(`${projectsLocation}/reexport/src/pure/session.ts`)!;
sys.writeFile(`${projectsLocation}/reexport/src/pure/session.ts`, content.replace("bar: ", "// bar: "));
replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "bar: ", "// bar: ");
sys.checkTimeoutQueueLengthAndRun(1); // build src/pure
sys.checkTimeoutQueueLengthAndRun(1); // build src/main
sys.checkTimeoutQueueLengthAndRun(1); // build src
@ -1286,4 +1284,63 @@ const a = {
]
});
});
describe("unittests:: tsbuild:: watchMode:: configFileErrors:: reports syntax errors in config file", () => {
verifyTscWatch({
scenario: "configFileErrors",
subScenario: "reports syntax errors in config file",
sys: () => createWatchedSystem(
[
{ path: `${projectRoot}/a.ts`, content: "export function foo() { }" },
{ path: `${projectRoot}/b.ts`, content: "export function bar() { }" },
{
path: `${projectRoot}/tsconfig.json`,
content: Utils.dedent`
{
"compilerOptions": {
"composite": true,
},
"files": [
"a.ts"
"b.ts"
]
}`
},
libFile
],
{ currentDirectory: projectRoot }
),
commandLineArgs: ["--b", "-w"],
changes: [
sys => {
replaceFileText(sys, `${projectRoot}/tsconfig.json`, ",", `,
"declaration": true,`);
sys.checkTimeoutQueueLengthAndRun(1); // build the project
sys.checkTimeoutQueueLength(0);
return "reports syntax errors after change to config file";
},
sys => {
replaceFileText(sys, `${projectRoot}/a.ts`, "foo", "fooBar");
sys.checkTimeoutQueueLengthAndRun(1); // build the project
sys.checkTimeoutQueueLength(0);
return "reports syntax errors after change to ts file";
},
sys => {
replaceFileText(sys, `${projectRoot}/tsconfig.json`, "", "");
sys.checkTimeoutQueueLengthAndRun(1); // build the project
sys.checkTimeoutQueueLength(0);
return "reports error when there is no change to tsconfig file";
},
sys => {
sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({
compilerOptions: { composite: true, declaration: true },
files: ["a.ts", "b.ts"]
}));
sys.checkTimeoutQueueLengthAndRun(1); // build the project
sys.checkTimeoutQueueLength(0);
return "builds after fixing config file errors";
}
]
});
});
}

View file

@ -417,4 +417,9 @@ namespace ts.tscWatch {
});
});
}
export function replaceFileText(sys: WatchedSystem, file: string, searchValue: string | RegExp, replaceValue: string) {
const content = Debug.assertDefined(sys.readFile(file));
sys.writeFile(file, content.replace(searchValue, replaceValue));
}
}

View file

@ -1086,8 +1086,7 @@ export function two() {
});
function changeParameterTypeOfBFile(sys: WatchedSystem, parameterName: string, toType: string) {
const oldContent = sys.readFile(`${projectRoot}/b.ts`)!;
sys.writeFile(`${projectRoot}/b.ts`, oldContent.replace(new RegExp(`${parameterName}\: [a-z]*`), `${parameterName}: ${toType}`));
replaceFileText(sys, `${projectRoot}/b.ts`, new RegExp(`${parameterName}\: [a-z]*`), `${parameterName}: ${toType}`);
sys.runQueuedTimeoutCallbacks();
return `Changed ${parameterName} type to ${toType}`;
}

View file

@ -1046,7 +1046,7 @@ declare function appfile4Spread(...b: number[]): void;
"declarationMap": true,
"outFile": "module.js"
},
"exclude": ["module.d.ts"]
"exclude": ["module.d.ts"],
"references": [
{ "path": "../lib", "prepend": true }
]

View file

@ -679,7 +679,7 @@ declare const myVar = 30;
"declarationMap": true,
"outFile": "module.js"
},
"exclude": ["module.d.ts"]
"exclude": ["module.d.ts"],
"references": [
{ "path": "../lib", "prepend": true }
]

View file

@ -2092,7 +2092,7 @@ declare const myVar = 30;
"declarationMap": true,
"outFile": "module.js"
},
"exclude": ["module.d.ts"]
"exclude": ["module.d.ts"],
"references": [
{ "path": "../lib", "prepend": true }
]

View file

@ -0,0 +1,63 @@
//// [/lib/incremental-declaration-changesOutput.txt]
/lib/tsc --b /src/tsconfig.json
exitCode:: ExitStatus.Success
//// [/src/a.d.ts]
export declare function foo(): void;
//// [/src/a.js]
"use strict";
exports.__esModule = true;
function foo() { }
exports.foo = foo;
//// [/src/b.d.ts]
export declare function bar(): void;
//// [/src/b.js]
"use strict";
exports.__esModule = true;
function bar() { }
exports.bar = bar;
//// [/src/tsconfig.json]
{"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]}
//// [/src/tsconfig.tsbuildinfo]
{
"program": {
"fileInfos": {
"../lib/lib.d.ts": {
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
},
"./a.ts": {
"version": "4646078106-export function foo() { }",
"signature": "-6972466928-export declare function foo(): void;\r\n"
},
"./b.ts": {
"version": "1045484683-export function bar() { }",
"signature": "-1357953631-export declare function bar(): void;\r\n"
}
},
"options": {
"composite": true,
"declaration": true,
"configFilePath": "./tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../lib/lib.d.ts",
"./a.ts",
"./b.ts"
]
},
"version": "FakeTSVersion"
}

View file

@ -0,0 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/tsconfig.json
src/tsconfig.json(8,9): error TS1005: ',' expected.
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
//// [/src/tsconfig.json]
{
"compilerOptions": {
"composite": true,
"declaration": true,
},
"files": [
"a.ts"
"b.ts"
]
}

View file

@ -0,0 +1,9 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/tsconfig.json
src/tsconfig.json(7,9): error TS1005: ',' expected.
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
//// [/src/a.ts]
export function foo() { }export function fooBar() { }

View file

@ -0,0 +1,6 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/tsconfig.json
src/tsconfig.json(7,9): error TS1005: ',' expected.
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped

View file

@ -0,0 +1,6 @@
//// [/lib/no-change-runOutput.txt]
/lib/tsc --b /src/tsconfig.json
src/tsconfig.json(7,9): error TS1005: ',' expected.
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped

View file

@ -2236,7 +2236,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5583,7 +5583,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5274,7 +5274,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5947,7 +5947,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5650,7 +5650,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -2726,7 +2726,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5603,7 +5603,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5805,7 +5805,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5514,7 +5514,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -5294,7 +5294,7 @@ declare var c: C;
"sourceMap": true,
"declarationMap": true,
"declaration": true,
"stripInternal": true
"stripInternal": true,
"outFile": "./thirdjs/output/third-output.js",
"skipDefaultLibCheck": true
},

View file

@ -0,0 +1,289 @@
/a/lib/tsc.js --b -w
//// [/user/username/projects/myproject/a.ts]
export function foo() { }
//// [/user/username/projects/myproject/b.ts]
export function bar() { }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
"composite": true,
},
"files": [
"a.ts"
"b.ts"
]
}
//// [/a/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
Output::
>> Screen clear
12:00:23 AM - Starting compilation in watch mode...
tsconfig.json(7,9): error TS1005: ',' expected.
12:00:24 AM - Found 1 error. Watching for file changes.
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"]
Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/myproject/a.ts
/user/username/projects/myproject/b.ts
No cached semantic diagnostics in the builder::
WatchedFiles::
/user/username/projects/myproject/tsconfig.json:
{"pollingInterval":250}
/user/username/projects/myproject/a.ts:
{"pollingInterval":250}
/user/username/projects/myproject/b.ts:
{"pollingInterval":250}
FsWatches::
FsWatchesRecursive::
exitCode:: ExitStatus.undefined
Change:: reports syntax errors after change to config file
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
"composite": true,
"declaration": true,
},
"files": [
"a.ts"
"b.ts"
]
}
Output::
>> Screen clear
12:00:28 AM - File change detected. Starting incremental compilation...
tsconfig.json(8,9): error TS1005: ',' expected.
12:00:29 AM - Found 1 error. Watching for file changes.
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"]
Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/myproject/a.ts
/user/username/projects/myproject/b.ts
No cached semantic diagnostics in the builder::
WatchedFiles::
/user/username/projects/myproject/tsconfig.json:
{"pollingInterval":250}
/user/username/projects/myproject/a.ts:
{"pollingInterval":250}
/user/username/projects/myproject/b.ts:
{"pollingInterval":250}
FsWatches::
FsWatchesRecursive::
exitCode:: ExitStatus.undefined
Change:: reports syntax errors after change to ts file
//// [/user/username/projects/myproject/a.ts]
export function fooBar() { }
Output::
>> Screen clear
12:00:33 AM - File change detected. Starting incremental compilation...
tsconfig.json(8,9): error TS1005: ',' expected.
12:00:34 AM - Found 1 error. Watching for file changes.
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"]
Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/myproject/a.ts
/user/username/projects/myproject/b.ts
No cached semantic diagnostics in the builder::
WatchedFiles::
/user/username/projects/myproject/tsconfig.json:
{"pollingInterval":250}
/user/username/projects/myproject/a.ts:
{"pollingInterval":250}
/user/username/projects/myproject/b.ts:
{"pollingInterval":250}
FsWatches::
FsWatchesRecursive::
exitCode:: ExitStatus.undefined
Change:: reports error when there is no change to tsconfig file
//// [/user/username/projects/myproject/tsconfig.json] file written with same contents
Output::
>> Screen clear
12:00:38 AM - File change detected. Starting incremental compilation...
tsconfig.json(8,9): error TS1005: ',' expected.
12:00:39 AM - Found 1 error. Watching for file changes.
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"]
Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/myproject/a.ts
/user/username/projects/myproject/b.ts
No cached semantic diagnostics in the builder::
WatchedFiles::
/user/username/projects/myproject/tsconfig.json:
{"pollingInterval":250}
/user/username/projects/myproject/a.ts:
{"pollingInterval":250}
/user/username/projects/myproject/b.ts:
{"pollingInterval":250}
FsWatches::
FsWatchesRecursive::
exitCode:: ExitStatus.undefined
Change:: builds after fixing config file errors
//// [/user/username/projects/myproject/tsconfig.json]
{"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]}
//// [/user/username/projects/myproject/a.js]
"use strict";
exports.__esModule = true;
function fooBar() { }
exports.fooBar = fooBar;
//// [/user/username/projects/myproject/a.d.ts]
export declare function fooBar(): void;
//// [/user/username/projects/myproject/b.js]
"use strict";
exports.__esModule = true;
function bar() { }
exports.bar = bar;
//// [/user/username/projects/myproject/b.d.ts]
export declare function bar(): void;
//// [/user/username/projects/myproject/tsconfig.tsbuildinfo]
{
"program": {
"fileInfos": {
"../../../../a/lib/lib.d.ts": {
"version": "-7698705165-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }",
"signature": "-7698705165-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }"
},
"./a.ts": {
"version": "-3260843409-export function fooBar() { }",
"signature": "-6611919720-export declare function fooBar(): void;\n"
},
"./b.ts": {
"version": "1045484683-export function bar() { }",
"signature": "-2904461644-export declare function bar(): void;\n"
}
},
"options": {
"composite": true,
"declaration": true,
"watch": true,
"configFilePath": "./tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../../../../a/lib/lib.d.ts",
"./a.ts",
"./b.ts"
]
},
"version": "FakeTSVersion"
}
Output::
>> Screen clear
12:00:43 AM - File change detected. Starting incremental compilation...
12:00:54 AM - Found 0 errors. Watching for file changes.
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"]
Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/myproject/a.ts
/user/username/projects/myproject/b.ts
Semantic diagnostics in builder refreshed for::
/a/lib/lib.d.ts
/user/username/projects/myproject/a.ts
/user/username/projects/myproject/b.ts
WatchedFiles::
/user/username/projects/myproject/tsconfig.json:
{"pollingInterval":250}
/user/username/projects/myproject/a.ts:
{"pollingInterval":250}
/user/username/projects/myproject/b.ts:
{"pollingInterval":250}
FsWatches::
FsWatchesRecursive::
exitCode:: ExitStatus.undefined

View file

@ -8,7 +8,7 @@
"declarationMap": true,
"outFile": "module.js"
},
"exclude": ["module.d.ts"]
"exclude": ["module.d.ts"],
"references": [
{ "path": "../lib", "prepend": true }
]