@astryxdesign/cli 0.6.4-canary.ed2e54e → 0.6.4

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 (145) hide show
  1. package/README.md +66 -64
  2. package/api/component/_adapter.d.mts +0 -25
  3. package/api/component/_adapter.mjs +5 -59
  4. package/api/component/component.d.mts +3 -6
  5. package/api/component/component.doc.mjs +10 -23
  6. package/api/component/component.mjs +9 -249
  7. package/api/component/component.type.d.mts +0 -25
  8. package/api/component/component.type.mjs +0 -44
  9. package/api/discover/_adapter.d.mts +6 -114
  10. package/api/discover/_adapter.mjs +17 -372
  11. package/api/discover/detail/detail.d.mts +6 -18
  12. package/api/discover/detail/detail.mjs +13 -67
  13. package/api/discover/detail/detail.test.mjs +0 -85
  14. package/api/discover/discover.d.mts +9 -3
  15. package/api/discover/discover.doc.mjs +18 -61
  16. package/api/discover/discover.mjs +36 -220
  17. package/api/discover/discover.test.mjs +2 -11
  18. package/api/discover/discover.type.d.mts +8 -147
  19. package/api/discover/discover.type.mjs +12 -102
  20. package/api/discover/list/list.d.mts +6 -20
  21. package/api/discover/list/list.mjs +12 -45
  22. package/api/discover/list/list.test.mjs +0 -46
  23. package/api/discover/search/search.d.mts +16 -18
  24. package/api/discover/search/search.mjs +56 -102
  25. package/api/discover/search/search.test.mjs +10 -144
  26. package/api/docs/docs.test.mjs +0 -2
  27. package/api/doctor/doctor.d.mts +3 -8
  28. package/api/doctor/doctor.mjs +9 -90
  29. package/api/doctor/doctor.test.mjs +10 -122
  30. package/api/index.d.mts +2 -1
  31. package/api/index.mjs +4 -4
  32. package/api/integration/add-helpers.d.mts +2 -5
  33. package/api/integration/add-helpers.mjs +9 -36
  34. package/api/integration/pack-check.mjs +3 -28
  35. package/api/json/index.ts +1 -0
  36. package/api/layout/_adapter.d.mts +34 -0
  37. package/api/layout/_adapter.mjs +148 -0
  38. package/api/layout/check/check.d.mts +16 -0
  39. package/api/layout/check/check.mjs +40 -0
  40. package/api/layout/expand/expand.d.mts +22 -0
  41. package/api/layout/expand/expand.mjs +155 -0
  42. package/api/layout/expand/expand.path-safety.test.mjs +53 -0
  43. package/api/layout/grammar/grammar.d.mts +13 -0
  44. package/api/layout/grammar/grammar.mjs +87 -0
  45. package/api/layout/layout.d.mts +6 -0
  46. package/api/layout/layout.mjs +17 -0
  47. package/api/layout/layout.test.mjs +297 -0
  48. package/api/layout/layout.type.d.mts +89 -0
  49. package/api/layout/layout.type.mjs +103 -0
  50. package/api/layout/layoutCheck.doc.d.mts +11 -0
  51. package/api/layout/layoutCheck.doc.mjs +85 -0
  52. package/api/layout/layoutExpand.doc.d.mts +11 -0
  53. package/api/layout/layoutExpand.doc.mjs +107 -0
  54. package/api/layout/layoutGrammar.doc.d.mts +11 -0
  55. package/api/layout/layoutGrammar.doc.mjs +57 -0
  56. package/api/search/search.test.mjs +0 -18
  57. package/api/template/template-integration.test.mjs +65 -1
  58. package/api/template/template.mjs +1 -1
  59. package/api/theme/add/add.mjs +25 -17
  60. package/api/theme/add/add.staging.test.mjs +23 -40
  61. package/api/theme/build/build.family.test.mjs +12 -7
  62. package/api/theme/build/build.mjs +18 -8
  63. package/api/upgrade/run/run.mjs +4 -6
  64. package/api/upgrade/upgrade.type.mjs +2 -2
  65. package/assets/codemods/__tests__/runner.test.mjs +1 -3
  66. package/assets/codemods/integration-runner.mjs +3 -3
  67. package/assets/codemods/runner.mjs +4 -5
  68. package/assets/docs/internationalization.doc.mjs +5 -7
  69. package/assets/docs/tree/integrations.doc.mjs +1 -20
  70. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
  71. package/authoring/config/config.doc.mjs +1 -9
  72. package/authoring/config/parse.d.mts +0 -2
  73. package/authoring/config/parse.mjs +0 -19
  74. package/authoring/config/parse.test.mjs +0 -8
  75. package/authoring/config/type.ts +2 -13
  76. package/authoring/doctypes/command/command.doc.mjs +1 -1
  77. package/authoring/doctypes/command/type.ts +1 -1
  78. package/authoring/index.d.mts +0 -1
  79. package/authoring/index.d.ts +0 -10
  80. package/authoring/index.mjs +0 -1
  81. package/clients/cli/command-result-coverage.test.mjs +7 -7
  82. package/clients/cli/commands/component/index.mjs +55 -152
  83. package/clients/cli/commands/component-ownership.test.mjs +0 -89
  84. package/clients/cli/commands/component.doc.mjs +6 -23
  85. package/clients/cli/commands/debug-result-summary.test.mjs +2 -2
  86. package/clients/cli/commands/discover.doc.mjs +9 -53
  87. package/clients/cli/commands/discover.mjs +118 -393
  88. package/clients/cli/commands/docs.test.mjs +0 -29
  89. package/clients/cli/commands/layout-check.doc.mjs +65 -0
  90. package/clients/cli/commands/layout-expand.doc.mjs +83 -0
  91. package/clients/cli/commands/layout-grammar.doc.mjs +30 -0
  92. package/clients/cli/commands/layout.doc.mjs +34 -0
  93. package/clients/cli/commands/layout.error-codes.test.mjs +66 -0
  94. package/clients/cli/commands/layout.exit-parity.test.mjs +41 -0
  95. package/clients/cli/commands/layout.mjs +275 -0
  96. package/clients/cli/commands/layout.path-help.test.mjs +33 -0
  97. package/clients/cli/commands/layout.stdin-cap.test.mjs +47 -0
  98. package/clients/cli/commands/layout.text-fields.test.mjs +39 -0
  99. package/clients/cli/commands/text-json-parity.test.mjs +17 -0
  100. package/clients/cli/index.mjs +4 -0
  101. package/clients/cli/lib/exit-codes.test.mjs +8 -1
  102. package/clients/cli/lib/json-shim.mjs +14 -24
  103. package/clients/cli/lib/json-shim.test.mjs +20 -6
  104. package/clients/cli/lib/manifest.mjs +8 -3
  105. package/clients/cli/lib/manifest.test.mjs +2 -5
  106. package/foundation/discovery/authoring-self-docs.mjs +0 -1
  107. package/foundation/discovery/template-adapter.mjs +1 -1
  108. package/foundation/doc-compiler/doc-loads.test.mjs +12 -0
  109. package/foundation/doc-compiler/tree.test.mjs +1 -9
  110. package/foundation/integrations/integrations.d.mts +1 -14
  111. package/foundation/integrations/integrations.mjs +1 -41
  112. package/foundation/integrations/integrations.test.mjs +0 -31
  113. package/foundation/response/response-types.doc.mjs +21 -15
  114. package/foundation/response/response-types.doc.test.mjs +0 -23
  115. package/foundation/xle/browser.d.mts +3 -3
  116. package/foundation/xle/browser.mjs +3 -3
  117. package/foundation/xle/expand.mjs +2 -2
  118. package/foundation/xle/parse.mjs +1 -1
  119. package/foundation/xle/print.mjs +2 -2
  120. package/foundation/xle/splice.mjs +1 -1
  121. package/package.json +9 -9
  122. package/api/discover/_adapter.test.mjs +0 -215
  123. package/api/discover/_catalog-view.d.mts +0 -115
  124. package/api/discover/_catalog-view.mjs +0 -203
  125. package/api/discover/_catalog-view.test.mjs +0 -128
  126. package/api/discover/detail/item/item.d.mts +0 -26
  127. package/api/discover/detail/item/item.mjs +0 -78
  128. package/api/discover/detail/item/item.test.mjs +0 -73
  129. package/api/integration/pack-check.lifecycle-output.test.mjs +0 -105
  130. package/api/theme/add/add.rollback.test.mjs +0 -158
  131. package/api/theme/build/build.rollback.test.mjs +0 -148
  132. package/api/upgrade/run/files-changed.test.mjs +0 -111
  133. package/assets/codemods/file-count.test.mjs +0 -163
  134. package/assets/docs/tree/component-lookups.doc.mjs +0 -149
  135. package/authoring/discover/discover.doc.d.mts +0 -13
  136. package/authoring/discover/discover.doc.mjs +0 -138
  137. package/authoring/discover/parse.d.mts +0 -24
  138. package/authoring/discover/parse.mjs +0 -128
  139. package/authoring/discover/parse.test.mjs +0 -124
  140. package/authoring/discover/type.ts +0 -87
  141. package/clients/cli/commands/component-batch.test.mjs +0 -341
  142. package/clients/cli/commands/discover.sources.test.mjs +0 -267
  143. package/clients/cli/lib/parse-error-format.test.mjs +0 -81
  144. package/foundation/response/batch.type.d.mts +0 -33
  145. package/foundation/response/batch.type.mjs +0 -34
