Skip to content

Commit 8d1c9d5

Browse files
committed
Addressing CR comments
1 parent 7e58afa commit 8d1c9d5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/harness/unittests/typingsInstaller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ namespace ts.projectSystem {
731731
checkNumberOfProjects(projectService, { configuredProjects: 1 });
732732
const p = projectService.configuredProjects[0];
733733
checkProjectActualFiles(p, [app.path]);
734+
checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules"]);
734735

735736
installer.installAll(/*expectedCount*/ 1);
736737

src/services/jsTyping.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ namespace ts.JsTyping {
218218
const fileNames = host.readDirectory(packagesFolderPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2);
219219
for (const fileName of fileNames) {
220220
const normalizedFileName = normalizePath(fileName);
221-
if (getBaseFileName(normalizedFileName) !== "package.json") {
221+
const baseFileName = getBaseFileName(normalizedFileName);
222+
if (baseFileName !== "package.json" && baseFileName !== "bower.json") {
222223
continue;
223224
}
224225
const result = readConfigFile(normalizedFileName, (path: string) => host.readFile(path));
@@ -230,7 +231,7 @@ namespace ts.JsTyping {
230231
// npm 3's package.json contains a "_requiredBy" field
231232
// we should include all the top level module names for npm 2, and only module names whose
232233
// "_requiredBy" field starts with "#" or equals "/" for npm 3.
233-
if (packageJson._requiredBy &&
234+
if (baseFileName === "package.json" && packageJson._requiredBy &&
234235
filter(packageJson._requiredBy, (r: string) => r[0] === "#" || r === "/").length === 0) {
235236
continue;
236237
}

0 commit comments

Comments
 (0)