Giter Club home page Giter Club logo

vscode-dependency-cruiser's Introduction

Dependency Cruiser Extension

Check dependencies for any files quick and easy.

Dependency Report Example

Features

Pick any file, and run View Dependencies from the command palette. The extension will generate a Dependency Report and open that in a web View.

View Dependencies Command

You Can also run the report from the content menu on any files:

View Dependencies Context Menu

Finally, you can click on each node, to open the file!

Configuration options:

The extension supports configuration for generating the diagram:

  • exclude: Define a regex to exclude dependencies for being listed. Defaults to node_modules/
  • maxDepth: Define the maximun depth the cruiser will go into dependencies.
  • layout: Define the layout the diagram will use to display the tree. Defaults to directed
  • prefix: Prefix to add to each node URL. For example, you can use this to alllow opening the file in github.
  • moduleSystems: Define the module systems to be used. Supported: ['amd', 'cjs', 'es6', 'tsd']. Defaults to ["amd", "cjs", "es6"]
  • tsConfig: Specify the path for the typescript configuration file. Defaults to tsconfig.json
  • webpackConfig: Specify the path for the webpack configuration file. Defaults to webpack.config.js
  • outputType: The output type will specify the tree be generated. Allowed options are top, folder and node. Defaults to node

Exclude Options

Use exclude to optimize the diagram you want to build.

  • To include all the dependencies, just specify an empty string. WARNING: Consider adding maxDepth in the case where node_modules is not excluded to avoid vs code to freeze.

Layout Options

There are 7 layout options supported:

  • directed: raws directed graphs (dot).
  • undirected: draws undirected graphs using a ``spring'' model (neato).
  • undirectedCompressed: draws undirected graphs (fdp).
  • clustered: draws clustered graphs (osage).
  • circular: draws distributed circular layout around connected nodes (circo).
  • radial: draws graphs using a radial layout (twopi).
  • treemap: draws the graph as a squarified treemap (patchwork).
  • themes: Specify a theme for the graph.

For more detailed information check the graphviz manual. You can also check graphviz man pages.

OutputType Options

  • top will provide a high level dependencies overview
  • folder is similar to archi but will report sublevel folders
  • node is the default output reporter. It will generate a report based on leafs.

Webpack options

The webpackConfig configuration allows multiple options to be included. For example, you can specify environment variables and send arguments to webpack:

"options": {
  "webpackConfig": {
    "fileName": "webpack.config.js",
    "env": { "production": true },
    "arguments": { "mode": "production" }
  }
}

Theme options

You can specify different types of themes.

  • basic: default theme UI
  • simple: bare bones UI
  • blueprint: blueprint style
  • flat: flat UI style
  • custom: Specify your own custom style. When specifying custom, you will also need to provide the customTheme configuration with it. Learn more about configurations on the Graphviz docs.

Requirements

The extension needs at least Node.js 10.x to run.

Known Issues

  • node_modules folder is currently excluded by default so no dependencies on external libraries will be listed. It is planned for 1.0.0
  • webpack configuration is not supported yet. It is planned for 1.0.0

Any other Known issue? We would really appreciate if you can open a issue.

Release Notes

0.0.1

  • Generate a dependencies report from the command palette or from the context menu
  • Open a dependency by clicking on the node from the report.

vscode-dependency-cruiser's People

Contributors

juanallo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-dependency-cruiser's Issues

Show a reverse dependency map

It'd be useful to be able to visualize what files depend on the current file. I've been looking through dependency cruiser's docs but it's not immediately clear to me yet how to go about that. If I figure it out I'll submit a PR.

just a recommendation

Its not an issue, but i wwould love to be able to export at least a JPEG from the dependenciy-view its generated. :)

How it is compared to depcheck?

AFAIK depcheck by far is the most comprehensive tool for analyzing dependency tree, does this extension only detect js files? Would be great to describe it in readme. I have had the idea for depcheck extension some time ago…

Respect Babel/TS/Webpack/whatever base paths, aliases and externals

I've configured my tsconfig.json with a baseUrl set to ./app/javascript. So I write import { foo } from 'utility' and it imports from ./app/javascript/utility. Dependency Cruiser, however, sees utility as a top-level import and shows me a graph like this:

Ekran Resmi 2020-09-07 ÖS 5 37 34

It would be really great to see Dependency Cruiser follow Babel/TS/Webpack/whatever's config for base paths and show imports like utility coming from the right place. Here's a non-exhaustive list of details that would need to be addressed:

Perhaps the easiest way to handle the myriad cases is to simply create baseUrl, paths and externals settings in the plugin's config and allow users to manually specify the base path, aliases and any external module declarations.

One last consideration: if you let users declare the base path, they will probably need to give an absolute path since VS Code could be launched from whatever pwd. Not sure whether there's a way around that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.