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

@planttheidea/nx-monorepo-tools

v1.0.0

Published

Nx plugins that inject formatting, dependency, and bundling-boundary targets into every package of a monorepo

Readme

@planttheidea/nx-monorepo-tools

Three Nx plugins that treat every package in a monorepo as a project and give each one the same targets. Each is registered separately in nx.json, so a workspace takes only the ones it wants.

yarn add --dev @planttheidea/nx-monorepo-tools
{
  "plugins": [
    { "plugin": "@planttheidea/nx-monorepo-tools/biome" },
    { "plugin": "@planttheidea/nx-monorepo-tools/knip" },
    { "plugin": "@planttheidea/nx-monorepo-tools/externals" },
  ],
}

Every plugin scans **/package.json and skips the workspace root, so a package is a project by virtue of having a manifest — nothing has to be listed anywhere.

biome

Injects four Biome targets into every package. Do not invoke biome directly; use these.

| Target | What it does | | -------- | ------------------------------------------- | | format | Auto-fix formatting | | lint | Auto-fix lint issues | | polish | Format and lint in one pass — the usual one | | verify | Check without writing, for CI |

All four are cached, and the workspace's biome.json (or biome.jsonc) is an input, so changing a rule invalidates every package rather than only the ones whose own files moved.

Requires @biomejs/biome in the workspace.

knip

Injects a cached dependencies target into every package that runs knip against it, reporting unused and missing dependencies.

Configuration is inherited rather than mapped. The plugin points knip at one configuration module inside this package, which resolves a base configuration and then merges the .kniprc.ts colocated with whichever project is being checked:

// applications/ribi/.kniprc.ts
import type { KnipConfig } from 'knip';

export const config: KnipConfig = {
  entry: ['src/**/*.tsx', 'vite.config.ts'],
  ignoreDependencies: [
    // Used by fonts
    '@fontsource-variable/oxanium',
  ],
};

export default config;

A package without a .kniprc.ts gets the base untouched. The merge is key by key, so declaring ignoreDependencies leaves entry at the base and vice versa; the file itself is appended to entry afterwards, because a package that narrows entry would otherwise leave its own configuration unreferenced and knip would call it an unused file.

The base is deliberately small:

{
  "entry": ["src/**/*.ts"],
  "ignore": ["dist/**", "out-tsc/**"],
  "include": ["dependencies", "devDependencies", "optionalPeerDependencies"],
  "treatConfigHintsAsErrors": true,
}

Requires knip in the workspace.

Why a configuration module rather than a plain file

knip resolves its own configuration with a single join(cwd, name) and no walk up the tree, so a colocated file inherits nothing on its own. A configuration file may export a function, which knip awaits, so the merge happens when knip runs rather than through generated files or a map of project names inside the plugin.

externals

Injects a cached externals target into every package, failing any esbuild build that bundles a workspace library instead of importing it.

@nx/esbuild:esbuild inlines workspace dependencies and leaves npm packages external. The consumer then holds a private copy of the library, and anything that library owns at module scope — a registry, a cache, a counter — exists twice in one process. Neither copy sees the other's state. Nothing throws; the symptom is a wrong value, and the library's own tests pass because they run against source and always shared one instance.

The rule is blanket: every workspace:* dependency must appear in the consumer's external.

{ "targets": { "build": { "options": { "external": ["ribi-database", "ribi-shared"] } } } }

external accepts * wildcards, so ["ribi-*"] covers a whole prefix.

It is deliberately blanket rather than keyed on which libraries hold state. A rule that only covers libraries someone remembered to mark cannot catch the case it exists for — the new library written by someone who did not know the rule.

Scope

Only consumers whose build target uses @nx/esbuild:esbuild are checked. A vite consumer resolves one specifier to one copy and has nothing to declare; any other bundler is unknown to this check rather than proven safe by it.

Project roots are expanded from the root manifest's workspaces globs, and only the dir/* form is supported. A deeper glob throws rather than silently matching nothing and taking every package under it out of the check.

createPackageJsonNodes

The helper the three plugins are built from, exported for writing a fourth in the same shape.

import { createPackageJsonNodes } from '@planttheidea/nx-monorepo-tools';

export const createNodesV2 = createPackageJsonNodes<Options>((projectRoot, options) => ({
  audit: { cache: true, command: `audit ${projectRoot}`, inputs: ['default', '^default'] },
}));

It supplies the **/package.json glob, skips the workspace root, and registers the returned targets against the directory that owns the manifest.