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

@smoothbricks/nx-plugin

v0.2.2

Published

Local Nx plugin for workspace-standard package setup and missing inferred targets.

Downloads

662

Readme

Nx Plugin

Local Nx plugin for workspace-standard package setup and missing inferred targets.

Target Ownership

Official @nx/js/typescript owns TypeScript library inference. A package tsconfig.lib.json becomes the tool-output target tsc-js; this plugin must not duplicate or rename that target.

@smoothbricks/nx-plugin owns only inferred targets Nx does not provide here:

  • typecheck-tests and typecheck-tests:watch from tsconfig.test.json
  • test:watch from explicit test commands for Bun and Vitest packages
  • zig-* targets from build.zig steps such as zig-wasm
  • aggregate build and lint targets

Nx Target Naming

Target names are {tool}-{output} names. Use names like tsc-js, tsdown-js, and zig-wasm; build and lint are aggregates.

Concrete targets come from concrete files:

  • typecheck-tests is inferred from tsconfig.test.json and runs tsc --noEmit -p tsconfig.test.json.
  • typecheck-tests:watch is inferred from tsconfig.test.json and runs the same typecheck in watch mode.
  • test:watch is inferred when the package already defines an explicit Bun or Vitest test command. The plugin derives the corresponding watch command and makes it depend on typecheck-tests.
  • zig-* is inferred from build.zig; each explicit b.step("name", ...) becomes zig-name.
  • build is inferred only when the project has at least one concrete build target to run, such as tsc-js from the official TypeScript plugin, a package-local target like tsdown-js, or a zig-* target from this plugin. It depends on output-family wildcard targets: *-js, *-web, *-html, *-css, *-ios, *-android, *-native, *-napi, *-bun, and *-wasm.

This is why Zig appears in the convention: the plugin is not guessing from arbitrary Zig source. SmoothBricks requires build.zig to expose named build steps so Nx can create cacheable, addressable targets from those steps.

Do not use colon-style Nx target names such as build:wasm or lint:fix. Nx CLI syntax already uses colons for project:target:configuration, so colon target names are hard to read, easy to confuse with configurations, and awkward to expose through package scripts. Package scripts may still use names like build:wasm; they should delegate to a real target such as nx run pkg:zig-wasm.

There is no Nx lint:fix target; repository formatting is handled by the root lint:fix script.

typecheck-tests and typecheck-tests:watch are inferred only when tsconfig.test.json exists. Test typechecking must not emit dist-test. test:watch is continuous and depends on typecheck-tests before entering Bun or Vitest watch mode. Smoo validation creates/requires this config for test runners that do not typecheck test files by default.

tsconfig.test.json is not a TypeScript build-mode project. It should reference library tsconfigs it needs to typecheck against, but the package root tsconfig.json should not reference ./tsconfig.test.json. Nx runs test typechecking through the inferred typecheck-tests target, not through tsc --build.

Zig targets are inferred only when build.zig declares at least one b.step(...). Each step becomes a zig-* target, so a package build.zig must have at least one step.

Bun Test Tracing Generator

Configure a package for the Bun test tracing + no-emit test typechecking pattern used in this repo.

nx generate ./packages/nx-plugin:bun-test-tracing \
  --project @smoothbricks/my-package \
  --opContextModule @smoothbricks/lmao \
  --opContextExport lmaoOpContext \
  --tracerModule @smoothbricks/lmao/testing/bun

What it wires:

  • bunfig.toml preloads for the LMAO Bun test tracing setup
  • src/test-suite-tracer.ts
  • tsconfig.test.json with noEmit for inferred typecheck-tests
  • direct test config references to library tsconfigs; package root tsconfig.json is left out of the test config graph
  • package package.json test/lint/devDependency wiring needed for the standard pattern

Bounded Test Targets

@smoothbricks/nx-plugin:bounded-exec runs a shell command with a timeout and force-kill grace period. Test targets use this executor so hung test processes fail predictably instead of blocking Nx indefinitely.

The shared policy API is exported from @smoothbricks/nx-plugin/bounded-test-policy for generators or other workspace tools that need to normalize package JSON consistently.

nx generate ./packages/nx-plugin:bounded-test-targets --project @smoothbricks/my-package

The generator rewrites package.json so nx.targets.test uses:

  • executor @smoothbricks/nx-plugin:bounded-exec
  • command preserved from an existing nx:run-commands test target or direct scripts.test
  • cwd: "{projectRoot}"
  • timeoutMs: 600000
  • killAfterMs: 10000
  • package script alias nx run <project>:test --outputStyle=stream