@astryxdesign/cli 0.6.4-canary.06c8fa3 → 0.6.4-canary.0e1fbdb
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 +49 -40
- package/api/build/build.doc.mjs +6 -1
- package/api/build/build.test.mjs +22 -0
- package/api/build/kit/kit.mjs +44 -5
- package/api/component/component.doc.mjs +14 -7
- package/api/docs/_adapter.d.mts +8 -3
- package/api/docs/_adapter.mjs +14 -6
- package/api/docs/docOverlays.test.mjs +27 -1
- package/api/docs/docs.doc.mjs +2 -2
- package/api/doctor/doctor.doc.mjs +17 -8
- package/api/doctor/doctor.type.d.mts +1 -1
- package/api/doctor/doctor.type.mjs +1 -1
- package/api/gap-report/gap-report.doc.mjs +19 -10
- package/api/hook/hook.doc.mjs +6 -3
- package/api/index.d.mts +2 -0
- package/api/index.mjs +3 -1
- package/api/init/init.doc.mjs +17 -12
- package/api/integration/add-theme.mjs +22 -1
- package/api/integration/add-theme.test.mjs +34 -0
- package/api/integration/authoring-checks.mjs +2 -2
- package/api/integration/integrationPackCheck.doc.mjs +3 -3
- package/api/integration/pack-check.lifecycle-output.test.mjs +2 -0
- package/api/integration/pack-check.mjs +54 -6
- package/api/integration/pack-check.test.mjs +90 -0
- package/api/integration/pack-check.type.mjs +1 -1
- package/api/json/assertResponse.doc.mjs +1 -1
- package/api/json/index.ts +1 -0
- package/api/json/isError.doc.mjs +1 -1
- package/api/layout/_adapter.d.mts +34 -0
- package/api/layout/_adapter.mjs +148 -0
- package/api/layout/check/check.d.mts +16 -0
- package/api/layout/check/check.mjs +40 -0
- package/api/layout/expand/expand.d.mts +22 -0
- package/api/layout/expand/expand.mjs +155 -0
- package/api/layout/expand/expand.path-safety.test.mjs +53 -0
- package/api/layout/grammar/grammar.d.mts +13 -0
- package/api/layout/grammar/grammar.mjs +87 -0
- package/api/layout/layout.d.mts +6 -0
- package/api/layout/layout.mjs +17 -0
- package/api/layout/layout.test.mjs +297 -0
- package/api/layout/layout.type.d.mts +89 -0
- package/api/layout/layout.type.mjs +103 -0
- package/api/layout/layoutCheck.doc.d.mts +11 -0
- package/api/layout/layoutCheck.doc.mjs +85 -0
- package/api/layout/layoutExpand.doc.d.mts +11 -0
- package/api/layout/layoutExpand.doc.mjs +107 -0
- package/api/layout/layoutGrammar.doc.d.mts +11 -0
- package/api/layout/layoutGrammar.doc.mjs +57 -0
- package/api/search/search.d.mts +27 -1
- package/api/search/search.doc.mjs +2 -2
- package/api/search/search.mjs +228 -16
- package/api/swizzle/swizzle.doc.mjs +7 -5
- package/api/template/copy/copy.mjs +1 -1
- package/api/template/copy/copy.test.mjs +9 -0
- package/api/template/template-integration.test.mjs +65 -1
- package/api/template/template.doc.mjs +2 -1
- package/api/template/template.mjs +1 -1
- package/api/theme/generateTonalPalette.doc.mjs +1 -2
- package/api/theme/listThemes.doc.mjs +1 -1
- package/api/theme/themeAdd.doc.mjs +9 -10
- package/api/theme/themeBuild.doc.mjs +13 -13
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +2 -1
- package/api/theme/themePaletteGenerate.doc.mjs +15 -8
- package/api/theme/themeTargets.doc.mjs +3 -2
- package/api/theme/themeTemplate.doc.mjs +2 -1
- package/api/upgrade/run/run.mjs +1 -1
- package/api/upgrade/upgrade.doc.mjs +24 -22
- package/assets/docs/README.md +4 -2
- package/assets/docs/browser-support.doc.mjs +11 -11
- package/assets/docs/color.doc.mjs +8 -2
- package/assets/docs/elevation.doc.mjs +6 -4
- package/assets/docs/getting-started.doc.mjs +5 -16
- package/assets/docs/icons.doc.mjs +2 -21
- package/assets/docs/illustrations.doc.mjs +7 -15
- package/assets/docs/layout.doc.dense.mjs +130 -82
- package/assets/docs/layout.doc.mjs +133 -77
- package/assets/docs/migration.doc.mjs +19 -21
- package/assets/docs/motion.doc.mjs +16 -3
- package/assets/docs/principles.doc.dense.mjs +5 -5
- package/assets/docs/principles.doc.mjs +8 -0
- package/assets/docs/principles.doc.zh.mjs +6 -6
- package/assets/docs/shape.doc.mjs +8 -3
- package/assets/docs/spacing.doc.mjs +7 -2
- package/assets/docs/styling-libraries.doc.mjs +6 -2
- package/assets/docs/styling.doc.mjs +19 -23
- package/assets/docs/theme.doc.dense.mjs +58 -18
- package/assets/docs/theme.doc.mjs +56 -46
- package/assets/docs/theme.doc.zh.mjs +9 -8
- package/assets/docs/tokens.doc.dense.mjs +2 -2
- package/assets/docs/tokens.doc.mjs +389 -8
- package/assets/docs/tokens.doc.zh.mjs +2 -2
- package/assets/docs/tree/add-a-component.doc.mjs +75 -0
- package/assets/docs/tree/add-a-theme.doc.mjs +85 -0
- package/assets/docs/tree/add-a-topic.doc.mjs +144 -0
- package/assets/docs/tree/agent-guidance.doc.mjs +138 -0
- package/assets/docs/tree/block-template.doc.mjs +130 -0
- package/assets/docs/tree/build-the-template.doc.mjs +28 -0
- package/assets/docs/tree/building-blocks.doc.mjs +46 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +137 -0
- package/assets/docs/tree/checks.doc.mjs +119 -0
- package/assets/docs/tree/codemods.doc.mjs +147 -0
- package/assets/docs/tree/component-family.doc.mjs +113 -0
- package/assets/docs/tree/component-imports.doc.mjs +69 -0
- package/assets/docs/tree/components.doc.mjs +23 -0
- package/assets/docs/tree/configuration.doc.mjs +23 -0
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +182 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +118 -0
- package/assets/docs/tree/describe-the-component.doc.mjs +57 -0
- package/assets/docs/tree/docs.doc.mjs +21 -0
- package/assets/docs/tree/document-the-template.doc.mjs +28 -0
- package/assets/docs/tree/document-the-theme.doc.mjs +68 -0
- package/assets/docs/tree/export-template-assets.doc.mjs +147 -0
- package/assets/docs/tree/extend-or-replace.doc.mjs +103 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +106 -0
- package/assets/docs/tree/generate-a-palette.doc.mjs +66 -0
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +105 -0
- package/assets/docs/tree/help.doc.mjs +16 -0
- package/assets/docs/tree/integrations.doc.mjs +25 -470
- package/assets/docs/tree/links.doc.mjs +98 -0
- package/assets/docs/tree/package-and-test.doc.mjs +32 -0
- package/assets/docs/tree/page-template.doc.mjs +71 -0
- package/assets/docs/tree/publishing.doc.mjs +111 -0
- package/assets/docs/tree/quick-start.doc.mjs +272 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +104 -0
- package/assets/docs/tree/replace-a-core-template.doc.mjs +172 -0
- package/assets/docs/tree/sections-and-placement.doc.mjs +108 -0
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +59 -0
- package/assets/docs/tree/ship.doc.mjs +16 -0
- package/assets/docs/tree/short-and-findable.doc.mjs +108 -0
- package/assets/docs/tree/single-component.doc.mjs +165 -0
- package/assets/docs/tree/start-a-template.doc.mjs +143 -0
- package/assets/docs/tree/subcomponent.doc.mjs +115 -0
- package/assets/docs/tree/template-assets.doc.mjs +64 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +109 -0
- package/assets/docs/tree/template-fonts.doc.mjs +102 -0
- package/assets/docs/tree/template-grading-rubric.doc.mjs +452 -0
- package/assets/docs/tree/template-icons.doc.mjs +97 -0
- package/assets/docs/tree/template-images-media.doc.mjs +127 -0
- package/assets/docs/tree/template-styles.doc.mjs +93 -0
- package/assets/docs/tree/templates.doc.mjs +34 -0
- package/assets/docs/tree/test-in-an-app.doc.mjs +115 -0
- package/assets/docs/tree/test-template-in-app.doc.mjs +128 -0
- package/assets/docs/tree/themes.doc.mjs +39 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +149 -0
- package/assets/docs/tree/upgrading.doc.mjs +103 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +51 -0
- package/assets/docs/tree/verify-packed-template.doc.mjs +77 -0
- package/assets/docs/tree/versioning.doc.mjs +161 -0
- package/assets/docs/tree/write-good-templates.doc.mjs +64 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +154 -0
- package/assets/docs/typography.doc.mjs +24 -4
- package/assets/docs/working-with-ai.doc.mjs +30 -22
- package/authoring/config/config.doc.mjs +2 -2
- package/authoring/config/type.ts +2 -2
- package/authoring/doctypes/_schema.d.mts +3 -2
- package/authoring/doctypes/_schema.mjs +6 -0
- package/authoring/doctypes/base/graph-fields.doc.mjs +3 -3
- package/authoring/doctypes/base/type.ts +4 -2
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/command/type.ts +1 -1
- package/authoring/doctypes/component/component.doc.mjs +6 -0
- package/authoring/doctypes/component/type.ts +8 -0
- package/authoring/doctypes/reference/reference.doc.mjs +7 -0
- package/authoring/doctypes/reference/type.ts +5 -0
- package/authoring/doctypes/schema/schema.doc.mjs +2 -2
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +2 -2
- package/authoring/integration/integration.doc.mjs +12 -10
- package/clients/cli/command-result-coverage.test.mjs +7 -7
- package/clients/cli/commands/component.doc.mjs +4 -3
- package/clients/cli/commands/debug-result-summary.test.mjs +2 -2
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +60 -17
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -2
- package/clients/cli/commands/doctor-integration.test.mjs +53 -0
- package/clients/cli/commands/doctor.doc.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +49 -5
- package/clients/cli/commands/gap-report.doc.mjs +10 -9
- package/clients/cli/commands/init.doc.mjs +9 -6
- package/clients/cli/commands/integration-add.doc.mjs +9 -9
- package/clients/cli/commands/integration-authoring.test.mjs +61 -10
- package/clients/cli/commands/integration-pack.doc.mjs +5 -9
- package/clients/cli/commands/integration-real-world.test.mjs +1 -1
- package/clients/cli/commands/integration-verify.doc.mjs +22 -0
- package/clients/cli/commands/integration.doc.mjs +4 -4
- package/clients/cli/commands/integration.mjs +74 -43
- package/clients/cli/commands/layout-check.doc.mjs +65 -0
- package/clients/cli/commands/layout-expand.doc.mjs +83 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +30 -0
- package/clients/cli/commands/layout.doc.mjs +34 -0
- package/clients/cli/commands/layout.error-codes.test.mjs +66 -0
- package/clients/cli/commands/layout.exit-parity.test.mjs +41 -0
- package/clients/cli/commands/layout.mjs +275 -0
- package/clients/cli/commands/layout.path-help.test.mjs +33 -0
- package/clients/cli/commands/layout.stdin-cap.test.mjs +47 -0
- package/clients/cli/commands/layout.text-fields.test.mjs +39 -0
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +10 -3
- package/clients/cli/commands/search.mjs +21 -2
- package/clients/cli/commands/search.test.mjs +21 -4
- package/clients/cli/commands/swizzle.doc.mjs +1 -1
- package/clients/cli/commands/template.doc.mjs +1 -1
- package/clients/cli/commands/text-json-parity.test.mjs +24 -1
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-palette.doc.mjs +1 -2
- package/clients/cli/commands/theme-targets.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +2 -1
- package/clients/cli/commands/upgrade.doc.mjs +62 -3
- package/clients/cli/index.mjs +32 -6
- package/clients/cli/lib/define-command.mjs +28 -4
- package/clients/cli/lib/define-command.test.mjs +54 -0
- package/clients/cli/lib/exit-codes.test.mjs +25 -2
- package/clients/cli/lib/json-shim.test.mjs +20 -6
- package/clients/cli/lib/manifest.mjs +23 -5
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/discovery/authoring-self-docs.test.mjs +6 -2
- package/foundation/discovery/cli-self-docs.mjs +16 -2
- package/foundation/discovery/cli-self-docs.test.mjs +20 -0
- package/foundation/discovery/docs-discovery.mjs +5 -1
- package/foundation/discovery/docs-discovery.test.mjs +21 -0
- package/foundation/discovery/docs-section-key.d.mts +1 -1
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/discovery/template-adapter.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +15 -2
- package/foundation/doc-compiler/inputs.test.mjs +0 -1
- package/foundation/doc-compiler/tree.d.mts +4 -0
- package/foundation/doc-compiler/tree.mjs +6 -1
- package/foundation/integrations/cli-requirement.d.mts +26 -6
- package/foundation/integrations/cli-requirement.mjs +46 -11
- package/foundation/integrations/cli-requirement.test.mjs +7 -2
- package/foundation/integrations/contribution-inventory.mjs +1 -1
- package/foundation/response/error-codes.doc.mjs +6 -8
- package/foundation/response/error-codes.test.mjs +30 -5
- package/foundation/response/response-types.doc.d.mts +4 -3
- package/foundation/response/response-types.doc.mjs +42 -6
- package/foundation/response/response.doc.mjs +11 -10
- package/foundation/xle/browser.d.mts +3 -3
- package/foundation/xle/browser.mjs +3 -3
- package/foundation/xle/expand.mjs +2 -2
- package/foundation/xle/parse.mjs +1 -1
- package/foundation/xle/print.mjs +2 -2
- package/foundation/xle/splice.mjs +1 -1
- package/package.json +9 -9
- package/api/docs/docs.test.mjs +0 -245
- package/api/docs/integration-tree.test.mjs +0 -555
- package/api/docs/integrationDocs.test.mjs +0 -314
- package/api/search/search.test.mjs +0 -530
- package/assets/docs/tree/integrations.test.mjs +0 -62
- package/assets/docs/tree/writing-docs.doc.mjs +0 -286
- package/clients/cli/commands/docs.test.mjs +0 -323
- package/foundation/agent-docs/agent-docs.test.mjs +0 -1159
- package/foundation/doc-compiler/tree.test.mjs +0 -606
|
@@ -8,6 +8,7 @@ export const docs = {
|
|
|
8
8
|
category: 'guide',
|
|
9
9
|
description:
|
|
10
10
|
'How to set up AI coding tools to generate correct component code.',
|
|
11
|
+
keywords: ['claude', 'cursor', 'codex', 'copilot', 'agents', 'mcp'],
|
|
11
12
|
|
|
12
13
|
sections: [
|
|
13
14
|
{
|
|
@@ -24,7 +25,8 @@ export const docs = {
|
|
|
24
25
|
],
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
|
-
|
|
28
|
+
id: 'quick-start',
|
|
29
|
+
title: 'Set up agent docs',
|
|
28
30
|
content: [
|
|
29
31
|
{
|
|
30
32
|
type: 'prose',
|
|
@@ -38,7 +40,7 @@ export const docs = {
|
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
42
|
type: 'prose',
|
|
41
|
-
text: "That's it. The `init --features agents` command generates everything your AI needs (component index, behavioral rules, CLI reference, and package guidance from configured integrations) from the installed project. After a dependency bump, `astryx upgrade
|
|
43
|
+
text: "That's it. The `init --features agents` command generates everything your AI needs (component index, behavioral rules, CLI reference, and package guidance from configured integrations) from the installed project. After a dependency bump, `astryx upgrade --from <old version>` reports a stale block and adding `--apply` refreshes it.",
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
type: 'prose',
|
|
@@ -48,10 +50,12 @@ export const docs = {
|
|
|
48
50
|
type: 'code',
|
|
49
51
|
lang: 'bash',
|
|
50
52
|
label: 'Manual options',
|
|
51
|
-
code: `npx @astryxdesign/cli init --features agents --agent claude # .claude/CLAUDE.md
|
|
52
|
-
npx @astryxdesign/cli init --features agents --agent cursor # .cursorrules
|
|
53
|
+
code: `npx @astryxdesign/cli init --features agents --agent claude # CLAUDE.md if present, else .claude/CLAUDE.md
|
|
54
|
+
npx @astryxdesign/cli init --features agents --agent cursor # .cursorrules if present, else AGENTS.md
|
|
53
55
|
npx @astryxdesign/cli init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)
|
|
54
|
-
npx @astryxdesign/cli init --features agents --agent
|
|
56
|
+
npx @astryxdesign/cli init --features agents --agent hermes # .hermes.md or HERMES.md if present, else AGENTS.md
|
|
57
|
+
npx @astryxdesign/cli init --features agents --agent muse # AGENTS.md (Muse)
|
|
58
|
+
npx @astryxdesign/cli init --features agents --agent all # every agent file present, else AGENTS.md and .claude/CLAUDE.md`,
|
|
55
59
|
},
|
|
56
60
|
],
|
|
57
61
|
},
|
|
@@ -82,14 +86,17 @@ npx @astryxdesign/cli init --features agents --agent muse # AGENTS.md (Muse
|
|
|
82
86
|
content: [
|
|
83
87
|
{
|
|
84
88
|
type: 'prose',
|
|
85
|
-
text: 'Cursor project rules
|
|
89
|
+
text: 'Cursor reads project rules from `.cursor/rules/`. To keep the Astryx context in a rule of its own, write it there. Give a path relative to the project root, such as `.cursor/rules/astryx.mdc`; an absolute path is refused.',
|
|
86
90
|
},
|
|
87
91
|
{
|
|
88
92
|
type: 'code',
|
|
89
93
|
lang: 'bash',
|
|
90
|
-
label: 'Install as a Cursor
|
|
91
|
-
code: `
|
|
92
|
-
|
|
94
|
+
label: 'Install as a Cursor project rule',
|
|
95
|
+
code: `npx @astryxdesign/cli init --features agents --agent-docs-path .cursor/rules/astryx.mdc`,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'prose',
|
|
99
|
+
text: 'Rerunning the same command rewrites only the Astryx block, so frontmatter you add above it (such as `alwaysApply: true`) stays.',
|
|
93
100
|
},
|
|
94
101
|
],
|
|
95
102
|
},
|
|
@@ -98,7 +105,7 @@ npx @astryxdesign/cli init --features agents --agent-docs-path ~/.cursor/rules/x
|
|
|
98
105
|
content: [
|
|
99
106
|
{
|
|
100
107
|
type: 'prose',
|
|
101
|
-
text: 'Paste this into your AI before writing any component code.
|
|
108
|
+
text: 'Paste this into your AI before writing any component code. If your AI can\'t answer these questions, it\'ll know to install the agent docs first.',
|
|
102
109
|
},
|
|
103
110
|
{
|
|
104
111
|
type: 'code',
|
|
@@ -107,7 +114,7 @@ npx @astryxdesign/cli init --features agents --agent-docs-path ~/.cursor/rules/x
|
|
|
107
114
|
code: `Before writing any Astryx code, check your knowledge:
|
|
108
115
|
|
|
109
116
|
1. What is the correct import path for Button?
|
|
110
|
-
2. How do you make
|
|
117
|
+
2. How do you make a Dialog non-dismissible?
|
|
111
118
|
3. What prop does Selector use for its items?
|
|
112
119
|
|
|
113
120
|
If you don't know all three, run \`npx @astryxdesign/cli init --features agents\` to generate agent docs, then read the generated file.`,
|
|
@@ -131,33 +138,34 @@ If you don't know all three, run \`npx @astryxdesign/cli init --features agents\
|
|
|
131
138
|
},
|
|
132
139
|
{
|
|
133
140
|
type: 'prose',
|
|
134
|
-
text: 'With this alias, agents
|
|
141
|
+
text: 'With this alias, agents run `npm run astryx -- component --list` instead of guessing the binary path. The `--` separator is standard npm convention for passing flags to scripts.',
|
|
135
142
|
},
|
|
136
143
|
{
|
|
137
144
|
type: 'code',
|
|
138
145
|
lang: 'bash',
|
|
139
146
|
label: 'Reliable CLI invocation',
|
|
140
|
-
code: `astryx component --list
|
|
141
|
-
astryx component Dialog --dense
|
|
142
|
-
astryx docs styling --
|
|
143
|
-
astryx docs tokens --dense`,
|
|
147
|
+
code: `npm run astryx -- component --list
|
|
148
|
+
npm run astryx -- component Dialog --dense
|
|
149
|
+
npm run astryx -- docs styling --full --detail brief
|
|
150
|
+
npm run astryx -- docs tokens --dense`,
|
|
144
151
|
},
|
|
145
152
|
],
|
|
146
153
|
},
|
|
147
154
|
{
|
|
148
|
-
|
|
155
|
+
id: 'the-dense-flag',
|
|
156
|
+
title: 'Shorter output: --detail and --dense',
|
|
149
157
|
content: [
|
|
150
158
|
{
|
|
151
159
|
type: 'prose',
|
|
152
|
-
text: '
|
|
160
|
+
text: 'For a shorter read, add `--detail brief` (one line per section) or `--detail compact`. `--dense` swaps in a shorter text where a doc ships one. Use them when pasting CLI output into a web-based AI tool like ChatGPT or Claude.',
|
|
153
161
|
},
|
|
154
162
|
{
|
|
155
163
|
type: 'code',
|
|
156
164
|
lang: 'bash',
|
|
157
|
-
label: '
|
|
158
|
-
code: `astryx
|
|
159
|
-
astryx
|
|
160
|
-
astryx docs
|
|
165
|
+
label: 'Short output for pasting into AI conversations',
|
|
166
|
+
code: `astryx docs styling --full --detail brief
|
|
167
|
+
astryx component Dialog --detail compact
|
|
168
|
+
astryx docs principles --dense`,
|
|
161
169
|
},
|
|
162
170
|
],
|
|
163
171
|
},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
export const doc = {
|
|
11
11
|
type: 'schema',
|
|
12
12
|
name: 'config',
|
|
13
|
-
displayName: '
|
|
13
|
+
displayName: 'astryx.config',
|
|
14
14
|
namespace: 'authoring',
|
|
15
15
|
description:
|
|
16
16
|
'The optional astryx.config.* file at your project root. Declares which ' +
|
|
@@ -77,7 +77,7 @@ export const doc = {
|
|
|
77
77
|
name: 'experimental.xle.components',
|
|
78
78
|
type: 'Record<string, XleComponent>',
|
|
79
79
|
description:
|
|
80
|
-
'
|
|
80
|
+
'Custom components the layout expander (XLE) may emit, keyed by tag.',
|
|
81
81
|
},
|
|
82
82
|
],
|
|
83
83
|
},
|
package/authoring/config/type.ts
CHANGED
|
@@ -115,8 +115,8 @@ export interface AstryxConfig {
|
|
|
115
115
|
/** Experimental XLE (layout expression) configuration. */
|
|
116
116
|
xle?: {
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
118
|
+
* Register app-local components so XLE layout expressions can
|
|
119
|
+
* reference them by name via {hint}. Keyed by component name.
|
|
120
120
|
*/
|
|
121
121
|
components?: Record<string, XleComponent>;
|
|
122
122
|
};
|
|
@@ -216,6 +216,7 @@ export const ComponentDocKindSchema: z.ZodObject<{
|
|
|
216
216
|
theming: z.ZodOptional<z.ZodUnknown>;
|
|
217
217
|
playground: z.ZodOptional<z.ZodUnknown>;
|
|
218
218
|
examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
219
|
+
replaces: z.ZodOptional<z.ZodString>;
|
|
219
220
|
name: z.ZodString;
|
|
220
221
|
displayName: z.ZodOptional<z.ZodString>;
|
|
221
222
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -316,6 +317,7 @@ export const FunctionDocKindSchema: z.ZodObject<{
|
|
|
316
317
|
export const GenericDocKindSchema: z.ZodObject<{
|
|
317
318
|
type: z.ZodLiteral<"generic">;
|
|
318
319
|
title: z.ZodOptional<z.ZodString>;
|
|
320
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
319
321
|
sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
320
322
|
id: z.ZodOptional<z.ZodString>;
|
|
321
323
|
title: z.ZodString;
|
|
@@ -384,7 +386,6 @@ export const GenericDocKindSchema: z.ZodObject<{
|
|
|
384
386
|
import: z.ZodOptional<z.ZodString>;
|
|
385
387
|
group: z.ZodOptional<z.ZodString>;
|
|
386
388
|
category: z.ZodOptional<z.ZodString>;
|
|
387
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
388
389
|
parent: z.ZodOptional<z.ZodString>;
|
|
389
390
|
relatedDocs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
390
391
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -840,7 +841,6 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
840
841
|
displayName: z.ZodOptional<z.ZodString>;
|
|
841
842
|
group: z.ZodOptional<z.ZodString>;
|
|
842
843
|
category: z.ZodOptional<z.ZodString>;
|
|
843
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
844
844
|
isHiddenFromOverview: z.ZodOptional<z.ZodBoolean>;
|
|
845
845
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
846
846
|
hiddenComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -865,6 +865,7 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
865
865
|
}>>;
|
|
866
866
|
title: z.ZodString;
|
|
867
867
|
description: z.ZodString;
|
|
868
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
868
869
|
sections: z.ZodArray<z.ZodObject<{
|
|
869
870
|
id: z.ZodOptional<z.ZodString>;
|
|
870
871
|
title: z.ZodString;
|
|
@@ -307,6 +307,7 @@ const ComponentBaseSchema = z
|
|
|
307
307
|
theming: z.unknown().optional(),
|
|
308
308
|
playground: z.unknown().optional(),
|
|
309
309
|
examples: z.array(z.unknown()).optional(),
|
|
310
|
+
replaces: z.string().min(1).optional(),
|
|
310
311
|
})
|
|
311
312
|
.passthrough();
|
|
312
313
|
|
|
@@ -414,6 +415,9 @@ export const GenericDocKindSchema = z
|
|
|
414
415
|
...BaseDocFields,
|
|
415
416
|
type: z.literal('generic'),
|
|
416
417
|
title: nonEmptyString.optional(),
|
|
418
|
+
// Search terms the title and sections do not use; `astryx search` matches
|
|
419
|
+
// them as keywords of the whole topic (ReferenceDoc `keywords`).
|
|
420
|
+
keywords: z.array(z.string()).optional(),
|
|
417
421
|
sections: z.array(ReferenceSectionSchema).min(1).optional(),
|
|
418
422
|
replaces: nonEmptyString.optional(),
|
|
419
423
|
extends: nonEmptyString.optional(),
|
|
@@ -730,6 +734,8 @@ const LegacyBaseDocSchema = z.object({
|
|
|
730
734
|
const LegacyReferenceDocSchema = LegacyBaseDocSchema.extend({
|
|
731
735
|
title: nonEmptyString,
|
|
732
736
|
description: z.string(),
|
|
737
|
+
// As on the stamped schema: search terms for the whole topic.
|
|
738
|
+
keywords: z.array(z.string()).optional(),
|
|
733
739
|
sections: z.array(ReferenceSectionSchema).min(1),
|
|
734
740
|
replaces: nonEmptyString.optional(),
|
|
735
741
|
extends: nonEmptyString.optional(),
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'Authored doc graph fields',
|
|
13
13
|
namespace: 'authoring',
|
|
14
14
|
description:
|
|
15
|
-
"
|
|
15
|
+
"Fields every authored doc kind can declare for the docs tree: `placement`, plus two reserved fields, `aliases` and `audience`. The docs tree reads `placement` for every guide, the CLI's and each integration's. Nothing reads `aliases` or `audience` today: a reference topic outside the docs tree that sets one fails to load, and other doc kinds accept them and ignore them.",
|
|
16
16
|
appliesTo: 'Every supported .doc.mjs object',
|
|
17
17
|
fields: [
|
|
18
18
|
{
|
|
@@ -45,13 +45,13 @@ export const doc = {
|
|
|
45
45
|
name: 'aliases',
|
|
46
46
|
type: 'string[]',
|
|
47
47
|
description:
|
|
48
|
-
'
|
|
48
|
+
'Reserved: prior names or routes the docs tree will keep resolving to this doc, without creating another identity. Nothing reads it today, and a topic that sets it fails to load.',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
name: 'audience',
|
|
52
52
|
type: "'public' | 'internal'",
|
|
53
53
|
description:
|
|
54
|
-
"
|
|
54
|
+
"Reserved: which docs bundle includes this doc ('public' when omitted). Nothing reads it today, and a topic that sets it fails to load.",
|
|
55
55
|
default: "'public'",
|
|
56
56
|
},
|
|
57
57
|
],
|
|
@@ -39,9 +39,11 @@ export interface DocPlacement {
|
|
|
39
39
|
export interface AuthoredDocGraphFields {
|
|
40
40
|
/** The doc's one parent in the docs tree: a namespace of its own package. */
|
|
41
41
|
placement?: DocPlacement;
|
|
42
|
-
/**
|
|
42
|
+
/** Reserved: prior routes or names the docs tree will keep resolving.
|
|
43
|
+
* Nothing reads it yet. */
|
|
43
44
|
aliases?: string[];
|
|
44
|
-
/**
|
|
45
|
+
/** Reserved: docs bundle audience; omit for public docs. Nothing reads it
|
|
46
|
+
* yet. */
|
|
45
47
|
audience?: DocAudience;
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -75,7 +75,7 @@ export interface CommandDoc extends AuthoredDocGraphFields {
|
|
|
75
75
|
args?: CommandArgDoc[];
|
|
76
76
|
/** Flags/options. */
|
|
77
77
|
options?: CommandOptionDoc[];
|
|
78
|
-
/** Subcommand names (for command groups like `theme`). */
|
|
78
|
+
/** Subcommand names (for command groups like `theme` / `layout`). */
|
|
79
79
|
subcommands?: string[];
|
|
80
80
|
/** Terminal examples. */
|
|
81
81
|
examples?: CommandExampleDoc[];
|
|
@@ -52,6 +52,12 @@ export const doc = {
|
|
|
52
52
|
description:
|
|
53
53
|
'Exact public package specifier consumers use to import an integration-owned component. The packed-package gate resolves this specifier and verifies it exports the component name.',
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
name: 'replaces',
|
|
57
|
+
type: 'string',
|
|
58
|
+
description:
|
|
59
|
+
"Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, lists, search, swizzle, and issue routing. The Core original stays reachable with `--package @astryxdesign/core`. Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.",
|
|
60
|
+
},
|
|
55
61
|
{
|
|
56
62
|
name: 'keywords',
|
|
57
63
|
type: 'string[]',
|
|
@@ -48,6 +48,14 @@ export interface ComponentBaseDoc extends AuthoredDocGraphFields {
|
|
|
48
48
|
displayName: string;
|
|
49
49
|
/** Exact consumer import specifier for integration-owned components. */
|
|
50
50
|
import?: string;
|
|
51
|
+
/** Integration components only: the exact `name` of the Core ComponentDoc
|
|
52
|
+
* this component takes over for unqualified lookup, so every app that loads
|
|
53
|
+
* the integration gets this component from component detail, lists, search,
|
|
54
|
+
* swizzle, and issue routing. The Core original stays reachable with
|
|
55
|
+
* `--package @astryxdesign/core`. Set it only to intentionally own a Core
|
|
56
|
+
* identity; give an alternative or variant its own name instead. Older CLIs
|
|
57
|
+
* that do not read `replaces` keep the component under its own name. */
|
|
58
|
+
replaces?: string;
|
|
51
59
|
/** Search keywords for CLI discovery. Terms a developer might type when
|
|
52
60
|
* looking for this component: synonyms, related UI concepts, and common
|
|
53
61
|
* names from other design systems (MUI, Chakra, Radix, and others).
|
|
@@ -51,6 +51,13 @@ export const doc = {
|
|
|
51
51
|
type: 'string',
|
|
52
52
|
description: "Navigation category: 'guide' or 'foundations'.",
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
name: 'keywords',
|
|
56
|
+
type: 'string[]',
|
|
57
|
+
description:
|
|
58
|
+
"Words a reader may search for that the title and sections do not use: a synonym, a task, or another library's name for the same thing. `astryx search` matches each as a keyword of the whole topic, so an exact one ranks the topic like its own title does.",
|
|
59
|
+
example: "['dark mode', 'color scheme']",
|
|
60
|
+
},
|
|
54
61
|
{
|
|
55
62
|
name: 'replaces',
|
|
56
63
|
type: 'string',
|
|
@@ -127,6 +127,11 @@ export interface ReferenceDoc extends AuthoredDocGraphFields {
|
|
|
127
127
|
description: string;
|
|
128
128
|
/** Navigation category: 'guide' or 'foundations'. */
|
|
129
129
|
category?: string;
|
|
130
|
+
/** Words a reader may search for that the title and sections do not use:
|
|
131
|
+
* a synonym, a task ("dark mode"), or another library's name for the same
|
|
132
|
+
* thing. `astryx search` matches each as a keyword of the whole topic, so
|
|
133
|
+
* an exact one ranks the topic like its own title does. */
|
|
134
|
+
keywords?: string[];
|
|
130
135
|
/** Name of an existing topic this doc takes the place of. Authored by an
|
|
131
136
|
* integration whose guide should be served instead of the built-in one —
|
|
132
137
|
* `replaces: 'getting-started'` on a doc named `getting-started` swaps the
|
|
@@ -49,7 +49,7 @@ export const doc = {
|
|
|
49
49
|
name: 'namespace',
|
|
50
50
|
type: 'string',
|
|
51
51
|
description:
|
|
52
|
-
"The group that reads this doc: 'authoring' for a file an author writes (a section of
|
|
52
|
+
"The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:authoring}), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
name: 'aliases',
|
|
@@ -162,7 +162,7 @@ export const doc = {
|
|
|
162
162
|
type: '{ dir: string }',
|
|
163
163
|
description: 'Where component sources live.',
|
|
164
164
|
fields: [
|
|
165
|
-
{name: 'components.dir', type: 'string', description: 'Glob root for
|
|
165
|
+
{name: 'components.dir', type: 'string', description: 'Glob root for Acme*.tsx files.', required: true},
|
|
166
166
|
],
|
|
167
167
|
},
|
|
168
168
|
],
|
|
@@ -56,7 +56,7 @@ export const doc = {
|
|
|
56
56
|
name: 'replaces',
|
|
57
57
|
type: 'string',
|
|
58
58
|
description:
|
|
59
|
-
"Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field and
|
|
59
|
+
"Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field, drop that template, and hide the package's doc topics.",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'isReady',
|
|
@@ -33,8 +33,8 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
33
33
|
* replaces for unqualified lookup (find it with
|
|
34
34
|
* `astryx --json template --list --package @astryxdesign/core`). The Core
|
|
35
35
|
* original stays selectable with `--package @astryxdesign/core`. Needs
|
|
36
|
-
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field
|
|
37
|
-
*
|
|
36
|
+
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field,
|
|
37
|
+
* drop that template, and hide the package's doc topics. */
|
|
38
38
|
replaces?: string;
|
|
39
39
|
/** Whether this template is ready for use. Templates with
|
|
40
40
|
* isReady: false show as "(WIP)" in the gallery and CLI. */
|
|
@@ -23,48 +23,49 @@ export const doc = {
|
|
|
23
23
|
name: 'providerId',
|
|
24
24
|
type: 'string',
|
|
25
25
|
description:
|
|
26
|
-
'
|
|
26
|
+
'The name that marks this package as the source of everything it contributes. Leave it out to use the package name from package.json. Set it to the old name only during a rename, so the IDs of what the package already contributed stay the same. If two packages use the same name here, the one you are working on wins; otherwise the one the CLI reads first wins, and the CLI warns about the other.',
|
|
27
27
|
example: "'@acme/widgets'",
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
name: 'components',
|
|
31
31
|
type: 'string',
|
|
32
32
|
description:
|
|
33
|
-
'
|
|
33
|
+
'The folder that holds your components and their docs, relative to package.json.',
|
|
34
34
|
example: "'./src/components'",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
name: 'templates',
|
|
38
38
|
type: 'string',
|
|
39
39
|
description:
|
|
40
|
-
'
|
|
40
|
+
'The folder that holds your templates, relative to package.json.',
|
|
41
41
|
example: "'./src/templates'",
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
name: 'codemods',
|
|
45
45
|
type: 'string',
|
|
46
|
-
description:
|
|
46
|
+
description:
|
|
47
|
+
'The folder that holds your codemods, relative to package.json.',
|
|
47
48
|
example: "'./codemods'",
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
name: 'docs',
|
|
51
52
|
type: 'string',
|
|
52
53
|
description:
|
|
53
|
-
'
|
|
54
|
+
'The folder that holds your doc topics, relative to package.json. Every {topic}.doc.{ts,mjs,js} in it shows up in `astryx docs` next to the built-in topics; a topic can also set `replaces` or `extends` to take over a built-in topic or add to it.',
|
|
54
55
|
example: "'./docs'",
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
name: 'themes',
|
|
58
59
|
type: 'string',
|
|
59
60
|
description:
|
|
60
|
-
'
|
|
61
|
+
'The folder that holds your themes, relative to package.json, with one folder per theme. Each theme folder has the theme source and a matching .doc.mjs file with the same name. Installed themes show up in `astryx theme list` and can be copied with `astryx theme add`.',
|
|
61
62
|
example: "'./themes'",
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
65
|
name: 'agentDocs',
|
|
65
66
|
type: '{ append?: readonly string[] }',
|
|
66
67
|
description:
|
|
67
|
-
'
|
|
68
|
+
'Lines of guidance your package adds to the end of the agent instructions the CLI manages. The CLI owns the heading, labels, bullets, and which files it writes.',
|
|
68
69
|
example: "{ append: ['Run acme verify.'] }",
|
|
69
70
|
},
|
|
70
71
|
{
|
|
@@ -94,9 +95,10 @@ export const doc = {
|
|
|
94
95
|
{
|
|
95
96
|
type: 'prose',
|
|
96
97
|
text:
|
|
97
|
-
'
|
|
98
|
-
'
|
|
99
|
-
'
|
|
98
|
+
'The provider name defaults to the package name in package.json. ' +
|
|
99
|
+
'During a rename, set `providerId` to the old package name so the IDs ' +
|
|
100
|
+
'of what the package already contributed stay the same. The package ' +
|
|
101
|
+
'version always comes from package.json.',
|
|
100
102
|
},
|
|
101
103
|
{
|
|
102
104
|
type: 'prose',
|
|
@@ -29,17 +29,17 @@ import {program} from './index.mjs';
|
|
|
29
29
|
import {reportsResult, reportsResultVia} from './lib/define-command.mjs';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Commands with no action of their own:
|
|
33
|
-
* list and does nothing else
|
|
32
|
+
* Commands with no action of their own: bare `astryx layout` prints its
|
|
33
|
+
* subcommand list and does nothing else, so there is no run to report on.
|
|
34
34
|
*
|
|
35
35
|
* Pinned as a SET rather than skipped silently — if a command joins this list,
|
|
36
36
|
* that is a real change to what the CLI does and it should be read, not
|
|
37
|
-
* absorbed.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* absorbed. (`theme` is deliberately NOT here: it HAS an action — the one that
|
|
38
|
+
* rejects an unknown subcommand — so it goes through the converter like any
|
|
39
|
+
* other. Its bare form prints help and never returns from that action, which
|
|
40
|
+
* the recorder covers where help is recorded, not here.)
|
|
41
41
|
*/
|
|
42
|
-
const NO_ACTION_OF_THEIR_OWN = [];
|
|
42
|
+
const NO_ACTION_OF_THEIR_OWN = ['layout'];
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Commands that record for themselves instead of returning a descriptor.
|
|
@@ -37,12 +37,13 @@ export const doc = {
|
|
|
37
37
|
{
|
|
38
38
|
flag: '--list',
|
|
39
39
|
param: 'options.list',
|
|
40
|
-
description: 'List
|
|
40
|
+
description: 'List every component (the same as giving no name)',
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
flag: '--category <category>',
|
|
44
44
|
param: 'options.category',
|
|
45
|
-
description:
|
|
45
|
+
description:
|
|
46
|
+
'List one component group, e.g. --category Layout or --category Avatar (an unknown group lists the valid ones)',
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
flag: '--props',
|
|
@@ -79,7 +80,7 @@ export const doc = {
|
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
82
|
label: 'Props table as JSON',
|
|
82
|
-
cli: 'astryx component
|
|
83
|
+
cli: 'astryx component Button --props --json',
|
|
83
84
|
},
|
|
84
85
|
],
|
|
85
86
|
exitCodes: [
|
|
@@ -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
|
-
//
|
|
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(['
|
|
184
|
+
const {event} = await runWithDebug(['layout', 'check', 'VStack>Text']);
|
|
185
185
|
expect(event.output).toMatchObject({
|
|
186
186
|
resultKind: 'none',
|
|
187
187
|
resultCount: null,
|
|
@@ -47,7 +47,7 @@ export const doc = {
|
|
|
47
47
|
{label: 'One section', cli: 'astryx docs theme quick-start'},
|
|
48
48
|
{label: 'The CLI docs tree', cli: 'astryx docs cli'},
|
|
49
49
|
{label: 'One API function', cli: 'astryx docs cli/api/functions/search'},
|
|
50
|
-
{label: 'A whole guide', cli: 'astryx docs cli/integrations --full'},
|
|
50
|
+
{label: 'A whole guide', cli: 'astryx docs cli/integrations/quick-start --full'},
|
|
51
51
|
],
|
|
52
52
|
exitCodes: [
|
|
53
53
|
{code: 0, when: 'success'},
|