Git Product home page Git Product logo

depcheck-safe's Introduction

depcheck-safe

Like depcheck but checks if removing the packages will cause the build to break, rolling back if so.

This (will be) an npm package which uses depcheck to determine which dependencies are not needed, then goes through those dependencies and removes them one by one. If removing one causes the build or tests to break, it will be rolled back, and another package will be removed until all reported unused dependencies have been processed. While not perfect, it reduces the number of false positives which can be manually reviewed.

I have to have this now I can't wait

Run:

npm -g install depcheck

depcheck > depcheck.txt

Remove all asterixis and headings in the depcheck.txt file. Place in root folder of nodejs project.

There is a proof of concept called depcheck-safe.bat which can be placed in the root of the nodejs project, and then run using command prompt. Warning: it will overwrite the package.json file, so make a backup first, and ensure that no modules have been installed using -g to get best results.

It will systematically build, test, lint, and e2e test the project. If any step fails, it will re-install the previously removed package, and go to the next one. When finished, package.json won't have any packages that were flagged by depcheck, removed, and passed all tests and builds.

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.