@astryxdesign/cli 0.7.3-canary.f94e962 → 0.7.3

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 (205) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +68 -68
  3. package/api/build/_adapter.mjs +37 -25
  4. package/api/build/blocks/blocks.d.mts +68 -18
  5. package/api/build/blocks/blocks.mjs +475 -116
  6. package/api/build/blocks/blocks.test.mjs +191 -61
  7. package/api/build/blocks/blocks.weights.json +1 -1
  8. package/api/build/build.type.mjs +1 -1
  9. package/api/build/kit/answer.d.mts +9 -5
  10. package/api/build/kit/answer.mjs +123 -13
  11. package/api/build/kit/answer.test.mjs +73 -3
  12. package/api/build/kit/signals.d.mts +19 -0
  13. package/api/build/kit/signals.mjs +18 -7
  14. package/api/build/kit/weights.d.mts +8 -22
  15. package/api/build/kit/weights.mjs +87 -8
  16. package/api/build/kit/weights.test.mjs +96 -0
  17. package/api/build/tree.mjs +2 -1
  18. package/api/build/tree.test.mjs +37 -29
  19. package/api/component/_adapter.mjs +39 -5
  20. package/api/component/component-replacement.test.mjs +1 -0
  21. package/api/component/component.mjs +1 -1
  22. package/api/component/doc-links.test.mjs +2 -2
  23. package/api/discover/_adapter.d.mts +1 -2
  24. package/api/discover/_adapter.mjs +6 -8
  25. package/api/discover/discover.mjs +0 -1
  26. package/api/docs/_adapter.d.mts +2 -2
  27. package/api/docs/_adapter.mjs +65 -18
  28. package/api/docs/docs-homes.test.mjs +127 -0
  29. package/api/docs/docs.doc.mjs +3 -3
  30. package/api/docs/docs.test.mjs +28 -18
  31. package/api/docs/integration-tree.test.mjs +20 -20
  32. package/api/docs/integrationDocs.test.mjs +1 -1
  33. package/api/docs/namespace-section.test.mjs +6 -6
  34. package/api/docs/reference-blocks.test.mjs +2 -2
  35. package/api/doctor/_adapter.d.mts +33 -13
  36. package/api/doctor/_adapter.mjs +55 -25
  37. package/api/doctor/doctor.d.mts +23 -5
  38. package/api/doctor/doctor.mjs +97 -28
  39. package/api/doctor/doctor.test.mjs +67 -9
  40. package/api/hook/hook.mjs +1 -1
  41. package/api/integration/validate-integration-fixes.test.mjs +6 -5
  42. package/api/integration/validate-integration-gaps.test.mjs +12 -1
  43. package/api/integration/validate-integration.d.mts +4 -0
  44. package/api/integration/validate-integration.mjs +48 -7
  45. package/api/integration/validate-integration.type.d.mts +36 -5
  46. package/api/integration/validate-integration.type.mjs +27 -6
  47. package/api/integration/validateIntegration.doc.mjs +1 -1
  48. package/api/search/_adapter.d.mts +16 -0
  49. package/api/search/_adapter.mjs +39 -0
  50. package/api/search/_adapter.test.mjs +173 -0
  51. package/api/search/_candidate-score.mjs +1 -1
  52. package/api/search/_entries.d.mts +11 -0
  53. package/api/search/_entries.mjs +35 -17
  54. package/api/search/_entries.test.mjs +48 -0
  55. package/api/search/_gather-docs.mjs +3 -3
  56. package/api/search/_gather-templates.d.mts +0 -1
  57. package/api/search/_gather-templates.mjs +25 -0
  58. package/api/search/search.doc.mjs +1 -1
  59. package/api/search/search.integration-block.test.mjs +100 -0
  60. package/api/search/search.mjs +6 -2
  61. package/api/search/search.test.mjs +14 -14
  62. package/api/template/template.mjs +5 -1
  63. package/assets/docs/author-a-theme.doc.mjs +2 -2
  64. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  65. package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
  66. package/assets/docs/tree/add-a-topic.doc.mjs +1 -1
  67. package/assets/docs/tree/agent-guidance.doc.mjs +1 -1
  68. package/assets/docs/tree/{integrations.doc.mjs → authoring.doc.mjs} +15 -6
  69. package/assets/docs/tree/block-template.doc.mjs +1 -1
  70. package/assets/docs/tree/build-the-template.doc.mjs +1 -1
  71. package/assets/docs/tree/building-blocks.doc.mjs +2 -2
  72. package/assets/docs/tree/check-the-props.doc.mjs +1 -1
  73. package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
  74. package/assets/docs/tree/checks.doc.mjs +2 -2
  75. package/assets/docs/tree/ci-and-containers.doc.mjs +13 -0
  76. package/assets/docs/tree/cli-command.doc.mjs +1 -1
  77. package/assets/docs/tree/cli.doc.mjs +1 -1
  78. package/assets/docs/tree/codemods.doc.mjs +1 -1
  79. package/assets/docs/tree/component-family.doc.mjs +1 -1
  80. package/assets/docs/tree/component-imports.doc.mjs +1 -1
  81. package/assets/docs/tree/components.doc.mjs +1 -1
  82. package/assets/docs/tree/configuration.doc.mjs +1 -1
  83. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  84. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  85. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  86. package/assets/docs/tree/docs.doc.mjs +1 -1
  87. package/assets/docs/tree/document-the-template.doc.mjs +1 -1
  88. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  89. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  90. package/assets/docs/tree/extend-or-replace.doc.mjs +1 -1
  91. package/assets/docs/{authoring.doc.mjs → tree/field-reference.doc.mjs} +4 -3
  92. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  93. package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
  94. package/assets/docs/tree/global-integrations.doc.mjs +2 -2
  95. package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
  96. package/assets/docs/tree/help.doc.mjs +2 -2
  97. package/assets/docs/tree/links.doc.mjs +1 -1
  98. package/assets/docs/tree/package-and-test.doc.mjs +1 -1
  99. package/assets/docs/tree/page-template.doc.mjs +1 -1
  100. package/assets/docs/tree/publishing.doc.mjs +1 -1
  101. package/assets/docs/tree/quick-start.doc.mjs +1 -1
  102. package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
  103. package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
  104. package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
  105. package/assets/docs/tree/see-it-in-an-app.doc.mjs +1 -1
  106. package/assets/docs/tree/ship.doc.mjs +2 -2
  107. package/assets/docs/tree/short-and-findable.doc.mjs +1 -1
  108. package/assets/docs/tree/single-component.doc.mjs +1 -1
  109. package/assets/docs/tree/start-a-template.doc.mjs +1 -1
  110. package/assets/docs/tree/subcomponent.doc.mjs +1 -1
  111. package/assets/docs/tree/template-assets.doc.mjs +1 -1
  112. package/assets/docs/tree/template-doc-overview.doc.mjs +2 -2
  113. package/assets/docs/tree/template-fonts.doc.mjs +1 -1
  114. package/assets/docs/tree/template-grading-rubric.doc.mjs +1 -1
  115. package/assets/docs/tree/template-icons.doc.mjs +1 -1
  116. package/assets/docs/tree/template-images-media.doc.mjs +1 -1
  117. package/assets/docs/tree/template-styles.doc.mjs +1 -1
  118. package/assets/docs/tree/templates.doc.mjs +1 -1
  119. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  120. package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
  121. package/assets/docs/tree/themes.doc.mjs +1 -1
  122. package/assets/docs/tree/troubleshooting.doc.mjs +1 -1
  123. package/assets/docs/tree/upgrading.doc.mjs +1 -1
  124. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
  125. package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
  126. package/assets/docs/tree/versioning.doc.mjs +5 -1
  127. package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
  128. package/assets/docs/tree/write-the-template-file.doc.mjs +1 -1
  129. package/assets/docs/use-integrations.doc.mjs +120 -0
  130. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  131. package/authoring/integration/integration.doc.mjs +1 -1
  132. package/authoring/integration/type.ts +1 -1
  133. package/clients/cli/command-result-coverage.test.mjs +6 -5
  134. package/clients/cli/commands/build-theme.color-scheme.test.mjs +1 -1
  135. package/clients/cli/commands/{component/index.mjs → component.mjs} +37 -37
  136. package/clients/cli/commands/component.test.mjs +6 -6
  137. package/clients/cli/commands/docs.doc.mjs +2 -2
  138. package/clients/cli/commands/docs.mjs +1 -1
  139. package/clients/cli/commands/docs.test.mjs +14 -14
  140. package/clients/cli/commands/doctor-integration.test.mjs +49 -1
  141. package/clients/cli/commands/doctor.doc.mjs +1 -1
  142. package/clients/cli/commands/doctor.mjs +10 -0
  143. package/clients/cli/commands/{hook/index.mjs → hook.mjs} +22 -22
  144. package/clients/cli/commands/import-hint-correctness.test.mjs +1 -1
  145. package/clients/cli/commands/integration.doc.mjs +1 -1
  146. package/clients/cli/commands/manifest.doc.mjs +1 -1
  147. package/clients/cli/commands/manifest.mjs +67 -0
  148. package/clients/cli/commands/outside-project.test.mjs +99 -0
  149. package/clients/cli/commands/postinstall.doc.mjs +23 -0
  150. package/clients/cli/commands/postinstall.mjs +31 -0
  151. package/clients/cli/commands/setup-nudge.test.mjs +17 -0
  152. package/clients/cli/commands/{build-theme.mjs → theme.mjs} +1 -1
  153. package/clients/cli/index.mjs +35 -93
  154. package/clients/cli/lib/component-format.mjs +1 -1
  155. package/clients/cli/lib/define-command.mjs +12 -7
  156. package/clients/cli/lib/exit-codes.test.mjs +5 -0
  157. package/clients/cli/lib/manifest.test.mjs +12 -0
  158. package/clients/cli/lib/welcome-box.mjs +50 -0
  159. package/foundation/agent-docs/agent-doc-state.d.mts +12 -0
  160. package/foundation/agent-docs/agent-doc-state.mjs +24 -2
  161. package/foundation/agent-docs/agent-docs.mjs +7 -6
  162. package/foundation/agent-docs/agent-docs.test.mjs +5 -4
  163. package/foundation/agent-docs/computer-agent-text.d.mts +39 -2
  164. package/foundation/agent-docs/computer-agent-text.mjs +135 -8
  165. package/foundation/agent-docs/computer-agent-text.test.mjs +99 -2
  166. package/foundation/discovery/authoring-self-docs.d.mts +7 -0
  167. package/foundation/discovery/authoring-self-docs.mjs +16 -4
  168. package/foundation/discovery/authoring-self-docs.test.mjs +15 -3
  169. package/foundation/discovery/authoring-surface.d.mts +1 -1
  170. package/foundation/discovery/authoring-surface.mjs +2 -2
  171. package/foundation/discovery/authoring-surface.test.mjs +1 -1
  172. package/foundation/discovery/cli-self-docs.d.mts +2 -1
  173. package/foundation/discovery/cli-self-docs.mjs +4 -3
  174. package/foundation/discovery/cli-self-docs.test.mjs +2 -2
  175. package/foundation/discovery/runner-commands.mjs +1 -0
  176. package/foundation/discovery/stray-pointers.test.mjs +1 -1
  177. package/foundation/doc-compiler/doc-loads.test.mjs +21 -9
  178. package/foundation/doc-compiler/split-topic-keywords.test.mjs +3 -2
  179. package/foundation/doc-compiler/tree.d.mts +32 -6
  180. package/foundation/doc-compiler/tree.mjs +77 -43
  181. package/foundation/doc-compiler/tree.test.mjs +7 -7
  182. package/foundation/fs/read-record.d.mts +18 -0
  183. package/foundation/fs/read-record.mjs +131 -0
  184. package/foundation/fs/read-record.test.mjs +77 -0
  185. package/foundation/integrations/cli-peer-version.d.mts +36 -0
  186. package/foundation/integrations/cli-peer-version.mjs +132 -0
  187. package/foundation/integrations/cli-peer-version.test.mjs +354 -0
  188. package/foundation/integrations/exports-subpaths.d.mts +57 -0
  189. package/foundation/integrations/exports-subpaths.mjs +113 -0
  190. package/foundation/integrations/public-imports.d.mts +118 -0
  191. package/foundation/integrations/public-imports.mjs +1769 -0
  192. package/foundation/integrations/public-imports.test.mjs +1793 -0
  193. package/foundation/release/cache.test.mjs +24 -21
  194. package/foundation/release/global-state.d.mts +8 -4
  195. package/foundation/release/global-state.mjs +4 -2
  196. package/foundation/release/notices.d.mts +62 -8
  197. package/foundation/release/notices.mjs +136 -25
  198. package/foundation/release/notices.test.mjs +21 -0
  199. package/foundation/response/response-types.doc.mjs +1 -1
  200. package/foundation/text/string-utils.d.mts +2 -1
  201. package/foundation/text/string-utils.mjs +16 -5
  202. package/foundation/text/suggest-order.d.mts +72 -0
  203. package/foundation/text/suggest-order.mjs +363 -0
  204. package/foundation/text/suggest-order.test.mjs +259 -0
  205. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,120 @@
