npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tracker-json

v1.2.0

Published

Generate tracker.json with ease

Downloads

8

Readme

tracker-json

Easily generate a tracker.json file for your Home Assistant custom cards on new releases

npm version

Installation

Either install tracker-json globally npm i -g tracker-json or locally in your cards project (npm i --save-dev tracker-json). The command tracker-json then either gets installed in your system or in your project

Configuration

You configure tracker-json in your custom cards source repo, in its package.json file. If my custom card project is called awesome-card I could configure it like so:

{
  "tracker-json": {
    "awesome-card": {
      "repo": "nervetattoo/awesome-card",
      "resolve": "gh:release"
    }
  }
}

Now, when you run tracker-json it will generate github repo specific URLs, get the version off of the one in package.json and set the cards update date to today. You can specify multiple keys in the configuration to create different variations of your custom card.

Supported configuration parameters

| Option | Default | Description | | --- | --- | --- | | repo | package.json repo field | A repo slug like github-user/repo-name | | file | package.json file field | The filename to link to inside the repo | | resolve | gh:repo | Strategy for file locations are resolution |

Resolvers

  • gh:repo
    • Uses the commit log up until the release tag as changelog
    • Uses the raw.githubusercontent.com domain to locate the file
  • gh:release
    • Uses the Github release with the version name for changelog. Remember to publish a changelog in the release
    • Uses the release assets to link to the file. Remember to publish the asset to the release

Basic usage

In the folder you want to store your tracker.json you can run the command tracker-json <semantic-version>. For example:

$ tracker-json.js 1.0.0
✓ tracker.json generated
my-card 1.0.0

Using with release-it

I highly recommend using tracker-json with release-it for release handling. release-it is a one-stop-shop to release a package following semantic versioning and also generate changelogs and publish the release to GitHub and optionally publishing to npm. Using release-it you would handle cutting a new release with commands like release-it major|minor|patch and it handles everything else for you. tracker-json currently only supports linking to releases with changelogs on GitHub, so you need to configure release-it with one of its hooks to trigger tracker-json as well as making sure it generates releases on GitHub:

{
  "release-it": {
    "github": {
      "release": true
    },
    "scripts": {
      "afterBump": "npx tracker-json"
    }
  }
}