@astryxdesign/cli 0.1.7 → 0.1.8-canary.07362a9

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 (389) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +115 -19
  3. package/{src/api → api/blog}/blog.mjs +42 -6
  4. package/{src/api → api/blog}/blog.test.mjs +2 -2
  5. package/api/build/build.mjs +92 -0
  6. package/api/build/build.test.mjs +92 -0
  7. package/{src/api → api/component}/component.mjs +49 -26
  8. package/{src/api → api/discover}/discover.mjs +55 -18
  9. package/{src/api → api/docs}/docs.mjs +47 -21
  10. package/{src/api → api/doctor}/doctor.mjs +13 -10
  11. package/{src/api → api}/error.mjs +2 -2
  12. package/{src/api → api/hook}/hook.mjs +11 -11
  13. package/{src/api → api}/index.mjs +16 -9
  14. package/{src/api → api/integration}/validate-integration.mjs +48 -15
  15. package/{src/api → api/integration}/validate-integration.test.mjs +1 -1
  16. package/{src/api → api/layout}/layout.mjs +66 -17
  17. package/{src/api → api/layout}/layout.test.mjs +1 -1
  18. package/{src/api → api/search}/search.mjs +71 -12
  19. package/api/swizzle/swizzle.mjs +283 -0
  20. package/{src/commands → api/swizzle}/swizzle.test.mjs +26 -1
  21. package/{src/api → api/template}/template-integration.test.mjs +2 -2
  22. package/{src/api → api/template}/template-suffix.test.mjs +3 -3
  23. package/{src/api → api/template}/template.mjs +96 -19
  24. package/{src/api → api/theme}/theme-add.mjs +35 -7
  25. package/{src → authoring}/codemod.mjs +6 -6
  26. package/{src → authoring}/config.test.mjs +1 -1
  27. package/{src → authoring}/doc.mjs +1 -1
  28. package/{src → authoring}/doc.test.mjs +1 -1
  29. package/{src → authoring}/template.mjs +1 -1
  30. package/bin/astryx.mjs +12 -10
  31. package/{src → cli}/commands/blog.mjs +48 -7
  32. package/{src → cli}/commands/build-theme.mjs +133 -115
  33. package/cli/commands/build.mjs +172 -0
  34. package/cli/commands/cli-postinstall.test.mjs +42 -0
  35. package/{src → cli}/commands/component/index.mjs +52 -25
  36. package/{src → cli}/commands/component-ownership.test.mjs +3 -3
  37. package/{src → cli}/commands/component-package.test.mjs +1 -1
  38. package/{src → cli}/commands/component-resolution.test.mjs +2 -2
  39. package/{src → cli}/commands/discover.mjs +23 -12
  40. package/{src → cli}/commands/docs.mjs +42 -10
  41. package/{src → cli}/commands/docs.test.mjs +1 -1
  42. package/{src → cli}/commands/doctor.mjs +3 -3
  43. package/{src → cli}/commands/doctor.test.mjs +2 -2
  44. package/{src → cli}/commands/ensure-core-built.mjs +3 -2
  45. package/{src → cli}/commands/external-showcase.test.mjs +1 -1
  46. package/{src → cli}/commands/hook/index.mjs +40 -17
  47. package/{src → cli}/commands/import-hint-correctness.test.mjs +1 -1
  48. package/cli/commands/init.mjs +195 -0
  49. package/{src → cli}/commands/init.next-steps.test.mjs +1 -1
  50. package/cli/commands/interactive-guard.test.mjs +66 -0
  51. package/{src → cli}/commands/json-contract.test.mjs +2 -2
  52. package/{src → cli}/commands/layout.mjs +59 -19
  53. package/{src → cli}/commands/search.mjs +22 -15
  54. package/{src → cli}/commands/search.test.mjs +1 -1
  55. package/cli/commands/setup-nudge.test.mjs +108 -0
  56. package/cli/commands/swizzle.mjs +103 -0
  57. package/{src → cli}/commands/template.mjs +84 -53
  58. package/{src → cli}/commands/template.path-safety.test.mjs +2 -2
  59. package/{src → cli}/commands/upgrade.integration-policy.test.mjs +1 -1
  60. package/{src → cli}/commands/upgrade.mjs +291 -77
  61. package/cli/commands/upgrade.test.mjs +314 -0
  62. package/{src → cli}/commands/validate-integration.mjs +17 -37
  63. package/{src → cli}/index.mjs +55 -19
  64. package/{src/codemods → codemods}/__tests__/registry.test.mjs +1 -0
  65. package/{src/codemods → codemods}/ensure-jscodeshift.mjs +12 -28
  66. package/{src/codemods → codemods}/integration-discovery.mjs +6 -3
  67. package/{src/codemods → codemods}/integration-discovery.test.mjs +1 -1
  68. package/{src/codemods → codemods}/integration-runner.mjs +8 -3
  69. package/{src/codemods → codemods}/registry.mjs +4 -1
  70. package/{src/codemods → codemods}/run-codemod.mjs +18 -11
  71. package/{src/codemods → codemods}/runner.mjs +24 -14
  72. package/{src/codemods → codemods}/transforms/v0.0.10/remove-size-props.mjs +9 -4
  73. package/{src/codemods → codemods}/transforms/v0.0.12/add-is-icon-only.mjs +27 -22
  74. package/{src/codemods → codemods}/transforms/v0.0.13/icon-name-deprecations.mjs +12 -5
  75. package/{src/codemods → codemods}/transforms/v0.0.13/rename-attachments-to-drawer.mjs +15 -8
  76. package/{src/codemods → codemods}/transforms/v0.0.13/toolbar-density-to-size.mjs +10 -4
  77. package/{src/codemods → codemods}/transforms/v0.0.14/rename-action-props.mjs +11 -5
  78. package/{src/codemods → codemods}/transforms/v0.0.14/rename-section-wash-to-muted.mjs +11 -6
  79. package/{src/codemods → codemods}/transforms/v0.0.14/rename-status-variants.mjs +15 -10
  80. package/{src/codemods → codemods}/transforms/v0.0.15/migrate-item-children-to-endcontent.mjs +13 -8
  81. package/{src/codemods → codemods}/transforms/v0.0.15/migrate-selector-children-to-render-option.mjs +18 -13
  82. package/{src/codemods → codemods}/transforms/v0.0.15/migrate-theme-selectors-to-data-attrs.mjs +8 -4
  83. package/{src/codemods → codemods}/transforms/v0.0.15/rename-date-picker-to-input.mjs +11 -6
  84. package/{src/codemods → codemods}/transforms/v0.0.15/rename-imperative-ref-to-handleRef.mjs +6 -1
  85. package/{src/codemods → codemods}/transforms/v0.0.15/rename-isStreaming-to-isStopShown.mjs +6 -1
  86. package/{src/codemods → codemods}/transforms/v0.0.15/rename-stack-element-to-as.mjs +8 -3
  87. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-badge-dot-to-statusdot.mjs +17 -10
  88. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-gap-to-numeric.mjs +7 -1
  89. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-isFullBleed-to-padding.mjs +9 -4
  90. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-useXDSIcon-to-getIcon.mjs +12 -7
  91. package/{src/codemods → codemods}/transforms/v0.0.2/rename-banner-endButton-to-endContent.mjs +7 -2
  92. package/{src/codemods → codemods}/transforms/v0.0.2/rename-form-tooltip-startIcon.mjs +8 -2
  93. package/{src/codemods → codemods}/transforms/v0.0.2/rename-isShown-to-isOpen.mjs +7 -2
  94. package/{src/codemods → codemods}/transforms/v0.0.2/rename-selector-items-to-options.mjs +7 -2
  95. package/{src/codemods → codemods}/transforms/v0.0.2/rename-sidenav-header-to-heading.mjs +11 -4
  96. package/{src/codemods → codemods}/transforms/v0.0.2/rename-topnav-title-to-heading.mjs +10 -4
  97. package/{src/codemods → codemods}/transforms/v0.0.2/unify-uncontrolled-to-defaultX.mjs +7 -2
  98. package/{src/codemods → codemods}/transforms/v0.0.2/unify-visibility-to-onOpenChange.mjs +10 -5
  99. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-badge-children-to-label.mjs +7 -2
  100. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-collapse-to-collapsible.mjs +9 -3
  101. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-radius-tokens.mjs +11 -5
  102. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-shadow-tokens.mjs +13 -6
  103. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-skeleton-radius.mjs +7 -1
  104. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-token-names.mjs +11 -5
  105. package/{src/codemods → codemods}/transforms/v0.0.7/rename-banner-variant-to-container.mjs +8 -3
  106. package/{src/codemods → codemods}/transforms/v0.0.8/migrate-token-renames.mjs +15 -8
  107. package/{src/codemods → codemods}/transforms/v0.0.8/rename-endslot-to-endcontent.mjs +7 -2
  108. package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +42 -7
  109. package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +43 -0
  110. package/{src/codemods → codemods}/transforms/v0.1.0/drop-xds-prefix-imports.mjs +117 -13
  111. package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-css-surfaces.mjs +21 -17
  112. package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-declare-module.mjs +7 -2
  113. package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +86 -15
  114. package/{src/codemods → codemods}/transforms/v0.1.2/rename-text-color-active-to-accent.mjs +15 -9
  115. package/{src/codemods → codemods}/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +17 -12
  116. package/{src/codemods → codemods}/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +15 -9
  117. package/{src/codemods → codemods}/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +17 -10
  118. package/{src/codemods → codemods}/transforms/v0.1.7/rename-table-renderprops-styles-to-xstyle.mjs +18 -13
  119. package/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +161 -0
  120. package/codemods/transforms/v0.1.8/index.mjs +19 -0
  121. package/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +239 -0
  122. package/docs/cli-integrations.doc.mjs +150 -0
  123. package/docs/elevation.doc.mjs +79 -1
  124. package/docs/getting-started.doc.mjs +9 -9
  125. package/docs/internationalization.doc.mjs +92 -46
  126. package/docs/migration.doc.mjs +18 -18
  127. package/docs/principles.doc.dense.mjs +1 -1
  128. package/docs/principles.doc.mjs +6 -6
  129. package/docs/principles.doc.zh.mjs +1 -1
  130. package/docs/styling-libraries.doc.mjs +3 -3
  131. package/docs/styling.doc.mjs +4 -4
  132. package/docs/theme.doc.dense.mjs +2 -2
  133. package/docs/theme.doc.mjs +7 -7
  134. package/docs/theme.doc.zh.mjs +1 -1
  135. package/docs/tokens.doc.mjs +1 -1
  136. package/docs/working-with-ai.doc.mjs +19 -19
  137. package/{src/commands → lib/agent-docs}/agent-docs.mjs +164 -29
  138. package/{src/commands → lib/agent-docs}/agent-docs.path-safety.test.mjs +1 -1
  139. package/{src/commands → lib/agent-docs}/agent-docs.test.mjs +123 -10
  140. package/{src/lib → lib}/cli-error.mjs +2 -2
  141. package/{src/lib → lib}/component-discovery.mjs +44 -2
  142. package/{src/lib → lib}/component-format.mjs +67 -25
  143. package/{src/lib → lib}/component-loader.mjs +27 -13
  144. package/{src/lib → lib}/componentDocOverlay.test.mjs +0 -1
  145. package/{src/lib → lib}/error-codes.test.mjs +1 -1
  146. package/{src/lib → lib}/hook-discovery.mjs +14 -1
  147. package/{src/lib → lib}/hook-format.mjs +29 -5
  148. package/{src/lib → lib}/integration-warnings.mjs +2 -2
  149. package/{src/lib → lib}/integrations.mjs +20 -0
  150. package/{src/lib → lib}/integrations.test.mjs +1 -1
  151. package/{src/lib → lib}/json-contract.test.mjs +1 -1
  152. package/{src/lib → lib}/json-shim.mjs +11 -6
  153. package/{src/lib → lib}/json-shim.test.mjs +1 -1
  154. package/{src/lib → lib}/json.mjs +3 -3
  155. package/{src/lib → lib}/levenshtein.mjs +6 -0
  156. package/{src/lib → lib}/manifest.mjs +7 -5
  157. package/{src/lib → lib}/manifest.test.mjs +2 -2
  158. package/{src/lib → lib}/module-loader.mjs +1 -0
  159. package/{src/lib → lib}/package-scanner.mjs +47 -0
  160. package/{src/lib → lib}/project.mjs +48 -18
  161. package/{src/lib → lib}/project.test.mjs +1 -1
  162. package/{src/lib → lib}/resolve-theme.mjs +5 -0
  163. package/{src/lib → lib}/string-utils.mjs +15 -0
  164. package/lib/term-log.mjs +57 -0
  165. package/{src/lib → lib}/xle/browser.mjs +18 -8
  166. package/{src/lib → lib}/xle/expand.mjs +155 -22
  167. package/{src/lib → lib}/xle/parse.mjs +119 -13
  168. package/{src/lib → lib}/xle/print.mjs +54 -14
  169. package/{src/lib → lib}/xle/registry-core.mjs +28 -3
  170. package/{src/lib → lib}/xle/registry.mjs +9 -4
  171. package/{src/lib → lib}/xle/splice.mjs +13 -2
  172. package/{src/lib → lib}/xle/validate.mjs +95 -14
  173. package/lib/xle/xle-ast.d.ts +214 -0
  174. package/package.json +37 -28
  175. package/scripts/postinstall.mjs +74 -0
  176. package/templates/blocks/components/Avatar/AvatarFallbackChain.tsx +4 -4
  177. package/templates/blocks/components/Avatar/AvatarGroup.tsx +2 -2
  178. package/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx +1 -1
  179. package/templates/blocks/components/Avatar/AvatarShowcase.tsx +5 -5
  180. package/templates/blocks/components/Avatar/AvatarUserCard.tsx +1 -1
  181. package/templates/blocks/components/Avatar/AvatarWithImage.tsx +4 -4
  182. package/templates/blocks/components/Avatar/AvatarWithStatus.tsx +3 -3
  183. package/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx +2 -2
  184. package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx +1 -1
  185. package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx +1 -1
  186. package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx +2 -2
  187. package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +3 -3
  188. package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +3 -3
  189. package/templates/blocks/components/Banner/BannerFloating.doc.mjs +14 -0
  190. package/templates/blocks/components/Banner/BannerFloating.tsx +16 -0
  191. package/templates/blocks/components/Button/ButtonFloating.doc.mjs +14 -0
  192. package/templates/blocks/components/Button/ButtonFloating.tsx +37 -0
  193. package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.doc.mjs +14 -0
  194. package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +23 -0
  195. package/templates/blocks/components/Card/CardElevations.doc.mjs +14 -0
  196. package/templates/blocks/components/Card/CardElevations.tsx +32 -0
  197. package/templates/blocks/components/Card/ClickableCardElevated.doc.mjs +14 -0
  198. package/templates/blocks/components/Card/ClickableCardElevated.tsx +21 -0
  199. package/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +14 -0
  200. package/templates/blocks/components/Card/SelectableCardElevated.tsx +37 -0
  201. package/templates/blocks/components/Carousel/CarouselSnap.tsx +1 -1
  202. package/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +14 -0
  203. package/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +75 -0
  204. package/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx +2 -2
  205. package/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx +1 -1
  206. package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx +1 -1
  207. package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +1 -1
  208. package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +5 -9
  209. package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -1
  210. package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
  211. package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -1
  212. package/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +14 -0
  213. package/templates/blocks/components/IconButton/IconButtonFloating.tsx +37 -0
  214. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +19 -0
  215. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +46 -0
  216. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +14 -0
  217. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +33 -0
  218. package/templates/blocks/components/Item/ItemWithMedia.tsx +2 -2
  219. package/templates/blocks/components/ListItem/ListItemWithMedia.tsx +2 -2
  220. package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.doc.mjs +14 -0
  221. package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +39 -0
  222. package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.doc.mjs +14 -0
  223. package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.tsx +44 -0
  224. package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -6
  225. package/templates/blocks/components/Stack/StackFillItem.tsx +2 -6
  226. package/templates/blocks/components/TabList/TabListTabsWithActions.doc.mjs +1 -1
  227. package/templates/blocks/components/TabList/TabListTabsWithActions.tsx +2 -7
  228. package/templates/blocks/components/Table/TableRowStatusTable.doc.mjs +14 -0
  229. package/templates/blocks/components/Table/TableRowStatusTable.tsx +59 -0
  230. package/templates/blocks/components/Thumbnail/ThumbnailDisabled.tsx +6 -1
  231. package/templates/blocks/components/Thumbnail/ThumbnailGallery.tsx +1 -0
  232. package/templates/blocks/components/Thumbnail/ThumbnailRemovable.tsx +1 -0
  233. package/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx +1 -1
  234. package/templates/pages/ai-chat/page.tsx +4 -4
  235. package/templates/pages/dashboard-portfolio/page.tsx +3 -11
  236. package/templates/pages/detail-page/page.tsx +5 -12
  237. package/templates/pages/documentation-design/page.tsx +1 -1
  238. package/templates/pages/messaging-shell/page.tsx +6 -8
  239. package/templates/pages/table-grouped/page.tsx +9 -14
  240. package/templates/pages/table-page/page.tsx +7 -9
  241. package/templates/pages/table-page-heatmap-status/page.tsx +5 -13
  242. package/{src/types → types}/api.contract.assert.ts +17 -8
  243. package/{src/types → types}/api.d.ts +110 -9
  244. package/{src/types → types}/base.d.ts +40 -4
  245. package/types/build.d.ts +53 -0
  246. package/types/codemod.d.ts +166 -0
  247. package/{src/types → types}/component.d.ts +1 -1
  248. package/{src/types → types}/discover.d.ts +1 -1
  249. package/{src/types → types}/docs.d.ts +1 -4
  250. package/{src/types → types}/hook.d.ts +1 -1
  251. package/{src/types → types}/index.d.ts +1 -0
  252. package/types/jscodeshift.d.ts +19 -0
  253. package/types/layout.d.ts +74 -0
  254. package/{src/types → types}/swizzle.d.ts +4 -0
  255. package/{src/types → types}/template-api.d.ts +4 -1
  256. package/types/theme.d.ts +53 -0
  257. package/types/upgrade.d.ts +108 -0
  258. package/utils/package-manager.mjs +178 -0
  259. package/utils/package-manager.test.mjs +220 -0
  260. package/{src/utils → utils}/path-safety.mjs +0 -18
  261. package/{src/utils → utils}/paths.mjs +4 -1
  262. package/{src/utils → utils}/update-check.mjs +5 -4
  263. package/{src/utils → utils}/update-check.test.mjs +3 -3
  264. package/docs/integration-authoring.md +0 -105
  265. package/src/commands/build.mjs +0 -196
  266. package/src/commands/init.mjs +0 -288
  267. package/src/commands/interactive-guard.test.mjs +0 -69
  268. package/src/commands/swizzle.mjs +0 -440
  269. package/src/commands/upgrade.test.mjs +0 -160
  270. package/src/types/codemod.d.ts +0 -81
  271. package/src/types/theme.d.ts +0 -23
  272. package/src/types/upgrade.d.ts +0 -64
  273. package/src/utils/interactive.mjs +0 -76
  274. package/src/utils/interactive.test.mjs +0 -70
  275. package/src/utils/package-manager.mjs +0 -74
  276. package/src/utils/package-manager.test.mjs +0 -113
  277. /package/{src/api → api/docs}/docOverlays.test.mjs +0 -0
  278. /package/{src/api → api/integration}/integration-block-exports.test.mjs +0 -0
  279. /package/{src/api → api/template}/template.test.mjs +0 -0
  280. /package/{src → authoring}/codemod.test.mjs +0 -0
  281. /package/{src → authoring}/config.mjs +0 -0
  282. /package/{src → authoring}/integration.mjs +0 -0
  283. /package/{src → authoring}/template.test.mjs +0 -0
  284. /package/{src → cli}/cli-exit-codes.test.mjs +0 -0
  285. /package/{src → cli}/commands/build-theme.color-scheme.test.mjs +0 -0
  286. /package/{src → cli}/commands/build-theme.import-path.test.mjs +0 -0
  287. /package/{src → cli}/commands/build-theme.path-safety.test.mjs +0 -0
  288. /package/{src → cli}/commands/build-theme.prose.test.mjs +0 -0
  289. /package/{src → cli}/commands/build-theme.variants.test.mjs +0 -0
  290. /package/{src → cli}/commands/build-theme.watch.test.mjs +0 -0
  291. /package/{src → cli}/commands/component.test.mjs +0 -0
  292. /package/{src → cli}/commands/detail-levels.test.mjs +0 -0
  293. /package/{src → cli}/commands/swizzle.path-safety.test.mjs +0 -0
  294. /package/{src → cli}/commands/swizzle.routing.test.mjs +0 -0
  295. /package/{src → cli}/commands/template.test.mjs +0 -0
  296. /package/{src → cli}/commands/upgrade.config-ordering.test.mjs +0 -0
  297. /package/{src → cli}/commands/validate-integration.test.mjs +0 -0
  298. /package/{src → cli}/update-hint-commands.test.mjs +0 -0
  299. /package/{src/codemods → codemods}/__tests__/rename-imperative-ref-to-handleRef.test.mjs +0 -0
  300. /package/{src/codemods → codemods}/__tests__/rename-isStreaming-to-isStopShown.test.mjs +0 -0
  301. /package/{src/codemods → codemods}/__tests__/rename-section-wash-to-muted.test.mjs +0 -0
  302. /package/{src/codemods → codemods}/__tests__/runner.test.mjs +0 -0
  303. /package/{src/codemods → codemods}/__tests__/toolbar-density-to-size.test.mjs +0 -0
  304. /package/{src/codemods → codemods}/__tests__/validation.test.mjs +0 -0
  305. /package/{src/codemods → codemods}/transforms/v0.0.10/__tests__/remove-size-props.test.mjs +0 -0
  306. /package/{src/codemods → codemods}/transforms/v0.0.10/index.mjs +0 -0
  307. /package/{src/codemods → codemods}/transforms/v0.0.12/__tests__/add-is-icon-only.test.mjs +0 -0
  308. /package/{src/codemods → codemods}/transforms/v0.0.12/index.mjs +0 -0
  309. /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/icon-name-deprecations.test.mjs +0 -0
  310. /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/rename-attachments-to-drawer.test.mjs +0 -0
  311. /package/{src/codemods → codemods}/transforms/v0.0.13/index.mjs +0 -0
  312. /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-action-props.test.mjs +0 -0
  313. /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +0 -0
  314. /package/{src/codemods → codemods}/transforms/v0.0.14/index.mjs +0 -0
  315. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-item-children-to-endcontent.test.mjs +0 -0
  316. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-selector-children-to-render-option.test.mjs +0 -0
  317. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-theme-selectors-to-data-attrs.test.mjs +0 -0
  318. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-date-picker-to-input.test.mjs +0 -0
  319. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-stack-element-to-as.test.mjs +0 -0
  320. /package/{src/codemods → codemods}/transforms/v0.0.15/index.mjs +0 -0
  321. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-badge-dot-to-statusdot.test.mjs +0 -0
  322. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-gap-to-numeric.test.mjs +0 -0
  323. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-isFullBleed-to-padding.test.mjs +0 -0
  324. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-useXDSIcon-to-getIcon.test.mjs +0 -0
  325. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-banner-endButton-to-endContent.test.mjs +0 -0
  326. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-form-tooltip-startIcon.test.mjs +0 -0
  327. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-isShown-to-isOpen.test.mjs +0 -0
  328. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-selector-items-to-options.test.mjs +0 -0
  329. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-sidenav-header-to-heading.test.mjs +0 -0
  330. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-topnav-title-to-heading.test.mjs +0 -0
  331. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-uncontrolled-to-defaultX.test.mjs +0 -0
  332. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-visibility-to-onOpenChange.test.mjs +0 -0
  333. /package/{src/codemods → codemods}/transforms/v0.0.2/index.mjs +0 -0
  334. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-collapse-to-collapsible.test.mjs +0 -0
  335. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-radius-tokens.test.mjs +0 -0
  336. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-shadow-tokens.test.mjs +0 -0
  337. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-skeleton-radius.test.mjs +0 -0
  338. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-token-names.test.mjs +0 -0
  339. /package/{src/codemods → codemods}/transforms/v0.0.6/index.mjs +0 -0
  340. /package/{src/codemods → codemods}/transforms/v0.0.7/__tests__/rename-banner-variant-to-container.test.mjs +0 -0
  341. /package/{src/codemods → codemods}/transforms/v0.0.7/index.mjs +0 -0
  342. /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/migrate-token-renames.test.mjs +0 -0
  343. /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/rename-endslot-to-endcontent.test.mjs +0 -0
  344. /package/{src/codemods → codemods}/transforms/v0.0.8/index.mjs +0 -0
  345. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-css-surfaces.test.mjs +0 -0
  346. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-declare-module.test.mjs +0 -0
  347. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/v0.1.0-ordering.test.mjs +0 -0
  348. /package/{src/codemods → codemods}/transforms/v0.1.0/index.mjs +0 -0
  349. /package/{src/codemods → codemods}/transforms/v0.1.2/__tests__/rename-text-color-active-to-accent.test.mjs +0 -0
  350. /package/{src/codemods → codemods}/transforms/v0.1.2/index.mjs +0 -0
  351. /package/{src/codemods → codemods}/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +0 -0
  352. /package/{src/codemods → codemods}/transforms/v0.1.3/index.mjs +0 -0
  353. /package/{src/codemods → codemods}/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -0
  354. /package/{src/codemods → codemods}/transforms/v0.1.5/index.mjs +0 -0
  355. /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/migrate-table-tableprops-to-direct-props.test.mjs +0 -0
  356. /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/rename-table-renderprops-styles-to-xstyle.test.mjs +0 -0
  357. /package/{src/codemods → codemods}/transforms/v0.1.7/index.mjs +0 -0
  358. /package/{src/lib → lib}/cli-error.test.mjs +0 -0
  359. /package/{src/lib → lib}/component-discovery.importpath.test.mjs +0 -0
  360. /package/{src/lib → lib}/component-format.test.mjs +0 -0
  361. /package/{src/lib → lib}/component-loader.test.mjs +0 -0
  362. /package/{src/lib → lib}/config-cache.mjs +0 -0
  363. /package/{src/lib → lib}/config-cache.test.mjs +0 -0
  364. /package/{src/lib → lib}/config-schema.mjs +0 -0
  365. /package/{src/lib → lib}/error-codes.mjs +0 -0
  366. /package/{src/lib → lib}/integration-warnings.test.mjs +0 -0
  367. /package/{src/lib → lib}/module-loader.test.mjs +0 -0
  368. /package/{src/lib → lib}/node-version.mjs +0 -0
  369. /package/{src/lib → lib}/node-version.test.mjs +0 -0
  370. /package/{src/lib → lib}/parse.mjs +0 -0
  371. /package/{src/lib → lib}/site.mjs +0 -0
  372. /package/{src/lib → lib}/xle/browser.d.ts +0 -0
  373. /package/{src/lib → lib}/xle/xle.test.mjs +0 -0
  374. /package/{src/schemas → schemas}/doc-schema.mjs +0 -0
  375. /package/{src/schemas → schemas}/template-schema.mjs +0 -0
  376. /package/{src/types → types}/config.d.ts +0 -0
  377. /package/{src/types → types}/doc.d.ts +0 -0
  378. /package/{src/types → types}/doctor.d.ts +0 -0
  379. /package/{src/types → types}/error-codes.d.ts +0 -0
  380. /package/{src/types → types}/integration.d.ts +0 -0
  381. /package/{src/types → types}/manifest.d.ts +0 -0
  382. /package/{src/types → types}/search.d.ts +0 -0
  383. /package/{src/types → types}/template.d.ts +0 -0
  384. /package/{src/types → types}/validate-integration.d.ts +0 -0
  385. /package/{src/utils → utils}/github.mjs +0 -0
  386. /package/{src/utils → utils}/path-safety.test.mjs +0 -0
  387. /package/{src/utils → utils}/paths.test.mjs +0 -0
  388. /package/{src/utils → utils}/semver.mjs +0 -0
  389. /package/{src/utils → utils}/semver.test.mjs +0 -0
