@astryxdesign/cli 0.6.3-canary.e073c9f → 0.6.3-canary.ea2f048

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 (188) hide show
  1. package/README.md +1 -2
  2. package/api/build/build.type.d.mts +2 -2
  3. package/api/build/build.type.mjs +2 -2
  4. package/api/component/component.type.d.mts +6 -6
  5. package/api/component/component.type.mjs +19 -19
  6. package/api/discover/discover.type.d.mts +4 -4
  7. package/api/discover/discover.type.mjs +10 -10
  8. package/api/docs/_adapter.d.mts +24 -37
  9. package/api/docs/_adapter.mjs +83 -169
  10. package/api/docs/detail/detail.mjs +63 -14
  11. package/api/docs/detail/section/section.d.mts +1 -1
  12. package/api/docs/detail/section/section.mjs +20 -44
  13. package/api/docs/detail/section/section.test.mjs +0 -41
  14. package/api/docs/docs.d.mts +2 -7
  15. package/api/docs/docs.doc.mjs +10 -27
  16. package/api/docs/docs.mjs +9 -16
  17. package/api/docs/docs.test.mjs +0 -6
  18. package/api/docs/docs.type.d.mts +3 -40
  19. package/api/docs/docs.type.mjs +8 -36
  20. package/api/docs/integrationDocs.test.mjs +0 -106
  21. package/api/doctor/doctor.d.mts +0 -48
  22. package/api/doctor/doctor.mjs +0 -232
  23. package/api/doctor/doctor.test.mjs +0 -196
  24. package/api/hook/hook.type.d.mts +3 -3
  25. package/api/hook/hook.type.mjs +11 -11
  26. package/api/hook/list/list.d.mts +1 -1
  27. package/api/integration/add-contribution.mjs +3 -5
  28. package/api/integration/add-contribution.test.mjs +4 -4
  29. package/api/integration/integration-authoring.type.d.mts +1 -1
  30. package/api/integration/pack-check.mjs +7 -49
  31. package/api/integration/pack-check.test.mjs +0 -249
  32. package/api/search/search.d.mts +1 -1
  33. package/api/search/search.mjs +5 -5
  34. package/api/search/search.type.d.mts +2 -2
  35. package/api/search/search.type.mjs +1 -1
  36. package/api/swizzle/swizzle.type.d.mts +2 -2
  37. package/api/swizzle/swizzle.type.mjs +2 -2
  38. package/api/template/template.d.mts +1 -1
  39. package/api/template/template.type.d.mts +6 -6
  40. package/api/template/template.type.mjs +12 -12
  41. package/api/theme/build/build.mjs +6 -20
  42. package/api/theme/build/build.test.mjs +0 -127
  43. package/api/theme/palette/generate/generate.mjs +1 -1
  44. package/api/theme/palette/generate/generator.d.mts +13 -10
  45. package/api/theme/palette/generate/generator.mjs +3 -7
  46. package/api/theme/theme.type.d.mts +11 -170
  47. package/api/theme/theme.type.mjs +27 -94
  48. package/api/upgrade/_adapter.mjs +5 -71
  49. package/api/upgrade/upgrade.doc.mjs +3 -4
  50. package/api/upgrade/upgrade.type.d.mts +5 -5
  51. package/api/upgrade/upgrade.type.mjs +11 -11
  52. package/assets/codemods/integration-discovery.mjs +2 -40
  53. package/assets/codemods/integration-discovery.test.mjs +0 -58
  54. package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +5 -27
  55. package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +5 -20
  56. package/assets/docs/README.md +0 -9
  57. package/assets/docs/cli-integrations.doc.mjs +15 -86
  58. package/assets/docs/styling-libraries.doc.mjs +1 -1
  59. package/assets/docs/working-with-ai.doc.mjs +1 -1
  60. package/authoring/_shared/contract.ts +0 -22
  61. package/authoring/codemod/codemod.doc.mjs +1 -6
  62. package/authoring/codemod/parse.d.mts +8 -8
  63. package/authoring/codemod/parse.mjs +6 -8
  64. package/authoring/config/parse.d.mts +13 -13
  65. package/authoring/config/parse.mjs +8 -8
  66. package/authoring/config/type.ts +3 -3
  67. package/authoring/debug/parse.d.mts +5 -5
  68. package/authoring/debug/parse.mjs +3 -3
  69. package/authoring/doctypes/_schema.d.mts +23 -788
  70. package/authoring/doctypes/_schema.mjs +39 -492
  71. package/authoring/doctypes/base/type.ts +0 -40
  72. package/authoring/doctypes/command/command.doc.mjs +2 -3
  73. package/authoring/doctypes/command/parse.d.mts +2 -2
  74. package/authoring/doctypes/command/parse.mjs +1 -1
  75. package/authoring/doctypes/command/type.ts +2 -3
  76. package/authoring/doctypes/component/component.doc.mjs +3 -6
  77. package/authoring/doctypes/component/parse.d.mts +2 -2
  78. package/authoring/doctypes/component/parse.mjs +1 -1
  79. package/authoring/doctypes/component/type.ts +3 -4
  80. package/authoring/doctypes/enum/parse.d.mts +2 -2
  81. package/authoring/doctypes/enum/parse.mjs +1 -1
  82. package/authoring/doctypes/enum/type.ts +1 -3
  83. package/authoring/doctypes/function/function.doc.mjs +0 -4
  84. package/authoring/doctypes/function/parse.d.mts +2 -2
  85. package/authoring/doctypes/function/parse.mjs +1 -1
  86. package/authoring/doctypes/function/type.ts +2 -6
  87. package/authoring/doctypes/hook/hook.doc.mjs +0 -4
  88. package/authoring/doctypes/hook/parse.d.mts +2 -2
  89. package/authoring/doctypes/hook/parse.mjs +1 -1
  90. package/authoring/doctypes/hook/type.ts +2 -3
  91. package/authoring/doctypes/legacy.d.mts +6 -8
  92. package/authoring/doctypes/legacy.mjs +4 -5
  93. package/authoring/doctypes/parse.d.mts +18 -20
  94. package/authoring/doctypes/parse.mjs +10 -16
  95. package/authoring/doctypes/parse.test.mjs +3 -77
  96. package/authoring/doctypes/reference/parse.d.mts +2 -2
  97. package/authoring/doctypes/reference/parse.mjs +5 -8
  98. package/authoring/doctypes/reference/reference.doc.mjs +4 -17
  99. package/authoring/doctypes/reference/type.ts +5 -51
  100. package/authoring/doctypes/schema/parse.d.mts +2 -2
  101. package/authoring/doctypes/schema/parse.mjs +1 -1
  102. package/authoring/doctypes/schema/type.ts +2 -3
  103. package/authoring/doctypes/template/parse.d.mts +1 -92
  104. package/authoring/doctypes/template/parse.mjs +2 -36
  105. package/authoring/doctypes/template/parse.test.mjs +2 -8
  106. package/authoring/doctypes/template/template.doc.mjs +0 -4
  107. package/authoring/doctypes/template/type.ts +2 -5
  108. package/authoring/doctypes/types.ts +9 -10
  109. package/authoring/gap-report/parse.d.mts +10 -10
  110. package/authoring/gap-report/parse.mjs +6 -6
  111. package/authoring/gap-report/type.ts +1 -1
  112. package/authoring/index.d.mts +0 -1
  113. package/authoring/index.d.ts +17 -49
  114. package/authoring/index.mjs +0 -1
  115. package/authoring/integration/integration.doc.mjs +6 -13
  116. package/authoring/integration/parse.d.mts +2 -2
  117. package/authoring/integration/parse.mjs +1 -1
  118. package/authoring/integration/parse.test.mjs +1 -10
  119. package/authoring/integration/schema.d.mts +4 -6
  120. package/authoring/integration/schema.mjs +3 -9
  121. package/authoring/integration/type.ts +6 -23
  122. package/authoring/shadcn/receipt.d.mts +6 -6
  123. package/clients/cli/commands/docs.doc.mjs +3 -13
  124. package/clients/cli/commands/docs.mjs +21 -121
  125. package/clients/cli/commands/docs.test.mjs +0 -88
  126. package/clients/cli/commands/integration-authoring.test.mjs +9 -13
  127. package/clients/cli/commands/theme-palette-generate.doc.mjs +4 -8
  128. package/clients/cli/commands/upgrade.doc.mjs +2 -2
  129. package/clients/cli/formatters/index.mjs +1 -162
  130. package/clients/cli/formatters/index.test.mjs +0 -91
  131. package/clients/cli/lib/manifest.mjs +2 -7
  132. package/foundation/config/project.mjs +6 -21
  133. package/foundation/discovery/component-discovery.d.mts +1 -1
  134. package/foundation/discovery/component-discovery.mjs +1 -2
  135. package/foundation/discovery/docs-discovery.d.mts +4 -11
  136. package/foundation/discovery/docs-discovery.mjs +88 -208
  137. package/foundation/discovery/docs-discovery.test.mjs +13 -279
  138. package/foundation/discovery/template-adapter.mjs +1 -2
  139. package/foundation/discovery/theming-targets.test.mjs +0 -4
  140. package/foundation/integrations/autolink.mjs +5 -12
  141. package/foundation/integrations/integration-warnings.mjs +0 -6
  142. package/foundation/integrations/integrations.d.mts +2 -46
  143. package/foundation/integrations/integrations.mjs +8 -167
  144. package/foundation/integrations/integrations.test.mjs +1 -384
  145. package/foundation/integrations/validate-contributions.d.mts +0 -2
  146. package/foundation/integrations/validate-contributions.mjs +0 -10
  147. package/foundation/response/json-contract.test.mjs +17 -46
  148. package/foundation/response/response-types.doc.mjs +1 -6
  149. package/package.json +11 -9
  150. package/api/docs/compiled-topics.test.mjs +0 -78
  151. package/api/docs/index/index.d.mts +0 -18
  152. package/api/docs/index/index.mjs +0 -32
  153. package/api/docs/index/index.test.mjs +0 -62
  154. package/api/upgrade/project-context.test.mjs +0 -272
  155. package/assets/docs/authoring.doc.mjs +0 -14
  156. package/authoring/doctypes/base/graph-fields.doc.d.mts +0 -9
  157. package/authoring/doctypes/base/graph-fields.doc.mjs +0 -62
  158. package/authoring/doctypes/load-contract.test.mjs +0 -207
  159. package/authoring/doctypes/namespace/namespace.doc.d.mts +0 -9
  160. package/authoring/doctypes/namespace/namespace.doc.mjs +0 -132
  161. package/authoring/doctypes/namespace/parse.d.mts +0 -12
  162. package/authoring/doctypes/namespace/parse.mjs +0 -25
  163. package/authoring/doctypes/namespace/parse.test.mjs +0 -165
  164. package/authoring/doctypes/namespace/type.ts +0 -71
  165. package/authoring/identity/identity.doc.d.mts +0 -9
  166. package/authoring/identity/identity.doc.mjs +0 -61
  167. package/authoring/identity/type.ts +0 -132
  168. package/foundation/discovery/authoring-self-docs.d.mts +0 -69
  169. package/foundation/discovery/authoring-self-docs.mjs +0 -214
  170. package/foundation/discovery/authoring-self-docs.test.mjs +0 -154
  171. package/foundation/discovery/docs-output-budget.d.mts +0 -28
  172. package/foundation/discovery/docs-output-budget.mjs +0 -50
  173. package/foundation/discovery/docs-section-key.d.mts +0 -98
  174. package/foundation/discovery/docs-section-key.mjs +0 -221
  175. package/foundation/discovery/docs-section-key.test.mjs +0 -224
  176. package/foundation/doc-compiler/compile.d.mts +0 -162
  177. package/foundation/doc-compiler/compile.mjs +0 -262
  178. package/foundation/doc-compiler/doc-compiler.test.mjs +0 -687
  179. package/foundation/doc-compiler/ir.d.mts +0 -9
  180. package/foundation/doc-compiler/ir.mjs +0 -287
  181. package/foundation/doc-compiler/lenses.d.mts +0 -33
  182. package/foundation/doc-compiler/lenses.mjs +0 -127
  183. package/foundation/identity/provider-identity.d.mts +0 -90
  184. package/foundation/identity/provider-identity.mjs +0 -320
  185. package/foundation/identity/provider-identity.test.mjs +0 -254
  186. package/foundation/identity/providers.d.mts +0 -7
  187. package/foundation/identity/providers.mjs +0 -16
  188. package/foundation/integrations/provider-conflicts.test.mjs +0 -125
