Giter Club home page Giter Club logo

codewithsaar.extensions.projectassets's Introduction

Welcome to project Assets

Overview

This is an initiative to visualize NuGet package dependencies in a given project. The side effect of this project is a library of ProjectAssets.Core.

Get started

  • Clone the repo

  • Go to CLI folder

cd src/ProjectAssets.CLI
  • Run
dotnet run -- -i obj

This generates the package reference mermaid chart at data/output.mmd.

  • Visual

    • Copy & paste the text in data/output.mmd to any mermaid visualizer. For example: https://mermaid.live

      • If the mermaid file becomes too big to render, use the configuration tab to increase the default settings: A screenshot shows where to set the configurations.
    • There are VSCode extensions to render *.mmd files in the editor too.

You could choose to use the artifacts in releases.

Trim down to specific package

Chances are, that not all packages are interested. You can specify a target package for analysis. For example:

dotnet run -- -i obj -t "Microsoft.Extensions.Configuration"

You will get:

stateDiagram-v2
net6.0 --> 📦Microsoft.Extensions.Configuration.Json/6.0.0
📦Microsoft.Extensions.Configuration.Json/6.0.0 --> 📦Microsoft.Extensions.Configuration.FileExtensions/6.0.0
📦Microsoft.Extensions.Configuration.FileExtensions/6.0.0 --> 📦Microsoft.Extensions.Configuration/6.0.0
📦Microsoft.Extensions.Configuration.Json/6.0.0 --> 📦Microsoft.Extensions.Configuration/6.0.0
net6.0 --> 📦Microsoft.Extensions.Logging.Console/6.0.0
📦Microsoft.Extensions.Logging.Console/6.0.0 --> 📦Microsoft.Extensions.Logging.Configuration/6.0.0
📦Microsoft.Extensions.Logging.Configuration/6.0.0 --> 📦Microsoft.Extensions.Configuration/6.0.0
📦Microsoft.Extensions.Configuration/6.0.0 --> 📦Microsoft.Extensions.Configuration.Abstractions/6.0.0
📦Microsoft.Extensions.Configuration.Abstractions/6.0.0 --> 📦Microsoft.Extensions.Primitives/6.0.0
📦Microsoft.Extensions.Primitives/6.0.0 --> 📦System.Runtime.CompilerServices.Unsafe/6.0.0
📦System.Runtime.CompilerServices.Unsafe/6.0.0 --> [*]
📦Microsoft.Extensions.Configuration/6.0.0 --> 📦Microsoft.Extensions.Primitives/6.0.0

Further: upstream or downstream of a given package

dotnet run -- -i obj -t "Microsoft.Extensions.Configuration" -d Up

And get:

stateDiagram-v2
net6.0 --> 📦Microsoft.Extensions.Configuration.Json/6.0.0
📦Microsoft.Extensions.Configuration.Json/6.0.0 --> 📦Microsoft.Extensions.Configuration.FileExtensions/6.0.0
📦Microsoft.Extensions.Configuration.FileExtensions/6.0.0 --> 📦Microsoft.Extensions.Configuration/6.0.0
📦Microsoft.Extensions.Configuration.Json/6.0.0 --> 📦Microsoft.Extensions.Configuration/6.0.0
net6.0 --> 📦Microsoft.Extensions.Logging.Console/6.0.0
📦Microsoft.Extensions.Logging.Console/6.0.0 --> 📦Microsoft.Extensions.Logging.Configuration/6.0.0
📦Microsoft.Extensions.Logging.Configuration/6.0.0 --> 📦Microsoft.Extensions.Configuration/6.0.0

Use the docker image CLI

Docker image CLI is supported. A quick use:

  • Pull the image
docker pull saars/ast-cli

The container looks for input files in /data. So for example, if you have a project.assets.json defined on your system in c:\src\project\obj, you can use the container to generate a Mermaid(mmd) file as follows:

docker run -it -v c:\src\project\obj:/data saars/ast-cli

This will map c:\src\project\obj into /data in the container. And you will find the output file at:

c:\src\project\obj\output.mmd

More

For more use, invoke the cli with -h.

When running with source code, you need -- as a separator for dotnet cli:

dotnet -- -h

For docker image:

docker run -it saars/ast-cli -h

Credit

This project is inspired and helped by:

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.