diff --git a/.agent/mise-tasks/check/browser b/.agent/mise-tasks/check/browser new file mode 100755 index 0000000..edc7483 --- /dev/null +++ b/.agent/mise-tasks/check/browser @@ -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 "$@" diff --git a/.agent/mise-tasks/check/eslint b/.agent/mise-tasks/check/eslint new file mode 100755 index 0000000..ccf95b9 --- /dev/null +++ b/.agent/mise-tasks/check/eslint @@ -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 "$@" diff --git a/.agent/mise-tasks/check/format b/.agent/mise-tasks/check/format new file mode 100755 index 0000000..7bf2baf --- /dev/null +++ b/.agent/mise-tasks/check/format @@ -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 "$@" diff --git a/.agent/mise-tasks/check/lints b/.agent/mise-tasks/check/lints new file mode 100755 index 0000000..7ab0712 --- /dev/null +++ b/.agent/mise-tasks/check/lints @@ -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 "$@" diff --git a/.agent/mise-tasks/check/shell b/.agent/mise-tasks/check/shell new file mode 100755 index 0000000..99f63b1 --- /dev/null +++ b/.agent/mise-tasks/check/shell @@ -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 "$@" diff --git a/.agent/mise-tasks/check/types-browser b/.agent/mise-tasks/check/types-browser new file mode 100755 index 0000000..522cfb4 --- /dev/null +++ b/.agent/mise-tasks/check/types-browser @@ -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 "$@" diff --git a/.agent/mise-tasks/check/types-src b/.agent/mise-tasks/check/types-src new file mode 100755 index 0000000..566682f --- /dev/null +++ b/.agent/mise-tasks/check/types-src @@ -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 "$@" diff --git a/.agent/mise-tasks/check/types-test b/.agent/mise-tasks/check/types-test new file mode 100755 index 0000000..e563e63 --- /dev/null +++ b/.agent/mise-tasks/check/types-test @@ -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 "$@" diff --git a/.agent/mise-tasks/check/unit b/.agent/mise-tasks/check/unit new file mode 100755 index 0000000..9d60c0c --- /dev/null +++ b/.agent/mise-tasks/check/unit @@ -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 "$@" diff --git a/.agent/mise-tasks/check/workflows b/.agent/mise-tasks/check/workflows new file mode 100755 index 0000000..e5057a2 --- /dev/null +++ b/.agent/mise-tasks/check/workflows @@ -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 "$@" diff --git a/.claude/settings.json b/.claude/settings.json index aaeedaf..2ba2aee 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,5 +1,8 @@ { "plansDirectory": "./.claude/plans", + "env": { + "MISE_ENV": "agent" + }, "permissions": { "allow": [ "Bash(mise run:*)", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b853207..5474646 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fdd5893..c8fb8ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 7c41b64..42cb7b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .claude/plans/ -.claude/briefs/ +.agent/state/ mise.local.toml diff --git a/.prettierignore b/.prettierignore index 228e0b9..60bbbab 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,5 +7,5 @@ !*.json !*.css .claude/plans/ -.claude/briefs/ +.agent/state/ node_modules diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d20a3..2909916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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:` 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 diff --git a/README.md b/README.md index 7b9089e..99c12da 100644 --- a/README.md +++ b/README.md @@ -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 @@ -165,7 +165,7 @@ 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 @@ -173,9 +173,9 @@ 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 @@ -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:` 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. diff --git a/STANDARDS.md b/STANDARDS.md index 217298c..3c40236 100644 --- a/STANDARDS.md +++ b/STANDARDS.md @@ -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 @@ -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`). diff --git a/docs/components.md b/docs/components.md index b6ddb6c..173d37c 100644 --- a/docs/components.md +++ b/docs/components.md @@ -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/.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/.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. diff --git a/docs/development.md b/docs/development.md index 8ffd600..c181dd0 100644 --- a/docs/development.md +++ b/docs/development.md @@ -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:` 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 diff --git a/docs/testing.md b/docs/testing.md index 6ac6260..b748147 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -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 @@ -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 @@ -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`. diff --git a/eslint.config.js b/eslint.config.js index 32fe84f..027d115 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -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, @@ -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 }, diff --git a/demo/artifact-viewer.html b/examples/artifact-viewer.html similarity index 99% rename from demo/artifact-viewer.html rename to examples/artifact-viewer.html index ba6039a..8da2367 100644 --- a/demo/artifact-viewer.html +++ b/examples/artifact-viewer.html @@ -5,7 +5,7 @@ artifact viewer specimen - +