@astryxdesign/cli 0.7.6-canary.962dffe → 0.7.6-canary.9728cd7

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 (504) hide show
  1. package/api/search/_adapter.d.mts +3 -1
  2. package/api/search/_adapter.mjs +19 -19
  3. package/assets/docs/motion.doc.mjs +1 -1
  4. package/foundation/discovery/package-tsconfig.mjs +34 -0
  5. package/foundation/fs/read-record.d.mts +4 -1
  6. package/foundation/fs/read-record.mjs +9 -5
  7. package/package.json +24 -10
  8. package/api/api-docs-parse.test.mjs +0 -47
  9. package/api/blog/_adapter.test.mjs +0 -183
  10. package/api/blog/blog.test.mjs +0 -144
  11. package/api/blog/detail/detail.test.mjs +0 -118
  12. package/api/blog/list/list.test.mjs +0 -81
  13. package/api/build/blocks/blocks.test.mjs +0 -238
  14. package/api/build/build.test.mjs +0 -569
  15. package/api/build/kit/answer.test.mjs +0 -108
  16. package/api/build/kit/rank.test.mjs +0 -380
  17. package/api/build/kit/weights.test.mjs +0 -286
  18. package/api/build/tree.test.mjs +0 -185
  19. package/api/component/component-replacement.test.mjs +0 -616
  20. package/api/component/component.test.mjs +0 -532
  21. package/api/component/doc-links.test.mjs +0 -419
  22. package/api/component/integration-export-name.test.mjs +0 -644
  23. package/api/component/integration-import-agreement.test.mjs +0 -474
  24. package/api/discover/_adapter.test.mjs +0 -839
  25. package/api/discover/_catalog-view.test.mjs +0 -129
  26. package/api/discover/_package-scanner.test.mjs +0 -117
  27. package/api/discover/detail/detail.test.mjs +0 -145
  28. package/api/discover/detail/doc/doc.test.mjs +0 -93
  29. package/api/discover/detail/item/item.test.mjs +0 -75
  30. package/api/discover/discover.test.mjs +0 -100
  31. package/api/discover/list/list.test.mjs +0 -107
  32. package/api/discover/search/search.test.mjs +0 -319
  33. package/api/docs/compiled-topics.test.mjs +0 -94
  34. package/api/docs/detail/section/section.test.mjs +0 -92
  35. package/api/docs/docOverlays.test.mjs +0 -189
  36. package/api/docs/docs-homes.test.mjs +0 -127
  37. package/api/docs/docs.depth.test.mjs +0 -134
  38. package/api/docs/docs.test.mjs +0 -315
  39. package/api/docs/guide-route-targets.test.mjs +0 -1002
  40. package/api/docs/index/index.test.mjs +0 -67
  41. package/api/docs/integration-tree.test.mjs +0 -616
  42. package/api/docs/integrationDocs.test.mjs +0 -546
  43. package/api/docs/namespace-section.test.mjs +0 -260
  44. package/api/docs/react-version-sync.test.mjs +0 -79
  45. package/api/docs/reference-blocks.test.mjs +0 -404
  46. package/api/docs/token-tables.test.mjs +0 -93
  47. package/api/doctor/built-checks.test.mjs +0 -531
  48. package/api/doctor/doctor.test.mjs +0 -1651
  49. package/api/doctor/icon-sets.test.mjs +0 -111
  50. package/api/doctor/release-checks.test.mjs +0 -156
  51. package/api/doctor/theme-checks.test.mjs +0 -884
  52. package/api/gap-report/gap-report.test.mjs +0 -1549
  53. package/api/hook/detail/detail.test.mjs +0 -53
  54. package/api/hook/detail/params/params.test.mjs +0 -39
  55. package/api/hook/hook.test.mjs +0 -75
  56. package/api/icon/all-or-nothing.test.mjs +0 -283
  57. package/api/icon/error-codes.test.mjs +0 -341
  58. package/api/icon/experimental-markers.test.mjs +0 -93
  59. package/api/icon/icon.test.mjs +0 -506
  60. package/api/icon/new-definition/new-definition.undo.test.mjs +0 -97
  61. package/api/icon/new-set/new-set.test.mjs +0 -398
  62. package/api/icon/option-pairs.test.mjs +0 -368
  63. package/api/init/init.test.mjs +0 -319
  64. package/api/init/remove/remove.test.mjs +0 -124
  65. package/api/init/user/user.test.mjs +0 -232
  66. package/api/integration/add-contribution.component-names.test.mjs +0 -186
  67. package/api/integration/add-contribution.test.mjs +0 -990
  68. package/api/integration/add-helpers.test.mjs +0 -161
  69. package/api/integration/add-theme.test.mjs +0 -676
  70. package/api/integration/authoring-checks.test.mjs +0 -1683
  71. package/api/integration/check/check.test.mjs +0 -538
  72. package/api/integration/doc-stability.test.mjs +0 -216
  73. package/api/integration/example-checks.no-npm.test.mjs +0 -140
  74. package/api/integration/example-checks.test.mjs +0 -776
  75. package/api/integration/integration-block-exports.test.mjs +0 -248
  76. package/api/integration/pack-check.component-replaces.test.mjs +0 -126
  77. package/api/integration/pack-check.lifecycle-output.test.mjs +0 -149
  78. package/api/integration/pack-check.test.mjs +0 -2512
  79. package/api/integration/public-api.test.mjs +0 -21
  80. package/api/integration/template-conflict-compatibility.test.mjs +0 -73
  81. package/api/integration/validate-installed-icon-sets.test.mjs +0 -67
  82. package/api/integration/validate-integration-case-disk.test.mjs +0 -123
  83. package/api/integration/validate-integration-fixes.test.mjs +0 -1457
  84. package/api/integration/validate-integration-gaps.test.mjs +0 -1999
  85. package/api/integration/validate-integration.test.mjs +0 -835
  86. package/api/integration/validate-unread-theme-folders.test.mjs +0 -111
  87. package/api/json/envelope-types.test.mjs +0 -76
  88. package/api/json/parse.test.mjs +0 -76
  89. package/api/render/render.test.mjs +0 -1155
  90. package/api/search/_adapter.test.mjs +0 -192
  91. package/api/search/_doc-searcher.test.mjs +0 -36
  92. package/api/search/_entries.test.mjs +0 -48
  93. package/api/search/_main-searcher.test.mjs +0 -106
  94. package/api/search/_order.test.mjs +0 -72
  95. package/api/search/_template-searcher.test.mjs +0 -40
  96. package/api/search/search-return-type.test.mjs +0 -54
  97. package/api/search/search.domain-priority.test.mjs +0 -351
  98. package/api/search/search.family-members.test.mjs +0 -124
  99. package/api/search/search.family-word.test.mjs +0 -146
  100. package/api/search/search.integration-block.test.mjs +0 -100
  101. package/api/search/search.integration-check.test.mjs +0 -24
  102. package/api/search/search.test.mjs +0 -1007
  103. package/api/search/search.tie-order.test.mjs +0 -39
  104. package/api/search/tree.test.mjs +0 -66
  105. package/api/swizzle/_github.test.mjs +0 -53
  106. package/api/swizzle/copy/copy.test.mjs +0 -60
  107. package/api/swizzle/swizzle.test.mjs +0 -157
  108. package/api/template/cdn/cdn.test.mjs +0 -108
  109. package/api/template/checkout-wizard.test.mjs +0 -87
  110. package/api/template/copy/copy.receipt.test.mjs +0 -77
  111. package/api/template/copy/copy.test.mjs +0 -77
  112. package/api/template/data-token-fallbacks.test.mjs +0 -85
  113. package/api/template/discover-integration-templates.test.mjs +0 -56
  114. package/api/template/form-wizard-dialog.test.mjs +0 -47
  115. package/api/template/inline-wizard-template.test.mjs +0 -24
  116. package/api/template/list/list.test.mjs +0 -52
  117. package/api/template/show/show.test.mjs +0 -76
  118. package/api/template/table-filter-view-tabs.test.mjs +0 -45
  119. package/api/template/table-floating-bulk-actions.test.mjs +0 -66
  120. package/api/template/template-integration.test.mjs +0 -1274
  121. package/api/template/template-suffix.test.mjs +0 -286
  122. package/api/template/template.test.mjs +0 -222
  123. package/api/template/tokenizer-showcase.test.mjs +0 -47
  124. package/api/template/unknown-name.test.mjs +0 -63
  125. package/api/theme/add/add.test.mjs +0 -363
  126. package/api/theme/add/add.types.test.mjs +0 -150
  127. package/api/theme/build/build.adaptation-core-compat.test.mjs +0 -394
  128. package/api/theme/build/build.adaptation-enrollment.test.mjs +0 -219
  129. package/api/theme/build/build.core-on-demand.test.mjs +0 -113
  130. package/api/theme/build/build.family.test.mjs +0 -503
  131. package/api/theme/build/build.font-warning.test.mjs +0 -170
  132. package/api/theme/build/build.heading-core-compat.test.mjs +0 -68
  133. package/api/theme/build/build.icon-entry-variants.test.mjs +0 -134
  134. package/api/theme/build/build.icon-function-entries.test.mjs +0 -499
  135. package/api/theme/build/build.icon-lineage.test.mjs +0 -117
  136. package/api/theme/build/build.icon-preservation.test.mjs +0 -639
  137. package/api/theme/build/build.icon-variants.test.mjs +0 -105
  138. package/api/theme/build/build.icons-specifier.test.mjs +0 -149
  139. package/api/theme/build/build.packed-old-core.test.mjs +0 -1512
  140. package/api/theme/build/build.project-core.test.mjs +0 -220
  141. package/api/theme/build/build.public-component-vars.test.mjs +0 -151
  142. package/api/theme/build/build.receipt-doc.test.mjs +0 -111
  143. package/api/theme/build/build.rollback.test.mjs +0 -148
  144. package/api/theme/build/build.test.mjs +0 -1258
  145. package/api/theme/build/font-warning.test.mjs +0 -268
  146. package/api/theme/eject/eject.binary.test.mjs +0 -90
  147. package/api/theme/eject/eject.copy-compat.test.mjs +0 -168
  148. package/api/theme/eject/eject.rollback.test.mjs +0 -158
  149. package/api/theme/eject/eject.staging.test.mjs +0 -83
  150. package/api/theme/eject/eject.test.mjs +0 -160
  151. package/api/theme/integration-themes.test.mjs +0 -218
  152. package/api/theme/list/list.test.mjs +0 -271
  153. package/api/theme/palette/generate/generate.test.mjs +0 -445
  154. package/api/theme/palette/generate/generator.test.mjs +0 -385
  155. package/api/theme/palette/generate/preview.test.mjs +0 -55
  156. package/api/theme/remove/remove.test.mjs +0 -94
  157. package/api/theme/targets/targets.test.mjs +0 -91
  158. package/api/theme/template/template.test.mjs +0 -102
  159. package/api/theme/use/use.test.mjs +0 -98
  160. package/api/upgrade/list/list.test.mjs +0 -73
  161. package/api/upgrade/project-context.test.mjs +0 -272
  162. package/api/upgrade/provider-agreement.test.mjs +0 -152
  163. package/api/upgrade/registry/registry.test.mjs +0 -911
  164. package/api/upgrade/run/authoring-codemod-reachable.test.mjs +0 -99
  165. package/api/upgrade/run/cli-behind-core.test.mjs +0 -438
  166. package/api/upgrade/run/failure-receipt.test.mjs +0 -212
  167. package/api/upgrade/run/files-changed.test.mjs +0 -111
  168. package/api/upgrade/run/outcomes.test.mjs +0 -646
  169. package/api/upgrade/run/run.test.mjs +0 -511
  170. package/api/upgrade/upgrade.test.mjs +0 -594
  171. package/assets/codemods/__tests__/registry.test.mjs +0 -77
  172. package/assets/codemods/__tests__/rename-imperative-ref-to-handleRef.test.mjs +0 -65
  173. package/assets/codemods/__tests__/rename-isStreaming-to-isStopShown.test.mjs +0 -58
  174. package/assets/codemods/__tests__/rename-section-wash-to-muted.test.mjs +0 -103
  175. package/assets/codemods/__tests__/runner.symlinks.test.mjs +0 -205
  176. package/assets/codemods/__tests__/runner.test.mjs +0 -559
  177. package/assets/codemods/__tests__/runner.unparseable.test.mjs +0 -457
  178. package/assets/codemods/__tests__/toolbar-density-to-size.test.mjs +0 -69
  179. package/assets/codemods/__tests__/validation.test.mjs +0 -108
  180. package/assets/codemods/file-count.test.mjs +0 -163
  181. package/assets/codemods/integration-discovery.test.mjs +0 -360
  182. package/assets/codemods/integration-runner.protection.test.mjs +0 -206
  183. package/assets/codemods/outcome.test.mjs +0 -40
  184. package/assets/codemods/term-log.test.mjs +0 -80
  185. package/assets/codemods/transform-prop.test.mjs +0 -130
  186. package/assets/codemods/transforms/v0.0.10/__tests__/remove-size-props.test.mjs +0 -144
  187. package/assets/codemods/transforms/v0.0.12/__tests__/add-is-icon-only.test.mjs +0 -193
  188. package/assets/codemods/transforms/v0.0.13/__tests__/icon-name-deprecations.test.mjs +0 -81
  189. package/assets/codemods/transforms/v0.0.13/__tests__/rename-attachments-to-drawer.test.mjs +0 -126
  190. package/assets/codemods/transforms/v0.0.14/__tests__/rename-action-props.test.mjs +0 -129
  191. package/assets/codemods/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +0 -126
  192. package/assets/codemods/transforms/v0.0.15/__tests__/migrate-item-children-to-endcontent.test.mjs +0 -95
  193. package/assets/codemods/transforms/v0.0.15/__tests__/migrate-selector-children-to-render-option.test.mjs +0 -109
  194. package/assets/codemods/transforms/v0.0.15/__tests__/migrate-theme-selectors-to-data-attrs.test.mjs +0 -44
  195. package/assets/codemods/transforms/v0.0.15/__tests__/rename-date-picker-to-input.test.mjs +0 -110
  196. package/assets/codemods/transforms/v0.0.15/__tests__/rename-stack-element-to-as.test.mjs +0 -71
  197. package/assets/codemods/transforms/v0.0.2/__tests__/migrate-badge-dot-to-statusdot.test.mjs +0 -137
  198. package/assets/codemods/transforms/v0.0.2/__tests__/migrate-gap-to-numeric.test.mjs +0 -161
  199. package/assets/codemods/transforms/v0.0.2/__tests__/migrate-isFullBleed-to-padding.test.mjs +0 -137
  200. package/assets/codemods/transforms/v0.0.2/__tests__/migrate-useXDSIcon-to-getIcon.test.mjs +0 -110
  201. package/assets/codemods/transforms/v0.0.2/__tests__/rename-banner-endButton-to-endContent.test.mjs +0 -61
  202. package/assets/codemods/transforms/v0.0.2/__tests__/rename-form-tooltip-startIcon.test.mjs +0 -130
  203. package/assets/codemods/transforms/v0.0.2/__tests__/rename-isShown-to-isOpen.test.mjs +0 -89
  204. package/assets/codemods/transforms/v0.0.2/__tests__/rename-selector-items-to-options.test.mjs +0 -74
  205. package/assets/codemods/transforms/v0.0.2/__tests__/rename-sidenav-header-to-heading.test.mjs +0 -140
  206. package/assets/codemods/transforms/v0.0.2/__tests__/rename-topnav-title-to-heading.test.mjs +0 -116
  207. package/assets/codemods/transforms/v0.0.2/__tests__/unify-uncontrolled-to-defaultX.test.mjs +0 -79
  208. package/assets/codemods/transforms/v0.0.2/__tests__/unify-visibility-to-onOpenChange.test.mjs +0 -130
  209. package/assets/codemods/transforms/v0.0.6/__tests__/migrate-badge-children-to-label.test.mjs +0 -46
  210. package/assets/codemods/transforms/v0.0.6/__tests__/migrate-collapse-to-collapsible.test.mjs +0 -72
  211. package/assets/codemods/transforms/v0.0.6/__tests__/migrate-radius-tokens.test.mjs +0 -98
  212. package/assets/codemods/transforms/v0.0.6/__tests__/migrate-shadow-tokens.test.mjs +0 -117
  213. package/assets/codemods/transforms/v0.0.6/__tests__/migrate-skeleton-radius.test.mjs +0 -75
  214. package/assets/codemods/transforms/v0.0.6/__tests__/migrate-token-names.test.mjs +0 -275
  215. package/assets/codemods/transforms/v0.0.7/__tests__/rename-banner-variant-to-container.test.mjs +0 -85
  216. package/assets/codemods/transforms/v0.0.8/__tests__/migrate-token-renames.test.mjs +0 -327
  217. package/assets/codemods/transforms/v0.0.8/__tests__/rename-endslot-to-endcontent.test.mjs +0 -98
  218. package/assets/codemods/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +0 -460
  219. package/assets/codemods/transforms/v0.1.0/__tests__/migrate-xds-css-surfaces.test.mjs +0 -103
  220. package/assets/codemods/transforms/v0.1.0/__tests__/migrate-xds-declare-module.test.mjs +0 -61
  221. package/assets/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +0 -123
  222. package/assets/codemods/transforms/v0.1.0/__tests__/v0.1.0-ordering.test.mjs +0 -104
  223. package/assets/codemods/transforms/v0.1.2/__tests__/rename-text-color-active-to-accent.test.mjs +0 -120
  224. package/assets/codemods/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +0 -574
  225. package/assets/codemods/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -93
  226. package/assets/codemods/transforms/v0.1.7/__tests__/migrate-table-tableprops-to-direct-props.test.mjs +0 -120
  227. package/assets/codemods/transforms/v0.1.7/__tests__/rename-table-renderprops-styles-to-xstyle.test.mjs +0 -112
  228. package/assets/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +0 -129
  229. package/assets/codemods/transforms/v0.2.0/__tests__/remove-tablist-orientation.test.mjs +0 -81
  230. package/assets/codemods/transforms/v0.2.1/__tests__/migrate-dialog-position-to-logical.test.mjs +0 -119
  231. package/assets/codemods/transforms/v0.3.0/__tests__/authoring-migration.e2e.test.mjs +0 -296
  232. package/assets/codemods/transforms/v0.3.0/__tests__/authoring-migration.tsc.test.mjs +0 -139
  233. package/assets/codemods/transforms/v0.3.0/__tests__/migrate-authoring-imports.test.mjs +0 -80
  234. package/assets/codemods/transforms/v0.3.0/__tests__/migrate-grid-minchildwidth-to-columns.test.mjs +0 -82
  235. package/assets/codemods/transforms/v0.3.0/__tests__/next-codemods.test.mjs +0 -64
  236. package/assets/codemods/transforms/v0.3.0/__tests__/rename-authoring-doctypes.test.mjs +0 -94
  237. package/assets/codemods/transforms/v0.3.0/__tests__/rename-radiogroup-arialabel-to-label.test.mjs +0 -86
  238. package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +0 -170
  239. package/assets/codemods/transforms/v0.4.0/__tests__/migrate-table-rowexpansion-to-tree.test.mjs +0 -201
  240. package/assets/codemods/transforms/v0.4.0/__tests__/next-codemods.test.mjs +0 -154
  241. package/assets/codemods/transforms/v0.5.0/__tests__/next-codemods.test.mjs +0 -127
  242. package/assets/codemods/transforms/v0.6.0/__tests__/migrate-astryx-theme-selectors-to-data-attrs.test.mjs +0 -398
  243. package/assets/codemods/transforms/v0.6.0/__tests__/next-codemods.test.mjs +0 -270
  244. package/assets/codemods/transforms/v0.6.4/__tests__/migrate-native-picker-to-presentation.test.mjs +0 -63
  245. package/assets/codemods/transforms/v0.6.4/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +0 -220
  246. package/assets/codemods/transforms/v0.6.7/__tests__/migrate-copied-themes-to-descriptors.test.mjs +0 -129
  247. package/assets/codemods/transforms/v0.7.0/__tests__/migrate-deprecated-theme-surface.test.mjs +0 -523
  248. package/assets/codemods/transforms/v0.7.0/__tests__/migrate-field-input-styling.test.mjs +0 -108
  249. package/assets/codemods/transforms/v0.7.0/__tests__/preserve-bottom-sheet-content-padding.test.mjs +0 -178
  250. package/assets/codemods/transforms/v0.7.0/__tests__/rename-empty-search-results-text.test.mjs +0 -202
  251. package/assets/codemods/transforms/v0.7.0/__tests__/validate-data-token-ownership.test.mjs +0 -168
  252. package/assets/codemods/transforms/v0.7.2/__tests__/migrate-list-edge-compensation-to-edge.test.mjs +0 -120
  253. package/assets/codemods/transforms/v0.7.5/__tests__/migrate-codeblock-tokenizer-to-language.test.mjs +0 -130
  254. package/authoring/_shared/errors.test.mjs +0 -49
  255. package/authoring/codemod/parse.test.mjs +0 -99
  256. package/authoring/config/debug-composition.test.mjs +0 -92
  257. package/authoring/config/parse.test.mjs +0 -121
  258. package/authoring/debug/parse.test.mjs +0 -187
  259. package/authoring/discover/parse.test.mjs +0 -158
  260. package/authoring/doctypes/doc-stability-types.test.mjs +0 -91
  261. package/authoring/doctypes/doctypes-new.test.mjs +0 -162
  262. package/authoring/doctypes/icon-definition/parse.test.mjs +0 -78
  263. package/authoring/doctypes/icon-set/icon-names.test.mjs +0 -26
  264. package/authoring/doctypes/icon-set/parse.test.mjs +0 -179
  265. package/authoring/doctypes/load-contract.test.mjs +0 -246
  266. package/authoring/doctypes/namespace/parse.test.mjs +0 -163
  267. package/authoring/doctypes/parse.test.mjs +0 -422
  268. package/authoring/doctypes/template/parse.test.mjs +0 -198
  269. package/authoring/gap-report/parse.test.mjs +0 -172
  270. package/authoring/integration/parse.test.mjs +0 -184
  271. package/authoring/shadcn/receipt.test.mjs +0 -187
  272. package/authoring/shadcn/source-variants.test.mjs +0 -120
  273. package/clients/cli/__tests__/cliManifest.test.ts +0 -37
  274. package/clients/cli/cli-command.test.mjs +0 -166
  275. package/clients/cli/cli-exit-codes.test.mjs +0 -163
  276. package/clients/cli/command-load-failure.test.mjs +0 -83
  277. package/clients/cli/command-result-coverage.test.mjs +0 -136
  278. package/clients/cli/commands/blog.test.mjs +0 -138
  279. package/clients/cli/commands/build-theme.adaptations.test.mjs +0 -773
  280. package/clients/cli/commands/build-theme.ascii-output.test.mjs +0 -198
  281. package/clients/cli/commands/build-theme.batch-report.test.mjs +0 -349
  282. package/clients/cli/commands/build-theme.color-scheme.test.mjs +0 -136
  283. package/clients/cli/commands/build-theme.data-tokens.test.mjs +0 -92
  284. package/clients/cli/commands/build-theme.flag-docs.test.mjs +0 -110
  285. package/clients/cli/commands/build-theme.font-warning.test.mjs +0 -170
  286. package/clients/cli/commands/build-theme.icons-specifier.test.mjs +0 -350
  287. package/clients/cli/commands/build-theme.import-path.test.mjs +0 -103
  288. package/clients/cli/commands/build-theme.multi.test.mjs +0 -148
  289. package/clients/cli/commands/build-theme.outside-project.test.mjs +0 -140
  290. package/clients/cli/commands/build-theme.path-safety.test.mjs +0 -398
  291. package/clients/cli/commands/build-theme.prose.test.mjs +0 -103
  292. package/clients/cli/commands/build-theme.registry.test.mjs +0 -160
  293. package/clients/cli/commands/build-theme.variants.test.mjs +0 -560
  294. package/clients/cli/commands/build-theme.watch.test.mjs +0 -320
  295. package/clients/cli/commands/build.error-codes.test.mjs +0 -50
  296. package/clients/cli/commands/build.exit-codes-doc.test.mjs +0 -54
  297. package/clients/cli/commands/build.playbook.test.mjs +0 -75
  298. package/clients/cli/commands/build.text-fields.test.mjs +0 -81
  299. package/clients/cli/commands/cli-postinstall.test.mjs +0 -90
  300. package/clients/cli/commands/component-batch.test.mjs +0 -341
  301. package/clients/cli/commands/component-ownership.test.mjs +0 -384
  302. package/clients/cli/commands/component-package.test.mjs +0 -169
  303. package/clients/cli/commands/component-replacement.text.test.mjs +0 -316
  304. package/clients/cli/commands/component-resolution.test.mjs +0 -204
  305. package/clients/cli/commands/component.test.mjs +0 -612
  306. package/clients/cli/commands/debug-result-summary.test.mjs +0 -214
  307. package/clients/cli/commands/detail-levels.test.mjs +0 -145
  308. package/clients/cli/commands/dialog-adaptive-template.test.mjs +0 -24
  309. package/clients/cli/commands/discover.broken-integration.test.mjs +0 -163
  310. package/clients/cli/commands/discover.components-flag.test.mjs +0 -97
  311. package/clients/cli/commands/discover.icon-sets.test.mjs +0 -133
  312. package/clients/cli/commands/discover.no-source.test.mjs +0 -490
  313. package/clients/cli/commands/discover.sources.test.mjs +0 -292
  314. package/clients/cli/commands/discover.text-projection.test.mjs +0 -103
  315. package/clients/cli/commands/docs.depth.test.mjs +0 -219
  316. package/clients/cli/commands/docs.test.mjs +0 -385
  317. package/clients/cli/commands/doctor-integration.package-json.test.mjs +0 -53
  318. package/clients/cli/commands/doctor-integration.test.mjs +0 -1483
  319. package/clients/cli/commands/doctor.test.mjs +0 -509
  320. package/clients/cli/commands/empty-argument.test.mjs +0 -16
  321. package/clients/cli/commands/external-showcase.test.mjs +0 -121
  322. package/clients/cli/commands/gap-report.test.mjs +0 -412
  323. package/clients/cli/commands/hook.text-projection.test.mjs +0 -45
  324. package/clients/cli/commands/icon-authoring.test.mjs +0 -2845
  325. package/clients/cli/commands/icon-options-wiring.test.mjs +0 -158
  326. package/clients/cli/commands/icon-sets-guide.test.mjs +0 -186
  327. package/clients/cli/commands/icon.test.mjs +0 -96
  328. package/clients/cli/commands/import-hint-correctness.test.mjs +0 -293
  329. package/clients/cli/commands/init.behavior.test.mjs +0 -434
  330. package/clients/cli/commands/init.flag-help.test.mjs +0 -151
  331. package/clients/cli/commands/init.next-steps.test.mjs +0 -41
  332. package/clients/cli/commands/integration-add.controls.test.mjs +0 -132
  333. package/clients/cli/commands/integration-authoring.test.mjs +0 -288
  334. package/clients/cli/commands/integration-check.test.mjs +0 -522
  335. package/clients/cli/commands/integration-real-world.test.mjs +0 -661
  336. package/clients/cli/commands/interactive-guard.test.mjs +0 -143
  337. package/clients/cli/commands/json-contract.test.mjs +0 -216
  338. package/clients/cli/commands/no-prompt-wording.test.mjs +0 -94
  339. package/clients/cli/commands/option-pair-refusals.test.mjs +0 -37
  340. package/clients/cli/commands/outside-project.test.mjs +0 -874
  341. package/clients/cli/commands/search.test.mjs +0 -514
  342. package/clients/cli/commands/setup-nudge.test.mjs +0 -280
  343. package/clients/cli/commands/silent-success-refusals.test.mjs +0 -15
  344. package/clients/cli/commands/swizzle.path-safety.test.mjs +0 -137
  345. package/clients/cli/commands/swizzle.routing.test.mjs +0 -342
  346. package/clients/cli/commands/template-cdn.behavior.test.mjs +0 -113
  347. package/clients/cli/commands/template.copy-receipt.test.mjs +0 -60
  348. package/clients/cli/commands/template.flag-help.test.mjs +0 -124
  349. package/clients/cli/commands/template.icons.test.mjs +0 -132
  350. package/clients/cli/commands/template.path-help.test.mjs +0 -40
  351. package/clients/cli/commands/template.path-safety.test.mjs +0 -82
  352. package/clients/cli/commands/template.show-media.test.mjs +0 -62
  353. package/clients/cli/commands/template.test.mjs +0 -62
  354. package/clients/cli/commands/text-json-parity.test.mjs +0 -850
  355. package/clients/cli/commands/theme-add-lifecycle.test.mjs +0 -228
  356. package/clients/cli/commands/theme-list.behavior.test.mjs +0 -51
  357. package/clients/cli/commands/theme-palette-generate.test.mjs +0 -154
  358. package/clients/cli/commands/theme-targets.behavior.test.mjs +0 -84
  359. package/clients/cli/commands/theme-template.behavior.test.mjs +0 -97
  360. package/clients/cli/commands/upgrade.ascii-output.test.mjs +0 -101
  361. package/clients/cli/commands/upgrade.config-ordering.test.mjs +0 -342
  362. package/clients/cli/commands/upgrade.file-protection.test.mjs +0 -404
  363. package/clients/cli/commands/upgrade.flag-help.test.mjs +0 -221
  364. package/clients/cli/commands/upgrade.hook-output.test.mjs +0 -89
  365. package/clients/cli/commands/upgrade.integration-policy.test.mjs +0 -581
  366. package/clients/cli/commands/upgrade.older-cli.test.mjs +0 -160
  367. package/clients/cli/commands/upgrade.outcomes.test.mjs +0 -350
  368. package/clients/cli/commands/upgrade.subfolder-path.test.mjs +0 -97
  369. package/clients/cli/commands/upgrade.test.mjs +0 -361
  370. package/clients/cli/commands/validate-nothing-exits-nonzero.test.mjs +0 -67
  371. package/clients/cli/commands/write-failure.test.mjs +0 -175
  372. package/clients/cli/e2e-smoke.test.mjs +0 -162
  373. package/clients/cli/error-envelope-code.test.mjs +0 -38
  374. package/clients/cli/formatters/index.test.mjs +0 -262
  375. package/clients/cli/latest-version-env.test.mjs +0 -50
  376. package/clients/cli/lib/cli-error.test.mjs +0 -206
  377. package/clients/cli/lib/component-format.test.mjs +0 -246
  378. package/clients/cli/lib/define-command.test.mjs +0 -103
  379. package/clients/cli/lib/doc-text-ascii.test.mjs +0 -85
  380. package/clients/cli/lib/exit-codes.test.mjs +0 -111
  381. package/clients/cli/lib/hook-format.test.mjs +0 -35
  382. package/clients/cli/lib/json-shim.test.mjs +0 -268
  383. package/clients/cli/lib/manifest.test.mjs +0 -346
  384. package/clients/cli/lib/parse-error-format.test.mjs +0 -81
  385. package/clients/cli/lib/resolve-theme.test.mjs +0 -543
  386. package/foundation/agent-docs/agent-docs.path-safety.test.mjs +0 -1550
  387. package/foundation/agent-docs/agent-docs.test.mjs +0 -1937
  388. package/foundation/agent-docs/app-theme-workflow.test.mjs +0 -16
  389. package/foundation/agent-docs/computer-agent-text.test.mjs +0 -699
  390. package/foundation/config/config-cache.test.mjs +0 -83
  391. package/foundation/config/config-writer.test.mjs +0 -84
  392. package/foundation/config/integration-debug.test.mjs +0 -218
  393. package/foundation/config/project-themes.test.mjs +0 -119
  394. package/foundation/config/project.test.mjs +0 -931
  395. package/foundation/config/theme-private-vars.test.mjs +0 -76
  396. package/foundation/config/theme-state.test.mjs +0 -182
  397. package/foundation/debug/debug-fields.test.mjs +0 -327
  398. package/foundation/debug/integration-handlers.test.mjs +0 -267
  399. package/foundation/debug/on-event.test.mjs +0 -643
  400. package/foundation/debug/privacy-contract.test.mjs +0 -195
  401. package/foundation/debug/redact.test.mjs +0 -534
  402. package/foundation/discovery/authoring-self-docs.test.mjs +0 -202
  403. package/foundation/discovery/authoring-surface.test.mjs +0 -392
  404. package/foundation/discovery/cli-self-docs.test.mjs +0 -396
  405. package/foundation/discovery/component-discovery.export-names.test.mjs +0 -832
  406. package/foundation/discovery/component-discovery.importpath.test.mjs +0 -59
  407. package/foundation/discovery/component-discovery.test.mjs +0 -336
  408. package/foundation/discovery/component-loader.test.mjs +0 -190
  409. package/foundation/discovery/component-replacement.test.mjs +0 -520
  410. package/foundation/discovery/componentDocOverlay.test.mjs +0 -159
  411. package/foundation/discovery/copied-passages.test.mjs +0 -124
  412. package/foundation/discovery/doc-consistency.test.mjs +0 -347
  413. package/foundation/discovery/doc-fluff.test.mjs +0 -142
  414. package/foundation/discovery/doc-types.test.mjs +0 -774
  415. package/foundation/discovery/docs-discovery.test.mjs +0 -707
  416. package/foundation/discovery/docs-section-key.test.mjs +0 -246
  417. package/foundation/discovery/hook-discovery.test.mjs +0 -216
  418. package/foundation/discovery/icon-set-checks.test.mjs +0 -1018
  419. package/foundation/discovery/icon-set-discovery.test.mjs +0 -320
  420. package/foundation/discovery/icon-set-writer.test.mjs +0 -26
  421. package/foundation/discovery/integration-doc-files.test.mjs +0 -275
  422. package/foundation/discovery/module-exports.test.mjs +0 -209
  423. package/foundation/discovery/package-tsconfig.test.mjs +0 -210
  424. package/foundation/discovery/prop-drift.test.mjs +0 -2337
  425. package/foundation/discovery/runner-commands.test.mjs +0 -131
  426. package/foundation/discovery/stray-pointers.test.mjs +0 -92
  427. package/foundation/discovery/template-adapter.fixture-refs.test.mjs +0 -284
  428. package/foundation/discovery/template-adapter.integration-isolation.test.mjs +0 -94
  429. package/foundation/discovery/template-adapter.test.mjs +0 -223
  430. package/foundation/discovery/template-conflict-release.test.mjs +0 -40
  431. package/foundation/discovery/template-icons.test.mjs +0 -560
  432. package/foundation/discovery/template-needs.test.mjs +0 -306
  433. package/foundation/discovery/theme-discovery.test.mjs +0 -775
  434. package/foundation/discovery/theme-imports.test.mjs +0 -173
  435. package/foundation/discovery/theming-targets.test.mjs +0 -328
  436. package/foundation/discovery/type-match.test.mjs +0 -169
  437. package/foundation/discovery/type-text.test.mjs +0 -196
  438. package/foundation/discovery/unresolved-references.test.mjs +0 -567
  439. package/foundation/doc-compiler/bundle.test.mjs +0 -266
  440. package/foundation/doc-compiler/doc-compiler.test.mjs +0 -714
  441. package/foundation/doc-compiler/doc-loads.test.mjs +0 -1762
  442. package/foundation/doc-compiler/doc-syntax.test.mjs +0 -383
  443. package/foundation/doc-compiler/inputs.test.mjs +0 -298
  444. package/foundation/doc-compiler/links.test.mjs +0 -285
  445. package/foundation/doc-compiler/lower-doc.test.mjs +0 -495
  446. package/foundation/doc-compiler/read.test.mjs +0 -380
  447. package/foundation/doc-compiler/split-topic-keywords.test.mjs +0 -74
  448. package/foundation/doc-compiler/tree.test.mjs +0 -691
  449. package/foundation/env/cli-command.test.mjs +0 -129
  450. package/foundation/env/node-version.test.mjs +0 -103
  451. package/foundation/env/package-manager.global.test.mjs +0 -66
  452. package/foundation/env/package-manager.test.mjs +0 -910
  453. package/foundation/env/search-path.test.mjs +0 -122
  454. package/foundation/env/semver.test.mjs +0 -111
  455. package/foundation/env/user-dirs.test.mjs +0 -72
  456. package/foundation/env/user-settings.test.mjs +0 -64
  457. package/foundation/fs/file-protection.test.mjs +0 -250
  458. package/foundation/fs/listing-cache.test.mjs +0 -88
  459. package/foundation/fs/module-loader.stdout.test.mjs +0 -333
  460. package/foundation/fs/module-loader.test.mjs +0 -410
  461. package/foundation/fs/path-safety.test.mjs +0 -222
  462. package/foundation/fs/paths.test.mjs +0 -725
  463. package/foundation/fs/publish-file-eperm-mutation.test.mjs +0 -64
  464. package/foundation/fs/publish-file-hardlink-unavailable.test.mjs +0 -142
  465. package/foundation/fs/publish-file.test.mjs +0 -136
  466. package/foundation/fs/read-record.test.mjs +0 -164
  467. package/foundation/identity/provider-identity.test.mjs +0 -254
  468. package/foundation/integrations/autolink.test.mjs +0 -430
  469. package/foundation/integrations/cli-peer-version.test.mjs +0 -354
  470. package/foundation/integrations/cli-requirement.test.mjs +0 -383
  471. package/foundation/integrations/computer-integrations.test.mjs +0 -292
  472. package/foundation/integrations/contribution-inventory.test.mjs +0 -420
  473. package/foundation/integrations/integration-warnings.test.mjs +0 -191
  474. package/foundation/integrations/integrations.test.mjs +0 -818
  475. package/foundation/integrations/manifest-writer.test.mjs +0 -271
  476. package/foundation/integrations/provider-conflicts.test.mjs +0 -125
  477. package/foundation/integrations/provider-ledger.test.mjs +0 -275
  478. package/foundation/integrations/provider-resolution.test.mjs +0 -369
  479. package/foundation/integrations/public-imports.test.mjs +0 -1818
  480. package/foundation/release/cache.test.mjs +0 -923
  481. package/foundation/release/choose.test.mjs +0 -427
  482. package/foundation/release/global-state.test.mjs +0 -381
  483. package/foundation/release/handoff.e2e.test.mjs +0 -278
  484. package/foundation/release/notices.test.mjs +0 -586
  485. package/foundation/release/project.test.mjs +0 -288
  486. package/foundation/render/render.test.mjs +0 -117
  487. package/foundation/response/error-codes.test.mjs +0 -297
  488. package/foundation/response/json-contract.test.mjs +0 -235
  489. package/foundation/response/json-serialize.test.mjs +0 -66
  490. package/foundation/response/response-types.doc.test.mjs +0 -278
  491. package/foundation/route/route.test.mjs +0 -153
  492. package/foundation/runtime/hosted-runtime.test.mjs +0 -403
  493. package/foundation/runtime/package-set.test.mjs +0 -432
  494. package/foundation/text/copyright-header.test.mjs +0 -58
  495. package/foundation/text/levenshtein.test.mjs +0 -53
  496. package/foundation/text/string-utils.test.mjs +0 -175
  497. package/foundation/text/suggest-order.test.mjs +0 -312
  498. package/foundation/xle/browser-imports.test.mjs +0 -74
  499. package/foundation/xle/expand.test.mjs +0 -54
  500. package/foundation/xle/print.test.mjs +0 -50
  501. package/foundation/xle/registry.test.mjs +0 -28
  502. package/foundation/xle/xle.test.mjs +0 -382
  503. package/host/door-conformance.test.mjs +0 -274
  504. package/host/index.test.mjs +0 -302
