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

@airdraft/ui-core

v0.1.9

Published

Airdraft UI core — field type metadata, validators, and schema mutation helpers (zero framework deps)

Readme

@airdraft/ui-core

Shared UI-layer constants and utilities for Airdraft. Provides field-type metadata (labels, icons, descriptions), the schema editor mutation helpers, and collection name validators consumed by @airdraft/react-ui.

Installation

npm install @airdraft/ui-core

This package is typically a transitive dependency — you don't need to install it directly unless you're building a custom schema editor or type picker.

Exports

Field type metadata

import { FIELD_TYPE_META, VISIBLE_FIELD_TYPES } from '@airdraft/ui-core'
import type { FieldTypeMeta } from '@airdraft/ui-core'

| Export | Description | |---|---| | FIELD_TYPE_META | Record<FieldType, FieldTypeMeta> — label, description, and Lucide icon name for every field type | | VISIBLE_FIELD_TYPES | FieldType[] — all field types with hidden !== true; use this to populate a type picker (excludes the deprecated image type) | | FieldTypeMeta | { type, label, description, icon, hidden? } |

Supported field types (all included in FIELD_TYPE_META):

string · text · number · boolean · date · datetime · list · select · multiselect · rich-text · relation · relations · object · url · media · blocks

image is present but marked hidden: true — it is excluded from VISIBLE_FIELD_TYPES and the schema editor type picker. Use media for new fields.

Schema editor mutations

import { applyFieldUpdate, applyFieldDelete, buildDefaultPath } from '@airdraft/ui-core'

| Export | Description | |---|---| | applyFieldUpdate(collection, key, config) | Returns a new CollectionConfig with the field at key upserted | | applyFieldDelete(collection, key) | Returns a new CollectionConfig with the field at key removed | | buildDefaultPath(name, format) | Generates a default path pattern for a collection (e.g. content/posts/**) |

Validators

import { validateFieldKey, generateFieldKey, validateCollectionName } from '@airdraft/ui-core'

| Export | Description | |---|---| | validateFieldKey(key) | Returns { valid: boolean, error?: string }. Keys must match [a-zA-Z][a-zA-Z0-9_]*. | | generateFieldKey(label) | Converts a human label to a valid snake_case field key (e.g. "Hero Image""hero_image"). | | validateCollectionName(name) | Returns { valid: boolean, error?: string }. Rejects reserved names (schema, health, openapi, etc.). |

Constants

import { RESERVED_COLLECTION_NAMES } from '@airdraft/ui-core'

RESERVED_COLLECTION_NAMESstring[] of names that cannot be used as collection names (schema, media, openapi, health, apply, collections).

Breaking change (v0.1.8): RESERVED_COLLECTION_NAMES was previously exported as Set<string>. It is now a string[]. Replace any .has(name) calls with .includes(name).

Changelog

See CHANGELOG.md.