@astryxdesign/cli 0.7.2-canary.ab79547 → 0.7.2-canary.b40ba52

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 (255) hide show
  1. package/README.md +20 -19
  2. package/api/build/help/help.mjs +1 -1
  3. package/api/component/_adapter.d.mts +41 -1
  4. package/api/component/_adapter.mjs +93 -7
  5. package/api/component/component.mjs +22 -5
  6. package/api/component/integration-export-name.test.mjs +644 -0
  7. package/api/discover/_adapter.d.mts +119 -12
  8. package/api/discover/_adapter.mjs +449 -10
  9. package/api/discover/_adapter.test.mjs +599 -17
  10. package/api/discover/_catalog-view.d.mts +16 -5
  11. package/api/discover/_catalog-view.mjs +32 -8
  12. package/api/discover/discover.d.mts +11 -0
  13. package/api/discover/discover.doc.mjs +7 -6
  14. package/api/discover/discover.mjs +107 -19
  15. package/api/discover/discover.type.d.mts +18 -7
  16. package/api/discover/discover.type.mjs +15 -7
  17. package/api/discover/list/list.d.mts +4 -3
  18. package/api/discover/list/list.mjs +17 -10
  19. package/api/docs/_adapter.d.mts +11 -0
  20. package/api/docs/_adapter.mjs +244 -1
  21. package/api/docs/integrationDocs.test.mjs +124 -0
  22. package/api/doctor/doctor.mjs +27 -3
  23. package/api/doctor/doctor.test.mjs +43 -0
  24. package/api/doctor/theme-checks.mjs +1 -1
  25. package/api/doctor/theme-checks.test.mjs +136 -0
  26. package/api/gap-report/gap-report.d.mts +3 -0
  27. package/api/gap-report/gap-report.doc.mjs +11 -3
  28. package/api/gap-report/gap-report.mjs +219 -52
  29. package/api/gap-report/gap-report.test.mjs +233 -0
  30. package/api/gap-report/gap-report.type.d.mts +41 -0
  31. package/api/gap-report/gap-report.type.mjs +18 -0
  32. package/api/index.d.mts +2 -0
  33. package/api/index.mjs +2 -0
  34. package/api/init/run/run.mjs +2 -2
  35. package/api/integration/_adapter.d.mts +12 -0
  36. package/api/integration/_adapter.mjs +54 -0
  37. package/api/integration/add-contribution.component-names.test.mjs +66 -0
  38. package/api/integration/add-contribution.mjs +8 -4
  39. package/api/integration/add-contribution.test.mjs +4 -2
  40. package/api/integration/authoring-checks.mjs +11 -2
  41. package/api/integration/authoring-checks.test.mjs +39 -0
  42. package/api/integration/authoring-checks.type.d.mts +9 -0
  43. package/api/integration/authoring-checks.type.mjs +14 -1
  44. package/api/integration/check/check.d.mts +96 -0
  45. package/api/integration/check/check.mjs +357 -0
  46. package/api/integration/check/check.test.mjs +489 -0
  47. package/api/integration/integration-check.type.d.mts +118 -0
  48. package/api/integration/integration-check.type.mjs +84 -0
  49. package/api/integration/integrationCheck.doc.d.mts +10 -0
  50. package/api/integration/integrationCheck.doc.mjs +73 -0
  51. package/api/integration/integrationComponentConflicts.doc.mjs +43 -6
  52. package/api/integration/pack-check.mjs +343 -104
  53. package/api/integration/pack-check.test.mjs +700 -0
  54. package/api/integration/validate-integration.mjs +8 -0
  55. package/api/integration/validate-integration.test.mjs +11 -0
  56. package/api/integration/validate-integration.type.d.mts +8 -0
  57. package/api/integration/validate-integration.type.mjs +12 -1
  58. package/api/integration/validateIntegration.doc.mjs +19 -3
  59. package/api/search/search.d.mts +81 -12
  60. package/api/search/search.domain-priority.test.mjs +108 -18
  61. package/api/search/search.integration-check.test.mjs +24 -0
  62. package/api/search/search.mjs +601 -50
  63. package/api/search/search.test.mjs +139 -0
  64. package/api/swizzle/copy/copy.mjs +28 -14
  65. package/api/theme/build/build.family.test.mjs +54 -6
  66. package/api/theme/build/build.mjs +114 -17
  67. package/api/theme/themeBuild.doc.mjs +4 -4
  68. package/api/upgrade/_adapter.d.mts +40 -2
  69. package/api/upgrade/_adapter.mjs +117 -4
  70. package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
  71. package/api/upgrade/run/run.mjs +30 -1
  72. package/api/upgrade/status/status.d.mts +21 -5
  73. package/api/upgrade/status/status.mjs +45 -8
  74. package/api/upgrade/upgrade.doc.mjs +5 -3
  75. package/api/upgrade/upgrade.type.d.mts +23 -0
  76. package/api/upgrade/upgrade.type.mjs +16 -1
  77. package/assets/codemods/runner.mjs +7 -1
  78. package/assets/discover/official-packages.json +367 -0
  79. package/assets/docs/README.md +10 -0
  80. package/assets/docs/author-a-theme.doc.mjs +1 -1
  81. package/assets/docs/getting-started.doc.mjs +3 -3
  82. package/assets/docs/styling-overview.doc.mjs +1 -1
  83. package/assets/docs/theme.doc.dense.mjs +1 -1
  84. package/assets/docs/theme.doc.mjs +1 -1
  85. package/assets/docs/theme.doc.zh.mjs +1 -1
  86. package/assets/docs/tree/add-a-component.doc.mjs +11 -1
  87. package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
  88. package/assets/docs/tree/add-a-topic.doc.mjs +10 -7
  89. package/assets/docs/tree/agent-guidance.doc.mjs +2 -2
  90. package/assets/docs/tree/block-template.doc.mjs +8 -20
  91. package/assets/docs/tree/build-the-template.doc.mjs +1 -1
  92. package/assets/docs/tree/check-the-props.doc.mjs +196 -0
  93. package/assets/docs/tree/check-your-docs.doc.mjs +51 -5
  94. package/assets/docs/tree/checks.doc.mjs +24 -16
  95. package/assets/docs/tree/codemods.doc.mjs +4 -4
  96. package/assets/docs/tree/component-family.doc.mjs +8 -6
  97. package/assets/docs/tree/component-imports.doc.mjs +10 -2
  98. package/assets/docs/tree/components.doc.mjs +1 -1
  99. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +25 -16
  100. package/assets/docs/tree/define-the-theme.doc.mjs +6 -5
  101. package/assets/docs/tree/describe-the-component.doc.mjs +2 -2
  102. package/assets/docs/tree/docs.doc.mjs +3 -3
  103. package/assets/docs/tree/document-the-template.doc.mjs +1 -1
  104. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  105. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  106. package/assets/docs/tree/extend-or-replace.doc.mjs +6 -6
  107. package/assets/docs/tree/fonts-and-assets.doc.mjs +2 -2
  108. package/assets/docs/tree/generate-a-palette.doc.mjs +5 -3
  109. package/assets/docs/tree/grade-template-with-agent.doc.mjs +1 -1
  110. package/assets/docs/tree/integrations.doc.mjs +8 -0
  111. package/assets/docs/tree/links.doc.mjs +6 -5
  112. package/assets/docs/tree/migration-setup.doc.mjs +1 -0
  113. package/assets/docs/tree/migration-verification.doc.mjs +0 -1
  114. package/assets/docs/tree/migration.doc.mjs +0 -1
  115. package/assets/docs/tree/package-and-test.doc.mjs +1 -1
  116. package/assets/docs/tree/page-template.doc.mjs +4 -8
  117. package/assets/docs/tree/publishing.doc.mjs +1 -1
  118. package/assets/docs/tree/quick-start.doc.mjs +37 -21
  119. package/assets/docs/tree/replace-a-core-component.doc.mjs +4 -6
  120. package/assets/docs/tree/replace-a-core-template.doc.mjs +6 -8
  121. package/assets/docs/tree/sections-and-placement.doc.mjs +4 -6
  122. package/assets/docs/tree/see-it-in-an-app.doc.mjs +4 -2
  123. package/assets/docs/tree/short-and-findable.doc.mjs +6 -5
  124. package/assets/docs/tree/single-component.doc.mjs +15 -6
  125. package/assets/docs/tree/start-a-template.doc.mjs +3 -3
  126. package/assets/docs/tree/subcomponent.doc.mjs +6 -6
  127. package/assets/docs/tree/template-assets.doc.mjs +2 -2
  128. package/assets/docs/tree/template-doc-overview.doc.mjs +4 -15
  129. package/assets/docs/tree/template-fonts.doc.mjs +1 -1
  130. package/assets/docs/tree/template-icons.doc.mjs +1 -1
  131. package/assets/docs/tree/template-images-media.doc.mjs +1 -1
  132. package/assets/docs/tree/template-styles.doc.mjs +2 -2
  133. package/assets/docs/tree/templates.doc.mjs +1 -1
  134. package/assets/docs/tree/test-in-an-app.doc.mjs +3 -3
  135. package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
  136. package/assets/docs/tree/tokens-and-setup.doc.mjs +19 -15
  137. package/assets/docs/tree/troubleshooting.doc.mjs +13 -5
  138. package/assets/docs/tree/type-scale.doc.mjs +3 -3
  139. package/assets/docs/tree/upgrading.doc.mjs +3 -3
  140. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +3 -1
  141. package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
  142. package/assets/docs/tree/versioning.doc.mjs +7 -6
  143. package/assets/docs/tree/write-the-template-file.doc.mjs +4 -3
  144. package/assets/docs/use-a-theme.doc.mjs +2 -2
  145. package/assets/theme.template.ts +1 -1
  146. package/authoring/codemod/codemod.doc.mjs +7 -3
  147. package/authoring/config/config.doc.mjs +9 -6
  148. package/authoring/config/type.ts +4 -2
  149. package/authoring/discover/discover.doc.mjs +1 -1
  150. package/authoring/doctypes/base/graph-fields.doc.mjs +6 -4
  151. package/authoring/doctypes/command/command.doc.mjs +14 -12
  152. package/authoring/doctypes/component/component.doc.mjs +29 -26
  153. package/authoring/doctypes/component/type.ts +13 -8
  154. package/authoring/doctypes/enum/enum.doc.mjs +7 -4
  155. package/authoring/doctypes/function/function.doc.mjs +9 -8
  156. package/authoring/doctypes/hook/hook.doc.mjs +5 -4
  157. package/authoring/doctypes/namespace/namespace.doc.mjs +7 -6
  158. package/authoring/doctypes/reference/reference.doc.mjs +11 -10
  159. package/authoring/doctypes/schema/schema.doc.mjs +9 -9
  160. package/authoring/doctypes/template/integration-template.doc.d.mts +11 -0
  161. package/authoring/doctypes/template/integration-template.doc.mjs +49 -0
  162. package/authoring/doctypes/template/parse.d.mts +6 -2
  163. package/authoring/doctypes/template/parse.mjs +3 -1
  164. package/authoring/doctypes/template/template.doc.mjs +3 -3
  165. package/authoring/doctypes/template/type.ts +22 -0
  166. package/authoring/doctypes/theme/theme.doc.mjs +2 -2
  167. package/authoring/gap-report/gap-report.doc.mjs +2 -2
  168. package/authoring/identity/identity.doc.mjs +3 -3
  169. package/authoring/index.d.ts +1 -0
  170. package/authoring/integration/integration.doc.mjs +12 -4
  171. package/authoring/integration/parse.test.mjs +10 -0
  172. package/authoring/integration/schema.d.mts +2 -0
  173. package/authoring/integration/schema.mjs +1 -0
  174. package/authoring/integration/type.ts +4 -0
  175. package/clients/cli/commands/build-theme.batch-report.test.mjs +3 -1
  176. package/clients/cli/commands/build-theme.mjs +1 -1
  177. package/clients/cli/commands/build-theme.path-safety.test.mjs +155 -21
  178. package/clients/cli/commands/cli-postinstall.test.mjs +49 -1
  179. package/clients/cli/commands/discover.broken-integration.test.mjs +4 -1
  180. package/clients/cli/commands/discover.doc.mjs +1 -1
  181. package/clients/cli/commands/discover.mjs +144 -93
  182. package/clients/cli/commands/discover.no-source.test.mjs +447 -33
  183. package/clients/cli/commands/discover.sources.test.mjs +20 -1
  184. package/clients/cli/commands/doctor-integration-components.doc.mjs +17 -4
  185. package/clients/cli/commands/doctor-integration-validate.doc.mjs +13 -2
  186. package/clients/cli/commands/doctor-integration.test.mjs +837 -0
  187. package/clients/cli/commands/doctor.mjs +190 -0
  188. package/clients/cli/commands/gap-report.doc.mjs +14 -2
  189. package/clients/cli/commands/gap-report.mjs +24 -2
  190. package/clients/cli/commands/gap-report.test.mjs +79 -0
  191. package/clients/cli/commands/integration-check.doc.mjs +85 -0
  192. package/clients/cli/commands/integration-check.test.mjs +284 -0
  193. package/clients/cli/commands/integration.doc.mjs +6 -2
  194. package/clients/cli/commands/integration.mjs +106 -1
  195. package/clients/cli/commands/json-contract.test.mjs +5 -1
  196. package/clients/cli/commands/setup-nudge.test.mjs +79 -1
  197. package/clients/cli/commands/swizzle.mjs +5 -3
  198. package/clients/cli/commands/swizzle.routing.test.mjs +18 -1
  199. package/clients/cli/commands/text-json-parity.test.mjs +5 -0
  200. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  201. package/clients/cli/commands/upgrade.doc.mjs +14 -0
  202. package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
  203. package/clients/cli/index.mjs +30 -5
  204. package/foundation/agent-docs/agent-doc-state.d.mts +14 -0
  205. package/foundation/agent-docs/agent-doc-state.mjs +38 -0
  206. package/foundation/agent-docs/agent-docs.d.mts +2 -1
  207. package/foundation/agent-docs/agent-docs.mjs +8 -6
  208. package/foundation/config/project.mjs +82 -0
  209. package/foundation/discovery/authoring-self-docs.mjs +2 -1
  210. package/foundation/discovery/component-discovery.d.mts +178 -10
  211. package/foundation/discovery/component-discovery.export-names.test.mjs +760 -0
  212. package/foundation/discovery/component-discovery.mjs +659 -62
  213. package/foundation/discovery/component-replacement.mjs +18 -0
  214. package/foundation/discovery/component-replacement.test.mjs +40 -0
  215. package/foundation/discovery/doc-types.d.mts +157 -0
  216. package/foundation/discovery/doc-types.mjs +1224 -0
  217. package/foundation/discovery/doc-types.test.mjs +700 -0
  218. package/foundation/discovery/docs-discovery.d.mts +81 -0
  219. package/foundation/discovery/docs-discovery.mjs +57 -0
  220. package/foundation/discovery/integration-doc-files.d.mts +22 -0
  221. package/foundation/discovery/integration-doc-files.mjs +231 -0
  222. package/foundation/discovery/integration-doc-files.test.mjs +246 -0
  223. package/foundation/discovery/module-exports.d.mts +27 -0
  224. package/foundation/discovery/module-exports.mjs +356 -31
  225. package/foundation/discovery/module-exports.test.mjs +172 -0
  226. package/foundation/discovery/package-tsconfig.d.mts +14 -0
  227. package/foundation/discovery/package-tsconfig.mjs +228 -0
  228. package/foundation/discovery/package-tsconfig.test.mjs +210 -0
  229. package/foundation/discovery/project-typescript.d.mts +32 -0
  230. package/foundation/discovery/project-typescript.mjs +89 -0
  231. package/foundation/discovery/prop-drift.d.mts +278 -0
  232. package/foundation/discovery/prop-drift.mjs +2263 -0
  233. package/foundation/discovery/prop-drift.test.mjs +2272 -0
  234. package/foundation/discovery/type-match.d.mts +53 -0
  235. package/foundation/discovery/type-match.mjs +660 -0
  236. package/foundation/discovery/type-match.test.mjs +169 -0
  237. package/foundation/discovery/type-text.d.mts +68 -0
  238. package/foundation/discovery/type-text.mjs +658 -0
  239. package/foundation/discovery/type-text.test.mjs +196 -0
  240. package/foundation/discovery/unresolved-references.d.mts +62 -0
  241. package/foundation/discovery/unresolved-references.mjs +790 -0
  242. package/foundation/discovery/unresolved-references.test.mjs +567 -0
  243. package/foundation/doc-compiler/doc-loads.test.mjs +10 -0
  244. package/foundation/doc-compiler/links.d.mts +9 -5
  245. package/foundation/doc-compiler/links.mjs +4 -2
  246. package/foundation/env/package-manager.d.mts +32 -0
  247. package/foundation/env/package-manager.mjs +47 -0
  248. package/foundation/env/package-manager.test.mjs +194 -7
  249. package/foundation/fs/module-loader.d.mts +2 -1
  250. package/foundation/fs/module-loader.mjs +60 -4
  251. package/foundation/fs/module-loader.test.mjs +194 -0
  252. package/foundation/integrations/contribution-inventory.mjs +6 -1
  253. package/foundation/response/response-types.doc.mjs +13 -7
  254. package/package.json +9 -9
  255. package/scripts/postinstall.mjs +3 -3
