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

@raisindb/schema-wasm

v0.1.16

Published

WASM bindings for RaisinDB schema validation

Readme

raisin-schema-wasm

WASM bindings for RaisinDB schema and package validation. Provides real-time validation for YAML package files in the browser.

License

This project is licensed under the Business Source License 1.1 (BSL-1.1). See the LICENSE file in the repository root for details.

Features

  • Package Validation - Validate entire RaisinDB packages with cross-file reference checking
  • File-Level Validation - Validate individual YAML files (manifests, node types, workspaces, content)
  • Position-Accurate Errors - Errors include line and column positions for editor integration
  • Auto-Fix Suggestions - Many errors include suggested fixes that can be applied automatically
  • Built-in Types - Includes built-in node types and workspaces for reference validation

Supported File Types

| File Type | Location | Description | |-----------|----------|-------------| | Manifest | manifest.yaml | Package metadata (name, version, description) | | Node Types | nodetypes/*.yaml | Node type definitions with properties and constraints | | Archetypes | archetypes/*.yaml | Archetype definitions (base types with inheritance) | | Element Types | elementtypes/*.yaml | Element type definitions | | Workspaces | workspaces/*.yaml | Workspace configurations | | Content | content/**/*.yaml | Content nodes with properties |

Building

Requires Rust toolchain with wasm32-unknown-unknown target:

# Install wasm-pack if not already installed
cargo install wasm-pack

# Build the WASM package
./build.sh

Output is generated in the pkg/ directory.

API

Package Validation

import { validate_package } from 'raisin-schema-wasm';

// Validate entire package (cross-file reference checking)
const files = {
  'manifest.yaml': '...',
  'nodetypes/Article.yaml': '...',
  'content/home.yaml': '...'
};

const results = validate_package(files);
// { 'manifest.yaml': {...}, 'nodetypes/Article.yaml': {...}, ... }

Individual File Validation

import {
  validate_manifest,
  validate_nodetype,
  validate_archetype,
  validate_elementtype,
  validate_workspace,
  validate_content
} from 'raisin-schema-wasm';

// Validate manifest
const result = validate_manifest(yamlContent, 'manifest.yaml');

// Validate node type (with package context for reference checking)
const nodeTypeResult = validate_nodetype(
  yamlContent,
  'nodetypes/Article.yaml',
  ['cms:Page', 'cms:Article']  // package node types
);

// Validate workspace
const workspaceResult = validate_workspace(
  yamlContent,
  'workspaces/content.yaml',
  ['cms:Page'],     // package node types
  ['content']       // package workspaces
);

// Validate content
const contentResult = validate_content(
  yamlContent,
  'content/home.yaml',
  ['cms:Page'],     // package node types
  ['content']       // package workspaces
);

Built-in Types

import { get_builtin_node_types, get_builtin_workspaces } from 'raisin-schema-wasm';

// Get built-in node types (raisin:*, etc.)
const builtinTypes = get_builtin_node_types();

// Get built-in workspace names
const builtinWorkspaces = get_builtin_workspaces();

Auto-Fix

import { apply_fix } from 'raisin-schema-wasm';

// Apply a fix to YAML content
const fixedYaml = apply_fix(yamlContent, error, newValue);

Types

interface ValidationResult {
  file_type: FileType;
  errors: ValidationError[];
  is_valid: boolean;
}

interface ValidationError {
  path: string;           // JSON path to error location
  field: string;          // Field name with error
  code: string;           // Error code (e.g., "MISSING_FIELD")
  message: string;        // Human-readable message
  severity: 'error' | 'warning';
  line?: number;          // 1-based line number
  column?: number;        // 1-based column number
  fix?: Fix;              // Optional auto-fix
}

interface Fix {
  fix_type: FixType;
  description: string;
  value?: any;            // Suggested value for auto-fixes
}

type FixType =
  | 'AddField'            // Add missing field
  | 'RemoveField'         // Remove invalid field
  | 'ChangeValue'         // Change field value
  | 'NeedsInput';         // Requires user input

type FileType =
  | 'Manifest'
  | 'NodeType'
  | 'Archetype'
  | 'ElementType'
  | 'Workspace'
  | 'Content';

Error Codes

Manifest Errors

| Code | Description | |------|-------------| | MISSING_FIELD | Required field is missing | | INVALID_TYPE | Field has wrong type | | INVALID_VALUE | Field value is invalid |

Node Type Errors

| Code | Description | |------|-------------| | MISSING_FIELD | Required field is missing | | INVALID_NAME | Invalid node type name format | | UNKNOWN_EXTENDS | Extends unknown node type | | UNKNOWN_ALLOWED_CHILD | References unknown node type in allowed_children | | INVALID_PROPERTY_TYPE | Invalid property type | | DUPLICATE_PROPERTY | Property defined multiple times |

Workspace Errors

| Code | Description | |------|-------------| | MISSING_FIELD | Required field is missing | | UNKNOWN_ROOT_TYPE | Root type references unknown node type |

Content Errors

| Code | Description | |------|-------------| | MISSING_FIELD | Required field is missing | | UNKNOWN_NODE_TYPE | Node type is not defined | | INVALID_PROPERTY | Property not defined in node type | | MISSING_REQUIRED_PROPERTY | Required property is missing |

Internal Dependencies

| Crate | Description | |-------|-------------| | raisin-models | Node type and content model definitions | | raisin-validation | Validation logic and rules |