@syncline-design/cli 0.1.0-sandbox.52 → 0.1.0-sandbox.54

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/README.md CHANGED
@@ -19,10 +19,10 @@ Until the first stable release only the `sandbox` tag exists.
19
19
 
20
20
  ## What it reads and writes
21
21
 
22
- | | |
23
- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
- | Reads | `.figma/design.json` (required), `.figma/assets.json`, `.figma/annotations.json` and `.figma/design.enriched.json` (optional), `.figma/fonts.resolved.json` (optional, written by the font lookup), `syncline.config.json` (optional) |
25
- | Writes | components, stories, vector assets, the theme and its `ThemeProvider`, Storybook docs and wiring (`.storybook/`), and the `tsconfig.json` entry for the theme typings |
22
+ | | |
23
+ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | Reads | `.syncline/design.json` (required), `.syncline/assets.json`, `.syncline/annotations.json` and `.syncline/design.enriched.json` (optional), `.syncline/fonts.resolved.json` (optional, written by the font lookup), `syncline.config.json` (optional) |
25
+ | Writes | components, stories, vector assets, the theme and its `ThemeProvider`, Storybook docs and wiring (`.storybook/`), and the `tsconfig.json` entry for the theme typings |
26
26
 
27
27
  Output is formatted with **your own prettier config**, so it matches what your
28
28
  commit hooks produce and a re-run shows no formatting churn.
@@ -31,15 +31,31 @@ Hand-editable files are written once and never overwritten unless you ask:
31
31
  stories (`stories.overwrite`), docs guidelines (`docs.overwriteGuidelines`) and
32
32
  a hand-written `.storybook/manager.ts`.
33
33
 
34
+ ## Upgrading from `.figma/`
35
+
36
+ Earlier versions kept the Figma export in a `.figma/` folder. It is now
37
+ `.syncline/` (the folder is named after the tool, not after Figma), and the CLI
38
+ no longer reads `.figma/`. In a repository that still has it:
39
+
40
+ ```bash
41
+ git mv .figma .syncline
42
+ ```
43
+
44
+ If a sync seeded `.github/workflows/syncline.yml` earlier, delete it and sync
45
+ again: the old file only watches `.figma/**`, so it would never run for the new
46
+ folder. A `syncline.config.json` that spells out `inputs.*` or `merge.baseDir`
47
+ with the old paths needs the same one-word change.
48
+
34
49
  ## Options
35
50
 
36
- | Option | |
37
- | ----------------- | ----------------------------------------------------------------------------------------------- |
38
- | `--config <file>` | Config file (default `syncline.config.json`; every setting has a default, so no file is needed) |
39
- | `--cwd <dir>` | Project root (default: the current directory) |
40
- | `--check` | Drift check for CI: nothing is written; exit 1 if the output differs from what is on disk |
41
- | `--verbose` | List every warning instead of a per-phase count |
42
- | `--accept <path>` | After a merge conflict you resolved by hand: keep the file and record the new base (repeatable) |
51
+ | Option | |
52
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
53
+ | `--config <file>` | Config file (default `syncline.config.json`; every setting has a default, so no file is needed) |
54
+ | `--cwd <dir>` | Project root (default: the current directory) |
55
+ | `--check` | Drift check for CI: nothing is written; exit 1 if the output differs from what is on disk |
56
+ | `--verbose` | List every warning instead of a per-phase count |
57
+ | `--overwrite-stories` | For this run only, rewrite stories files that already exist so they get the proposed `play()` stories (replaces hand edits to those files; the config is untouched) |
58
+ | `--accept <path>` | After a merge conflict you resolved by hand: keep the file and record the new base (repeatable) |
43
59
 
44
60
  Warnings are design feedback (for example a fill that is not bound to a Figma
45
61
  variable), never failures.
@@ -54,11 +70,11 @@ Every key is optional; this is the full shape with its defaults. The Figma plugi
54
70
  "styling": "styled-components",
55
71
  "libraryName": "design-system", // names the docs and the Storybook chrome
56
72
  "inputs": {
57
- "design": ".figma/design.json",
58
- "enriched": ".figma/design.enriched.json", // absent on disk => raw tier
59
- "assets": ".figma/assets.json",
60
- "annotations": ".figma/annotations.json", // the designer's intents; absent => none
61
- "fonts": ".figma/fonts.resolved.json", // where each font can be loaded from; commit it
73
+ "design": ".syncline/design.json",
74
+ "enriched": ".syncline/design.enriched.json", // absent on disk => raw tier
75
+ "assets": ".syncline/assets.json",
76
+ "annotations": ".syncline/annotations.json", // the designer's intents; absent => none
77
+ "fonts": ".syncline/fonts.resolved.json", // where each font can be loaded from; commit it
62
78
  },
63
79
  "paths": {
64
80
  "components": "src/components",
@@ -81,12 +97,12 @@ Every key is optional; this is the full shape with its defaults. The Figma plugi
81
97
  },
82
98
  "merge": {
83
99
  "enabled": false, // keep hand edits to generated components when the design changes
84
- "baseDir": ".figma/base", // the last generated version of each component; commit it
100
+ "baseDir": ".syncline/base", // the last generated version of each component; commit it
85
101
  "llm": false, // paid: let the bridge resolve what a 3-way merge can't
86
102
  "sendSource": false, // required with llm: the conflicting files' source is sent to the bridge
87
103
  },
88
104
  "enrichStories": {
89
- "enabled": false, // paid: AI-proposed stories with play() tests, for components with no stories file yet
105
+ "enabled": true, // part of generating stories; the plan decides at run time (paid), false opts out
90
106
  "verify": true, // run each proposed story (jsdom, your Vitest) and write only the ones that pass
91
107
  },