@@ -863,3 +863,142 @@ describe('search — usage guidance is indexed, a tier below description', () =>
863
863
  expect(hit?.score).toBe(45);
864
864
  });
865
865
  });
866
+
867
+ describe('search leaf — compound names, other names, and word forms', () => {
868
+ it('finds a compound name typed as separate words inside a longer query', async () => {
869
+ const {data} = await search('table header cell with sort arrow', {cwd});
870
+ expect(
871
+ data.results.slice(0, 3).map(r => r.name),
872
+ ).toContain('TableHeaderCell');
873
+ }, SLOW);
874
+
875
+ it('finds a one-word keyword typed as separate words', async () => {
876
+ // MetadataList declares `keyvalue`.
877
+ const {data} = await search('key value pairs', {cwd});
878
+ expect(data.results[0]).toMatchObject({
879
+ domain: 'component',
880
+ name: 'MetadataList',
881
+ });
882
+ }, SLOW);
883
+
884
+ it('finds a hook named by its words without the `use` prefix', async () => {
885
+ const {data} = await search('persisted table column settings', {cwd});
886
+ expect(data.results[0]).toMatchObject({
887
+ domain: 'hook',
888
+ name: 'useTableColumnSettings',
889
+ });
890
+ }, SLOW);
891
+
892
+ it('reads a camelCase identifier as the words it spells', async () => {
893
+ const {data} = await search('useTablePaginationState', {cwd});
894
+ expect(data.results[0]).toMatchObject({
895
+ domain: 'hook',
896
+ name: 'useTablePagination',
897
+ });
898
+ }, SLOW);
899
+
900
+ it('keeps each identifier of a multi-word query whole', async () => {
901
+ const {data} = await search('ChatMessageList ChatComposer', {cwd});
902
+ expect(data.results.slice(0, 2).map(r => r.name).sort()).toEqual([
903
+ 'ChatComposer',
904
+ 'ChatMessageList',
905
+ ]);
906
+ }, SLOW);
907
+
908
+ it("finds a component by another library's name for it", async () => {
909
+ for (const [q, name] of [
910
+ ['ScrollArea viewport', 'ScrollableArea'],
911
+ ['toggle group of buttons', 'ToggleButtonGroup'],
912
+ ['circular progress for uploads', 'Spinner'],
913
+ ]) {
914
+ const {data} = await search(q, {cwd});
915
+ expect(data.results[0], q).toMatchObject({domain: 'component', name});
916
+ }
917
+ }, SLOW);
918
+
919
+ it('reads a one-identifier other name as typed', async () => {
920
+ const {data} = await search('AppHeader', {cwd});
921
+ expect(data.results[0]).toMatchObject({
922
+ domain: 'component',
923
+ name: 'LayoutHeader',
924
+ });
925
+ }, SLOW);
926
+
927
+ it('adds no near siblings beside an entry the query names outright', async () => {
928
+ const {data} = await search('top nav mega menu', {cwd});
929
+ expect(data.results[0]).toMatchObject({name: 'TopNavMegaMenu'});
930
+ // Its sub-parts start with its name; read joined they would score in the
931
+ // whole-name tier right under it.
932
+ const siblings = data.results.filter(
933
+ r => r.name !== 'TopNavMegaMenu' && r.name.startsWith('TopNavMegaMenu'),
934
+ );
935
+ for (const sibling of siblings) expect(sibling.score).toBeLessThan(190);
936
+ }, SLOW);
937
+
938
+ it('ranks an entry the query names above a match on part of another name', async () => {
939
+ // `table header` names TableHeader; useTableStickyColumns only holds the
940
+ // words `sticky columns`.
941
+ const {data} = await search('table header with sticky columns', {cwd});
942
+ const names = data.results.map(r => r.name);
943
+ expect(names.indexOf('TableHeader')).toBeLessThan(
944
+ names.indexOf('useTableStickyColumns') === -1
945
+ ? Infinity
946
+ : names.indexOf('useTableStickyColumns'),
947
+ );
948
+ }, SLOW);
949
+
950
+ it('keeps an entry a query word names by its whole name at its own rank', async () => {
951
+ // Two words join into TextInput, and TextArea also matches two words
952
+ // through its joined keyword; one word is still TextArea's whole name.
953
+ const {data} = await search('text input and textarea with multi line', {
954
+ cwd,
955
+ });
956
+ expect(data.results[0]).toMatchObject({name: 'TextArea'});
957
+ }, SLOW);
958
+
959
+ it('ranks a match on more of the query above a shorter named entry', async () => {
960
+ const {data} = await search('dropdown menu radio options', {cwd});
961
+ expect(data.results[0]).toMatchObject({name: 'DropdownMenuRadioItem'});
962
+ }, SLOW);
963
+
964
+ it('lets a plural start a name through its singular', () => {
965
+ expect(
966
+ scoreCandidate('tokens', {domain: 'component', name: 'Tokenizer'}),
967
+ ).toMatchObject({score: 60});
968
+ });
969
+
970
+ it('finds Icon by a glyph name', async () => {
971
+ for (const q of ['cog', 'lightning bolt']) {
972
+ const {data} = await search(q, {cwd});
973
+ expect(data.results[0], q).toMatchObject({
974
+ domain: 'component',
975
+ name: 'Icon',
976
+ });
977
+ }
978
+ }, SLOW);
979
+
980
+ it('matches a verb form against its verb', () => {
981
+ // "spacing" lost the final e of "space".
982
+ expect(
983
+ scoreCandidate('spacing', {domain: 'component', name: 'Gap', keywords: ['space']}),
984
+ ).toMatchObject({score: 88});
985
+ expect(
986
+ scoreCandidate('dragging', {domain: 'component', name: 'Gap', keywords: ['drag']}),
987
+ ).toMatchObject({score: 88});
988
+ });
989
+
990
+ it('lets a plural start a longer word through its singular', () => {
991
+ expect(
992
+ scoreCandidate('chips', {domain: 'component', name: 'Chipset'}),
993
+ ).toMatchObject({score: 60});
994
+ // A four-letter singular is too short: "stats" does not start "statusbar".
995
+ expect(
996
+ scoreCandidate('stats', {domain: 'component', name: 'Statusbar'}),
997
+ ).toBeNull();
998
+ });
999
+
1000
+ it('leaves an identifier joined with _ unmatched when nothing has it', async () => {
1001
+ const {data} = await search('qqzz_no_match_here', {cwd});
1002
+ expect(data.results).toEqual([]);
1003
+ }, SLOW);
1004
+ });
@@ -21,8 +21,10 @@ import {checkGhCli} from '../_github.mjs';
21
21
  import {Project} from '../../../foundation/config/project.mjs';
