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

@cassida/next-plugin

v0.12.0

Published

Next.js integration for Cassida. Bundles the SWC plugin registration, the IR-comment loader, the @layer cas CSS virtual module, and the optional plugin registry (hover-fix, conditional, print, global-css). Phase 1 scaffold — withCassida() API surface only

Readme

@cassida/next-plugin

Next.js integration for Cassida. One-line drop-in for next.config.js that wires up the SWC plugin, the IR-comment loader, the @layer cas virtual CSS module, and the optional plugin registry.

Status: Phase 1 scaffold. Currently exports the withCassida() API surface and the NextCassidaOptions type. The actual integration lands in subsequent commits.

Supported Next.js versions

Cassida supports the current Next.js LTS release only (15.x at the time of writing). Earlier majors aren't tested in CI; future bumps in @next/swc's embedded swc_core may break older Next.js installs of @cassida/next-plugin without notice.

The @cassida/swc-plugin package ships two ABI-pinned WASM artefacts — the next-targeted one tracks the swc_core pinned by the current Next.js LTS, and won't be backported when Next.js bumps its swc_core in a future release.

Enforcement. A weekly cron in this repo (.github/workflows/swc-core-drift.yml) watches the swc_core version embedded in the current Next.js LTS release. When the pin drifts, an issue is auto-opened on this repo with the Cassida-Phase-1.5 label so the @cassida/swc-plugin-next crate can be bumped before consumers' Next.js upgrades break.

Install

pnpm add @cassida/next-plugin @cassida/core

@cassida/next-plugin depends transitively on @cassida/swc-plugin, @cassida/parser, and @cassida/compiler. Optional plugins (@cassida/plugin-hover-fix, @cassida/plugin-conditional, @cassida/plugin-print, @cassida/plugin-global-css) are lazy-loaded — they're only required if you enable them via options.plugins.

Usage

// next.config.js
import { withCassida } from '@cassida/next-plugin';

export default withCassida(
  {
    // ordinary next config
    reactStrictMode: true,
    experimental: { typedRoutes: true },
  },
  {
    // cassida options (all optional)
    layer: 'cas',
    hash: { prefix: 'cas-', length: 8 },
    shorthand: { policy: 'strict' },

    // Enable optional plugins
    plugins: {
      hoverFix: true,
      conditional: { shortCircuit: true },
      print: false, // skip the @media print preflight
      globalCss: { preflight: './styles/preflight.css' },
    },

    // Auto-discover tsconfig path aliases (default true)
    pathAliases: true,
  },
);

withCassida() returns the same next.config object, augmented with the SWC plugin registration, webpack/turbopack rules, and any other glue the requested options imply.

Why a dedicated Next.js wrapper

@cassida/swc-plugin alone is just the AST transform; it needs a Node-side post-pass to compile the emitted IR into class names and to bundle the resulting CSS. @cassida/next-plugin is that glue, packaged as a one-line config wrapper so consumers don't manually hand-edit experimental.swcPlugins, webpack.module.rules, or experimental.turbo.rules.

It also ships the App Router (RSC) guard that warns when a cas() call would land in a Server Component runtime, the lazy plugin loader so you only require what you enable, and the standard @layer cas CSS bundle endpoint.

Monorepo and output: 'standalone'

In a monorepo where the Next.js app directory holds its own lockfile but the workspace root also has one, Next.js 15 emits a "multiple lockfiles detected" warning on every build. The conventional fix — setting outputFileTracingRoot to the app directory — silences the warning, but it has a second effect that bites later: it also governs which node_modules files are copied into the .next/standalone/ bundle when you use output: 'standalone'.

If outputFileTracingRoot points at the app directory, the standalone bundle won't include the @cassida/* packages (they live one or more levels up under the workspace node_modules), and the SWC plugin's WASM loader will fail to resolve at runtime in production.

The fix: point outputFileTracingRoot at the workspace root, not the app directory.

// next.config.mjs
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { withCassida } from '@cassida/next-plugin';

const workspaceRoot = dirname(dirname(fileURLToPath(import.meta.url)));
// (or hard-code if your structure is stable)

export default withCassida({
  // ...
  outputFileTracingRoot: workspaceRoot,
});

In single-package consumers (no monorepo), outputFileTracingRoot can be left unset — the warning won't fire and the standalone bundle traces correctly by default.

License

MIT