tyrell-components 1.0.0-rc.21 → 1.0.0-rc.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/bin/tyrell.mjs +77 -0
- package/dist/tyrell.js +1 -1
- package/guides/AGENT_INSTRUCTIONS.md +1 -1
- package/guides/TY_GUIDE.md +2 -0
- package/guides/clj/HELIX_TY_GUIDE.md +2 -2
- package/guides/clj/REAGENT_TY_GUIDE.md +2 -2
- package/guides/clj/REPLICANT_TY_GUIDE.md +2 -2
- package/guides/clj/UIX_TY_GUIDE.md +2 -2
- package/lib/components/select.d.ts +12 -0
- package/lib/components/select.js +88 -11
- package/lib/styles/select-base.js +5 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -2
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tyrell — rules for coding agents
|
|
2
2
|
|
|
3
|
-
For apps that **use** Tyrell (`tyrell-components`, `tyrell-react`, `dev.gersak/tyrell`). Version: 1.0.0-rc.
|
|
3
|
+
For apps that **use** Tyrell (`tyrell-components`, `tyrell-react`, `dev.gersak/tyrell`). Version: 1.0.0-rc.22. Not for editing Tyrell's own source.
|
|
4
4
|
|
|
5
5
|
Your training data barely knows Tyrell; Tailwind/shadcn/Bootstrap habits are wrong here, and these rules win. The full docs for this version (`guides/`, `CHANGELOG.md`) ship next to this file: grep them before guessing.
|
|
6
6
|
|
|
@@ -74,7 +74,7 @@ Below 640px fields drop `lg` to 36 and `xl` to 40 (below 480px `xl` to 36). Butt
|
|
|
74
74
|
- Options are `ty-option` (not `<option>` or `ty-tag`). The selection is the select's `value`; `<ty-option selected>` selects nothing, so server-rendered HTML carries `value="…"`.
|
|
75
75
|
- **Up to 7 options: give it a trigger** (`slot="trigger"`). The search row only appears above 7 options, so a short list doesn't need a form field. In toolbars and filter bars, `compact` is the plain alternative.
|
|
76
76
|
- More options, or typed search: the default field. `external-search` for remote lists, `allow-create` for a tags input.
|
|
77
|
-
- A slotted trigger keeps the value, form submit, ARIA, keyboard and the error line.
|
|
77
|
+
- A slotted trigger keeps the value, form submit, ARIA, keyboard and the error line. A trigger that takes focus (`ty-button`, `clickable` tag) is the tab stop; else the select is. You render the trigger: show the current value in it and update it on `change`. No × button; call `clear()`.
|
|
78
78
|
- The list is at least 320px wide, or as wide as the trigger; `--ty-select-popup-width` sets it.
|
|
79
79
|
- **Status picker:** the trigger is a `ty-tag` in the current option's flavor, with a chevron.
|
|
80
80
|
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.0-rc.22] - 2026-11-12
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`ty-select` with `slot="trigger"`: one tab stop, always visible.** The select's own stub stayed a tab stop next to a focusable trigger, so a `ty-button` trigger took two Tab presses and the first one showed nothing. Now a trigger that can take focus (`ty-button`, a link, a `clickable` `ty-tag`) is the only tab stop, and the element that actually takes focus (inside `ty-button`, its `<button>`; before, the host got the ARIA and screen readers never read it) carries `aria-haspopup`, a live `aria-expanded`, the `aria-invalid` state and, with `label`, the name "Label: value"; a trigger that can't (a plain `ty-tag`) leaves the stub as the tab stop, which now draws a focus ring. `focus()` and Escape land on the same element.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`npx tyrell-components agents`:** writes the rules card of the installed version into the project's `AGENTS.md` between `BEGIN/END:tyrell-agent-rules` markers, so every agent that reads AGENTS.md gets it, and adds `@AGENTS.md` to `CLAUDE.md` for Claude Code. A re-run replaces only the block; `--check` exits 1 when it is missing or for another version.
|
|
19
|
+
|
|
10
20
|
## [1.0.0-rc.21] - 2026-11-11
|
|
11
21
|
|
|
12
22
|
### Added
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Every version ships `AGENTS.md`: the rules agents get wrong without it (use the
|
|
|
27
27
|
```
|
|
28
28
|
@node_modules/tyrell-components/AGENTS.md
|
|
29
29
|
```
|
|
30
|
-
- **
|
|
30
|
+
- **Any agent** (Codex, Cursor, Copilot, Claude Code…): `npx tyrell-components agents` writes the card for the installed version into the project's `AGENTS.md` between markers and makes `CLAUDE.md` import it. Re-run after upgrading; `--check` fails CI when the block is stale. With a CDN pin and no `node_modules`: `npx tyrell-components@<version> agents`.
|
|
31
31
|
- **No `node_modules`** (CDN script tag, server-rendered Clojure/Go/Python): download the copy for your pinned version, import that, and refresh it when you bump the pin:
|
|
32
32
|
```bash
|
|
33
33
|
curl -o TYRELL.md https://cdn.jsdelivr.net/npm/tyrell-components@<version>/AGENTS.md
|
package/bin/tyrell.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* tyrell-components CLI.
|
|
4
|
+
*
|
|
5
|
+
* npx tyrell-components agents write or refresh the Tyrell rules block
|
|
6
|
+
* npx tyrell-components agents --check exit 1 when the block is missing or stale (CI)
|
|
7
|
+
*
|
|
8
|
+
* The block goes into the project's AGENTS.md, which Codex, Cursor, Copilot and
|
|
9
|
+
* most other agents read; CLAUDE.md gets `@AGENTS.md` so Claude Code reads it
|
|
10
|
+
* too. It holds the rules card of the installed version between markers, so a
|
|
11
|
+
* re-run after an upgrade replaces only that block.
|
|
12
|
+
*/
|
|
13
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
14
|
+
import { join } from 'node:path'
|
|
15
|
+
|
|
16
|
+
const [cmd, ...flags] = process.argv.slice(2)
|
|
17
|
+
if (cmd !== 'agents') {
|
|
18
|
+
console.log('Usage: npx tyrell-components agents [--check]')
|
|
19
|
+
process.exit(cmd && cmd !== '--help' ? 1 : 0)
|
|
20
|
+
}
|
|
21
|
+
const check = flags.includes('--check')
|
|
22
|
+
|
|
23
|
+
const read = (url) => { try { return readFileSync(url, 'utf8') } catch { return null } }
|
|
24
|
+
const { version } = JSON.parse(read(new URL('../package.json', import.meta.url)))
|
|
25
|
+
// The published package ships AGENTS.md; in Tyrell's own repo, use the source card.
|
|
26
|
+
const card = read(new URL('../AGENTS.md', import.meta.url)) ??
|
|
27
|
+
read(new URL('../../../guides/AGENT_INSTRUCTIONS.md', import.meta.url))
|
|
28
|
+
?.replace(/<!--(?!\/?tyrell-version)[\s\S]*?-->\n*/g, '')
|
|
29
|
+
.replace(/<!--tyrell-version-->[\s\S]*?<!--\/tyrell-version-->/, version)
|
|
30
|
+
if (!card) {
|
|
31
|
+
console.error('tyrell-components: rules card not found in this package')
|
|
32
|
+
process.exit(1)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const BEGIN = '<!-- BEGIN:tyrell-agent-rules -->'
|
|
36
|
+
const END = '<!-- END:tyrell-agent-rules -->'
|
|
37
|
+
const block = [
|
|
38
|
+
BEGIN,
|
|
39
|
+
`<!-- Managed by \`npx tyrell-components agents\` (tyrell-components ${version}). Re-run it after upgrading Tyrell; edits inside this block are overwritten. -->`,
|
|
40
|
+
'',
|
|
41
|
+
card.trim(),
|
|
42
|
+
END,
|
|
43
|
+
].join('\n')
|
|
44
|
+
|
|
45
|
+
const upsert = (text) => {
|
|
46
|
+
const i = text.indexOf(BEGIN)
|
|
47
|
+
const j = text.indexOf(END)
|
|
48
|
+
if (i >= 0 && j > i) return text.slice(0, i) + block + text.slice(j + END.length)
|
|
49
|
+
return (text.trimEnd() ? `${text.trimEnd()}\n\n` : '') + `${block}\n`
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const root = process.cwd()
|
|
53
|
+
const agentsPath = join(root, 'AGENTS.md')
|
|
54
|
+
const claudePath = join(root, 'CLAUDE.md')
|
|
55
|
+
const agentsBefore = read(agentsPath) ?? ''
|
|
56
|
+
const agentsAfter = upsert(agentsBefore)
|
|
57
|
+
const claudeBefore = read(claudePath)
|
|
58
|
+
// Claude Code skips AGENTS.md once a CLAUDE.md exists, unless CLAUDE.md imports it.
|
|
59
|
+
const claudeAfter = claudeBefore === null ? '@AGENTS.md\n'
|
|
60
|
+
: /^@AGENTS\.md\s*$/m.test(claudeBefore) ? claudeBefore
|
|
61
|
+
: `@AGENTS.md\n\n${claudeBefore}`
|
|
62
|
+
|
|
63
|
+
if (check) {
|
|
64
|
+
const stale = [agentsBefore !== agentsAfter && 'AGENTS.md', claudeBefore !== claudeAfter && 'CLAUDE.md'].filter(Boolean)
|
|
65
|
+
if (stale.length) {
|
|
66
|
+
console.error(`Tyrell rules block missing or not for ${version} in ${stale.join(', ')}: run npx tyrell-components agents`)
|
|
67
|
+
process.exit(1)
|
|
68
|
+
}
|
|
69
|
+
console.log(`Tyrell rules block is current (${version})`)
|
|
70
|
+
process.exit(0)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
writeFileSync(agentsPath, agentsAfter)
|
|
74
|
+
if (claudeAfter !== claudeBefore) writeFileSync(claudePath, claudeAfter)
|
|
75
|
+
console.log(`AGENTS.md: Tyrell ${version} rules ${agentsBefore.includes(BEGIN) ? 'refreshed' : 'added'}`)
|
|
76
|
+
if (claudeAfter !== claudeBefore) console.log(`CLAUDE.md: ${claudeBefore === null ? 'created' : 'now imports'} @AGENTS.md`)
|
|
77
|
+
console.log('Re-run after upgrading Tyrell (or add `npx tyrell-components agents --check` to CI).')
|