22
22
  import {
23
23
  CORE_PACKAGE,
24
- findIntegrationComponentDoc,
25
- findIntegrationComponentSource,
24
+ docStem,
25
+ findComponentReadme,
26
+ findIntegrationComponent,
27
+ unscopedComponentOwners,
26
28
  } from '../../../foundation/discovery/component-discovery.mjs';
27
29
  import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
28
30
  import {AstryxError, writeFailed} from '../../error.mjs';
@@ -126,33 +128,38 @@ async function loadConfigSafely(cwd) {
126
128
 
127
129
  /**
128
130
  * Build the set of OWNER packages that provide a component named `name` across
129
- * core + every loaded integration.
131
+ * core + every loaded integration. Core holds every name it documents, but has
132
+ * source to copy (`sourceDir`) only for a name with its own folder.
130
133
  * @param {string} coreDir
131
134
  * @param {Array<{name: string, components?: string, issuesUrl?: string}>} loadedIntegrations
132
135
  * @param {string} name
133
136
  * @param {string|undefined} coreIssuesUrl
134
- * @returns {Array<{package: string, sourceDir: string|null, ownerPackage: string, issuesUrl: string|undefined}>}
137
+ * @returns {Array<{package: string, sourceDir: string|null, docPath: string|null, ownerPackage: string, issuesUrl: string|undefined, hold: string}>}
135
138
  */
136
139
  function resolveOwners(coreDir, loadedIntegrations, name, coreIssuesUrl) {
137
140
  const owners = [];
138
141
  const coreComponentDir = path.join(coreDir, 'src', name);
139
- if (fs.existsSync(coreComponentDir)) {
142
+ const coreFolder = fs.existsSync(coreComponentDir);
143
+ if (coreFolder || findComponentReadme(coreDir, name)) {
140
144
  owners.push({
141
145
  package: CORE_PACKAGE,
142
- sourceDir: coreComponentDir,
146
+ sourceDir: coreFolder ? coreComponentDir : null,
147
+ docPath: null,
143
148
  ownerPackage: CORE_PACKAGE,
144
149
  issuesUrl: coreIssuesUrl || DEFAULT_ISSUES_URL,
150
+ hold: 'core',
145
151
  });
146
152
  }
147
153
  for (const integration of loadedIntegrations) {
148
- const docPath = findIntegrationComponentDoc(integration, name);
149
- if (!docPath) continue;
150
- const sourcePath = findIntegrationComponentSource(integration, name);
154
+ const found = findIntegrationComponent(integration, name);
155
+ if (!found) continue;
151
156
  owners.push({
152
157
  package: integration.name,
153
- sourceDir: sourcePath ? path.dirname(sourcePath) : null,
158
+ sourceDir: found.sourcePath ? path.dirname(found.sourcePath) : null,
159
+ docPath: found.docPath,
154
160
  ownerPackage: integration.name,
155
161
  issuesUrl: integration.issuesUrl,
162
+ hold: found.hold,
156
163
  });
157
164
  }
158
165
  return owners;
@@ -222,25 +229,32 @@ export async function swizzleCopy(component, options = {}) {
222
229
  : undefined;
223
230
  // An active integration replacement answers to the Core name it replaces,
224
231
  // bare or qualified by its own package (spec:AST-035 FR11): copy it under its
225
- // own name. `--package @astryxdesign/core` still copies the Core original.
232
+ // doc's file name, the folder it has always gone to. `--package
233
+ // @astryxdesign/core` still copies the Core original.
226
234
  if (pkg !== CORE_PACKAGE) {
227
235
  const replacement = await resolveComponentReplacement(
228
236
  coreDir,
229
237
  loadedIntegrations,
230
238
  dirName,
231
239
  );
240
+ const copyName = replacement ? docStem(replacement.docPath) : null;
232
241
  if (
233
242
  replacement &&
234
- (!pkg || (pkg === replacement.package && replacement.name !== dirName))
243
+ copyName &&
244
+ (!pkg || (pkg === replacement.package && copyName !== dirName))
235
245
  ) {
236
- return swizzleCopy(replacement.name, {
246
+ return swizzleCopy(copyName, {
237
247
  ...options,
238
248
  package: replacement.package,
239
249
  });
240
250
  }
241
251
  }
242
252
 
243
- const allOwners = resolveOwners(coreDir, loadedIntegrations, dirName, coreIssuesUrl);
253
+ const found = resolveOwners(coreDir, loadedIntegrations, dirName, coreIssuesUrl);
254
+ // The owner rule, then a Core name without its own folder drops out.
255
+ const allOwners = (pkg ? found : unscopedComponentOwners(found)).filter(
256
+ owner => owner.package !== CORE_PACKAGE || owner.sourceDir != null,
257
+ );
244
258
 
245
259
  if (allOwners.length === 0) {
246
260
  throw new AstryxError(
@@ -13,6 +13,7 @@ import {themeBuild, themeBuildFamily} from './build.mjs';
13
13
  import {interceptCore} from './core-interception.mjs';
14
14
  import {ensureCoreBuilt} from '../../../clients/cli/commands/ensure-core-built.mjs';
15
15
  import {runCli} from '../../../test-utils/run-cli.mjs';
16
+ import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
16
17
  vi.setConfig({testTimeout: 120_000});
17
18
  const CLI_ROOT = path.resolve(import.meta.dirname, '../../..');
18
19
  const FAMILY_KEY = 'ocean-family';
@@ -252,22 +253,69 @@ describe('themeBuildFamily()', () => {
252
253
  expect(fs.existsSync(dtsPath)).toBe(false);
253
254
  });
254
255
 
255
- it('refuses family outputs outside cwd before checking or writing', async () => {
256
+ it('refuses to write family outputs outside cwd, and checks them read-only', async () => {
256
257
  const dir = makeDir();
257
258
  const files = writeFamily(dir).map(file => path.join(dir, file));
258
259
  const app = path.join(dir, 'app');
259
260
  fs.mkdirSync(app);
260
261
 
261
- for (const check of [false, true]) {
262
- await expect(
263
- themeBuildFamily(files, {familyKey: FAMILY_KEY, check}, {cwd: app}),
264
- ).rejects.toMatchObject({code: 'ERR_PATH_TRAVERSAL'});
265
- }
262
+ await expect(
263
+ themeBuildFamily(files, {familyKey: FAMILY_KEY}, {cwd: app}),
264
+ ).rejects.toMatchObject({code: 'ERR_PATH_TRAVERSAL'});
265
+ const checked = await themeBuildFamily(
266
+ files,
267
+ {familyKey: FAMILY_KEY, check: true},
268
+ {cwd: app},
269
+ );
270
+ expect(checked?.type).toBe('theme.build.check');
271
+ expect(checked?.data.upToDate).toBe(false);
272
+ // The `.css.d.ts` import stub may be absent in check mode.
273
+ expect(checked?.data.stale).toEqual(
274
+ OUTPUTS.filter(file => !file.endsWith('.css.d.ts')).map(file => ({
275
+ path: `../themes/${file}`,
276
+ reason: 'missing',
277
+ })),
278
+ );
266
279
  for (const output of OUTPUTS) {
267
280
  expect(fs.existsSync(path.join(dir, 'themes', output))).toBe(false);
268
281
  }
269
282
  });
270
283
 
284
+ it('ends a stale family report for outputs outside cwd with a remedy that works', async () => {
285
+ const dir = makeDir();
286
+ const files = writeFamily(dir).map(file => path.join(dir, file));
287
+ const app = path.join(dir, 'app');
288
+ fs.mkdirSync(app);
289
+ const family = ['--family', ...files, '--family-key', FAMILY_KEY];
290
+
291
+ const stale = await runCli(['theme', 'build', ...family, '--check'], app);
292
+ expect(stale.code).toBe(1);
293
+ // The old remedy ran the build from cwd, which refuses these outputs.
294
+ expect(stale.stderr).not.toContain('Rebuild with:');
295
+
296
+ const lines = stale.stderr.split('\n').map(line => line.trim());
297
+ const runDir = lines.find(line => line.startsWith('cd '))?.slice(3);
298
+ expect(runDir).toBe(fs.realpathSync(path.join(dir, 'themes')));
299
+ const stem = `${getCliInvocation(runDir)} theme build `;
300
+ const [buildArgs, checkArgs] = lines
301
+ .filter(line => line.startsWith(stem))
302
+ .map(line => line.slice(stem.length).split(' '));
303
+ expect(checkArgs).toEqual([...buildArgs, '--check']);
304
+
305
+ // Following the remedy builds, and the check from there passes.
306
+ const built = await runCli(['theme', 'build', ...buildArgs], runDir);
307
+ expect(built.code).toBe(0);
308
+ for (const output of OUTPUTS) {
309
+ expect(fs.existsSync(path.join(dir, 'themes', output))).toBe(true);
310
+ }
311
+ const checked = await runCli(
312
+ ['--json', 'theme', 'build', ...checkArgs],
313
+ runDir,
314
+ );
315
+ expect(checked.code).toBe(0);
316
+ expect(JSON.parse(checked.stdout).data.upToDate).toBe(true);
317
+ });
318
+
271
319
  it('fails without publishing a mixed trio when staging a write fails', async () => {
272
320
  const dir = makeDir();
273
321
  const files = writeFamily(dir);
@@ -27,8 +27,10 @@
27
27
  * files; an internal callback lets the CLI make only the process status fail.
28
28
  * Human progress is emitted through the shared `logger` (silent by default), so
29
29
  * the CLI keeps its exact output while a programmatic caller stays quiet.
30
- * Every output, explicit or beside the theme file, stays inside `cwd`
31
- * (`ERR_PATH_TRAVERSAL` otherwise), in check mode too.
30
+ * Every output a build writes, explicit or beside the theme file, stays inside
31
+ * `cwd` (`ERR_PATH_TRAVERSAL` otherwise). Check mode writes nothing, so it
32
+ * compares outputs outside `cwd` read-only; only a relative `out` path that
33
+ * escapes `cwd` is refused there too.
32
34
  *
33
35
  * The installed `@astryxdesign/core` is an independently versioned optional
34
36
  * peer, so it can be older than the CLI. A theme that uses only baseline
@@ -60,7 +62,10 @@ import {isBuiltin} from 'node:module';
60
62
  import {fileURLToPath, pathToFileURL} from 'node:url';
61
63
  import {parse} from '@babel/parser';
62
64
  import {createJiti} from 'jiti';
63
- import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
65
+ import {
66
+ formatCliCommand,
67
+ getCliInvocation,
68
+ } from '../../../foundation/env/package-manager.mjs';
64
69
  import {
65
70
  CLI_ROOT,
66
71
  findCoreDir,
@@ -568,6 +573,86 @@ function confineOutputs(writes, root, remedy) {
568
573
  for (const write of writes) confineOutput(write.dest, root, remedy);
569
574
  }
570
575
 
576
+ /** @param {string} dest absolute output path @param {string} root @returns {boolean} whether a build at `root` refuses to write `dest` */
577
+ function refusedOutput(dest, root) {
578
+ try {
579
+ confineOutput(dest, root, '');
580
+ return false;
581
+ } catch (err) {
582
+ if (
583
+ err instanceof AstryxError &&
584
+ err.code === ERROR_CODES.ERR_PATH_TRAVERSAL
585
+ )
586
+ return true;
587
+ throw err;
588
+ }
589
+ }
590
+
591
+ /** @param {string[]} dirs absolute directories @returns {string | null} the deepest directory containing all of them, or null across roots */
592
+ function commonDirectory(dirs) {
593
+ let common = dirs[0];
594
+ for (const dir of dirs.slice(1)) {
595
+ while (
596
+ path.relative(common, dir).startsWith('..') ||
597
+ path.isAbsolute(path.relative(common, dir))
598
+ ) {
599
+ const parent = path.dirname(common);
600
+ if (parent === common) return null;
601
+ common = parent;
602
+ }
603
+ }
604
+ return common;
605
+ }
606
+
607
+ /** @param {string} value @returns {string} `value` as one shell word */
608
+ function shellWord(value) {
609
+ if (/^[A-Za-z0-9@%+=:,./_-]+$/.test(value)) return value;
610
+ return `'${value.replace(/'/g, `'\\''`)}'`;
611
+ }
612
+
613
+ /**
614
+ * How a stale check report ends when outputs sit outside the write root. A
615
+ * build there refuses them, and each output's `Source:` header records the
616
+ * directory its build ran from, so the build and the check both run from the
617
+ * nearest directory that contains every theme file and output.
618
+ * @param {Array<{dest: string}>} writes
619
+ * @param {string[]} sources absolute theme files the build reads
620
+ * @param {string} root the directory a build here keeps its writes inside
621
+ * @param {(relative: (file: string) => string) => string[]} args the arguments after `theme build`, given each path relative to the directory to run from
622
+ * @returns {string[] | null} report lines, or null when every output is inside `root`
623
+ */
624
+ function outsideCheckRemedy(writes, sources, root, args) {
625
+ if (!writes.some(write => refusedOutput(write.dest, root))) return null;
626
+ const real = (/** @type {string} */ file) => realLocation(path.resolve(file));
627
+ const dir = commonDirectory([
628
+ ...sources.map(file => path.dirname(real(file))),
629
+ ...writes.map(write => path.dirname(real(write.dest))),
630
+ ]);
631
+ if (!dir) {
632
+ return [
633
+ 'These outputs are outside the working directory, so a build here refuses them. Build and check them from one directory that contains the theme files and the outputs.',
634
+ ];
635
+ }
636
+ const command = (/** @type {string[]} */ extra) =>
637
+ formatCliCommand(
638
+ [
639
+ 'theme',
640
+ 'build',
641
+ ...args(file => path.relative(dir, real(file))),
642
+ ...extra,
643
+ ]
644
+ .map(shellWord)
645
+ .join(' '),
646
+ dir,
647
+ );
648
+ return [
649
+ 'These outputs are outside the working directory, so a build here refuses them, and each output records the directory it was built from. Build and check them from a directory that contains them:',
650
+ ` cd ${shellWord(dir)}`,
651
+ ` ${command([])}`,
652
+ ` ${command(['--check'])}`,
653
+ ];
654
+ }
655
+
571
656
  /** @param {Array<{dest: string, content: string}>} writes */
572
657
  function writeBuildOutputs(writes) {
573
658
  if (writes.length === 0) return;
@@ -2859,9 +2944,13 @@ async function themeBuildInternal(
2859
2944
  const writeRoot = options.__writeRoot ?? cwd;
2860
2945
  let outPath;
2861
2946
  if (options.out) {
2862
- // Relative or absolute, the explicit output stays inside the write root.
2863
2947
  outPath = path.resolve(cwd, options.out);
2864
- confineOutput(outPath, writeRoot, OUT_REMEDY, options.out);
2948
+ // A build keeps the explicit output inside the write root, relative or
2949
+ // absolute. Check mode writes nothing, so it refuses only a relative path
2950
+ // that escapes cwd.
2951
+ if (!options.check || !path.isAbsolute(options.out)) {
2952
+ confineOutput(outPath, writeRoot, OUT_REMEDY, options.out);
2953
+ }
2865
2954
  } else {
2866
2955
  outPath = path.join(path.dirname(filePath), `${baseName}.css`);
2867
2956
  }
@@ -2957,10 +3046,12 @@ async function themeBuildInternal(
2957
3046
  writes.push({dest: variantDtsPath, content: variantContent});
2958
3047
  }
2959
3048
 
2960
- // Every output stays inside cwd, including the defaults beside the theme
2961
- // file. Check mode refuses the same paths, so it never passes outputs that a
2962
- // build would refuse to write.
2963
- confineOutputs(writes, writeRoot, options.out ? OUT_REMEDY : SOURCE_REMEDY);
3049
+ // Every output a build writes stays inside cwd, including the defaults
3050
+ // beside the theme file. Check mode writes nothing, so it compares outputs
3051
+ // outside cwd read-only.
3052
+ if (!options.check) {
3053
+ confineOutputs(writes, writeRoot, options.out ? OUT_REMEDY : SOURCE_REMEDY);
3054
+ }
2964
3055
 
2965
3056
  // Check mode: compare generated content against what's on disk instead of
2966
3057
  // writing. A file is "stale" if it's missing or its content differs once the
@@ -2980,7 +3071,10 @@ async function themeBuildInternal(
2980
3071
  ` ${s.reason === 'missing' ? 'missing' : 'stale'}: ${s.path}`,
2981
3072
  );
2982
3073
  }
2983
- logger.error(`\n Rebuild with: ${buildCommand}`);
3074
+ // prettier-ignore
3075
+ const remedy = outsideCheckRemedy(writes, [filePath], writeRoot, relative => [relative(filePath), ...(options.out ? ['--out', relative(outPath)] : []), ...(options.iconsSpecifier ? ['--icons-specifier', options.iconsSpecifier] : [])]);
3076
+ if (remedy) logger.error(`\n ${remedy.join('\n ')}`);
3077
+ else logger.error(`\n Rebuild with: ${buildCommand}`);
2984
3078
  }
2985
3079
  return {
2986
3080
  type: 'theme.build.check',
@@ -3093,7 +3187,7 @@ function printBuildTrailer(trailer) {
3093
3187
  logger.log(`
3094
3188
  Install in your app (paths are relative to a file in src/; adjust if yours lives elsewhere):
3095
3189
 
3096
- import { Theme } from '@astryxdesign/core';
3190
+ import { Theme } from '@astryxdesign/core/theme';
3097
3191
  import { ${trailer.exportName} } from '${trailer.jsImport}';
3098
3192
  import '${trailer.cssImport}';
3099
3193
 
@@ -3103,7 +3197,7 @@ Install in your app (paths are relative to a file in src/; adjust if yours lives
3103
3197
 
3104
3198
  Or with a <link> tag:
3105
3199
 
3106
- import { Theme } from '@astryxdesign/core';
3200
+ import { Theme } from '@astryxdesign/core/theme';
3107
3201
  import { ${trailer.exportName} } from '${trailer.jsImport}';
3108
3202
 
3109
3203
  <link rel="stylesheet" href="${trailer.cssImport}" />
@@ -3129,7 +3223,7 @@ export function printBatchTrailer(trailers) {
3129
3223
  logger.log(`
3130
3224
  Install in your app (paths are relative to a file in src/; adjust if yours lives elsewhere):
3131
3225
 
3132
- import { Theme } from '@astryxdesign/core';
3226
+ import { Theme } from '@astryxdesign/core/theme';
3133
3227
  import { ${first.exportName} } from '${first.jsImport}';
3134
3228
  import '${first.cssImport}';
3135
3229
 
@@ -3139,7 +3233,7 @@ Install in your app (paths are relative to a file in src/; adjust if yours lives
3139
3233
 
3140
3234
  Or with a <link> tag:
3141
3235
 
3142
- import { Theme } from '@astryxdesign/core';
3236
+ import { Theme } from '@astryxdesign/core/theme';
3143
3237
  import { ${first.exportName} } from '${first.jsImport}';
3144
3238
 
3145
3239
  <link rel="stylesheet" href="${first.cssImport}" />
@@ -3506,8 +3600,8 @@ export async function themeBuildFamily(
3506
3600
  js: path.relative(cwd, jsPath),
3507
3601
  dts: path.relative(cwd, dtsPath),
3508
3602
  };
3509
- // The family's outputs stay inside cwd too, in check mode as well.
3510
- confineOutputs(writes, cwd, FAMILY_REMEDY);
3603
+ // A family build's outputs stay inside cwd too; check mode only reads them.
3604
+ if (!options.check) confineOutputs(writes, cwd, FAMILY_REMEDY);
3511
3605
  if (options.check) {
3512
3606
  const stale = staleBuildOutputs(writes, cwd);
3513
3607
  const upToDate = stale.length === 0;
@@ -3524,7 +3618,10 @@ export async function themeBuildFamily(
3524
3618
  ` ${entry.reason === 'missing' ? 'missing' : 'stale'}: ${entry.path}`,
3525
3619
  );
3526
3620
  }
3527
- logger.error(`\n Rebuild with: ${buildCommand}`);
3621
+ // prettier-ignore
3622
+ const remedy = outsideCheckRemedy(writes, members.map(member => member.filePath), cwd, relative => ['--family', ...members.map(member => relative(member.filePath)), '--family-key', baseName, ...(options.iconsSpecifier ? ['--icons-specifier', options.iconsSpecifier] : [])]);
3623
+ if (remedy) logger.error(`\n ${remedy.join('\n ')}`);
3624
+ else logger.error(`\n Rebuild with: ${buildCommand}`);
3528
3625
  }
3529
3626
  return {
3530
3627
  type: 'theme.build.check',
@@ -58,13 +58,13 @@ export const doc = {
58
58
  name: 'options.out',
59
59
  type: 'string',
60
60
  description:
61
- 'Override the output CSS path, relative or absolute; it must resolve inside cwd. The .js, .d.ts and any .variants.d.ts are written in the same directory, named after the theme (<name>.js), not after the CSS file.',
61
+ 'Override the output CSS path, relative or absolute; a build refuses a path outside cwd, and check mode refuses only a relative path that escapes cwd. The .js, .d.ts and any .variants.d.ts are written in the same directory, named after the theme (<name>.js), not after the CSS file.',
62
62
  },
63
63
  {
64
64
  name: 'options.check',
65
65
  type: 'boolean',
66
66
  description:
67
- 'Compile in memory and compare each output against what is on disk instead of writing: the CI drift guard.',
67
+ 'Compile in memory and compare each output against what is on disk instead of writing: the CI drift guard. Because it writes nothing, it also compares outputs outside cwd; when those are stale, the report names the directory that contains them and the build and check commands to run from there, since a build refuses them and each output records the directory it was built from.',
68
68
  default: 'false',
69
69
  },
70
70
  {
@@ -77,7 +77,7 @@ export const doc = {
77
77
  name: 'ctx.cwd',
78
78
  type: 'string',
79
79
  description:
80
- 'Directory the theme file, a relative out path, and the returned output paths resolve against. Every output is written inside it, including the default outputs beside the theme file.',
80
+ 'Directory the theme file, a relative out path, and the returned output paths resolve against. Every output a build writes is inside it, including the default outputs beside the theme file.',
81
81
  default: 'process.cwd()',
82
82
  },
83
83
  ],
@@ -105,7 +105,7 @@ export const doc = {
105
105
  },
106
106
  {
107
107
  code: 'ERR_PATH_TRAVERSAL',
108
- when: 'the theme name contains a path separator or traversal marker, or an output resolves outside cwd (including through a symlink): an `out` path, relative or absolute, or the default outputs beside a theme file outside cwd (also rejected in check mode)',
108
+ when: 'the theme name contains a path separator or traversal marker, or a written output resolves outside cwd (including through a symlink): an `out` path, relative or absolute, or the default outputs beside a theme file outside cwd. Check mode writes nothing, so it refuses only a relative `out` path that escapes cwd',
109
109
  },
110
110
  {
111
111
  code: 'ERR_CORE_NOT_FOUND',
@@ -31,6 +31,43 @@ export function detectInstalledTargetVersion(cwd: string): {
31
31
  version: string;
32
32
  packageName: string;
33
33
  } | null;
34
+ /**
35
+ * Whether the installed Core is newer than this CLI, so part of the requested
36
+ * range has no codemods here.
37
+ *
38
+ * Core codemods ship inside the CLI. A CLI older than the installed
39
+ * `@astryxdesign/core` has none for the releases after its own version, so it
40
+ * can find no codemods, or stop partway, while the code still needs those
41
+ * releases' migrations. The returned command repeats this upgrade with the CLI
42
+ * release that matches the installed Core.
43
+ *
44
+ * Where an upgrade runs decides what it finds: the installed Core is read
45
+ * from that folder, and `--path` must stay inside it. So the command first
46
+ * changes to `cwd`, the folder this run used, then names `sourcePath`, the
47
+ * directory this run scanned, as an absolute `--path`. Both are named by their
48
+ * physical paths, with every symbolic link resolved: a shell's `cd` follows a
49
+ * link, but the CLI it starts reads its folder with every link resolved and
50
+ * checks `--path` against that. Pasted from any folder, the command finds the
51
+ * same Core and scans the same directory, even after a package runner moved
52
+ * this run (Yarn 1 runs `yarn astryx` at the project root). It is written for
53
+ * a POSIX shell, or for PowerShell on Windows (cmd.exe is not a target), with
54
+ * every argument quoted for that shell.
55
+ *
56
+ * Returns null when the CLI covers the whole range (`to` is not newer than
57
+ * both the CLI and `from`), when the CLI's own version cannot be read, or when
58
+ * the target is legacy `@xds/core`, which no CLI release shares a version with.
59
+ *
60
+ * @param {{from: string, to: string, packageName: string, options: UpgradeOptions, cwd: string, sourcePath: string}} input
61
+ * @returns {import('./upgrade.type.mjs').CliBehindCore | null}
62
+ */
63
+ export function detectCliBehindCore({ from, to, packageName, options, cwd, sourcePath, }: {
64
+ from: string;
65
+ to: string;
66
+ packageName: string;
67
+ options: UpgradeOptions;
68
+ cwd: string;
69
+ sourcePath: string;
70
+ }): import("./upgrade.type.mjs").CliBehindCore | null;
34
71
  /**
35
72
  * @param {(string | null | undefined | false)[] | undefined} files
36
73
  * @returns {string[]}
@@ -104,9 +141,9 @@ export function ensureCodemodDeps({ installDeps }?: {
104
141
  * Run the CORE registry codemods. Runs BEFORE the config is loaded so a core
105
142
  * CONFIG codemod can repair a config the strict loader would otherwise reject.
106
143
  * @param {CoreVersionManifest[]} versionManifests
107
- * @param {{apply: boolean, path: string, codemod?: string, skipCodemods: Set<string>, root?: string, protection?: {root: string, classify: (file: string) => import('../../foundation/fs/file-protection.mjs').FileProtection[]}, silent?: boolean}} options
144
+ * @param {{apply: boolean, path: string, codemod?: string, skipCodemods: Set<string>, root?: string, protection?: {root: string, classify: (file: string) => import('../../foundation/fs/file-protection.mjs').FileProtection[]}, silent?: boolean, coversTarget?: boolean}} options
108
145
  */
109
- export function runCoreCodemods(versionManifests: CoreVersionManifest[], { apply, path: srcPath, codemod, skipCodemods, root, protection, silent }: {
146
+ export function runCoreCodemods(versionManifests: CoreVersionManifest[], { apply, path: srcPath, codemod, skipCodemods, root, protection, silent, coversTarget, }: {
110
147
  apply: boolean;
111
148
  path: string;
112
149
  codemod?: string;
@@ -117,6 +154,7 @@ export function runCoreCodemods(versionManifests: CoreVersionManifest[], { apply
117
154
  classify: (file: string) => import("../../foundation/fs/file-protection.mjs").FileProtection[];
118
155
  };
119
156
  silent?: boolean;
157
+ coversTarget?: boolean;
120
158
  }): Promise<{
121
159
  totalFilesChanged: number;
122
160
  totalTransformsApplied: number;