Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 2.45 KB

File metadata and controls

54 lines (38 loc) · 2.45 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Repository Overview

This is a Bun/TypeScript monorepo (workspaces) containing tools for validating Web Components usage against Custom Elements Manifest (CEM) files. Uses wireit for incremental build caching.

Packages

  • projects/cli/ (@webq/cli) — Bun/TypeScript CLI tool and MCP server for querying and validating CEM JSON files. Includes 18 HTML validation rules. See projects/cli/CLAUDE.md for details.
  • projects/eslint/ (@webq/eslint) — ESLint plugin that validates custom element HTML usage via @html-eslint/parser. Delegates validation to the webq CLI. See projects/eslint/CLAUDE.md for details.
  • projects/schemas/ — JSON schemas for custom-elements, custom-attributes, custom-patterns, custom-styles, DTCG tokens, and VSCode custom data formats.

Tooling

  • This repo uses Bun as the package manager and runtime. Always use bun run <script>, bun test, bun install, and bun x <package> — never npm, npx, or yarn.
  • Dependencies must always be pinned to an exact version number (no ^ or ~ prefixes).

Quick Reference

Monorepo (root)

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

CLI (projects/cli)

cd projects/cli
bun run ci                # Lint + test + build
bun test                  # Run tests
bun run build             # Build for all platforms
bun src/index.ts          # Run CLI directly
bun test src/internal/elements/store.test.ts  # Single test

ESLint Plugin (projects/eslint)

cd projects/eslint
bun run ci                # Build + lint + test (wireit, cached)
bun run build             # TypeScript compilation
bun test src/             # Run all tests
bun test src/rules/no-unknown-attr.test.ts  # Single test

Cross-Cutting Concepts

Both packages consume CEM JSON (custom-elements.json) files — the standard format for documenting Web Components. The ESLint plugin delegates validation to the webq CLI at lint time; the CLI provides runtime querying and HTML validation via CLI or MCP protocol. Both packages implement the same 18 validation rules.