Container only ref needs to be ignored from uptodate status
Fixes #31288
This commit is contained in:
parent
f2735b5a06
commit
0e5d95feef
|
@ -1462,7 +1462,8 @@ namespace ts {
|
|||
const refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
|
||||
|
||||
// Its a circular reference ignore the status of this project
|
||||
if (refStatus.type === UpToDateStatusType.ComputingUpstream) {
|
||||
if (refStatus.type === UpToDateStatusType.ComputingUpstream ||
|
||||
refStatus.type === UpToDateStatusType.ContainerOnly) { // Container only ignore this project
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
"unittests/services/textChanges.ts",
|
||||
"unittests/services/transpile.ts",
|
||||
"unittests/tsbuild/amdModulesWithOut.ts",
|
||||
"unittests/tsbuild/containerOnlyReferenced.ts",
|
||||
"unittests/tsbuild/emptyFiles.ts",
|
||||
"unittests/tsbuild/graphOrdering.ts",
|
||||
"unittests/tsbuild/inferredTypeFromTransitiveModule.ts",
|
||||
|
|
48
src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts
Normal file
48
src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
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
|
||||
});
|
||||
|
||||
function outputs(folder: string) {
|
||||
return [
|
||||
`${folder}/index.js`,
|
||||
`${folder}/index.d.ts`,
|
||||
`${folder}/tsconfig.tsbuildinfo`
|
||||
];
|
||||
}
|
||||
|
||||
it("verify that subsequent builds after initial build doesnt build anything", () => {
|
||||
const fs = projFs.shadow();
|
||||
const host = new fakes.SolutionBuilderHost(fs);
|
||||
createSolutionBuilder(host, ["/src"], { verbose: true }).build();
|
||||
host.assertDiagnosticMessages(
|
||||
getExpectedDiagnosticForProjectsInBuild("src/src/folder/tsconfig.json", "src/src/folder2/tsconfig.json", "src/src/tsconfig.json", "src/tests/tsconfig.json", "src/tsconfig.json"),
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/folder/tsconfig.json", "src/src/folder/index.js"],
|
||||
[Diagnostics.Building_project_0, "/src/src/folder/tsconfig.json"],
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/folder2/tsconfig.json", "src/src/folder2/index.js"],
|
||||
[Diagnostics.Building_project_0, "/src/src/folder2/tsconfig.json"],
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/tests/tsconfig.json", "src/tests/index.js"],
|
||||
[Diagnostics.Building_project_0, "/src/tests/tsconfig.json"],
|
||||
);
|
||||
verifyOutputsPresent(fs, [
|
||||
...outputs("/src/src/folder"),
|
||||
...outputs("/src/src/folder2"),
|
||||
...outputs("/src/tests"),
|
||||
]);
|
||||
host.clearDiagnostics();
|
||||
createSolutionBuilder(host, ["/src"], { verbose: true }).build();
|
||||
host.assertDiagnosticMessages(
|
||||
getExpectedDiagnosticForProjectsInBuild("src/src/folder/tsconfig.json", "src/src/folder2/tsconfig.json", "src/src/tsconfig.json", "src/tests/tsconfig.json", "src/tsconfig.json"),
|
||||
[Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/src/folder/tsconfig.json", "src/src/folder/index.ts", "src/src/folder/index.js"],
|
||||
[Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/src/folder2/tsconfig.json", "src/src/folder2/index.ts", "src/src/folder2/index.js"],
|
||||
[Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/tests/tsconfig.json", "src/tests/index.ts", "src/tests/index.js"],
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -10,7 +10,6 @@ namespace ts {
|
|||
});
|
||||
|
||||
it("verify that it builds correctly", () => {
|
||||
const projFs = loadProjectFromDisk("tests/projects/projectReferenceWithRootDirInParent");
|
||||
const allExpectedOutputs = [
|
||||
"/src/dist/other/other.js", "/src/dist/other/other.d.ts",
|
||||
"/src/dist/main/a.js", "/src/dist/main/a.d.ts",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export const x = 10;
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"files": ["index.ts"],
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export const x = 10;
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"files": ["index.ts"],
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
}
|
||||
}
|
10
tests/projects/containerOnlyReferenced/src/tsconfig.json
Normal file
10
tests/projects/containerOnlyReferenced/src/tsconfig.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"files": [],
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "./folder" },
|
||||
{ "path": "./folder2"}
|
||||
]
|
||||
}
|
1
tests/projects/containerOnlyReferenced/tests/index.ts
Normal file
1
tests/projects/containerOnlyReferenced/tests/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const x = 10;
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"files": ["index.ts"],
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../src" }
|
||||
]
|
||||
}
|
10
tests/projects/containerOnlyReferenced/tsconfig.json
Normal file
10
tests/projects/containerOnlyReferenced/tsconfig.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"files": [],
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "./src" },
|
||||
{ "path": "./tests"}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue