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

@hollis-labs/plugin-registry

v0.2.0

Published

Browser half of the plugin contract — the registry wire types and the loader that resolves them.

Readme

@hollis-labs/plugin-registry

The browser registry, loader and optional React adapter for github.com/hollis-labs/plugin-sdk. The Go and TypeScript views share the registry contract and conformance fixtures. The core has no runtime dependencies. React ^19 is an optional peer behind ./react. Version 0.2.0 is a breaking replacement for the registry shape in 0.1.0; there is no compatibility fallback. Documents require registry_version: 2; legacy protocol keys, dual-key documents and unsupported versions fail with ErrRegistryVersion.

npm i @hollis-labs/plugin-registry

Host admission

The registry describes contributions by owner, generation and local key. The manifest is authoritative: importing a bundle never discovers additional contributions. Hosts explicitly opt into kind and region descriptors and supply their own metadata validator for nonempty schemas. Unsupported optional entries produce named refusals; a required refusal stops preflight and keeps the serving registry intact. Capability declarations carry information; hosts remain responsible for authorization and isolation.

import { createPluginRegistry, type KindDescriptor, type RegionDescriptor } from '@hollis-labs/plugin-registry'

const panel: KindDescriptor = {
  schema_version: 1,
  metadata_schema: {},
  representations: ['component'],
  regions: ['rail'],
  required_capabilities: [],
}
const rail: RegionDescriptor = {
  kinds: ['panel'],
  representations: ['component'],
  context_schema: {},
  ordering: 'manifest' as const,
}
const registry = createPluginRegistry({
  kinds: { panel },
  regions: { rail },
  runtimes: { react: '19.1.0' },
  stylesheets: false,
  onDiagnostic: (event) => report(event),
})

// Pass original JSON text so duplicate keys can be detected before JSON.parse.
const raw = await fetch('/api/plugins/registry').then((r) => r.text())
await registry.sync(raw)
const contribution = registry.get('panel', 'acme/main')

sync also accepts a validated object, but an object cannot retain duplicate keys discarded by a prior JSON parser. Original text is required at the wire boundary. Validation rejects case-insensitive duplicate keys at every nesting level, mis-cased known fields, unsafe revisions, unknown owners and malformed representations. Integer wire fields (registry_version, revision, and kind or contribution schema_version) require integer literal spelling; 5.0, 5e0, and 1e2 are rejected. Opaque metadata and declarative numbers may use floats. Object input cannot recover number spellings normalized by a prior parser. Runtime bounds use normalized semantic versions, inclusive endpoints and explicit prerelease opt-in.

Verified bundles and lifecycle

Component bundles require an exact sha256: digest. The loader fetches bytes once, checks that digest, and imports the same bytes. Its default importer uses an immutable data URL, so bundles must be self-contained and the host CSP must permit that URL. Relative module imports and automatic runtime sharing are not provided. A custom importModule receives a VerifiedBundle; it must execute bundle.bytes, never refetch bundle.sourceUrl. Hosts can override fetchBundle to control transport and credentials.

Preflight checks admission, runtime compatibility and integrity before retiring an active owner. Replacement then fences captured entries and disposes resources in reverse acquisition order before importing or adopting the replacement. Import or adoption failure after revocation leaves the old generation revoked. Cleanup failures quarantine the owner, and disposal continues for other resources. Unchanged contributions retain their values and disposer accounting. The host supplies dispose for resources its adopt callback creates.

unload(owner, generation?) fences immediately and aborts cooperative pending work before awaiting disposal. Late completions cannot reactivate tombstoned generations. clear() retires the host epoch; reconnect with a fresh epoch. Cancellation is cooperative: a custom importer or disposer that never settles can hold subsequent activation work. Tombstones and cleanup quarantines live for the lifetime of a registry instance.

React

import {
  createReactPluginRegistry,
  usePluginContribution,
} from '@hollis-labs/plugin-registry/react'

const registry = createReactPluginRegistry({
  kinds: { panel }, regions: { rail }, runtimes: { react: '19.1.0' },
})

function Slot() {
  const contribution = usePluginContribution(registry, 'panel', 'acme/main')
  if (!contribution) return null
  const Component = contribution.value
  return <Suspense fallback={null}><Component /></Suspense>
}

The adapter wraps component exports in React.lazy and checks the captured entry's active generation on render. An old captured component renders nothing after revocation. Declarative data and browser-safe handler bindings remain data; the SDK does not execute handlers or select a winner for a host surface.

Inspecting the registry

get and list return active adopted contributions. ownerOf attributes listed declarations, including unresolved exports. snapshot exposes declared entries, resolution state and owner generations; refusals and errors expose named admission and lifecycle failures. Entries carry host-declared status and optional status_reason. Only accepted entries resolve. declared_not_selected, unavailable, and unknown statuses remain listed and inactive. Unknown values project as unavailable and emit status-diagnostic with reason unknown-status, without echoing the raw status; status_reason stays as supplied. A retained refused entry must match the authoritative top-level refusal. Status never bypasses admission checks or adds SDK selection logic. subscribe and version support external-store integrations. Hosts define the meaning of kinds, ordering, selection, schema compilation, trust, CSP and shared runtimes.

Release history is in CHANGELOG.md. MIT — see LICENSE.