92
108
  "theme": {
@@ -232,16 +248,19 @@ credentials or the paid plan just reports the conflicts.
232
248
 
233
249
  ## AI-proposed stories (`enrichStories`)
234
250
 
235
- With `enrichStories.enabled` (a paid feature) the CLI asks the bridge for extra
236
- stories with `play()` interaction tests, for every component that has no stories
237
- file yet. **Only facts leave the repo**: prop names and closed option lists, and
251
+ Proposing extra stories with `play()` interaction tests is part of generating
252
+ the stories (`enrichStories.enabled` is on by default; `false` opts out). It is a
253
+ paid feature and the plan decides at run time: on an account without it the bridge
254
+ says no, the CLI prints why and writes the plain stories, so an upgrade needs no
255
+ config change. The CLI asks for every component that has no stories file yet. **Only facts leave the repo**: prop names and closed option lists, and
238
256
  the roles and texts a story can act on; no source code. The model's answer is
239
257
  data that the CLI validates against the real component (props, options and
240
258
  targets must exist) before it renders the `play()` with `storybook/test`, so
241
259
  whatever the model gets wrong is dropped, not written. Answers are cached in
242
- `.figma/stories.enriched.json` (commit it), `--check` and `--no-enrich` never
260
+ `.syncline/stories.enriched.json` (commit it), `--check` and `--no-enrich` never
243
261
  call the bridge, and a run without a bridge, credentials or the paid plan just
244
- writes the plain stories. An existing stories file is never rewritten.
262
+ writes the plain stories. An existing stories file is never rewritten, unless you
263
+ run `syncline generate --overwrite-stories` once to upgrade the files you already have.
245
264
 
246
265
  **Every proposed story is run before it is written** (`enrichStories.verify`, on
247
266
  by default). The model cannot know what a component really does, and in a first
@@ -250,7 +269,8 @@ the project, runs them headless with the project's own Vitest (jsdom, your
250
269
  `vite.config.*` and `.storybook/preview`, Storybook's portable stories), keeps
251
270
  the ones that pass and records the rest, with the reason, under `rejected` in the
252
271
  cache, so a re-run does not ask again. It needs `vitest`, `jsdom` and
253
- `@storybook/react` in the project; without them nothing is written and the run
272
+ `@storybook/react` in the project (the dependency check lists them, and
273
+ `dependencies.install` adds them); without them nothing is written and the run
254
274
  says why. Set `verify` to `false` to write the proposals unchecked.
255
275
 
256
276
  ## Fonts
@@ -262,7 +282,7 @@ no font files. See [Fonts](../../docs/fonts/README.md).
262
282
 
263
283
  `generate` asks [Fontsource](https://fontsource.org) (the Google Fonts as npm
264
284
  packages) about each family it has not seen and records the answer, "not found"
265
- included, in `.figma/fonts.resolved.json`; commit it so a re-run needs no network.
285
+ included, in `.syncline/fonts.resolved.json`; commit it so a re-run needs no network.
266
286
  `--check` and `--no-enrich` use that file and never go online, and a request that
267
287
  fails leaves the family unknown (retried next run), never "missing".
268
288
  `syncline fonts` runs just the lookup and lists where each family comes from.
@@ -294,7 +314,7 @@ generated files are stale:
294
314
  name: synclineon:
295
315
  push:
296
316
  branches: [main]
297
- paths: ['.figma/**', 'syncline.config.json']
317
+ paths: ['.syncline/**', 'syncline.config.json']
298
318
  pull_request:
299
319
 
300
320
  jobs:
@@ -342,7 +362,7 @@ permissions:
342
362
 
343
363
  How a run behaves:
344
364
 
345
- - The result is written to `.figma/design.enriched.json`, which is also the
365
+ - The result is written to `.syncline/design.enriched.json`, which is also the
346
366
  cache: a component is only sent again when its facts or the bridge's prompt
347
367
  version change. Commit the file, so the next run (and `--check`) reuses it.
348
368
  - A component that fails is retried once, then left on the raw tier and retried
@@ -354,7 +374,7 @@ How a run behaves:
354
374
 
355
375
  ## Annotation overlay
356
376
 
357
- `.figma/annotations.json` holds the same annotation lines a Figma component
377
+ `.syncline/annotations.json` holds the same annotation lines a Figma component
358
378
  description can carry (`@select`, `@input search`, `@continuous Progress 0..100`,
359
379
  see the generated _Figma annotations_ guideline), keyed by the component's Figma
360
380
  key, plus page entries (`@iconset` / `@iconset off`) for icon-set merging. The
package/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { r as e } from "./run-B6_BdS7j.js";
2
+ import { r as e } from "./run-Bx68LVYw.js";
3
3
  //#region src/bin.ts
4
4
  e(process.argv.slice(2), {
5
5
  out: (e) => process.stdout.write(e),
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, k as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, w as D, x as O, y as k } from "./run-B6_BdS7j.js";
1
+ import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, k as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, w as D, x as O, y as k } from "./run-Bx68LVYw.js";
2
2
  import { join as A } from "node:path";
3
3
  //#region src/stories/project-step.ts
4
4
  async function j(n) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncline-design/cli",
3
- "version": "0.1.0-sandbox.52",
3
+ "version": "0.1.0-sandbox.54",
4
4
  "description": "Generates a React component library from a Figma export (Syncline).",
5
5
  "license": "MIT",
6
6
  "repository": {