@@ -11,10 +11,12 @@
11
11
  import type {
12
12
  ComponentListResponse,
13
13
  ComponentBriefResponse,
14
+ ComponentFullResponse,
14
15
  ComponentDetailResponse,
15
16
  ComponentDetailPropsResponse,
16
17
  ComponentDetailSourceResponse,
17
18
  ComponentDetailShowcaseResponse,
19
+ ComponentDetailBlocksResponse,
18
20
  } from './component';
19
21
  import type {
20
22
  DiscoverListResponse,
@@ -41,14 +43,38 @@ import type {
41
43
  HookDetailParamsResponse,
42
44
  } from './hook';
43
45
  import type {SwizzleListResponse, SwizzleCopyResponse} from './swizzle';
44
- import type {ThemeBuildResponse} from './theme';
45
- import type {UpgradeListResponse, UpgradeRunResponse} from './upgrade';
46
+ import type {
47
+ ThemeBuildResponse,
48
+ ThemeListResponse,
49
+ ThemeAddResponse,
50
+ } from './theme';
51
+ import type {
52
+ UpgradeListResponse,
53
+ UpgradeRunResponse,
54
+ UpgradeStatusResponse,
55
+ } from './upgrade';
46
56
  import type {SearchResponse} from './search';
57
+ import type {
58
+ LayoutExpandResponse,
59
+ LayoutCheckResponse,
60
+ LayoutGrammarResponse,
61
+ } from './layout';
62
+ import type {BuildHelpResponse, BuildKitResponse} from './build';
47
63
  import type {ErrorCode} from './error-codes';
48
64
  import type {ManifestResponse} from './manifest';
49
65
  import type {DoctorResponse} from './doctor';
50
66
  import type {ValidateIntegrationResponse} from './validate-integration';
51
67
 
68
+ /**
69
+ * A "did you mean…" suggestion attached to an error. `reason` is optional:
70
+ * some call sites emit bare `{name}` (e.g. a list of candidate component names)
71
+ * with no per-item explanation.
72
+ */
73
+ export interface Suggestion {
74
+ name: string;
75
+ reason?: string;
76
+ }
77
+
52
78
  /**
53
79
  * Structured error. Check `'error' in result` to discriminate.
54
80
  *
@@ -58,7 +84,7 @@ import type {ValidateIntegrationResponse} from './validate-integration';
58
84
  export interface CLIError {
59
85
  error: string;
60
86
  code: ErrorCode;
61
- suggestions?: Array<{name: string; reason: string}>;
87
+ suggestions?: Suggestion[];
62
88
  }
63
89
 
64
90
  /** Returned by the fallback hook for commands without --json support. */
@@ -74,10 +100,12 @@ export type CLIResult<T> = T | CLIError | CLIUnsupportedError;
74
100
  export type CLIAnyResponse =
75
101
  | ComponentListResponse
76
102
  | ComponentBriefResponse
103
+ | ComponentFullResponse
77
104
  | ComponentDetailResponse
78
105
  | ComponentDetailPropsResponse
79
106
  | ComponentDetailSourceResponse
80
107
  | ComponentDetailShowcaseResponse
108
+ | ComponentDetailBlocksResponse
81
109
  | DiscoverListResponse
82
110
  | DiscoverDetailResponse
83
111
  | DiscoverDetailDocResponse
@@ -97,9 +125,17 @@ export type CLIAnyResponse =
97
125
  | SwizzleListResponse
98
126
  | SwizzleCopyResponse
99
127
  | ThemeBuildResponse
128
+ | ThemeListResponse
129
+ | ThemeAddResponse
100
130
  | UpgradeListResponse
101
131
  | UpgradeRunResponse
132
+ | UpgradeStatusResponse
102
133
  | SearchResponse
134
+ | LayoutExpandResponse
135
+ | LayoutCheckResponse
136
+ | LayoutGrammarResponse
137
+ | BuildHelpResponse
138
+ | BuildKitResponse
103
139
  | ManifestResponse
104
140
  | DoctorResponse
105
141
  | ValidateIntegrationResponse;
@@ -129,7 +165,7 @@ export function jsonOut<T extends CLIResponseType>(
129
165
  */
130
166
  export function jsonError(
131
167
  message: string,
132
- suggestions?: Array<{name: string; reason: string}>,
168
+ suggestions?: Suggestion[],
133
169
  code?: ErrorCode,
134
170
  ): never;
135
171
 
@@ -0,0 +1,53 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Build command JSON responses.
5
+ *
6
+ * `astryx build` is the "assemble a page" verb. With no query it emits the
7
+ * workflow playbook; with a query it delegates to the search pipeline and
8
+ * emits a `search` response (see search.d.ts).
9
+ *
10
+ * Invocation -> type discriminator
11
+ * ---------------------------------------------------
12
+ * xds --json build -> build.help
13
+ * xds --json build "<idea>" -> build.kit
14
+ */
15
+
16
+ import type {SearchResultEntry} from './search';
17
+
18
+ /** xds --json build (no query) — the "how to build a page" playbook signal. */
19
+ export interface BuildHelpResponse {
20
+ type: 'build.help';
21
+ data: {
22
+ /** Always true; marks this envelope as the playbook rather than a result set. */
23
+ playbook: true;
24
+ };
25
+ }
26
+
27
+ /**
28
+ * xds --json build "<idea>" — the composition kit for what you're building.
29
+ *
30
+ * Entries are raw `SearchResultEntry` objects (no package-manager-prefixed
31
+ * command strings — the CLI adds those); `frame`/`foundation` are static
32
+ * component-name arrays surfaced on every kit.
33
+ */
34
+ export interface BuildKitResponse {
35
+ type: 'build.kit';
36
+ data: {
37
+ query: string;
38
+ /** False when search returned nothing (renderer shows "No matches"). */
39
+ hasResults: boolean;
40
+ /** True when the top page template is a confident direct match. */
41
+ directMatch: boolean;
42
+ /** Closest page templates (≤3). */
43
+ pages: SearchResultEntry[];
44
+ /** Drop-in block patterns covering parts of the idea (≤5). */
45
+ blocks: SearchResultEntry[];
46
+ /** Idea-specific components/hooks (≤6), excluding frame/foundation. */
47
+ domain: SearchResultEntry[];
48
+ /** Always-on page-shell component names. */
49
+ frame: string[];
50
+ /** Always-on layout/typography/action component names. */
51
+ foundation: string[];
52
+ };
53
+ }
@@ -0,0 +1,166 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Public type surface for the file-based codemod-authoring API exported from
5
+ * `@astryxdesign/cli/codemod`.
6
+ */
7
+
8
+ /** A single source file presented to a codemod's transform. */
9
+ export interface AstryxCodemodFile {
10
+ /** Absolute path to the file being transformed. */
11
+ path: string;
12
+ /** The current source contents of the file. */
13
+ source: string;
14
+ }
15
+
16
+ /** Helpers and context passed to a codemod's transform as the second argument. */
17
+ export interface AstryxCodemodApi {
18
+ /** A jscodeshift instance configured with a parser for the file. */
19
+ jscodeshift: unknown;
20
+ /** Report a statistic (no-op-friendly; provided for jscodeshift parity). */
21
+ stats: (...args: unknown[]) => void;
22
+ /** Report progress (no-op-friendly; provided for jscodeshift parity). */
23
+ report: (...args: unknown[]) => void;
24
+ }
25
+
26
+ /**
27
+ * A codemod's transform. Return the new source to rewrite the file, or
28
+ * `null`/`undefined` to leave the file unchanged.
29
+ */
30
+ export type AstryxCodemodTransform = (
31
+ file: AstryxCodemodFile,
32
+ api: AstryxCodemodApi,
33
+ ) => string | null | undefined;
34
+
35
+ /** Definition accepted by {@link createCodemod}. */
36
+ export interface AstryxCodemodDef {
37
+ /** Short, human-readable title shown in upgrade output. */
38
+ title: string;
39
+ /** Optional longer description. */
40
+ description?: string;
41
+ /** When true, the codemod runs only when explicitly requested. */
42
+ isOptional?: boolean;
43
+ /** File extensions this codemod applies to (e.g. ['.tsx', '.ts']). */
44
+ fileExtensions?: string[];
45
+ /** The transform function. */
46
+ transform: AstryxCodemodTransform;
47
+ }
48
+
49
+ /** Result of {@link createCodemod}. */
50
+ export interface AstryxCodemod extends AstryxCodemodDef {
51
+ isOptional: boolean;
52
+ type: 'code';
53
+ }
54
+
55
+ /** Definition accepted by {@link createConfigCodemod}. */
56
+ export interface AstryxConfigCodemodDef {
57
+ /** Short, human-readable title shown in upgrade output. */
58
+ title: string;
59
+ /** Optional longer description. */
60
+ description?: string;
61
+ /** When true, the codemod runs only when explicitly requested. */
62
+ isOptional?: boolean;
63
+ /** The transform function applied to the astryx.config.* file. */
64
+ transform: AstryxCodemodTransform;
65
+ }
66
+
67
+ /** Result of {@link createConfigCodemod}. */
68
+ export interface AstryxConfigCodemod extends AstryxConfigCodemodDef {
69
+ isOptional: boolean;
70
+ type: 'config';
71
+ }
72
+
73
+ /** Define a file-transforming codemod. */
74
+ export declare function createCodemod<T extends AstryxCodemodDef>(
75
+ def: T,
76
+ ): AstryxCodemod;
77
+
78
+ /** Define a codemod that targets the consumer's astryx.config.* file. */
79
+ export declare function createConfigCodemod<T extends AstryxConfigCodemodDef>(
80
+ def: T,
81
+ ): AstryxConfigCodemod;
82
+
83
+ // ---------------------------------------------------------------------------
84
+ // Internal types (used by the CLI codemod runner infrastructure & transforms).
85
+ // These are not part of the public authoring surface but are shared across the
86
+ // .mjs files under src/codemods/ so JSDoc annotations stay consistent.
87
+ // ---------------------------------------------------------------------------
88
+
89
+ /**
90
+ * jscodeshift transform signature. jscodeshift ships no type declarations, so
91
+ * the AST surface (`api.jscodeshift`, paths, node attributes) is untyped by
92
+ * design; transforms operate on it dynamically.
93
+ */
94
+ export type CodemodTransform = (
95
+ file: AstryxCodemodFile,
96
+ api: CodemodTransformApi,
97
+ ) => string | null | undefined;
98
+
99
+ /**
100
+ * The `api` argument as seen INSIDE a transform implementation. Identical to
101
+ * {@link AstryxCodemodApi} except `jscodeshift` is typed as the callable
102
+ * factory (jscodeshift ships no types, so the AST it returns is untyped). Used
103
+ * by the .mjs transforms so `const j = api.jscodeshift; j(file.source)` type-checks.
104
+ */
105
+ export interface CodemodTransformApi {
106
+ jscodeshift: JscodeshiftFactory;
107
+ stats: (...args: unknown[]) => void;
108
+ report: (...args: unknown[]) => void;
109
+ }
110
+
111
+ /**
112
+ * A normalized codemod entry as produced by both the core registry runner and
113
+ * integration discovery. See the header of `run-codemod.mjs` for the contract.
114
+ */
115
+ export interface CodemodEntry {
116
+ /** Unique id within its package/version (e.g. the transform module name). */
117
+ id: string;
118
+ /** Whether this is a source-file codemod or a config-file codemod. */
119
+ type: 'code' | 'config';
120
+ /** The codemod itself. */
121
+ codemod: {
122
+ title: string;
123
+ description?: string;
124
+ isOptional?: boolean;
125
+ fileExtensions?: string[];
126
+ transform: CodemodTransform;
127
+ };
128
+ /** Owning package name. */
129
+ package: string;
130
+ /** Owning package version. */
131
+ version?: string;
132
+ }
133
+
134
+ /** The result of running a single codemod over one or more files. */
135
+ export interface CodemodRunResult {
136
+ filesChanged: number;
137
+ writtenFiles: string[];
138
+ errors: Array<{file: string; codemod: string; error: string}>;
139
+ }
140
+
141
+ /** The console-like log surface used across the codemod runners. */
142
+ export interface CliLog {
143
+ step: (...args: unknown[]) => void;
144
+ info: (...args: unknown[]) => void;
145
+ success: (...args: unknown[]) => void;
146
+ warn: (...args: unknown[]) => void;
147
+ error: (...args: unknown[]) => void;
148
+ message?: (...args: unknown[]) => void;
149
+ }
150
+
151
+ /**
152
+ * The jscodeshift factory (the module's default export / `withParser` root).
153
+ * Callable and carries `withParser`; both return an untyped jscodeshift API.
154
+ *
155
+ * `any` is unavoidable here: jscodeshift ships no types and its AST/builder
156
+ * surface is fully dynamic (`j(src)`, `j.JSXElement`, `path.node`, …). `unknown`
157
+ * would break the callable + index access the transforms rely on.
158
+ */
159
+ export interface JscodeshiftFactory {
160
+ /* eslint-disable @typescript-eslint/no-explicit-any */
161
+ (...args: any[]): any;
162
+ withParser: (parser: string) => any;
163
+ /** AST node types and builders (j.JSXElement, j.jsxAttribute, ...) are untyped. */
164
+ [key: string]: any;
165
+ /* eslint-enable @typescript-eslint/no-explicit-any */
166
+ }
@@ -23,7 +23,7 @@
23
23
  * (not found) -> CLIError
24
24
  */
25
25
 
26
- import type {ComponentDoc, PropDoc} from '../../../core/src/docs-types';
26
+ import type {ComponentDoc, PropDoc} from '../../core/src/docs-types';
27
27
 
28
28
  /** xds --json component [--list] [--category X] [--detail brief] */
29
29
  export interface ComponentListResponse {
@@ -13,7 +13,7 @@
13
13
  * (not found) -> CLIError
14
14
  */
15
15
 
16
- import type {ComponentDoc} from '../../../core/src/docs-types';
16
+ import type {ComponentDoc} from '../../core/src/docs-types';
17
17
 
18
18
  /** xds --json discover */
19
19
  export interface DiscoverListResponse {
@@ -11,10 +11,7 @@
11
11
  * (unknown topic/section) -> CLIError
12
12
  */
13
13
 
14
- import type {
15
- ReferenceDoc,
16
- ReferenceSection,
17
- } from '../../../core/src/docs-types';
14
+ import type {ReferenceDoc, ReferenceSection} from '../../core/src/docs-types';
18
15
 
19
16
  /** xds --json docs */
20
17
  export interface DocsListResponse {
@@ -20,7 +20,7 @@
20
20
  * (not found) -> CLIError
21
21
  */
22
22
 
23
- import type {HookDoc, HookParamDoc} from '../../../core/src/docs-types';
23
+ import type {HookDoc, HookParamDoc} from '../../core/src/docs-types';
24
24
 
25
25
  /** xds --json hook [--list] [--category X] [--detail brief] */
26
26
  export interface HookListResponse {
@@ -10,6 +10,7 @@ export * from './swizzle';
10
10
  export * from './theme';
11
11
  export * from './upgrade';
12
12
  export * from './search';
13
+ export * from './build';
13
14
  export * from './error-codes';
14
15
  export * from './manifest';
15
16
  export * from './doctor';
@@ -0,0 +1,19 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Ambient declaration for `jscodeshift`, which ships no type declarations.
5
+ * The AST surface is intentionally untyped; codemod transforms operate on it
6
+ * dynamically. This keeps dynamic `import('jscodeshift')` from tripping TS7016
7
+ * under strict checkJs.
8
+ */
9
+ declare module 'jscodeshift' {
10
+ interface JscodeshiftFactory {
11
+ /* eslint-disable @typescript-eslint/no-explicit-any */
12
+ (...args: any[]): any;
13
+ withParser: (parser: string) => any;
14
+ [key: string]: any;
15
+ /* eslint-enable @typescript-eslint/no-explicit-any */
16
+ }
17
+ const jscodeshift: JscodeshiftFactory;
18
+ export default jscodeshift;
19
+ }
@@ -0,0 +1,74 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Layout command JSON responses.
5
+ *
6
+ * `astryx layout expand|check|grammar` turn compressed XLE/XLO expressions into
7
+ * validated XDS TSX (or echo canonical surfaces / a grammar cheatsheet).
8
+ *
9
+ * Invocation -> type discriminator
10
+ * -----------------------------------------------------------------
11
+ * astryx --json layout expand "<expr>" -> layout.expand
12
+ * astryx --json layout check "<expr>" -> layout.check
13
+ * astryx --json layout grammar -> layout.grammar
14
+ */
15
+
16
+ /** The input surface an expression was parsed as. */
17
+ export type LayoutForm = 'compact' | 'outline' | 'auto';
18
+
19
+ /** A validation issue with its formatted, human-readable rendering. */
20
+ export interface LayoutIssue {
21
+ line?: number;
22
+ col?: number;
23
+ message: string;
24
+ formatted: string;
25
+ suggestions?: string[];
26
+ }
27
+
28
+ /** A block referenced by a layout expression and how it was spliced in. */
29
+ export interface LayoutBlockReference {
30
+ name: string;
31
+ mode: string;
32
+ }
33
+
34
+ /** astryx --json layout expand "<expr>" [path] */
35
+ export interface LayoutExpandResponse {
36
+ type: 'layout.expand';
37
+ data: {
38
+ form: LayoutForm;
39
+ code: string;
40
+ componentsUsed: string[];
41
+ /** Number of useState hooks the expansion scaffolded. */
42
+ states: number;
43
+ todos: string[];
44
+ blocksReferenced: LayoutBlockReference[];
45
+ warnings: string[];
46
+ written: string | null;
47
+ };
48
+ }
49
+
50
+ /** astryx --json layout check "<expr>" */
51
+ export interface LayoutCheckResponse {
52
+ type: 'layout.check';
53
+ data: {
54
+ valid: boolean;
55
+ form: LayoutForm;
56
+ errors: LayoutIssue[];
57
+ warnings: string[];
58
+ compact: string;
59
+ outline: string;
60
+ };
61
+ }
62
+
63
+ /** astryx --json layout grammar */
64
+ export interface LayoutGrammarResponse {
65
+ type: 'layout.grammar';
66
+ data: {
67
+ text: string;
68
+ /** Alias table (short name -> canonical component), from the registry. */
69
+ aliases: Record<string, string>;
70
+ };
71
+ }
72
+
73
+ export type LayoutResponse =
74
+ LayoutExpandResponse | LayoutCheckResponse | LayoutGrammarResponse;
@@ -29,9 +29,13 @@ export interface SwizzleCopyResponse {
29
29
  type: 'swizzle.copy';
30
30
  data: {
31
31
  component: string;
32
+ /** Owner package the component source was copied from. */
33
+ package: string;
32
34
  outputDir: string;
33
35
  filesCopied: number;
34
36
  files: string[];
37
+ /** Whether any copied file uses StyleX (requires build-time setup). */
38
+ usesStyleX: boolean;
35
39
  feedback?: SwizzleFeedback;
36
40
  };
37
41
  }
@@ -15,4 +15,7 @@ export type {
15
15
  AstryxTemplate,
16
16
  } from '@astryxdesign/core/authoring';
17
17
 
18
- export {createPageTemplate, createBlockTemplate} from '@astryxdesign/core/authoring';
18
+ export {
19
+ createPageTemplate,
20
+ createBlockTemplate,
21
+ } from '@astryxdesign/core/authoring';
@@ -0,0 +1,53 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Theme build command JSON responses.
5
+ *
6
+ * Invocation -> type discriminator
7
+ * ------------------------------------------------------------------
8
+ * xds --json theme build <file> -> theme.build
9
+ * xds --json theme list -> theme.list
10
+ * xds --json theme add <slug> -> theme.add
11
+ * (file not found / parse error) -> CLIError
12
+ */
13
+
14
+ /** xds --json theme build <file> */
15
+ export interface ThemeBuildResponse {
16
+ type: 'theme.build';
17
+ data: {
18
+ name: string;
19
+ tokenCount: number;
20
+ componentCount: number;
21
+ sizeKB: number;
22
+ outputs: {css: string; js: string; dts: string; variantsDts?: string};
23
+ warnings: string[];
24
+ };
25
+ }
26
+
27
+ /** A single theme entry as surfaced by `theme list`. */
28
+ export interface ThemeListEntry {
29
+ slug: string;
30
+ displayName: string;
31
+ description: string;
32
+ maintained: boolean;
33
+ }
34
+
35
+ /** xds --json theme list */
36
+ export interface ThemeListResponse {
37
+ type: 'theme.list';
38
+ data: ThemeListEntry[];
39
+ }
40
+
41
+ /** xds --json theme add <slug> */
42
+ export interface ThemeAddResponse {
43
+ type: 'theme.add';
44
+ data: {
45
+ slug: string;
46
+ displayName: string;
47
+ maintained: boolean;
48
+ outputDir: string;
49
+ entry: string;
50
+ exportName: string;
51
+ files: string[];
52
+ };
53
+ }
@@ -0,0 +1,108 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Upgrade command JSON responses.
5
+ *
6
+ * Invocation -> type discriminator
7
+ * ------------------------------------------------------------------
8
+ * xds --json upgrade --list -> upgrade.list
9
+ * xds --json upgrade [--apply] -> upgrade.run
10
+ * xds --json upgrade (status short-circuit) -> upgrade.status
11
+ * (version detection failure) -> CLIError
12
+ */
13
+
14
+ /** xds --json upgrade --list */
15
+ export interface UpgradeListResponse {
16
+ type: 'upgrade.list';
17
+ data: UpgradeListEntry[];
18
+ }
19
+
20
+ export interface UpgradeListEntry {
21
+ name: string;
22
+ title: string;
23
+ version: string;
24
+ }
25
+
26
+ /**
27
+ * State of the managed agent-docs block (`<!-- ASTRYX:START --> … END -->`)
28
+ * relative to the installed core version, plus what `upgrade` did about it.
29
+ * Present on every upgrade response (run, status, and the codemod/config error
30
+ * envelopes) because the block is refreshed independently of codemods.
31
+ *
32
+ * - `refreshed` — a stale block was rewritten (`--apply` only).
33
+ * - `would-refresh` — a stale block was detected in dry-run; nothing written.
34
+ * - `nudge-init` — no managed block exists; user should run `init`.
35
+ * - `error` — refresh was attempted but writing failed.
36
+ * - `none` — nothing to do (block already current).
37
+ */
38
+ export interface AgentDocsSummary {
39
+ status: 'missing' | 'stale' | 'current';
40
+ /** Installed core version the block should reflect. */
41
+ installedVersion: string;
42
+ /** Distinct stale block versions found (the "from" side of the refresh). */
43
+ fromVersions: string[];
44
+ /** Files rewritten (apply) or that would be rewritten (dry-run). */
45
+ files: string[];
46
+ /** True only when a block was actually rewritten (apply mode). */
47
+ refreshed: boolean;
48
+ action: 'refreshed' | 'would-refresh' | 'nudge-init' | 'error' | 'none';
49
+ }
50
+
51
+ /** xds --json upgrade [--apply] */
52
+ export interface UpgradeRunResponse {
53
+ type: 'upgrade.run';
54
+ data: {
55
+ from: string;
56
+ to: string;
57
+ codemods: number;
58
+ /** Integration packages processed in this upgrade (by name/spec). */
59
+ integrations: string[];
60
+ agentDocsRefreshed: boolean;
61
+ agentDocs: AgentDocsSummary;
62
+ /** Total files changed across core + integration codemods (apply mode). */
63
+ filesChanged?: number;
64
+ /** Total transforms that reported a change. */
65
+ transformsApplied?: number;
66
+ /** Per-codemod errors, when any codemod failed. */
67
+ errors?: Array<{file: string; codemod: string; error: string}>;
68
+ };
69
+ }
70
+
71
+ /**
72
+ * xds --json upgrade — short-circuit status results.
73
+ *
74
+ * - `up_to_date`: `--from` is >= installed target and `--force` was not passed.
75
+ * - `no_codemods`: no codemods (core or integration) apply to the range.
76
+ * - `config_fixable`: DRY-RUN ONLY. The consumer's astryx.config currently
77
+ * fails strict validation, but a pending core CONFIG codemod (in the selected
78
+ * range) would repair it. The dry run previews the fix without writing and
79
+ * reports the exact command to apply it; integrations are skipped for the
80
+ * preview (they will be processed on the `--apply` run).
81
+ */
82
+ export interface UpgradeStatusResponse {
83
+ type: 'upgrade.status';
84
+ data:
85
+ | {
86
+ status: 'up_to_date';
87
+ from: string;
88
+ to: string;
89
+ agentDocs: AgentDocsSummary;
90
+ }
91
+ | {
92
+ status: 'no_codemods';
93
+ from: string;
94
+ to: string;
95
+ agentDocs: AgentDocsSummary;
96
+ }
97
+ | {
98
+ status: 'config_fixable';
99
+ from: string;
100
+ to: string;
101
+ configError: string;
102
+ configCodemods: string[];
103
+ suggestedCommand: string;
104
+ message: string;
105
+ note: string;
106
+ agentDocs: AgentDocsSummary;
107
+ };
108
+ }