MIT License

项目介绍

CryogenicPlanet/depp 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 264 个 Star、4 次 Fork。

仓库全名
CryogenicPlanet/depp
开源许可证
MIT License
Star 数
264
Fork 数
4
未关闭 Issue
2

README 摘要

Installation Usage Just run depp in your project folder and it will do the rest. Keep in mind it will likely fail without setting some externals Note if you want it to work with JS please use -j or --js by default it will do only .ts|.tsx files All options Example Advanced usage This is an example of advanced usage of the script with externals and ignore-namespace Configuration You can save your depp config and not…

完整内容见 GitHub 原始 README 或本页 。

常见问题

depp 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 264 个 Star。

depp 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 depp 的源码?

可以直接克隆仓库:git clone https://github.com/CryogenicPlanet/depp.git,默认分支为 master;安装与运行步骤见仓库 README。

depp 最近还在维护吗?

仓库最近一次更新为 2022年5月27日,当前有 2 个未关闭 Issue;Star 数为 264,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

⚡ Check your npm modules for unused and duplicate dependencies fast

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
274
价值分
159
活跃状态
活跃

语言占比

Go
HTML
TypeScript

Release

README

Depp - A fast unused and duplicate package checker Go Reference

Installation

## NPM
npm install -g depp-installer 
# (will try to get npm install -g depp later)

## Go
go install github.com/cryogenicplanet/depp@latest

Usage

Just run depp in your project folder and it will do the rest. Keep in mind it will likely fail without setting some externals

Note if you want it to work with JS please use -j or --js by default it will do only .ts|.tsx files

All options

➜ depp --help  
NAME:
   depp - Find un used packages fast

USAGE:
   depp [global options] command [command options] [arguments...]

COMMANDS:
   clean      Cleans all output files
   show       Shows previous report
   deploy, d  Automatically deploy your report to netlify
   config     A command to handle config
   init       Initialize project
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --dev, -d                              Enable dev dependencies (default: false)
   --js, -j                               Enable js source files (default: false)
   --path value, -p value                 Overwrite root directory
   --log, -l                              Will write logs to .depcheck.log (default: false)
   --source value, -s value               Overwrite default sources
   --report, -r                           Generate report file (default: false)
   --show-versions, -v                    Show conflicting versions (default: false)
   --write-output-files, -w               This will write the esbuild output files. (default: false)
   --externals value, -e value            Pass custom externals using this flag
   --ignore-namespaces value, --in value  Pass namespace (@monorepo) to be ignored
   --no-open, --no                        Flag to prevent auto opening report in browser (default: false)
   --save-config, --sc                    Flag to automatically save config from other flags (default: false)
   --ci                                   Run in github actions ci mode (default: false)
   --deploy value                         Will automatically deploy report to netlify
   --help, -h                             show help (default: false)

Example Advanced usage

This is an example of advanced usage of the script with externals and ignore-namespace

depp -v -j -e mobx -e magic-sdk -e domain -e @daybrush/utils -e yjs -e constants -e ws  -e perf_hooks -in @editor -in @server   --report

Configuration

You can save your depp config and not have to run it with flags every time, the config is saved in .depp/config.json but can be created from the cli

# Initialize config
depp init 

➜ depp --help                                                
NAME:
   depp - Find un used packages fast

USAGE:
   depp [global options] command [command options] [arguments...]

COMMANDS:
   clean      Cleans all output files
   show       Shows previous report
   deploy, d  Automatically deploy your report to netlify
   config     A command to handle config
   init       Initialize project
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --dev, -d                              Enable dev dependencies (default: false)
   --js, -j                               Enable js source files (default: false)
   --path value, -p value                 Overwrite root directory
   --log, -l                              Will write logs to .depcheck.log (default: false)
   --source value, -s value               Overwrite default sources
   --report, -r                           Generate report file (default: false)
   --show-versions, -v                    Show conflicting versions (default: false)
   --write-output-files, -w               This will write the esbuild output files. (default: false)
   --externals value, -e value            Pass custom externals using this flag
   --ignore-namespaces value, --in value  Pass namespace (@monorepo) to be ignored
   --no-open, --no                        Flag to prevent auto opening report in browser (default: false)
   --save-config, --sc                    Flag to automatically save config from other flags (default: false)
   --ci                                   Run in github actions ci mode (default: false)
   --deploy value                         Will automatically deploy report to netlify
   --browser                              Will use esbuild browser platform (by default it uses node platform) (default: false)
   --ignore-path value, --ip value        A glob pattern of files to be ignored

CI

Currently only supports Github actions out of the box.

In mode, depp will automatically comment on the PR with its report. It will look like this

It can also deploy the report to netlify but requires a NETLIFY_TOKEN which you can get here

name: Dependency CI

on:
  pull_request:


jobs:
  release-go:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.17
      - name: Install Depp 
        run: go install github.com/cryogenicplanet/depp@latest
      - name: Run Depp
        run: depp --ci
        env:
            # NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}}
            # Optional if you want report urls or not
            # You can get a netlify pat here https://app.netlify.com/user/applications#personal-access-tokens

Example Outputs

  1. Markdown
  2. Html

Why use this

  1. It is using esbuild and go so it is quite a bit faster than most other tools
  2. Most tools that I could find at least, didn’t not support monorepos. This does and is built for monorepos

Caveats

This is not been extensively tested and might have some short comings, it may not identify every unused package but will definitely do a decent first pass

Acknowledgement

Credits to @zack_overflow for the amazing cover photo

This is built upon the excellent work down by @evanw on esbuild and uses esbuild under the hood

评论

暂无评论