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

@ruledwdl/core

v0.3.3

Published

Web Definition Language (WDL) core runtime and component layout engine.

Readme

Web Definition Language — Core Engine (@ruledwdl/core)

WDL (Web Definition Language) is a host-agnostic, declarative language runtime and component layout engine. It renders WDL definitions (REGISTRY / COMPONENTS / DATA, layouts, and components) directly to optimized HTML using a pluggable store.

npm version License: AGPL v3 Spec License: GPL v3


Features & Recent Updates (v0.3.2)

  • Host-Agnostic Engine: Zero framework overhead — runs natively in Node.js, Cloudflare Workers, Edge runtimes, or modern browsers with 0 build tools.
  • Registry Schema V2.1: Native browser Scoped CSS Rules (@scope) support via flat rules: [{ selector, media?, css }] arrays compiled directly into <style data-wdl="components">.
  • Variant Attribute Generation: Automatic data-variant="..." attribute emission and :scope[data-variant="..."] CSS selector mapping.
  • Layers Component Expressions: Ultra-lean component syntax using WDL Layers expressions (tag.semantic_id, >, +, < de-indent/subset, <*N repeaters, <@N depth reference, * data loops) backed by WDLDomTree.
  • Design Token Cascade: Layered design and brand tokens integrated directly into WDL JSON and compiled into <style data-wdl="theme-tokens">, design-tokens, and brand-tokens.
  • 100% Zero-Dependency Core: Zero external markdown runtime requirement; includes pluggable transformData and transformText hooks for external markdown engines (marked, markdown-it, remark).

Specifications & Documentation


Installation

npm install @ruledwdl/core

Ecosystem Packages

The RuledWDL monorepo maintains three core packages:

| Package | Workspace Folder | NPM Package | Version | Description | | :--- | :--- | :--- | :--- | :--- | | @ruledwdl/core | Root (./) | @ruledwdl/core | 0.3.2 | Core layout composition engine, layers parser, store interfaces, and registry compiler. | | @ruledwdl/csr | packages/csr | @ruledwdl/csr | 0.3.2 | Ultra-lightweight client-side renderer & DOM hydrator with auto-injection of <style> tags in <head>. | | @ruledwdl/state | packages/state | @ruledwdl/state | 0.1.2 | Headless component state manager for layers, attr, data, variant, and registry rules. |


Quick Start

import { composePage, createMemoryStore } from '@ruledwdl/core';

// 1. Initialize a WDL Store
const store = createMemoryStore({
  layouts: {
    base: {
      name: 'base',
      COMPONENTS: [{ layers: 'div.shell', attr: { '.shell': { text: '{{content}}' } } }],
      DATA: { __design_tokens: ':root { --color-primary: #0284c7; }' }
    }
  }
});

// 2. Define a WDL Page with Schema V2.1 Scoped CSS Rules
const page = {
  title: 'Home Page',
  layout: 'base',
  REGISTRY: {
    $version: '2.1',
    card: {
      rules: [
        { selector: ':scope', css: { display: 'flex', padding: '1.5rem' } },
        { selector: '& .title', css: { color: 'var(--color-primary)' } }
      ]
    }
  },
  COMPONENTS: [
    { layers: 'div.card > h1.title', attr: { '.title': { text: 'Welcome ${name}' } } }
  ],
  DATA: { name: 'World' }
};

// 3. Compose to HTML
const { html, dynamic } = await composePage(store, 'demo-tenant', page);
console.log(html);

Direct Browser / CDN Usage (No Build Step)

Include the single standalone bundle file directly in your HTML:

<script src="https://cdn.jsdelivr.net/npm/@ruledwdl/core/dist/ruledwdl.min.js"></script>
<script>
  const { composePage, createMemoryStore } = WDL;
  // Use WDL directly in the browser via window.WDL
</script>

CLI Usage

# Render a page to stdout
npx ruledwdl render <project-dir> <slug>

# Run live preview server
npx ruledwdl serve [project-dir] [port]

Running Tests

npm test

License & Specifications