@designtools/manifest 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,577 @@
1
+ import ts from 'typescript';
2
+
3
+ /**
4
+ * The manifest schema: what `designtools-manifest build` writes to
5
+ * `<system>/manifest/`: components.json, tokens.json, rules.json,
6
+ * patterns.json, taxonomy.json and assets.json.
7
+ *
8
+ * This file has no imports on purpose. @designtools/blocks carries a byte-identical
9
+ * copy, so a project's docs read the manifest through the same types the tool
10
+ * wrote it with, and a test in this repo fails if the two drift.
11
+ *
12
+ * Every path is relative to the project root, with forward slashes. Arrays keep
13
+ * source order where order means something (variant axes, fixture states, token
14
+ * ramps); everything else is sorted, so a diff of the files shows only real changes.
15
+ */
16
+ declare const MANIFEST_SCHEMA = "designtools.manifest/1";
17
+ /** What every manifest file opens with. */
18
+ interface ManifestFile {
19
+ /** `@designtools/manifest@<version>`, so `check` can tell a tool upgrade from an edit. */
20
+ generator: string;
21
+ schema: string;
22
+ }
23
+ /** components.json */
24
+ interface ComponentsManifest extends ManifestFile {
25
+ /** The system folder the components were read from. */
26
+ system: string;
27
+ /** Sorted by name, then source. */
28
+ components: ComponentEntry[];
29
+ }
30
+ interface ComponentEntry {
31
+ /** The export name, or `@name` when the JSDoc gives one. */
32
+ name: string;
33
+ /** The exported identifier to import. Equals `name` unless `@name` renamed it. */
34
+ export: string;
35
+ /** The file that exports it. */
36
+ source: string;
37
+ /**
38
+ * The module specifier an app imports it by, through the tsconfig path alias
39
+ * that reaches the system folder (`@ds/button/button`). Absent when no alias does,
40
+ * in which case `source` is the only honest answer.
41
+ */
42
+ import?: string;
43
+ /** The component's JSDoc, or its variant config's when the component has none. */
44
+ description?: string;
45
+ /** `@category`. Blocks group components without one under "Components". */
46
+ category?: string;
47
+ /** `@status`, or `deprecated` from `@deprecated`. Absent until someone decides it. */
48
+ status?: Status;
49
+ /** Why it has that status: the `@deprecated` reason, or text after `@status`. */
50
+ statusNote?: string;
51
+ /** `@use`, `@avoid`, `@instead`: when to reach for it, when not, and what instead. */
52
+ usage?: Usage;
53
+ /** `@example` snippets in the JSDoc, each one JSX. */
54
+ snippets?: string[];
55
+ /** `@see`, each one a link or a component name. */
56
+ see?: string[];
57
+ /** `@primitive`: the primitive it wraps, as a link or a package path. */
58
+ primitive?: string;
59
+ /** `@aria`: the ARIA pattern it follows, usually a link. */
60
+ aria?: string;
61
+ /** `@role` and `@keyboard`: what assistive technology meets, and the keys it answers. */
62
+ a11y?: {
63
+ role?: string;
64
+ keyboard?: string[];
65
+ };
66
+ /** `@replaces`: raw elements this component stands in for, which the adherence report counts. */
67
+ replaces?: string[];
68
+ /**
69
+ * What it also accepts beyond its own props: an intrinsic element (`"span"`)
70
+ * or a wrapped primitive (`"@base-ui/react/select:Root"`).
71
+ */
72
+ inherits?: string[];
73
+ /** Its own props, and those of a primitive it wraps. Inherited DOM props are left out. */
74
+ props: Record<string, PropEntry>;
75
+ /** Absent when it has no variants by any route. */
76
+ variants?: VariantsEntry;
77
+ /** Every `data-slot` it renders, sorted. */
78
+ slots: string[];
79
+ /** Absent when the component has no examples file. */
80
+ examples?: ExamplesEntry;
81
+ }
82
+ type Status = "stable" | "emerging" | "deprecated";
83
+ interface Usage {
84
+ use?: string;
85
+ avoid?: string;
86
+ /** Components, or other things, to use instead. */
87
+ instead?: string[];
88
+ }
89
+ interface PropEntry {
90
+ /** The type as written or resolved, e.g. `string`, `"sm" | "md"`, `(v: string) => void`. */
91
+ type: string;
92
+ /** Present when the type is a union of literals: each value, unquoted. */
93
+ values?: string[];
94
+ required: boolean;
95
+ /** The default, as source text, when the component destructures one. */
96
+ default?: string;
97
+ description?: string;
98
+ deprecated?: string;
99
+ /** The package that declares it, when it comes from a wrapped primitive rather than the project. */
100
+ from?: string;
101
+ }
102
+ interface VariantsEntry {
103
+ /** Where the axes came from: a `tv()` or `cva()` config, or the props' literal union types. */
104
+ from: "tv" | "cva" | "props";
105
+ /** The config's variable name. Absent when `from` is `"props"`. */
106
+ config?: string;
107
+ /** Source order. */
108
+ axes: VariantAxis[];
109
+ /** Conditions only, without their classes, in source order. */
110
+ compound?: Record<string, string | string[]>[];
111
+ /** A `tv()` config's named parts, in source order. */
112
+ parts?: string[];
113
+ }
114
+ interface VariantAxis {
115
+ name: string;
116
+ /** Source order. */
117
+ options: VariantOption[];
118
+ default?: string;
119
+ }
120
+ interface VariantOption {
121
+ name: string;
122
+ description?: string;
123
+ }
124
+ /**
125
+ * A co-located `*.examples.tsx`: `canonical` is the one to copy, `do*` and
126
+ * `dont*` render as pairs in order, anything else is a further example.
127
+ */
128
+ interface ExamplesEntry {
129
+ source: string;
130
+ canonical?: ExampleRef;
131
+ do: ExampleRef[];
132
+ dont: ExampleRef[];
133
+ other: ExampleRef[];
134
+ }
135
+ interface ExampleRef {
136
+ /** The export name. */
137
+ name: string;
138
+ /** Its JSDoc: why to do it, or why not. */
139
+ description?: string;
140
+ /** The JSX it returns, as written, for agents and code views. */
141
+ code?: string;
142
+ }
143
+ /** tokens.json */
144
+ interface TokensManifest extends ManifestFile {
145
+ /** The stylesheets read, in the order given. */
146
+ sources: string[];
147
+ /** Source order: file by file, declaration by declaration. */
148
+ tokens: TokenEntry[];
149
+ }
150
+ type TokenTier = "color" | "font" | "font-weight" | "text" | "leading" | "tracking" | "spacing" | "size" | "radius" | "shadow" | "ease" | "duration" | "motion" | "breakpoint" | "container" | "other";
151
+ interface TokenEntry {
152
+ /** The custom property, with its dashes: `--color-primary-500`. */
153
+ name: string;
154
+ tier: TokenTier;
155
+ /**
156
+ * The value in each context it is declared in. `default` is `@theme` or `:root`;
157
+ * `light` and `dark` are the mode blocks; a `p3:` prefix marks the
158
+ * `@media (color-gamut: p3)` layer. Any other selector is kept as written.
159
+ */
160
+ values: Record<string, string>;
161
+ /** The comment above it, or above the run of declarations it belongs to. */
162
+ description?: string;
163
+ /** The stylesheet that first declares it. */
164
+ source: string;
165
+ /** Later stylesheets whose declaration replaced a value, in the order read: an override layer. */
166
+ overriddenIn?: string[];
167
+ }
168
+ /** rules.json: brand and interface rules in one format. */
169
+ interface RulesManifest extends ManifestFile {
170
+ /** Sorted by id. */
171
+ rules: RuleEntry[];
172
+ }
173
+ interface RuleEntry {
174
+ /** The file name without `.rule.json`, used as its anchor: `touch-target`. */
175
+ id: string;
176
+ kind: "brand" | "interface";
177
+ title: string;
178
+ /** The rule, in one or two sentences, for people first. */
179
+ statement: string;
180
+ /** Why it exists. */
181
+ rationale?: string;
182
+ /** The measurable line, e.g. `44 × 44 CSS px`. */
183
+ threshold?: string;
184
+ /** Components, elements, assets or pages it governs. */
185
+ appliesTo?: string[];
186
+ exceptions?: string[];
187
+ /** Tokens it rests on, e.g. `--size-2xl`. */
188
+ tokens?: string[];
189
+ /**
190
+ * Confirmed with the client, an assumption still to confirm, or measured: generated from the
191
+ * tokens (where a colour can be text), a fact that changes when they do, not a decision.
192
+ */
193
+ status: "confirmed" | "assumption" | "measured";
194
+ /** How it is proved: a test, a lint rule, an audit, or a person. */
195
+ check?: {
196
+ kind: "test" | "lint" | "audit" | "manual";
197
+ ref?: string;
198
+ description?: string;
199
+ };
200
+ source: string;
201
+ }
202
+ /** patterns.json: the product's recurring screen compositions. */
203
+ interface PatternsManifest extends ManifestFile {
204
+ /** Sorted by name. */
205
+ patterns: PatternEntry[];
206
+ }
207
+ interface PatternEntry {
208
+ /** From the file name: `checkout` for `checkout.pattern.tsx`. */
209
+ id: string;
210
+ name: string;
211
+ description?: string;
212
+ status?: Status;
213
+ /** The system components it imports, by name, sorted. */
214
+ components: string[];
215
+ /** Each named export is a composition, in source order. */
216
+ examples: ExampleRef[];
217
+ source: string;
218
+ }
219
+ /** taxonomy.json: one vocabulary, with the wrong forms to avoid. */
220
+ interface TaxonomyManifest extends ManifestFile {
221
+ /** Sorted by name. */
222
+ terms: TermEntry[];
223
+ }
224
+ interface TermEntry {
225
+ /** The canonical form. */
226
+ name: string;
227
+ kind: "component" | "variant" | "token" | "pattern" | "rule" | "product";
228
+ /** Known wrong forms: `error` for `destructive`, `Modal` for `Dialog`, "log in" for "sign in". */
229
+ wrong?: string[];
230
+ note?: string;
231
+ /** Where it is defined: a component's source, a token's name, a rule's id. */
232
+ ref?: string;
233
+ }
234
+ /** assets.json: logos, icons and imagery, with how to use them. */
235
+ interface AssetsManifest extends ManifestFile {
236
+ /** Sorted by file. */
237
+ assets: AssetEntry[];
238
+ }
239
+ interface AssetEntry {
240
+ file: string;
241
+ kind: "logo" | "icon" | "image" | "other";
242
+ name: string;
243
+ usage?: string;
244
+ /** e.g. `24px tall` */
245
+ minSize?: string;
246
+ /** e.g. `the height of the wordmark's x` or a length */
247
+ clearSpace?: string;
248
+ /** Surfaces it may sit on, as semantic colour names: `canvas`, `primary`. */
249
+ surfaces?: string[];
250
+ alt?: string;
251
+ /** Intrinsic size, read from an SVG's viewBox or a PNG's header. */
252
+ width?: number;
253
+ height?: number;
254
+ }
255
+
256
+ /**
257
+ * Components: every exported React component under the system folder.
258
+ *
259
+ * Props come from react-docgen-typescript, which resolves types through the
260
+ * checker, run once over a single program for every file (the LloydsDirect
261
+ * docgen built a program per file, which is where its time went). Everything
262
+ * else (variants, data-slots, JSDoc, examples) is read from the syntax tree,
263
+ * because it is written as data in the source and needs no type resolution.
264
+ */
265
+
266
+ interface Warning {
267
+ file: string;
268
+ line?: number;
269
+ message: string;
270
+ }
271
+ interface ComponentsOptions {
272
+ /** Project root; every path in the output is relative to it. */
273
+ root: string;
274
+ /** The system folder, relative to root. */
275
+ system: string;
276
+ /** tsconfig.json to resolve imports and path aliases with, relative to root. Found from root when absent. */
277
+ tsconfig?: string;
278
+ /** Folder the manifest is written to, relative to root; skipped when scanning. */
279
+ out?: string;
280
+ }
281
+ declare function listComponentFiles(root: string, system: string, out?: string): string[];
282
+ declare function readComponents(options: ComponentsOptions, warn: (w: Warning) => void): ComponentEntry[];
283
+
284
+ /**
285
+ * Build the manifest in memory: each file's path and exact contents. The
286
+ * CLI writes them (build), compares them with what is on disk (check), or
287
+ * compares them with a git ref (diff); nothing here touches the disk but to read.
288
+ */
289
+
290
+ declare const GENERATOR_NAME = "@designtools/manifest";
291
+ declare const VERSION: string;
292
+ declare const GENERATOR: string;
293
+ interface ManifestConfig {
294
+ /** Project root. Every other path is relative to it. */
295
+ root: string;
296
+ /** The design system folder, e.g. `src/ds`. */
297
+ system: string;
298
+ /** Token stylesheets, in the order they are imported. */
299
+ tokens: string[];
300
+ /** tsconfig.json for resolving imports. Found from root when absent. */
301
+ tsconfig?: string;
302
+ /** Where the manifest goes. Defaults to `<system>/manifest`, so it moves with the system. */
303
+ out?: string;
304
+ /** Folder of `*.rule.json` files. Defaults to `<system>/rules`. */
305
+ rules?: string;
306
+ /** The curated synonyms and wrong forms. Defaults to `<system>/taxonomy.json`. */
307
+ taxonomy?: string;
308
+ /** Brand assets, with an `assets.json` saying how to use them. Defaults to `<system>/brand`. */
309
+ brand?: string;
310
+ /** Where the docs are served, for the agent pointer file, e.g. `/design/system`. */
311
+ docs?: string;
312
+ /**
313
+ * The usage file `@designtools/tokens --usage` writes: every colour on every background with a
314
+ * verdict. Its failures become measured usage rules in rules.json.
315
+ */
316
+ usage?: string;
317
+ /** The agent file the pointer section goes in, when the default choice is wrong for the project. */
318
+ agents?: string;
319
+ /**
320
+ * More places for prose-check to read, beside the agent files, `.claude/`, `docs/`
321
+ * and the system folder: files of any kind, or folders, whose markdown and
322
+ * `*content.ts(x)` files (the docs site's editorial copy) are read.
323
+ */
324
+ prose?: string[];
325
+ }
326
+ interface BuiltManifest {
327
+ components: ComponentsManifest;
328
+ tokens: TokensManifest;
329
+ rules: RulesManifest;
330
+ patterns: PatternsManifest;
331
+ taxonomy: TaxonomyManifest;
332
+ assets: AssetsManifest;
333
+ /** Relative path → exact file contents. */
334
+ files: Record<string, string>;
335
+ warnings: Warning[];
336
+ }
337
+ declare function outDir(config: ManifestConfig): string;
338
+ declare function buildManifest(config: ManifestConfig): BuiltManifest;
339
+ /**
340
+ * JSON with every object's keys sorted and arrays left in their order, two-space
341
+ * indented, with a final newline. Arrays carry the orders that mean something
342
+ * (axes, states, ramps), so sorting them would lose information; sorting keys
343
+ * means two runs, or two machines, write the same bytes.
344
+ */
345
+ declare function serialise(value: unknown): string;
346
+
347
+ /**
348
+ * Configuration: `designtools.json` at the project root, overridden by flags.
349
+ *
350
+ * { "manifest": { "system": "src/ds", "tokens": ["app/styles/tokens.css", "app/styles/scale.css"] } }
351
+ *
352
+ * One file for every @designtools tool, so a project records its system folder once.
353
+ */
354
+
355
+ declare const CONFIG_FILE = "designtools.json";
356
+ interface ConfigFlags {
357
+ root?: string;
358
+ system?: string;
359
+ tokens?: string[];
360
+ tsconfig?: string;
361
+ out?: string;
362
+ }
363
+ declare function loadConfig(flags: ConfigFlags): ManifestConfig;
364
+
365
+ /**
366
+ * Classify every change between two manifests, so a person only has to look at
367
+ * the breaking ones:
368
+ *
369
+ * breaking something a caller relies on is gone or now required
370
+ * additive something new that nothing could depend on yet
371
+ * visual a value changed; visual regression decides whether it matters
372
+ * docs a description, category, example or deprecation changed
373
+ *
374
+ * Components are matched by their path inside the system folder and their
375
+ * export name, so moving the whole system up a tier is not a change.
376
+ */
377
+
378
+ type ChangeClass = "breaking" | "additive" | "visual" | "docs";
379
+ declare const CHANGE_CLASSES: ChangeClass[];
380
+ interface Change {
381
+ class: ChangeClass;
382
+ /** The component or token the change belongs to. */
383
+ subject: string;
384
+ message: string;
385
+ }
386
+ interface ManifestPair {
387
+ components?: ComponentsManifest;
388
+ tokens?: TokensManifest;
389
+ rules?: RulesManifest;
390
+ patterns?: PatternsManifest;
391
+ taxonomy?: TaxonomyManifest;
392
+ assets?: AssetsManifest;
393
+ }
394
+ declare function diffManifests(before: ManifestPair, after: ManifestPair): Change[];
395
+ /** A markdown report, ready to post on a pull request. */
396
+ declare function formatReport(changes: Change[], base: string): string;
397
+
398
+ /**
399
+ * JSDoc, read from the comment text rather than through the type checker, so a
400
+ * tag means the same thing on a component, a variant config and a fixture.
401
+ *
402
+ * The recognised tags are the ones the LloydsDirect design system used in
403
+ * practice. Anything else is reported, because a misspelt tag (`@primative`
404
+ * turned up three times there) otherwise vanishes without a trace.
405
+ */
406
+
407
+ interface JSDocTag {
408
+ name: string;
409
+ text: string;
410
+ }
411
+ interface JSDoc {
412
+ description: string;
413
+ tags: JSDocTag[];
414
+ /** 1-based line of the comment, for warnings. */
415
+ line: number;
416
+ }
417
+ /** Tags the manifest reads. */
418
+ declare const MANIFEST_TAGS: Set<string>;
419
+ /** Parse the text of a `/** … *\/` comment into a description and its tags. */
420
+ declare function parseJSDoc(comment: string): Omit<JSDoc, "line">;
421
+
422
+ /**
423
+ * Examples files: each named export renders the real components. The manifest
424
+ * records each export's name, its JSDoc (why), and the JSX it returns as written,
425
+ * so a docs page can show the code and an agent can copy the canonical one. It
426
+ * never runs them.
427
+ */
428
+
429
+ interface ExampleFile {
430
+ sf: ts.SourceFile;
431
+ /** The file's own JSDoc: the first comment, when a statement other than an import follows it. */
432
+ doc?: JSDoc;
433
+ exports: ExampleRef[];
434
+ }
435
+ declare function readExampleFile(path: string, source: string, warn: (w: Warning) => void, owner?: string): ExampleFile;
436
+ /** `canonical`, then `do*` and `dont*` in order, then anything else. */
437
+ declare function classifyExamples(source: string, exports: ExampleRef[]): ExamplesEntry;
438
+
439
+ /**
440
+ * Tokens: every custom property in the project's token stylesheets.
441
+ *
442
+ * A project commits CSS, not a token JSON: @designtools/tokens writes the colour
443
+ * tiers with their light, dark and P3 blocks, and the scale (space, type, radius,
444
+ * shadow, motion) is authored by hand beside it. Both are read the same way, so
445
+ * there is one reader and no second token format to keep in step.
446
+ *
447
+ * The comment above a declaration, or above the run of declarations it starts,
448
+ * is that token's description: the scale's comments already say why each value
449
+ * is what it is. A comment on the same line after a declaration describes that
450
+ * declaration (`--size-xl: 3rem; /* 48px controls *\/`), and does not start a run.
451
+ */
452
+
453
+ declare function readTokens(root: string, sources: string[], warn: (w: Warning) => void): TokenEntry[];
454
+ declare function tierOf(name: string, values: Record<string, string>): TokenTier;
455
+
456
+ /**
457
+ * The guidance a system carries beyond its components and tokens: rules,
458
+ * patterns, the taxonomy and brand assets. Each is authored by people in a
459
+ * small file beside the code; the manifest gathers them into one shape, and
460
+ * fills in what can be read rather than written (a pattern's components, an
461
+ * image's size, the canonical names).
462
+ */
463
+
464
+ /** One `<id>.rule.json` per rule, brand and interface alike. */
465
+ declare function readRules(root: string, dir: string, warn: (w: Warning) => void): RuleEntry[];
466
+ /**
467
+ * `<id>.pattern.tsx` anywhere in the system folder: the file's JSDoc names and
468
+ * describes it, its imports say which components it composes, and each named
469
+ * export is a composition.
470
+ */
471
+ declare function readPatterns(root: string, system: string, components: ComponentEntry[], compiler: ts.CompilerOptions, warn: (w: Warning) => void, skip?: string): PatternEntry[];
472
+ /**
473
+ * One vocabulary. The canonical names come from everything the manifest reads;
474
+ * the curated `taxonomy.json` adds their wrong forms, and product terms the
475
+ * code does not name.
476
+ */
477
+ declare function buildTaxonomy(root: string, curatedPath: string, inputs: {
478
+ components: ComponentEntry[];
479
+ tokens: TokenEntry[];
480
+ patterns: PatternEntry[];
481
+ rules: RuleEntry[];
482
+ }, warn: (w: Warning) => void): TermEntry[];
483
+ /**
484
+ * Brand assets from one folder. `assets.json` in it says how to use each file;
485
+ * files it does not mention are listed too, with a warning, so nothing in the
486
+ * folder goes unseen. The order is the author's (the wordmark first, because it
487
+ * is the default), then anything unlisted by file name.
488
+ */
489
+ declare function readAssets(root: string, brandDir: string, warn: (w: Warning) => void): AssetEntry[];
490
+
491
+ /**
492
+ * The agent pointer file: a generated section of CLAUDE.md or AGENTS.md that
493
+ * sends agents to the manifest, the rules and the design language. It never
494
+ * lists components, tokens or variants: a list written into prose is a second
495
+ * copy that drifts, and prose-check flags one.
496
+ */
497
+
498
+ declare const AGENTS_START = "<!-- designtools:start \u00B7 generated by designtools-manifest agents; edit outside these markers -->";
499
+ declare const AGENTS_END = "<!-- designtools:end -->";
500
+ /**
501
+ * The file the pointer goes in: the flag, then `manifest.agents` in designtools.json,
502
+ * then AGENTS.md when CLAUDE.md imports it (`@AGENTS.md`, as `next dev` writes it), so
503
+ * every agent reads the section and Claude still reaches it through the import; else
504
+ * CLAUDE.md if the project has one, else AGENTS.md.
505
+ */
506
+ declare function agentsFile(root: string, given?: string, configured?: string): string;
507
+ declare function agentsSection(config: ManifestConfig & {
508
+ docs?: string;
509
+ }): string;
510
+ /** The file with the section replaced, or appended when it has none. */
511
+ declare function withAgentsSection(existing: string | undefined, section: string): string;
512
+ interface Provenance {
513
+ /** `name@version` of the project, from its package.json. */
514
+ version: string;
515
+ /** Short commit hash, with `-dirty` when the tree has uncommitted changes. */
516
+ commit: string;
517
+ /** `Generated from acme-web@1.4.0 at 3f2a9c1` */
518
+ line: string;
519
+ }
520
+ /**
521
+ * Where a generated page comes from, for its header: the project's version and
522
+ * the commit it was built at. CI variables win over git, which a deploy may not have.
523
+ */
524
+ declare function provenance(root: string): Provenance;
525
+
526
+ /**
527
+ * prose-check: the system's names in agent files and docs prose, checked
528
+ * against the manifest. It warns; it never fails. Three things are flagged:
529
+ *
530
+ * a component tag (`<Modal>`) the system does not have
531
+ * a wrong form from the taxonomy (`Modal` for `Dialog`, "log in" for "sign in")
532
+ * a restated list: a paragraph or list naming several components or tokens,
533
+ * which is a second copy of the manifest that will drift
534
+ *
535
+ * A page that names wrong forms on purpose (a voice page: "never the customer")
536
+ * says so: `prose-check-ignore` on a line skips it, `prose-check-ignore-next-line`
537
+ * skips the one after, and `prose-check-ignore-start` … `prose-check-ignore-end`
538
+ * skip everything between, in whatever comment syntax the file uses.
539
+ */
540
+
541
+ interface ProseFinding {
542
+ file: string;
543
+ line: number;
544
+ message: string;
545
+ }
546
+ interface ProseInputs {
547
+ components: ComponentEntry[];
548
+ patterns: PatternEntry[];
549
+ tokens: TokenEntry[];
550
+ terms: TermEntry[];
551
+ }
552
+ declare function defaultProseFiles(root: string, system: string, extra?: string[]): string[];
553
+ declare function checkProse(root: string, files: string[], inputs: ProseInputs): ProseFinding[];
554
+
555
+ /**
556
+ * Variant configs, read by parsing the `tv()` or `cva()` call. The config is
557
+ * already data (axes, options, defaults, compound conditions), so nothing is
558
+ * inferred from types.
559
+ *
560
+ * tailwind-variants is the suite default; class-variance-authority has the same
561
+ * shape for everything read here. Either may be imported under another name.
562
+ */
563
+
564
+ interface VariantConfig {
565
+ /** The variable it is assigned to. */
566
+ name: string;
567
+ kind: "tv" | "cva";
568
+ entry: VariantsEntry;
569
+ /** `tv({ extend: base })`: the config this one builds on, merged in by whoever resolves names. */
570
+ extendsName?: string;
571
+ doc?: JSDoc;
572
+ description?: string;
573
+ }
574
+ /** Every `const x = tv({...})` / `cva(base, {...})` at any depth, in source order. */
575
+ declare function findVariantConfigs(sf: ts.SourceFile): VariantConfig[];
576
+
577
+ export { AGENTS_END, AGENTS_START, type AssetEntry, type AssetsManifest, type BuiltManifest, CHANGE_CLASSES, CONFIG_FILE, type Change, type ChangeClass, type ComponentEntry, type ComponentsManifest, type ComponentsOptions, type ConfigFlags, type ExampleRef, type ExamplesEntry, GENERATOR, GENERATOR_NAME, MANIFEST_SCHEMA, MANIFEST_TAGS, type ManifestConfig, type ManifestPair, type PatternEntry, type PatternsManifest, type PropEntry, type ProseFinding, type ProseInputs, type Provenance, type RuleEntry, type RulesManifest, type Status, type TaxonomyManifest, type TermEntry, type TokenEntry, type TokenTier, type TokensManifest, type Usage, VERSION, type VariantAxis, type VariantOption, type VariantsEntry, type Warning, agentsFile, agentsSection, buildManifest, buildTaxonomy, checkProse, classifyExamples, defaultProseFiles, diffManifests, findVariantConfigs, formatReport, listComponentFiles, loadConfig, outDir, parseJSDoc, provenance, readAssets, readComponents, readExampleFile, readPatterns, readRules, readTokens, serialise, tierOf, withAgentsSection };
package/dist/index.js ADDED
@@ -0,0 +1,70 @@
1
+ import {
2
+ AGENTS_END,
3
+ AGENTS_START,
4
+ CHANGE_CLASSES,
5
+ CONFIG_FILE,
6
+ GENERATOR,
7
+ GENERATOR_NAME,
8
+ MANIFEST_SCHEMA,
9
+ MANIFEST_TAGS,
10
+ VERSION,
11
+ agentsFile,
12
+ agentsSection,
13
+ buildManifest,
14
+ buildTaxonomy,
15
+ checkProse,
16
+ classifyExamples,
17
+ defaultProseFiles,
18
+ diffManifests,
19
+ findVariantConfigs,
20
+ formatReport,
21
+ listComponentFiles,
22
+ loadConfig,
23
+ outDir,
24
+ parseJSDoc,
25
+ provenance,
26
+ readAssets,
27
+ readComponents,
28
+ readExampleFile,
29
+ readPatterns,
30
+ readRules,
31
+ readTokens,
32
+ serialise,
33
+ tierOf,
34
+ withAgentsSection
35
+ } from "./chunk-PQGMDEUF.js";
36
+ export {
37
+ AGENTS_END,
38
+ AGENTS_START,
39
+ CHANGE_CLASSES,
40
+ CONFIG_FILE,
41
+ GENERATOR,
42
+ GENERATOR_NAME,
43
+ MANIFEST_SCHEMA,
44
+ MANIFEST_TAGS,
45
+ VERSION,
46
+ agentsFile,
47
+ agentsSection,
48
+ buildManifest,
49
+ buildTaxonomy,
50
+ checkProse,
51
+ classifyExamples,
52
+ defaultProseFiles,
53
+ diffManifests,
54
+ findVariantConfigs,
55
+ formatReport,
56
+ listComponentFiles,
57
+ loadConfig,
58
+ outDir,
59
+ parseJSDoc,
60
+ provenance,
61
+ readAssets,
62
+ readComponents,
63
+ readExampleFile,
64
+ readPatterns,
65
+ readRules,
66
+ readTokens,
67
+ serialise,
68
+ tierOf,
69
+ withAgentsSection
70
+ };