Skip to content

Releases: bbopen/tw-layout-lint

tw-layout-lint v0.1.1

Choose a tag to compare

@github-actions github-actions released this 23 Sep 06:35
70c3b84

Dependency refresh for tw-layout-lint. The public API and runtime class rules have not changed.

  • Updated Tailwind CSS, React, Vite, Playwright, and supported test tools.
  • Updated GitHub Actions checkout and Node setup to v7.
  • Kept TypeScript 6 because tsup's declaration build fails with TypeScript 7. Kept Vitest 4 for Node 20 support.

CI passed on Node 20 and 22. The demo's Chromium tests and fresh consumer package check also passed.

Install this release from its tarball:

npm install https://github.com/bbopen/tw-layout-lint/releases/download/v0.1.1/tw-layout-lint-0.1.1.tgz

The package is not published to the public npm registry. This GitHub release contains the installable tarball.

tw-layout-lint 0.1.0

Choose a tag to compare

@bbopen bbopen released this 29 Apr 04:11

First public release of tw-layout-lint — a layout-only class validator for Tailwind CSS v4 agent output, with stable diagnostic codes, a finite runtime safelist, and a small React adapter.

What it is

A small package (~12 KB gz) that takes the layout-only Tailwind class strings an LLM emits, validates them against a strict allowlist, and returns stable diagnostic codes so the agent can self-correct. Plus a React adapter and a generated @source inline() artifact that pins the runtime class set so Tailwind v4 actually emits CSS for everything the validator accepts.

Highlights

  • 29 stable diagnostic codes with structured payloads (code, severity, phase, path, hint, related). Codes are stable starting at this release: never reused, never removed in 0.x.
  • Runtime contract verified end-to-end at four layers: validator accept set → enumeration → @source inline() brace expansion → real @tailwindcss/cli output. Verified additionally via a Cloudflare-tunneled fresh-consumer test.
  • 263 tests across 12 files: token grammar, value grammar, shape, runtime + build-time + family-var-pairing, adversarial categories + deep probes, React adapter under StrictMode / Fragment / memo, real Tailwind compile, build artifact (bundle, ESM/CJS, source maps), public API contract, catalog drift + diagnostic snapshot stability.
  • Build-time mode (opt-in) for static numerics + arbitrary values; runtime mode (default) is intentionally narrow with a finite safelist for Tailwind v4 to safelist.
  • Demo at examples/demo/ with three pages (Adversarial showcase, Playground, Gallery) and a Playwright e2e suite.

Install

npm install tw-layout-lint
/* globals.css */
@import "tailwindcss";
@import "tw-layout-lint/source.css";

Documentation

Bundle (gz)

File Size
dist/index.js 12 KB
dist/react/index.js 10 KB
dist/source.css 0.8 KB

License: MIT.