Skip to content

Repository files navigation

WebQ

Tools for querying and validating Web Components against Custom Elements Manifest (CEM) files.

Packages

PackageDescription
@webq/cliCLI tool and MCP server for querying and validating CEM files
@webq/eslintESLint plugin for validating custom element HTML usage
schemasJSON schemas for CEM, custom attributes, patterns, styles, and more

Quick Start

CLI

curl -fsSL https://raw.githubusercontent.com/blueprintui/webq/main/projects/cli/install.sh | bash

Or install via NodeJS:

npm install -g @webq/cli
# List all custom elements
webq element.list --path ./node_modules
# Get details for a specific element
webq element bp-button --path ./node_modules
# Validate HTML against CEM definitions
webq validate-html '<bp-button variant="primary">Click</bp-button>' --path ./node_modules

See the CLI README for the full command reference, configuration, and MCP tool documentation.

ESLint Plugin

npm install @webq/eslint --save-dev
// eslint.config.jsimporthtmlParserfrom'@html-eslint/parser';import{recommended}from'@webq/eslint';exportdefault[{files: ['**/*.html'],languageOptions: {parser: htmlParser},
...recommended({cem: './path/to/custom-elements.json'})}];

See the ESLint README for manual configuration and the full rule list.

MCP Server

WebQ can run as an MCP server, providing AI assistants with tools for querying element APIs and validating HTML.

Claude Code

webq setup-mcp
webq setup-skill

Cursor

Add to .cursor/mcp.json:

{
"mcpServers": {
"webq": {
"command": "webq",
"args": ["mcp", "--path", "./node_modules"]
}
}
}

Validation Rules

Both @webq/cli and @webq/eslint share the same 18 validation rules:

RuleSeverityDescription
no-unknown-elementerrorCustom elements must exist in the manifest
no-unknown-attrerrorAttributes must be defined in the manifest
no-unknown-attr-valueerrorValues must match defined type unions
no-unknown-eventerrorEvent bindings must match defined events
no-unknown-sloterrorSlot values must match defined slots
no-unknown-commanderrorCommands must match defined commands
no-unknown-css-parterror::part() selectors must match defined CSS parts
no-unknown-css-custom-propertyerrorCSS custom properties must match definitions
no-missing-required-childerrorPattern root elements must have required children
no-missing-sibling-bindingerrorSibling trigger/target pairs must have matching bindings
no-deprecated-elementwarnWarn on deprecated elements
no-deprecated-attrwarnWarn on deprecated attributes
no-deprecated-eventwarnWarn on deprecated events
no-deprecated-slotwarnWarn on deprecated slots
no-deprecated-commandwarnWarn on deprecated commands
no-boolean-attr-valuewarnWarn when boolean attributes have explicit values
no-unknown-style-valuewarnvar() references must match defined custom properties
no-unknown-custom-attr-valuewarnCustom attribute values must match definitions

Schemas

JSON schemas for validating manifest files are available in projects/schemas/:

SchemaDescription
custom-elementsPer-component APIs (attributes, properties, events, slots, CSS)
custom-patternsCompositional rules (parent/child, sibling relationships)
custom-attributesGlobal HTML attributes (utility token-list attributes)
custom-stylesGlobal CSS custom properties and cascade layers
dtcgDesign Token Community Group token format
vscode-htmlVSCode custom data format for HTML
vscode-cssVSCode custom data format for CSS

Development

bun install # Install all dependencies
bun run ci # Build + test all packages
bun run format # Check formatting (prettier)
bun run format:fix # Fix formatting

License

MIT

About

Tools for querying and validating Web Components against Custom Elements Manifest (CEM) files. Includes a CLI, MCP server, and ESLint plugin.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages