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

@vexcms/core

v0.0.20

Published

The foundational package for [VEX CMS](https://github.com/ianyimi/vex) — a headless content management system built for [Convex](https://convex.dev).

Downloads

2,542

Readme

@vexcms/core

The foundational package for VEX CMS — a headless content management system built for Convex.

@vexcms/core provides the configuration API, field type system, schema generation, type generation, and all core utilities that power the VEX CMS ecosystem. It has no direct Convex dependency — Convex is a peer dependency only.

Quick Start

The easiest way to get started is with the create-vexcms CLI:

pnpm create vexcms@latest

This scaffolds a complete project with all @vexcms/* packages, authentication, and an admin panel. See the create-vexcms README for full setup instructions.

Manual Installation

pnpm add @vexcms/core @vexcms/cli @vexcms/admin-next @vexcms/ui @vexcms/richtext @vexcms/better-auth @vexcms/file-storage-convex

Features

Configuration API

Define your CMS structure with a type-safe, declarative API:

import { defineConfig, defineCollection, text, richtext, select } from "@vexcms/core"

const posts = defineCollection({
  slug: "posts",
  labels: { singular: "Post", plural: "Posts" },
  fields: {
    title: text({ label: "Title", required: true }),
    content: richtext({ label: "Content" }),
    status: select({
      label: "Status",
      options: [
        { label: "Draft", value: "draft" },
        { label: "Published", value: "published" },
      ],
      defaultValue: "draft",
    }),
  },
})

export default defineConfig({
  collections: [posts],
  admin: { user: "user" },
  basePath: "/admin",
})

Field Types

13 built-in field types with full TypeScript inference:

| Field | Description | |-------|-------------| | text | String with optional min/max length | | number | Numeric with optional min/max/step | | checkbox | Boolean toggle | | select | Single or multi-value enum with options | | date | Date stored as epoch milliseconds | | imageUrl | URL string for images | | relationship | Reference to another collection (single or hasMany) | | upload | Reference to media collection documents (single or hasMany) | | json | Arbitrary JSON data | | array | Wraps any field type in an array | | richtext | Plate/Slate JSON editor documents | | ui | Non-persisted custom render components | | blocks | Ordered array of block instances (discriminated union) |

Blocks System

Define reusable content blocks for flexible page building:

import { defineBlock, text, richtext } from "@vexcms/core"

const heroBlock = defineBlock({
  slug: "hero",
  label: "Hero Section",
  fields: {
    heading: text({ label: "Heading", required: true }),
    body: richtext({ label: "Body" }),
  },
})

Collections, Globals & Media

  • Collections — Content types with typed fields, versioning/draft workflow, database indexes, search indexes, and admin UI configuration
  • Globals — Singleton settings (site config, navigation, etc.) with the same field system
  • Media Collections — File storage with auto-injected fields (storageId, filename, mimeType, size, url, alt, width, height)

Schema & Type Generation

Generates Convex schema and TypeScript types from your config:

import { generateVexSchema, generateVexTypes } from "@vexcms/core"

const schemaSource = generateVexSchema(config)  // → vex.schema.ts
const typesSource = generateVexTypes(config)     // → vex.types.ts

Versioning & Drafts

Per-collection draft/publish workflow with autosave:

defineCollection({
  slug: "posts",
  versions: {
    drafts: true,
    autosave: { interval: 2000 },
    maxPerDoc: 100,
  },
  // ...
})

Access Control (RBAC)

Role-based permissions at the document and field level:

import { defineAccess } from "@vexcms/core"

const access = defineAccess({
  roles: ["user", "admin"],
  adminRoles: ["admin"],
  userCollection: users,
  resources: [posts, users, media],
  permissions: {
    admin: {
      posts: true,
      user: true,
      media: true,
    },
    user: {
      posts: {
        create: true,
        read: true,
        update: ({ data, user }) => data.author === user._id,
        delete: false,
      },
      // Field-level permissions
      user: {
        read: { mode: "allow", fields: ["name", "email"] },
        update: { mode: "deny", fields: ["role", "email"] },
      },
    },
  },
})

Auto-Migration

Schema diffing and migration planning for safe schema changes:

import { diffSchema, planMigration } from "@vexcms/core"

const diff = diffSchema(oldSchema, newSchema)
const ops = planMigration(config, oldSchema, newSchema)

Live Preview

Per-collection iframe preview with responsive breakpoints and snapshot system.

Convex Integration Utilities

Generic document CRUD operations, query helpers with draft support, and preview snapshot management — all framework-agnostic.

Peer Dependencies

  • convex — Convex backend
  • react — React 18+
  • @tanstack/react-table — Table utilities for admin column generation