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

@marktiderman/genesis-switchboard

v2.0.0

Published

The Switchboard — pluggable, cross-runtime data-layer config for Genesis. Composes LEVELS (L1 Code / L2 Middle / L3 Production) × TIERS (A env / B resource / C field) so the app reads one canonical shape and never knows where data lives. Part of the Genes

Readme

@marktiderman/genesis-switchboard

The Switchboard — a pluggable, cross-runtime data layer for Genesis. A resource's backing becomes a configuration choice, not a code rewrite. Your app calls data.resource('x').list() and never knows where the data lives — code fixtures, Airtable/Notion, or Supabase Postgres. Move one resource — or even one field — between a mock, a human-editable middle layer, and production without touching consumer code.

Consumed the way you consume the Genesis design system: a versioned @marktiderman/genesis-* package. Depth lives in SWITCHBOARD.md (the authoritative design + the Winning Framework); this README is the quickstart.


Install

pnpm add @marktiderman/genesis-switchboard
# @supabase/supabase-js is an OPTIONAL peer — add it only if you build a real Supabase (L3) client:
pnpm add @supabase/supabase-js

Quickstart

import { Registry, Switchboard, CodeAdapter } from "@marktiderman/genesis-switchboard";

// 1. Register resources + the backing that serves each (see switchboard.config.sample.ts).
const registry = new Registry(/* resource contracts */);

// 2. One client. It routes every read to the right backing.
const data = new Switchboard(registry);

// 3. Read a canonical shape — you don't know (or care) where it lives.
const cycles = await data.resource("work_cycles").list();
const one    = await data.resource("features").get("F-123");
const sorted = await data.resource("ideas").query({ where: { kind: "idea" }, orderBy: "votes", direction: "desc" });

The teaching config — a worked example of wiring L1/L2/L3 adapters and A/B/C tiers — is src/switchboard.config.sample.ts.

The mental model — two independent axes

              TIERS  (at what granularity you choose the backing)
              A Environment        B Resource          C Field/Column
  L1 Code  │  dev → all code      features → code      scratch col ← code
  L2 Mid   │  dev → Airtable      features ← Airtable   curated col ← Airtable   (human-editable)
  L3 Prod  │  prod → Supabase     work_cycles ← Supa    identity+rows ← Supa
              Resolution precedence:  C  >  B  >  A
  • LEVELS = how a resource is backed (persistence + governance). Cost-of-change rises L1 → L3.
  • TIERS = at what granularity you pick the backing. Field-level (C) beats resource-level (B) beats the environment default (A).
  • The frog-hop — Tier-C field federation: one row's identity from Supabase, a scratch column live-mocked in code, a curated column from Airtable — joined by the resource key into one canonical shape.

What's in the box

| Piece | Job | | --- | --- | | Registry | the map from resource name → its resolution contract (where it lives). | | Adapter interface | the uniform list/get/query/create/update/delete contract every backing implements. | | Adapters | Code (L1) · Airtable / Notion (L2, field-ID maps + 429 retry + stale-while-error) · Supabase (L3). | | Resolver | the Switchboard + ResourceClientdata.resource(x) → the right adapter. | | Reconciler | compares a resource across two Levels → a drift report; generates the promote plan (L2→L3). | | Staleness | serves last-known-good on a failed refresh, flags the read degraded so drift/promote won't trust it. | | Introspect | auto-discovers a resource's fields + infers types, so a new source maps without hand-writing the shape. |

Access & security contract

  • Access by user_id. org_id is metadata only — never an access principal. The L3 Supabase adapter reads through the caller's session; RLS scopes rows by user_id.
  • Modern Supabase keys only (publishable/secret). Never a legacy anon/service JWT.
  • Networking is an injectable FetchLike (defaults to global fetch) — no Node-only built-ins, so it runs on Node 18+, Deno, and React Native.

Scripts

pnpm --filter @marktiderman/genesis-switchboard build       # tsup → ESM + CJS + .d.ts
pnpm --filter @marktiderman/genesis-switchboard test        # vitest (the four proof suites + more)
pnpm --filter @marktiderman/genesis-switchboard typecheck   # tsc --noEmit

The WIN is proven by mixed-source.test.ts (Tier-B), precedence.test.ts (C>B>A + Tier-C federation), adapter-maps.test.ts (field-ID round-trips, 429 retry, stale-while-error), and reconcile.test.ts (drift + promote). See SWITCHBOARD.md for the full design, lineage (PRD-29), and build-phase status.