Skip to content

Commit

Permalink
Addressing CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jramsay committed Feb 16, 2017
1 parent 7e58afa commit 8d1c9d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/harness/unittests/typingsInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ namespace ts.projectSystem {
checkNumberOfProjects(projectService, { configuredProjects: 1 });
const p = projectService.configuredProjects[0];
checkProjectActualFiles(p, [app.path]);
checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules"]);

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

Expand Down
5 changes: 3 additions & 2 deletions src/services/jsTyping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ namespace ts.JsTyping {
const fileNames = host.readDirectory(packagesFolderPath, [".json"], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2);
for (const fileName of fileNames) {
const normalizedFileName = normalizePath(fileName);
if (getBaseFileName(normalizedFileName) !== "package.json") {
const baseFileName = getBaseFileName(normalizedFileName);
if (baseFileName !== "package.json" && baseFileName !== "bower.json") {
continue;
}
const result = readConfigFile(normalizedFileName, (path: string) => host.readFile(path));
Expand All @@ -230,7 +231,7 @@ namespace ts.JsTyping {
// npm 3's package.json contains a "_requiredBy" field
// we should include all the top level module names for npm 2, and only module names whose
// "_requiredBy" field starts with "#" or equals "/" for npm 3.
if (packageJson._requiredBy &&
if (baseFileName === "package.json" && packageJson._requiredBy &&
filter(packageJson._requiredBy, (r: string) => r[0] === "#" || r === "/").length === 0) {
continue;
}
Expand Down

0 comments on commit 8d1c9d5

Please sign in to comment.