@syncline-design/cli 0.1.0-sandbox.46 → 0.1.0-sandbox.48
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 +38 -4
- package/bin.js +1 -1
- package/index.js +7 -7
- package/package.json +1 -1
- package/{run-oaaRlk5Q.js → run-CGTUZWPk.js} +2750 -2328
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
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-
|
|
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-CGTUZWPk.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,
|
|
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 (!
|
|
39
|
-
let p = i.enrichStories.verify ? await
|
|
38
|
+
if (!f) return { status: "skipped" };
|
|
39
|
+
let p = i.enrichStories.verify ? await c({
|
|
40
40
|
...n,
|
|
41
41
|
cachePath: l,
|
|
42
|
-
generate:
|
|
42
|
+
generate: h
|
|
43
43
|
}) : void 0;
|
|
44
44
|
return {
|
|
45
45
|
status: "done",
|
|
46
|
-
proposals:
|
|
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,
|
|
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 };
|