🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

tracker-json

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tracker-json

Generate tracker.json with ease

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

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

OptionDefaultDescription
repopackage.json repo fieldA repo slug like github-user/repo-name
filepackage.json file fieldThe filename to link to inside the repo
resolvegh:repoStrategy 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"
    }
  }
}

Keywords

home-assistant

FAQs

Package last updated on 26 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts