@astryxdesign/cli 0.1.8-canary.0c4d8d7 → 0.1.8-canary.0db5dfd

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 (303) hide show
  1. package/{src/api → api/blog}/blog.mjs +42 -6
  2. package/{src/api → api/blog}/blog.test.mjs +2 -2
  3. package/api/build/build.mjs +92 -0
  4. package/api/build/build.test.mjs +92 -0
  5. package/{src/api → api/component}/component.mjs +49 -26
  6. package/{src/api → api/discover}/discover.mjs +55 -18
  7. package/{src/api → api/docs}/docs.mjs +47 -21
  8. package/{src/api → api/doctor}/doctor.mjs +11 -8
  9. package/{src/api → api/hook}/hook.mjs +11 -11
  10. package/{src/api → api}/index.mjs +16 -9
  11. package/{src/api → api/integration}/validate-integration.mjs +48 -15
  12. package/{src/api → api/integration}/validate-integration.test.mjs +1 -1
  13. package/{src/api → api/layout}/layout.mjs +66 -17
  14. package/{src/api → api/layout}/layout.test.mjs +1 -1
  15. package/{src/api → api/search}/search.mjs +71 -12
  16. package/api/swizzle/swizzle.mjs +283 -0
  17. package/{src/commands → api/swizzle}/swizzle.test.mjs +26 -1
  18. package/{src/api → api/template}/template-integration.test.mjs +2 -2
  19. package/{src/api → api/template}/template-suffix.test.mjs +3 -3
  20. package/{src/api → api/template}/template.mjs +96 -19
  21. package/{src/api → api/theme}/theme-add.mjs +35 -7
  22. package/{src → authoring}/codemod.mjs +6 -6
  23. package/{src → authoring}/config.test.mjs +1 -1
  24. package/{src → authoring}/doc.mjs +1 -1
  25. package/{src → authoring}/doc.test.mjs +1 -1
  26. package/{src → authoring}/template.mjs +1 -1
  27. package/bin/astryx.mjs +12 -10
  28. package/{src → cli}/commands/blog.mjs +48 -7
  29. package/{src → cli}/commands/build-theme.mjs +125 -46
  30. package/{src → cli}/commands/build.mjs +33 -57
  31. package/{src → cli}/commands/component/index.mjs +49 -22
  32. package/{src → cli}/commands/component-ownership.test.mjs +3 -3
  33. package/{src → cli}/commands/component-package.test.mjs +1 -1
  34. package/{src → cli}/commands/component-resolution.test.mjs +2 -2
  35. package/{src → cli}/commands/discover.mjs +17 -8
  36. package/{src → cli}/commands/docs.mjs +39 -7
  37. package/{src → cli}/commands/docs.test.mjs +1 -1
  38. package/{src → cli}/commands/doctor.mjs +3 -3
  39. package/{src → cli}/commands/doctor.test.mjs +2 -2
  40. package/{src → cli}/commands/ensure-core-built.mjs +3 -2
  41. package/{src → cli}/commands/external-showcase.test.mjs +1 -1
  42. package/{src → cli}/commands/hook/index.mjs +37 -14
  43. package/{src → cli}/commands/import-hint-correctness.test.mjs +1 -1
  44. package/{src → cli}/commands/init.mjs +20 -9
  45. package/{src → cli}/commands/layout.mjs +58 -18
  46. package/{src → cli}/commands/search.mjs +19 -12
  47. package/{src → cli}/commands/search.test.mjs +1 -1
  48. package/{src → cli}/commands/setup-nudge.test.mjs +1 -1
  49. package/cli/commands/swizzle.mjs +103 -0
  50. package/{src → cli}/commands/template.mjs +73 -22
  51. package/{src → cli}/commands/template.path-safety.test.mjs +2 -2
  52. package/{src → cli}/commands/upgrade.integration-policy.test.mjs +1 -1
  53. package/{src → cli}/commands/upgrade.mjs +160 -52
  54. package/{src → cli}/commands/upgrade.test.mjs +1 -1
  55. package/{src → cli}/commands/validate-integration.mjs +17 -37
  56. package/{src → cli}/index.mjs +17 -15
  57. package/{src/codemods → codemods}/ensure-jscodeshift.mjs +1 -1
  58. package/{src/codemods → codemods}/integration-discovery.mjs +6 -3
  59. package/{src/codemods → codemods}/integration-discovery.test.mjs +1 -1
  60. package/{src/codemods → codemods}/integration-runner.mjs +8 -3
  61. package/{src/codemods → codemods}/registry.mjs +3 -1
  62. package/{src/codemods → codemods}/run-codemod.mjs +17 -10
  63. package/{src/codemods → codemods}/runner.mjs +22 -12
  64. package/{src/codemods → codemods}/transforms/v0.0.10/remove-size-props.mjs +9 -4
  65. package/{src/codemods → codemods}/transforms/v0.0.12/add-is-icon-only.mjs +27 -22
  66. package/{src/codemods → codemods}/transforms/v0.0.13/icon-name-deprecations.mjs +12 -5
  67. package/{src/codemods → codemods}/transforms/v0.0.13/rename-attachments-to-drawer.mjs +15 -8
  68. package/{src/codemods → codemods}/transforms/v0.0.13/toolbar-density-to-size.mjs +10 -4
  69. package/{src/codemods → codemods}/transforms/v0.0.14/rename-action-props.mjs +11 -5
  70. package/{src/codemods → codemods}/transforms/v0.0.14/rename-section-wash-to-muted.mjs +11 -6
  71. package/{src/codemods → codemods}/transforms/v0.0.14/rename-status-variants.mjs +15 -10
  72. package/{src/codemods → codemods}/transforms/v0.0.15/migrate-item-children-to-endcontent.mjs +13 -8
  73. package/{src/codemods → codemods}/transforms/v0.0.15/migrate-selector-children-to-render-option.mjs +18 -13
  74. package/{src/codemods → codemods}/transforms/v0.0.15/migrate-theme-selectors-to-data-attrs.mjs +8 -4
  75. package/{src/codemods → codemods}/transforms/v0.0.15/rename-date-picker-to-input.mjs +11 -6
  76. package/{src/codemods → codemods}/transforms/v0.0.15/rename-imperative-ref-to-handleRef.mjs +6 -1
  77. package/{src/codemods → codemods}/transforms/v0.0.15/rename-isStreaming-to-isStopShown.mjs +6 -1
  78. package/{src/codemods → codemods}/transforms/v0.0.15/rename-stack-element-to-as.mjs +8 -3
  79. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-badge-dot-to-statusdot.mjs +17 -10
  80. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-gap-to-numeric.mjs +7 -1
  81. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-isFullBleed-to-padding.mjs +9 -4
  82. package/{src/codemods → codemods}/transforms/v0.0.2/migrate-useXDSIcon-to-getIcon.mjs +12 -7
  83. package/{src/codemods → codemods}/transforms/v0.0.2/rename-banner-endButton-to-endContent.mjs +7 -2
  84. package/{src/codemods → codemods}/transforms/v0.0.2/rename-form-tooltip-startIcon.mjs +8 -2
  85. package/{src/codemods → codemods}/transforms/v0.0.2/rename-isShown-to-isOpen.mjs +7 -2
  86. package/{src/codemods → codemods}/transforms/v0.0.2/rename-selector-items-to-options.mjs +7 -2
  87. package/{src/codemods → codemods}/transforms/v0.0.2/rename-sidenav-header-to-heading.mjs +11 -4
  88. package/{src/codemods → codemods}/transforms/v0.0.2/rename-topnav-title-to-heading.mjs +10 -4
  89. package/{src/codemods → codemods}/transforms/v0.0.2/unify-uncontrolled-to-defaultX.mjs +7 -2
  90. package/{src/codemods → codemods}/transforms/v0.0.2/unify-visibility-to-onOpenChange.mjs +10 -5
  91. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-badge-children-to-label.mjs +7 -2
  92. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-collapse-to-collapsible.mjs +9 -3
  93. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-radius-tokens.mjs +11 -5
  94. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-shadow-tokens.mjs +13 -6
  95. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-skeleton-radius.mjs +7 -1
  96. package/{src/codemods → codemods}/transforms/v0.0.6/migrate-token-names.mjs +11 -5
  97. package/{src/codemods → codemods}/transforms/v0.0.7/rename-banner-variant-to-container.mjs +8 -3
  98. package/{src/codemods → codemods}/transforms/v0.0.8/migrate-token-renames.mjs +15 -8
  99. package/{src/codemods → codemods}/transforms/v0.0.8/rename-endslot-to-endcontent.mjs +7 -2
  100. package/{src/codemods → codemods}/transforms/v0.1.0/drop-xds-prefix-imports.mjs +19 -14
  101. package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-css-surfaces.mjs +21 -17
  102. package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-declare-module.mjs +7 -2
  103. package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +16 -11
  104. package/{src/codemods → codemods}/transforms/v0.1.2/rename-text-color-active-to-accent.mjs +15 -9
  105. package/{src/codemods → codemods}/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +17 -12
  106. package/{src/codemods → codemods}/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +15 -9
  107. package/{src/codemods → codemods}/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +17 -10
  108. package/{src/codemods → codemods}/transforms/v0.1.7/rename-table-renderprops-styles-to-xstyle.mjs +18 -13
  109. package/{src/codemods → codemods}/transforms/v0.1.8/rename-avatar-size-scale.mjs +15 -10
  110. package/docs/internationalization.doc.mjs +92 -46
  111. package/{src/commands → lib/agent-docs}/agent-docs.mjs +30 -11
  112. package/{src/commands → lib/agent-docs}/agent-docs.path-safety.test.mjs +1 -1
  113. package/{src/lib → lib}/component-discovery.mjs +44 -2
  114. package/{src/lib → lib}/component-format.mjs +65 -24
  115. package/{src/lib → lib}/component-loader.mjs +27 -13
  116. package/{src/lib → lib}/componentDocOverlay.test.mjs +0 -1
  117. package/{src/lib → lib}/error-codes.test.mjs +1 -1
  118. package/{src/lib → lib}/hook-discovery.mjs +14 -1
  119. package/{src/lib → lib}/hook-format.mjs +29 -5
  120. package/{src/lib → lib}/integration-warnings.mjs +2 -2
  121. package/{src/lib → lib}/integrations.mjs +20 -0
  122. package/{src/lib → lib}/integrations.test.mjs +1 -1
  123. package/{src/lib → lib}/json-contract.test.mjs +1 -1
  124. package/{src/lib → lib}/json-shim.mjs +10 -5
  125. package/{src/lib → lib}/json-shim.test.mjs +1 -1
  126. package/{src/lib → lib}/levenshtein.mjs +6 -0
  127. package/{src/lib → lib}/manifest.mjs +7 -5
  128. package/{src/lib → lib}/manifest.test.mjs +2 -2
  129. package/{src/lib → lib}/module-loader.mjs +1 -0
  130. package/{src/lib → lib}/package-scanner.mjs +47 -0
  131. package/{src/lib → lib}/project.mjs +48 -18
  132. package/{src/lib → lib}/project.test.mjs +1 -1
  133. package/{src/lib → lib}/resolve-theme.mjs +5 -0
  134. package/{src/lib → lib}/string-utils.mjs +15 -0
  135. package/{src/lib → lib}/term-log.mjs +12 -3
  136. package/{src/lib → lib}/xle/browser.mjs +18 -8
  137. package/{src/lib → lib}/xle/expand.mjs +155 -22
  138. package/{src/lib → lib}/xle/parse.mjs +119 -13
  139. package/{src/lib → lib}/xle/print.mjs +54 -14
  140. package/{src/lib → lib}/xle/registry-core.mjs +28 -3
  141. package/{src/lib → lib}/xle/registry.mjs +9 -4
  142. package/{src/lib → lib}/xle/splice.mjs +13 -2
  143. package/{src/lib → lib}/xle/validate.mjs +95 -14
  144. package/lib/xle/xle-ast.d.ts +214 -0
  145. package/package.json +33 -26
  146. package/scripts/postinstall.mjs +4 -4
  147. package/templates/blocks/components/Avatar/AvatarShowcase.tsx +1 -1
  148. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +19 -0
  149. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +46 -0
  150. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +14 -0
  151. package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +33 -0
  152. package/{src/types → types}/api.contract.assert.ts +17 -8
  153. package/{src/types → types}/api.d.ts +106 -0
  154. package/{src/types → types}/base.d.ts +17 -2
  155. package/types/build.d.ts +53 -0
  156. package/types/codemod.d.ts +166 -0
  157. package/{src/types → types}/component.d.ts +1 -1
  158. package/{src/types → types}/discover.d.ts +1 -1
  159. package/{src/types → types}/docs.d.ts +1 -4
  160. package/{src/types → types}/hook.d.ts +1 -1
  161. package/types/jscodeshift.d.ts +19 -0
  162. package/types/layout.d.ts +74 -0
  163. package/types/theme.d.ts +53 -0
  164. package/{src/types → types}/upgrade.d.ts +8 -1
  165. package/{src/utils → utils}/paths.mjs +4 -1
  166. package/src/commands/swizzle.mjs +0 -417
  167. package/src/types/build.d.ts +0 -23
  168. package/src/types/codemod.d.ts +0 -81
  169. package/src/types/theme.d.ts +0 -23
  170. /package/{src/api → api/docs}/docOverlays.test.mjs +0 -0
  171. /package/{src/api → api}/error.mjs +0 -0
  172. /package/{src/api → api/integration}/integration-block-exports.test.mjs +0 -0
  173. /package/{src/api → api/template}/template.test.mjs +0 -0
  174. /package/{src → authoring}/codemod.test.mjs +0 -0
  175. /package/{src → authoring}/config.mjs +0 -0
  176. /package/{src → authoring}/integration.mjs +0 -0
  177. /package/{src → authoring}/template.test.mjs +0 -0
  178. /package/{src → cli}/cli-exit-codes.test.mjs +0 -0
  179. /package/{src → cli}/commands/build-theme.color-scheme.test.mjs +0 -0
  180. /package/{src → cli}/commands/build-theme.import-path.test.mjs +0 -0
  181. /package/{src → cli}/commands/build-theme.path-safety.test.mjs +0 -0
  182. /package/{src → cli}/commands/build-theme.prose.test.mjs +0 -0
  183. /package/{src → cli}/commands/build-theme.variants.test.mjs +0 -0
  184. /package/{src → cli}/commands/build-theme.watch.test.mjs +0 -0
  185. /package/{src → cli}/commands/cli-postinstall.test.mjs +0 -0
  186. /package/{src → cli}/commands/component.test.mjs +0 -0
  187. /package/{src → cli}/commands/detail-levels.test.mjs +0 -0
  188. /package/{src → cli}/commands/init.next-steps.test.mjs +0 -0
  189. /package/{src → cli}/commands/interactive-guard.test.mjs +0 -0
  190. /package/{src → cli}/commands/json-contract.test.mjs +0 -0
  191. /package/{src → cli}/commands/swizzle.path-safety.test.mjs +0 -0
  192. /package/{src → cli}/commands/swizzle.routing.test.mjs +0 -0
  193. /package/{src → cli}/commands/template.test.mjs +0 -0
  194. /package/{src → cli}/commands/upgrade.config-ordering.test.mjs +0 -0
  195. /package/{src → cli}/commands/validate-integration.test.mjs +0 -0
  196. /package/{src → cli}/update-hint-commands.test.mjs +0 -0
  197. /package/{src/codemods → codemods}/__tests__/registry.test.mjs +0 -0
  198. /package/{src/codemods → codemods}/__tests__/rename-imperative-ref-to-handleRef.test.mjs +0 -0
  199. /package/{src/codemods → codemods}/__tests__/rename-isStreaming-to-isStopShown.test.mjs +0 -0
  200. /package/{src/codemods → codemods}/__tests__/rename-section-wash-to-muted.test.mjs +0 -0
  201. /package/{src/codemods → codemods}/__tests__/runner.test.mjs +0 -0
  202. /package/{src/codemods → codemods}/__tests__/toolbar-density-to-size.test.mjs +0 -0
  203. /package/{src/codemods → codemods}/__tests__/validation.test.mjs +0 -0
  204. /package/{src/codemods → codemods}/transforms/v0.0.10/__tests__/remove-size-props.test.mjs +0 -0
  205. /package/{src/codemods → codemods}/transforms/v0.0.10/index.mjs +0 -0
  206. /package/{src/codemods → codemods}/transforms/v0.0.12/__tests__/add-is-icon-only.test.mjs +0 -0
  207. /package/{src/codemods → codemods}/transforms/v0.0.12/index.mjs +0 -0
  208. /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/icon-name-deprecations.test.mjs +0 -0
  209. /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/rename-attachments-to-drawer.test.mjs +0 -0
  210. /package/{src/codemods → codemods}/transforms/v0.0.13/index.mjs +0 -0
  211. /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-action-props.test.mjs +0 -0
  212. /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +0 -0
  213. /package/{src/codemods → codemods}/transforms/v0.0.14/index.mjs +0 -0
  214. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-item-children-to-endcontent.test.mjs +0 -0
  215. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-selector-children-to-render-option.test.mjs +0 -0
  216. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-theme-selectors-to-data-attrs.test.mjs +0 -0
  217. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-date-picker-to-input.test.mjs +0 -0
  218. /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-stack-element-to-as.test.mjs +0 -0
  219. /package/{src/codemods → codemods}/transforms/v0.0.15/index.mjs +0 -0
  220. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-badge-dot-to-statusdot.test.mjs +0 -0
  221. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-gap-to-numeric.test.mjs +0 -0
  222. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-isFullBleed-to-padding.test.mjs +0 -0
  223. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-useXDSIcon-to-getIcon.test.mjs +0 -0
  224. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-banner-endButton-to-endContent.test.mjs +0 -0
  225. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-form-tooltip-startIcon.test.mjs +0 -0
  226. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-isShown-to-isOpen.test.mjs +0 -0
  227. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-selector-items-to-options.test.mjs +0 -0
  228. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-sidenav-header-to-heading.test.mjs +0 -0
  229. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-topnav-title-to-heading.test.mjs +0 -0
  230. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-uncontrolled-to-defaultX.test.mjs +0 -0
  231. /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-visibility-to-onOpenChange.test.mjs +0 -0
  232. /package/{src/codemods → codemods}/transforms/v0.0.2/index.mjs +0 -0
  233. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-collapse-to-collapsible.test.mjs +0 -0
  234. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-radius-tokens.test.mjs +0 -0
  235. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-shadow-tokens.test.mjs +0 -0
  236. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-skeleton-radius.test.mjs +0 -0
  237. /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-token-names.test.mjs +0 -0
  238. /package/{src/codemods → codemods}/transforms/v0.0.6/index.mjs +0 -0
  239. /package/{src/codemods → codemods}/transforms/v0.0.7/__tests__/rename-banner-variant-to-container.test.mjs +0 -0
  240. /package/{src/codemods → codemods}/transforms/v0.0.7/index.mjs +0 -0
  241. /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/migrate-token-renames.test.mjs +0 -0
  242. /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/rename-endslot-to-endcontent.test.mjs +0 -0
  243. /package/{src/codemods → codemods}/transforms/v0.0.8/index.mjs +0 -0
  244. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +0 -0
  245. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-css-surfaces.test.mjs +0 -0
  246. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-declare-module.test.mjs +0 -0
  247. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +0 -0
  248. /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/v0.1.0-ordering.test.mjs +0 -0
  249. /package/{src/codemods → codemods}/transforms/v0.1.0/index.mjs +0 -0
  250. /package/{src/codemods → codemods}/transforms/v0.1.2/__tests__/rename-text-color-active-to-accent.test.mjs +0 -0
  251. /package/{src/codemods → codemods}/transforms/v0.1.2/index.mjs +0 -0
  252. /package/{src/codemods → codemods}/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +0 -0
  253. /package/{src/codemods → codemods}/transforms/v0.1.3/index.mjs +0 -0
  254. /package/{src/codemods → codemods}/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -0
  255. /package/{src/codemods → codemods}/transforms/v0.1.5/index.mjs +0 -0
  256. /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/migrate-table-tableprops-to-direct-props.test.mjs +0 -0
  257. /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/rename-table-renderprops-styles-to-xstyle.test.mjs +0 -0
  258. /package/{src/codemods → codemods}/transforms/v0.1.7/index.mjs +0 -0
  259. /package/{src/codemods → codemods}/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +0 -0
  260. /package/{src/codemods → codemods}/transforms/v0.1.8/index.mjs +0 -0
  261. /package/{src/commands → lib/agent-docs}/agent-docs.test.mjs +0 -0
  262. /package/{src/lib → lib}/cli-error.mjs +0 -0
  263. /package/{src/lib → lib}/cli-error.test.mjs +0 -0
  264. /package/{src/lib → lib}/component-discovery.importpath.test.mjs +0 -0
  265. /package/{src/lib → lib}/component-format.test.mjs +0 -0
  266. /package/{src/lib → lib}/component-loader.test.mjs +0 -0
  267. /package/{src/lib → lib}/config-cache.mjs +0 -0
  268. /package/{src/lib → lib}/config-cache.test.mjs +0 -0
  269. /package/{src/lib → lib}/config-schema.mjs +0 -0
  270. /package/{src/lib → lib}/error-codes.mjs +0 -0
  271. /package/{src/lib → lib}/integration-warnings.test.mjs +0 -0
  272. /package/{src/lib → lib}/json.mjs +0 -0
  273. /package/{src/lib → lib}/module-loader.test.mjs +0 -0
  274. /package/{src/lib → lib}/node-version.mjs +0 -0
  275. /package/{src/lib → lib}/node-version.test.mjs +0 -0
  276. /package/{src/lib → lib}/parse.mjs +0 -0
  277. /package/{src/lib → lib}/site.mjs +0 -0
  278. /package/{src/lib → lib}/xle/browser.d.ts +0 -0
  279. /package/{src/lib → lib}/xle/xle.test.mjs +0 -0
  280. /package/{src/schemas → schemas}/doc-schema.mjs +0 -0
  281. /package/{src/schemas → schemas}/template-schema.mjs +0 -0
  282. /package/{src/types → types}/config.d.ts +0 -0
  283. /package/{src/types → types}/doc.d.ts +0 -0
  284. /package/{src/types → types}/doctor.d.ts +0 -0
  285. /package/{src/types → types}/error-codes.d.ts +0 -0
  286. /package/{src/types → types}/index.d.ts +0 -0
  287. /package/{src/types → types}/integration.d.ts +0 -0
  288. /package/{src/types → types}/manifest.d.ts +0 -0
  289. /package/{src/types → types}/search.d.ts +0 -0
  290. /package/{src/types → types}/swizzle.d.ts +0 -0
  291. /package/{src/types → types}/template-api.d.ts +0 -0
  292. /package/{src/types → types}/template.d.ts +0 -0
  293. /package/{src/types → types}/validate-integration.d.ts +0 -0
  294. /package/{src/utils → utils}/github.mjs +0 -0
  295. /package/{src/utils → utils}/package-manager.mjs +0 -0
  296. /package/{src/utils → utils}/package-manager.test.mjs +0 -0
  297. /package/{src/utils → utils}/path-safety.mjs +0 -0
  298. /package/{src/utils → utils}/path-safety.test.mjs +0 -0
  299. /package/{src/utils → utils}/paths.test.mjs +0 -0
  300. /package/{src/utils → utils}/semver.mjs +0 -0
  301. /package/{src/utils → utils}/semver.test.mjs +0 -0
  302. /package/{src/utils → utils}/update-check.mjs +0 -0
  303. /package/{src/utils → utils}/update-check.test.mjs +0 -0