1
1
  # @xds/cli
2
2
 
3
+ # 0.7.3
4
+
5
+ #### New Features
6
+
7
+ - `astryx build` names the right block first far more often. It ranks every block in the catalog by what the request means, read from each block's own name, description, and component, so a block that word matching missed can still come first, with its own score and reason; and the block picker's fixed values are refitted on a larger, more varied set of written example requests, which helps most with requests worded in a product's own terms. A block the request names by its exact name, and a block from an integration, keep their place. The kit never lists more blocks than before, and its fields, page call, start template, and alternatives are unchanged.
8
+ - `astryx search` puts the entry you are after first more often: it orders the matches inside each score band, every result keeps its match score and reason, and a query that is an entry's exact name still answers with that entry first ([#7752](https://github.com/facebook/astryx/pull/7752)).
9
+ - `astryx doctor integration validate` and `astryx integration check` check the component names a package's docs and blocks give, and list what they find as notes beside validate's issues, each with its fix. Nothing counts a note and `integration check --strict` does not fail on them; they become failing warnings in the next minor release:
10
+ - `doc_name_mismatch` lists a component doc whose `name` is not the name the component is listed under when the module its printed import names (the doc's `import`, the published subpath, or the package root) provably does not export that name, so `astryx component` would print a broken import. The `Fix:` proposes the file name when that module exports it, otherwise the component it exports. A name that module's exports cannot prove or rule out (a re-export from another package, `export =`, a destructured binding, a namespace, an import that resolves to no file, or, when no import can be resolved, a source that only exports a default) is listed as not checked, with the reason, in validate's new `docNames` report.
11
+ - `unknown_block_component` lists a name a template's `exampleFor` or `componentsUsed` gives that neither the package nor Core has (every doc `astryx component` resolves in Core counts) and the template does not import it. Imports the template's local helpers make count too, including through a barrel such as `parts/index.ts`. A name is judged only where the template reaches components solely through named imports and re-exports from Core, React, StyleX, local helpers read in full, or the package's own name (followed through its `exports` like a helper). Anything else is listed as not checked in validate's new `blockComponents` report: an import from another package, which may render other components; any `default` binding other than React's or StyleX's; a namespace import; an alias of or member read off an imported binding; a component held in a variable; `require()`; a dynamic `import()`; a file that does not parse cleanly; a local module this check cannot read; and, without Core installed, any name only Core could resolve.
12
+
13
+ `integration check --strict` does not fail on anything listed as not checked.
14
+
15
+ - New `@astryxdesign/cli/host` entry for tools that carry the CLI: `runHostedCli` runs the CLI once per process, with the command name that tool's users type (printed commands start with it) and, when the tool skipped the project's own CLI, the reason, so that CLI is never run.
16
+
17
+ ```js
18
+ import {runHostedCli} from '@astryxdesign/cli/host';
19
+
20
+ const result = await runHostedCli({
21
+ argv: ['search', 'button'],
22
+ cliCommand: 'acme astryx',
23
+ });
24
+ ```
25
+
26
+ - `astryx doctor integration validate` now notes, from source and without a build, what an integration package tells apps to import that they cannot import, the way it lists an ignored `cliCommand`. Each note is in `data.notes` and names its fix, such as the exact `exports` entry to add. Notes are listed only: neither `doctor integration validate` nor `astryx integration check --strict` counts or fails on them in 0.7.3, and they become failing warnings in the next minor release, so fix them now. It notes:
27
+ - a component's import (the doc's `import`, or the one the CLI derives when the doc has none) or a template's public import whose subpath package.json `exports` does not declare, or that names another package. A subpath is not declared by a missing key, a key whose only conditions an ES module import does not load (such as `require` or `types`), an `exports` that is a single string, a wildcard that does not match, or an empty `exports` map;
28
+ - a component example that imports a subpath the package does not declare;
29
+ - a template that imports a relative path outside the templates root, or a path its own package or Core does not export.
30
+
31
+ A subpath is judged from its `exports` declaration alone, never by its target file, so `exports` may point at build output that does not exist yet; whether that module exports the names an import asks for is the next entry's check. Wildcards and condition objects with `import` or `default` pass. An import of a subpath whose `exports` entry has only `types` targets, or that an ES module import reaches only through `types` (such as `types` beside `require`), is never judged as a run-time import: it passes when it is `import type`, when every binding is an inline `type`, or when every name it imports is one the `types` file declares as a type, and is listed under `unchecked` otherwise. A `types` target under `require` does not count, and a package with no `exports` keeps its deep paths to files it ships. What it cannot judge (in a package with no `exports`, a deep path into build output not built yet, such as `dist/`; a template import of Core when `@astryxdesign/core` is not installed beside the package; every import of the package's own name when package.json has no `name`) is listed under `unchecked` in a new `publicImports` report on the result (`{status: 'checked', findings: [], unchecked: [{file, specifier, reason}]}`), which `integration check` counts as not compared.
32
+
33
+ - `astryx doctor integration validate` now also notes, from source and without a build, an import that names something its module does not export (in `data.notes`, each with its fix). These notes are listed only in 0.7.3 too, and become failing warnings in the next minor release. It notes:
34
+ - a component's import (the doc's `import`, or the one the CLI derives) that leads to a module that does not export the component, naming the subpath that does or the `exports` entry to add;
35
+ - a component example or a template that imports a name the package does not export;
36
+ - a template source with no default export (`astryx template` still copies it, but its public import and anything that renders it get nothing), suggesting an exported PascalCase function, class or `const`, never a hook such as `useAccount`, a helper such as `formatBalance`, an ALL-CAPS constant or a type; with none, the fix stays generic.
37
+
38
+ A name is judged only when a file the `exports` entry names is there to read in full. `export *` is followed, cycles included; a built module's declaration file (`x.d.ts` beside `x.js`, and the `.d.ts` files its `export *` names) is read for the types it exports; `export import Alias = Inner.Value` counts as an export; TypeScript source resolves a `./x.js` specifier to `./x.ts`; and a declaration file that is a module exports every top-level declaration unless it has an export list, `export *`, `export =` or a default export of an expression, as TypeScript does. Whatever the reader does not fully model is listed under `unchecked` in the `publicImports` report instead of as a note: a file the `exports` entry names that does not exist yet; a module whose list cannot be read in full (CommonJS, `export *` from another package); a declaration file with no import or export (a global script); a name missing from a JavaScript module with no declaration file, which may be a type; and every name it would report, other than a component doc's own component, while a TypeScript file in the package (outside `node_modules`) has a parsed `declare module` block for a relative path, the package's own name or a subpath of it, since that can add names to the module. The reason names that file; `declare global`, a wildcard spec such as `'*.css'`, another package's name and a `declare module` in a comment do not count, and a file with `declare module` in its text that cannot be parsed counts. `astryx docs authoring/ship/checks` explains each check.
39
+
40
+ - A failed `astryx component`, `template` or `docs` lookup lists the entry you most likely meant first. Components that tie on match score are ordered by how early the name you typed appears in their keywords and by how close their names are, instead of alphabetically; among the suggestions offered, a component one of whose other names was typed (including another library's name for it, such as `MUI TextField`, with or without the library's name) comes first; a compound name that does not exist (a family part named with other words, or without one of its family's words) suggests the real part or its family. Templates are ordered by how closely their id or title matches the name you typed, and unknown docs routes by how closely the route matches. Suggestion lists never get longer, every suggestion is a real entry, and a name that resolved before still resolves to the same entry.
41
+ - Integration docs that tell readers to run an Astryx command through a package runner now get a `runner_command` note from `doctor integration validate` (and so `integration check`) in `data.notes`, with its file, line and the bare `astryx <command>` to write instead. A note fails nothing, so `integration check --strict` exits as before. The unscoped name after a download runner (`npx astryx`) always counts, because it fetches an unrelated package; the scoped `npx @astryxdesign/cli`, for install steps, does not.
42
+
43
+ #### Fixes
44
+
45
+ - `astryx build` starts from a page template its word weights do not list (an integration's template, or one added since the weights were fit) only when the request names as many words of that template's own display name, category and keywords (search's stopwords aside) as of the best listed template, or names that template's family (the first part of its category) before the listed template's family and at most two fewer of its words; otherwise it starts from that listed template and offers the other as the first alternative.
46
+ - The CLI finds the project's `@astryxdesign/core` from any folder inside the project, so `component`, `hook`, `build`, `search`, `swizzle`, `theme targets` and `doctor` now work five or more folders deep, in workspace members whose Core the workspace installs at its root, and in Yarn Plug'n'Play projects. They still search the folders they searched before, and past them continue up to the workspace root of the nearest folder whose package.json declares an Astryx package.
47
+ - `upgrade --from` run from any folder in a project upgrades that project: the nearest folder whose package.json declares an Astryx package or that an Astryx workspace lists, found without passing a repository root or counting the home folder. It targets only the project's own Core (the one in its `node_modules`, or for a member its workspace lists, the one the workspace installs), scans the project's `src` by default, reads a `--path` you type from the folder you ran in, names the files in its `--json` result relative to that folder, refreshes the project's agent docs, and names the project root and the source folder it scans before it changes anything. With no such project, `upgrade` reads only the current folder, as before.
48
+ - An `upgrade` run in a folder that installs Core but declares no Astryx package now upgrades the Astryx project above it instead of that folder alone, since such a folder was never a separate upgrade root. To keep a sub-folder that installs Core its own project, declare an Astryx package in that folder's package.json.
49
+ - A `packages/core` folder that holds another package is no longer read as Core, and an integration named in `astryx.config` now loads when the workspace installs it at its root, as an autolinked one already did.
50
+ - The CLI's install advice no longer adds a package to a `package.json` that is not an Astryx project's. This covers the daily hint, the setup reminder, the update notice, `astryx doctor`'s version-alignment and integration fixes, and `astryx discover`'s install command for an integration installed for the computer. The project is the nearest folder whose `package.json` declares an Astryx package, or a member its workspace lists, never the home folder and never past a repository root.
51
+ - From a folder inside such a project whose own `package.json` is not the project's, such as a tool folder that installs its own `@astryxdesign/core`, the daily hint that matches a project's CLI to its Core, the setup reminder and `astryx doctor`'s version-alignment fix used to name a command that added the CLI to that folder's `package.json`, making it a separate Astryx project. They still compare the CLI with the Core the run reads, and when the two differ they say to run from the project's folder, or to declare an Astryx package in that folder; the update notice upgrades the project from its folder, with the project's release.
52
+ - For an integration installed for the computer, `astryx discover` gives no install command from such a folder, and `astryx doctor`'s fix says to run from the project's folder, where the command adds it for the project; in a folder that belongs to no project, neither names a command.
53
+ - In a folder that belongs to no Astryx project, the hint, the setup reminder and the update notice no longer print, and `astryx doctor`'s fix says how to reach a project.
54
+ - Unchanged: the official packages `astryx discover` lists and the theme packages `astryx doctor` suggests still use the folder the command runs in; a member its workspace lists keeps its own advice; in a folder whose `package.json` declares an Astryx package, the advice is the same. No JSON shape or exit code changes.
55
+ - `astryx doctor integration validate`, `astryx integration check` and `astryx integration verify` catch more package mistakes, and each new finding ends in a `Fix:` that clears it. Findings that 0.7.2 did not fail on are listed as notes beside validate's issues, which nothing counts, until the next minor:
56
+ - Two docs for one component (`AcmeWidget.doc.mjs` and `AcmeWidget.doc.js`) are listed as `duplicate_component_doc`, naming the one read; discovery now always reads the same one.
57
+ - A component doc whose file name differs from its source only in letter case is one finding that says which file to rename: an error where the pair fails (Linux), a listed `source_without_component_doc` where it still pairs (a case-insensitive disk); a hidden doc that does not pair keeps the source warning it had.
58
+ - A root reached through a symlinked folder is listed as `symlinked_root`: npm pack does not follow it.
59
+ - An absolute root says roots are relative and gives the relative path; a root that is a file is reported by every check instead of crashing it.
60
+ - A package.json without `name` or `version` is listed with a fix, instead of a crash; `verify` fails on it. A package whose `name` and manifest `providerId` give no provider ID is listed as `no_provider_id`.
61
+ - A contribution file Astryx cannot read is listed as `unreadable_file`, before npm pack fails on it.
62
+
63
+ `astryx integration check --strict` does not fail on these pairing, root and package.json notes either; they become failures in the next minor. `astryx integration verify` still fails on a package.json npm cannot pack.
64
+
65
+ - `astryx doctor integration validate`, `astryx integration check` and `astryx integration verify` say more plainly what is wrong in findings they already reported, and how to fix it:
66
+ - An empty doc or manifest, or one with no default export, says so and names what it does export, instead of "(root): Invalid input".
67
+ - A manifest key one or two letters off a known key asks "did you mean `components`?" before suggesting a newer CLI.
68
+ - A theme descriptor named for the built file (`ocean.doc.mjs` beside a built `ocean.js` that lacks the `ocean` export) says it must share its stem with the `defineTheme` source, naming that source when the built module's `Source:` line or the source's `defineTheme` name confirms it.
69
+ - A template doc with no source, a theme descriptor with no source, a theme source with no descriptor, and a component whose source is `.jsx` get a `Fix:`.
70
+ - A theme source named for its theme (`brand.ts`) beside the module the build writes (`brand.js`) is told to take the `brandTheme` stem.
71
+ - `verify` names packed files by their path in the package, not the scratch copy's; says npm pack does not follow a symlinked root instead of asking for a `files` entry; and, when a theme's `defineTheme` name differs from the files its package exports, says a rebuild writes files under the new name.
72
+ - Integration authors now learn when the running CLI is outside their package's `@astryxdesign/cli` peer range: `astryx doctor integration validate` and `astryx integration check` list a `cli_peer_version` note naming the package, the range and the running version. Below the range the note gives the project's commands to install a newer `@astryxdesign/core` and `@astryxdesign/cli` together (as dev dependencies in the package's own folder) and then run `astryx upgrade --from <version> --apply`. Above the range it asks for a release of an installed package that supports this CLI, or asks the author of the package in the current folder to test with this CLI and widen the range. A note fails nothing: `--strict`, `integration verify`, `doctor`, and exit codes are unchanged.
73
+ - `astryx component <Member> --package @astryxdesign/core` now answers with that member, as the unscoped lookup does. A Core component documented in its family's doc (HStack and VStack in the Stack doc) used to come back as the family doc, named after the family and with no props.
74
+ - The agent guide that global mode writes to the home folder now tells agents to deliver a page built with Astryx, not only how to find things. Before, agents that found the right template could still build the page with a tool that cannot install packages and deliver a page with no Astryx in it. The guide now tells agents to work in a project folder (creating one if there is none); add `@astryxdesign/core` and `@astryxdesign/cli` to a new project or one without Core, or, in a project that already has `@astryxdesign/core`, the CLI at the same version; run `astryx init` there; follow the same template-first workflow and self-check the project agent docs give; and end by building the project and delivering that build. The guide stays version-free and names only commands every release keeps. The project agent docs are unchanged, and so is what `@astryxdesign/core`'s install script prints: its copy of the shared agent-docs file only gains the same workflow lines.
75
+ - Agents that follow the guide global mode writes to the home folder now know what to do when `astryx` is not found: run the command that installed the CLI for the computer first, with the same package manager and folder, such as `npm i -g @astryxdesign/cli` or `pnpm add -g @astryxdesign/cli`. On machines that keep the home folder but reset system folders on restart, the guide outlived the CLI installed for the computer and told agents to run a command that was gone. Outside a project, when the guide names `astryx` and no `astryx` command is on the search path, apart from a package runner's own copy, `astryx doctor` now says so and names the install step the guide records, or npm's when it records none. The global-mode guide for CI and containers explains how to keep the CLI across restarts. A guide written for a host's own command is unchanged. No JSON shape or exit code changes.
76
+ - The butter, stone, and y2k themes no longer show the secondary hover fill on a disabled `ComplexSelector` trigger, whether the trigger is natively disabled or exposes `aria-disabled="true"`, the focusable form every disabled control now uses. Before, the guard only recognized a natively disabled trigger. The themes `astryx theme eject` copies carry the same guard.
77
+ - Apps that use Core's prebuilt CSS without a StyleX build step now get the default data colors: the prebuilt CSS defines the canonical `dataVars` defaults, so compiled imports and raw CSS references paint correctly.
78
+ - `astryx init` writes the agent docs at the project root, in files the project commits, so Codex, Gemini CLI, Copilot CLI and Claude Code all read the block from the project root or any folder below it ([#7497](https://github.com/facebook/astryx/pull/7497)). It no longer writes agent docs into a project's subfolder, the home folder, or a settings folder in it such as `~/.gemini`.
79
+ - `AGENTS.md` holds the block, created when missing. Before, a project with only `CLAUDE.md` got the block only there, so Codex and Gemini CLI never saw it.
80
+ - Claude Code skips `AGENTS.md` in a folder that has a `CLAUDE.md` or `.claude/CLAUDE.md`, so the Claude Code file the project already has keeps a full copy: root `CLAUDE.md`, else `.claude/CLAUDE.md`. It keeps the copy even when it imports `AGENTS.md`, because Claude Code does not follow that import in a session started in a subfolder; started at the root, Claude Code then reads two. When both exist, the copy goes in root `CLAUDE.md`, which projects commit even when they ignore `.claude/`, and a block in `.claude/CLAUDE.md` is removed. Init creates no Claude file. `astryx upgrade` refreshes every copy, except in a project at the top of a home settings folder (see the next entry).
81
+ - Gemini CLI reads only `GEMINI.md`: init adds a one-line import, `@./AGENTS.md`, creating `GEMINI.md` when it is missing. It adds none when `GEMINI.md` already imports `AGENTS.md`, inline or on its own line. It adds the import even when the project's `.gemini/settings.json` has Gemini read `AGENTS.md` through `context.fileName`: Gemini loads those settings only when it starts at the project root, so a session started in a subfolder would otherwise get no copy. Started at the root, Gemini then reads two.
82
+ - The project root is the nearest folder at or above where init runs whose `package.json` declares an `@astryxdesign` package, else the nearest with any `package.json`. The search stops at a repository root and never counts the home folder. With no `package.json` found, init writes where it runs, as before. `docsWritten` still lists each file relative to where init ran, for example `../../AGENTS.md`.
83
+ - A `GEMINI.md` that resolves outside the project, for example a link to a shared file, is skipped and reported in `docsError` with one note (not an error line), in the default layout and in a project's own layout; the rest is written and init exits 0.
84
+ - The managed block belongs to Astryx: init and `astryx upgrade` write, refresh, and remove only the block, whatever ignore rules or generated markers say, as 0.7.1 did, and never change the text around it. Every write stays inside the project: run in the folder 0.7.1 wrote, an agent file 0.7.1 wrote there whose path leaves the project still refuses the run with exit 1. The project's Claude Code file (root `CLAUDE.md`, or `.claude/CLAUDE.md` when there is no root one) that resolves outside the project and is a block-less import of an existing `AGENTS.md`, which 0.7.1 left alone, is skipped and reported in `docsError` with one note, and init exits 0. Run from a folder below the project root, where 0.7.1 wrote in that folder instead, a project-root file whose path leaves the project is skipped and reported in `docsError` with one note, the rest is written, and init exits 0.
85
+ - While root `CLAUDE.md` is untracked and ignored by the repository's ignore rules (any ignore file from the repository root down, such as a monorepo's root `.gitignore`, the local exclude file, or configured excludes; init asks git, Sapling or Mercurial), a `.claude/CLAUDE.md` the project commits gets the copy too, so a fresh clone still gives Claude Code a copy; `--agent claude` and `--agent all` write it there as well. A file the repository tracks counts as committed whatever the ignore rules say, as git and Mercurial ignore only untracked files, and when the repository cannot answer, the copy is kept, on the first run as on later ones. Such a copy that resolves outside the project refuses the run with exit 1 where 0.7.1 wrote it too; one 0.7.1 did not write (the one `--agent claude` adds, or a block-less import of an existing `AGENTS.md`) is skipped and reported in `docsError` with one note, and init exits 0. So is a `.claude/CLAUDE.md` whose block `--agent claude` would remove beside a `CLAUDE.md`, since 0.7.1's `claude` preset wrote only `CLAUDE.md` there. Beside a committed root `CLAUDE.md`, with `.claude` linked outside the project, three cases that 0.7.1 refused now exit 0 with nothing written: the default with a `.claude/CLAUDE.md` of plain text, and `--agent all` with one of plain text or a block-less import of `AGENTS.md`; root `CLAUDE.md` holds the copy, so no write leaves the project. In a project that keeps its own layout, a `GEMINI.md` that imports no agent file now gets a copy, as the other agent files do.
86
+ - The copy in `.claude/CLAUDE.md` is removed only once root `CLAUDE.md` holds the same block, and only the managed block between its markers: the rest of the file stays, and the file is deleted only when nothing but whitespace is left. `astryx init --remove-agents` deletes a file it created only when nothing but whitespace or init's own heading is left; 0.7.0 also deleted a file whose remaining text had a heading and any line with the word "guidance".
87
+ - `astryx init --remove-agents` removes the block at the project root, where `init` writes it, and in the folder it runs in. Run from a subfolder, it removes what `init` wrote at the root, and a block an earlier version left in that subfolder; a root agent file with a block that resolves outside the project is left as it is with a note, and the run exits 0, as 0.7.1 did when it touched only the subfolder. Exit codes and the JSON shape are unchanged.
88
+ - `--agent claude` and `--agent all` never leave a block in both `CLAUDE.md` and `.claude/CLAUDE.md`, unless the project ignores `CLAUDE.md`: when `CLAUDE.md` gets the block, a block in `.claude/CLAUDE.md` is removed. `--agent all` keeps the `GEMINI.md` import. The `--agent` help and the working-with-AI guide say so. `--agent-docs-path` writes where init runs, as before.
89
+ - `astryx doctor` fails when the `GEMINI.md` import points at an `AGENTS.md` with no block. The setup check in the CLI and in `@astryxdesign/core` no longer counts that import as set up, and looks at `GEMINI.md`. The reminder to run `init` that commands print looks at the project root too, so it stops once `init` has run in a nested package.
90
+ - `astryx init` and `astryx upgrade` no longer write agent docs into your home folder, or into a settings folder in it such as `~/.gemini` or `~/.claude` outside a project. Agents read the files in those folders in every project, so a block there reached unrelated work. This follows the CLI's existing rules that no command writes agent docs into those folders and that a write outside a command's own folder is refused before anything is written.
91
+ - **Refused by `init`:** the home folder itself, and the top of any folder in it whose name starts with a dot (every such folder is a settings folder), even when it holds a `package.json`. A folder below it with its own `package.json` is a project and is set up normally, such as an agent worktree in `~/.codex/worktrees/` or `~/.cursor/worktrees/`, and `astryx upgrade` refreshes it. With `--agent-docs-path`, each file's own folder is checked: from the home folder, `notes/AI.md` is written as before, while `AI.md` or `.claude/CLAUDE.md` is refused.
92
+ - **What `init` does instead:** it writes no agent docs, reports `docsError` as `install-failed` with the reason, and exits 0, as before.
93
+ - **Refused by `upgrade`:** refreshing a block in a project whose root is the home folder or the top of a settings folder, such as `~/.dotfiles` with a `package.json`, with or without `--apply`. It leaves the block as it is, sets `agentDocs.action` to `error` (never `would-refresh`), and warns with the folder and why; its other steps and its exit status are as before. With no block there, it gives the same reason instead of suggesting `astryx init`. `astryx doctor`'s agent-docs fix does the same, and the setup reminder after each command stays quiet.
94
+ - **Migration:** run `astryx init` from the project's own folder, or add the block to the file by hand. Move a project rooted at the home folder or a settings folder into a folder of its own, or update or remove its block by hand. To remove a block an earlier version wrote into `~/.claude/CLAUDE.md`, run `astryx init --remove-agents` in the home folder.
95
+ - Repeated searches in one process answer faster: `astryx search` reuses its entry index while the catalog is unchanged, and ties that reuse to one list of the fields the index reads, so the index is never reused after any of them changes. Every answer is unchanged.
96
+ - Tools that bundle the CLI into a server function no longer pack their whole project folder into it: one path in `integration check`'s import checks was built in a way file tracers cannot follow. The path and its results are unchanged.
97
+ - `search()` from `@astryxdesign/cli/api` answers faster when one process searches again: it reuses the components, docs, templates and themes it gathered for the same folder and `type` while no file it read, and no folder it listed, has changed since (a linked workspace package included). To see those reads, the first such search in a process wraps `node:fs`'s read functions for that process; outside a search they behave exactly as before. Results are unchanged. Short-lived runs are unaffected: each `astryx search` command gathers once, as before ([#7830](https://github.com/facebook/astryx/pull/7830)).
98
+ - `astryx search` and `astryx build` find a block by its authored display name when that name has two words or more and holds every word of the component the block shows: a query naming it, such as "rich text editor" for an integration's Rich Text Editor block, ranks it first. A display name that labels only the variant, such as "Inside a card", is not read.
99
+
100
+ #### Documentation
101
+
102
+ - `astryx docs cli/commands/postinstall` now documents the hidden `postinstall` hook, `astryx docs cli/commands` lists it, and `astryx postinstall --help` shows its exit code and an example. The summary of `astryx docs cli/commands/manifest` (text and `--json`) drops its final period, so it matches the description the manifest has always printed. What each command prints when it runs, its JSON and its exit codes are unchanged.
103
+ - Everything an integration author reads now lives under one home, `astryx docs authoring`: the integration guides' routes moved from `cli/integrations/…` to `authoring/…` (for example, `cli/integrations/quick-start` is now `authoring/quick-start`), beside the field reference at `astryx docs authoring/field-reference`. `astryx docs authoring <name>` still opens one field reference section, and an old `cli/integrations/…` route's error names its new route. The loose topics now sit in Guides or Foundations instead of Unorganized, under the same names: `astryx docs getting-started` still opens, and its Up is `astryx docs guides`.
104
+ - A new guide, `astryx docs is-my-code-good`, checks component use, icons, custom styles, layout, assets, and code health from source and rendered evidence, in one page you can share. It includes an agent prompt and requires missing evidence to stay visible. The template grading rubric now links each category to these shared criteria instead of repeating them, and keeps its own weights, counting rules, and version 1.4.
105
+ - Questions like "add an integration" or "install a package" now find a guide for app builders first.
106
+ Added a "Use integrations" guide (`use-integrations.doc.mjs`) that covers discovering, installing, and using integration packages in an app; open it with `astryx docs use-integrations`. Search ranks it above authoring and API-function docs for those questions, while queries like "build an integration" still rank authoring content first.
107
+
108
+ #### Contributors
109
+
110
+ Thanks to everyone who contributed to this release:
111
+
112
+ - @cixzhang
113
+ - @ejhammond
114
+ - @josephfarina
115
+
116
+ ---
117
+
3
118
  # 0.7.2
4
119
 
5
120
  #### New Components