Repository navigation
Conversation
♿ Accessibility audit — WCAG 2.2 AA✅ No violations across 427 stories / 13664 theme·mode combinations in Automated axe covers ~30–50% of WCAG 2.2 AA. Keyboard, screen-reader and reflow checks still need a manual pass. Full per-story JSON is in the run’s |
5b14248 to
296b2ff
Compare
There was a problem hiding this comment.
I applaud this, more consistent output from AI and much easier to build without AI.
Must admit I did not find the time to read through all skills changes. Scanned the rest and tried out the new & import scripts. Cannot really test the update script as there are no upstream snapshots yet.
| let name = input; | ||
| if (mode === 'new') { | ||
| if (!input.startsWith(HOME_GROWN_PREFIX)) { | ||
| if (spartanPrimitives(repoRoot)[input]) { |
There was a problem hiding this comment.
Why are we only checking for name collisions with Spartan primitives, not shadcn ones?
There was a problem hiding this comment.
Good point, I've changed this to check both
|
|
||
| export function contract(name: string, description: string, axes: Axes): string { | ||
| const id = `${camel(name)}Contract`; | ||
| const entries = Object.entries(axes); |
There was a problem hiding this comment.
Nit; axesEntries is more clear
| export function spartanBlocker(name: string, root: string): string | undefined { | ||
| const primitive = spartanPrimitives(root)[name]; | ||
| if (!primitive) return `The installed @spartan-ng/cli has no "${name}" primitive.`; | ||
|
|
There was a problem hiding this comment.
Will the opposite never be the case (a primitive that exists on Spartan but not on shadcn)?
There was a problem hiding this comment.
It could! Updated this, too
| /** | ||
| * The CLIs "helpfully" bump dependencies and re-write shared files. Snapshot | ||
| * package.json and the tracked source files first, then undo anything that | ||
| * wasn't there before: version bumps of existing deps, unwanted new deps, and | ||
| * edits to tracked files under src/. | ||
| */ | ||
| function startGuard(root: string, framework: Framework) { |
There was a problem hiding this comment.
With the shadcn CLI you can view a component which gives you the file contents & a list of dependencies, in which case we could write & install those ourselves to prevent this somewhat hacky approach of us having to revert changes made by the CLI.
Sadly I can't find something similar for Spartan.
There was a problem hiding this comment.
Updated this for shadcn
| { | ||
| "react-story": ["command"], | ||
| "angular-story": ["command"], | ||
| "story-title-parity": ["dropdown-menu", "input-group"] | ||
| } |
There was a problem hiding this comment.
Would be nice to know why these are in the allowlist.
There was a problem hiding this comment.
I've added a "reason" key/value to clarify!
| : {}; | ||
| const allowed = (v: Violation) => allowlist[v.rule]?.includes(v.subject) ?? false; | ||
|
|
||
| const errors = violations.filter((v) => !allowed(v)); |
There was a problem hiding this comment.
Ideally you'd only allow subject-rule combinations. Now if there are new violations in an allowed subject you'd never see them because all violations are allowed for that subject.
| "new:component": "jiti scripts/new-component.ts", | ||
| "import:component": "jiti scripts/import-component.ts", | ||
| "update:component": "jiti scripts/update-component.ts", |
There was a problem hiding this comment.
Looking at different script variants (like the test: scripts), I'd expect these scripts to be called component:new, component:import and component:update.
There was a problem hiding this comment.
Renamed them, good point!
Turns rules that only lived in AGENTS.md and the skills into a check: barrels, package exports, stories and contracts per component, no leftover Tailwind in React or Angular component code, no TODOs in contracts, and matching React/Angular story titles. Known exceptions are listed in scripts/conventions.allowlist.json.
Scaffolds a component in contracts plus React and/or Angular: vendors it with the shadcn or Spartan CLI, writes the barrel, package exports, CSS and story stubs, and saves a pristine upstream copy in .upstream/. Also undoes CLI side effects: dependency bumps, the bogus `cn` package and import from the shadcn registry, tw-animate-css, duplicate copies of components Curve already vendors, and edits to other tracked files. Refuses up front when the component exists or Spartan needs a newer @spartan-ng/brain than the repo has.
Lead with pnpm new:component / update:component / check:conventions and keep the manual playbooks as the reference and fallback. Also remove the duplicated refresh paragraphs in AGENTS.md, correct the React style (base-vega), note that autodocs is set project-wide in preview.ts, and document the Spartan CLI/brain version split.
…stom Home-grown components (curve-<name>, like curve-data-table) have no upstream CLI to vendor from. With --custom the generator skips the CLIs and the .upstream/ snapshot and writes a small working component instead: each contract axis becomes a typed prop that sets a data-* attribute, with a CSS rule stub per value and Playground + per-axis stories named the same in both frameworks. The curve- prefix is required with --custom (and rejected without it), so home-grown names never collide with upstream components. update:component now says there is no upstream to merge for curve-* components.
move the manual steps into a separate fallback file that agents read only when the script can’t be used. Fail if there’s no —description for a new component so if an agent is used, the script doesn’t stall Signed-off-by: Anneke Sinnema <[email protected]>
296b2ff to
578315c
Compare
Signed-off-by: Anneke Sinnema <[email protected]>
Signed-off-by: Anneke Sinnema <[email protected]>
component:import and component:new now check shadcn as well as Spartan, and say which upstream has a component. React vendoring asks 'shadcn add --dry-run' what it would write and writes only the component, so there are no CLI side effects to undo.
Summary
Add scripts to add and update components, which can be run manually instead of using AI for simple tasks.
Type of change
Checklist
pnpm build,pnpm lint, andpnpm formatpasspnpm test:visual:updateafterpnpm build-storybook) if appearance changedpnpm changeset) — required for any change to@surfnet/curve-reactor@surfnet/curve-angular; N/A for docs/CI-only changes@surfnet/curve-contracts)