@atelier-ui/create-workspace 0.3.15 → 0.4.1
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 +29 -0
- package/package.json +1 -1
- package/src/generators/preset/files/contracts/README.md +6 -6
- package/src/generators/preset/files/contracts/types.ts.template +9 -10
- package/src/generators/preset/files/storybook/angular/atl-button.stories.ts.template +2 -2
- package/src/generators/preset/files/testing/angular/atl-button.spec.ts.template +2 -2
- package/src/generators/preset/files/tools/{scripts → design-contracts/bin}/check-contracts.mjs +236 -223
- package/src/generators/preset/files/tools/{scripts → design-contracts/bin}/figma-snapshot-contracts.mjs +107 -92
- package/src/generators/preset/files/tools/design-contracts/src/codespec.mjs +234 -0
- package/src/generators/preset/files/tools/design-contracts/src/config.mjs +63 -0
- package/src/generators/preset/files/tools/{scripts/lib → design-contracts/src}/docgen.mjs +78 -98
- package/src/generators/preset/files/tools/{scripts/lib/ts-eval.js → design-contracts/src/ts-eval.cjs} +3 -4
- package/src/generators/preset/files/tools/eslint-rules/atl-button-icon-only-needs-name.js +12 -7
- package/src/generators/preset/preset.js +29 -13
- package/src/generators/preset/preset.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## 0.4.1 (2026-10-09)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **design-contracts:** a boolean axisMap entry needs values unless the axis is true/false ([0e0c7a6a](https://github.com/DominikPieper/atelier-ui/commit/0e0c7a6a))
|
|
6
|
+
- **design-contracts:** tests, snapshot targets a connected file, emit in Figma's terms ([9b92fc4c](https://github.com/DominikPieper/atelier-ui/commit/9b92fc4c))
|
|
7
|
+
- **design-contracts:** extract the contract loop into @conciso/design-contracts ([fd8da23a](https://github.com/DominikPieper/atelier-ui/commit/fd8da23a))
|
|
8
|
+
|
|
9
|
+
### ❤️ Thank You
|
|
10
|
+
|
|
11
|
+
- Claude Opus 5.5
|
|
12
|
+
- Dominik Pieper @DominikPieper
|
|
13
|
+
|
|
14
|
+
## 0.4.0 (2026-10-09)
|
|
15
|
+
|
|
16
|
+
### 🚀 Features
|
|
17
|
+
|
|
18
|
+
- ⚠️ **angular:** AtlButton is a native button, button[atl-button] (ADR-0163) ([a9c3d2b5](https://github.com/DominikPieper/atelier-ui/commit/a9c3d2b5))
|
|
19
|
+
|
|
20
|
+
### ⚠️ Breaking Changes
|
|
21
|
+
|
|
22
|
+
- **angular:** AtlButton is a native button, button[atl-button] (ADR-0163) ([a9c3d2b5](https://github.com/DominikPieper/atelier-ui/commit/a9c3d2b5))
|
|
23
|
+
write <button atl-button> instead of <atl-button>.
|
|
24
|
+
|
|
25
|
+
### ❤️ Thank You
|
|
26
|
+
|
|
27
|
+
- Claude Opus 5.5
|
|
28
|
+
- Dominik Pieper @DominikPieper
|
|
29
|
+
|
|
1
30
|
## 0.3.15 (2026-10-09)
|
|
2
31
|
|
|
3
32
|
### 🚀 Features
|
package/package.json
CHANGED
|
@@ -19,16 +19,16 @@ change and points at the task item tracking it; being drawn makes an entry owed
|
|
|
19
19
|
not decide the answer, and deleting the axis from the master is often the honest one
|
|
20
20
|
(interaction states are CSS pseudo-classes here by convention, ADR-0114).
|
|
21
21
|
|
|
22
|
-
The
|
|
23
|
-
|
|
24
|
-
object literal (no imports of values, no computed members).
|
|
22
|
+
The check (`check-contracts`, from `@conciso/design-contracts`) reads each
|
|
23
|
+
`<name>.contract.ts` statically (it evaluates the literal and never runs the file), so a
|
|
24
|
+
contract must stay a plain object literal (no imports of values, no computed members).
|
|
25
25
|
|
|
26
26
|
Every component story meta whose component has a contract must import it and set
|
|
27
27
|
`contract` in its `parameters` (`docs-block.ts`'s `ContractBlock` reads
|
|
28
28
|
`parameters.contract` to render the "Contract" section on the docs page); a story file
|
|
29
|
-
that has a contract but doesn't wire it in is `[CONTRACT-IMPORT]` —
|
|
30
|
-
`
|
|
31
|
-
scaffolded workspace until it
|
|
29
|
+
that has a contract but doesn't wire it in is `[CONTRACT-IMPORT]` — its severity is the
|
|
30
|
+
`contractImportSeverity` setting in `contracts.config.json` (an error in the Atelier
|
|
31
|
+
monorepo, which ships the block; a warning in a scaffolded workspace until it does).
|
|
32
32
|
|
|
33
33
|
To add one: create `<kebab-selector-without-atl-prefix>.contract.ts` in the contracts
|
|
34
34
|
directory (`AtlButton` → `button.contract.ts`), `import type { ComponentContract } from
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The micro-contract
|
|
2
|
+
* The micro-contract: the ONLY hand-authored spec artefact per
|
|
3
3
|
* component. It records what no derived artefact can know — which Figma master this
|
|
4
4
|
* component is, and where Figma and code differ on purpose. Everything else about the
|
|
5
5
|
* component is derived: props, types, defaults and descriptions from the docgen manifest;
|
|
@@ -12,23 +12,22 @@
|
|
|
12
12
|
* metadata file has failed.
|
|
13
13
|
*
|
|
14
14
|
* Contracts are plain object literals — no imports of values, no computed members — so
|
|
15
|
-
*
|
|
16
|
-
* registry.
|
|
15
|
+
* the check can read them statically (it evaluates the literal, it never runs the file).
|
|
17
16
|
*/
|
|
18
17
|
export interface ComponentContract {
|
|
19
|
-
/** Spec selector, e.g. `'
|
|
18
|
+
/** Spec selector, e.g. `'Button'`. Must equal the master's `selector` in the Figma snapshot. */
|
|
20
19
|
component: string;
|
|
21
|
-
/** The master's `COMPONENT_SET` (or lone `COMPONENT`) node id in the
|
|
20
|
+
/** The master's `COMPONENT_SET` (or lone `COMPONENT`) node id in the Figma file, e.g. `'129:20'`. */
|
|
22
21
|
figmaNodeId: string;
|
|
23
22
|
/**
|
|
24
23
|
* Figma properties — variant axes, Booleans, Texts, instance swaps — that have no code
|
|
25
24
|
* prop on purpose, each with the reason. The `state` axis is NOT listed: interaction
|
|
26
|
-
* states are CSS pseudo-classes by
|
|
25
|
+
* states are CSS pseudo-classes by convention and the check knows it.
|
|
27
26
|
*/
|
|
28
27
|
figmaOnly?: ReadonlyArray<{ name: string; reason: string }>;
|
|
29
28
|
/**
|
|
30
29
|
* Code props or events that have no Figma property on purpose, each with the reason
|
|
31
|
-
* (e.g. `open` — "false renders nothing"
|
|
30
|
+
* (e.g. `open` — "false renders nothing"). Domain: only string-literal enum
|
|
32
31
|
* props — the code's own axes — ever need an entry here, for the same reason
|
|
33
32
|
* `[ENUM-UNDRAWN]` only ever reports enum props. Booleans, strings, numbers, callbacks
|
|
34
33
|
* and events with no Figma counterpart are normal (behaviour and content) and never
|
|
@@ -39,10 +38,10 @@ export interface ComponentContract {
|
|
|
39
38
|
* A Figma axis that maps to a code prop under another name or value set, e.g. the
|
|
40
39
|
* `selection` axis (`checked` | `unchecked`) that is `checked: boolean` in code.
|
|
41
40
|
* Verbatim-equal axes need no entry. `codeProp` may be dotted (`Child.prop`, e.g.
|
|
42
|
-
* `
|
|
41
|
+
* `Step.completed`) when the prop lives on a CHILD component's own manifest rather
|
|
43
42
|
* than the story's primary component — the check resolves it there. Several entries
|
|
44
|
-
* may target the same `figmaAxis` (e.g.
|
|
45
|
-
* different `
|
|
43
|
+
* may target the same `figmaAxis` (e.g. Stepper's `state` axis maps to three
|
|
44
|
+
* different `Step` flags, one entry each).
|
|
46
45
|
*/
|
|
47
46
|
axisMap?: ReadonlyArray<{
|
|
48
47
|
figmaAxis: string;
|
|
@@ -15,7 +15,7 @@ const meta: Meta<AtlButton> = {
|
|
|
15
15
|
tags: ['autodocs'],
|
|
16
16
|
render: (args) => ({
|
|
17
17
|
props: args,
|
|
18
|
-
template: `<atl-button ${argsToTemplate(args)}>Button</
|
|
18
|
+
template: `<button atl-button ${argsToTemplate(args)}>Button</button>`,
|
|
19
19
|
}),
|
|
20
20
|
argTypes: {
|
|
21
21
|
variant: {
|
|
@@ -51,7 +51,7 @@ export const Primary: Story = {
|
|
|
51
51
|
props: { ...args, clicked: false },
|
|
52
52
|
template: `
|
|
53
53
|
<div style="display:flex;flex-direction:column;gap:0.5rem;align-items:flex-start">
|
|
54
|
-
<atl-button ${argsToTemplate(args)} (click)="clicked = true">Button</
|
|
54
|
+
<button atl-button ${argsToTemplate(args)} (click)="clicked = true">Button</button>
|
|
55
55
|
<span>{{ clicked ? 'clicked' : 'not clicked' }}</span>
|
|
56
56
|
</div>
|
|
57
57
|
`,
|
|
@@ -7,7 +7,7 @@ import { AtlButton } from '@atelier-ui/angular';
|
|
|
7
7
|
// story: a service, a directive, a form-validation rule.
|
|
8
8
|
describe('AtlButton', () => {
|
|
9
9
|
it('renders with its accessible name', async () => {
|
|
10
|
-
await render('<atl-button>Click me</
|
|
10
|
+
await render('<button atl-button>Click me</button>', {
|
|
11
11
|
imports: [AtlButton],
|
|
12
12
|
});
|
|
13
13
|
expect(
|
|
@@ -17,7 +17,7 @@ describe('AtlButton', () => {
|
|
|
17
17
|
|
|
18
18
|
it('emits a click event when clicked', async () => {
|
|
19
19
|
const onClick = vi.fn();
|
|
20
|
-
await render('<atl-button (click)="onClick()">Click me</
|
|
20
|
+
await render('<button atl-button (click)="onClick()">Click me</button>', {
|
|
21
21
|
imports: [AtlButton],
|
|
22
22
|
componentProperties: { onClick },
|
|
23
23
|
});
|