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

@zeropress/theme-validator

v0.5.3

Published

Shared ZeroPress theme validation core

Readme

@zeropress/theme-validator

npm license node

Shared validation core for ZeroPress theme manifests and directory-backed file maps.

This package is the single source of truth for runtime theme validation used by:

It implements the current runtime v0.5 validation rules defined in ZeroPress Theme Runtime Spec v0.5.


Install

npm install @zeropress/theme-validator

Exports

import {
  DEFAULT_RUNTIME,
  validateNamespace,
  validateSlug,
  validateThemeManifest,
  validateThemeFiles,
} from '@zeropress/theme-validator';

Schema exports:

import runtimeSchemaUrl from '@zeropress/theme-validator/theme.v0.5.runtime.schema.json';

Published schema files are shipped from the package schemas/ directory, and package subpath exports are versioned.


API

validateNamespace(value) / validateSlug(value)

Shared identifier helpers for scaffolding and submission flows.

  • validateNamespace(value) returns the normalized namespace string or throws
  • validateSlug(value) returns the validated slug string or throws

validateThemeManifest(themeJson)

Validates manifest-only input without requiring theme files.

This is intended for:

  • scaffolding tools
  • manifest-only prechecks
  • tests that need runtime contract checks without packaging

validateThemeFiles(fileMap, options?)

Validates an already-loaded virtual file map.

Accepted inputs:

  • Map<string, string | Uint8Array | ArrayBuffer>
  • Record<string, string | Uint8Array | ArrayBuffer>

This is intended for:

  • directory-based validation
  • worker-side already-loaded uploads after unzip
  • tests and internal adapters

Directory callers can also pass pathEntries for path traversal and symlink validation:

const result = await validateThemeFiles(files, {
  pathEntries: [
    {
      path: 'partials/header.html',
      isSymlink: false,
    },
    {
      path: 'escape-link',
      isSymlink: true,
      resolvedPath: '/real/target',
      rootRealPath: '/theme/root',
    },
  ],
});

Result Shape

validateThemeFiles() returns:

{
  ok: true,
  errors: [],
  warnings: [],
  manifest: {
    name: 'My Theme',
    namespace: 'my-studio',
    slug: 'my-theme',
    version: '1.0.0',
    license: 'MIT',
    runtime: '0.5',
    description: 'Optional',
    menuSlots: {
      primary: {
        title: 'Primary Menu',
      },
    },
    widgetAreas: {
      sidebar: {
        title: 'Sidebar Widgets',
      },
    },
    siteMeta: {
      issue: {
        title: 'Issue',
        type: 'string',
      },
    },
    collectionSlots: {
      'cover-story': {
        title: 'Cover Story',
      },
    },
  },
  checkedFiles: 6
}

Issue objects use this shape:

{
  code: 'MISSING_REQUIRED_FILE',
  path: 'assets/style.css',
  message: "Required file 'assets/style.css' is missing",
  severity: 'error'
}

Validation Profile

Errors

  • theme.json missing or invalid
  • Missing required templates: layout.html, index.html, post.html, page.html
  • Missing assets/style.css
  • Invalid semver in theme.json.version
  • Missing or invalid theme.json.namespace
  • Missing or invalid theme.json.slug
  • Missing or invalid theme.json.license
  • Missing or invalid theme.json.runtime
  • theme.json.name longer than 80 characters
  • theme.json.author longer than 80 characters
  • theme.json.description longer than 280 characters
  • Unknown root fields in theme.json
  • Invalid theme.json.menuSlots
  • Invalid theme.json.widgetAreas
  • Invalid theme.json.siteMeta
  • Invalid theme.json.collectionSlots
  • Invalid menu slot ids
  • Invalid menu slot definitions or unknown slot properties
  • Invalid widget area ids
  • Invalid widget area definitions or unknown widget area properties
  • Removed theme.json.settings
  • layout.html missing or duplicating {{slot:content}}
  • Unknown slot names
  • Nested slot expressions
  • Mustache block syntax
  • <script> inside layout.html
  • Path traversal or symlink escape

Warnings

  • archive.html, category.html, tag.html missing

Requirements

  • Node.js >= 18.18.0
  • ESM only

Related


License

MIT