0.3.1 • Published 2 months ago

dependency-drift-tracker v0.3.1

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 months ago

Dependency drift tracker

Track your NPM dependencies drift across multiple git repositories using libyear. It store the result on flat files and display the drift over time via a webpage.

Usage

Using the GitHub Action

The dependency-drift-tracker GitHub action is the easiest way to use track your dependencies drift over time. It runs every day and update the data files. To get started, head over to the dependency-drift-status repository and click on Use this template button on the top right corner. Then enter a repository name and click on Create repository.

The next step is to enable GitHub Pages for your repository:

  1. Go to your repository Settings page
  2. Go to the Pages sub-section on the left
  3. Under Source, select Deploy from a branch
  4. In the Branch dropdown, select gh-pages and / (root)
  5. Click on Save

And then you edit the repositories.txt file to add the git repositories you want to to track, one per line. See the configuration section for more details on it.

Once finished, you can trigger an initial run of the action:

  1. Go to your repository Actions page
  2. Click on Update libyear info on the left
  3. In the message banner This workflow has a workflow_dispatch event trigger., click on Run workflow and in the dropdown click on "Run workflow" with the branch main.
  4. After a few minutes, your data files should be up to date

Standalone

The standalone version is not tied to GitHub action and do not require a git repository to store the data files.

Create an empty directory with a data directory.

mkdir --parents repository-drift/data
cd repository-drift

And create a repositories.txt file with one git repository per line. See the configuration option to learn more on it.

Then run:

npx dependency-drift-tracker

It will create or update json files in the data directory. You can then initialize a git repositories to keep track of the changes.

Configuration

The repositories.txt file contains the git repositories you want to track. Put one repository per line with the full URL to access it.

https://github.com/Dependency-Drift-Tracker/dependency-drift-tracker
https://github.com/Dependency-Drift-Tracker/dependency-drift-tracker-action

If your package.json is in a subdirectory, you can use the # to specify the path:

https://github.com/Dependency-Drift-Tracker/dependency-drift-tracker-action#path/to/dir

Private repositories

It's possible to clone private repositories or to hide parts of the repository using environments variables. For example with an environment variable named ACCESS_TOKEN, the following repository line could be updated https://$ACCESS_TOKEN@github.com/Dependency-Drift-Tracker/dependency-drift-tracker-action.

Development

Run tests

npm test

License

GNU GPL 3

0.3.0

2 months ago

0.3.1

2 months ago

0.2.0

4 months ago

0.1.0

6 months ago