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

@anvil-di/anvil-unplugin

v0.0.4

Published

Run anvil codegen as part of your bundler's normal pipeline. One plugin, every bundler (Vite, Rollup, Webpack, Rspack, esbuild) via unplugin.

Readme

@msulak/anvil-unplugin

Run @msulak/anvil codegen as part of your bundler's normal pipeline. Built on unplugin so a single adapter works across Vite, Rollup, Webpack, Rspack, and esbuild.

Why

Today's flow without the plugin:

anvil build        # regenerate every .anvil.ts
vite build         # bundle

That gets stale fast in dev — every edit to a @Module requires re-running anvil build before vite dev's HMR will see the change. With the plugin:

// vite.config.ts
import anvil from "@msulak/anvil-unplugin/vite";

export default defineConfig({
  plugins: [anvil()],
});

Codegen runs on buildStart and on every relevant file change in dev (debounced). Validation errors flow through the bundler's normal error pipeline — Vite's overlay, Rollup's warning channel, Webpack's stats output.

Per-bundler imports

import anvil from "@msulak/anvil-unplugin/vite";      // Vite plugin
import anvil from "@msulak/anvil-unplugin/rollup";    // Rollup plugin
import anvil from "@msulak/anvil-unplugin/webpack";   // Webpack plugin
import anvil from "@msulak/anvil-unplugin/rspack";    // Rspack plugin
import anvil from "@msulak/anvil-unplugin/esbuild";   // esbuild plugin

Options

anvil({
  // Component entry files. Defaults to whatever anvil.config.json
  // declares, just like running `anvil build` with no args.
  entries: ["src/**/*-component.ts"],

  // Forwarded to `anvil build --tsconfig ...`. Lets the resolver honor
  // tsconfig `paths` / `baseUrl` aliases.
  tsconfig: "./tsconfig.json",

  // Path to the `anvil` binary. Defaults to the native binary resolved
  // via @msulak/anvil-cli's optionalDependencies.
  cli: "/path/to/anvil",

  // Debounce window for re-running codegen after a file edit (ms).
  // Defaults to 100, matching `anvil watch`.
  debounceMs: 100,

  // Which codegen backend to use:
  // - "native" (default): spawn the anvil Rust binary
  // - "wasm": run in-process via @msulak/anvil-codegen-wasm (no spawn overhead)
  mode: "native",
});

How it works

The plugin invokes the anvil CLI as a child process (native mode) or runs the WASM pipeline in-process (wasm mode):

  • buildStart — runs once at the beginning of every build, blocking the bundler until codegen finishes. If anvil build fails, the bundler's error handling surfaces the diagnostic.
  • watchChange — fires on every source .ts / .tsx edit in dev. Schedules a debounced rebuild; concurrent edits collapse into a single re-run. .anvil.ts outputs are ignored to avoid self-trigger loops.

The bundler's normal TypeScript pipeline then picks up the freshly generated *.anvil.ts files. There's no special TS plugin; .anvil.ts is just .ts.

How the binary gets there

@msulak/anvil-unplugin depends on @msulak/anvil-cli, which is the npm launcher for anvil's native Rust binary. @msulak/anvil-cli declares one optionalDependencies entry per supported platform (@msulak/anvil-cli-linux-x64, @msulak/anvil-cli-darwin-arm64, etc.); npm installs only the matching one based on os/cpu filters. At runtime the unplugin calls resolveBinaryPath() from @msulak/anvil-cli to find the binary — no PATH manipulation or cargo install required.

The same cli option still works if you want to point at a custom build (a cargo build --release'd binary outside node_modules, for example).

Limitations (v0.2)

  • In native mode the plugin spawns one process per build. Hot reload is fast (~50–200ms for a typical project); use mode: "wasm" for in-process codegen without the spawn overhead.
  • Diagnostics flow as raw anvil stderr through the bundler's error API. Future work: parse the structured output and emit per-file diagnostics with source maps.
  • Watch granularity is "any .ts change re-runs codegen for all configured entries". The CLI's M5 watch mode does smarter per-entry source-closure tracking; future versions of this plugin should reuse that data instead of duplicating its own filter.