@@ -0,0 +1,19 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'InternationalizationProvider',
7
+ name: 'InternationalizationProvider — Shipped Locale',
8
+ displayName: 'Internationalization Provider — Shipped Locale',
9
+ description:
10
+ 'Load a locale catalog shipped by Astryx and re-render InternationalizationProvider with a new locale to update Astryx strings live.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: [
14
+ 'InternationalizationProvider',
15
+ 'SegmentedControl',
16
+ 'Selector',
17
+ 'Layout',
18
+ ],
19
+ };
@@ -0,0 +1,46 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {InternationalizationProvider} from '@astryxdesign/core/i18n';
7
+ import frFR from '@astryxdesign/core/locales/fr-FR.json';
8
+ import {Stack} from '@astryxdesign/core/Layout';
9
+ import {
10
+ SegmentedControl,
11
+ SegmentedControlItem,
12
+ } from '@astryxdesign/core/SegmentedControl';
13
+ import {Selector} from '@astryxdesign/core/Selector';
14
+
15
+ type Locale = 'en' | 'fr-FR';
16
+
17
+ export default function InternationalizationProviderShippedLocale() {
18
+ const [locale, setLocale] = useState<Locale>('en');
19
+ const [value, setValue] = useState<string | null>(null);
20
+ return (
21
+ <InternationalizationProvider locale={locale} messages={{'fr-FR': frFR}}>
22
+ <Stack direction="vertical" gap={4} hAlign="center">
23
+ <SegmentedControl
24
+ label="Language"
25
+ value={locale}
26
+ onChange={nextLocale => setLocale(nextLocale as Locale)}
27
+ size="sm">
28
+ <SegmentedControlItem value="en" label="EN" />
29
+ <SegmentedControlItem value="fr-FR" label="FR" />
30
+ </SegmentedControl>
31
+ <Selector
32
+ style={{width: 300}}
33
+ label="Billing region"
34
+ options={[
35
+ {value: 'americas', label: 'Americas'},
36
+ {value: 'emea', label: 'EMEA'},
37
+ {value: 'apac', label: 'APAC'},
38
+ ]}
39
+ value={value}
40
+ onChange={setValue}
41
+ hasClear
42
+ />
43
+ </Stack>
44
+ </InternationalizationProvider>
45
+ );
46
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'InternationalizationProvider',
7
+ name: 'InternationalizationProvider — Overrides',
8
+ displayName: 'Internationalization Provider — Overrides',
9
+ description:
10
+ 'Override a small number of Astryx strings without providing a full locale catalog.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['InternationalizationProvider', 'Selector'],
14
+ };
@@ -0,0 +1,33 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {InternationalizationProvider} from '@astryxdesign/core/i18n';
7
+ import {Selector} from '@astryxdesign/core/Selector';
8
+
9
+ export default function InternationalizationProviderOverrides() {
10
+ const [value, setValue] = useState<string | null>(null);
11
+ return (
12
+ <InternationalizationProvider
13
+ locale="en"
14
+ overrides={{
15
+ en: {
16
+ '@astryx.selector.placeholder': 'Choose...',
17
+ },
18
+ }}>
19
+ <Selector
20
+ style={{width: 300}}
21
+ label="Billing region"
22
+ options={[
23
+ {value: 'americas', label: 'Americas'},
24
+ {value: 'emea', label: 'EMEA'},
25
+ {value: 'apac', label: 'APAC'},
26
+ ]}
27
+ value={value}
28
+ onChange={setValue}
29
+ hasClear
30
+ />
31
+ </InternationalizationProvider>
32
+ );
33
+ }
@@ -31,14 +31,14 @@
31
31
  */
