smontanari / code-forensics

A toolset for code analysis and report visualisation
384 stars 45 forks source link

node_modules and gulpfile.js #14

Closed jdevoo closed 6 years ago

jdevoo commented 6 years ago

I saw the comment on the landing page about not installing code-forensics globally with npm so I end up with node_modules in the home directory. But I noticed in the webserver script that lib references node_modules relatively. I would prefer to use code-forensics from a docker image where I separate the project under study along with its gulpfile.js, output, tmp and repo into a separate directory. I tried with --gulpfile but that doesn't help. Any chance the /lib can be be mapped to the node_modules in the home of the user?

smontanari commented 6 years ago

The main reason I discourage to install code-forensics as a global module is because of potential conflicts with other libraries installed globally. I assume that wouldn't be the case in a custom setup container. Having said that I think it should be fairly simple to have the webserver.js script being smarter about finding the node_modules directory it is installed into, there are plenty of modules that do that already. I will spike something quickly

smontanari commented 6 years ago

As of release 0.15.1 the webserver.js script resolves the path of node_modules in the chain of its ancestors; that should allow more flexibility around where the code-forensics module and its dependencies are actually installed. I didn't have time to test this on a docker container, but maybe this can solve your problem

jdevoo commented 6 years ago

This is cool Silvio! I am now able to spin up the docker image through a small batch on Windows wherever I find a gulpfile. I pasted the script and the Dockerfile in this gist for reference.