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

@wireweave/language-data

v1.4.6

Published

Shared language definitions for Wireweave DSL editors

Readme

Installation

npm install @wireweave/language-data
# or
pnpm add @wireweave/language-data

Features

  • Language Data - Component and attribute definitions
  • Monaco Integration - Full IntelliSense for Monaco Editor
  • CodeMirror Integration - Full IntelliSense for CodeMirror 6
  • Zero Dependencies - Standalone package

Usage

Basic Data

import {
  ALL_COMPONENTS,
  ATTRIBUTES,
  getComponent,
  getAttribute,
  getValidChildren,
  getComponentAttributes,
} from '@wireweave/language-data';

// Get component definition
const page = getComponent('page');
console.log(page?.description);

// Get attribute definition
const gap = getAttribute('gap');
console.log(gap?.type); // "number"

// Get valid children for a component
const children = getValidChildren('page');
console.log(children.map(c => c.name));

// Get attributes for a component
const attrs = getComponentAttributes('button');
console.log(attrs.map(a => a.name));

Monaco Editor Integration

import * as monaco from 'monaco-editor';
import {
  LANGUAGE_ID,
  getMonarchTokensProvider,
  getLanguageConfiguration,
  createHoverProvider,
  createCompletionProvider,
  createDiagnosticsSetup,
} from '@wireweave/language-data/monaco';

// Register language
monaco.languages.register({ id: LANGUAGE_ID });
monaco.languages.setMonarchTokensProvider(LANGUAGE_ID, getMonarchTokensProvider());
monaco.languages.setLanguageConfiguration(LANGUAGE_ID, getLanguageConfiguration());

// Register IntelliSense
monaco.languages.registerHoverProvider(LANGUAGE_ID, createHoverProvider(monaco));
monaco.languages.registerCompletionItemProvider(LANGUAGE_ID, createCompletionProvider(monaco));

// Setup diagnostics
const editor = monaco.editor.create(container, { language: LANGUAGE_ID });
const setupDiagnostics = createDiagnosticsSetup(monaco);
setupDiagnostics(editor);

CodeMirror Integration

import { StreamLanguage } from '@codemirror/language';
import { autocompletion } from '@codemirror/autocomplete';
import { hoverTooltip } from '@codemirror/view';
import { linter } from '@codemirror/lint';
import {
  createTokenizer,
  createCompletionSource,
  createHoverTooltipSource,
  createLinter,
} from '@wireweave/language-data/codemirror';

// Create language
const wireframeLanguage = StreamLanguage.define(createTokenizer());

// Setup extensions
const extensions = [
  wireframeLanguage,
  autocompletion({ override: [createCompletionSource()] }),
  hoverTooltip(createHoverTooltipSource()),
  linter(createLinter()),
];

Exports

Main (@wireweave/language-data)

| Export | Description | |--------|-------------| | ALL_COMPONENTS | Array of ~40 component definitions | | ATTRIBUTES | Array of ~60 attribute definitions | | VALUE_KEYWORDS | Array of valid value keywords | | CATEGORY_LABELS | Category name to label mapping | | getComponent(name) | Get component by name | | getAttribute(name) | Get attribute by name | | getValidChildren(name) | Get valid child components | | getComponentAttributes(name) | Get attributes for component | | isComponent(word) | Check if word is a component | | isAttribute(word) | Check if word is an attribute |

Monaco (@wireweave/language-data/monaco)

| Export | Description | |--------|-------------| | LANGUAGE_ID | Language identifier ("wireframe") | | getMonarchTokensProvider() | Monarch tokenizer for syntax highlighting | | getLanguageConfiguration() | Brackets, comments, auto-closing | | createHoverProvider(monaco) | Hover tooltip provider | | createCompletionProvider(monaco) | Auto-completion provider | | createDiagnosticsSetup(monaco) | Diagnostics/linting setup |

CodeMirror (@wireweave/language-data/codemirror)

| Export | Description | |--------|-------------| | createTokenizer() | StreamLanguage tokenizer | | createCompletionSource() | Auto-completion source | | createHoverTooltipSource() | Hover tooltip source | | createLinter() | Linter for diagnostics |

Types

interface ComponentDef {
  name: string;
  nodeType: string;
  category: ComponentCategory;
  attributes: string[];
  hasChildren: boolean;
  description: string;
  example: string;
  validChildren?: string[];
  validParents?: string[];
}

interface AttributeDef {
  name: string;
  type: 'string' | 'number' | 'boolean' | 'enum';
  values?: string[];
  description: string;
  example: string;
}

type ComponentCategory =
  | 'layout' | 'container' | 'grid' | 'text'
  | 'input' | 'display' | 'data' | 'feedback'
  | 'overlay' | 'navigation';

Used By

License

MIT