@@ -1,125 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Provider-identity conflicts proved against the repository's real
5
- * integration packages instead of hand-written fixtures: the Lab package as it
6
- * ships, beside a copy of Charts whose manifest also claims Lab's provider ID.
7
- *
8
- * Fixtures live under a repo-local temp dir, not /tmp, because Vite refuses to
9
- * dynamically import a module from outside the project root.
10
- */
11
-
12
- import {afterEach, beforeEach, describe, expect, it} from 'vitest';
13
- import * as fs from 'node:fs';
14
- import * as path from 'node:path';
15
- import {fileURLToPath} from 'node:url';
16
- import {Project} from '../config/project.mjs';
17
- import {doctor} from '../../api/doctor/doctor.mjs';
18
- import {runCli} from '../../test-utils/run-cli.mjs';
19
-
20
- const REPO = path.resolve(
21
- path.dirname(fileURLToPath(import.meta.url)),
22
- '../../../..',
23
- );
24
- const CHARTS = path.join(REPO, 'packages', 'charts');
25
- const SLOW = 60_000;
26
-
27
- /** Both packages are named; Lab is named as the one used, Charts as set aside. */
28
- const WINNER_NAMED =
29
- /@astryxdesign\/charts@\S+ and @astryxdesign\/lab@\S+ both claim provider ID "@astryxdesign\/lab"\. @astryxdesign\/lab@\S+ loads first and is used; @astryxdesign\/charts@\S+ contributes nothing/u;
30
-
31
- let consumer;
32
- let chartsManifest;
33
-
34
- beforeEach(() => {
35
- consumer = fs.mkdtempSync(
36
- path.join(process.cwd(), '.astryx-provider-conflict-'),
37
- );
38
- const scope = path.join(consumer, 'node_modules', '@astryxdesign');
39
- fs.mkdirSync(scope, {recursive: true});
40
- fs.symlinkSync(
41
- path.join(REPO, 'packages', 'lab'),
42
- path.join(scope, 'lab'),
43
- 'dir',
44
- );
45
-
46
- const charts = path.join(scope, 'charts');
47
- fs.cpSync(CHARTS, charts, {
48
- recursive: true,
49
- filter: source => {
50
- const [top] = path.relative(CHARTS, source).split(path.sep);
51
- return top !== 'node_modules' && top !== 'dist';
52
- },
53
- });
54
- chartsManifest = path.join(charts, 'astryx.integration.mjs');
55
- const shipped = fs.readFileSync(chartsManifest, 'utf8');
56
- const claimed = shipped.replace(
57
- 'export default {',
58
- "export default {\n providerId: '@astryxdesign/lab',",
59
- );
60
- expect(claimed).not.toBe(shipped);
61
- fs.writeFileSync(chartsManifest, claimed);
62
-
63
- fs.writeFileSync(
64
- path.join(consumer, 'package.json'),
65
- JSON.stringify({name: 'consumer', private: true}),
66
- );
67
- fs.writeFileSync(
68
- path.join(consumer, 'astryx.config.mjs'),
69
- "export default {integrations: ['@astryxdesign/lab', '@astryxdesign/charts']};\n",
70
- );
71
- });
72
-
73
- afterEach(() => {
74
- fs.rmSync(consumer, {recursive: true, force: true});
75
- });
76
-
77
- describe('provider identity conflicts in the real integration packages', () => {
78
- it('keeps Lab, sets Charts aside, and names both on every surface', async () => {
79
- const project = await Project.load(consumer, {fresh: true});
80
- const components = await project.components();
81
- expect(
82
- components.filter(component => component.package === '@astryxdesign/lab')
83
- .length,
84
- ).toBeGreaterThan(0);
85
- expect(
86
- components.some(component => component.package === '@astryxdesign/charts'),
87
- ).toBe(false);
88
- const conflicts = (await project.issues()).filter(
89
- issue => issue.code === 'duplicate_provider',
90
- );
91
- expect(conflicts).toEqual([
92
- expect.objectContaining({
93
- package: expect.stringMatching(/^@astryxdesign\/charts@\S+$/u),
94
- severity: 'warning',
95
- message: expect.stringMatching(WINNER_NAMED),
96
- }),
97
- ]);
98
-
99
- const report = await doctor({cwd: consumer});
100
- const check = report.data.checks.find(
101
- candidate => candidate.id === 'provider-identity',
102
- );
103
- expect(check?.status).toBe('warn');
104
- expect(check?.message).toMatch(WINNER_NAMED);
105
-
106
- const cli = await runCli(['component', '--list'], consumer);
107
- expect(cli.status).toBe(0);
108
- expect(cli.stderr).toMatch(WINNER_NAMED);
109
- }, SLOW);
110
-
111
- it('loads both real packages without an issue once their IDs differ', async () => {
112
- fs.copyFileSync(path.join(CHARTS, 'astryx.integration.mjs'), chartsManifest);
113
-
114
- const project = await Project.load(consumer, {fresh: true});
115
- const components = await project.components();
116
- expect(
117
- components.some(component => component.package === '@astryxdesign/charts'),
118
- ).toBe(true);
119
- expect(
120
- (await project.issues()).filter(
121
- issue => issue.code === 'duplicate_provider',
122
- ),
123
- ).toEqual([]);
124
- }, SLOW);
125
- });