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

@stardust-cms/vce-adapter

v0.1.0

Published

Reusable adapter bridging the pure versioned-content-engine to the @stardust-cms/dashboard ContentStoreAdapter seam, with a pluggable payload policy and persistence.

Downloads

155

Readme

@stardust-cms/vce-adapter

A reusable adapter that bridges the pure versioned-content-engine to the @stardust-cms/dashboard ContentStoreAdapter seam.

The dashboard hands the adapter structured HostContentOps and re-injects the returned ContentSnapshot; internally each op is translated to a versioned-content-engine operation and a materialized VCE snapshot is projected back to dashboard ContentPayload[] — giving the editor draft / live / publish / version history for free.

Why a separate package

The adapter imports both a concrete engine (versioned-content-engine) and the dashboard contract. The dashboard's own dependency-cruiser rules forbid importing a concrete store/engine under its src/**, so the adapter cannot live inside the dashboard. It is therefore its own package, depending on both as peers.

Install

npm install @stardust-cms/vce-adapter versioned-content-engine @stardust-cms/dashboard

Usage

The core adapter is generic over your VCE content-type map and stays content-type-agnostic by delegating every payload decision to an injected PayloadPolicy. For the demo's CmsContent, a ready-made policy ships on the /cms-content subpath:

import { VceContentStoreAdapter } from "@stardust-cms/vce-adapter";
import {
  cmsContentPayloadPolicy,
  type CmsContentTypeMap,
} from "@stardust-cms/vce-adapter/cms-content";
import { createLocalStoragePersistence } from "@stardust-cms/vce-adapter/local-storage";

const store = new VceContentStoreAdapter<CmsContentTypeMap>(SEED_CONTENT, {
  policy: cmsContentPayloadPolicy,
  persistence: createLocalStoragePersistence({ key: "my-app-content" }),
});

store satisfies the dashboard ContentStoreAdapter contract, including the optional subscribe(listener) (added in dashboard 0.1.8): every snapshot-changing operation — apply, publish, setViewVersion — notifies all listeners, so direct publish() / setViewVersion() calls re-inject in the dashboard.

Public surface

| Export | Subpath | Purpose | | --- | --- | --- | | VceContentStoreAdapter, VceAdapterOptions | . | The generic adapter class + its options. | | PayloadPolicy, EditPatch, InsertPayload | . | The injectable content-type bridge. | | PersistenceAdapter | . | The pluggable persistence seam. | | cmsContentPayloadPolicy, CmsContentTypeMap | ./cms-content | Ready-made policy reproducing the demo's exact CmsContent behavior. | | createLocalStoragePersistence | ./local-storage | Browser localStorage persistence (browser-only; kept off the core path). |

Persistence semantics

createLocalStoragePersistence persists only the current working draft (as SeedItem[]), not version history — "re-seed working draft, drop history." On reload the saved draft becomes a fresh published baseline. All storage access is guarded and quota-tolerant: a failure degrades to the built-in seed rather than throwing.

Layering

  • Core (adapter, types, project, host-contract) is generic and environment-agnostic.
  • CmsContent policy (/cms-content) is the only module that pulls in @stardust-cms/iframe-adapter protocol types.
  • Browser persistence (/local-storage) is the only module that touches localStorage / DOM.

These edges are enforced by dependency-cruiser, strict TypeScript, and ESLint (typescript-eslint strict + stylistic, no any / non-null ! / ts-* comments / eslint-disable).