@@ -38,7 +38,6 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
38
38
  *
39
39
  * @typedef {(
40
40
  * | import('../../../../api/component/component.type.mjs').ComponentListResponse
41
- * | import('../../../../api/component/component.type.mjs').ComponentBatchResponse
42
41
  * | import('../../../../api/component/component.type.mjs').ComponentDetailResponse
43
42
  * | import('../../../../api/component/component.type.mjs').ComponentDetailPropsResponse
44
43
  * | import('../../../../api/component/component.type.mjs').ComponentDetailSourceResponse
@@ -68,11 +67,6 @@ function summarize(result) {
68
67
  );
69
68
  return resultSet({count, resultKind: 'component'});
70
69
  }
71
- case 'component.batch':
72
- return resultSet({
73
- count: result.data.results.filter(row => row.status === 'found').length,
74
- resultKind: 'component',
75
- });
76
70
  case 'component.detail':
77
71
  case 'component.detail.props':
78
72
  case 'component.detail.source':
@@ -88,103 +82,19 @@ function summarize(result) {
88
82
  }
89
83
  }
90
84
 
91
- /**
92
- * Project one single-component API result through the existing formatter kit.
93
- * @param {import('../../../../api/component/component.type.mjs').ComponentSingleResponse} result
94
- * @param {string} requestedName
95
- * @param {'full'|'compact'|'brief'} detail
96
- * @param {ReturnType<typeof resolveTheme>} themeData
97
- * @returns {import('../../formatters/index.mjs').Block[]}
98
- */
99
- function componentDetailBlocks(result, requestedName, detail, themeData) {
100
- const resolvedName = (requestedName.split('/').pop() ?? requestedName).replace(
101
- /^XDS/,
102
- '',
103
- );
104
- switch (result.type) {
105
- case 'component.detail': {
106
- /** @type {import('../../formatters/index.mjs').Block[]} */
107
- const out = [];
108
- if (result.data.parentDoc) {
109
- out.push(record(result.data, {fields: ['parentDoc']}));
110
- }
111
- out.push(
112
- detail === 'brief'
113
- ? code(
114
- formatBrief(result.data, resolvedName, result.data.import, {
115
- themeData,
116
- }),
117
- )
118
- : detail === 'compact'
119
- ? code(
120
- formatCompact(result.data, resolvedName, result.data.import),
121
- )
122
- : code(
123
- formatFull(result.data, {
124
- themeData,
125
- importHint: result.data.import,
126
- }),
127
- ),
128
- );
129
- return out;
130
- }
131
- case 'component.detail.props':
132
- return [code(formatProps({props: result.data}, resolvedName))];
133
- case 'component.detail.source':
134
- case 'component.detail.showcase':
135
- return [code(result.data.source)];
136
- case 'component.detail.blocks': {
137
- const {showcase, examples, related} = result.data;
138
- /** @type {import('../../formatters/index.mjs').Block[]} */
139
- const out = [];
140
- if (showcase) {
141
- out.push(
142
- section('Showcase'),
143
- record(showcase, {fields: ['displayName', 'description']}),
144
- );
145
- }
146
- if (examples.length > 0) {
147
- out.push(
148
- section('Examples'),
149
- records(examples, {fields: ['name', 'description']}),
150
- );
151
- }
152
- if (related.length > 0) {
153
- out.push(
154
- section(
155
- `Related: ${related.length} blocks that use ${result.data.component}`,
156
- ),
157
- list(related.map(block => block.name)),
158
- );
159
- }
160
- if (!showcase && examples.length === 0 && related.length === 0) {
161
- out.push(text(`No blocks found for ${result.data.component}`));
162
- }
163
- return out;
164
- }
165
- default:
166
- return [];
167
- }
168
- }
169
-
170
85
  /**
171
86
  * @param {import('commander').Command} program
172
87
  */
