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

@cimi-cms/schema

v0.1.0-beta.0

Published

Code-first, type-safe content schemas for CIMI — define blocks, sections and content types in TypeScript and infer their data types.

Readme

@cimi-cms/schema

Code-first, type-safe content schemas for CIMI. Define blocks, sections and content types in TypeScript — the data types are inferred from the definitions, no codegen step, and the same definitions serialize to the schema format that GET /api/v1/apps/{appId}/schema serves and cimi push applies.

npm install @cimi-cms/schema

Define

import { defineBlock, defineField, defineSchema } from '@cimi-cms/schema';

export const heroBlock = defineBlock({
  key: 'home-hero',
  label: 'Home hero',
  fields: {
    title: defineField({ type: 'text', label: 'Titel', required: true, localized: true }),
    theme: defineField({ type: 'select', label: 'Thema', options: ['light', 'dark'] }),
    'primary-link': defineField({ type: 'url', label: 'Primaire link' }),
  },
});

export const schema = defineSchema({
  locales: ['nl', 'en'],
  defaultLocale: 'nl',
  blocks: [heroBlock],
});

Infer

import type { BlockData, InferSchemaTypes } from '@cimi-cms/schema';

type HeroData = BlockData<typeof heroBlock>;
// { title: string; theme: 'light' | 'dark' | null; 'primary-link': LinkValue | null }

type MyCimi = InferSchemaTypes<typeof schema>;
// The type argument for the @cimi-cms/sdk v2 client: new CimiClient<MyCimi>(…)

Sync

Pushing, pulling and diffing schemas against a live CIMI app is the job of @cimi-cms/cli:

npx cimi diff          # local definitions vs the live app
npx cimi push --dry-run
npx cimi push

Renames are explicit, never guessed: give the new definition a renamedFrom: 'old-key' hint and cimi push migrates the stored content along with the key. See the repository's docs/SCHEMA_AS_CODE.md for the full model (managed mode, hashing, validation).

Also in this package

  • toNormalizedSchema(schema) — definitions → normalized wire schema
  • diffSchemas(current, desired) — the structural differ used by both the CLI and the server
  • computeSchemaHash(body) — from the @cimi-cms/schema/hash subpath (Node-only)
  • The normalized value shapes (LinkValue, MediaValue, RelationValue, BlockValue) shared with @cimi-cms/sdk

MIT © Wouters Media