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

@collie-lang/next

v1.1.1

Published

Next.js plugin for Collie template language

Readme

@collie-lang/next

Next.js plugin for Collie template language.

⚠️ Deprecated workflow note
This README still documents the legacy .collie import model. The new registry + <Collie id="..."> runtime is described in ARCHITECTURE.md, and the old component imports / component-name-derived addressing will be replaced in a future stage.

Installation

npm install --save-dev @collie-lang/next

Usage

In your next.config.js:

const { withCollie } = require('@collie-lang/next');

module.exports = withCollie({
  // Your Next.js config here
});

Or with ES modules (next.config.mjs):

import { withCollie } from '@collie-lang/next';

export default withCollie({
  // Your Next.js config here
});

TypeScript Support

Create a collie.d.ts file in your project root or src directory:

declare module '*.collie' {
  import type { ComponentType } from 'react';
  const Component: ComponentType<Record<string, unknown>>;
  export default Component;
}

Advanced Configuration

Custom Webpack Overrides

const { withCollie } = require('@collie-lang/next');

module.exports = withCollie({
  webpack(config, options) {
    // mutate config as needed
    if (!options.isServer) {
      config.resolve.fallback ??= {};
    }
    return config;
  },
});

Composing with Other Plugins

const { withCollie } = require('@collie-lang/next');
const withBundleAnalyzer = require('@next/bundle-analyzer')();

module.exports = withBundleAnalyzer(
  withCollie({
    reactStrictMode: true,
  })
);

Routing Modes

Collie components work with both routers:

// App Router (app/page.tsx)
import Welcome from '@/components/Welcome.collie';
export default function Page() {
  return <Welcome />;
}

// Pages Router (pages/index.tsx)
import Welcome from '@/components/Welcome.collie';
export default function Page() {
  return <Welcome />;
}

Server Components

Collie templates can be rendered on the server:

// components/Server.collie
export default function Server(props)
  div
    h1 Server says: {props.message}
// app/page.tsx
import Server from '@/components/Server.collie';

export default async function Page() {
  const data = await fetchData();
  return <Server message={data.message} />;
}

Client Components

Mark a Collie template as a client component with the @client directive:

// components/Counter.collie
@client
props
  count: number
  onIncrement: () => void

div.counter
  button(onClick={onIncrement})
    "Count: {count}"

Collie will emit "use client"; at the top of the generated module automatically, so you can import Counter.collie directly inside App or Pages Router files.