@astryxdesign/cli 0.7.4-canary.e5c5a87 → 0.7.4-canary.eccc6ee

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.
Files changed (78) hide show
  1. package/README.md +63 -63
  2. package/api/docs/_adapter.d.mts +80 -0
  3. package/api/docs/_adapter.mjs +248 -5
  4. package/api/docs/detail/detail.mjs +8 -0
  5. package/api/docs/docs.doc.mjs +1 -1
  6. package/api/docs/docs.type.d.mts +28 -2
  7. package/api/docs/docs.type.mjs +13 -3
  8. package/api/docs/guide-route-targets.test.mjs +998 -0
  9. package/api/docs/index/index.mjs +9 -0
  10. package/api/docs/list/list.mjs +7 -1
  11. package/api/docs/node/node.mjs +9 -1
  12. package/api/docs/reference-blocks.test.mjs +1 -1
  13. package/api/doctor/built-checks.mjs +43 -13
  14. package/api/doctor/built-checks.test.mjs +29 -0
  15. package/api/doctor/doctor.doc.mjs +1 -1
  16. package/api/integration/_adapter.d.mts +8 -0
  17. package/api/integration/_adapter.mjs +25 -0
  18. package/api/integration/authoring-checks.mjs +29 -2
  19. package/api/integration/pack-check.mjs +32 -1
  20. package/api/integration/pack-check.test.mjs +33 -0
  21. package/api/integration/validate-integration.mjs +66 -1
  22. package/api/integration/validateIntegration.doc.mjs +1 -1
  23. package/api/search/_candidate-score.d.mts +3 -2
  24. package/api/search/_candidate-score.mjs +66 -3
  25. package/api/search/_gather-docs.mjs +12 -2
  26. package/api/search/_priority.mjs +2 -1
  27. package/api/search/_score.d.mts +2 -1
  28. package/api/search/_score.mjs +2 -2
  29. package/api/search/search.family-members.test.mjs +124 -0
  30. package/assets/discover/official-packages.json +16 -0
  31. package/assets/docs/browser-support.doc.mjs +1 -1
  32. package/assets/docs/theme.doc.mjs +2 -2
  33. package/assets/docs/tree/component-lookups.doc.mjs +2 -1
  34. package/assets/docs/tree/extend-or-replace.doc.mjs +36 -4
  35. package/assets/docs/tree/migration.doc.mjs +2 -1
  36. package/assets/docs/tree/styling-libraries.doc.mjs +2 -1
  37. package/assets/docs/tree/styling.doc.mjs +1 -1
  38. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +54 -0
  39. package/assets/templates/themes/butter/butterPalettes.generated.receipt.json +1499 -0
  40. package/assets/templates/themes/butter/butterPalettes.generated.ts +550 -0
  41. package/assets/templates/themes/butter/butterTheme.ts +274 -234
  42. package/assets/templates/themes/butter/palette.config.json +484 -0
  43. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +41 -0
  44. package/assets/templates/themes/gothic/gothicPalettes.generated.receipt.json +979 -0
  45. package/assets/templates/themes/gothic/gothicPalettes.generated.ts +271 -0
  46. package/assets/templates/themes/gothic/gothicTheme.ts +130 -160
  47. package/assets/templates/themes/gothic/palette.config.json +371 -0
  48. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +51 -0
  49. package/assets/templates/themes/matcha/matchaPalettes.generated.receipt.json +1502 -0
  50. package/assets/templates/themes/matcha/matchaPalettes.generated.ts +501 -0
  51. package/assets/templates/themes/matcha/matchaPalettes.ts +21 -0
  52. package/assets/templates/themes/matcha/matchaTheme.ts +164 -103
  53. package/assets/templates/themes/matcha/palette.config.json +448 -0
  54. package/assets/templates/themes/y2k/palette.config.json +166 -0
  55. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +54 -0
  56. package/assets/templates/themes/y2k/y2kPalettes.generated.receipt.json +872 -0
  57. package/assets/templates/themes/y2k/y2kPalettes.generated.ts +550 -0
  58. package/assets/templates/themes/y2k/y2kPalettes.ts +257 -0
  59. package/assets/templates/themes/y2k/y2kTheme.ts +164 -391
  60. package/authoring/doctypes/_schema.d.mts +4 -0
  61. package/authoring/doctypes/_schema.mjs +4 -0
  62. package/authoring/doctypes/reference/type.ts +14 -2
  63. package/clients/cli/commands/docs.mjs +27 -2
  64. package/clients/cli/commands/docs.test.mjs +1 -1
  65. package/foundation/agent-docs/agent-docs.d.mts +14 -2
  66. package/foundation/agent-docs/agent-docs.mjs +54 -2
  67. package/foundation/agent-docs/agent-docs.test.mjs +61 -0
  68. package/foundation/discovery/docs-discovery.d.mts +93 -2
  69. package/foundation/discovery/docs-discovery.mjs +236 -8
  70. package/foundation/doc-compiler/compile.mjs +8 -1
  71. package/foundation/doc-compiler/doc-loads.test.mjs +3 -0
  72. package/foundation/doc-compiler/tree.d.mts +5 -0
  73. package/foundation/doc-compiler/tree.mjs +3 -0
  74. package/foundation/integrations/cli-requirement.d.mts +14 -0
  75. package/foundation/integrations/cli-requirement.mjs +23 -0
  76. package/foundation/integrations/cli-requirement.test.mjs +1 -0
  77. package/foundation/response/response-types.doc.mjs +5 -5
  78. package/package.json +9 -9
