Git Product home page Git Product logo

components-stats's Introduction

@jimdo/components-stats

npm package Build Status Downloads Issues Commitizen Friendly Semantic Release

Collect usage statistics for any npm package exposing React UI components, across a GitHub organization. Inspired by Twilio.com blogpost.

Purpose

The aim is to provide better understanding of Design System or other shared UI libraries usage across the organization. This tool will facilitate things such as: deprecation of unused components and props, detection of misuse, set-up of alerts.

Compiling & Running Locally

Create a config.js file based on config.example.

A GitHub personal access token with scope repo is required, to access the org private repositories through GitHub APIs.

Usage for pkgName will be analyzed across org, excluding repositories that did not receive any commit in the last daysUntilStale days. Be patient, this will take some time.

The list of repositories having pkgName as dependency is collected through the package-adoption npm module.

Omit components to report all components.

โš ๏ธ The script will clone all the eligible repositories locally and use them as source for react-scanner. If a repository already exists locally, it will update it with a git pull.

# Install dependencies using npm
$ > npm i

# Start
$ > npm start

Results

The script outputs:

  • a pkgAdoption.json file with the list of repositories that include pkgName as a dependency.

  • a reports_by_repo folder with one scanner-report_[repo_name_subdir].json file for each repository. Each file is a report with the usage of React components exposed by the pkgName library. react-scanner is used to produce the report.

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.