@astryxdesign/cli 0.3.0-canary.fc1c3f3 → 0.3.0-canary.fcbc342
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.
- package/README.md +8 -8
- package/api/blog/blog.doc.mjs +2 -2
- package/api/build/build.doc.mjs +1 -1
- package/api/component/component.doc.mjs +1 -1
- package/api/discover/discover.doc.mjs +2 -2
- package/api/docs/docs.doc.mjs +2 -2
- package/api/doctor/doctor.doc.mjs +3 -3
- package/api/hook/hook.doc.mjs +1 -1
- package/api/init/init.doc.mjs +1 -1
- package/api/integration/summarizeIssues.doc.mjs +1 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/json/assertResponse.doc.mjs +2 -2
- package/api/json/isError.doc.mjs +1 -1
- package/api/json/parseResponse.doc.mjs +2 -2
- package/api/layout/layoutCheck.doc.mjs +1 -1
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -1
- package/api/swizzle/swizzle.doc.mjs +1 -1
- package/api/template/template.test.mjs +26 -0
- package/api/theme/listThemes.doc.mjs +2 -2
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeBuild.doc.mjs +3 -3
- package/api/theme/themeList.doc.mjs +2 -2
- package/api/upgrade/upgrade.doc.mjs +1 -1
- package/assets/codemods/transforms/next/__tests__/next-codemods.test.mjs +92 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/rename-dropdown-menu-radio-dot-target.mjs +152 -0
- package/assets/codemods/transforms/v0.3.0/__tests__/migrate-table-rowexpansion-to-tree.test.mjs +201 -0
- package/assets/codemods/transforms/v0.3.0/index.mjs +8 -0
- package/assets/codemods/transforms/v0.3.0/migrate-table-rowexpansion-to-tree.mjs +214 -0
- package/assets/docs/browser-support.doc.mjs +6 -6
- package/assets/docs/getting-started.doc.mjs +3 -3
- package/assets/docs/icons.doc.mjs +3 -3
- package/assets/docs/illustrations.doc.mjs +2 -2
- package/assets/docs/internationalization.doc.mjs +1 -1
- package/assets/docs/migration.doc.mjs +1 -1
- package/assets/docs/principles.doc.mjs +1 -1
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/styling.doc.mjs +4 -4
- package/assets/docs/theme.doc.mjs +3 -3
- package/assets/docs/typography.doc.mjs +2 -2
- package/assets/templates/blocks/components/Stepper/StepperHorizontal.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperHorizontal.tsx +24 -0
- package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.tsx +68 -0
- package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.tsx +92 -0
- package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.tsx +41 -0
- package/assets/templates/blocks/components/Stepper/StepperShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/Stepper/StepperShowcase.tsx +25 -0
- package/assets/templates/blocks/components/Stepper/StepperStatus.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperStatus.tsx +50 -0
- package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.tsx +40 -0
- package/assets/templates/blocks/components/Table/TableRowExpansionTable.tsx +61 -58
- package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
- package/assets/templates/themes/neutral/neutralTheme.ts +4 -1
- package/authoring/codemod/codemod.doc.mjs +2 -2
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/doctypes/base/type.ts +15 -0
- package/authoring/doctypes/command/command.doc.mjs +2 -2
- package/authoring/doctypes/component/component.doc.mjs +7 -7
- package/authoring/doctypes/enum/enum.doc.mjs +2 -2
- package/authoring/doctypes/function/function.doc.mjs +3 -3
- package/authoring/doctypes/hook/hook.doc.mjs +3 -3
- package/authoring/doctypes/reference/reference.doc.mjs +3 -3
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/doctypes/template/template.doc.mjs +3 -3
- package/clients/cli/commands/build-theme.registry.test.mjs +14 -1
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/doctor.doc.mjs +2 -2
- package/clients/cli/commands/layout-expand.doc.mjs +1 -1
- package/clients/cli/commands/layout.doc.mjs +1 -1
- package/clients/cli/commands/manifest.doc.mjs +3 -3
- package/clients/cli/commands/search.doc.mjs +1 -1
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-list.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +2 -2
- package/clients/cli/commands/validate-integration.doc.mjs +2 -2
- package/foundation/discovery/template-adapter.d.mts +6 -3
- package/foundation/discovery/template-adapter.mjs +30 -14
- package/foundation/response/response-types.doc.mjs +7 -7
- package/foundation/response/response.doc.mjs +5 -5
- package/package.json +9 -9
|
@@ -6,90 +6,93 @@ import {useState} from 'react';
|
|
|
6
6
|
import {
|
|
7
7
|
Table,
|
|
8
8
|
useTableRowExpansion,
|
|
9
|
-
useTableRowExpansionState,
|
|
10
9
|
proportional,
|
|
11
10
|
pixel,
|
|
12
11
|
} from '@astryxdesign/core/Table';
|
|
12
|
+
import {VStack, HStack} from '@astryxdesign/core/Stack';
|
|
13
|
+
import {Text, Heading} from '@astryxdesign/core/Text';
|
|
14
|
+
import {Badge} from '@astryxdesign/core/Badge';
|
|
13
15
|
|
|
14
|
-
interface
|
|
16
|
+
interface Order extends Record<string, unknown> {
|
|
15
17
|
id: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
customer: string;
|
|
19
|
+
status: string;
|
|
20
|
+
total: string;
|
|
21
|
+
items: {name: string; qty: number; price: string}[];
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
const
|
|
24
|
+
const orders: Order[] = [
|
|
23
25
|
{
|
|
24
|
-
id: '
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
name: 'components',
|
|
32
|
-
type: 'folder',
|
|
33
|
-
size: '—',
|
|
34
|
-
children: [
|
|
35
|
-
{
|
|
36
|
-
id: 'src/components/Button.tsx',
|
|
37
|
-
name: 'Button.tsx',
|
|
38
|
-
type: 'file',
|
|
39
|
-
size: '4.2 KB',
|
|
40
|
-
children: [],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'src/components/Table.tsx',
|
|
44
|
-
name: 'Table.tsx',
|
|
45
|
-
type: 'file',
|
|
46
|
-
size: '12.8 KB',
|
|
47
|
-
children: [],
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'src/index.ts',
|
|
53
|
-
name: 'index.ts',
|
|
54
|
-
type: 'file',
|
|
55
|
-
size: '0.4 KB',
|
|
56
|
-
children: [],
|
|
57
|
-
},
|
|
26
|
+
id: 'ord-1001',
|
|
27
|
+
customer: 'Ada Lovelace',
|
|
28
|
+
status: 'Shipped',
|
|
29
|
+
total: '$248.00',
|
|
30
|
+
items: [
|
|
31
|
+
{name: 'Mechanical keyboard', qty: 1, price: '$180.00'},
|
|
32
|
+
{name: 'Wrist rest', qty: 2, price: '$34.00'},
|
|
58
33
|
],
|
|
59
34
|
},
|
|
60
35
|
{
|
|
61
|
-
id: '
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
id: 'ord-1002',
|
|
37
|
+
customer: 'Alan Turing',
|
|
38
|
+
status: 'Processing',
|
|
39
|
+
total: '$52.00',
|
|
40
|
+
items: [{name: 'USB-C cable', qty: 4, price: '$13.00'}],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'ord-1003',
|
|
44
|
+
customer: 'Grace Hopper',
|
|
45
|
+
status: 'Delivered',
|
|
46
|
+
total: '$1,200.00',
|
|
47
|
+
items: [{name: 'Standing desk', qty: 1, price: '$1,200.00'}],
|
|
66
48
|
},
|
|
67
49
|
];
|
|
68
50
|
|
|
69
51
|
const columns = [
|
|
70
|
-
{key: '
|
|
71
|
-
{key: '
|
|
72
|
-
{key: '
|
|
52
|
+
{key: 'customer', header: 'Customer', width: proportional(2)},
|
|
53
|
+
{key: 'status', header: 'Status', width: pixel(130)},
|
|
54
|
+
{key: 'total', header: 'Total', width: pixel(110)},
|
|
73
55
|
];
|
|
74
56
|
|
|
75
57
|
export default function TableRowExpansionTable() {
|
|
76
58
|
const [expandedKeys, setExpandedKeys] = useState<Set<string>>(
|
|
77
|
-
new Set(['
|
|
59
|
+
new Set(['ord-1001']),
|
|
78
60
|
);
|
|
79
61
|
|
|
80
|
-
const
|
|
81
|
-
baseData: fileTree,
|
|
82
|
-
getChildren: item => item.children ?? [],
|
|
83
|
-
getRowKey: item => item.id,
|
|
62
|
+
const expansion = useTableRowExpansion<Order>({
|
|
84
63
|
expandedKeys,
|
|
85
|
-
|
|
64
|
+
onToggle: key =>
|
|
65
|
+
setExpandedKeys(prev => {
|
|
66
|
+
const next = new Set(prev);
|
|
67
|
+
if (next.has(key)) {
|
|
68
|
+
next.delete(key);
|
|
69
|
+
} else {
|
|
70
|
+
next.add(key);
|
|
71
|
+
}
|
|
72
|
+
return next;
|
|
73
|
+
}),
|
|
74
|
+
getRowKey: item => item.id,
|
|
75
|
+
// The detail panel renders arbitrary content below the row: here, the
|
|
76
|
+
// order's line items. Any component composes here (charts, forms, tables).
|
|
77
|
+
renderExpanded: item => (
|
|
78
|
+
<VStack gap={2}>
|
|
79
|
+
<Heading level={4}>Line items</Heading>
|
|
80
|
+
{item.items.map(line => (
|
|
81
|
+
<HStack key={line.name} gap={3}>
|
|
82
|
+
<Badge label={`x${line.qty}`} variant="info" />
|
|
83
|
+
<Text type="body">{line.name}</Text>
|
|
84
|
+
<Text type="body" color="secondary">
|
|
85
|
+
{line.price}
|
|
86
|
+
</Text>
|
|
87
|
+
</HStack>
|
|
88
|
+
))}
|
|
89
|
+
</VStack>
|
|
90
|
+
),
|
|
86
91
|
});
|
|
87
92
|
|
|
88
|
-
const expansion = useTableRowExpansion(expansionConfig);
|
|
89
|
-
|
|
90
93
|
return (
|
|
91
94
|
<Table
|
|
92
|
-
data={
|
|
95
|
+
data={orders}
|
|
93
96
|
columns={columns}
|
|
94
97
|
idKey="id"
|
|
95
98
|
hasHover
|
|
@@ -323,8 +323,11 @@ export const neutralTheme = defineTheme({
|
|
|
323
323
|
|
|
324
324
|
// =========================================================================
|
|
325
325
|
// Radius — slightly larger than default (kept as-is)
|
|
326
|
+
// --radius-none and --radius-full are always fixed and must never be
|
|
327
|
+
// scaled by a theme (see defineTheme's radius config docs) — 0 and
|
|
328
|
+
// 9999px respectively, matching @astryxdesign/core's own defaults.
|
|
326
329
|
// =========================================================================
|
|
327
|
-
'--radius-none': '
|
|
330
|
+
'--radius-none': '0px',
|
|
328
331
|
'--radius-inner': '0.375rem',
|
|
329
332
|
'--radius-element': '0.625rem',
|
|
330
333
|
'--radius-container': '0.75rem',
|
|
@@ -42,7 +42,7 @@ export const doc = {
|
|
|
42
42
|
name: 'fileExtensions',
|
|
43
43
|
type: 'string[]',
|
|
44
44
|
description:
|
|
45
|
-
'File extensions this codemod applies to. Code codemods only
|
|
45
|
+
'File extensions this codemod applies to. Code codemods only; a ' +
|
|
46
46
|
'config codemod always targets astryx.config.*.',
|
|
47
47
|
example: "['.tsx', '.ts']",
|
|
48
48
|
},
|
|
@@ -140,7 +140,7 @@ export const doc = {
|
|
|
140
140
|
type: 'prose',
|
|
141
141
|
text:
|
|
142
142
|
"The config-codemod variant (type: 'config') carries the same fields " +
|
|
143
|
-
'as a code codemod except fileExtensions
|
|
143
|
+
'as a code codemod except fileExtensions: it always targets the ' +
|
|
144
144
|
'astryx.config.* file rather than a set of source files.',
|
|
145
145
|
},
|
|
146
146
|
{
|
|
@@ -46,7 +46,7 @@ export const doc = {
|
|
|
46
46
|
{
|
|
47
47
|
name: 'experimental',
|
|
48
48
|
type: '{ xle?: { components?: Record<string, XleComponent> } }',
|
|
49
|
-
description: 'Unstable features
|
|
49
|
+
description: 'Unstable features; may change without a breaking bump.',
|
|
50
50
|
fields: [
|
|
51
51
|
{
|
|
52
52
|
name: 'experimental.xle.components',
|
|
@@ -260,6 +260,8 @@ export interface ComponentSlotElement {
|
|
|
260
260
|
* { property: 'padding', vars: ['--_card-padding'] },
|
|
261
261
|
* ```
|
|
262
262
|
*/
|
|
263
|
+
// SYNC: apps/docsite/scripts/generate-data.mjs (interface DerivedVar) — see the
|
|
264
|
+
// note on ComponentThemingTarget below.
|
|
263
265
|
export interface ComponentThemingDerivedVar {
|
|
264
266
|
/** The standard CSS property name (camelCase) that theme authors write.
|
|
265
267
|
* e.g. `'borderRadius'`, `'padding'`, `'paddingBlock'` */
|
|
@@ -291,6 +293,10 @@ export interface ComponentThemingDerivedVar {
|
|
|
291
293
|
* {className: 'astryx-card'}
|
|
292
294
|
* ```
|
|
293
295
|
*/
|
|
296
|
+
// SYNC: When adding a field here, add it to the docsite's generated-registry
|
|
297
|
+
// copy too — apps/docsite/scripts/generate-data.mjs (interface ThemingTarget).
|
|
298
|
+
// `next build` type-checks the emitted componentRegistry.ts against that copy,
|
|
299
|
+
// so a field present in a .doc.mjs but missing there fails the docsite build.
|
|
294
300
|
export interface ComponentThemingTarget {
|
|
295
301
|
/** The stable CSS class name rendered by the component.
|
|
296
302
|
* Always starts with `astryx-`.
|
|
@@ -310,6 +316,15 @@ export interface ComponentThemingTarget {
|
|
|
310
316
|
* `[data-checked="checked"]`. Legacy state classes are still emitted for
|
|
311
317
|
* compatibility. Omit if the element has no state-driven selectors. */
|
|
312
318
|
states?: string[];
|
|
319
|
+
/** Set when this target has been RENAMED and this entry is the old name.
|
|
320
|
+
* The component still emits the class (via `themeProps`'s `legacyNames`),
|
|
321
|
+
* so existing themes keep working, but the docsite should steer readers to
|
|
322
|
+
* the replacement. The value is the class name that supersedes this one,
|
|
323
|
+
* without the `astryx-` prefix — e.g. `"checkbox-indicator"`.
|
|
324
|
+
*
|
|
325
|
+
* A theme target is public API; renaming one without this is a silent
|
|
326
|
+
* break for every theme styling it. */
|
|
327
|
+
deprecatedFor?: string;
|
|
313
328
|
}
|
|
314
329
|
|
|
315
330
|
/**
|
|
@@ -15,7 +15,7 @@ export const doc = {
|
|
|
15
15
|
displayName: 'CommandDoc',
|
|
16
16
|
namespace: 'authoring',
|
|
17
17
|
description:
|
|
18
|
-
'The doc-type for a CLI command
|
|
18
|
+
'The doc-type for a CLI command: the terminal binding of an operation. A command ' +
|
|
19
19
|
'is not its own behavior; it is a FunctionDoc exposed on the CLI, referenced via `fn`, ' +
|
|
20
20
|
'carrying only CLI-surface facts (args, flags, subcommands, examples, exit codes). ' +
|
|
21
21
|
'A `defineCommand` converter turns it into Commander config + `--help`.',
|
|
@@ -231,7 +231,7 @@ export const doc = {
|
|
|
231
231
|
notes: [
|
|
232
232
|
{
|
|
233
233
|
type: 'prose',
|
|
234
|
-
text: 'A command carries only CLI-surface facts. Behavior, parameters, returns, and thrown errors live in the FunctionDoc it points at via `fn
|
|
234
|
+
text: 'A command carries only CLI-surface facts. Behavior, parameters, returns, and thrown errors live in the FunctionDoc it points at via `fn`; the function does not know it has a CLI.',
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
type: 'prose',
|
|
@@ -50,7 +50,7 @@ export const doc = {
|
|
|
50
50
|
name: 'hiddenComponents',
|
|
51
51
|
type: 'string[]',
|
|
52
52
|
description:
|
|
53
|
-
'Sub-component names to hide from human-facing UI (CLI listings, docs catalogs). They stay public and importable
|
|
53
|
+
'Sub-component names to hide from human-facing UI (CLI listings, docs catalogs). They stay public and importable; agents and tooling can still discover them via source.',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
name: 'hidden',
|
|
@@ -104,7 +104,7 @@ export const doc = {
|
|
|
104
104
|
name: 'theming.derived',
|
|
105
105
|
type: 'ComponentThemingDerivedVar[]',
|
|
106
106
|
description:
|
|
107
|
-
'Maps standard CSS properties to internal vars for theme-pipeline expansion. Ordered by priority
|
|
107
|
+
'Maps standard CSS properties to internal vars for theme-pipeline expansion. Ordered by priority: earlier entries emit first.',
|
|
108
108
|
},
|
|
109
109
|
],
|
|
110
110
|
},
|
|
@@ -170,7 +170,7 @@ export const doc = {
|
|
|
170
170
|
name: 'description',
|
|
171
171
|
type: 'string',
|
|
172
172
|
description:
|
|
173
|
-
"SubComponentDoc variant (required there): one-sentence description of the sub-component's role within the parent composition. Single/Multi docs have no top-level description
|
|
173
|
+
"SubComponentDoc variant (required there): one-sentence description of the sub-component's role within the parent composition. Single/Multi docs have no top-level description; they derive their summary from `usage`.",
|
|
174
174
|
},
|
|
175
175
|
],
|
|
176
176
|
examples: [
|
|
@@ -187,7 +187,7 @@ export const docs = {
|
|
|
187
187
|
'A Switch toggles a single setting on or off. Use it for instant, binary preferences that apply immediately without a submit step.',
|
|
188
188
|
bestPractices: [
|
|
189
189
|
{guidance: true, description: 'Apply the change immediately when toggled.'},
|
|
190
|
-
{guidance: false, description: 'Use a Switch for actions that need confirmation
|
|
190
|
+
{guidance: false, description: 'Use a Switch for actions that need confirmation; prefer a Checkbox in a form.'},
|
|
191
191
|
],
|
|
192
192
|
},
|
|
193
193
|
props: [
|
|
@@ -226,9 +226,9 @@ export const docs = {
|
|
|
226
226
|
type: 'list',
|
|
227
227
|
style: 'unordered',
|
|
228
228
|
items: [
|
|
229
|
-
'SingleComponentDoc
|
|
230
|
-
'MultiComponentDoc
|
|
231
|
-
'SubComponentDoc
|
|
229
|
+
'SingleComponentDoc: one primary component; put props directly on the doc via `props`. Use for Switch, Badge, Spinner, TextInput.',
|
|
230
|
+
'MultiComponentDoc: a directory exporting several components/hooks; list them in `components` (inline ComponentEntry or name-only ComponentRef). Use for Table, Dialog, TabList.',
|
|
231
|
+
'SubComponentDoc: a single sub-component in its own {Name}.doc.mjs inside the parent directory; set `subComponentOf` to the parent name. It inherits family fields and may omit `usage`.',
|
|
232
232
|
],
|
|
233
233
|
},
|
|
234
234
|
{
|
|
@@ -14,7 +14,7 @@ export const doc = {
|
|
|
14
14
|
displayName: 'EnumDoc',
|
|
15
15
|
namespace: 'authoring',
|
|
16
16
|
description:
|
|
17
|
-
'The doc-type for a closed vocabulary
|
|
17
|
+
'The doc-type for a closed vocabulary: a fixed set of literal values such as ' +
|
|
18
18
|
'error codes or response-type discriminants. Colocated as a `.doc.mjs` next to ' +
|
|
19
19
|
'the source of truth it documents.',
|
|
20
20
|
appliesTo: '<enum>.doc.mjs',
|
|
@@ -59,7 +59,7 @@ export const doc = {
|
|
|
59
59
|
{
|
|
60
60
|
name: 'members',
|
|
61
61
|
type: 'EnumMemberDoc[]',
|
|
62
|
-
description: 'The enumerated members
|
|
62
|
+
description: 'The enumerated members: one entry per literal value.',
|
|
63
63
|
required: true,
|
|
64
64
|
fields: [
|
|
65
65
|
{
|
|
@@ -41,7 +41,7 @@ export const doc = {
|
|
|
41
41
|
name: 'kind',
|
|
42
42
|
type: "'hook' | 'api'",
|
|
43
43
|
description:
|
|
44
|
-
'Which flavor
|
|
44
|
+
'Which flavor; drives docsite sectioning; inferred from importPath if omitted.',
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
name: 'summary',
|
|
@@ -127,7 +127,7 @@ export const doc = {
|
|
|
127
127
|
{
|
|
128
128
|
name: 'returns[].name',
|
|
129
129
|
type: 'string',
|
|
130
|
-
description: 'Field name (hooks)
|
|
130
|
+
description: 'Field name (hooks); omit for API envelope entries.',
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
name: 'returns[].type',
|
|
@@ -191,7 +191,7 @@ export const doc = {
|
|
|
191
191
|
name: 'usage',
|
|
192
192
|
type: 'UsageDoc',
|
|
193
193
|
description:
|
|
194
|
-
'Usage documentation (hooks)
|
|
194
|
+
'Usage documentation (hooks): description, best practices, anatomy. Same shape as HookDoc.usage.',
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
name: 'command',
|
|
@@ -43,7 +43,7 @@ export const doc = {
|
|
|
43
43
|
name: 'group',
|
|
44
44
|
type: 'string',
|
|
45
45
|
description:
|
|
46
|
-
'Optional group for sidebar/docs organization
|
|
46
|
+
'Optional group for sidebar/docs organization; same as ComponentDoc.group.',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
name: 'keywords',
|
|
@@ -117,7 +117,7 @@ export const doc = {
|
|
|
117
117
|
{
|
|
118
118
|
name: 'usage',
|
|
119
119
|
type: 'UsageDoc',
|
|
120
|
-
description: 'Usage documentation
|
|
120
|
+
description: 'Usage documentation: description and best practices.',
|
|
121
121
|
required: true,
|
|
122
122
|
fields: [
|
|
123
123
|
{
|
|
@@ -190,7 +190,7 @@ export const docs = {
|
|
|
190
190
|
notes: [
|
|
191
191
|
{
|
|
192
192
|
type: 'prose',
|
|
193
|
-
text: "A hook's discriminant is `type: 'function'
|
|
193
|
+
text: "A hook's discriminant is `type: 'function'`: HookDoc and FunctionDoc share the generalized function kind. HookDoc is the hook-flavored view: named `returns` fields and a required `usage` block.",
|
|
194
194
|
},
|
|
195
195
|
{
|
|
196
196
|
type: 'prose',
|
|
@@ -14,7 +14,7 @@ export const doc = {
|
|
|
14
14
|
displayName: 'ReferenceDoc',
|
|
15
15
|
namespace: 'authoring',
|
|
16
16
|
description:
|
|
17
|
-
'The doc-type for a reference/topic doc
|
|
17
|
+
'The doc-type for a reference/topic doc: tokens, principles, theming, patterns, ' +
|
|
18
18
|
'accessibility, migration guides. Unlike ComponentDoc it is not tied to a component: ' +
|
|
19
19
|
'drop a `.doc.mjs` in the docs directory and it shows up in `astryx docs`. Content is ' +
|
|
20
20
|
'built from ordered sections of mixed content blocks.',
|
|
@@ -120,7 +120,7 @@ export const docs = {
|
|
|
120
120
|
notes: [
|
|
121
121
|
{
|
|
122
122
|
type: 'prose',
|
|
123
|
-
text: 'Each `sections[].content` is an ordered array of ReferenceContentBlock
|
|
123
|
+
text: 'Each `sections[].content` is an ordered array of ReferenceContentBlock, a discriminated union. New block types can be added without breaking existing docs. The same union is reused by the `notes` field on SchemaDoc and CommandDoc.',
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
type: 'code',
|
|
@@ -140,7 +140,7 @@ export const docs = {
|
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
type: 'prose',
|
|
143
|
-
text: "A section may set `previewType` to render a visual preview column for token tables
|
|
143
|
+
text: "A section may set `previewType` to render a visual preview column for token tables: one of 'swatch' | 'shadow-box' | 'radius-box' | 'spacing-bar' | 'size-bar' | 'border-line' | 'duration-bar' | 'easing-curve' | 'font-sample'.",
|
|
144
144
|
},
|
|
145
145
|
],
|
|
146
146
|
};
|
|
@@ -190,7 +190,7 @@ export const doc = {
|
|
|
190
190
|
type: 'list',
|
|
191
191
|
style: 'dont',
|
|
192
192
|
items: [
|
|
193
|
-
'Set `required: false` for optional fields
|
|
193
|
+
'Set `required: false` for optional fields; omit `required` entirely instead.',
|
|
194
194
|
],
|
|
195
195
|
},
|
|
196
196
|
],
|
|
@@ -150,13 +150,13 @@ export const doc = {
|
|
|
150
150
|
type: 'list',
|
|
151
151
|
style: 'unordered',
|
|
152
152
|
items: [
|
|
153
|
-
"PageTemplateDoc (type: 'page')
|
|
154
|
-
"BlockTemplateDoc (type: 'block')
|
|
153
|
+
"PageTemplateDoc (type: 'page'): a full page template; `name` doubles as its display value.",
|
|
154
|
+
"BlockTemplateDoc (type: 'block'): an example of a component; requires `exampleFor` and `aspectRatio`.",
|
|
155
155
|
],
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
type: 'prose',
|
|
159
|
-
text: "`category` uses the shared TemplateCategory taxonomy: 'Group - Variant' strings (e.g. 'Table - Bulk Actions'). Not every value maps to an existing template
|
|
159
|
+
text: "`category` uses the shared TemplateCategory taxonomy: 'Group - Variant' strings (e.g. 'Table - Bulk Actions'). Not every value maps to an existing template; unused values are reserved so authors get autocomplete for the full taxonomy.",
|
|
160
160
|
},
|
|
161
161
|
],
|
|
162
162
|
};
|
|
@@ -60,7 +60,10 @@ function renderedClassLiterals() {
|
|
|
60
60
|
const full = path.join(dir, entry.name);
|
|
61
61
|
if (entry.isDirectory()) {
|
|
62
62
|
walk(full);
|
|
63
|
-
} else if (
|
|
63
|
+
} else if (
|
|
64
|
+
(entry.name.endsWith('.tsx') || entry.name.endsWith('.ts')) &&
|
|
65
|
+
!entry.name.includes('.test.')
|
|
66
|
+
) {
|
|
64
67
|
const text = fs.readFileSync(full, 'utf8');
|
|
65
68
|
for (const re of [
|
|
66
69
|
/themeProps\(\s*'([^']+)'/g,
|
|
@@ -71,6 +74,16 @@ function renderedClassLiterals() {
|
|
|
71
74
|
classes.add(m[1]);
|
|
72
75
|
}
|
|
73
76
|
}
|
|
77
|
+
// Renamed targets emit their old name too, via themeProps'
|
|
78
|
+
// `legacyNames`. Those classes are just as rendered as the primary
|
|
79
|
+
// one, so a doc entry for the old name is still backed by real output.
|
|
80
|
+
const legacyRe = /legacyNames:\s*\[([^\]]*)\]/g;
|
|
81
|
+
let lm;
|
|
82
|
+
while ((lm = legacyRe.exec(text)) !== null) {
|
|
83
|
+
for (const nm of lm[1].matchAll(/'([^']+)'/g)) {
|
|
84
|
+
classes.add(nm[1]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
74
87
|
}
|
|
75
88
|
}
|
|
76
89
|
};
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
'Build a page: composition kit for an idea, or the workflow playbook (no args)',
|
|
18
18
|
description:
|
|
19
19
|
'The assemble-a-page entry point. With no query it returns the how-to-build-a-page ' +
|
|
20
|
-
'playbook; with a query it groups the unified search hits into a composition kit
|
|
20
|
+
'playbook; with a query it groups the unified search hits into a composition kit: ' +
|
|
21
21
|
'the closest templates, drop-in blocks, and idea-specific components and hooks.',
|
|
22
22
|
fn: 'build',
|
|
23
23
|
args: [{name: 'query', param: 'query', required: false}],
|
|
@@ -69,7 +69,7 @@ export const doc = {
|
|
|
69
69
|
{code: 0, when: 'success'},
|
|
70
70
|
{
|
|
71
71
|
code: 1,
|
|
72
|
-
when: 'unknown component, category, or package
|
|
72
|
+
when: 'unknown component, category, or package, or @astryxdesign/core cannot be resolved',
|
|
73
73
|
},
|
|
74
74
|
],
|
|
75
75
|
related: ['search', 'hook', 'docs', 'template', 'swizzle'],
|
|
@@ -15,8 +15,8 @@ export const doc = {
|
|
|
15
15
|
namespace: 'cli',
|
|
16
16
|
summary: 'Diagnose your XDS setup and report problems with fixes',
|
|
17
17
|
description:
|
|
18
|
-
'Runs read-only diagnostics
|
|
19
|
-
'alignment, installed themes, config validity, agent docs, and the package manager
|
|
18
|
+
'Runs read-only diagnostics: Node version, @astryxdesign/core install and version ' +
|
|
19
|
+
'alignment, installed themes, config validity, agent docs, and the package manager, ' +
|
|
20
20
|
'and reports pass/warn/fail with an actionable fix for each problem. Safe as a CI gate.',
|
|
21
21
|
fn: 'doctor',
|
|
22
22
|
examples: [
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
summary: 'Expand a layout expression into validated XDS TSX',
|
|
18
18
|
description:
|
|
19
19
|
'Parses and validates a compressed XLE/XLO expression, then expands it into ' +
|
|
20
|
-
'ready-to-use XDS TSX
|
|
20
|
+
'ready-to-use XDS TSX, routing children into slots, scaffolding typed useState for ' +
|
|
21
21
|
'interactive controls, and splicing referenced blocks. Writes to a path, or returns the code.',
|
|
22
22
|
fn: 'layoutExpand',
|
|
23
23
|
args: [
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
summary: 'Generate XDS layouts from compressed expressions (XLE/XLO)',
|
|
17
17
|
description:
|
|
18
18
|
'The layout command group. Running astryx layout with no subcommand prints the ' +
|
|
19
|
-
'subcommand list; the work happens in the subcommands
|
|
19
|
+
'subcommand list; the work happens in the subcommands: expand an expression into ' +
|
|
20
20
|
'TSX (expand), validate one (check), or print the grammar cheatsheet (grammar).',
|
|
21
21
|
subcommands: ['expand', 'check', 'grammar'],
|
|
22
22
|
examples: [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file CommandDoc for `astryx manifest`. A CLI-only capability manifest with no
|
|
5
5
|
* wrapped API function (so no `fn`); it emits the full command surface — args,
|
|
6
|
-
* flags, subcommands, and JSON response types
|
|
6
|
+
* flags, subcommands, and JSON response types, as a single typed envelope.
|
|
7
7
|
* @position packages/cli/clients/cli/commands — command documentation
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -15,8 +15,8 @@ export const doc = {
|
|
|
15
15
|
namespace: 'cli',
|
|
16
16
|
summary: 'Print the full CLI capability manifest (use with --json).',
|
|
17
17
|
description:
|
|
18
|
-
'Emits the complete CLI surface
|
|
19
|
-
'subcommands, and JSON response types
|
|
18
|
+
'Emits the complete CLI surface: every command with its arguments, options, ' +
|
|
19
|
+
'subcommands, and JSON response types, as a single typed envelope for agents and ' +
|
|
20
20
|
'tooling to introspect. Intended to be run with --json.',
|
|
21
21
|
examples: [
|
|
22
22
|
{label: 'Full manifest', cli: 'astryx manifest --json'},
|
|
@@ -15,7 +15,7 @@ export const doc = {
|
|
|
15
15
|
namespace: 'cli',
|
|
16
16
|
summary: 'Search components, hooks, docs, and templates in one ranked list',
|
|
17
17
|
description:
|
|
18
|
-
'Terminal front-end to search()
|
|
18
|
+
'Terminal front-end to search(): prints one ranked, greppable list across ' +
|
|
19
19
|
'every content domain, each row carrying a follow-up command to act on it.',
|
|
20
20
|
fn: 'search',
|
|
21
21
|
args: [{name: 'query', param: 'query', required: true}],
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
namespace: 'cli',
|
|
17
17
|
summary: 'Scaffold a theme into your project as editable source',
|
|
18
18
|
description:
|
|
19
|
-
"Copies a bundled theme's source into your project so you own it
|
|
19
|
+
"Copies a bundled theme's source into your project so you own it, no theme package " +
|
|
20
20
|
'needed. Writes are staged then renamed, rolling back on failure. Running it with no ' +
|
|
21
21
|
'slug, or with --list, lists the bundled themes instead.',
|
|
22
22
|
fn: 'themeAdd',
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
summary: 'Compile a defineTheme file to CSS + JS',
|
|
18
18
|
description:
|
|
19
19
|
'Compiles a file that calls defineTheme() into a scoped CSS file, a JS module, and ' +
|
|
20
|
-
'type declarations
|
|
20
|
+
'type declarations: the exact CSS the <Theme> runtime emits. With --check it writes ' +
|
|
21
21
|
'nothing and instead reports whether the committed outputs have drifted from source.',
|
|
22
22
|
fn: 'themeBuild',
|
|
23
23
|
args: [{name: 'file', param: 'file', required: true}],
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
namespace: 'cli',
|
|
17
17
|
summary: 'List themes available to add',
|
|
18
18
|
description:
|
|
19
|
-
'Lists the themes bundled with this CLI build
|
|
19
|
+
'Lists the themes bundled with this CLI build (the ones theme add can scaffold), ' +
|
|
20
20
|
'each with its slug, display name, description, and maintained flag.',
|
|
21
21
|
fn: 'themeList',
|
|
22
22
|
examples: [{label: 'List bundled themes', cli: 'astryx theme list --json'}],
|
|
@@ -13,10 +13,10 @@ export const doc = {
|
|
|
13
13
|
name: 'theme',
|
|
14
14
|
displayName: 'astryx theme',
|
|
15
15
|
namespace: 'cli',
|
|
16
|
-
summary: 'Theme tools
|
|
16
|
+
summary: 'Theme tools: build, export, and manage themes',
|
|
17
17
|
description:
|
|
18
18
|
'The theme command group. Running astryx theme with no subcommand prints the ' +
|
|
19
|
-
'subcommand list; the work happens in the subcommands
|
|
19
|
+
'subcommand list; the work happens in the subcommands: compile a theme (build), ' +
|
|
20
20
|
'scaffold one into your project (add), or list the bundled themes (list).',
|
|
21
21
|
subcommands: ['build', 'add', 'list'],
|
|
22
22
|
examples: [
|
|
@@ -16,8 +16,8 @@ export const doc = {
|
|
|
16
16
|
namespace: 'cli',
|
|
17
17
|
summary: 'Validate an Astryx integration package (manifest + contributions)',
|
|
18
18
|
description:
|
|
19
|
-
'Validates ONE integration at a time
|
|
20
|
-
'installed package resolved by name
|
|
19
|
+
'Validates ONE integration at a time: the local package rooted at cwd, or an ' +
|
|
20
|
+
'installed package resolved by name, schema-checking its manifest, verifying each ' +
|
|
21
21
|
'declared contribution root, and reporting every finding. Safe as a CI gate.',
|
|
22
22
|
fn: 'validateIntegration',
|
|
23
23
|
args: [{name: 'package', param: 'pkg', required: false}],
|
|
@@ -11,11 +11,14 @@ export function pkgOf(t: {
|
|
|
11
11
|
package?: string;
|
|
12
12
|
}): string;
|
|
13
13
|
/**
|
|
14
|
-
* Replace demo
|
|
15
|
-
*
|
|
14
|
+
* Replace demo asset references with a placeholder so scaffolded pages
|
|
15
|
+
* render with zero setup. Images get a self-contained data URI; videos
|
|
16
|
+
* (which have no equivalent inline placeholder — see VIDEO_EXTENSIONS) are
|
|
17
|
+
* stripped to an empty src instead of being mis-replaced with image data.
|
|
18
|
+
* Builders drop in their own media either way.
|
|
16
19
|
*
|
|
17
20
|
* @param {string} source - Template source code.
|
|
18
|
-
* @returns {string} Source with demo
|
|
21
|
+
* @returns {string} Source with demo asset references replaced.
|
|
19
22
|
*/
|
|
20
23
|
export function stripTemplateAssetRefs(source: string): string;
|
|
21
24
|
/**
|