pranavraaghav / verne

CLI Tool that validates dependency satisfaction accross multiple Github repositories and optionally updates them if necessary.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open in Visual Studio Code

LinkedIn


Logo

Verne

CLI Tool that validates dependency satisfaction accross multiple Github repositories and optionally updates them if necessary.
Built within 48 hours for Dyte's SDE Tooling Internship Task.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contact

About The Project

Product Name Screen Shot Product Name Screen Shot

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • npm
    npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://github.com/dyte-submissions/dyte-vit-2022-pranavraagz
    cd dyte-vit-2022-pranavraagz
  2. Install NPM packages
    npm install
  3. Build the cli
    npm run build
  4. Install it globally on your system (might require superuser)
    sudo npm install -g .

(back to top)

Usage

Input format

$ verne <input>         <input> must be of form <name>@<version-number>

Options (flags)

Options
--file, -i            Describe location of CSV (REQUIRED)
--update, -u          Update dependancies 
--clear               Clear logged in GitHub user 
--version             View version 
--help                View help

Examples

Check if axios@0.23.0 is satisfied by all repos in input.csv

verne -i input.csv axios@0.23.0

Check if axios@0.23.0 is satisfied by all repos in input.csv AND update if not satisfied

verne -u -i input.csv axios@0.23.0

NOTE:

  • Updates will not be made when version is satisfied.
  • Updates cannot be made on repositories with a pre-existing un-merged update PR made by the CLI. (attempting to doing so might crash the app)
  • Major changes are not updated automatically (this is an intended feature) and will have to be done manually on a repo-by-repo basis due to its breaking nature.

Force a login attempt

verne --clear -i input.csv axios@0.23.0

Sample CSV files:

From problem statement

name,repo
dyte-react-sample-app,https://github.com/dyte-in/react-sample-app/
dyte-js-sample-app,https://github.com/dyte-in/javascript-sample-app
dyte-sample-app-backend,https://github.com/dyte-in/backend-sample-app

Testing dependency update on repo not owned by you

name,repo
reddit-backend-clone,https://github.com/pranavraagz/reddit-backend-clone

NOTE: For the above, consider running with dependency bcrypt@5.0.5 (anything higher than 5.0.1)

Caveats (do not skip)

In case you have already made a PR on a repo you do not own using this tool, then attempting to make another (using --update) one might crash the tool during runtime due to an unhandled edge case. To overcome this, you could go to your Github profile and delete the forked repository (which in turn should delete the PR) and then try again.
Likewise on repos that you own, you might have to delete the newly created branch (which in turn should delete the PR) in order to be able to run the tool (using --update) on it again.

The current version of the CLI does not update the .lock file in the repo (this is a required functionality) but will be addressed in a future update.

(back to top)

Features

  • Check for dependency satisfaction in public & private repos
  • Update dependencies
    • In repos owned by user
    • In repos not owned by user (private repos will require the account to have prior access)
  • Github login
  • Credential caching
  • Read & Write CSV
  • Prevent updating dependency on major changes (breaking changes)

Roadmap

  • Update the .lock file's dependencies as well
  • Allow creation of multiple PRs on same repo for different dependencies
  • Handle cases where a package.json isn't present at all
  • Unit tests
  • Run as a Github Action
  • Tables with column word wrap to fit data in smaller terminal windows
  • Empathetic CLI interactions (ask for input if not provided instead of exiting)
  • Colorful CLI (for easy distinguishability)
  • Config cleanup upon uninstall

(back to top)

Contact

Pranav Raaghav - pranavraagz@gmail.com

Project Link: https://github.com/dyte-submissions/dyte-vit-2022-pranavraagz

(back to top)

About

CLI Tool that validates dependency satisfaction accross multiple Github repositories and optionally updates them if necessary.

License:MIT License


Languages

Language:TypeScript 74.9%Language:JavaScript 25.1%