@@ -1,1483 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Command-level coverage for `astryx doctor integration` authoring checks.
5
- * @input Integration fixtures and the post-0.7 conflict projection.
6
- * @output Assertions for human and typed command responses.
7
- * @position CLI adapter coverage; 0.6.x API shape is verified separately.
8
- */
9
-
10
- import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
11
-
12
- vi.mock('../../../foundation/discovery/template-conflict-release.mjs', () => ({
13
- expandedTemplateConflictSchemaActive: () => true,
14
- }));
15
- import * as fs from 'node:fs';
16
- import * as os from 'node:os';
17
- import * as path from 'node:path';
18
- import {Command} from 'commander';
19
- import {discoverCoreTemplates} from '../../../foundation/discovery/template-adapter.mjs';
20
- import {discoverOwnedComponents} from '../../../foundation/discovery/component-discovery.mjs';
21
- import {discoverBuiltinTopics} from '../../../foundation/discovery/docs-discovery.mjs';
22
- import {
23
- findCoreDir,
24
- findProjectCoreDir,
25
- } from '../../../foundation/fs/paths.mjs';
26
- import {registerDoctor} from './doctor.mjs';
27
- import {expectRecordsCarry} from '../../../test-utils/text-projection.mjs';
28
-
29
- let tmpDir;
30
- let previousCwd;
31
- let previousExitCode;
32
- let logCalls;
33
-
34
- function createProgram() {
35
- const program = new Command();
36
- program.exitOverride();
37
- program.option('--json', 'Output as typed JSON');
38
- registerDoctor(program);
39
- return program;
40
- }
41
-
42
- function writeIntegration({
43
- id,
44
- name = 'Integration template',
45
- missingRoot = false,
46
- replacements,
47
- type = 'page',
48
- }) {
49
- fs.writeFileSync(
50
- path.join(tmpDir, 'package.json'),
51
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
52
- );
53
- fs.writeFileSync(
54
- path.join(tmpDir, 'astryx.integration.mjs'),
55
- `export default {templates: '${missingRoot ? './missing' : './templates'}'};\n`,
56
- );
57
- if (missingRoot || id == null) return;
58
- const stem = path.join(tmpDir, 'templates', id);
59
- fs.mkdirSync(path.dirname(stem), {recursive: true});
60
- fs.writeFileSync(
61
- `${stem}.doc.mjs`,
62
- `export default {type: '${type}', name: ${JSON.stringify(name)}, description: 'fixture'${replacements?.[id] == null ? '' : `, replaces: ${JSON.stringify(replacements[id])}`}};\n`,
63
- );
64
- fs.writeFileSync(
65
- `${stem}.tsx`,
66
- 'export default function Fixture() { return null; }\n',
67
- );
68
- }
69
-
70
- function writeComponentIntegration(componentName) {
71
- fs.writeFileSync(
72
- path.join(tmpDir, 'package.json'),
73
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
74
- );
75
- fs.writeFileSync(
76
- path.join(tmpDir, 'astryx.integration.mjs'),
77
- `export default {components: './components'};\n`,
78
- );
79
- fs.mkdirSync(path.join(tmpDir, 'components'), {recursive: true});
80
- fs.writeFileSync(
81
- path.join(tmpDir, 'components', `${componentName}.doc.mjs`),
82
- `export default {type: 'component', name: ${JSON.stringify(componentName)}, displayName: ${JSON.stringify(componentName)}, description: 'Fixture component.', props: []};\n`,
83
- );
84
- fs.writeFileSync(
85
- path.join(tmpDir, 'components', `${componentName}.tsx`),
86
- 'export default function Fixture() { return null; }\n',
87
- );
88
- }
89
-
90
- function writeDocIntegration({name, replaces, extendsTopic}) {
91
- fs.writeFileSync(
92
- path.join(tmpDir, 'package.json'),
93
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
94
- );
95
- fs.writeFileSync(
96
- path.join(tmpDir, 'astryx.integration.mjs'),
97
- `export default {docs: './docs'};\n`,
98
- );
99
- fs.mkdirSync(path.join(tmpDir, 'docs'), {recursive: true});
100
- const relationship =
101
- replaces != null
102
- ? `, replaces: ${JSON.stringify(replaces)}`
103
- : extendsTopic != null
104
- ? `, extends: ${JSON.stringify(extendsTopic)}`
105
- : '';
106
- fs.writeFileSync(
107
- path.join(tmpDir, 'docs', `${name}.doc.mjs`),
108
- `export default {type: 'generic', name: ${JSON.stringify(name)}, title: 'Fixture', description: 'Fixture topic.'${relationship}, sections: [{title: 'Overview', content: [{type: 'prose', text: 'Fixture.'}]}]};\n`,
109
- );
110
- }
111
-
112
- beforeEach(() => {
113
- previousCwd = process.cwd();
114
- previousExitCode = process.exitCode;
115
- process.exitCode = undefined;
116
- tmpDir = fs.mkdtempSync(
117
- path.join(previousCwd, '.astryx-doctor-integration-'),
118
- );
119
- logCalls = [];
120
- vi.spyOn(console, 'log').mockImplementation((...args) => {
121
- logCalls.push(args.join(' '));
122
- });
123
- vi.spyOn(console, 'error').mockImplementation(() => {});
124
- });
125
-
126
- afterEach(() => {
127
- process.chdir(previousCwd);
128
- process.exitCode = previousExitCode;
129
- fs.rmSync(tmpDir, {recursive: true, force: true});
130
- vi.restoreAllMocks();
131
- });
132
-
133
- describe('doctor integration — command', () => {
134
- it('prints the authoring subcommands when invoked without a leaf', async () => {
135
- const writes = [];
136
- vi.spyOn(process.stdout, 'write').mockImplementation(chunk => {
137
- writes.push(String(chunk));
138
- return true;
139
- });
140
-
141
- await createProgram().parseAsync([
142
- 'node',
143
- 'astryx',
144
- 'doctor',
145
- 'integration',
146
- ]);
147
-
148
- const output = writes.join('');
149
- expect(output).toContain('validate [package]');
150
- expect(output).toContain('templates [package]');
151
- expect(output).toContain('components [package]');
152
- expect(output).toContain('docs [package]');
153
- expect(process.exitCode).toBeUndefined();
154
- });
155
-
156
- it('explains the optional package argument in every leaf help', () => {
157
- const program = createProgram();
158
- const doctor = program.commands.find(
159
- command => command.name() === 'doctor',
160
- );
161
- const integration = doctor?.commands.find(
162
- command => command.name() === 'integration',
163
- );
164
-
165
- for (const leafName of ['validate', 'templates', 'components', 'docs']) {
166
- const leaf = integration?.commands.find(
167
- command => command.name() === leafName,
168
- );
169
- expect(leaf?.helpInformation(), leafName).toContain(
170
- 'Installed integration package name; omit to',
171
- );
172
- }
173
- });
174
-
175
- it('templates explains how to check an installed package when no local manifest exists', async () => {
176
- fs.writeFileSync(
177
- path.join(tmpDir, 'package.json'),
178
- JSON.stringify({name: 'plain'}),
179
- );
180
- process.chdir(tmpDir);
181
-
182
- await createProgram().parseAsync([
183
- 'node',
184
- 'astryx',
185
- 'doctor',
186
- 'integration',
187
- 'templates',
188
- ]);
189
-
190
- expect(logCalls.join('\n')).toContain(
191
- ' doctor integration templates <package>',
192
- );
193
- expect(process.exitCode).toBeUndefined();
194
- });
195
-
196
- it('validate keeps the integration.validate JSON contract', async () => {
197
- writeIntegration({id: 'integration-only'});
198
- process.chdir(tmpDir);
199
-
200
- await createProgram().parseAsync([
201
- 'node',
202
- 'astryx',
203
- '--json',
204
- 'doctor',
205
- 'integration',
206
- 'validate',
207
- ]);
208
-
209
- const parsed = JSON.parse(logCalls.join('\n'));
210
- expect(parsed.type).toBe('integration.validate');
211
- expect(parsed.data.name).toBe('@acme/widgets');
212
- expect(parsed.data.issues).toEqual([]);
213
- expect(process.exitCode).toBeUndefined();
214
- });
215
-
216
- it('validate prints the fix and the file an issue carries, and JSON carries the same issue', async () => {
217
- writeDocIntegration({name: 'deploying'});
218
- fs.writeFileSync(
219
- path.join(tmpDir, 'docs', 'ghost.doc.zh.mjs'),
220
- "export default {title: 'ghost'};\n",
221
- );
222
- process.chdir(tmpDir);
223
-
224
- await createProgram().parseAsync([
225
- 'node',
226
- 'astryx',
227
- 'doctor',
228
- 'integration',
229
- 'validate',
230
- ]);
231
- const output = logCalls.join('\n');
232
- expect(output).toContain('orphan_doc_overlay');
233
- expect(output).toMatch(
234
- /fix:\s+Delete docs\/ghost\.doc\.zh\.mjs, or add the topic it translates/,
235
- );
236
- expect(output).toMatch(/file:\s+docs\/ghost\.doc\.zh\.mjs/);
237
- expect(output).toMatch(/line:\s+1\b/);
238
-
239
- logCalls = [];
240
- await createProgram().parseAsync([
241
- 'node',
242
- 'astryx',
243
- '--json',
244
- 'doctor',
245
- 'integration',
246
- 'validate',
247
- ]);
248
- const parsed = JSON.parse(logCalls.join('\n'));
249
- expect(parsed.data.issues).toEqual([
250
- {
251
- code: 'orphan_doc_overlay',
252
- severity: 'warning',
253
- message: expect.stringContaining('docs/ghost.doc.zh.mjs'),
254
- fix: expect.stringContaining('Delete docs/ghost.doc.zh.mjs'),
255
- file: 'docs/ghost.doc.zh.mjs',
256
- line: 1,
257
- },
258
- ]);
259
- });
260
-
261
- it('validate warns about each doc field that does not match its authoring type, and still exits 0', async () => {
262
- writeIntegration({id: 'hero', name: 'Hero', type: 'block'});
263
- process.chdir(tmpDir);
264
-
265
- await createProgram().parseAsync([
266
- 'node',
267
- 'astryx',
268
- 'doctor',
269
- 'integration',
270
- 'validate',
271
- ]);
272
-
273
- const output = logCalls.join('\n');
274
- expect(output).toContain('[ok] No integration issues found.');
275
- expect(output).toMatch(
276
- /Checking 1 doc\(s\) against the authoring types \(TypeScript \d+\.\d+/,
277
- );
278
- expect(output).toContain('templates/hero.doc.mjs');
279
- expect(output).toMatch(/export:\s+default/);
280
- expect(output).toMatch(/type:\s+IntegrationTemplateDoc/);
281
- expect(output).toContain(
282
- 'Add `aspectRatio`: IntegrationBlockTemplateDoc requires it.',
283
- );
284
- expect(output).toContain(
285
- 'Add `displayName`: IntegrationBlockTemplateDoc requires it.',
286
- );
287
- expect(output).toContain(
288
- '2 doc field(s) in 1 file(s) do not match the authoring types.',
289
- );
290
- expect(process.exitCode).toBeUndefined();
291
- });
292
-
293
- it('validate type-checks each icon set descriptor against IconSetDoc', async () => {
294
- fs.writeFileSync(
295
- path.join(tmpDir, 'package.json'),
296
- JSON.stringify({name: '@acme/icons', version: '1.0.0'}),
297
- );
298
- fs.writeFileSync(
299
- path.join(tmpDir, 'astryx.integration.mjs'),
300
- "export default {experimental: {iconSets: './icon-sets'}};\n",
301
- );
302
- const dir = path.join(tmpDir, 'icon-sets', 'outline');
303
- fs.mkdirSync(dir, {recursive: true});
304
- fs.writeFileSync(
305
- path.join(dir, 'outline.doc.mjs'),
306
- "export default {type: 'icon-set', name: 'outline', displayName: 'Outline', description: 'D', maintained: true, license: 'MIT'};\n",
307
- );
308
- fs.writeFileSync(
309
- path.join(dir, 'outline.icons.json'),
310
- JSON.stringify({schemaVersion: 1, module: '@acme/icons', icons: []}),
311
- );
312
- process.chdir(tmpDir);
313
-
314
- await createProgram().parseAsync([
315
- 'node',
316
- 'astryx',
317
- 'doctor',
318
- 'integration',
319
- 'validate',
320
- '--json',
321
- ]);
322
-
323
- const result = JSON.parse(logCalls.join('\n'));
324
- expect(result.data.docTypes).toMatchObject({
325
- status: 'checked',
326
- docs: 1,
327
- findings: [],
328
- });
329
- });
330
-
331
- it('validate says there is no doc to type-check, rather than asking for TypeScript', async () => {
332
- const outside = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-no-docs-'));
333
- try {
334
- fs.writeFileSync(
335
- path.join(outside, 'package.json'),
336
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
337
- );
338
- fs.writeFileSync(
339
- path.join(outside, 'astryx.integration.mjs'),
340
- "export default {components: './components'};\n",
341
- );
342
- fs.mkdirSync(path.join(outside, 'components'));
343
- fs.writeFileSync(
344
- path.join(outside, 'components', 'Widget.tsx'),
345
- 'export function Widget() { return null; }\n',
346
- );
347
- process.chdir(outside);
348
-
349
- await createProgram().parseAsync([
350
- 'node',
351
- 'astryx',
352
- 'doctor',
353
- 'integration',
354
- 'validate',
355
- ]);
356
-
357
- const output = logCalls.join('\n');
358
- expect(output).toContain('[info] No doc files to type-check.');
359
- expect(output).not.toContain('Docs not type-checked');
360
- expect(output).not.toContain('against the authoring types');
361
- } finally {
362
- process.chdir(previousCwd);
363
- fs.rmSync(outside, {recursive: true, force: true});
364
- }
365
- });
366
-
367
- it('validate says the docs matched even when another check failed', async () => {
368
- writeIntegration({id: 'hero', missingRoot: true});
369
- fs.writeFileSync(
370
- path.join(tmpDir, 'astryx.integration.mjs'),
371
- "export default {templates: './missing', components: './components'};\n",
372
- );
373
- fs.mkdirSync(path.join(tmpDir, 'components'), {recursive: true});
374
- fs.writeFileSync(
375
- path.join(tmpDir, 'components', 'AcmeBadge.doc.mjs'),
376
- "export default {type: 'component', name: 'AcmeBadge', displayName: 'Badge', usage: {description: 'A badge.'}, props: []};\n",
377
- );
378
- fs.writeFileSync(
379
- path.join(tmpDir, 'components', 'AcmeBadge.tsx'),
380
- 'export function AcmeBadge() { return null; }\n',
381
- );
382
- process.chdir(tmpDir);
383
-
384
- await createProgram().parseAsync([
385
- 'node',
386
- 'astryx',
387
- 'doctor',
388
- 'integration',
389
- 'validate',
390
- ]);
391
-
392
- const output = logCalls.join('\n');
393
- expect(process.exitCode).toBe(1);
394
- expect(output).toContain(
395
- '[info] No doc field differs from its authoring type (1 checked).',
396
- );
397
- expect(output).not.toContain('[ok] Every doc');
398
- });
399
-
400
- it('validate prints every field of the doc type check that JSON carries', async () => {
401
- writeIntegration({id: 'hero', name: 'Hero', type: 'block'});
402
- fs.writeFileSync(
403
- path.join(tmpDir, 'astryx.integration.mjs'),
404
- "export default {templates: './templates', components: './components'};\n",
405
- );
406
- fs.mkdirSync(path.join(tmpDir, 'components'), {recursive: true});
407
- fs.writeFileSync(
408
- path.join(tmpDir, 'components', 'AcmeBadge.doc.mjs'),
409
- "export default {type: 'component', name: 'AcmeBadge', displayName: 5, usage: {description: 'A badge.'}, props: [], keyword: ['x']};\n",
410
- );
411
- fs.writeFileSync(
412
- path.join(tmpDir, 'components', 'AcmeBadge.tsx'),
413
- 'export function AcmeBadge() { return null; }\n',
414
- );
415
- fs.writeFileSync(
416
- path.join(tmpDir, 'components', 'shared.mjs'),
417
- `export default {type: 'component', name: 'AcmeAgain', displayName: 'Again', usage: {description: 'x'}, props: []};\n`,
418
- );
419
- fs.writeFileSync(
420
- path.join(tmpDir, 'components', 'AcmeAgain.doc.mjs'),
421
- "export {default} from './shared.mjs';\n",
422
- );
423
- fs.writeFileSync(
424
- path.join(tmpDir, 'components', 'AcmeAgain.tsx'),
425
- 'export function AcmeAgain() { return null; }\n',
426
- );
427
- process.chdir(tmpDir);
428
- const run = async (/** @type {string[]} */ flags) => {
429
- logCalls.length = 0;
430
- await createProgram().parseAsync([
431
- 'node',
432
- 'astryx',
433
- ...flags,
434
- 'doctor',
435
- 'integration',
436
- 'validate',
437
- ]);
438
- return logCalls.join('\n');
439
- };
440
-
441
- const report = JSON.parse(await run(['--json'])).data.docTypes;
442
- const output = await run([]);
443
-
444
- expect([...new Set(report.findings.map(f => f.problem))].sort()).toEqual([
445
- 'missing_field',
446
- 'unknown_field',
447
- 'wrong_type',
448
- ]);
449
- expect(report.unchecked).toHaveLength(1);
450
- expectRecordsCarry(output, report.findings, ['doc', 'field', 'problem']);
451
- expectRecordsCarry(output, report.unchecked, ['doc', 'reason']);
452
- expect(output).toContain(
453
- `Checking ${report.docs} doc(s) against the authoring types (TypeScript ${report.typescript})`,
454
- );
455
- });
456
-
457
- it('validate type-checks each doc component discovery serves, in __fixtures__, in a dot-folder or behind a symlink', async () => {
458
- fs.writeFileSync(
459
- path.join(tmpDir, 'package.json'),
460
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
461
- );
462
- fs.writeFileSync(
463
- path.join(tmpDir, 'astryx.integration.mjs'),
464
- `export default {components: './components'};\n`,
465
- );
466
- for (const [rel, name] of [
467
- ['components/__fixtures__/AcmeFixture.doc.mjs', 'AcmeFixture'],
468
- ['components/.drafts/AcmeDraft.doc.mjs', 'AcmeDraft'],
469
- ['shared/AcmeLinked.doc.mjs', 'AcmeLinked'],
470
- ]) {
471
- fs.mkdirSync(path.dirname(path.join(tmpDir, rel)), {recursive: true});
472
- fs.writeFileSync(
473
- path.join(tmpDir, rel),
474
- `export default {type: 'component', name: '${name}', displayName: '${name}', usage: {description: 'Fixture.'}, props: [], keyword: []};\n`,
475
- );
476
- }
477
- fs.symlinkSync(
478
- path.join(tmpDir, 'shared', 'AcmeLinked.doc.mjs'),
479
- path.join(tmpDir, 'components', 'AcmeLinked.doc.mjs'),
480
- );
481
- process.chdir(tmpDir);
482
-
483
- await createProgram().parseAsync([
484
- 'node',
485
- 'astryx',
486
- '--json',
487
- 'doctor',
488
- 'integration',
489
- 'validate',
490
- ]);
491
-
492
- const {docTypes} = JSON.parse(logCalls.join('\n')).data;
493
- expect(docTypes).toMatchObject({status: 'checked', docs: 3, unchecked: []});
494
- expect(
495
- docTypes.findings.map(
496
- (/** @type {any} */ f) => `${f.doc} ${f.field} ${f.problem}`,
497
- ),
498
- ).toEqual([
499
- 'components/__fixtures__/AcmeFixture.doc.mjs keyword unknown_field',
500
- 'components/.drafts/AcmeDraft.doc.mjs keyword unknown_field',
501
- 'components/AcmeLinked.doc.mjs keyword unknown_field',
502
- ]);
503
- });
504
-
505
- it('validate type-checks a hidden doc and a second doc for one name, and counts a test fixture', async () => {
506
- fs.writeFileSync(
507
- path.join(tmpDir, 'package.json'),
508
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
509
- );
510
- fs.writeFileSync(
511
- path.join(tmpDir, 'astryx.integration.mjs'),
512
- `export default {components: './components'};\n`,
513
- );
514
- for (const [rel, name, extra] of [
515
- ['components/AcmeBadge.doc.mjs', 'AcmeBadge', ''],
516
- ['components/again/AcmeBadge.doc.mjs', 'AcmeBadge', ', keyword: []'],
517
- [
518
- 'components/AcmeHidden.doc.mjs',
519
- 'AcmeHidden',
520
- ', hidden: true, keyword: []',
521
- ],
522
- [
523
- 'components/__tests__/AcmeTested.doc.mjs',
524
- 'AcmeTested',
525
- ', keyword: []',
526
- ],
527
- ]) {
528
- fs.mkdirSync(path.dirname(path.join(tmpDir, rel)), {recursive: true});
529
- fs.writeFileSync(
530
- path.join(tmpDir, rel),
531
- `export default {type: 'component', name: '${name}', displayName: '${name}', usage: {description: 'Fixture.'}, props: []${extra}};\n`,
532
- );
533
- fs.writeFileSync(
534
- path.join(tmpDir, rel.replace('.doc.mjs', '.tsx')),
535
- 'export default function Fixture() { return null; }\n',
536
- );
537
- }
538
- process.chdir(tmpDir);
539
- const run = async (/** @type {string[]} */ flags) => {
540
- logCalls.length = 0;
541
- await createProgram().parseAsync([
542
- 'node',
543
- 'astryx',
544
- ...flags,
545
- 'doctor',
546
- 'integration',
547
- 'validate',
548
- ]);
549
- return logCalls.join('\n');
550
- };
551
-
552
- const {docTypes} = JSON.parse(await run(['--json'])).data;
553
- const output = await run([]);
554
-
555
- expect(docTypes).toMatchObject({docs: 3, fixtures: 1, unchecked: []});
556
- expect(
557
- docTypes.findings.map(
558
- (/** @type {any} */ f) => `${f.doc} ${f.field} ${f.problem}`,
559
- ),
560
- ).toEqual([
561
- 'components/AcmeHidden.doc.mjs keyword unknown_field',
562
- 'components/again/AcmeBadge.doc.mjs keyword unknown_field',
563
- ]);
564
- expect(output).toContain('[info] 1 test fixture doc(s) not checked.');
565
- expect(output).not.toContain('[ok] Every doc matches');
566
- });
567
-
568
- it('validate keeps the fixture count when test fixtures are the only docs', async () => {
569
- fs.writeFileSync(
570
- path.join(tmpDir, 'package.json'),
571
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
572
- );
573
- fs.writeFileSync(
574
- path.join(tmpDir, 'astryx.integration.mjs'),
575
- `export default {components: './components'};\n`,
576
- );
577
- const rel = 'components/__tests__/AcmeTested.doc.mjs';
578
- fs.mkdirSync(path.dirname(path.join(tmpDir, rel)), {recursive: true});
579
- fs.writeFileSync(
580
- path.join(tmpDir, rel),
581
- `export default {type: 'component', name: 'AcmeTested', displayName: 'AcmeTested', usage: {description: 'Fixture.'}, props: []};\n`,
582
- );
583
- process.chdir(tmpDir);
584
- const run = async (/** @type {string[]} */ flags) => {
585
- logCalls.length = 0;
586
- await createProgram().parseAsync([
587
- 'node',
588
- 'astryx',
589
- ...flags,
590
- 'doctor',
591
- 'integration',
592
- 'validate',
593
- ]);
594
- return logCalls.join('\n');
595
- };
596
-
597
- const {docTypes} = JSON.parse(await run(['--json'])).data;
598
- const output = await run([]);
599
-
600
- expect(docTypes).toMatchObject({docs: 0, fixtures: 1, findings: []});
601
- expect(output).toContain('[info] No doc files to type-check.');
602
- expect(output).toContain('[info] 1 test fixture doc(s) not checked.');
603
- });
604
-
605
- it("validate keeps main's issue for a root it cannot read, and lists a root with a folder it cannot read", async () => {
606
- fs.writeFileSync(
607
- path.join(tmpDir, 'package.json'),
608
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
609
- );
610
- fs.writeFileSync(
611
- path.join(tmpDir, 'astryx.integration.mjs'),
612
- `export default {components: './components', docs: './docs'};\n`,
613
- );
614
- fs.mkdirSync(path.join(tmpDir, 'components', 'locked'), {recursive: true});
615
- fs.mkdirSync(path.join(tmpDir, 'docs'));
616
- const locked = [
617
- path.join(tmpDir, 'components', 'locked'),
618
- path.join(tmpDir, 'docs'),
619
- ];
620
- for (const dir of locked) fs.chmodSync(dir, 0o000);
621
- process.chdir(tmpDir);
622
- try {
623
- await createProgram().parseAsync([
624
- 'node',
625
- 'astryx',
626
- '--json',
627
- 'doctor',
628
- 'integration',
629
- 'validate',
630
- ]);
631
- } finally {
632
- for (const dir of locked) fs.chmodSync(dir, 0o755);
633
- }
634
-
635
- const {data} = JSON.parse(logCalls.join('\n'));
636
- expect(data.issues.map((/** @type {any} */ i) => i.code).sort()).toEqual([
637
- 'invalid_component',
638
- 'unreadable_root',
639
- ]);
640
- expect(data.docTypes.unchecked).toEqual([
641
- {
642
- doc: 'components',
643
- reason: expect.stringMatching(
644
- /^the components root does not load, so no doc in it was checked: .*EACCES/,
645
- ),
646
- },
647
- ]);
648
- });
649
-
650
- it('validate reports the doc type check as additive JSON', async () => {
651
- writeIntegration({id: 'hero', name: 'Hero', type: 'block'});
652
- process.chdir(tmpDir);
653
-
654
- await createProgram().parseAsync([
655
- 'node',
656
- 'astryx',
657
- '--json',
658
- 'doctor',
659
- 'integration',
660
- 'validate',
661
- ]);
662
-
663
- const parsed = JSON.parse(logCalls.join('\n'));
664
- expect(parsed.data.issues).toEqual([]);
665
- expect(parsed.data.docTypes).toMatchObject({
666
- status: 'checked',
667
- docs: 1,
668
- unchecked: [],
669
- });
670
- expect(parsed.data.docTypes.typescript).toMatch(/^\d+\.\d+/);
671
- expect(parsed.data.docTypes.findings).toEqual([
672
- expect.objectContaining({
673
- doc: 'templates/hero.doc.mjs',
674
- export: 'default',
675
- type: 'IntegrationTemplateDoc',
676
- field: 'aspectRatio',
677
- problem: 'missing_field',
678
- severity: 'warning',
679
- }),
680
- expect.objectContaining({field: 'displayName', problem: 'missing_field'}),
681
- ]);
682
- expect(process.exitCode).toBeUndefined();
683
- });
684
-
685
- it('validate says, in one visible line, that docs were not type-checked when the project has no TypeScript', async () => {
686
- const outside = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-no-ts-'));
687
- const inside = tmpDir;
688
- try {
689
- // The fixture helpers write to tmpDir; point it outside the repository,
690
- // where no TypeScript resolves, and restore it for afterEach.
691
- tmpDir = outside;
692
- writeIntegration({id: 'hero', name: 'Hero', type: 'block'});
693
- tmpDir = inside;
694
- process.chdir(outside);
695
-
696
- await createProgram().parseAsync([
697
- 'node',
698
- 'astryx',
699
- 'doctor',
700
- 'integration',
701
- 'validate',
702
- ]);
703
-
704
- const output = logCalls.join('\n');
705
- expect(output).toContain(
706
- '[skip] Docs not type-checked: TypeScript is not installed in this project',
707
- );
708
- expect(output).not.toMatch(
709
- /Checking \d+ doc\(s\) against the authoring types/,
710
- );
711
- expect(process.exitCode).toBeUndefined();
712
- } finally {
713
- process.chdir(previousCwd);
714
- fs.rmSync(outside, {recursive: true, force: true});
715
- }
716
- });
717
-
718
- it('validate prints the public-import findings as listed only, and still exits 0', async () => {
719
- writeIntegration({id: 'hero', name: 'Hero', type: 'block'});
720
- fs.writeFileSync(
721
- path.join(tmpDir, 'package.json'),
722
- JSON.stringify({name: '@acme/widgets', version: '1.2.3', exports: {}}),
723
- );
724
- process.chdir(tmpDir);
725
-
726
- await createProgram().parseAsync([
727
- 'node',
728
- 'astryx',
729
- 'doctor',
730
- 'integration',
731
- 'validate',
732
- ]);
733
-
734
- const output = logCalls.join('\n');
735
- expect(output).toContain('note (template_import_not_exported):');
736
- expect(output).toContain('Fix:');
737
- expect(output).toContain('[ok] No integration issues found.');
738
- expect(process.exitCode).toBeUndefined();
739
- });
740
-
741
- it('validate lists, as not checked, the imports it cannot judge when package.json has no name', async () => {
742
- writeIntegration({id: 'hero', name: 'Hero', type: 'block'});
743
- fs.writeFileSync(
744
- path.join(tmpDir, 'package.json'),
745
- JSON.stringify({version: '1.2.3'}),
746
- );
747
- process.chdir(tmpDir);
748
-
749
- await createProgram().parseAsync([
750
- 'node',
751
- 'astryx',
752
- 'doctor',
753
- 'integration',
754
- 'validate',
755
- ]);
756
-
757
- const output = logCalls.join('\n');
758
- expect(output).toMatch(/\[info\] Imports not checked: 1:/);
759
- expect(output).toContain('package.json has no "name"');
760
- expect(process.exitCode).toBeUndefined();
761
- });
762
-
763
- it('templates warns on a Core id and writes the exact --package command', async () => {
764
- const [core] = await discoverCoreTemplates();
765
- expect(core).toBeDefined();
766
- writeIntegration({id: core.dirName});
767
- process.chdir(tmpDir);
768
-
769
- await createProgram().parseAsync([
770
- 'node',
771
- 'astryx',
772
- 'doctor',
773
- 'integration',
774
- 'templates',
775
- ]);
776
-
777
- const output = logCalls.join('\n');
778
- expect(output).toContain('[warn]');
779
- expect(output).toContain(core.dirName);
780
- expect(output).toContain('Consider renaming');
781
- expect(output).toContain(`--package @acme/widgets`);
782
- expect(process.exitCode).toBeUndefined();
783
- });
784
-
785
- it('templates exposes conflicts as structured JSON warnings', async () => {
786
- const [core] = await discoverCoreTemplates();
787
- expect(core).toBeDefined();
788
- writeIntegration({id: core.dirName});
789
- process.chdir(tmpDir);
790
-
791
- await createProgram().parseAsync([
792
- 'node',
793
- 'astryx',
794
- '--json',
795
- 'doctor',
796
- 'integration',
797
- 'templates',
798
- ]);
799
-
800
- const parsed = JSON.parse(logCalls.join('\n'));
801
- expect(parsed.type).toBe('integration.template-conflicts');
802
- expect(parsed.data.conflicts[0]).toMatchObject({
803
- id: core.dirName,
804
- severity: 'warning',
805
- integrationPackage: '@acme/widgets',
806
- });
807
- expect(parsed.data.conflicts[0].command).toContain(
808
- `--package @acme/widgets`,
809
- );
810
- expect(process.exitCode).toBeUndefined();
811
- });
812
-
813
- it('templates reports an intentional replacement and the Core-original command', async () => {
814
- const core = (await discoverCoreTemplates()).find(
815
- template => template.type === 'page',
816
- );
817
- expect(core).toBeDefined();
818
- writeIntegration({
819
- id: 'acme-app-shell',
820
- type: core.type,
821
- replacements: {'acme-app-shell': core.dirName},
822
- });
823
- process.chdir(tmpDir);
824
-
825
- await createProgram().parseAsync([
826
- 'node',
827
- 'astryx',
828
- '--json',
829
- 'doctor',
830
- 'integration',
831
- 'templates',
832
- ]);
833
-
834
- const parsed = JSON.parse(logCalls.join('\n'));
835
- expect(parsed.data.issues).toEqual([]);
836
- expect(parsed.data.conflicts).toEqual([
837
- expect.objectContaining({
838
- id: 'acme-app-shell',
839
- relationship: 'replaces',
840
- replaces: core.dirName,
841
- severity: 'info',
842
- }),
843
- ]);
844
- expect(parsed.data.conflicts[0].command).toContain(
845
- `--package @astryxdesign/core`,
846
- );
847
- expect(process.exitCode).toBeUndefined();
848
- });
849
-
850
- it('templates exits 1 for a missing replacement target', async () => {
851
- writeIntegration({
852
- id: 'acme-app-shell',
853
- replacements: {'acme-app-shell': 'missing-core-shell'},
854
- });
855
- process.chdir(tmpDir);
856
-
857
- await createProgram().parseAsync([
858
- 'node',
859
- 'astryx',
860
- '--json',
861
- 'doctor',
862
- 'integration',
863
- 'templates',
864
- ]);
865
-
866
- const parsed = JSON.parse(logCalls.join('\n'));
867
- expect(parsed.data.issues).toEqual(
868
- expect.arrayContaining([
869
- expect.objectContaining({
870
- code: 'missing_template_replacement_target',
871
- severity: 'error',
872
- }),
873
- ]),
874
- );
875
- expect(process.exitCode).toBe(1);
876
- });
877
-
878
- it('templates exits 1 when structural errors prevent a trustworthy check', async () => {
879
- writeIntegration({missingRoot: true});
880
- process.chdir(tmpDir);
881
-
882
- await createProgram().parseAsync([
883
- 'node',
884
- 'astryx',
885
- '--json',
886
- 'doctor',
887
- 'integration',
888
- 'templates',
889
- ]);
890
-
891
- const parsed = JSON.parse(logCalls.join('\n'));
892
- expect(parsed.data.conflicts).toEqual([]);
893
- expect(
894
- parsed.data.issues.some(issue => issue.code === 'missing_root'),
895
- ).toBe(true);
896
- expect(process.exitCode).toBe(1);
897
- });
898
-
899
- it('components exits 1 when Core is missing, with no [ok] after the failure', async () => {
900
- // Outside the repo, so nothing above the package resolves Core.
901
- const outside = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-no-core-'));
902
- const previousTmp = tmpDir;
903
- tmpDir = outside;
904
- try {
905
- writeComponentIntegration('AcmeCarousel');
906
- // Doctor judges the project's own Core, never the one a copy carries.
907
- expect(findProjectCoreDir(outside)).toBeNull();
908
- process.chdir(outside);
909
-
910
- await createProgram().parseAsync([
911
- 'node',
912
- 'astryx',
913
- 'doctor',
914
- 'integration',
915
- 'components',
916
- ]);
917
-
918
- const printed = logCalls.join('\n');
919
- expect(printed).toContain('core_not_found');
920
- expect(printed).not.toContain('[ok]');
921
- // No TypeScript out here either: the props comparison says it skipped.
922
- expect(printed).toContain(
923
- '[skip] Props not compared: TypeScript is not installed in this project',
924
- );
925
- expect(process.exitCode).toBe(1);
926
- } finally {
927
- tmpDir = previousTmp;
928
- process.chdir(previousCwd);
929
- fs.rmSync(outside, {recursive: true, force: true});
930
- }
931
- });
932
-
933
- it('components warns with the exact package-qualified command', async () => {
934
- const coreDir = findCoreDir(tmpDir);
935
- expect(coreDir).not.toBeNull();
936
- const [core] = discoverOwnedComponents(coreDir, []);
937
- writeComponentIntegration(core.name);
938
- process.chdir(tmpDir);
939
-
940
- await createProgram().parseAsync([
941
- 'node',
942
- 'astryx',
943
- 'doctor',
944
- 'integration',
945
- 'components',
946
- ]);
947
-
948
- const output = logCalls.join('\n');
949
- expect(output).toContain('[warn]');
950
- expect(output).toContain(core.name);
951
- expect(output).toContain(`component ${core.name} --package @acme/widgets`);
952
- expect(process.exitCode).toBeUndefined();
953
- });
954
-
955
- it('components prints each documented prop that differs from the code, and still exits 0', async () => {
956
- writeComponentIntegration('AcmeBadge');
957
- fs.writeFileSync(
958
- path.join(tmpDir, 'components', 'AcmeBadge.doc.mjs'),
959
- `export default {type: 'component', name: 'AcmeBadge', displayName: 'AcmeBadge', description: 'Fixture component.', props: [{name: 'label', type: 'string', description: 'Text.'}]};\n`,
960
- );
961
- fs.writeFileSync(
962
- path.join(tmpDir, 'components', 'AcmeBadge.tsx'),
963
- 'export function AcmeBadge(props: {label: string}) { return null; }\n',
964
- );
965
- process.chdir(tmpDir);
966
-
967
- await createProgram().parseAsync([
968
- 'node',
969
- 'astryx',
970
- 'doctor',
971
- 'integration',
972
- 'components',
973
- ]);
974
-
975
- const output = logCalls.join('\n');
976
- expect(output).toMatch(/^kind:\s+required_mismatch$/m);
977
- expect(output).toContain(
978
- '"label" is required in the code, but the doc does not mark it required.',
979
- );
980
- expect(output).toContain(
981
- '1 prop(s) differ between the docs and the code in 1 of 1 component(s) compared (TypeScript',
982
- );
983
- expect(output).not.toContain('[ok] Documented prop');
984
- expect(process.exitCode).toBeUndefined();
985
- });
986
-
987
- it('components compares a hidden doc and a family entry with no record, so their drift is never an [ok]', async () => {
988
- writeComponentIntegration('AcmeMenu');
989
- const dir = path.join(tmpDir, 'components');
990
- fs.writeFileSync(
991
- path.join(dir, 'AcmeMenu.doc.mjs'),
992
- `export default {type: 'component', name: 'AcmeMenuRoot', displayName: 'AcmeMenuRoot', description: 'Fixture component.', hiddenComponents: ['AcmeMenuItem'], components: [{name: 'AcmeMenuItem', displayName: 'AcmeMenuItem', description: 'Fixture item.', props: [{name: 'label', type: 'string', description: 'Text.'}]}]};\n`,
993
- );
994
- fs.writeFileSync(
995
- path.join(dir, 'AcmeMenu.tsx'),
996
- 'export function AcmeMenuRoot() { return null; }\nexport function AcmeMenuItem(props: {value?: string}) { return null; }\n',
997
- );
998
- fs.writeFileSync(
999
- path.join(dir, 'AcmeSecret.doc.mjs'),
1000
- `export default {type: 'component', name: 'AcmeSecret', displayName: 'AcmeSecret', description: 'Fixture component.', hidden: true, props: [{name: 'tone', type: 'string', description: 'Tone.'}]};\n`,
1001
- );
1002
- fs.writeFileSync(
1003
- path.join(dir, 'AcmeSecret.tsx'),
1004
- 'export function AcmeSecret(props: {size?: number}) { return null; }\n',
1005
- );
1006
- process.chdir(tmpDir);
1007
- const run = async (/** @type {string[]} */ flags) => {
1008
- logCalls.length = 0;
1009
- await createProgram().parseAsync([
1010
- 'node',
1011
- 'astryx',
1012
- ...flags,
1013
- 'doctor',
1014
- 'integration',
1015
- 'components',
1016
- ]);
1017
- return logCalls.join('\n');
1018
- };
1019
-
1020
- const report = JSON.parse(await run(['--json'])).data.propDrift;
1021
- const output = await run([]);
1022
-
1023
- expect(
1024
- report.findings.map(f => `${f.component}.${f.prop} ${f.kind}`),
1025
- ).toEqual([
1026
- 'AcmeMenuItem.label not_in_code',
1027
- 'AcmeMenuItem.value not_in_doc',
1028
- 'AcmeSecret.size not_in_doc',
1029
- 'AcmeSecret.tone not_in_code',
1030
- ]);
1031
- expect(output).not.toContain('[ok] Documented prop');
1032
- expect(process.exitCode).toBeUndefined();
1033
- });
1034
-
1035
- it('components lists props a mapped type builds from keys it cannot trace, and says the [ok] leaves them out', async () => {
1036
- writeComponentIntegration('AcmeChip');
1037
- const dir = path.join(tmpDir, 'components');
1038
- fs.writeFileSync(
1039
- path.join(dir, 'AcmeChip.doc.mjs'),
1040
- `export default {type: 'component', name: 'AcmeChip', displayName: 'AcmeChip', description: 'Fixture.', props: [{name: 'label', type: 'string', description: 'Text.'}]};\n`,
1041
- );
1042
- fs.writeFileSync(
1043
- path.join(dir, 'AcmeChip.tsx'),
1044
- "export function AcmeChip(props: {label?: string} & {[K in `on${Capitalize<'open'>}`]?: () => void}) { return null; }\n",
1045
- );
1046
- process.chdir(tmpDir);
1047
- const run = async (/** @type {string[]} */ flags) => {
1048
- logCalls.length = 0;
1049
- await createProgram().parseAsync([
1050
- 'node',
1051
- 'astryx',
1052
- ...flags,
1053
- 'doctor',
1054
- 'integration',
1055
- 'components',
1056
- ]);
1057
- return logCalls.join('\n');
1058
- };
1059
-
1060
- const {propsNotChecked} = JSON.parse(await run(['--json'])).data.propDrift;
1061
- const output = await run([]);
1062
-
1063
- expect(propsNotChecked).toEqual([
1064
- expect.objectContaining({component: 'AcmeChip', props: ['onOpen']}),
1065
- ]);
1066
- expect(output).toContain(
1067
- '[info] Props not checked for a doc entry in 1 component(s):',
1068
- );
1069
- expect(output).toContain(
1070
- 'in 1 component(s), apart from the props not checked (TypeScript',
1071
- );
1072
- });
1073
-
1074
- it('components compares the entries of a family doc whose own source is missing', async () => {
1075
- writeComponentIntegration('AcmeTabs');
1076
- const dir = path.join(tmpDir, 'components');
1077
- const entry = (/** @type {string} */ name, /** @type {string} */ prop) =>
1078
- `{name: '${name}', displayName: '${name}', description: 'Fixture.', props: [{name: '${prop}', type: 'string', description: 'Text.'}]}`;
1079
- fs.writeFileSync(
1080
- path.join(dir, 'AcmeTabs.doc.mjs'),
1081
- `export default {type: 'component', name: 'AcmeTabs', displayName: 'AcmeTabs', description: 'Fixture.', props: [], hiddenComponents: ['AcmeTabsPanel'], components: [${entry('AcmeTabsItem', 'label')}, ${entry('AcmeTabsPanel', 'ghost')}]};\n`,
1082
- );
1083
- fs.rmSync(path.join(dir, 'AcmeTabs.tsx'), {force: true});
1084
- // The package's entry exports the members, so discovery records the
1085
- // listed one, though the family's own file is missing.
1086
- for (const name of ['AcmeTabsItem', 'AcmeTabsPanel']) {
1087
- fs.writeFileSync(
1088
- path.join(dir, `${name}.tsx`),
1089
- `export function ${name}(props: {label?: string; open?: boolean}) { return null; }\n`,
1090
- );
1091
- fs.appendFileSync(
1092
- path.join(tmpDir, 'index.ts'),
1093
- `export {${name}} from './components/${name}';\n`,
1094
- );
1095
- }
1096
- process.chdir(tmpDir);
1097
-
1098
- await createProgram().parseAsync([
1099
- 'node',
1100
- 'astryx',
1101
- '--json',
1102
- 'doctor',
1103
- 'integration',
1104
- 'components',
1105
- ]);
1106
- const report = JSON.parse(logCalls.join('\n')).data.propDrift;
1107
-
1108
- expect(
1109
- report.findings.map(
1110
- (/** @type {any} */ f) => `${f.component}.${f.prop} ${f.kind}`,
1111
- ),
1112
- ).toEqual([
1113
- 'AcmeTabsItem.open not_in_doc',
1114
- 'AcmeTabsPanel.ghost not_in_code',
1115
- 'AcmeTabsPanel.label not_in_doc',
1116
- 'AcmeTabsPanel.open not_in_doc',
1117
- ]);
1118
- expect(report.unchecked).toEqual([
1119
- {
1120
- component: 'AcmeTabs',
1121
- doc: 'components/AcmeTabs.doc.mjs',
1122
- reason: 'no source file for AcmeTabs',
1123
- },
1124
- ]);
1125
- });
1126
-
1127
- it('components counts two docs of one name as two components, and compares a .doc.ts beside a .doc.mjs', async () => {
1128
- writeComponentIntegration('AcmeTwin');
1129
- const dir = path.join(tmpDir, 'components');
1130
- const doc = (/** @type {string} */ name, /** @type {string} */ prop) =>
1131
- `export default {type: 'component', name: '${name}', displayName: '${name}', description: 'Fixture.', props: [{name: '${prop}', type: 'string', description: 'Text.'}]};\n`;
1132
- fs.writeFileSync(
1133
- path.join(dir, 'AcmeTwin.doc.mjs'),
1134
- doc('AcmeTwin', 'tone'),
1135
- );
1136
- fs.writeFileSync(
1137
- path.join(dir, 'AcmeTwin.doc.ts'),
1138
- doc('AcmeTwin', 'size'),
1139
- );
1140
- fs.writeFileSync(
1141
- path.join(dir, 'AcmeTwin.tsx'),
1142
- 'export function AcmeTwin(props: {label?: string}) { return null; }\n',
1143
- );
1144
- for (const folder of ['a', 'b']) {
1145
- fs.mkdirSync(path.join(dir, folder));
1146
- fs.writeFileSync(
1147
- path.join(dir, folder, 'AcmeX.doc.mjs'),
1148
- doc('AcmeX', folder),
1149
- );
1150
- fs.writeFileSync(
1151
- path.join(dir, folder, 'AcmeX.tsx'),
1152
- 'export function AcmeX() { return null; }\n',
1153
- );
1154
- }
1155
- process.chdir(tmpDir);
1156
- const run = async (/** @type {string[]} */ flags) => {
1157
- logCalls.length = 0;
1158
- await createProgram().parseAsync([
1159
- 'node',
1160
- 'astryx',
1161
- ...flags,
1162
- 'doctor',
1163
- 'integration',
1164
- 'components',
1165
- ]);
1166
- return logCalls.join('\n');
1167
- };
1168
-
1169
- const report = JSON.parse(await run(['--json'])).data.propDrift;
1170
- const output = await run([]);
1171
-
1172
- expect(
1173
- report.findings
1174
- .filter(f => f.kind === 'not_in_code')
1175
- .map(f => `${f.doc} ${f.prop}`)
1176
- .sort(),
1177
- ).toEqual([
1178
- 'components/AcmeTwin.doc.mjs tone',
1179
- 'components/AcmeTwin.doc.ts size',
1180
- 'components/a/AcmeX.doc.mjs a',
1181
- 'components/b/AcmeX.doc.mjs b',
1182
- ]);
1183
- expect(output).toMatch(/ in 4 of 4 component\(s\) compared /);
1184
- });
1185
-
1186
- it('components prints every field of the props comparison that JSON carries', async () => {
1187
- writeComponentIntegration('AcmeBadge');
1188
- fs.writeFileSync(
1189
- path.join(tmpDir, 'components', 'AcmeBadge.doc.mjs'),
1190
- `export default {type: 'component', name: 'AcmeBadge', displayName: 'AcmeBadge', description: 'Fixture component.', props: [${[
1191
- "{name: 'label', type: 'string', description: 'Text.'}",
1192
- "{name: 'elevation', type: 'number', description: 'Shadow.'}",
1193
- "{name: 'size', type: 'string', description: 'Size.'}",
1194
- "{name: 'meta', type: '{id: string; extra?: number}', description: 'Data.'}",
1195
- "{name: 'gap', type: 'number', description: 'Gap.', default: '8'}",
1196
- ].join(', ')}]};\n`,
1197
- );
1198
- // `key` is a prop a doc never needs, though the component declares it.
1199
- fs.writeFileSync(
1200
- path.join(tmpDir, 'components', 'AcmeBadge.tsx'),
1201
- "export function AcmeBadge({gap = 4}: {label: string; tone?: 'neutral' | 'info'; size?: number; meta?: {id: string}; gap?: number; key?: string}) { return null; }\n",
1202
- );
1203
- fs.writeFileSync(
1204
- path.join(tmpDir, 'components', 'AcmeLonely.doc.mjs'),
1205
- `export default {type: 'component', name: 'AcmeLonely', displayName: 'AcmeLonely', description: 'Fixture component.', props: []};\n`,
1206
- );
1207
- fs.writeFileSync(
1208
- path.join(tmpDir, 'components', 'AcmeLonely.tsx'),
1209
- 'export function Other() { return null; }\n',
1210
- );
1211
- process.chdir(tmpDir);
1212
- const run = async (/** @type {string[]} */ flags) => {
1213
- logCalls.length = 0;
1214
- await createProgram().parseAsync([
1215
- 'node',
1216
- 'astryx',
1217
- ...flags,
1218
- 'doctor',
1219
- 'integration',
1220
- 'components',
1221
- ]);
1222
- return logCalls.join('\n');
1223
- };
1224
-
1225
- const report = JSON.parse(await run(['--json'])).data.propDrift;
1226
- const output = await run([]);
1227
-
1228
- expect(report.findings.map(f => `${f.prop} ${f.kind}`)).toEqual([
1229
- 'elevation not_in_code',
1230
- 'gap default_mismatch',
1231
- 'label required_mismatch',
1232
- 'size type_mismatch',
1233
- 'tone not_in_doc',
1234
- ]);
1235
- expectRecordsCarry(output, report.findings, ['component', 'prop', 'kind']);
1236
- expectRecordsCarry(output, report.unchecked, ['component', 'reason']);
1237
- expectRecordsCarry(output, report.typesNotCompared, [
1238
- 'component',
1239
- 'reason',
1240
- 'props',
1241
- ]);
1242
- expect(report.typesNotCompared).toHaveLength(1);
1243
- expect(output).toContain(
1244
- `Documented prop types judged: ${report.typesCompared}; not compared: 1.`,
1245
- );
1246
- // The response-type reference, which the README's JSON table comes from,
1247
- // names every field too.
1248
- const {doc: responseTypes} =
1249
- await import('../../../foundation/response/response-types.doc.mjs');
1250
- const member = responseTypes.members.find(
1251
- m => m.value === 'integration.component-conflicts',
1252
- );
1253
- for (const field of Object.keys(report)) {
1254
- expect(member?.description).toMatch(new RegExp(`\\b${field}\\b`));
1255
- }
1256
- expect(output).toContain(
1257
- `in 1 of ${report.components} component(s) compared (TypeScript ${report.typescript}).`,
1258
- );
1259
- });
1260
-
1261
- it('components says documented props match when they do', async () => {
1262
- writeComponentIntegration('AcmeOnlyWidget');
1263
- process.chdir(tmpDir);
1264
-
1265
- await createProgram().parseAsync([
1266
- 'node',
1267
- 'astryx',
1268
- 'doctor',
1269
- 'integration',
1270
- 'components',
1271
- ]);
1272
-
1273
- const output = logCalls.join('\n');
1274
- expect(output).toMatch(
1275
- /\[ok\] Documented prop names and required flags match the code in 1 component\(s\) \(TypeScript \d/,
1276
- );
1277
- expect(output).toMatch(
1278
- /\[info\] Documented prop types judged: \d+; not compared: 0\./,
1279
- );
1280
- });
1281
-
1282
- it('components prints no [ok] for props it could not compare', async () => {
1283
- writeComponentIntegration('AcmeLonely');
1284
- fs.writeFileSync(
1285
- path.join(tmpDir, 'components', 'AcmeLonely.tsx'),
1286
- 'export function Other() { return null; }\n',
1287
- );
1288
- process.chdir(tmpDir);
1289
-
1290
- await createProgram().parseAsync([
1291
- 'node',
1292
- 'astryx',
1293
- 'doctor',
1294
- 'integration',
1295
- 'components',
1296
- ]);
1297
-
1298
- const output = logCalls.join('\n');
1299
- expect(output).toContain(
1300
- '[info] Props not compared for 1 documented component(s):',
1301
- );
1302
- expect(output).not.toContain('[ok] Documented prop');
1303
- });
1304
-
1305
- it('components exposes conflicts as structured JSON warnings', async () => {
1306
- const coreDir = findCoreDir(tmpDir);
1307
- expect(coreDir).not.toBeNull();
1308
- const [core] = discoverOwnedComponents(coreDir, []);
1309
- writeComponentIntegration(core.name);
1310
- process.chdir(tmpDir);
1311
-
1312
- await createProgram().parseAsync([
1313
- 'node',
1314
- 'astryx',
1315
- '--json',
1316
- 'doctor',
1317
- 'integration',
1318
- 'components',
1319
- ]);
1320
-
1321
- const parsed = JSON.parse(logCalls.join('\n'));
1322
- expect(parsed.type).toBe('integration.component-conflicts');
1323
- expect(parsed.data.conflicts[0]).toMatchObject({
1324
- name: core.name,
1325
- severity: 'warning',
1326
- integrationPackage: '@acme/widgets',
1327
- });
1328
- expect(parsed.data.conflicts[0].command).toContain(
1329
- `--package @acme/widgets`,
1330
- );
1331
- expect(process.exitCode).toBeUndefined();
1332
- });
1333
-
1334
- it('docs resolves a link to a component or a template, its own or Core’s, and still flags one that names no doc', async () => {
1335
- const page = (await discoverCoreTemplates()).find(
1336
- template => template.type === 'page',
1337
- );
1338
- expect(page).toBeDefined();
1339
- fs.writeFileSync(
1340
- path.join(tmpDir, 'package.json'),
1341
- JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
1342
- );
1343
- fs.writeFileSync(
1344
- path.join(tmpDir, 'astryx.integration.mjs'),
1345
- "export default {components: './components', templates: './templates', docs: './docs'};\n",
1346
- );
1347
- for (const dir of ['components', 'templates', 'docs']) {
1348
- fs.mkdirSync(path.join(tmpDir, dir), {recursive: true});
1349
- }
1350
- fs.writeFileSync(
1351
- path.join(tmpDir, 'components', 'AcmeButton.doc.mjs'),
1352
- "export default {type: 'component', name: 'AcmeButton', displayName: 'Acme Button', description: 'A button.', props: []};\n",
1353
- );
1354
- fs.writeFileSync(
1355
- path.join(tmpDir, 'components', 'AcmeButton.tsx'),
1356
- 'export function AcmeButton() { return null; }\n',
1357
- );
1358
- fs.writeFileSync(
1359
- path.join(tmpDir, 'templates', 'acme-card.doc.mjs'),
1360
- "export default {type: 'block', name: 'Acme card', description: 'A card.'};\n",
1361
- );
1362
- fs.writeFileSync(
1363
- path.join(tmpDir, 'templates', 'acme-card.tsx'),
1364
- 'export default function Fixture() { return null; }\n',
1365
- );
1366
- const text =
1367
- 'Start with {@link component:AcmeButton} or {@link block:acme-card}, ' +
1368
- 'built on {@link @astryxdesign/core:component:Button} and ' +
1369
- `{@link @astryxdesign/core:page:${page?.dirName}}. Not {@link component:AcmeMissing}.`;
1370
- fs.writeFileSync(
1371
- path.join(tmpDir, 'docs', 'using-widgets.doc.mjs'),
1372
- `export default ${JSON.stringify({
1373
- type: 'generic',
1374
- name: 'using-widgets',
1375
- title: 'Using widgets',
1376
- description: 'Fixture topic.',
1377
- sections: [{title: 'Overview', content: [{type: 'prose', text}]}],
1378
- })};\n`,
1379
- );
1380
- process.chdir(tmpDir);
1381
-
1382
- await createProgram().parseAsync([
1383
- 'node',
1384
- 'astryx',
1385
- '--json',
1386
- 'doctor',
1387
- 'integration',
1388
- 'docs',
1389
- ]);
1390
-
1391
- const parsed = JSON.parse(logCalls.join('\n'));
1392
- const unresolved = parsed.data.issues
1393
- .filter(issue => issue.code === 'invalid_doc_graph')
1394
- .map(issue => issue.message);
1395
- expect(unresolved).toHaveLength(1);
1396
- expect(unresolved[0]).toContain('"component:AcmeMissing" names no doc');
1397
- });
1398
-
1399
- it('docs reports an intentional replacement as info', async () => {
1400
- const [coreTopic] = Object.keys(discoverBuiltinTopics());
1401
- writeDocIntegration({name: 'acme-setup', replaces: coreTopic});
1402
- process.chdir(tmpDir);
1403
-
1404
- await createProgram().parseAsync([
1405
- 'node',
1406
- 'astryx',
1407
- 'doctor',
1408
- 'integration',
1409
- 'docs',
1410
- ]);
1411
-
1412
- const output = logCalls.join('\n');
1413
- expect(output).toContain('[info]');
1414
- expect(output).toContain('Intentional override');
1415
- expect(process.exitCode).toBeUndefined();
1416
- });
1417
-
1418
- it('docs reports an intentional extension as info', async () => {
1419
- const [coreTopic] = Object.keys(discoverBuiltinTopics());
1420
- writeDocIntegration({name: 'acme-extra', extendsTopic: coreTopic});
1421
- process.chdir(tmpDir);
1422
-
1423
- await createProgram().parseAsync([
1424
- 'node',
1425
- 'astryx',
1426
- 'doctor',
1427
- 'integration',
1428
- 'docs',
1429
- ]);
1430
-
1431
- const output = logCalls.join('\n');
1432
- expect(output).toContain('[info]');
1433
- expect(output).toContain('Intentional extension');
1434
- expect(process.exitCode).toBeUndefined();
1435
- });
1436
-
1437
- it('docs exits 1 for a placement that hides a guide, with no [ok] after the failure', async () => {
1438
- writeDocIntegration({name: 'deploying'});
1439
- fs.writeFileSync(
1440
- path.join(tmpDir, 'docs', 'deploying.doc.mjs'),
1441
- "export default {type: 'generic', name: 'deploying', title: 'Deploying', description: 'Deploy.', placement: {parent: 'namespace:nope', slot: 'guides'}, sections: [{title: 'Deploy', content: [{type: 'prose', text: 'Deploy.'}]}]};\n",
1442
- );
1443
- process.chdir(tmpDir);
1444
-
1445
- await createProgram().parseAsync([
1446
- 'node',
1447
- 'astryx',
1448
- 'doctor',
1449
- 'integration',
1450
- 'docs',
1451
- ]);
1452
-
1453
- const printed = logCalls.join('\n');
1454
- expect(printed).toContain('[fail]');
1455
- expect(printed).toContain('invalid_doc_graph');
1456
- expect(printed).not.toContain('[ok]');
1457
- expect(process.exitCode).toBe(1);
1458
- });
1459
-
1460
- it('docs exits 1 for an accidental same-name Core topic', async () => {
1461
- const [coreTopic] = Object.keys(discoverBuiltinTopics());
1462
- writeDocIntegration({name: coreTopic});
1463
- process.chdir(tmpDir);
1464
-
1465
- await createProgram().parseAsync([
1466
- 'node',
1467
- 'astryx',
1468
- '--json',
1469
- 'doctor',
1470
- 'integration',
1471
- 'docs',
1472
- ]);
1473
-
1474
- const parsed = JSON.parse(logCalls.join('\n'));
1475
- expect(parsed.type).toBe('integration.doc-conflicts');
1476
- expect(parsed.data.findings[0]).toMatchObject({
1477
- topic: coreTopic,
1478
- severity: 'error',
1479
- relationship: 'accidental',
1480
- });
1481
- expect(process.exitCode).toBe(1);
1482
- });
1483
- });