@@ -41,11 +41,56 @@ import {
41
41
  wordForms,
42
42
  sameWord,
43
43
  startsAWordOf,
44
+ wordsOf,
44
45
  joined,
45
46
  isTypo,
46
47
  } from './_words.mjs';
47
48
  import {pluralOf} from './_query.mjs';
48
49
 
50
+ /**
51
+ * Whether a multi-word term spells out a name word by word: as many words as
52
+ * the name, each the name's word in order or, for a single-letter word, a word
53
+ * starting with that letter ("vertical" for V) that the entry's own
54
+ * description names. `vertical stack` spells out VStack when its description says
55
+ * "vertical"; `visual stack` does not.
56
+ * @param {string} term
57
+ * @param {string} name
58
+ * @param {string} description
59
+ */
60
+ function spellsOut(term, name, description) {
61
+ const words = term.split(/\s+/).filter(Boolean);
62
+ const parts = wordsOf(name);
63
+ if (words.length < 2 || words.length !== parts.length) return false;
64
+ const described = wordsOf(description);
65
+ let expanded = false;
66
+ for (let i = 0; i < words.length; i++) {
67
+ const w = words[i];
68
+ const p = parts[i];
69
+ if (sameWord(w, p)) continue;
70
+ // Only a single-letter word is an abbreviation to spell out: "With" in a
71
+ // name is not spelled out by "without".
72
+ if (p.length !== 1 || !w.startsWith(p)) return false;
73
+ if (!described.some(d => sameWord(d, w))) return false;
74
+ expanded = true;
75
+ }
76
+ return expanded;
77
+ }
78
+
79
+ /**
80
+ * Whether a one-word term is a name's last word and every word before it is a
81
+ * single letter: Stack in VStack and HStack.
82
+ * @param {string} term
83
+ * @param {string} name
84
+ */
85
+ function headOfLetters(term, name) {
86
+ const parts = wordsOf(name);
87
+ return (
88
+ parts.length >= 2 &&
89
+ sameWord(term, parts[parts.length - 1]) &&
90
+ parts.slice(0, -1).every(p => p.length === 1)
91
+ );
92
+ }
93
+
49
94
  /**
50
95
  * Score a single candidate against the search term across name, keywords,
51
96
  * and prose signals. Returns the best (highest) score plus a human reason,
@@ -62,7 +107,7 @@ import {pluralOf} from './_query.mjs';
62
107
  * @param {string} [candidate.description]
63
108
  * @param {string[]} [candidate.prose] - Extra free-text blobs (doc section text, best practices).
64
109
  * @param {string[]} [candidate.guidance] - Usage guidance (features, best practices) — scored a tier below description.
65
- * @param {{fuzzy?: boolean, joins?: boolean}} [opts] - `fuzzy`: allow edit-distance (typo) matches. Default true; multi-word queries pass false. `joins`: read a spaced query joined into a name or keyword (default true); off when the query names an entry outright.
110
+ * @param {{fuzzy?: boolean, joins?: boolean, part?: boolean}} [opts] - `fuzzy`: allow edit-distance (typo) matches. Default true; multi-word queries pass false. `joins`: read a spaced query joined into a name or keyword (default true); off when the query names an entry outright. `part`: the term is one word of a longer query, so a name's head word after single letters (Stack in VStack) does not count as a keyword hit for it.
66
111
  * @returns {{score: number, reason: string, alias?: 'partial' | 'keyword'} | null}
67
112
  * `alias` marks a hit that read the query's words joined.
68
113
  */
