@syncline-design/cli 0.1.0-sandbox.46 → 0.1.0-sandbox.47

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), `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 | `.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 |
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.
@@ -58,6 +58,7 @@ Every key is optional; this is the full shape with its defaults. The Figma plugi
58
58
  "enriched": ".figma/design.enriched.json", // absent on disk => raw tier
59
59
  "assets": ".figma/assets.json",
60
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
61
62
  },
62
63
  "paths": {
63
64
  "components": "src/components",
@@ -98,6 +99,19 @@ Every key is optional; this is the full shape with its defaults. The Figma plugi
98
99
  "surfaceToken": "Brand/Grey",
99
100
  },
100
101
  },
102
+ "fonts": {
103
+ "enabled": true, // false: no font loading or font diagnostics (components still read the --font-* variables)
104
+ "files": {
105
+ // fonts that are not on Google Fonts, mapped to files you own (never downloaded or published by Syncline)
106
+ "Acme Sans": [
107
+ {
108
+ "weight": 400,
109
+ "style": "normal",
110
+ "path": "src/fonts/AcmeSans-Regular.woff2",
111
+ },
112
+ ],
113
+ },
114
+ },
101
115
  "dependencies": {
102
116
  "install": false, // true: add missing react/styled-components/Storybook packages with your package manager
103
117
  },
@@ -239,6 +253,26 @@ cache, so a re-run does not ask again. It needs `vitest`, `jsdom` and
239
253
  `@storybook/react` in the project; without them nothing is written and the run
240
254
  says why. Set `verify` to `false` to write the proposals unchecked.
241
255
 
256
+ ## Fonts
257
+
258
+ Components read each font through a CSS custom property with the family name as
259
+ fallback: `font-family: var(--font-inter-tight, 'Inter Tight'), sans-serif`. An app
260
+ binds its own loader (for example `next/font`) to the variable; the library ships
261
+ no font files. See [Fonts](../../docs/fonts/README.md).
262
+
263
+ `generate` asks [Fontsource](https://fontsource.org) (the Google Fonts as npm
264
+ 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.
266
+ `--check` and `--no-enrich` use that file and never go online, and a request that
267
+ fails leaves the family unknown (retried next run), never "missing".
268
+ `syncline fonts` runs just the lookup and lists where each family comes from.
269
+
270
+ The generated Storybook loads what was found (`.storybook/fonts.css`, imported by
271
+ the decorator) and `generate` adds the `@fontsource*` packages to the dependency
272
+ check. A family Fontsource does not have, such as a proprietary font, is reported
273
+ and is yours to load: map your own files in `fonts.files`, or define the variable
274
+ in your app. Syncline never downloads or publishes a font it does not host.
275
+
242
276
  ## Dependencies
243
277
 
244
278
  The generated code imports `react`, `react-dom`, `styled-components` and, with
package/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { r as e } from "./run-oaaRlk5Q.js";
2
+ import { r as e } from "./run-DlUVXv17.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-oaaRlk5Q.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-DlUVXv17.js";
2
2
  import { join as A } from "node:path";
3
3
  //#region src/stories/project-step.ts
4
4
  async function j(n) {
@@ -16,7 +16,7 @@ async function j(n) {
16
16
  status: "no-design",
17
17
  reason: s.error
18
18
  };
19
- let l = A(r, i.inputs.stories), u = n.env ?? process.env, d = await f({
19
+ let l = A(r, i.inputs.stories), u = n.env ?? process.env, f = await d({
20
20
  input: {
21
21
  ...s.input,
22
22
  existing: O(r)
@@ -35,17 +35,17 @@ async function j(n) {
35
35
  fetch: n.fetch,
36
36
  sleep: n.sleep
37
37
  });
38
- if (!d) return { status: "skipped" };
39
- let p = i.enrichStories.verify ? await b({
38
+ if (!f) return { status: "skipped" };
39
+ let p = i.enrichStories.verify ? await c({
40
40
  ...n,
41
41
  cachePath: l,
42
- generate: c
42
+ generate: h
43
43
  }) : void 0;
44
44
  return {
45
45
  status: "done",
46
- proposals: d.size,
46
+ proposals: f.size,
47
47
  ...p && { verified: p }
48
48
  };
49
49
  }
50
50
  //#endregion
51
- export { o as BridgeError, w as CLI_NAME, g as CLI_VERSION, n as CliConfigSchema, i as DEFAULT_CONFIG_FILE, C as applyVerification, E as bridgeClientProvider, T as cachedStoryEnrichment, r as createBridgeClient, k as enrichDesign, v as enrichStories, p as formatFiles, c as generate, D as getBridgeToken, l as hashFacts, m as hashStoryFacts, y as helpText, h as loadCliConfig, u as proposalKeys, d as readStoriesCache, S as run, s as runEnrichStep, j as runProjectStoriesStep, f as runStoriesStep, _ as runVitestHarness, x as selectProposals, b as verifyProposals };
51
+ export { o as BridgeError, w as CLI_NAME, g as CLI_VERSION, n as CliConfigSchema, i as DEFAULT_CONFIG_FILE, b as applyVerification, s as bridgeClientProvider, _ as cachedStoryEnrichment, r as createBridgeClient, E as enrichDesign, x as enrichStories, m as formatFiles, h as generate, D as getBridgeToken, k as hashFacts, v as hashStoryFacts, y as helpText, l as loadCliConfig, C as proposalKeys, T as readStoriesCache, S as run, p as runEnrichStep, j as runProjectStoriesStep, d as runStoriesStep, u as runVitestHarness, f as selectProposals, c as verifyProposals };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncline-design/cli",
3
- "version": "0.1.0-sandbox.46",
3
+ "version": "0.1.0-sandbox.47",
4
4
  "description": "Generates a React component library from a Figma export (Syncline).",
5
5
  "license": "MIT",
6
6
  "repository": {