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

@openuji/vocab-build

v0.1.0

Published

Generate publishable semantic web vocabulary assets from JSON-LD schema source files

Readme

@openuji/vocab-build

Generate publishable semantic web vocabulary assets from JSON-LD schema source files.

Features

  • 🎯 Dual Mode Support: Editor's Draft (ED) and Technical Report (TR) versioned snapshots
  • 📦 Complete Asset Generation: JSON-LD contexts, Turtle/RDF vocabularies, and HTML documentation
  • 🔒 TR Immutability: Prevents accidental overwrites of published snapshots
  • 🎨 Modern HTML Output: Responsive, accessible vocabulary pages with copy-to-clipboard
  • 🔄 Redirect Manifests: Support for Netlify, Cloudflare, and generic JSON formats
  • Full Validation: Zod-based schema validation with detailed error messages

Installation

npm install @openuji/vocab-build
# or
pnpm add @openuji/vocab-build

CLI Usage

Build Command

Build vocabulary assets in Editor's Draft mode:

vocab-build build \
  --input vocab.core.jsonld \
  --out dist \
  --module core \
  --mode ED

Build a Technical Report snapshot:

vocab-build build \
  --input vocab.core.jsonld \
  --out dist \
  --module core \
  --mode TR \
  --version 1.0.0

Validate Command

Validate a vocabulary source file:

vocab-build validate --input vocab.core.jsonld

Release Command

Convenience command for releasing a TR version:

vocab-build release --input vocab.core.jsonld

CLI Options

| Option | Description | Default | |--------|-------------|---------| | -i, --input <path> | Path to vocab source file (required) | - | | -o, --out <dir> | Output directory | dist | | -m, --module <core\|ui> | Module name (required) | - | | --mode <ED\|TR> | Build mode (required) | - | | -v, --version <semver> | Version for TR mode (x.y.z) | - | | -f, --force | Overwrite existing TR snapshot | false | | -b, --base-url <url> | Base URL for deployment | - | | -r, --redirects <type> | Redirect type (none|netlify|cloudflare|json) | netlify | | -s, --strict | Fail on unknown fields | false |

Library API

import { buildVocab, validateVocab } from '@openuji/vocab-build';

const result = await buildVocab({
  input: 'vocab.core.jsonld',
  output: 'dist',
  module: 'core',
  mode: 'ED',
});

if (result.success) {
  console.log('Generated files:', result.files);
} else {
  console.error('Errors:', result.errors);
}

Input Format

Vocabulary source files use an extended JSON-LD format:

{
  "module": "core",
  "namespace": "https://ujm.specs.openuji.org/ns#",
  "docBase": "https://ujm.specs.openuji.org/ns",
  "title": "User Journey Map Core Vocabulary",
  "description": "Core vocabulary for defining user journey maps",
  "status": "ED",
  "updated": "2025-12-23",
  "terms": [
    {
      "id": "Journey",
      "kind": "Class",
      "label": "Journey",
      "comment": "A complete user journey"
    },
    {
      "id": "start",
      "kind": "Property",
      "label": "start",
      "comment": "The starting step",
      "domain": "https://ujm.specs.openuji.org/ns#Journey",
      "range": "https://ujm.specs.openuji.org/ns#Step"
    }
  ],
  "context": {
    "Journey": {
      "@id": "https://ujm.specs.openuji.org/ns#Journey",
      "@type": "@id"
    }
  }
}

Required Fields

  • module: "core" or "ui"
  • namespace: Base IRI ending in #
  • docBase: Base document IRI without #
  • title, description: Human-readable strings
  • status: "ED" or "TR"
  • terms: Array of term definitions

ED-Specific

  • updated: ISO date string (YYYY-MM-DD)

TR-Specific

  • version: SemVer string (x.y.z)

Term Definition

  • id: Fragment name (valid identifier)
  • kind: "Class" or "Property"
  • label, comment: Human-readable strings
  • domain, range: Optional IRIs
  • deprecated: Optional boolean
  • seeAlso: Optional array of URLs

Output Structure

For core module:

dist/
  ns/
    index.html           # Latest HTML
    ns.ttl              # Latest Turtle
  contexts/
    core.jsonld         # Latest JSON-LD context
  ED/
    core/
      index.html        # Editor's Draft
  TR/
    core/
      1.0.0/
        index.html      # TR snapshot
        context.jsonld
        ns.ttl
  _redirects           # Optional redirect manifest

For ui module:

dist/
  ui/
    index.html
    ui.ttl
  contexts/
    ui.jsonld
  ED/
    ui/
      index.html
  TR/
    ui/
      1.0.0/
        index.html
        context.jsonld
        ui.ttl

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Run tests
pnpm test

# Type check
pnpm typecheck

License

MIT