An open source design system that's fully customizable and agent ready
TypeScript
docs(cli): keep declared keywords to what each doc answers (#7714)
Joeya2f0c93dfaac
diff --git a/.changeset/search-doc-keyword-names.md b/.changeset/search-doc-keyword-names.mdindex 2ee878441f..10dd8930a2 100644--- a/.changeset/search-doc-keyword-names.md+++ b/.changeset/search-doc-keyword-names.md@@ -2,6 +2,6 @@'@astryxdesign/cli': patch----[fix] `astryx search` keeps a guide first when the query is a phrase the guide declares as a keyword. A guide that declares `code review` now comes before the Code component for that search, instead of below every component that matches one word. A component whose name is the whole query still comes first, and one-word queries are unchanged.+[fix] `astryx search` keeps a guide first when the query is a phrase of two or more words that the guide declares as a keyword. `font size` and `font weight` now open the font setup guide before the Text component, and `dark mode` opens the theme guides before the theme hooks. A component whose name is the whole query still comes first, one-word queries are unchanged, and the code terms and table cells in a reference doc don't count as its keywords.@josephfarinadiff --git a/packages/cli/api/search/search.domain-priority.test.mjs b/packages/cli/api/search/search.domain-priority.test.mjsindex 04f3a14845..0838288a4b 100644--- a/packages/cli/api/search/search.domain-priority.test.mjs+++ b/packages/cli/api/search/search.domain-priority.test.mjs@@ -277,6 +277,21 @@ describe('search domain priority — real docs and components', () => {SLOW,);+ it(+ 'opens the guide that answers a declared phrase, not one that only mentions it',+ async () => {+ const [layers] = (await search('cascade layers', {cwd})).data.results;+ expect(layers).toMatchObject({+ domain: 'doc',+ name: 'migration/migration-setup',+ });+ const [keyboard] = (await search('keyboard navigation', {cwd})).data+ .results;+ expect(keyboard?.name).not.toBe('migration/migration-verification');+ },+ SLOW,+ );+it('keeps a component above docs that match only by a heading, with scores unchanged',async () => {diff --git a/packages/cli/assets/docs/tree/migration-setup.doc.mjs b/packages/cli/assets/docs/tree/migration-setup.doc.mjsindex 48525f0a2b..36a9b930fb 100644--- a/packages/cli/assets/docs/tree/migration-setup.doc.mjs+++ b/packages/cli/assets/docs/tree/migration-setup.doc.mjs@@ -21,6 +21,7 @@ export const docs = {'reset','smoke test','layer audit',+ 'cascade layers','Tailwind coexistence',],diff --git a/packages/cli/assets/docs/tree/migration-verification.doc.mjs b/packages/cli/assets/docs/tree/migration-verification.doc.mjsindex 2400a45267..6e552e0f1a 100644--- a/packages/cli/assets/docs/tree/migration-verification.doc.mjs+++ b/packages/cli/assets/docs/tree/migration-verification.doc.mjs@@ -19,7 +19,6 @@ export const docs = {'verification','checklist','AI prompt',- 'keyboard navigation',],sections: [diff --git a/packages/cli/assets/docs/tree/migration.doc.mjs b/packages/cli/assets/docs/tree/migration.doc.mjsindex 7c04058870..cd1baf6347 100644--- a/packages/cli/assets/docs/tree/migration.doc.mjs+++ b/packages/cli/assets/docs/tree/migration.doc.mjs@@ -19,7 +19,6 @@ export const docs = {'Tailwind','shadcn','Radix',- 'cascade layers','coexistence',],slots: {