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

@uniweb/schemas

v0.2.1

Published

Standard schema definitions for Uniweb components

Readme

@uniweb/schemas

Standard schema definitions for Uniweb components. These schemas define common content types that components can consume from various data sources.

Overview

Schemas describe structured content types like people, articles, events, and projects. They provide:

  • Field definitions — names, types, validation rules
  • Defaults — sensible fallback values
  • Documentation — what each field represents

Components declare which schemas they accept in meta.js. Data matching these schemas can come from:

  • Tagged code blocks in markdown (yaml:person, json:event)
  • Page/site-level data fetching
  • The Uniweb platform CMS

Standard Schemas

| Schema | Description | |--------|-------------| | person | Team members, authors, contacts | | article | Blog posts, news items, documentation | | event | Calendar events, conferences, webinars | | project | Portfolio items, case studies | | opportunity | Jobs, grants, calls for proposals | | publication | Academic papers, research documents |

Installation

pnpm add @uniweb/schemas

Usage

In meta.js

Import and use standard schemas in your foundation components:

// foundation/src/sections/TeamGrid/meta.js
import { person } from '@uniweb/schemas'

export default {
  title: 'Team Grid',
  category: 'showcase',

  // Use standard schema - the build extracts a lean runtime version
  schemas: {
    team: person,
  },

  // Opt into receiving cascaded data from page/site fetches
  inheritData: ['team'],
}

The foundation build automatically:

  • Tree-shakes unused schemas from the bundle
  • Extracts only the fields needed at runtime (strips metadata like name, version, description)
  • Creates a lean schema with type, default, and options

In markdown (tagged blocks)

```yaml:person
name: Sarah Chen
role: Lead Architect
bio: 10+ years building distributed systems
avatar: /team/sarah.jpg

### From data fetching

```yaml
# page.yml
title: Our Team
fetch:
  path: /team
  schema: person

Schema Definition Format

Each schema is defined with fields, types, and optional validation:

export default {
  name: 'person',
  version: '1.0.0',
  description: 'A person or team member',

  fields: {
    name: {
      type: 'string',
      required: true,
      description: 'Full name',
    },
    role: {
      type: 'string',
      description: 'Job title or role',
    },
    bio: {
      type: 'markdown',
      description: 'Biography or description',
    },
    avatar: {
      type: 'image',
      description: 'Profile photo',
    },
    email: {
      type: 'string',
      format: 'email',
    },
    social: {
      type: 'object',
      fields: {
        twitter: { type: 'string' },
        linkedin: { type: 'string' },
        github: { type: 'string' },
      },
    },
  },
}

Field Types

| Type | Description | |------|-------------| | string | Plain text | | number | Numeric value | | boolean | True/false | | markdown | Rich text with markdown formatting | | image | Image reference (path or URL) | | date | ISO date string | | datetime | ISO datetime string | | url | URL string | | email | Email address | | object | Nested object with fields | | array | Array with items type |

Field Options

| Option | Type | Description | |--------|------|-------------| | type | string | Field type (required) | | required | boolean | Field must have a value | | default | any | Default value if not provided | | description | string | Human-readable description | | format | string | Validation format (email, url, etc.) | | fields | object | Nested fields for object type | | items | object | Item schema for array type |

Custom Schemas

Define custom schemas inline in meta.js:

export default {
  title: 'Pricing Table',

  schemas: {
    'pricing-tier': {
      name: { type: 'string', required: true },
      price: { type: 'number', required: true },
      period: { type: 'string', default: 'month' },
      features: { type: 'array', items: { type: 'string' } },
      highlighted: { type: 'boolean', default: false },
    },
  },
}

API

Schema Imports

// Import individual schemas (tree-shakeable)
import { person, article, event } from '@uniweb/schemas'

// Import all schemas
import { schemas } from '@uniweb/schemas'
const personSchema = schemas.person

Utilities

import { validateAgainstSchema, applyDefaults } from '@uniweb/schemas'

// Validate data against a schema
const { valid, errors } = validateAgainstSchema(data, person)
// errors: [{ path: 'email', message: 'Invalid email format' }]

// Apply default values from schema
const dataWithDefaults = applyDefaults(data, person)

License

Apache 2.0