173
88
  export function registerComponent(program) {
174
89
  defineCommand(program, componentCommand, {
175
90
  fn: componentFn,
176
- action: async (
177
- /** @type {string[] | undefined} */ names,
178
- /** @type {{list?: boolean, category?: string, props?: boolean, source?: boolean, showcase?: boolean, blocks?: boolean, package?: string}} */ options,
179
- ) => {
91
+ action: async (/** @type {string | undefined} */ name, /** @type {{list?: boolean, category?: string, props?: boolean, source?: boolean, showcase?: boolean, blocks?: boolean, package?: string}} */ options) => {
180
92
  const run = getCliInvocation();
181
- const name = names?.length === 1 ? names[0] : undefined;
182
- const apiInput = !names?.length ? undefined : name ?? names;
183
93
  const zh = program.opts().zh || false;
184
94
  const dense = program.opts().dense || false;
185
95
  const lang = program.opts().lang || null;
186
96
  const detailSource = program.getOptionValueSource('detail');
187
- const isListView = options.list || options.category || !names?.length;
97
+ const isListView = options.list || options.category || !name;
188
98
  // Default detail level is full for single-component view, brief for list views.
189
99
  // (List views are scannable name lists; users can opt into compact/full.)
190
100
  let detail = program.opts().detail || 'full';
@@ -209,7 +119,7 @@ export function registerComponent(program) {
209
119
  /** @type {ComponentResult} */
210
120
  let result;
211
121
  try {
212
- result = /** @type {ComponentResult} */ (await componentApi(apiInput, {
122
+ result = /** @type {ComponentResult} */ (await componentApi(name, {
213
123
  cwd: process.cwd(),
214
124
  list: options.list,
215
125
  category: options.category,
@@ -227,12 +137,6 @@ export function registerComponent(program) {
227
137
  }
228
138
 
229
139
  const answered = summarize(result);
230
- if (
231
- result.type === 'component.batch' &&
232
- result.data.results.some(row => row.status !== 'found')
233
- ) {
234
- process.exitCode = 1;
235
- }
236
140
  if (json) {
237
141
  jsonOut(result);
238
142
  return answered;
@@ -248,7 +152,7 @@ export function registerComponent(program) {
248
152
  const listFooter = text(
249
153
  [
250
154
  `Import from the path shown (e.g. import {Button} from '@astryxdesign/core/Button')`,
251
- `Usage: ${run} component <name> [name...]`,
155
+ `Usage: ${run} component <name>`,
252
156
  ].join('\n'),
253
157
  );
254
158
 
@@ -327,65 +231,64 @@ export function registerComponent(program) {
327
231
  break;
328
232
  }
329
233
 
330
- case 'component.batch': {
234
+ case 'component.detail': {
235
+ const resolvedName = (name || '').replace(/^XDS/, '');
236
+ const importHint = result.data.import;
237
+ if (result.data.parentDoc) emit(record(result.data, {fields: ['parentDoc']}));
238
+ const doc =
239
+ detail === 'brief'
240
+ ? code(formatBrief(result.data, resolvedName, importHint, {themeData}))
241
+ : detail === 'compact'
242
+ ? code(formatCompact(result.data, resolvedName, importHint))
243
+ : code(formatFull(result.data, {themeData, importHint}));
244
+ emit(doc);
245
+ break;
246
+ }
247
+
248
+ case 'component.detail.props': {
249
+ const resolvedName = (name || '').replace(/^XDS/, '');
250
+ emit(code(formatProps({props: result.data}, resolvedName)));
251
+ break;
252
+ }
253
+
254
+ case 'component.detail.source': {
255
+ emit(code(result.data.source));
256
+ break;
257
+ }
258
+
259
+ case 'component.detail.showcase': {
260
+ emit(code(result.data.source));
261
+ break;
262
+ }
263
+
264
+ case 'component.detail.blocks': {
265
+ const {showcase, examples, related} = result.data;
331
266
  /** @type {import('../../formatters/index.mjs').Block[]} */
332
- const out = [
333
- section('Component batch'),
334
- record({count: result.data.count}),
335
- section('Results'),
336
- ];
337
- for (const row of result.data.results) {
338
- out.push(section(row.selector));
339
- if (row.status === 'found') {
340
- out.push(
341
- record(row, {fields: ['selector', 'status']}),
342
- section('Result'),
343
- ...componentDetailBlocks(
344
- row.result,
345
- row.selector,
346
- detail,
347
- themeData,
348
- ),
349
- );
350
- continue;
351
- }
267
+ const out = [];
268
+ if (showcase) {
352
269
  out.push(
353
- record(row, {
354
- fields: ['selector', 'status', 'code', 'error'],
355
- }),
270
+ section('Showcase'),
271
+ record(showcase, {fields: ['displayName', 'description']}),
356
272
  );
357
- if (row.status === 'ambiguous') {
358
- out.push(
359
- section('Candidates'),
360
- records(row.candidates, {
361
- fields: ['package', 'component', 'kind', 'installed'],
362
- }),
363
- );
364
- } else if (row.suggestions?.length) {
365
- out.push(
366
- section('Suggestions'),
367
- records(row.suggestions, {fields: ['name', 'reason']}),
368
- );
369
- }
273
+ }
274
+ if (examples.length > 0) {
275
+ out.push(
276
+ section('Examples'),
277
+ records(examples, {fields: ['name', 'description']}),
278
+ );
279
+ }
280
+ if (related.length > 0) {
281
+ out.push(
282
+ section(`Related: ${related.length} blocks that use ${result.data.component}`),
283
+ list(related.map(b => b.name)),
284
+ );
285
+ }
286
+ if (!showcase && examples.length === 0 && related.length === 0) {
287
+ out.push(text(`No blocks found for ${result.data.component}`));
370
288
  }
371
289
  emit(...out);
372
290
  break;
373
291
  }
374
-
375
- case 'component.detail':
376
- case 'component.detail.props':
377
- case 'component.detail.source':
378
- case 'component.detail.showcase':
379
- case 'component.detail.blocks':
380
- emit(
381
- ...componentDetailBlocks(
382
- result,
383
- name ?? '',
384
- detail,
385
- themeData,
386
- ),
387
- );
388
- break;
389
292
  }
390
293
  return answered;
391
294
  },
@@ -277,95 +277,6 @@ describe('component() — integration ownership via config', () => {
277
277
  expect(result.data.import).toBe(`${INTEGRATION_NAME}/Toolbar/Search`);
278
278
  });
279
279
 
280
- it('reports every installed candidate for an ambiguous batch selector', async () => {
281
- createFixture({extraComponent: 'AppShell'});
282
- const result = await component(['MetaAppShell', 'AppShell'], {cwd: tmpDir});
283
- expect(result.type).toBe('component.batch');
284
- expect(result.data.results[0]).toMatchObject({
285
- selector: 'MetaAppShell',
286
- status: 'found',
287
- });
288
- expect(result.data.results[1]).toMatchObject({
289
- selector: 'AppShell',
290
- status: 'ambiguous',
291
- code: 'ERR_UNKNOWN_COMPONENT',
292
- });
293
- expect(result.data.results[1].candidates).toEqual(
294
- expect.arrayContaining([
295
- {
296
- package: CORE_PACKAGE,
297
- component: 'AppShell',
298
- kind: 'component',
299
- installed: true,
300
- },
301
- {
302
- package: INTEGRATION_NAME,
303
- component: 'AppShell',
304
- kind: 'component',
305
- installed: true,
306
- },
307
- ]),
308
- );
309
- });
310
-
311
- it('keeps the single-result envelope for one package-qualified selector', async () => {
312
- createFixture();
313
- const result = await component('@test/meta@1.2.3/MetaAppShell', {
314
- cwd: tmpDir,
315
- });
316
- expect(result.type).toBe('component.detail');
317
- expect(result.data).toMatchObject({
318
- name: 'MetaAppShell',
319
- package: INTEGRATION_NAME,
320
- });
321
- });
322
-
323
- it('resolves an exact installed package version and refuses another version', async () => {
324
- createFixture();
325
- const result = await component(
326
- [
327
- '@test/meta@1.2.3/MetaAppShell',
328
- '@test/meta@9.9.9/MetaAppShell',
329
- ],
330
- {cwd: tmpDir},
331
- );
332
- expect(result.type).toBe('component.batch');
333
- expect(result.data.results[0]).toMatchObject({
334
- selector: '@test/meta@1.2.3/MetaAppShell',
335
- status: 'found',
336
- result: {type: 'component.detail'},
337
- });
338
- expect(result.data.results[1]).toMatchObject({
339
- selector: '@test/meta@9.9.9/MetaAppShell',
340
- status: 'not_found',
341
- code: 'ERR_UNKNOWN_PACKAGE',
342
- suggestions: [
343
- {
344
- name: 'astryx discover @test/meta@9.9.9',
345
- reason: 'look up this package version',
346
- },
347
- ],
348
- });
349
- });
350
-
351
- it('reports a package-qualified selector that conflicts with --package', async () => {
352
- createFixture();
353
- const result = await component(
354
- ['@test/meta/MetaAppShell', 'Button'],
355
- {cwd: tmpDir, package: CORE_PACKAGE},
356
- );
357
- expect(result.type).toBe('component.batch');
358
- expect(result.data.results[0]).toMatchObject({
359
- selector: '@test/meta/MetaAppShell',
360
- status: 'error',
361
- code: 'ERR_INVALID_ARGUMENT',
362
- });
363
- expect(result.data.results[1]).toMatchObject({
364
- selector: 'Button',
365
- status: 'found',
366
- });
367
- });
368
-
369
280
  it('JSON list includes integration components as {name, package} objects', async () => {
370
281
  createFixture();
371
282
  const result = await component(undefined, {cwd: tmpDir, list: true});
@@ -16,23 +16,11 @@ export const doc = {
16
16
  namespace: 'cli/commands',
17
17
  summary: 'List components or print component docs',
18
18
  description:
19
- 'Resolves one or several components by exact selector across core and integration ' +
20
- 'packages and prints each authored doc, or lists the catalog grouped by category. ' +
21
- "Use 'Button', 'widgets/Button', '@acme/widgets/Button', or " +
22
- "'@acme/widgets@1.2.3/Button'. A version applies to the package and must match the " +
23
- 'installed version. Boolean flags narrow every resolved component to just its props, ' +
24
- 'source, showcase, or example blocks.',
19
+ 'Resolves a component by name across core and integration packages and prints ' +
20
+ 'its authored doc, or lists the catalog grouped by category. Boolean flags narrow ' +
21
+ 'a single component to just its props, source, showcase, or example blocks.',
25
22
  fn: 'component',
26
- args: [
27
- {
28
- name: 'names',
29
- param: 'name',
30
- description:
31
- 'One or more exact selectors. Use Name, package/Name, @scope/package/Name, or @scope/package@version/Name. Two or more return one ordered batch. At most 100 selectors are accepted.',
32
- required: false,
33
- variadic: true,
34
- },
35
- ],
23
+ args: [{name: 'name', param: 'name', required: false}],
36
24
  options: [
37
25
  {
38
26
  flag: '--list',
@@ -67,16 +55,11 @@ export const doc = {
67
55
  {
68
56
  flag: '--package <name>',
69
57
  param: 'options.package',
70
- description:
71
- 'Scope lookup to an external package (e.g. @acme/xds-widgets)',
58
+ description: 'Scope lookup to an external package (e.g. @acme/xds-widgets)',
72
59
  },
73
60
  ],
74
61
  examples: [
75
62
  {label: 'Browse the catalog', cli: 'astryx component --list'},
76
- {
77
- label: 'Look up several components',
78
- cli: 'astryx component Button Badge Text',
79
- },
80
63
  {
81
64
  label: 'Props table as JSON',
82
65
  cli: 'astryx component XDSButton --props --json',
@@ -86,7 +69,7 @@ export const doc = {
86
69
  {code: 0, when: 'success'},
87
70
  {
88
71
  code: 1,
89
- when: 'unknown component, category, or package; more than 100 selectors; any batch row is unresolved; or @astryxdesign/core cannot be resolved',
72
+ when: 'unknown component, category, or package, or @astryxdesign/core cannot be resolved',
90
73
  },
91
74
  ],
92
75
  related: ['search', 'hook', 'docs', 'template', 'swizzle'],
@@ -179,9 +179,9 @@ describe('DebugEvent result summary', () => {
179
179
  it(
180
180
  'says so explicitly when a command has no result set',
181
181
  async () => {
182
- // Bare `integration` prints its subcommand list: nothing was looked
182
+ // `layout check` returns a verdict on one expression: nothing was looked
183
183
  // up, and the run says that rather than leaving four ambiguous nulls.
184
- const {event} = await runWithDebug(['integration']);
184
+ const {event} = await runWithDebug(['layout', 'check', 'VStack>Text']);
185
185
  expect(event.output).toMatchObject({
186
186
  resultKind: 'none',
187
187
  resultCount: null,
@@ -14,13 +14,11 @@ export const doc = {
14
14
  name: 'discover',
15
15
  displayName: 'astryx discover',
16
16
  namespace: 'cli/commands',
17
- summary:
18
- 'Browse and search integrations: the ones you have and the ones you could add',
17
+ summary: 'Discover external packages and components',
19
18
  description:
20
- 'Lists the integrations this project loads and, when it has a discover source, the ones it could add, with what each one adds. ' +
21
- 'A package query shows one package: what it adds, every version a source knows, and the command that adds it. ' +
22
- "An @scope/name/Component path prints an installed component's doc; any other item path shows that item. " +
23
- 'Anything else, even an exact component name, searches every item and package and lists the matches. Discover only reads: your package manager installs, updates, and removes packages.',
19
+ 'Explores components contributed by configured external packages and integrations. ' +
20
+ 'With no query it lists those packages; an @scope/name query browses one package; ' +
21
+ 'an @scope/name/Component path or a free-text term resolves to a component doc.',
24
22
  fn: 'discover',
25
23
  args: [{name: 'query', param: 'query', required: false}],
26
24
  options: [
@@ -28,61 +26,19 @@ export const doc = {
28
26
  flag: '--components',
29
27
  param: 'options.components',
30
28
  description:
31
- 'In the package list, print every component, and every other item, of each package instead of the first 10 and a "+N more" count. No effect on --json output or on a package, component, or search query.',
32
- },
33
- {
34
- flag: '--type <kind>',
35
- param: 'options.type',
36
- description:
37
- 'Only one kind: component, template, doc, theme, codemod, or agent-doc. In the list, only packages that add it; in a search, only items of that kind.',
38
- },
39
- {
40
- flag: '--installed',
41
- param: 'options.installed',
42
- description:
43
- 'Only what this project has. Cannot be set with --available.',
44
- },
45
- {
46
- flag: '--available',
47
- param: 'options.available',
48
- description:
49
- 'Only what this project could add. Cannot be set with --installed.',
50
- },
51
- {
52
- flag: '--limit <n>',
53
- param: 'options.limit',
54
- description:
55
- 'Max number of search results, a positive integer (default 20).',
29
+ 'In the package list, print every component of each package instead of the first 10 and a "+N more" count. No effect on --json output or on a package, component, or search query.',
56
30
  },
57
31
  ],
58
32
  examples: [
59
- {
60
- label: 'List what you have and what you could add',
61
- cli: 'astryx discover',
62
- },
63
- {
64
- label: 'List every component of each package',
65
- cli: 'astryx discover --components',
66
- },
67
- {
68
- label: 'Only packages that add themes',
69
- cli: 'astryx discover --type theme',
70
- },
71
- {
72
- label: 'Browse a package and its versions',
73
- cli: 'astryx discover @acme/ui',
74
- },
75
- {label: 'See one version', cli: 'astryx discover @acme/ui@2.1.0'},
76
- {
77
- label: 'Search templates you could add',
78
- cli: 'astryx discover dashboard --type template --available',
79
- },
33
+ {label: 'List packages', cli: 'astryx discover --json'},
34
+ {label: 'List every component of each package', cli: 'astryx discover --components'},
35
+ {label: 'Browse a package', cli: 'astryx discover @acme/ui'},
80
36
  ],
81
37
  exitCodes: [
82
38
  {code: 0, when: 'success'},
83
39
  {
84
40
  code: 1,
85
- when: 'unknown package, version, component, or item; a malformed doc; an invalid --type or --limit; --installed with --available; or a blank query when packages are discovered',
41
+ when: 'unknown package or component, a malformed doc, or a blank query when packages are discovered',
86
42
  },
87
43
  ],
88
44
  related: ['component', 'search', 'template'],