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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trackunit/migrations

v0.1.4

Published

Coordinator library that discovers installed `@trackunit/*` packages, updates their versions, and runs pending migrations.

Readme

@trackunit/migrations

Coordinator library that discovers installed @trackunit/* packages, updates their versions, and runs pending migrations.

How it works

Each published @trackunit/* package can declare a "migrations" field in its package.json pointing to a migrations.json manifest. This library recursively scans node_modules (including nested/transitive dependencies) to find all such packages, then follows a two-step flow modeled after nx migrate:

  1. migrate -- discovers packages, updates package.json versions, writes pending migrations to trackunit-migrations.json
  2. run-migrations -- executes the pending migrations from that file, then clears the list

Version state is tracked in trackunit-migrations.json so migrations that have already been applied are not re-run.

flowchart TD
  subgraph step1 [Step 1: nx g @trackunit/migrations:migrate]
    scan["Recursively scan node_modules\nfor @trackunit/* packages"]
    scan --> checkField{"package.json\nhas migrations field?"}
    checkField -->|No| skipPkg[Skip package]
    checkField -->|Yes| loadManifest["Load migrations.json"]
    loadManifest --> readState["Read trackunit-migrations.json\nfor migratedVersions state"]
    readState --> filterVersion{"migration.version >\nlastMigratedVersion?"}
    filterVersion -->|No| skipMigration[Skip migration]
    filterVersion -->|Yes| collect["Add to pending list"]
  end

  subgraph updatePkg [Version Updates]
    scan --> compareDeps{"Installed version >\npackage.json version?"}
    compareDeps -->|Yes| bumpDep["Update version in\nconsumer package.json"]
    compareDeps -->|No| noop[No change]
  end

  collect --> writeFile["Write trackunit-migrations.json\nwith pending migrations +\nupdated migratedVersions"]

  subgraph step2 [Step 2: nx g @trackunit/migrations:run-migrations]
    readFile["Read trackunit-migrations.json"] --> loop["For each pending migration"]
    loop --> importImpl["Import migration implementation"]
    importImpl --> execute["Execute migration against NX Tree\n(AST transforms, file rewrites)"]
    execute --> clearPending["Clear pending list\nPreserve migratedVersions"]
  end

  writeFile --> review["Developer reviews\ntrackunit-migrations.json"]
  review --> readFile
flowchart LR
  subgraph nodeModules ["node_modules (recursive scan)"]
    rc["@trackunit/react-components\nv2.0.0\nmigrations: ./migrations.json"]
    rcc["@trackunit/react-chart-components\nv1.20.0\nmigrations: ./migrations.json"]
    su["@trackunit/shared-utils\nv1.13.0\n(no migrations field)"]
    nested["some-lib/node_modules/\n@trackunit/react-components\nv1.21.8 (older, deduped out)"]
  end

  subgraph migrationsFiles [migrations.json per package]
    rcMig["react-components/migrations.json\n- rename-button-kind (v1.22.0)\n- button-required-variant (v2.0.0)"]
    rccMig["react-chart-components/migrations.json\n- chart-api-v2 (v1.20.0)"]
  end

  subgraph output [trackunit-migrations.json]
    pending["migrations:\n- rename-button-kind\n- button-required-variant\n- chart-api-v2\n\nmigratedVersions:\n  react-components: 2.0.0\n  react-chart-components: 1.20.0"]
  end

  rc --> rcMig
  rcc --> rccMig
  su -.->|skipped| nodeModules
  nested -.->|deduped| rc
  rcMig --> pending
  rccMig --> pending

Usage

Step 1: Discover and collect migrations

nx g @trackunit/migrations:migrate

This updates @trackunit/* dependency versions in your package.json and writes a trackunit-migrations.json file listing any pending migrations. Review the file before proceeding.

Step 2: Run pending migrations

nx g @trackunit/migrations:run-migrations

This executes each migration listed in trackunit-migrations.json and clears the pending list. You can delete the file afterward or keep it for version tracking.

Internal monorepo

yarn nx g @trackunit/migrations:migrate
yarn nx g @trackunit/migrations:run-migrations

For more info and a full guide on Iris App SDK Development, please visit our Developer Hub.

Trackunit

This package was developed by Trackunit ApS.

Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.

The Trackunit logo