dyatko / arkit

JavaScript architecture diagrams and dependency graphs

Home Page:https://arkit.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to show dependencies of npm packages required in project via dependency graph

daniyaldev2k20 opened this issue · comments

I am unable to generate dependencies of npm packages like express, mongoose, etc in the dependency graph. I tried advanced arkit.json config, initially I ran npx arkit -c with arkit.json as below
{ "$schema": "https://arkit.pro/schema.json", "excludePatterns": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"], "components": [ { "type": "Dependency", "patterns": ["node_modules/*"] }, { "type": "Component", "patterns": ["**/*.js", "**/*.jsx"] } ], "output": [ { "path": "arkit.svg", "groups": [ { "first": true, "components": ["Component"] }, { "type": "Dependencies", "components": ["Dependency"] } ] } ] }
With this JSON, I am not getting dependencies like Arkit or Vue/Nuxt TodoMVC in arkit examples, furthermore selecting only node_modules and omitting components in arkit.json, I am getting this huge graph

I also looked over Arkit or Vue/Nuxt TodoMVC but was unable to find arkit.json which could solve my problem, issue # 28 wrt user "karevn" occurs when I tried to alter arkit.json like this
{ "type": "Dependency", "patterns": ["node_modules/*"] },

I tried to alter arkit.json like this
{ "$schema": "https://arkit.pro/schema.json", "excludePatterns": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"], "components": [ { "type": "Dependency", "patterns": ["package.json['dependencies']"] }, { "type": "Component", "patterns": ["**/*.js", "**/*.jsx"] } ], "output": [ { "path": "arkit.svg", "groups": [ { "first": true, "components": ["Component"] }, { "type": "Dependencies", "components": ["Dependency"] } ] } ] }

But it doesn't work and I only need the main dependencies in package.json not all of them in node_modules file, this is very crucial as I have a project dependent on this, the rest of the architecture is visualized without any problems but npm dependencies is an issue

Operating system is Windows 10

Node.js version is 12.16.1