32
32
 
33
33
  import type * as Api from './api';
34
- import type {component} from '../api/component.mjs';
35
- import type {docs} from '../api/docs.mjs';
36
- import type {discover} from '../api/discover.mjs';
37
- import type {template} from '../api/template.mjs';
34
+ import type {component} from '../api/component/component.mjs';
35
+ import type {docs} from '../api/docs/docs.mjs';
36
+ import type {discover} from '../api/discover/discover.mjs';
37
+ import type {template} from '../api/template/template.mjs';
38
38
 
39
39
  /** Resolve to `true` only when `A` and `B` are mutually assignable. */
40
40
  type Equal<A, B> =
41
- (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2)
41
+ (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2
42
42
  ? true
43
43
  : false;
44
44
 
@@ -52,16 +52,25 @@ type Opt<T> = NonNullable<T>;
52
52
  // must describe the same set of keys/types, in both directions. ──────────────
53
53
 
54
54
  type _ComponentOptions = Expect<
55
- Equal<Opt<Parameters<typeof Api.component>[1]>, Opt<Parameters<typeof component>[1]>>
55
+ Equal<
56
+ Opt<Parameters<typeof Api.component>[1]>,
57
+ Opt<Parameters<typeof component>[1]>
58
+ >
56
59
  >;
57
60
  type _DocsOptions = Expect<
58
61
  Equal<Opt<Parameters<typeof Api.docs>[2]>, Opt<Parameters<typeof docs>[2]>>
59
62
  >;
60
63
  type _DiscoverOptions = Expect<
61
- Equal<Opt<Parameters<typeof Api.discover>[1]>, Opt<Parameters<typeof discover>[1]>>
64
+ Equal<
65
+ Opt<Parameters<typeof Api.discover>[1]>,
66
+ Opt<Parameters<typeof discover>[1]>
67
+ >
62
68
  >;
63
69
  type _TemplateOptions = Expect<
64
- Equal<Opt<Parameters<typeof Api.template>[1]>, Opt<Parameters<typeof template>[1]>>
70
+ Equal<
71
+ Opt<Parameters<typeof Api.template>[1]>,
72
+ Opt<Parameters<typeof template>[1]>
73
+ >
65
74
  >;
66
75
 
67
76
  // ── Positional-argument parity: arity and positional types must match. ───────
@@ -44,6 +44,16 @@ import type {
44
44
  import type {SearchResponse, SearchDomain} from './search';
45
45
  import type {ErrorCode} from './error-codes';
46
46
  import type {DoctorResponse} from './doctor';
47
+ import type {
48
+ LayoutForm,
49
+ LayoutExpandResponse,
50
+ LayoutCheckResponse,
51
+ LayoutGrammarResponse,
52
+ } from './layout';
53
+ import type {ValidateIntegrationResponse} from './validate-integration';
54
+ import type {AstryxIntegrationIssue} from './integration';
55
+ import type {BuildHelpResponse, BuildKitResponse} from './build';
56
+ import type {SwizzleListResponse, SwizzleCopyResponse} from './swizzle';
47
57
  import type {Suggestion} from './base';
48
58
 
49
59
  /** Structured API error with a stable machine-readable code. */
@@ -186,6 +196,47 @@ export declare function search(
186
196
  options?: SearchOptions,
187
197
  ): Promise<SearchResponse>;
188
198
 
199
+ // ── Build ────────────────────────────────────────────────────────────
200
+
201
+ export interface BuildOptions {
202
+ cwd?: string;
203
+ type?: SearchDomain;
204
+ limit?: number;
205
+ }
206
+
207
+ /**
208
+ * Page-building assistant. No query → `build.help` (playbook signal); a query →
209
+ * `build.kit` (grouped composition kit of raw search entries + frame/foundation).
210
+ */
211
+ export declare function build(
212
+ query?: string,
213
+ options?: BuildOptions,
214
+ ): Promise<BuildHelpResponse | BuildKitResponse>;
215
+
216
+ // ── Swizzle ──────────────────────────────────────────────────────────
217
+
218
+ export interface SwizzleOptions {
219
+ cwd?: string;
220
+ /** Output directory (must resolve inside cwd). Defaults to ./components/astryx. */
221
+ output?: string;
222
+ /** Scope to a specific owning package when a name is ambiguous. */
223
+ package?: string;
224
+ /** Force the list response even with a component argument. */
225
+ list?: boolean;
226
+ /** Overwrite existing files instead of erroring. */
227
+ overwrite?: boolean;
228
+ }
229
+
230
+ /**
231
+ * List swizzlable components (no name / `list`) or copy one component's source
232
+ * into the project (side effect) and return a `swizzle.copy` receipt. Errors
233
+ * throw AstryxError (ERR_UNKNOWN_COMPONENT, ERR_AMBIGUOUS_COMPONENT, …).
234
+ */
235
+ export declare function swizzle(
236
+ component?: string,
237
+ options?: SwizzleOptions,
238
+ ): Promise<SwizzleListResponse | SwizzleCopyResponse>;
239
+
189
240
  // ── Doctor ──────────────────────────────────
190
241
 
191
242
  export interface DoctorOptions {
@@ -195,3 +246,58 @@ export interface DoctorOptions {
195
246
  export declare function doctor(
196
247
  options?: DoctorOptions,
197
248
  ): Promise<DoctorResponse>;
249
+
250
+ // ── Layout ───────────────────────────────────────────────────────────
251
+
252
+ export interface LayoutExpandOptions {
253
+ targetPath?: string;
254
+ form?: LayoutForm;
255
+ loose?: boolean;
256
+ name?: string;
257
+ cwd?: string;
258
+ }
259
+
260
+ export declare function layoutExpand(
261
+ expression: string,
262
+ options?: LayoutExpandOptions,
263
+ ): Promise<LayoutExpandResponse>;
264
+
265
+ export interface LayoutCheckOptions {
266
+ form?: LayoutForm;
267
+ loose?: boolean;
268
+ cwd?: string;
269
+ }
270
+
271
+ export declare function layoutCheck(
272
+ expression: string,
273
+ options?: LayoutCheckOptions,
274
+ ): Promise<LayoutCheckResponse>;
275
+
276
+ export interface LayoutGrammarOptions {
277
+ cwd?: string;
278
+ }
279
+
280
+ export declare function layoutGrammar(
281
+ options?: LayoutGrammarOptions,
282
+ ): Promise<LayoutGrammarResponse>;
283
+
284
+ // ── Validate integration ─────────────────────────────────────────────
285
+
286
+ export interface ValidateIntegrationOptions {
287
+ cwd?: string;
288
+ }
289
+
290
+ /**
291
+ * Validate the local integration (no `pkg`) or an installed one (`pkg` given).
292
+ * The no-manifest local case returns `{ name: null, version: null, issues: [] }`.
293
+ */
294
+ export declare function validateIntegration(
295
+ pkg?: string,
296
+ options?: ValidateIntegrationOptions,
297
+ ): Promise<ValidateIntegrationResponse>;
298
+
299
+ /** Count issues by severity. */
300
+ export declare function summarizeIssues(issues: AstryxIntegrationIssue[]): {
301
+ errors: number;
302
+ warnings: number;
303
+ };
@@ -43,14 +43,23 @@ import type {
43
43
  HookDetailParamsResponse,
44
44
  } from './hook';
45
45
  import type {SwizzleListResponse, SwizzleCopyResponse} from './swizzle';
46
- import type {ThemeBuildResponse} from './theme';
46
+ import type {
47
+ ThemeBuildResponse,
48
+ ThemeListResponse,
49
+ ThemeAddResponse,
50
+ } from './theme';
47
51
  import type {
48
52
  UpgradeListResponse,
49
53
  UpgradeRunResponse,
50
54
  UpgradeStatusResponse,
51
55
  } from './upgrade';
52
56
  import type {SearchResponse} from './search';
53
- import type {BuildHelpResponse} from './build';
57
+ import type {
58
+ LayoutExpandResponse,
59
+ LayoutCheckResponse,
60
+ LayoutGrammarResponse,
61
+ } from './layout';
62
+ import type {BuildHelpResponse, BuildKitResponse} from './build';
54
63
  import type {ErrorCode} from './error-codes';
55
64
  import type {ManifestResponse} from './manifest';
56
65
  import type {DoctorResponse} from './doctor';
@@ -116,11 +125,17 @@ export type CLIAnyResponse =
116
125
  | SwizzleListResponse
117
126
  | SwizzleCopyResponse
118
127
  | ThemeBuildResponse
128
+ | ThemeListResponse
129
+ | ThemeAddResponse
119
130
  | UpgradeListResponse
120
131
  | UpgradeRunResponse
121
132
  | UpgradeStatusResponse
122
133
  | SearchResponse
134
+ | LayoutExpandResponse
135
+ | LayoutCheckResponse
136
+ | LayoutGrammarResponse
123
137
  | BuildHelpResponse
138
+ | BuildKitResponse
124
139
  | ManifestResponse
125
140
  | DoctorResponse
126
141
  | ValidateIntegrationResponse;
@@ -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 {
@@ -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
+ }