Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .agent/mise-tasks/check/browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
#MISE description="Run the check's browser step, the browser tier on the build in the pinned chrome-headless-shell, after build"
#MISE depends=["build"]
# Runs scripts/check/browser.sh, one step of the check.
set -euo pipefail
exec scripts/check/browser.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/eslint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's ESLint step over the code, the layer's imports included"
# Runs scripts/check/eslint.sh, one step of the check.
set -euo pipefail
exec scripts/check/eslint.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's format step, Prettier's check of the code, the JSON, and the stylesheets"
# Runs scripts/check/format.sh, one step of the check.
set -euo pipefail
exec scripts/check/format.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/lints
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's lints step, marathon's lint-context and lint-references, both"
# Runs scripts/check/lints.sh, one step of the check.
set -euo pipefail
exec scripts/check/lints.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's shell step, shellcheck over the scripts, the file tasks, and the agent area's shell scripts"
# Runs scripts/check/shell.sh, one step of the check.
set -euo pipefail
exec scripts/check/shell.sh "$@"
6 changes: 6 additions & 0 deletions .agent/mise-tasks/check/types-browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
#MISE description="Run the check's browser type-check, tsc over the browser cases' in-page modules against the build's declarations, after build"
#MISE depends=["build"]
# Runs scripts/check/types-browser.sh, one step of the check.
set -euo pipefail
exec scripts/check/types-browser.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/types-src
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's source type-check, tsc over the sources"
# Runs scripts/check/types-src.sh, one step of the check.
set -euo pipefail
exec scripts/check/types-src.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/types-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's test type-check, tsc over the Node-side tests, the scripts' TypeScript, and the agent area"
# Runs scripts/check/types-test.sh, one step of the check.
set -euo pipefail
exec scripts/check/types-test.sh "$@"
6 changes: 6 additions & 0 deletions .agent/mise-tasks/check/unit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
#MISE description="Run the check's unit step, the unit tier on the lint and a pack of the build, after build"
#MISE depends=["build"]
# Runs scripts/check/unit.sh, one step of the check.
set -euo pipefail
exec scripts/check/unit.sh "$@"
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/workflows
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's workflows step, actionlint over the GitHub Actions workflows"
# Runs scripts/check/workflows.sh, one step of the check.
set -euo pipefail
exec scripts/check/workflows.sh "$@"
3 changes: 3 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"plansDirectory": "./.claude/plans",
"env": {
"MISE_ENV": "agent"
},
"permissions": {
"allow": [
"Bash(mise run:*)",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v7.0.1

- uses: jdx/mise-action@v5.3.0
- uses: jdx/mise-action@v5.4.0

- name: mise run install
run: mise run install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
exit 1
fi

- uses: jdx/mise-action@v5.3.0
- uses: jdx/mise-action@v5.4.0

- name: mise run install
run: mise run install
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.claude/plans/
.claude/briefs/
.agent/state/

mise.local.toml

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
!*.json
!*.css
.claude/plans/
.claude/briefs/
.agent/state/
node_modules
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ All notable changes to `@standards-lab/web-components` are documented here. The

### Changed

- The repository's tooling takes marathon 0.24.0, pnpm 12.23.0, and typescript-eslint 8.74.0.
- The repository's tooling takes marathon 0.25.0, pnpm 12.23.0, typescript-eslint 8.74.0,
chrome-headless-shell 158.0.8127.88, `@types/node` 26.6.11, ESLint 10.16.0,
eslint-plugin-boundaries 7.4.5, and jdx/mise-action v5.4.0.
- `marked` is at 18.3.0.
- The repository's tasks take the agent-separation layout: `check` is a file task in `mise-tasks/`
that runs the step scripts in `scripts/check/` in order, stopping at the first failure; the
`lint`, `types`, `test`, and `preflight` tasks are gone, and under `MISE_ENV=agent`, which the
Claude settings set, `mise.agent.toml` adds a `check:<step>` task for each step. `.gitignore`
lists `.agent/state/` in place of `.claude/briefs/`, and the tools check `.agent/`.
- The demo pages are the example pages: `demo/` is `examples/`, `mise run demo` is
`mise run examples`, and their stylesheet is `examples/examples.css`, in the `examples` layer.

## [0.2.0] - 2026-11-22

Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ the foundation's `page.css`:
- `./*.css`: each component's sheet, which its module imports itself.

[docs/components.md](https://github.com/standards-lab/web-components/blob/main/docs/components.md)
documents each module in full, and its demo and specimen pages.
documents each module in full, and its example pages.

### Settings and Help

The components bind no key, so the page binds S and ? itself, as `demo/components.html` does. Two
glyph buttons in the header's `.header-actions` open the dialogs with `command="show-modal"`, and
the foundation's `keys.js` binds each to its key through `data-keys`. Help is a `.dialog-fit`
The components bind no key, so the page binds S and ? itself, as `examples/components.html` does.
Two glyph buttons in the header's `.header-actions` open the dialogs with `command="show-modal"`,
and the foundation's `keys.js` binds each to its key through `data-keys`. Help is a `.dialog-fit`
dialog holding `sl-shortcuts`, and Settings is a `.dialog-wide` dialog holding `sl-settings`; each
has a `.dialog-header` whose Close shows the Esc hint. Close and Escape close either dialog with no
script, and focus returns to the element that held it. The page links the foundation's
Expand Down Expand Up @@ -165,17 +165,17 @@ fills the glyphs' markers:
```

The Help heading takes focus as its dialog opens; the Settings heading doesn't, so `sl-settings`
focuses its first row. `demo/settings.html` and `demo/shortcuts.html` carry the pattern too.
focuses its first row. `examples/settings.html` and `examples/shortcuts.html` carry the pattern too.

## Development

Tasks run through [mise](https://mise.jdx.dev):

```
mise run install # the pinned tools, and node_modules with the foundation, the icons, and the tooling at their tags; reads the network
mise run check # lint, lint-context, lint-references, types, build, and both test tiers; reads no network
mise run check # the linters, lint-context and lint-references, the type-checks, the build, and both test tiers; reads no network
mise run build # src/ into dist/
mise run demo # serve the components demo page and the specimen pages on dist/
mise run examples # serve the example pages, the components page and the specimen pages, on dist/
mise run screenshots # capture each specimen page at the defaults, zen, regular, and mono, light and dark, in tiles, inline in kitty
mise run screenshots --palette github # the same, in the palette named; the facet flags combine
mise run screenshots --space compact # the same, in the space named
Expand All @@ -200,8 +200,9 @@ and profiles, and web-tooling's
documents them. The check never runs it.

The check lints with ESLint, Prettier, shellcheck, actionlint, and marathon's lint-context and
lint-references. CI runs `mise run install` and the check on each pull request to main and each
push to it.
lint-references. It runs the step scripts in `scripts/check/` in turn and stops at the first that
fails; an agent (`MISE_ENV=agent`) also has a `check:<step>` task for each. CI runs
`mise run install` and the check on each pull request to main and each push to it.
[docs/development.md](https://github.com/standards-lab/web-components/blob/main/docs/development.md)
gives the reasoning behind the configuration and the scripts.

Expand Down
8 changes: 7 additions & 1 deletion STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The architecture pages that apply, in the architecture repository:
- `architecture/principles/validation-first.md`: a component checks what it is given, a content
type, a JSON text, a URL in Markdown, before it renders it.
- `architecture/principles/comments.md`: the five kinds of comment.
- `architecture/principles/agent-separation.md`: the agent area in `.agent/`, the task layout in
`mise-tasks/` and `.agent/mise-tasks/`, the agent profile in `mise.agent.toml`, and
`MISE_ENV=agent` in the Claude settings' `env`.

## Design

Expand Down Expand Up @@ -60,4 +63,7 @@ The architecture pages that apply, in the architecture repository:
- The browser tier tests `dist/`, and no server transforms what it serves.
- Tests are TypeScript run under Node's type stripping, erasable syntax only, type-checked by
`tsconfig.test.json`; browser-served fixtures stay `.js`.
- A mise task runs one script or one command, and `check` is a depends list.
- A one-line task stays inline in `mise.toml`, a multi-line one is a file task in `mise-tasks/`,
and the check's steps are scripts in `scripts/check/`, which `mise-tasks/check` runs in order
and each agent task in `.agent/mise-tasks/check/` wraps
(`architecture/principles/agent-separation.md`).
36 changes: 18 additions & 18 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,22 @@ the tests measure as they do.

- `./*.css`: each component's sheet, which its module imports itself.

## Demo

`demo/components.html` puts the status badge, the entry, and the pagination on one page, with its
import map, and the [Settings and Help pattern](../README.md#settings-and-help) in its header, which
the settings and shortcuts pages carry too. `demo/glyphs.js` fills the pages' web-icons markers.
Each component has a specimen page, `demo/<name>.html`, for `status-badge`, `entry`, `pagination`,
`artifact-viewer`, `chat-thread`, `composer`, `upload-dropzone`, `stage-timeline`, `event-log`,
`search-results`, `document-list`, `drawer`, `settings`, and `shortcuts`. A specimen page shows
every state of its component, labelled, then again in a section 20rem wide, and, for a component
that holds a control, one instance reached by the keyboard to show its focus ring: the screenshot
script focuses the focus section's `[data-focus-start]` mark, which takes focus only by script, then
presses Tab as many times as the mark's value says, so `:focus-visible` matches. A page whose
component draws its own frame drops the dashed one, so a capture shows the component's frame alone.
The drawer's mode is the viewport's, so its page is an app's frame instead, its states the page's at
two widths: docked at 1280px, and closed, open, and open right to left at 480px. Its Outline drawer
is `modal`, and its captures open it at 1280px, then reach its Close by Tab. The settings and
shortcuts captures add each page's dialog, opened by its key. The specimen pages link the
foundation's `page-full.css` and import its `register-full.js`, so a profile applies by its
## Examples

`examples/components.html` puts the status badge, the entry, and the pagination on one page, with
its import map, and the [Settings and Help pattern](../README.md#settings-and-help) in its header,
which the settings and shortcuts pages carry too. `examples/glyphs.js` fills the pages' web-icons
markers. Each component has a specimen page, `examples/<name>.html`, for `status-badge`, `entry`,
`pagination`, `artifact-viewer`, `chat-thread`, `composer`, `upload-dropzone`, `stage-timeline`,
`event-log`, `search-results`, `document-list`, `drawer`, `settings`, and `shortcuts`. A specimen
page shows every state of its component, labelled, then again in a section 20rem wide, and, for a
component that holds a control, one instance reached by the keyboard to show its focus ring: the
screenshot script focuses the focus section's `[data-focus-start]` mark, which takes focus only by
script, then presses Tab as many times as the mark's value says, so `:focus-visible` matches. A page
whose component draws its own frame drops the dashed one, so a capture shows the component's frame
alone. The drawer's mode is the viewport's, so its page is an app's frame instead, its states the
page's at two widths: docked at 1280px, and closed, open, and open right to left at 480px. Its
Outline drawer is `modal`, and its captures open it at 1280px, then reach its Close by Tab. The
settings and shortcuts captures add each page's dialog, opened by its key. The specimen pages link
the foundation's `page-full.css` and import its `register-full.js`, so a profile applies by its
attribute on the root.
24 changes: 17 additions & 7 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,27 @@ tags, so `scripts/preflight.sh` looks for each in `node_modules` beside lit and
Chrome for Testing publishes no checksums, so each chrome-headless-shell bump takes the sha256 and
size from the download by hand. mise caches a download by its checksum, so a version bumped without
its own sha256 installs the old build; preflight compares the installed browser's version with the
pin and fails, naming the sha256, when they differ.
pin and fails, naming the sha256, when they differ. Through `scripts/preflight.sh`, each step of
the check and each task that runs a tool fails naming `mise run install` when a tool it needs is
missing.

`types:browser` depends on `build`: the browser cases' in-page modules read the declarations the
build ships. `types:test` doesn't: the tests import nothing from `dist/`.
## Tasks and their configuration

`mise-tasks/check` runs the step scripts in `scripts/check/` in turn (the linters, the source and
test type-checks, the build, then the steps that read `dist/`) and stops at the first that fails.
Under `MISE_ENV=agent`, which the Claude settings set, `mise.agent.toml` adds a `check:<step>` task
in `.agent/mise-tasks/check/` for each step script, so an agent runs one step alone; a step that
reads `dist/` depends on `build`.

The browser type-check reads `dist/`: the browser cases' in-page modules read the declarations the
build ships. The test type-check doesn't: the tests import nothing from `dist/`.

## TypeScript

- `tsconfig.json` builds `src/` into `dist/`, and `mise run types` checks the same sources with
`--noEmit`. The foundation is read as a consumer reads it, through the install of the peer at the
top level, here its devDependency: its shipped `.d.ts`, and the ambient `"*.css"` declaration its
`./css` types subpath holds.
- `tsconfig.json` builds `src/` into `dist/`, and the check's source type-check checks the same
sources with `--noEmit`. The foundation is read as a consumer reads it, through the install of
the peer at the top level, here its devDependency: its shipped `.d.ts`, and the ambient `"*.css"`
declaration its `./css` types subpath holds.
- `tsconfig.test.json` checks the Node-side tests and their helpers, which `node --test` runs under
Node's type stripping, and the screenshots description, which the tooling's bin loads under the
same stripping: the base's strictness and erasable syntax, on Node's module resolution and its
Expand Down
22 changes: 12 additions & 10 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ the behavior and layout each one holds to.
and `release.test.ts` checks a `pnpm pack` of the `dist/` that `mise run build` writes, as it
stands and in scratch copies with one fault each.
- The browser tier runs on `dist/` in the pinned chrome-headless-shell, on the pages under
`test/fixtures/` and the specimen pages under `demo/`. `test/browser/support/served.ts` is what
the browser tier, `mise run demo`, and the screenshots description all serve, so the list is kept
once. Of the served packages, lit's own dependencies (lit-html, lit-element, and
`test/fixtures/` and the specimen pages under `examples/`. `test/browser/support/served.ts` is
what the browser tier, `mise run examples`, and the screenshots description all serve, so the
list is kept once. Of the served packages, lit's own dependencies (lit-html, lit-element, and
`@lit/reactive-element`) sit beside it in pnpm's store and the server brings them with it; the
foundation and the icons are the installs the components' `dist/` imports by name, reached as a
consumer reaches them.
- `test/browser/support/types.js` is run by no page: tsc checks it with the in-page modules against
the same `dist/`, so a declaration that narrows what a consumer may write fails `types:browser`.
the same `dist/`, so a declaration that narrows what a consumer may write fails the check's
browser type-check.

## Every browser case

Expand Down Expand Up @@ -46,16 +47,16 @@ the behavior and layout each one holds to.
- Each case on `test/fixtures/components.html` runs once on the lean entry, `page.css` with no
profile set, and once in each profile combination on the full entry, `page-full.css` with
`register-full.js`.
- `themes.test.ts` reads the specimen pages from `demo/` as it reads the profiles, so a page a
- `themes.test.ts` reads the specimen pages from `examples/` as it reads the profiles, so a page a
component adds is covered with no edit. One case pins that the registry lists at least the four
built-in colors, so an empty read can't pass with nothing checked. `demo/components.html` is left
out: it links only the lean entry, so it shows one profile.
built-in colors, so an empty read can't pass with nothing checked. `examples/components.html` is
left out: it links only the lean entry, so it shows one profile.
- Text in a fully transparent color shows nothing, as a hidden mark does, so it takes no color
token.
- The stage timeline and the shortcuts list hold no control, so the focus ring cases skip their
pages; a case pins that each renders nothing focusable, so a control one gains must get a ring
case.
- `shortcut-dialogs.test.ts` runs on the demo pages that carry the Settings and Help pattern, so
- `shortcut-dialogs.test.ts` runs on the example pages that carry the Settings and Help pattern, so
the README's markup is held to working with the components.

## Components
Expand Down Expand Up @@ -166,5 +167,6 @@ the behavior and layout each one holds to.
- A value import of a declaration file is caught in each value form, an inline `type` specifier
among them, since `verbatimModuleSyntax` keeps that import.
- The allowed imports use names that hold dots, which a rule must tell from `.` and `..` segments.
- The `lint` mise task runs ESLint with `-c` on the repository's config, whose patterns then match from the
tree, the working directory, and whose plugins load from the repository's `node_modules`.
- The check's ESLint step runs ESLint with `-c` on the repository's config, whose patterns then
match from the tree, the working directory, and whose plugins load from the repository's
`node_modules`.
7 changes: 5 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const declarations = {
};

export default defineConfig([
{ ignores: ["dist/"] },
{ ignores: ["dist/", ".agent/state/"] },
{ files: code, extends: [js.configs.recommended, tseslint.configs.recommended] },
{
files: code,
Expand All @@ -88,7 +88,10 @@ export default defineConfig([
},
{ files: code, languageOptions: { globals: globals.browser } },
{ files: code, rules: { "no-restricted-syntax": ["error", ...cssImports] } },
{ files: ["test/**/*.ts", "scripts/**"], languageOptions: { globals: globals.node } },
{
files: ["test/**/*.ts", "scripts/**", ".agent/**"],
languageOptions: { globals: globals.node },
},
{
files: ["src/**"],
plugins: { boundaries, "import-x": importX },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>artifact viewer specimen</title>
<link rel="stylesheet" href="/deps/@standards-lab/web-foundation/dist/page-full.css" />
<link rel="stylesheet" href="demo.css" />
<link rel="stylesheet" href="examples.css" />
<script type="importmap">
{
"imports": {
Expand Down
2 changes: 1 addition & 1 deletion demo/chat-thread.html → examples/chat-thread.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>chat thread specimen</title>
<link rel="stylesheet" href="/deps/@standards-lab/web-foundation/dist/page-full.css" />
<link rel="stylesheet" href="demo.css" />
<link rel="stylesheet" href="examples.css" />
<script type="importmap">
{
"imports": {
Expand Down
File renamed without changes.
Loading