Skip to content

Commit fadd862

Browse files
committed
Fix incorrect assert
1 parent e133b08 commit fadd862

File tree

3 files changed

+320
-2
lines changed

3 files changed

+320
-2
lines changed

src/compiler/watchPublic.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,6 @@ export function createWatchProgram<T extends BuilderProgram>(host: WatchCompiler
10881088
}
10891089

10901090
function updateExtendedConfigFilesWatches(forProjectPath: Path, options: CompilerOptions | undefined, watchOptions: WatchOptions | undefined, watchType: WatchTypeRegistry["ExtendedConfigFile"] | WatchTypeRegistry["ExtendedConfigOfReferencedProject"]) {
1091-
Debug.assert(configFileName);
10921091
updateSharedExtendedConfigFileWatcher(
10931092
forProjectPath,
10941093
options,
@@ -1104,7 +1103,7 @@ export function createWatchProgram<T extends BuilderProgram>(host: WatchCompiler
11041103
// If there are no referenced projects this extended config file watcher depend on ignore
11051104
if (!projects?.size) return;
11061105
projects.forEach(projectPath => {
1107-
if (toPath(configFileName) === projectPath) {
1106+
if (configFileName && toPath(configFileName) === projectPath) {
11081107
// If this is the config file of the project, reload completely
11091108
reloadLevel = ConfigFileProgramReloadLevel.Full;
11101109
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
Input::
2+
//// [/user/username/projects/project/tsconfig.json]
3+
{"compilerOptions":{"types":[]},"files":["app.ts"],"references":[{"path":"./lib"}]}
4+
5+
//// [/user/username/projects/project/app.ts]
6+
import { one } from './lib';
7+
console.log(one);
8+
9+
10+
//// [/user/username/projects/project/lib/tsconfig.json]
11+
{"compilerOptions":{"composite":true,"types":[]},"files":["index.ts"]}
12+
13+
//// [/user/username/projects/project/lib/tsconfig.base.json]
14+
{"compilerOptions":{"composite":true,"types":[]}}
15+
16+
//// [/user/username/projects/project/lib/index.ts]
17+
export const one = 1;
18+
19+
//// [/user/username/projects/project/lib/index.d.ts]
20+
export const one = 1;
21+
22+
//// [/a/lib/lib.d.ts]
23+
/// <reference no-default-lib="true"/>
24+
interface Boolean {}
25+
interface Function {}
26+
interface CallableFunction {}
27+
interface NewableFunction {}
28+
interface IArguments {}
29+
interface Number { toExponential: any; }
30+
interface Object {}
31+
interface RegExp {}
32+
interface String { charAt: any; }
33+
interface Array<T> { length: number; [n: number]: T; }
34+
interface ReadonlyArray<T> {}
35+
declare const console: { log(msg: any): void; };
36+
37+
38+
/a/lib/tsc.js --w -p . --extendedDiagnostics
39+
Output::
40+
[12:00:31 AM] Starting compilation in watch mode...
41+
42+
Current directory: / CaseSensitiveFileNames: false
43+
Synchronizing program
44+
CreatingProgramWith::
45+
roots: ["/user/username/projects/project/app.ts"]
46+
options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
47+
projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}]
48+
Loading config file: /user/username/projects/project/lib/tsconfig.json
49+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project
50+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/app.ts 250 undefined Source file
51+
DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations
52+
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations
53+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/index.d.ts 250 undefined Source file
54+
FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 undefined Source file
55+
DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations
56+
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations
57+
[12:00:34 AM] Found 0 errors. Watching for file changes.
58+
59+
60+
61+
Program root files: ["/user/username/projects/project/app.ts"]
62+
Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
63+
Program structureReused: Not
64+
Program files::
65+
/a/lib/lib.d.ts
66+
/user/username/projects/project/lib/index.d.ts
67+
/user/username/projects/project/app.ts
68+
69+
Semantic diagnostics in builder refreshed for::
70+
/a/lib/lib.d.ts
71+
/user/username/projects/project/lib/index.d.ts
72+
/user/username/projects/project/app.ts
73+
74+
Shape signatures in builder refreshed for::
75+
/a/lib/lib.d.ts (used version)
76+
/user/username/projects/project/lib/index.d.ts (used version)
77+
/user/username/projects/project/app.ts (used version)
78+
79+
FsWatches::
80+
/user/username/projects/project/lib/tsconfig.json: *new*
81+
{}
82+
/user/username/projects/project/app.ts: *new*
83+
{}
84+
/user/username/projects/project/lib/index.d.ts: *new*
85+
{}
86+
/a/lib/lib.d.ts: *new*
87+
{}
88+
89+
FsWatchesRecursive::
90+
/user: *new*
91+
{}
92+
93+
exitCode:: ExitStatus.undefined
94+
95+
//// [/user/username/projects/project/app.js]
96+
"use strict";
97+
Object.defineProperty(exports, "__esModule", { value: true });
98+
var lib_1 = require("./lib");
99+
console.log(lib_1.one);
100+
101+
102+
103+
Change:: Modify lib tsconfig
104+
105+
Input::
106+
//// [/user/username/projects/project/lib/tsconfig.json]
107+
{"compilerOptions":{"composite":true},"files":["index.ts"]}
108+
109+
110+
Output::
111+
FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project
112+
Scheduling update
113+
Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project
114+
Synchronizing program
115+
Loading config file: /user/username/projects/project/lib/tsconfig.json
116+
[12:00:38 AM] File change detected. Starting incremental compilation...
117+
118+
CreatingProgramWith::
119+
roots: ["/user/username/projects/project/app.ts"]
120+
options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
121+
projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}]
122+
[12:00:39 AM] Found 0 errors. Watching for file changes.
123+
124+
125+
126+
Program root files: ["/user/username/projects/project/app.ts"]
127+
Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
128+
Program structureReused: Not
129+
Program files::
130+
/a/lib/lib.d.ts
131+
/user/username/projects/project/lib/index.d.ts
132+
/user/username/projects/project/app.ts
133+
134+
Semantic diagnostics in builder refreshed for::
135+
136+
No shapes updated in the builder::
137+
138+
exitCode:: ExitStatus.undefined
139+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
Input::
2+
//// [/user/username/projects/project/tsconfig.json]
3+
{"compilerOptions":{"types":[]},"files":["app.ts"],"references":[{"path":"./lib"}]}
4+
5+
//// [/user/username/projects/project/app.ts]
6+
import { one } from './lib';
7+
console.log(one);
8+
9+
10+
//// [/user/username/projects/project/lib/tsconfig.json]
11+
{"extends":"./tsconfig.base.json","files":["index.ts"]}
12+
13+
//// [/user/username/projects/project/lib/tsconfig.base.json]
14+
{"compilerOptions":{"composite":true,"types":[]}}
15+
16+
//// [/user/username/projects/project/lib/index.ts]
17+
export const one = 1;
18+
19+
//// [/user/username/projects/project/lib/index.d.ts]
20+
export const one = 1;
21+
22+
//// [/a/lib/lib.d.ts]
23+
/// <reference no-default-lib="true"/>
24+
interface Boolean {}
25+
interface Function {}
26+
interface CallableFunction {}
27+
interface NewableFunction {}
28+
interface IArguments {}
29+
interface Number { toExponential: any; }
30+
interface Object {}
31+
interface RegExp {}
32+
interface String { charAt: any; }
33+
interface Array<T> { length: number; [n: number]: T; }
34+
interface ReadonlyArray<T> {}
35+
declare const console: { log(msg: any): void; };
36+
37+
38+
/a/lib/tsc.js --w -p . --extendedDiagnostics
39+
Output::
40+
[12:00:31 AM] Starting compilation in watch mode...
41+
42+
Current directory: / CaseSensitiveFileNames: false
43+
Synchronizing program
44+
CreatingProgramWith::
45+
roots: ["/user/username/projects/project/app.ts"]
46+
options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
47+
projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}]
48+
Loading config file: /user/username/projects/project/lib/tsconfig.json
49+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project
50+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/tsconfig.base.json 2000 undefined Extended config file of referenced project
51+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/app.ts 250 undefined Source file
52+
DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations
53+
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations
54+
FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/index.d.ts 250 undefined Source file
55+
FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 undefined Source file
56+
DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations
57+
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations
58+
[12:00:34 AM] Found 0 errors. Watching for file changes.
59+
60+
61+
62+
Program root files: ["/user/username/projects/project/app.ts"]
63+
Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
64+
Program structureReused: Not
65+
Program files::
66+
/a/lib/lib.d.ts
67+
/user/username/projects/project/lib/index.d.ts
68+
/user/username/projects/project/app.ts
69+
70+
Semantic diagnostics in builder refreshed for::
71+
/a/lib/lib.d.ts
72+
/user/username/projects/project/lib/index.d.ts
73+
/user/username/projects/project/app.ts
74+
75+
Shape signatures in builder refreshed for::
76+
/a/lib/lib.d.ts (used version)
77+
/user/username/projects/project/lib/index.d.ts (used version)
78+
/user/username/projects/project/app.ts (used version)
79+
80+
FsWatches::
81+
/user/username/projects/project/lib/tsconfig.json: *new*
82+
{}
83+
/user/username/projects/project/lib/tsconfig.base.json: *new*
84+
{}
85+
/user/username/projects/project/app.ts: *new*
86+
{}
87+
/user/username/projects/project/lib/index.d.ts: *new*
88+
{}
89+
/a/lib/lib.d.ts: *new*
90+
{}
91+
92+
FsWatchesRecursive::
93+
/user: *new*
94+
{}
95+
96+
exitCode:: ExitStatus.undefined
97+
98+
//// [/user/username/projects/project/app.js]
99+
"use strict";
100+
Object.defineProperty(exports, "__esModule", { value: true });
101+
var lib_1 = require("./lib");
102+
console.log(lib_1.one);
103+
104+
105+
106+
Change:: Modify lib tsconfig
107+
108+
Input::
109+
//// [/user/username/projects/project/lib/tsconfig.json]
110+
{"extends":"./tsconfig.base.json","compilerOptions":{"typeRoots":[]},"files":["index.ts"]}
111+
112+
113+
Output::
114+
FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project
115+
Scheduling update
116+
Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project
117+
Synchronizing program
118+
Loading config file: /user/username/projects/project/lib/tsconfig.json
119+
[12:00:38 AM] File change detected. Starting incremental compilation...
120+
121+
CreatingProgramWith::
122+
roots: ["/user/username/projects/project/app.ts"]
123+
options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
124+
projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}]
125+
[12:00:39 AM] Found 0 errors. Watching for file changes.
126+
127+
128+
129+
Program root files: ["/user/username/projects/project/app.ts"]
130+
Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
131+
Program structureReused: Not
132+
Program files::
133+
/a/lib/lib.d.ts
134+
/user/username/projects/project/lib/index.d.ts
135+
/user/username/projects/project/app.ts
136+
137+
Semantic diagnostics in builder refreshed for::
138+
139+
No shapes updated in the builder::
140+
141+
exitCode:: ExitStatus.undefined
142+
143+
144+
Change:: Modify lib extends
145+
146+
Input::
147+
//// [/user/username/projects/project/lib/tsconfig.base.json]
148+
{"compilerOptions":{"composite":true}}
149+
150+
151+
Output::
152+
FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.base.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.base.json 2000 undefined Extended config file of referenced project
153+
Scheduling update
154+
Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.base.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.base.json 2000 undefined Extended config file of referenced project
155+
Synchronizing program
156+
Loading config file: /user/username/projects/project/lib/tsconfig.json
157+
[12:00:43 AM] File change detected. Starting incremental compilation...
158+
159+
CreatingProgramWith::
160+
roots: ["/user/username/projects/project/app.ts"]
161+
options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
162+
projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}]
163+
[12:00:44 AM] Found 0 errors. Watching for file changes.
164+
165+
166+
167+
Program root files: ["/user/username/projects/project/app.ts"]
168+
Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"}
169+
Program structureReused: Not
170+
Program files::
171+
/a/lib/lib.d.ts
172+
/user/username/projects/project/lib/index.d.ts
173+
/user/username/projects/project/app.ts
174+
175+
Semantic diagnostics in builder refreshed for::
176+
177+
No shapes updated in the builder::
178+
179+
exitCode:: ExitStatus.undefined
180+

0 commit comments

Comments
 (0)