@@ -78,7 +123,7 @@ export function scoreCandidate(
78
123
  prose = [],
79
124
  guidance = [],
80
125
  },
81
- {fuzzy = true, joins = true} = {},
126
+ {fuzzy = true, joins = true, part = false} = {},
82
127
  ) {
83
128
  let best = 0;
84
129
  let reason = '';
@@ -128,6 +173,15 @@ export function scoreCandidate(
128
173
  // Most of the name typed as words, cut short: `complex select` is
129
174
  // ComplexSelector, ahead of a one-word keyword elsewhere.
130
175
  consider(95, `name "${candidateName}" spelled`, 'partial');
176
+ } else if (
177
+ domain !== 'doc' &&
178
+ domain !== 'theme' &&
179
+ spellsOut(term, candidateName, description)
180
+ ) {
181
+ // The name's short words spelled out, in order, as the entry's own
182
+ // description spells them: `vertical stack` is VStack ("Vertical stack
183
+ // for arranging items top-to-bottom").
184
+ consider(95, `name "${candidateName}" spelled out`);
131
185
  } else if (pluralOf(nameLower, term) || pluralOf(term, nameLower)) {
132
186
  // One point under the exact spelling, so the doc named `tokens` still
133
187
  // outranks the Token component for `tokens`.
@@ -135,7 +189,16 @@ export function scoreCandidate(
135
189
  } else {
136
190
  if (sameWord(term, nameLower)) consider(95, `name "${candidateName}"`);
137
191
  // The term is a word of the name, or starts one: "input" in TextInput.
138
- else if (startsAWordOf(term, candidateName)) {
192
+ else if (
193
+ !part &&
194
+ domain !== 'doc' &&
195
+ domain !== 'theme' &&
196
+ headOfLetters(term, candidateName)
197
+ ) {
198
+ // The whole query is the name's head word after single letters (Stack
199
+ // in VStack, HStack): a variant named by its head, as a keyword is.
200
+ consider(90, `name "${candidateName}" ends in "${term}"`);
201
+ } else if (startsAWordOf(term, candidateName)) {
139
202
  consider(60, `name contains "${term}"`);
140
203
  }
141
204
  if (fuzzy) {
@@ -7,6 +7,7 @@
7
7
 
8
8
  import {
9
9
  guideEntry,
10
+ sectionPackageOf,
10
11
  loadDocsCatalog,
11
12
  lowerTopic,
12
13
  projectTree,
@@ -104,9 +105,17 @@ export async function gatherDocs(cwd) {
104
105
  // A tree hit names where it lives: its ancestors' titles, then its own.
105
106
  const path = [...tree.ancestors(node).map(a => a.title), node.title];
106
107
  if (node.kind === 'generic') {
108
+ // A guide an integration replaced or extended names the package that
109
+ // wrote it, and each section the package that wrote that section, as
110
+ // reads do (INV28).
111
+ const entry = guideEntry(node);
107
112
  let doc = null;
113
+ /** @type {((key: string) => string) | undefined} */
114
+ let sectionPackage;
108
115
  try {
109
- doc = (await lowerTopic(catalog, guideEntry(node))).doc;
116
+ const lowered = await lowerTopic(catalog, entry);
117
+ doc = lowered.doc;
118
+ sectionPackage = sectionPackageOf(entry, lowered);
110
119
  } catch {
111
120
  // As above: the owning commands report it.
112
121
  }
@@ -118,7 +127,8 @@ export async function gatherDocs(cwd) {
118
127
  node.summary,
119
128
  path.join(' › '),
120
129
  node.parent == null ? undefined : `astryx docs ${node.parent}`,
121
- node.provider,
130
+ entry.package,
131
+ sectionPackage,
122
132
  ),
123
133
  );
124
134
  continue;
@@ -132,7 +132,8 @@ export function domainPriority(
132
132
  const fuzzy = tokens.length <= 1;
133
133
  return words.some(
134
134
  w =>
135
- (bestForToken(w, candidate, {fuzzy})?.score ?? 0) >= STRONG_TOKEN_SCORE,
135
+ (bestForToken(w, candidate, {fuzzy, part: words.length > 1})?.score ??
136
+ 0) >= STRONG_TOKEN_SCORE,
136
137
  )
137
138
  ? 1
138
139
  : 0;
@@ -6,11 +6,12 @@
6
6
  * (synonym hits are discounted so a direct hit always wins).
7
7
  * @param {string} tok
8
8
  * @param {Candidate} candidate
9
- * @param {{fuzzy?: boolean}} [opts]
9
+ * @param {{fuzzy?: boolean, part?: boolean}} [opts] - see scoreCandidate
10
10
  * @returns {{score: number, reason: string} | null}
11
11
  */
12
12
  export function bestForToken(tok: string, candidate: Candidate, opts?: {
13
13
  fuzzy?: boolean;
14
+ part?: boolean;
14
15
  }): {
15
16
  score: number;
16
17
  reason: string;
@@ -39,7 +39,7 @@ const MIN_TOKEN_SCORE = 50;
39
39
  * (synonym hits are discounted so a direct hit always wins).
40
40
  * @param {string} tok
41
41
  * @param {Candidate} candidate
42
- * @param {{fuzzy?: boolean}} [opts]
42
+ * @param {{fuzzy?: boolean, part?: boolean}} [opts] - see scoreCandidate
43
43
  * @returns {{score: number, reason: string} | null}
44
44
  */
45
45
  export function bestForToken(tok, candidate, opts = {}) {
@@ -187,7 +187,7 @@ export function scoreQuery(
187
187
  let alias = false;
188
188
  let aliasWords = 0;
189
189
  for (const tok of tokens) {
190
- let h = bestForToken(tok, candidate, {fuzzy});
190
+ let h = bestForToken(tok, candidate, {fuzzy, part: true});
191
191
  if (
192
192
  compound?.covered.has(joined(tok)) &&
193
193
  compound.score > (h?.score ?? 0)
@@ -0,0 +1,124 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file A family member named by short words is found by them spelled out:
5
+ * "vertical stack" is VStack, whose own description says so, and a member whose
6
+ * name is its head word after single letters is a match for that head word.
7
+ * The same holds for any integration's members, which no learned weights know.
8
+ */
9
+
10
+ import fs from 'node:fs';
11
+ import os from 'node:os';
12
+ import path from 'node:path';
13
+ import {afterAll, beforeAll, describe, expect, it} from 'vitest';
14
+ import {search} from './search.mjs';
15
+
16
+ const SLOW = 60_000;
17
+
18
+ describe('family members found by their spelled-out names', () => {
19
+ it.each([
20
+ ['vertical stack', 'VStack'],
21
+ ['horizontal stack', 'HStack'],
22
+ ])('`%s` ranks %s first', async (query, name) => {
23
+ const {results} = (await search(query)).data;
24
+ expect(results[0], JSON.stringify(results.slice(0, 3))).toMatchObject({
25
+ domain: 'component',
26
+ name,
27
+ });
28
+ });
29
+
30
+ it('`stack` keeps Stack first and lists VStack and HStack', async () => {
31
+ const {results} = (await search('stack')).data;
32
+ expect(results[0]).toMatchObject({domain: 'component', name: 'Stack'});
33
+ const top = results.slice(0, 8).map(r => r.name);
34
+ expect(top).toContain('VStack');
35
+ expect(top).toContain('HStack');
36
+ });
37
+
38
+ it('only a single-letter word is spelled out', async () => {
39
+ // "without" begins with "With" but spells out no letter of the name.
40
+ const {results} = (await search('checkbox list without end content')).data;
41
+ expect(results[0]?.reason).not.toMatch(/spelled out/);
42
+ });
43
+
44
+ it('a longer query keeps Stack first', async () => {
45
+ // Stack in VStack counts as a keyword hit only when it is the whole query.
46
+ const {results} = (await search('vertical stack of cards')).data;
47
+ expect(results[0]).toMatchObject({domain: 'component', name: 'Stack'});
48
+ });
49
+
50
+ it("a longer query does not lift a head word's members", async () => {
51
+ const {results} = (await search('stack direction')).data;
52
+ const top = results.slice(0, 3).map(r => r.name);
53
+ expect(top).not.toContain('VStack');
54
+ expect(top).not.toContain('HStack');
55
+ });
56
+
57
+ it('a word the description does not spell out is no name', async () => {
58
+ const {results} = (await search('visual stack')).data;
59
+ expect(results[0]?.name).not.toBe('VStack');
60
+ });
61
+ });
62
+
63
+ describe("an integration's family members (cold start)", () => {
64
+ /** @type {string} */
65
+ let dir;
66
+ beforeAll(() => {
67
+ dir = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-family-members-'));
68
+ const pkg = path.join(dir, 'node_modules', '@acme', 'grids');
69
+ fs.mkdirSync(path.join(pkg, 'components'), {recursive: true});
70
+ fs.mkdirSync(
71
+ path.join(dir, 'node_modules', '@astryxdesign', 'core', 'src'),
72
+ {
73
+ recursive: true,
74
+ },
75
+ );
76
+ fs.writeFileSync(path.join(dir, 'package.json'), '{"name":"consumer"}');
77
+ fs.writeFileSync(
78
+ path.join(dir, 'astryx.config.mjs'),
79
+ "export default { integrations: ['@acme/grids'] };\n",
80
+ );
81
+ fs.writeFileSync(
82
+ path.join(pkg, 'package.json'),
83
+ '{"name":"@acme/grids","version":"1.0.0"}',
84
+ );
85
+ fs.writeFileSync(
86
+ path.join(pkg, 'astryx.integration.mjs'),
87
+ "export default { components: './components' };\n",
88
+ );
89
+ for (const [name, description] of [
90
+ ['VGrid', 'Vertical grid for arranging tiles in columns.'],
91
+ ['HGrid', 'Horizontal grid for arranging tiles in rows.'],
92
+ ]) {
93
+ fs.writeFileSync(
94
+ path.join(pkg, 'components', `${name}.doc.mjs`),
95
+ `export default {
96
+ type: 'component',
97
+ name: '${name}',
98
+ usage: {description: '${description}'},
99
+ props: [],
100
+ };\n`,
101
+ );
102
+ fs.writeFileSync(
103
+ path.join(pkg, 'components', `${name}.tsx`),
104
+ `export function ${name}() { return null; }\n`,
105
+ );
106
+ }
107
+ });
108
+ afterAll(() => fs.rmSync(dir, {recursive: true, force: true}));
109
+
110
+ it.each([
111
+ ['vertical grid', 'VGrid'],
112
+ ['horizontal grid', 'HGrid'],
113
+ ])(
114
+ '`%s` ranks %s first',
115
+ async (query, name) => {
116
+ const {results} = (await search(query, {cwd: dir, type: 'component'}))
117
+ .data;
118
+ expect(results[0], JSON.stringify(results.slice(0, 3))).toMatchObject({
119
+ name,
120
+ });
121
+ },
122
+ SLOW,
123
+ );
124
+ });
@@ -243,6 +243,22 @@
243
243
  {
244
244
  "kind": "template",
245
245
  "name": "EmojiPickerShowcase"
246
+ },
247
+ {
248
+ "kind": "template",
249
+ "name": "ListInputBudgetAllocation"
250
+ },
251
+ {
252
+ "kind": "template",
253
+ "name": "ListInputFamilyMembers"
254
+ },
255
+ {
256
+ "kind": "template",
257
+ "name": "ListInputMailingList"
258
+ },
259
+ {
260
+ "kind": "template",
261
+ "name": "ListInputShowcase"
246
262
  }
247
263
  ]
248
264
  },
@@ -4,7 +4,7 @@
4
4
 
5
5
  export const docs = {
6
6
  name: 'browser-support',
7
- title: 'Browser Support',
7
+ title: 'Browser support',
8
8
  category: 'guide',
9
9
  description:
10
10
  'What browsers Astryx targets, which modern platform features it depends on, and how to support older browsers for your own audience.',
@@ -4,9 +4,9 @@
4
4
 
5
5
  export const docs = {
6
6
  name: 'theme',
7
- title: 'Theme System',
7
+ title: 'Theming',
8
8
  category: 'guide',
9
- keywords: ['theme', 'dark mode', 'defineTheme', 'provider'],
9
+ keywords: ['theme', 'theming', 'theme system', 'dark mode', 'defineTheme', 'provider'],
10
10
  description:
11
11
  'How to use and create themes: see Use a theme for applying themes, and Author a theme for creating and customizing them.',
12
12
 
@@ -10,8 +10,9 @@ export const docs = {
10
10
  type: 'generic',
11
11
  name: 'component-lookups',
12
12
  placement: {parent: 'namespace:cli', slot: 'guides', order: 5},
13
- title: 'Looking up components',
13
+ title: 'Component lookups',
14
14
  category: 'guide',
15
+ keywords: ['look up', 'looking up components', 'lookup', 'batch'],
15
16
  description:
16
17
  'Look up one or several exact component identities, choose a focused projection, and handle complete batch receipts.',
17
18
  sections: [
@@ -2,8 +2,9 @@
2
2
 
3
3
  /**
4
4
  * @file `astryx docs authoring/building-blocks/docs/extend-or-replace`:
5
- * take over an existing topic with `replaces`, merge sections into one with
6
- * `extends`, and check overlaps with Core topics.
5
+ * take over an existing topic or guide with `replaces`, merge sections into
6
+ * one with `extends` (placing each with `before` or `after`), and check
7
+ * overlaps with Core topics.
7
8
  */
8
9
 
9
10
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -13,7 +14,7 @@ export const docs = {
13
14
  placement: {parent: 'namespace:docs', slot: 'guides', order: 40},
14
15
  title: 'Extend or replace a topic',
15
16
  category: 'guide',
16
- description: 'Take over a topic, or merge sections into it.',
17
+ description: 'Take over a topic or guide, or merge sections into it.',
17
18
  sections: [
18
19
  {
19
20
  id: 'replace-a-topic',
@@ -63,7 +64,8 @@ export const docs = {
63
64
  type: 'list',
64
65
  style: 'unordered',
65
66
  items: [
66
- "Read the base topic's keys with `--index`, and give a section that replaces one that key as its `id`. A section without an `id` matches only a base section with exactly its title, or one whose `id` is the key its title makes, so `Integration Themes` is added beside a base `Integration themes` that has no `id`.",
67
+ "Read the base topic's keys with `--index`, and give a section that replaces one that key as its `id`. A section that replaces one keeps its place. A section without an `id` matches only a base section with exactly its title, or one whose `id` is the key its title makes, so `Integration Themes` is added beside a base `Integration themes` that has no `id`.",
68
+ "Set `before` or `after` to a base section's key to add a new section there instead of at the end. A key that names no section adds it at the end, and `astryx doctor integration validate` lists a note. An older CLI rejects these fields, so declare an `@astryxdesign/cli` peer range that starts at the release that reads them; `astryx integration verify` warns without it.",
67
69
  "The topic keeps the base's title and description, and readers open it by the base's name.",
68
70
  'Replace the `Overview` placeholder that `integration add` writes, or it is added to the base topic.',
69
71
  "Extend a topic to correct or add to it. A copy made with `replaces` stops getting the owner's fixes.",
@@ -71,6 +73,36 @@ export const docs = {
71
73
  },
72
74
  ],
73
75
  },
76
+ {
77
+ id: 'replace-or-extend-a-cli-guide',
78
+ title: 'Replace or extend a CLI guide',
79
+ content: [
80
+ {
81
+ type: 'prose',
82
+ text: "A guide in the CLI's docs tree has a route rather than a topic name. Set `replaces` or `extends` to that route to change the guide for every app that installs your package: say what differs for your users on the page agents already read.",
83
+ },
84
+ {
85
+ type: 'code',
86
+ lang: 'javascript',
87
+ label: 'docs/acme-quick-start.doc.mjs',
88
+ code: "export default {\n type: 'generic',\n name: 'acme-quick-start',\n extends: 'authoring/quick-start',\n title: 'Acme quick start',\n description: 'What differs when you build integrations at Acme.',\n sections: [\n {id: 'use-the-acme-registry', title: 'Use the Acme registry', before: 'fill-in-package-json', content: [/* ... */]},\n ],\n};",
89
+ },
90
+ {
91
+ type: 'list',
92
+ style: 'unordered',
93
+ items: [
94
+ 'Your doc stays a flat topic: do not give it a `placement`. Readers open the guide by its route, never by your `name`.',
95
+ 'With `replaces`, readers of the route get your doc, under your package. With `extends`, each section you add or replace names your package.',
96
+ 'A name that holds no topic or guide, such as a namespace, changes nothing; `astryx doctor integration validate` lists it as a note, with the guides below a namespace.',
97
+ ],
98
+ },
99
+ {
100
+ type: 'code',
101
+ lang: 'bash',
102
+ code: '# Every guide route, by namespace\nastryx docs authoring --depth all\nastryx docs cli --depth all\n# The keys to place sections by\nastryx docs authoring/quick-start --index',
103
+ },
104
+ ],
105
+ },
74
106
  {
75
107
  id: 'check-overlaps-with-core-topics',
76
108
  title: 'Check overlaps with Core topics',
@@ -10,11 +10,12 @@
10
10
  export const docs = {
11
11
  type: 'namespace',
12
12
  name: 'migration',
13
- title: 'Migration Guide',
13
+ title: 'Migration',
14
14
  summary:
15
15
  'Migrate an existing Tailwind, shadcn, or Radix app to the design system incrementally — setup, component replacement, and verification.',
16
16
  keywords: [
17
17
  'migration',
18
+ 'migration guide',
18
19
  'migrate',
19
20
  'Tailwind',
20
21
  'shadcn',
@@ -10,7 +10,7 @@
10
10
  export const docs = {
11
11
  type: 'namespace',
12
12
  name: 'styling-libraries',
13
- title: 'Styling Library Interop',
13
+ title: 'Other styling libraries',
14
14
  summary:
15
15
  'Integrate Tailwind, StyleX, Panda, Chakra, MUI, CSS-in-JS, CSS Modules, and non-CSS renderers with system tokens.',
16
16
  keywords: [
@@ -23,6 +23,7 @@ export const docs = {
23
23
  'styled-components',
24
24
  'CSS Modules',
25
25
  'interop',
26
+ 'styling library interop',
26
27
  ],
27
28
  slots: {
28
29
  guides: {title: 'Guides', accepts: {kinds: ['generic']}},
@@ -10,7 +10,7 @@
10
10
  export const docs = {
11
11
  type: 'namespace',
12
12
  name: 'styling',
13
- title: 'Styling Components',
13
+ title: 'Styling components',
14
14
  summary:
15
15
  'Customize component appearance: xstyle, Tailwind, className, rest props, compound components, data attribute selectors, tokens, and StyleX setup.',
16
16
  keywords: [
@@ -0,0 +1,54 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ // Generated from the committed full palette for the stops used by Butter's
4
+ // theme source. Regenerate with `pnpm generate:butter-palette-refs`.
5
+ // Keep the complete palette available for authoring and audits without
6
+ // making consumers pay for unused palette stops.
7
+ // prettier-ignore
8
+ export const butterPaletteRefs = {
9
+ purple: {
10
+ light: {25: '#52237b', 80: '#ddb9f6', 90: '#f2daff'},
11
+ dark: {25: '#52237b', 80: '#ddb9f6', 90: '#f2daff'},
12
+ },
13
+ green: {
14
+ light: {25: '#004a05', 70: '#7bbf7a', 80: '#a2d7a0', 85: '#b6e3b4', 90: '#caeec8'},
15
+ dark: {15: '#013004', 20: '#063c0a', 70: '#83bc82', 80: '#a8d4a6', 90: '#cdedcc'},
16
+ },
17
+ neutral: {
18
+ light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 45: '#605f52', 55: '#79786a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'},
19
+ dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'},
20
+ },
21
+ orange: {
22
+ light: {25: '#622e00', 80: '#f2bd81', 90: '#ffdcb6'},
23
+ dark: {25: '#622e00', 80: '#f2bd81', 90: '#ffdcb6'},
24
+ },
25
+ blue: {
26
+ light: {25: '#203a6c', 80: '#bdc5eb', 90: '#dbe1ff'},
27
+ dark: {25: '#203a6c', 80: '#bdc5eb', 90: '#dbe1ff'},
28
+ },
29
+ red: {
30
+ light: {10: '#3b0200', 25: '#6f1400', 30: '#821b00', 60: '#e56241', 80: '#ffb09b', 90: '#ffd9cf', 95: '#ffece7'},
31
+ dark: {15: '#4c0700', 25: '#6f1400', 80: '#ffb09b', 85: '#ffc5b5', 90: '#ffd9cf'},
32
+ },
33
+ yellow: {
34
+ light: {25: '#443c00', 30: '#514700', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
35
+ dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'},
36
+ },
37
+ teal: {
38
+ light: {25: '#00482d', 80: '#94d3bb', 90: '#b0f0d7'},
39
+ dark: {25: '#00482d', 80: '#94d3bb', 90: '#b0f0d7'},
40
+ },
41
+ accent: {
42
+ light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'},
43
+ },
44
+ cyan: {
45
+ light: {25: '#004649', 80: '#8dd2d3', 90: '#a9eff0'},
46
+ dark: {25: '#004649', 80: '#8dd2d3', 90: '#a9eff0'},
47
+ },
48
+ pink: {
49
+ light: {25: '#6c0a68', 80: '#f0b3e8', 90: '#ffd5fb'},
50
+ dark: {25: '#6c0a68', 80: '#f0b3e8', 90: '#ffd5fb'},
51
+ },
52
+ } as const;
53
+
54
+ export default butterPaletteRefs;