Git Product home page Git Product logo

dependency-report's Introduction

dependency-report

Generate usage reports for JavaScript dependencies through an AST.

Note: only supports ES2015 import statements (not CommonJS require calls).

Install

yarn add @segment/dependency-report
# or
npm install @segment/dependency-report

CLI Usage

Input

$ dependency-report './client/**/*.js' --packages=evergreen-ui --exports=SideSheet

Results

[
  [
    {
      "name": "SideSheet",
      "files": 6,
      "filepaths": [
        "./client/components/Customers/Audiences/Audience/Overview/RunOverview/index.js",
        "./client/components/Customers/Destinations/View.js",
        "./client/components/Customers/DestinationSettings.js",
        "./client/components/Destinations/DestinationErrors/ErrorSheet.js",
        "./client/components/WorkspaceSettingsV2/DeletionRequests/RegulationSheet.js",
        "./client/containers/Navigation/UserDropdownApp.js"
      ]
    }
  ]
]

input

$ dependency-report './client/**/*.js' --packages=evergreen-ui --exports=SideSheet,Popover,CornerDialog,RadioGroup

Results

[
  [
    {
      "name": "SideSheet",
      "files": 6,
      "filepaths": [
        "./client/components/Customers/Audiences/Audience/Overview/RunOverview/index.js",
        "./client/components/Customers/Destinations/View.js",
        "./client/components/Customers/DestinationSettings.js",
        "./client/components/Destinations/DestinationErrors/ErrorSheet.js",
        "./client/components/WorkspaceSettingsV2/DeletionRequests/RegulationSheet.js",
        "./client/containers/Navigation/UserDropdownApp.js"
      ]
    },
    {
      "name": "Popover",
      "files": 2,
      "filepaths": [
        "./client/components/WorkspaceSettingsV2/SuppressedUsers/RemoveButton.js",
        "./client/containers/Navigation/UserDropdownApp.js"
      ]
    },
    {
      "name": "CornerDialog",
      "files": 4,
      "filepaths": [
        "./client/components/GDPRNotification.js",
        "./client/components/NewAgreementNotification.js",
        "./client/components/Sources/SourceDebugger/TestConnectionNotice.js",
        "./client/containers/Sources/SourceSchema/DataGovernanceFeedbackApp.js"
      ]
    },
    {
      "name": "RadioGroup",
      "files": 0,
      "filepaths": []
    }
  ]
]

Usage

const DependencyReport = require('@segment/dependency-report')

const report = new DependencyReport({
  files: '**/*.js'
})

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.