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

cirrojs

v0.0.5

Published

React islands SSG with strict CSP (no unsafe-inline). Vite-based, MPA-first.

Readme

cirro

React の島(islands)アーキテクチャによる、CSP 厳格(unsafe-inline 不要)を実現する軽量 static site generator。

特徴

  • インラインスクリプトを一切生成しないscript-src 'self' の厳格な CSP で動作する(Astro 等が残しがちな少量のインラインを排除)
  • 本文は純粋な静的 HTML、インタラクティブな箇所だけをとしてハイドレート(MPA)
  • Config Base Routing: .ts に型付きオブジェクトでルート定義。動的ルートは params → URL の関数 + getStaticPaths
  • React のみ(独自テンプレート構文の学習が不要)

使い方

// vite.config.ts
import react from "@vitejs/plugin-react";
import { cirro } from "cirro/vite";
import { defineConfig } from "vite";

// React プラグインは利用者が明示的に追加する(cirro は内包しない)。
export default defineConfig({
    plugins: [react(), cirro({ routes: "./src/routes.ts", islands: "./src/islands/registry.ts" })],
});
// package.json
"scripts": { "dev": "cirro dev", "build": "tsc && cirro build", "preview": "vite preview" }

CLI は cirro dev(SSR + ルーティング + HMR の開発サーバー)と cirro build(静的サイトを dist/ へ生成)の 2 つ。プレビューは vite preview を使う。

// src/islands/registry.ts — 島を登録(純データ)
import { Counter } from "./Counter";
export const islands = { counter: Counter } as const;
// src/islands/Island.ts — 型安全な <Island> を生成
import { createIsland } from "cirro";
import { islands } from "./registry";
export const Island = createIsland(islands);
// src/routes.ts — ルート定義
import { route, type AnyRoute } from "cirro";
import { HomePage } from "./pages/home";
import { PostPage } from "./pages/post";

export const routes: AnyRoute[] = [
    { path: "/", component: HomePage },
    route({
        path: ({ slug }) => `/posts/${slug}`,
        getStaticPaths: () => [{ slug: "hello" }],
        component: PostPage,
    }),
];

ページは完全な HTML 文書を返し、島は <Island name="counter" props={{ initial: 3 }} /> のように型安全に配置する。

Markdown

createMarkdown() でビルド時に Markdown を HTML 化する。rehype-sanitize を固定で強制し(ユーザープラグインは「サニタイズの上流」に積む)、目次抽出(toc)やクラスベースのシンタックスハイライト(highlight、インラインスタイルを出さず style-src 'self' と両立)に対応する。unified 一式はクライアントへ送られない。

import { createMarkdown } from "cirro";
import remarkGfm from "remark-gfm";

const { render } = createMarkdown({ remarkPlugins: [remarkGfm], toc: true, highlight: true });
const { body, toc } = render(markdownSource); // body: サニタイズ済み HTML の React 要素 / toc: 目次

ドキュメント

使い方の詳細は doc/04_USAGE.md を参照(セットアップ、ルーティング、dev / build、島、Markdown、Panda CSS によるデザイン、CSP まで網羅)。島システムの仕組みは doc/03_ISLAND_SYSTEM.md、設計の背景は doc/01_CHARTER.md を参照。

ライセンス

MIT