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

plgg-domain

v0.0.1

Published

The durable-core / sacrificial-shell spine: a single authored Domain of caster-typed entities that derives its SQLite schema, a schema-compatibility boot gate, a code-independent export/import, a provenance manifest, and the derivation seams downstream sh

Readme

plgg-domain

The durable-core / sacrificial-shell spine (roadmap decision D18), built from scratch on plgg, plgg-sql, and plgg-db-migration. Part of the plgg monorepo.

In the LLM / "vibe-coding" era, application code is cheap and disposable — regenerated on demand. So plgg treats the application shell as sacrificial and the data, domain model, and external contracts as the durable core. This package makes that boundary crisp and machine-checkable: a regenerated shell provably cannot drift from the core, because it is derived out of it.

The idea

You author one Domain — a record of caster-typed Entity declarations — and everything downstream is derived from it:

  • schemaOf — derive the SQLite schema as a plgg-db-migration migration, so the generated schema joins the append-only migration history.
  • assertPersistedSchema — a schema-compatibility boot gate: a freshly generated app started against an existing database asserts, through casters, that the persisted schema satisfies the current Domain (Ok), is merely behind (Lag, with a runnable forward migration), or conflicts irreconcilably (Drift, a typed value matched exhaustively) — in which case it refuses to boot rather than corrupt the durable store.
  • decodeEntity / encodeEntity — the runtime row boundary: persisted rows always re-enter the domain parse-don't-validate.
  • exportDomain / importDomain — a canonical, code-independent export and re-import, so the app can always be discarded and regenerated.
  • DomainManifest — a provenance manifest (domain fingerprint, derivation version, schema head) recording which generation produced a running instance.
  • Derivation seams (toDeliveryShape, and the ToContentModel / ToResourceDeclaration / ToMcpToolSchema interfaces) — the pure functions a regenerated shell's delivery API, content models, UI declarations, and MCP tools are re-derived from.

Example

example.ts walks the whole D18 flow: author a Domain, derive + apply the schema, boot against a matching store (Ok), seed + export + re-import into a fresh database (round-trip with no loss), and boot against an incompatible store (refuse, with a clear typed reason).

Scripts

  • scripts/tsc-plgg-domain.sh — type-check.
  • scripts/test-plgg-domain.sh — unit specs (≥91% coverage gate), run against real node:sqlite.