synthesisui 0.16.40 → 0.16.42

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.
@@ -38,6 +38,10 @@ const SKIP = new Set([
38
38
  "build",
39
39
  "out",
40
40
  "coverage",
41
+ // Storybook's build output. Its bundled manager JS carries Storybook's OWN
42
+ // brand palette, and a census of a component library came back led by
43
+ // #1EA7FD and #FF4785 - Storybook's blue and pink, not the library's.
44
+ "storybook-static",
41
45
  ".turbo",
42
46
  ".vercel",
43
47
  // Our own installed artifacts are the answer, not the problem.
@@ -61,9 +65,16 @@ skippedProjects) {
61
65
  if (e.isDirectory()) {
62
66
  if (SKIP.has(e.name))
63
67
  continue;
64
- // A CHILD directory carrying its own _synthesisui is a separately
68
+ // A CHILD directory carrying its own INSTALLED SYSTEM is a separately
65
69
  // governed project - its record, its doctor, its numbers.
66
- const governed = await readdir(join(full, "_synthesisui")).then(() => true, () => false);
70
+ //
71
+ // The test used to be "does `_synthesisui/` exist", and that folder holds
72
+ // more than a system: `import --dry` writes a census into it. So the
73
+ // recommended sequence defeated itself (dono, 30/07) - importing from
74
+ // `packages/ui` left a census there, and the next `doctor apps/…` skipped
75
+ // the shared package as if it governed itself, taking its 92 tokens with
76
+ // it. Governance means an installed system, which is `ds/`.
77
+ const governed = await readdir(join(full, "_synthesisui", "ds")).then((entries) => entries.length > 0, () => false);
67
78
  if (governed) {
68
79
  skippedProjects?.push(full);
69
80
  continue;
@@ -359,7 +370,20 @@ export async function doctor(opts) {
359
370
  // Nothing of ours here does not mean nothing to measure against. Fall back
360
371
  // to whatever vocabulary the project already declares for itself.
361
372
  if (table.byName.size === 0) {
362
- table = await harvestOwnTokens(scopes.length > 0 ? scopes : [root]);
373
+ /**
374
+ * THEIR VOCABULARY IS REPO-WIDE, even when the READING is scoped.
375
+ *
376
+ * A path argument scopes what gets measured; it must not scope what counts
377
+ * as named. Measured on a real monorepo (dono, 30/07):
378
+ * `doctor apps/web-dashboard` found 28 tokens and missed the 112 that live
379
+ * in `packages/ui` - the shared package that IS that company's design
380
+ * system. Every value the app borrows from it was reported as having no
381
+ * name, which inverts the one sentence this command exists to say.
382
+ *
383
+ * Same rule our own installed system already follows: found from the root,
384
+ * measured in the scope.
385
+ */
386
+ table = await harvestOwnTokens([root]);
363
387
  }
364
388
  const hasSystem = table.byName.size > 0;
365
389
  const reports = [];
@@ -235,7 +235,17 @@ const IDIOM = new Set(["0", "0px", "1px", "9999px", "100%", "50%"]);
235
235
  * spec is the TEST, not drift. Every real project has these; accusing them
236
236
  * buried the report's real findings under 99 phantom lines the first time
237
237
  * the doctor ran on a repo with its own test suite (30/07). */
238
- const IS_FIXTURE = /(\.(spec|test)\.[a-z]+$|__tests__\/|\/fixtures?\/)/;
238
+ /**
239
+ * Files whose colours are not the product's.
240
+ *
241
+ * Tests and fixtures were always here. STORIES joined them after a component
242
+ * library was imported and its census came back describing demo content
243
+ * (dono, 30/07): a story paints a plausible article, a fake avatar, a swatch
244
+ * grid - values chosen to show the component off, never shipped to anyone.
245
+ * Counting them accuses the author of drift they did not write, and crediting
246
+ * them inflates a coverage number nobody can act on.
247
+ */
248
+ const IS_FIXTURE = /(\.(spec|test|stories)\.[a-z]+$|__tests__\/|\/fixtures?\/|(^|\/)\.storybook\/)/;
239
249
  export function scanSource(file, source, table) {
240
250
  if (IS_FIXTURE.test(file)) {
241
251
  const real = scanCore(file, source, table);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.40",
3
+ "version": "0.16.42",
4
4
  "description": "Bring SynthesisUI design systems into any project - tokens, typed components, whole pages and an agent-ready CLAUDE.md manifest.",
5
5
  "type": "module",
6
6
  "bin": {