@atelier-ui/create-workspace 0.3.12 → 0.3.14
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 0.3.14 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **check-contracts:** code-only facts are description lines, checked both ways (ADR-0161) ([fb5ac153](https://github.com/DominikPieper/atelier-ui/commit/fb5ac153))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Claude Opus 5.5
|
|
10
|
+
- Dominik Pieper @DominikPieper
|
|
11
|
+
|
|
12
|
+
## 0.3.13 (2026-10-08)
|
|
13
|
+
|
|
14
|
+
This was a version bump only for create-workspace to align it with other projects, there were no code changes.
|
|
15
|
+
|
|
1
16
|
## 0.3.12 (2026-10-08)
|
|
2
17
|
|
|
3
18
|
### 🚀 Features
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"selector": "AtlButton",
|
|
10
10
|
"nodeId": "129:20",
|
|
11
11
|
"name": "Inputs/AtlButton",
|
|
12
|
-
"description": "Action button. Maps to AtlButtonSpec in libs/spec.\n\nUse when: a user-initiated action — submit, save, delete, navigate. Pick the visual based on hierarchy: `primary` for the screen's main action (one per screen), `secondary` for supporting actions, `outline` for tertiary/inline, `danger` for destructive actions (delete, irreversible).\n\nDon't use when: the action is a navigation link (use a real `<a>` element, not a styled button), the choice is between two states (use Form/AtlToggle), or the user is filling a form field (use Form/AtlInput / Form/AtlSelect).\n\nAPI surface (Figma → spec):\n- Variant `variant`: primary | secondary | outline | danger — maps to AtlButtonSpec.variant\n- Variant `size`: sm | md | lg — maps to AtlButtonSpec.size\n- Variant `state`: default | hover | focus | active — interaction state\n- Text `label`: not a property — the label is the button's content (default slot / `children` / `<ng-content>`), not a field of AtlButtonSpec. Bound to both the label and the disabled overlay's label, so one override drives both\n- Boolean `disabled`: maps to AtlButtonSpec.disabled — shows `_disabled-overlay`, an opaque layer in `color/disabled-bg` / `-border` / `-text` (ADR-0159; not an opacity wash, which kept the brand hue in dark mode)\n- Boolean `loading`: maps to AtlButtonSpec.loading — shows the spinner in `color/disabled-text`. In code loading always disables the button, so set `disabled` too\n- Boolean `hasIcon`: toggles the leading icon slot (Instance Swap → Icon library)\n\nA11y: native HTML <button>. When the button has no visible label (icon-only), supply `aria-label` — required by spec. Disabled state uses HTML `disabled` (not aria-disabled) for buttons since they're never expected to remain in the tab order.\n\nStatus: structural restructure 2026-04-27 — `state` enum slimmed to interaction (default/hover/focus/active); `loading` and `disabled` moved out as Booleans matching AtlButtonSpec; `hasIcon` Boolean added for icon-slot toggle.\n\nDeclared Boolean properties that reference no layer (2026-08-27, ADR-0058). check:figma reads these lines, so the reason is stated where a designer opening the master sees it:\n- Boolean `hasIcon`: declared but unbound — and it maps to nothing: `AtlButtonSpec` has no `hasIcon`. It is a Figma-side slot toggle for placing an Icon instance, which is a legitimate authoring affordance but not part of the component contract. Bind it to the icon slot layer when that slot exists, or drop it.",
|
|
12
|
+
"description": "Action button. Maps to AtlButtonSpec in libs/spec.\n\nUse when: a user-initiated action — submit, save, delete, navigate. Pick the visual based on hierarchy: `primary` for the screen's main action (one per screen), `secondary` for supporting actions, `outline` for tertiary/inline, `danger` for destructive actions (delete, irreversible).\n\nDon't use when: the action is a navigation link (use a real `<a>` element, not a styled button), the choice is between two states (use Form/AtlToggle), or the user is filling a form field (use Form/AtlInput / Form/AtlSelect).\n\nAPI surface (Figma → spec):\n- Variant `variant`: primary | secondary | outline | danger — maps to AtlButtonSpec.variant\n- Variant `size`: sm | md | lg — maps to AtlButtonSpec.size\n- Variant `state`: default | hover | focus | active — interaction state\n- Text `label`: not a property — the label is the button's content (default slot / `children` / `<ng-content>`), not a field of AtlButtonSpec. Bound to both the label and the disabled overlay's label, so one override drives both\n- Boolean `disabled`: maps to AtlButtonSpec.disabled — shows `_disabled-overlay`, an opaque layer in `color/disabled-bg` / `-border` / `-text` (ADR-0159; not an opacity wash, which kept the brand hue in dark mode)\n- Boolean `loading`: maps to AtlButtonSpec.loading — shows the spinner in `color/disabled-text`. In code loading always disables the button, so set `disabled` too\n- Boolean `hasIcon`: toggles the leading icon slot (Instance Swap → Icon library)\n\nA11y: native HTML <button>. When the button has no visible label (icon-only), supply `aria-label` — required by spec. Disabled state uses HTML `disabled` (not aria-disabled) for buttons since they're never expected to remain in the tab order.\n\nStatus: structural restructure 2026-04-27 — `state` enum slimmed to interaction (default/hover/focus/active); `loading` and `disabled` moved out as Booleans matching AtlButtonSpec; `hasIcon` Boolean added for icon-slot toggle.\n\nDeclared Boolean properties that reference no layer (2026-08-27, ADR-0058). check:figma reads these lines, so the reason is stated where a designer opening the master sees it:\n- Boolean `hasIcon`: declared but unbound — and it maps to nothing: `AtlButtonSpec` has no `hasIcon`. It is a Figma-side slot toggle for placing an Icon instance, which is a legitimate authoring affordance but not part of the component contract. Bind it to the icon slot layer when that slot exists, or drop it.\n\nCode-only props (no Figma property on purpose; check:contracts reads these lines against the contract's codeOnly):\n- Code-only `type`: native button type (button | submit | reset) — form semantics the element always carries, not a visual axis.",
|
|
13
13
|
"variantAxes": {
|
|
14
14
|
"variant": [
|
|
15
15
|
"primary",
|
|
@@ -86,6 +86,24 @@ const INTERACTION_STATE_VALUES = new Set([
|
|
|
86
86
|
|
|
87
87
|
const UNRESOLVABLE = Symbol('unresolvable');
|
|
88
88
|
|
|
89
|
+
// Master-description mirror grammar for contract `codeOnly` entries. A `codeOnly` entry
|
|
90
|
+
// `x` is mirrored only by a line "- Code-only `x`: <reason>" (non-empty reason) or by the
|
|
91
|
+
// existing opt-out line "- Boolean `x`: not modelled — <reason>" that check-figma.js
|
|
92
|
+
// parses (same shape). Substring mentions in prose prove nothing.
|
|
93
|
+
function hasCodeOnlyMirror(description, name) {
|
|
94
|
+
const n = escapeRegExp(name);
|
|
95
|
+
return new RegExp(
|
|
96
|
+
`^- Code-only \`${n}\`:\\s*\\S|^- Boolean \`${n}\`:\\s*not modelled\\s*[\\u2014-]\\s*\\S`,
|
|
97
|
+
'm',
|
|
98
|
+
).test(description || '');
|
|
99
|
+
}
|
|
100
|
+
// Names of every "- Code-only `x`:" line in a master description (reverse direction).
|
|
101
|
+
function codeOnlyLineNames(description) {
|
|
102
|
+
return [...(description || '').matchAll(/^- Code-only `([^`]+)`:/gm)].map(
|
|
103
|
+
(m) => m[1],
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
89
107
|
const TAG_LEVEL = {
|
|
90
108
|
'CONTRACT-MISSING': 'error',
|
|
91
109
|
'CONTRACT-DUPLICATE': 'error',
|
|
@@ -104,6 +122,7 @@ const TAG_LEVEL = {
|
|
|
104
122
|
'DOCGEN-FAILED': 'error',
|
|
105
123
|
'UNRESOLVED-ARGS': 'warning',
|
|
106
124
|
UNMIRRORED: 'warning',
|
|
125
|
+
'STALE-MIRROR': 'warning',
|
|
107
126
|
'NO-STORY-META': 'warning',
|
|
108
127
|
ROSTER: 'error',
|
|
109
128
|
// 'CONTRACT-IMPORT' is set below, once CONTRACTS_DIR is resolved — its
|
|
@@ -368,11 +387,11 @@ function runGlobalChecks() {
|
|
|
368
387
|
`${selector}: codeOnly '${entry.name}' reason is UNEXPLAINED`,
|
|
369
388
|
);
|
|
370
389
|
}
|
|
371
|
-
if (!(master.description
|
|
390
|
+
if (!hasCodeOnlyMirror(master.description, entry.name)) {
|
|
372
391
|
report(
|
|
373
392
|
'UNMIRRORED',
|
|
374
393
|
null,
|
|
375
|
-
`${selector}: codeOnly '${entry.name}'
|
|
394
|
+
`${selector}: codeOnly '${entry.name}' has no "- Code-only \`${entry.name}\`: <reason>" line in the master description`,
|
|
376
395
|
);
|
|
377
396
|
}
|
|
378
397
|
}
|
|
@@ -1312,16 +1331,22 @@ function processComponent(
|
|
|
1312
1331
|
|
|
1313
1332
|
// ── codeOnly staleness (R1d: cross-framework — tracked here, evaluated once after
|
|
1314
1333
|
// every requested framework has run, in runCodeOnlyStalenessChecks()) ──
|
|
1315
|
-
|
|
1334
|
+
// The same lookup also covers names that only appear in a master-description
|
|
1335
|
+
// "- Code-only `x`:" line, for the reverse check (STALE-MIRROR).
|
|
1336
|
+
const trackedNames = new Set([
|
|
1337
|
+
...((contract && contract.codeOnly) || []).map((e) => e.name),
|
|
1338
|
+
...codeOnlyLineNames(master && master.description),
|
|
1339
|
+
]);
|
|
1340
|
+
for (const entryName of trackedNames) {
|
|
1316
1341
|
const present =
|
|
1317
|
-
propByName.has(
|
|
1318
|
-
docgenProps.some((p) => p.isOutput && p.name ===
|
|
1342
|
+
propByName.has(entryName) ||
|
|
1343
|
+
docgenProps.some((p) => p.isOutput && p.name === entryName);
|
|
1319
1344
|
if (!present) continue;
|
|
1320
1345
|
if (!codeOnlyPresentByFw.has(name))
|
|
1321
1346
|
codeOnlyPresentByFw.set(name, new Map());
|
|
1322
1347
|
const byEntry = codeOnlyPresentByFw.get(name);
|
|
1323
|
-
if (!byEntry.has(
|
|
1324
|
-
byEntry.get(
|
|
1348
|
+
if (!byEntry.has(entryName)) byEntry.set(entryName, new Set());
|
|
1349
|
+
byEntry.get(entryName).add(fw);
|
|
1325
1350
|
}
|
|
1326
1351
|
}
|
|
1327
1352
|
|
|
@@ -1588,6 +1613,23 @@ async function runFramework(fw) {
|
|
|
1588
1613
|
// covers "the contract exists but nothing resolves to it".
|
|
1589
1614
|
function runCodeOnlyStalenessChecks() {
|
|
1590
1615
|
const singleFwRun = targetFrameworks.length === 1;
|
|
1616
|
+
// Reverse mirror check: every "- Code-only `x`:" line in a master description must
|
|
1617
|
+
// name a prop/input/event present in at least one reached framework's manifest.
|
|
1618
|
+
for (const [selector, reached] of reachedByFw) {
|
|
1619
|
+
if (reached.size === 0) continue;
|
|
1620
|
+
const master = snapshotBySelector.get(selector);
|
|
1621
|
+
for (const lineName of codeOnlyLineNames(master && master.description)) {
|
|
1622
|
+
const present =
|
|
1623
|
+
(codeOnlyPresentByFw.get(selector) || new Map()).get(lineName) ||
|
|
1624
|
+
new Set();
|
|
1625
|
+
if (present.size > 0) continue;
|
|
1626
|
+
report(
|
|
1627
|
+
'STALE-MIRROR',
|
|
1628
|
+
null,
|
|
1629
|
+
`${selector}: master description has a "- Code-only \`${lineName}\`:" line but no manifest prop/input/event of that name (checked: ${[...reached].sort().join(', ')})`,
|
|
1630
|
+
);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1591
1633
|
for (const [selector, contract] of contractsBySelector) {
|
|
1592
1634
|
const reached = reachedByFw.get(selector);
|
|
1593
1635
|
if (!reached || reached.size === 0) continue;
|