Skip to content

Commit

Permalink
Merge pull request #72 from invincibleJai/fix-comp-analyses-npm
Browse files Browse the repository at this point in the history
fix(npm-comp-analyses): fixes comp-analyses for npm, makes call only …
  • Loading branch information
Ravindra Singh Ratnawat authored Sep 14, 2018
2 parents 2753165 + c0c2bc4 commit 077b061
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cico_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function release() {

create_merge_PR_vscode

create_PR_RHChe
# create_PR_RHChe
}

function publish_tar() {
Expand Down
2 changes: 1 addition & 1 deletion src/collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as Xml2Object from 'xml2object';
import { Stream } from 'stream';

/* By default the collector is going to process these dependency keys */
const DefaultClasses = ["dependencies", "devDependencies", "optionalDependencies"];
const DefaultClasses = ["dependencies"];

/* String value with position */
interface IPositionedString {
Expand Down
17 changes: 11 additions & 6 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,18 @@ files.on(EventStream.Diagnostics, "^package\\.json$", (uri, name, contents) => {
connection.sendDiagnostics({uri: uri, diagnostics: diagnostics});
});
for (let dependency of deps) {
get_metadata('npm', dependency.name.value, dependency.version.value, (response) => {
if (response != null) {
let pipeline = new DiagnosticsPipeline(DiagnosticsEngines, dependency, config, diagnostics);
pipeline.run(response);
}
var regexVersion = new RegExp(/^[0-9]*[.][0-9]*[.][0-9]*[^.]$/);
if(dependency.name.value && regexVersion.test(dependency.version.value)) {
get_metadata('npm', dependency.name.value, dependency.version.value, (response) => {
if (response != null) {
let pipeline = new DiagnosticsPipeline(DiagnosticsEngines, dependency, config, diagnostics);
pipeline.run(response);
}
aggregator.aggregate(dependency);
});
} else {
aggregator.aggregate(dependency);
});
}
}
});
});
Expand Down

0 comments on commit 077b061

Please sign in to comment.