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

@timoaus/define-scaffold

v1.0.0

Published

Schema and validation for scaffold server configurations

Downloads

3

Readme

@scaffold-mcp/define-scaffold

Schema and validation utilities for scaffold server configurations.

Purpose

This package provides Zod schemas and validation functions for:

  • server.json - Server configuration files that define available scaffold modules
  • Module metadata - YAML frontmatter in module markdown files

Usage

Validating server.json

import { validateServerConfig, ServerConfigSchema } from '@scaffold-mcp/define-scaffold'

const serverConfig = {
  name: 'my-server',
  version: '1.0.0',
  description: 'My scaffold server',
  modules: [
    './core.md'
  ]
}

const result = validateServerConfig(serverConfig)
if (result.success) {
  console.log('Valid server config:', result.data)
} else {
  console.error('Validation errors:', result.errors)
}

Validating module metadata

import { validateModuleMetadata } from '@scaffold-mcp/define-scaffold'

const metadata = {
  name: 'core',
  version: '1.0.0',
  description: 'Core module',
  dependencies: {
    'react': { minVersion: '18.0.0' }
  },
  features: {
    'ssr': 'boolean',
    'routing': 'boolean'
  }
}

const result = validateModuleMetadata(metadata)

Using schemas directly

import { ServerConfigSchema, ModuleMetadataSchema } from '@scaffold-mcp/define-scaffold'

// For JSON Schema generation or other Zod use cases
const serverSchema = ServerConfigSchema
const moduleSchema = ModuleMetadataSchema

Querying servers and checking compatibility

import { 
  loadScaffoldConfig, 
  queryServer, 
  checkCompatibility,
  getInstalledModules 
} from '@scaffold-mcp/define-scaffold'

// Load user's current configuration
const scaffoldConfig = await loadScaffoldConfig('./scaffold.json')

// Query a server for available modules
const serverResult = await queryServer('https://example.com/tanstack-start')
if (serverResult.success) {
  console.log('Available modules:', serverResult.modules)
}

// Check compatibility between user's config and server
const compatibility = await checkCompatibility(scaffoldConfig, 'https://example.com/tanstack-start')
console.log('Installed modules:', compatibility.installedModules)
console.log('Available to install:', compatibility.availableModules)

// Get list of installed modules
const installed = getInstalledModules(scaffoldConfig)

Schema Structure

ServerConfig

  • name - Server identifier
  • version - Server version
  • description - Human-readable description
  • modules - Array of relative paths to module markdown files

ModuleMetadata (YAML frontmatter)

  • name - Module name (defined in the markdown file)
  • version - Module version
  • description - Module description
  • dependencies - Optional dependencies on other modules
  • features - Optional feature flags with types

ScaffoldConfig (scaffold.json)

  • modules - Object mapping installed module names to their configuration

InstalledModule

  • version - Installed version of the module
  • server - Server URL or path where the module was installed from
  • features - Optional object mapping feature names to their enabled values

Dependencies Format

Dependencies are only for internal module dependencies within the scaffold system:

dependencies:
  other-module-name:
    server: optional-server-name  # defaults to same server
    minVersion: "1.0.0"           # optional minimum version

External package dependencies (like react, typescript) are not managed by this system.

Features Format

features:
  feature-name: boolean  # or 'string' or 'number'

Example scaffold.json

{
  "modules": {
    "tanstack-start/core": {
      "version": "1.0.0",
      "server": "https://example.com/tanstack-start",
      "features": {
        "router": true,
        "ssr": false
      }
    },
    "tanstack-start/react-query": {
      "version": "1.0.0",
      "server": "https://example.com/tanstack-start",
      "features": {
        "devtools": true,
        "persistence": false,
        "optimistic": true
      }
    }
  }
}

Testing

Run tests with:

bun run test

License

MIT