@astryxdesign/cli 0.6.4-canary.f0355e3 → 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.
- package/README.md +96 -99
- package/api/build/build.doc.mjs +1 -6
- package/api/build/build.test.mjs +0 -22
- package/api/build/kit/kit.mjs +5 -44
- package/api/component/_adapter.d.mts +0 -25
- package/api/component/_adapter.mjs +5 -59
- package/api/component/component.d.mts +3 -6
- package/api/component/component.doc.mjs +17 -37
- package/api/component/component.mjs +9 -249
- package/api/component/component.type.d.mts +0 -25
- package/api/component/component.type.mjs +0 -44
- package/api/discover/_adapter.d.mts +6 -114
- package/api/discover/_adapter.mjs +17 -372
- package/api/discover/detail/detail.d.mts +6 -18
- package/api/discover/detail/detail.mjs +13 -67
- package/api/discover/detail/detail.test.mjs +0 -85
- package/api/discover/discover.d.mts +9 -3
- package/api/discover/discover.doc.mjs +18 -61
- package/api/discover/discover.mjs +36 -220
- package/api/discover/discover.test.mjs +2 -11
- package/api/discover/discover.type.d.mts +8 -147
- package/api/discover/discover.type.mjs +12 -102
- package/api/discover/list/list.d.mts +6 -20
- package/api/discover/list/list.mjs +12 -45
- package/api/discover/list/list.test.mjs +0 -46
- package/api/discover/search/search.d.mts +16 -18
- package/api/discover/search/search.mjs +56 -102
- package/api/discover/search/search.test.mjs +10 -144
- package/api/docs/_adapter.d.mts +3 -8
- package/api/docs/_adapter.mjs +6 -14
- package/api/docs/docOverlays.test.mjs +1 -27
- package/api/docs/docs.doc.mjs +2 -2
- package/api/docs/docs.test.mjs +243 -0
- package/api/docs/integration-tree.test.mjs +555 -0
- package/api/docs/integrationDocs.test.mjs +314 -0
- package/api/doctor/doctor.d.mts +3 -8
- package/api/doctor/doctor.doc.mjs +8 -17
- package/api/doctor/doctor.mjs +9 -90
- package/api/doctor/doctor.test.mjs +10 -122
- 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 +10 -19
- package/api/hook/hook.doc.mjs +3 -6
- package/api/index.d.mts +2 -1
- package/api/index.mjs +5 -5
- package/api/init/init.doc.mjs +12 -17
- package/api/integration/add-helpers.d.mts +2 -5
- package/api/integration/add-helpers.mjs +9 -36
- package/api/integration/add-theme.mjs +1 -22
- package/api/integration/add-theme.test.mjs +0 -34
- package/api/integration/authoring-checks.mjs +2 -2
- package/api/integration/integrationPackCheck.doc.mjs +3 -3
- package/api/integration/pack-check.mjs +9 -82
- package/api/integration/pack-check.test.mjs +0 -90
- 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 +1 -27
- package/api/search/search.doc.mjs +2 -2
- package/api/search/search.mjs +16 -228
- package/api/search/search.test.mjs +512 -0
- package/api/swizzle/swizzle.doc.mjs +5 -7
- package/api/template/copy/copy.mjs +1 -1
- package/api/template/copy/copy.test.mjs +0 -9
- package/api/template/template-integration.test.mjs +65 -1
- package/api/template/template.doc.mjs +1 -2
- package/api/template/template.mjs +1 -1
- package/api/theme/add/add.mjs +25 -17
- package/api/theme/add/add.staging.test.mjs +23 -40
- package/api/theme/build/build.family.test.mjs +12 -7
- package/api/theme/build/build.mjs +18 -8
- package/api/theme/generateTonalPalette.doc.mjs +2 -1
- package/api/theme/listThemes.doc.mjs +1 -1
- package/api/theme/themeAdd.doc.mjs +10 -9
- package/api/theme/themeBuild.doc.mjs +13 -13
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +1 -2
- package/api/theme/themePaletteGenerate.doc.mjs +8 -15
- package/api/theme/themeTargets.doc.mjs +2 -3
- package/api/theme/themeTemplate.doc.mjs +1 -2
- package/api/upgrade/run/run.mjs +4 -6
- package/api/upgrade/upgrade.doc.mjs +22 -24
- package/api/upgrade/upgrade.type.mjs +2 -2
- package/assets/codemods/__tests__/runner.test.mjs +1 -3
- package/assets/codemods/integration-runner.mjs +3 -3
- package/assets/codemods/runner.mjs +4 -5
- package/assets/docs/README.md +2 -4
- package/assets/docs/browser-support.doc.mjs +11 -11
- package/assets/docs/color.doc.mjs +2 -8
- package/assets/docs/elevation.doc.mjs +4 -6
- package/assets/docs/getting-started.doc.mjs +16 -5
- package/assets/docs/icons.doc.mjs +21 -2
- package/assets/docs/illustrations.doc.mjs +15 -7
- package/assets/docs/internationalization.doc.mjs +5 -7
- package/assets/docs/layout.doc.dense.mjs +82 -130
- package/assets/docs/layout.doc.mjs +77 -133
- package/assets/docs/migration.doc.mjs +21 -19
- package/assets/docs/motion.doc.mjs +3 -16
- package/assets/docs/principles.doc.dense.mjs +5 -5
- package/assets/docs/principles.doc.mjs +0 -8
- package/assets/docs/principles.doc.zh.mjs +6 -6
- package/assets/docs/shape.doc.mjs +3 -8
- package/assets/docs/spacing.doc.mjs +2 -7
- package/assets/docs/styling-libraries.doc.mjs +2 -6
- package/assets/docs/styling.doc.mjs +23 -19
- package/assets/docs/theme.doc.dense.mjs +18 -58
- package/assets/docs/theme.doc.mjs +46 -56
- package/assets/docs/theme.doc.zh.mjs +8 -9
- package/assets/docs/tokens.doc.dense.mjs +2 -2
- package/assets/docs/tokens.doc.mjs +8 -389
- package/assets/docs/tokens.doc.zh.mjs +2 -2
- package/assets/docs/tree/integrations.doc.mjs +451 -25
- package/assets/docs/tree/integrations.test.mjs +62 -0
- package/assets/docs/tree/writing-docs.doc.mjs +286 -0
- package/assets/docs/typography.doc.mjs +4 -24
- package/assets/docs/working-with-ai.doc.mjs +22 -30
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/authoring/config/config.doc.mjs +2 -10
- package/authoring/config/parse.d.mts +0 -2
- package/authoring/config/parse.mjs +0 -19
- package/authoring/config/parse.test.mjs +0 -8
- package/authoring/config/type.ts +2 -13
- package/authoring/doctypes/_schema.d.mts +2 -3
- package/authoring/doctypes/_schema.mjs +0 -6
- package/authoring/doctypes/base/graph-fields.doc.mjs +3 -3
- package/authoring/doctypes/base/type.ts +2 -4
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/command/type.ts +1 -1
- package/authoring/doctypes/component/component.doc.mjs +0 -6
- package/authoring/doctypes/component/type.ts +0 -8
- package/authoring/doctypes/reference/reference.doc.mjs +0 -7
- package/authoring/doctypes/reference/type.ts +0 -5
- 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/index.d.mts +0 -1
- package/authoring/index.d.ts +0 -10
- package/authoring/index.mjs +0 -1
- package/authoring/integration/integration.doc.mjs +10 -12
- package/clients/cli/command-result-coverage.test.mjs +7 -7
- package/clients/cli/commands/component/index.mjs +55 -152
- package/clients/cli/commands/component-ownership.test.mjs +0 -89
- package/clients/cli/commands/component.doc.mjs +9 -27
- package/clients/cli/commands/debug-result-summary.test.mjs +2 -2
- package/clients/cli/commands/discover.doc.mjs +9 -53
- package/clients/cli/commands/discover.mjs +118 -393
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +17 -60
- package/clients/cli/commands/docs.test.mjs +294 -0
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +2 -3
- package/clients/cli/commands/doctor-integration.test.mjs +0 -53
- package/clients/cli/commands/doctor.doc.mjs +1 -3
- package/clients/cli/commands/doctor.mjs +5 -49
- package/clients/cli/commands/gap-report.doc.mjs +9 -10
- package/clients/cli/commands/init.doc.mjs +6 -9
- package/clients/cli/commands/integration-add.doc.mjs +9 -9
- package/clients/cli/commands/integration-authoring.test.mjs +10 -61
- package/clients/cli/commands/integration-pack.doc.mjs +9 -5
- package/clients/cli/commands/integration-real-world.test.mjs +1 -1
- package/clients/cli/commands/integration.doc.mjs +4 -4
- package/clients/cli/commands/integration.mjs +43 -74
- 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 +3 -10
- package/clients/cli/commands/search.mjs +2 -21
- package/clients/cli/commands/search.test.mjs +4 -21
- 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 +16 -5
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +2 -3
- package/clients/cli/commands/theme-palette.doc.mjs +2 -1
- package/clients/cli/commands/theme-targets.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +1 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -62
- package/clients/cli/index.mjs +10 -28
- package/clients/cli/lib/define-command.mjs +4 -28
- package/clients/cli/lib/define-command.test.mjs +0 -54
- package/clients/cli/lib/exit-codes.test.mjs +9 -18
- package/clients/cli/lib/json-shim.mjs +14 -24
- package/clients/cli/lib/json-shim.test.mjs +20 -6
- package/clients/cli/lib/manifest.mjs +13 -18
- package/clients/cli/lib/manifest.test.mjs +2 -5
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/agent-docs/agent-docs.test.mjs +1159 -0
- package/foundation/discovery/authoring-self-docs.mjs +0 -1
- package/foundation/discovery/authoring-self-docs.test.mjs +2 -6
- package/foundation/discovery/cli-self-docs.mjs +2 -16
- package/foundation/discovery/cli-self-docs.test.mjs +0 -20
- package/foundation/discovery/docs-discovery.mjs +1 -5
- package/foundation/discovery/docs-discovery.test.mjs +0 -21
- 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 +14 -3
- package/foundation/doc-compiler/tree.d.mts +0 -4
- package/foundation/doc-compiler/tree.mjs +1 -6
- package/foundation/doc-compiler/tree.test.mjs +598 -0
- package/foundation/integrations/cli-requirement.d.mts +6 -26
- package/foundation/integrations/cli-requirement.mjs +11 -46
- package/foundation/integrations/cli-requirement.test.mjs +2 -7
- package/foundation/integrations/contribution-inventory.mjs +1 -1
- package/foundation/integrations/integrations.d.mts +1 -14
- package/foundation/integrations/integrations.mjs +1 -41
- package/foundation/integrations/integrations.test.mjs +0 -31
- package/foundation/response/error-codes.doc.mjs +8 -6
- package/foundation/response/error-codes.test.mjs +5 -30
- package/foundation/response/response-types.doc.d.mts +3 -4
- package/foundation/response/response-types.doc.mjs +27 -40
- package/foundation/response/response-types.doc.test.mjs +0 -23
- package/foundation/response/response.doc.mjs +10 -11
- 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/discover/_adapter.test.mjs +0 -215
- package/api/discover/_catalog-view.d.mts +0 -115
- package/api/discover/_catalog-view.mjs +0 -203
- package/api/discover/_catalog-view.test.mjs +0 -128
- package/api/discover/detail/item/item.d.mts +0 -26
- package/api/discover/detail/item/item.mjs +0 -78
- package/api/discover/detail/item/item.test.mjs +0 -73
- package/api/integration/pack-check.lifecycle-output.test.mjs +0 -107
- package/api/theme/add/add.rollback.test.mjs +0 -158
- package/api/theme/build/build.rollback.test.mjs +0 -148
- package/api/upgrade/run/files-changed.test.mjs +0 -111
- package/assets/codemods/file-count.test.mjs +0 -163
- package/assets/docs/tree/add-a-component.doc.mjs +0 -75
- package/assets/docs/tree/add-a-theme.doc.mjs +0 -85
- package/assets/docs/tree/add-a-topic.doc.mjs +0 -144
- package/assets/docs/tree/agent-guidance.doc.mjs +0 -138
- package/assets/docs/tree/block-template.doc.mjs +0 -130
- package/assets/docs/tree/build-the-template.doc.mjs +0 -28
- package/assets/docs/tree/building-blocks.doc.mjs +0 -46
- package/assets/docs/tree/check-your-docs.doc.mjs +0 -137
- package/assets/docs/tree/checks.doc.mjs +0 -119
- package/assets/docs/tree/codemods.doc.mjs +0 -147
- package/assets/docs/tree/component-family.doc.mjs +0 -113
- package/assets/docs/tree/component-imports.doc.mjs +0 -69
- package/assets/docs/tree/component-lookups.doc.mjs +0 -149
- package/assets/docs/tree/components.doc.mjs +0 -23
- package/assets/docs/tree/configuration.doc.mjs +0 -23
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +0 -182
- package/assets/docs/tree/define-the-theme.doc.mjs +0 -118
- package/assets/docs/tree/describe-the-component.doc.mjs +0 -57
- package/assets/docs/tree/docs.doc.mjs +0 -21
- package/assets/docs/tree/document-the-template.doc.mjs +0 -28
- package/assets/docs/tree/document-the-theme.doc.mjs +0 -68
- package/assets/docs/tree/export-template-assets.doc.mjs +0 -147
- package/assets/docs/tree/extend-or-replace.doc.mjs +0 -103
- package/assets/docs/tree/fonts-and-assets.doc.mjs +0 -106
- package/assets/docs/tree/generate-a-palette.doc.mjs +0 -66
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +0 -105
- package/assets/docs/tree/help.doc.mjs +0 -16
- package/assets/docs/tree/links.doc.mjs +0 -98
- package/assets/docs/tree/package-and-test.doc.mjs +0 -32
- package/assets/docs/tree/page-template.doc.mjs +0 -71
- package/assets/docs/tree/publishing.doc.mjs +0 -111
- package/assets/docs/tree/quick-start.doc.mjs +0 -272
- package/assets/docs/tree/replace-a-core-component.doc.mjs +0 -104
- package/assets/docs/tree/replace-a-core-template.doc.mjs +0 -172
- package/assets/docs/tree/sections-and-placement.doc.mjs +0 -108
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +0 -59
- package/assets/docs/tree/ship.doc.mjs +0 -16
- package/assets/docs/tree/short-and-findable.doc.mjs +0 -108
- package/assets/docs/tree/single-component.doc.mjs +0 -165
- package/assets/docs/tree/start-a-template.doc.mjs +0 -143
- package/assets/docs/tree/subcomponent.doc.mjs +0 -115
- package/assets/docs/tree/template-assets.doc.mjs +0 -64
- package/assets/docs/tree/template-doc-overview.doc.mjs +0 -109
- package/assets/docs/tree/template-fonts.doc.mjs +0 -102
- package/assets/docs/tree/template-grading-rubric.doc.mjs +0 -452
- package/assets/docs/tree/template-icons.doc.mjs +0 -97
- package/assets/docs/tree/template-images-media.doc.mjs +0 -127
- package/assets/docs/tree/template-styles.doc.mjs +0 -93
- package/assets/docs/tree/templates.doc.mjs +0 -34
- package/assets/docs/tree/test-in-an-app.doc.mjs +0 -115
- package/assets/docs/tree/test-template-in-app.doc.mjs +0 -128
- package/assets/docs/tree/themes.doc.mjs +0 -39
- package/assets/docs/tree/troubleshooting.doc.mjs +0 -149
- package/assets/docs/tree/upgrading.doc.mjs +0 -103
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +0 -51
- package/assets/docs/tree/verify-packed-template.doc.mjs +0 -77
- package/assets/docs/tree/versioning.doc.mjs +0 -161
- package/assets/docs/tree/write-good-templates.doc.mjs +0 -64
- package/assets/docs/tree/write-the-template-file.doc.mjs +0 -154
- package/authoring/discover/discover.doc.d.mts +0 -13
- package/authoring/discover/discover.doc.mjs +0 -138
- package/authoring/discover/parse.d.mts +0 -24
- package/authoring/discover/parse.mjs +0 -128
- package/authoring/discover/parse.test.mjs +0 -124
- package/authoring/discover/type.ts +0 -87
- package/clients/cli/commands/component-batch.test.mjs +0 -341
- package/clients/cli/commands/discover.sources.test.mjs +0 -267
- package/clients/cli/commands/integration-verify.doc.mjs +0 -22
- package/clients/cli/lib/parse-error-format.test.mjs +0 -81
- package/foundation/response/batch.type.d.mts +0 -33
- package/foundation/response/batch.type.mjs +0 -34
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs cli/writing-docs`: the guide to writing docs that readers,
|
|
5
|
+
* people and agents alike, find by search or by moving one level at a time.
|
|
6
|
+
* It lives in the docs tree under the `cli` namespace, so its only route is
|
|
7
|
+
* `cli/writing-docs`.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
11
|
+
export const docs = {
|
|
12
|
+
type: 'generic',
|
|
13
|
+
name: 'writing-docs',
|
|
14
|
+
placement: {parent: 'namespace:cli', slot: 'guides', order: 20},
|
|
15
|
+
title: 'Writing docs',
|
|
16
|
+
category: 'guide',
|
|
17
|
+
description:
|
|
18
|
+
'Write docs that people and agents find by search or by reading one level at a time.',
|
|
19
|
+
|
|
20
|
+
sections: [
|
|
21
|
+
{
|
|
22
|
+
title: 'How the docs work',
|
|
23
|
+
category: 'guide',
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: 'prose',
|
|
27
|
+
text: 'Every doc is one node in one docs graph, with a stable identity and one home in a tree.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'list',
|
|
31
|
+
style: 'unordered',
|
|
32
|
+
items: [
|
|
33
|
+
"Identity: the doc's provider, its kind, and its name. Moving a doc never changes it.",
|
|
34
|
+
'Route: the names of the doc and its parents, such as `cli/api/functions/search`; `astryx docs <route>` reads it.',
|
|
35
|
+
'Moves: every read ends with Up, Previous, Next, and Related, each as a command you can run.',
|
|
36
|
+
'Search: a hit is the smallest part that answers, one section or one tree page. It gives the command that reads it and the command that opens the level above.',
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'prose',
|
|
41
|
+
text: "You never write moves or lists of children. The CLI derives them from each doc's home and its typed links.",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: 'Add a doc',
|
|
47
|
+
category: 'guide',
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'prose',
|
|
51
|
+
text: 'To add a doc, write one `.doc.mjs` file named after the doc, and stamp the type that matches what it describes.',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'table',
|
|
55
|
+
headers: ['You document', 'Doc type', '`type`'],
|
|
56
|
+
rows: [
|
|
57
|
+
['A topic or a guide', 'ReferenceDoc', "'generic'"],
|
|
58
|
+
['A CLI command', 'CommandDoc', "'command'"],
|
|
59
|
+
['A CLI API function', 'FunctionDoc', "'function'"],
|
|
60
|
+
['An object shape', 'SchemaDoc', "'schema'"],
|
|
61
|
+
['A fixed list of values', 'EnumDoc', "'enum'"],
|
|
62
|
+
['A component', 'ComponentDoc', "'component'"],
|
|
63
|
+
['A level of the tree', 'NamespaceDoc', "'namespace'"],
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'prose',
|
|
68
|
+
text: 'A topic or guide holds `sections`. Each section has a `title` and `content` blocks, and covers one idea. The `description` is one sentence that says what the doc covers.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'code',
|
|
72
|
+
lang: 'javascript',
|
|
73
|
+
label: 'docs/deploying.doc.mjs',
|
|
74
|
+
code: "export default {\n type: 'generic',\n name: 'deploying',\n title: 'Deploying',\n description: 'Ship an app built with Acme widgets.',\n sections: [\n {\n title: 'Build before you ship',\n content: [\n {type: 'prose', text: 'Build the app, then check it with {@link @astryxdesign/cli:command:doctor}.'},\n {type: 'code', lang: 'bash', code: 'npm run build'},\n {type: 'list', style: 'unordered', items: ['Check the output folder.']},\n {type: 'table', headers: ['Env', 'Value'], rows: [['NODE_ENV', 'production']]},\n ],\n },\n ],\n};",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'list',
|
|
78
|
+
style: 'unordered',
|
|
79
|
+
items: [
|
|
80
|
+
'A name is a command argument, so use only letters, digits, `_`, and `-`. Use lowercase kebab-case, such as `writing-docs`, so the name and its route segment match.',
|
|
81
|
+
'Keep the name stable. Links name a doc by its identity, and the name is part of it.',
|
|
82
|
+
'A name that collides with an existing topic is an error unless the doc declares `replaces` or `extends`.',
|
|
83
|
+
'Name the cases a doc does not cover, and link to where they are covered. A reader cannot tell a case you left out from a case that does not exist.',
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: 'prose',
|
|
88
|
+
text: 'Every field of every doc type is in {@link generic:authoring}.',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: 'Place a doc',
|
|
94
|
+
category: 'guide',
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'prose',
|
|
98
|
+
text: 'Each doc gets one home in one of three ways: a namespace adopts it, it places itself, or it stays a flat topic. Folders never decide a home.',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'prose',
|
|
102
|
+
text: "Adopted: a CLI typed doc declares `namespace`, either `'cli/commands'` or `'cli/api'`. That namespace adopts it by kind, so its route is `cli/commands/<name>` or `cli/api/functions/<name>`.",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'code',
|
|
106
|
+
lang: 'javascript',
|
|
107
|
+
code: "{type: 'function', name: 'search', namespace: 'cli/api' /* ... */} // cli/api/functions/search",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: 'prose',
|
|
111
|
+
text: "Placed: a guide declares `placement`. The `parent` names a namespace of your own package, the `slot` is one that namespace declares for the doc's kind, and `order` sorts the siblings in the slot. A placement that fails withdraws the doc with an error.",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'code',
|
|
115
|
+
lang: 'javascript',
|
|
116
|
+
code: "placement: {parent: 'namespace:cli', slot: 'guides', order: 20}, // cli/writing-docs",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'prose',
|
|
120
|
+
text: 'Flat: a doc with neither is a flat topic, read with `astryx docs <name>`.',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: 'code',
|
|
124
|
+
lang: 'javascript',
|
|
125
|
+
code: "{type: 'generic', name: 'tokens', title: 'All Tokens' /* ... */} // astryx docs tokens",
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: 'Link docs',
|
|
131
|
+
category: 'guide',
|
|
132
|
+
content: [
|
|
133
|
+
{
|
|
134
|
+
type: 'prose',
|
|
135
|
+
text: 'Link a doc with `{@link <target>}` or a typed field, never by writing its `astryx docs` route in prose: a route you write goes stale when the doc moves. Other commands, such as `astryx doctor`, you write as they are.',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: 'prose',
|
|
139
|
+
text: "Typed fields: a FunctionDoc's `command` names the CLI command that runs it, and its `related` names functions. A CommandDoc's `fn` names the function it runs, and its `related` names commands.",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: 'code',
|
|
143
|
+
lang: 'javascript',
|
|
144
|
+
code: "{type: 'function', name: 'search', command: 'search', related: ['docs']}\n{type: 'command', name: 'search', fn: 'search', related: ['docs']}",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: 'prose',
|
|
148
|
+
text: "Inside a section's text, write `{@link <target>}`, where the target is `[<provider>:]<kind>:<name>`; leave out the provider for a doc of your own provider. The CLI prints the command that opens the doc. It works in prose, list items, and table cells; link syntax inside code ticks is shown as written, and an older CLI prints the link as plain text. A namespace doc can also carry `reference` and `workflow` blocks in its `blocks`, though the CLI does not print them yet; a topic's sections cannot hold them.",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
type: 'code',
|
|
152
|
+
lang: 'javascript',
|
|
153
|
+
code: "{type: 'prose', text: 'Check it with {@link command:doctor}.'}\n{type: 'list', style: 'unordered', items: ['Search with {@link @astryxdesign/cli:function:search}.']}\n\n// In a namespace doc's blocks only:\n{type: 'workflow', steps: [\n {title: 'Write the doc', references: ['generic:authoring']},\n {title: 'Check it', references: ['command:doctor']},\n]}",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: 'prose',
|
|
157
|
+
text: "The route in the printed command is derived when the doc is read, so a link follows its doc when the doc moves. A target that names no doc prints as written, and so does a typed-field name that matches more than one doc; `astryx doctor` warns on both.",
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
title: 'Keep reads short',
|
|
163
|
+
category: 'guide',
|
|
164
|
+
content: [
|
|
165
|
+
{
|
|
166
|
+
type: 'prose',
|
|
167
|
+
text: 'Keep every read short so a reader gets one answer per command: one idea per section, a summary first, and a hard size limit.',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'list',
|
|
171
|
+
style: 'unordered',
|
|
172
|
+
items: [
|
|
173
|
+
'Give each section one idea. If it needs a second topic, split it into two sections.',
|
|
174
|
+
"A section's summary, shown in the section list and in search, is its first prose block or first list item, cut at 240 characters. Lead with what the section answers.",
|
|
175
|
+
'In text, a topic with more than one section reads as its section list. The reader opens one section, or prints everything with `--full`. With `--json`, a topic returns the whole doc and `--index` its section list.',
|
|
176
|
+
'Every read should fit in 32 KB; `astryx doctor` warns on one that does not. Aim for sections under about 30 lines.',
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'code',
|
|
181
|
+
lang: 'bash',
|
|
182
|
+
code: 'astryx docs cli/writing-docs\nastryx docs cli/writing-docs keep-reads-short\nastryx docs cli/writing-docs --full',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
title: 'Make docs findable',
|
|
188
|
+
category: 'guide',
|
|
189
|
+
content: [
|
|
190
|
+
{
|
|
191
|
+
type: 'prose',
|
|
192
|
+
text: 'Search finds a doc only by the words it indexes, so put the words a reader types where search looks.',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 'prose',
|
|
196
|
+
text: "Search matches titles, section titles, headings, each section's summary, and identifiers written in code ticks, such as `ERR_UNKNOWN_SECTION` or `token-ref`. It also matches a doc's own name and the `keywords` of a namespace or typed doc.",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: 'list',
|
|
200
|
+
style: 'do',
|
|
201
|
+
items: [
|
|
202
|
+
'Title a section with the task or question, such as "Place a doc".',
|
|
203
|
+
'Start each section with a sentence that names its subject and answers it.',
|
|
204
|
+
'Write exact identifiers in code ticks: field names, block types, and error codes.',
|
|
205
|
+
'Add `keywords` only for words that are not already in the title or summary.',
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: 'list',
|
|
210
|
+
style: 'dont',
|
|
211
|
+
items: [
|
|
212
|
+
'Open a section with background. Its first block is its summary.',
|
|
213
|
+
'Use vague titles such as "Overview" or "Details" when a specific one fits.',
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'prose',
|
|
218
|
+
text: 'Test it the way a new reader arrives: search for the question, not the title, and check that the first hit answers it.',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
type: 'code',
|
|
222
|
+
lang: 'bash',
|
|
223
|
+
code: 'astryx search placement --type doc',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
title: 'Docs from an integration',
|
|
229
|
+
category: 'guide',
|
|
230
|
+
content: [
|
|
231
|
+
{
|
|
232
|
+
type: 'prose',
|
|
233
|
+
text: 'An integration joins the same graph with a namespace doc in its docs directory and guides placed in it. The namespace shows in `astryx docs` beside `cli`, with the same moves, search, and links. You can place a doc only in a namespace of your own package.',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
type: 'prose',
|
|
237
|
+
text: 'Let the CLI write the files: inside the package, `astryx integration add doc deploying --parent acme` writes the guide with its placement, declares the docs root, and writes the `acme` namespace doc the first time. Run `astryx docs` in the package to see it.',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
type: 'prose',
|
|
241
|
+
text: "A CLI release that does not read the docs tree can hide every doc topic your package ships when the package contains a namespace doc or a placed guide: none appear in `astryx docs`, in text or JSON, and `astryx doctor` may not say why. So `--parent` also declares the CLI release your docs need as an optional `@astryxdesign/cli` peer in package.json, which makes npm warn when an older CLI is installed, and `astryx integration pack --check` fails a package that ships either one without it.",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
type: 'code',
|
|
245
|
+
lang: 'javascript',
|
|
246
|
+
code: "// docs/acme.doc.mjs\n/** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */\nexport default {\n type: 'namespace', name: 'acme', title: 'Acme widgets',\n summary: 'Guides for building apps with Acme widgets.',\n slots: {guides: {title: 'Guides', accepts: {kinds: ['generic']}}},\n};\n\n// docs/deploying.doc.mjs (route: acme/deploying)\n/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */\nexport default {\n type: 'generic', name: 'deploying', title: 'Deploying',\n description: 'Ship an app built with Acme widgets.',\n placement: {parent: 'namespace:acme', slot: 'guides', order: 10},\n sections: [{title: 'Check before you ship', content: [\n {type: 'prose', text: 'Run {@link @astryxdesign/cli:command:doctor} before every deploy.'},\n ]}],\n};",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: 'prose',
|
|
250
|
+
text: "The link names the `@astryxdesign/cli` provider because its target lives in another package. A link without a provider resolves against yours: your manifest's `providerId`, or else your package name. That holds in a topic that `extends` another package's topic too: your sections link your docs, and a link to the other package's docs names its provider.",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
type: 'prose',
|
|
254
|
+
text: 'Everything else an integration ships is in {@link generic:integrations}.',
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
title: 'Check your docs',
|
|
260
|
+
category: 'guide',
|
|
261
|
+
content: [
|
|
262
|
+
{
|
|
263
|
+
type: 'prose',
|
|
264
|
+
text: 'Run the doctor commands to check every home, link, and read in your docs.',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
type: 'list',
|
|
268
|
+
style: 'unordered',
|
|
269
|
+
items: [
|
|
270
|
+
'`astryx doctor`, in a project, checks the whole graph: the tree, the links, and the size of each read.',
|
|
271
|
+
'`astryx doctor integration docs`, inside an integration package, runs the same checks on that package\'s docs before it ships.',
|
|
272
|
+
'`astryx integration pack --check` fails a package that ships a namespace doc or a placed guide without a CLI peer that reads them.',
|
|
273
|
+
],
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
type: 'prose',
|
|
277
|
+
text: 'No check can tell whether a doc is still true. Describe what the CLI does now, and change the doc in the same change that changes the behavior.',
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: 'prose',
|
|
281
|
+
text: 'A problem in the tree or a link is a warning: it names what to fix, but the exit code stays 0, so read the report (or its `--json`) before you ship.',
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
};
|
|
@@ -8,7 +8,6 @@ export const docs = {
|
|
|
8
8
|
category: 'foundations',
|
|
9
9
|
description:
|
|
10
10
|
'Font families, geometric type scale, weight, line-height, and semantic text tokens for consistent, accessible text styling.',
|
|
11
|
-
keywords: ['font', 'fonts', 'font size'],
|
|
12
11
|
tokenCategory: 'typography',
|
|
13
12
|
|
|
14
13
|
sections: [
|
|
@@ -45,10 +44,9 @@ export const docs = {
|
|
|
45
44
|
],
|
|
46
45
|
},
|
|
47
46
|
|
|
48
|
-
// ── Custom Fonts
|
|
47
|
+
// ── Loading Custom Fonts ────────────────────────────────────────────────
|
|
49
48
|
{
|
|
50
|
-
|
|
51
|
-
title: 'Custom fonts',
|
|
49
|
+
title: 'Loading Custom Fonts',
|
|
52
50
|
category: 'foundations',
|
|
53
51
|
content: [
|
|
54
52
|
{
|
|
@@ -167,16 +165,11 @@ export const docs = {
|
|
|
167
165
|
],
|
|
168
166
|
},
|
|
169
167
|
|
|
170
|
-
// ──
|
|
168
|
+
// ── Usage ────────────────────────────────────────────────────────────────
|
|
171
169
|
{
|
|
172
|
-
|
|
173
|
-
title: 'Headings and text',
|
|
170
|
+
title: 'Usage',
|
|
174
171
|
category: 'foundations',
|
|
175
172
|
content: [
|
|
176
|
-
{
|
|
177
|
-
type: 'prose',
|
|
178
|
-
text: 'Use `Heading` for document structure and `Text` for everything else; each maps its props to the type scale tokens.',
|
|
179
|
-
},
|
|
180
173
|
{
|
|
181
174
|
type: 'code',
|
|
182
175
|
lang: 'tsx',
|
|
@@ -212,19 +205,6 @@ export const docs = {
|
|
|
212
205
|
// Display without heading semantics (data callouts, decorative)
|
|
213
206
|
<Text type="display-2">$1.2M Revenue</Text>`,
|
|
214
207
|
},
|
|
215
|
-
],
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
// ── Custom type scale ───────────────────────────────────────────────────
|
|
219
|
-
{
|
|
220
|
-
id: 'custom-type-scale',
|
|
221
|
-
title: 'Custom type scale',
|
|
222
|
-
category: 'foundations',
|
|
223
|
-
content: [
|
|
224
|
-
{
|
|
225
|
-
type: 'prose',
|
|
226
|
-
text: 'Change the whole ramp with `base` and `ratio` in `defineTheme`; every font size and line height recomputes from them.',
|
|
227
|
-
},
|
|
228
208
|
{
|
|
229
209
|
type: 'code',
|
|
230
210
|
lang: 'tsx',
|
|
@@ -8,7 +8,6 @@ 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'],
|
|
12
11
|
|
|
13
12
|
sections: [
|
|
14
13
|
{
|
|
@@ -25,8 +24,7 @@ export const docs = {
|
|
|
25
24
|
],
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
|
-
|
|
29
|
-
title: 'Set up agent docs',
|
|
27
|
+
title: 'Quick Start',
|
|
30
28
|
content: [
|
|
31
29
|
{
|
|
32
30
|
type: 'prose',
|
|
@@ -40,7 +38,7 @@ export const docs = {
|
|
|
40
38
|
},
|
|
41
39
|
{
|
|
42
40
|
type: 'prose',
|
|
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
|
|
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` reports a stale block and `astryx upgrade --apply` refreshes it.",
|
|
44
42
|
},
|
|
45
43
|
{
|
|
46
44
|
type: 'prose',
|
|
@@ -50,12 +48,10 @@ export const docs = {
|
|
|
50
48
|
type: 'code',
|
|
51
49
|
lang: 'bash',
|
|
52
50
|
label: 'Manual options',
|
|
53
|
-
code: `npx @astryxdesign/cli init --features agents --agent claude #
|
|
54
|
-
npx @astryxdesign/cli init --features agents --agent cursor # .cursorrules
|
|
51
|
+
code: `npx @astryxdesign/cli init --features agents --agent claude # .claude/CLAUDE.md
|
|
52
|
+
npx @astryxdesign/cli init --features agents --agent cursor # .cursorrules
|
|
55
53
|
npx @astryxdesign/cli init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)
|
|
56
|
-
npx @astryxdesign/cli init --features agents --agent
|
|
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`,
|
|
54
|
+
npx @astryxdesign/cli init --features agents --agent muse # AGENTS.md (Muse)`,
|
|
59
55
|
},
|
|
60
56
|
],
|
|
61
57
|
},
|
|
@@ -86,17 +82,14 @@ npx @astryxdesign/cli init --features agents --agent all # every agent fil
|
|
|
86
82
|
content: [
|
|
87
83
|
{
|
|
88
84
|
type: 'prose',
|
|
89
|
-
text: 'Cursor
|
|
85
|
+
text: 'Cursor project rules aren\'t always picked up; it selects which rules to apply based on relevance. For reliable inclusion, install the design system context as a User Rule instead. User Rules live at ~/.cursor/rules/ and apply across all projects.',
|
|
90
86
|
},
|
|
91
87
|
{
|
|
92
88
|
type: 'code',
|
|
93
89
|
lang: 'bash',
|
|
94
|
-
label: 'Install as a Cursor
|
|
95
|
-
code: `
|
|
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.',
|
|
90
|
+
label: 'Install as a Cursor user rule',
|
|
91
|
+
code: `mkdir -p ~/.cursor/rules
|
|
92
|
+
npx @astryxdesign/cli init --features agents --agent-docs-path ~/.cursor/rules/xds.mdc`,
|
|
100
93
|
},
|
|
101
94
|
],
|
|
102
95
|
},
|
|
@@ -105,7 +98,7 @@ npx @astryxdesign/cli init --features agents --agent all # every agent fil
|
|
|
105
98
|
content: [
|
|
106
99
|
{
|
|
107
100
|
type: 'prose',
|
|
108
|
-
text: 'Paste this into your AI before writing any component code. If your AI can\'t answer
|
|
101
|
+
text: 'Paste this into your AI before writing any component code. These three questions have a 0% pass rate without docs; models confidently guess wrong on all of them. If your AI can\'t answer them, it\'ll know to install the agent docs first.',
|
|
109
102
|
},
|
|
110
103
|
{
|
|
111
104
|
type: 'code',
|
|
@@ -114,7 +107,7 @@ npx @astryxdesign/cli init --features agents --agent all # every agent fil
|
|
|
114
107
|
code: `Before writing any Astryx code, check your knowledge:
|
|
115
108
|
|
|
116
109
|
1. What is the correct import path for Button?
|
|
117
|
-
2. How do you make
|
|
110
|
+
2. How do you make an Dialog non-dismissible?
|
|
118
111
|
3. What prop does Selector use for its items?
|
|
119
112
|
|
|
120
113
|
If you don't know all three, run \`npx @astryxdesign/cli init --features agents\` to generate agent docs, then read the generated file.`,
|
|
@@ -138,34 +131,33 @@ If you don't know all three, run \`npx @astryxdesign/cli init --features agents\
|
|
|
138
131
|
},
|
|
139
132
|
{
|
|
140
133
|
type: 'prose',
|
|
141
|
-
text: 'With this alias, agents
|
|
134
|
+
text: 'With this alias, agents use `astryx component --list` instead of guessing the binary path. The `--` separator is standard npm convention for passing flags to scripts.',
|
|
142
135
|
},
|
|
143
136
|
{
|
|
144
137
|
type: 'code',
|
|
145
138
|
lang: 'bash',
|
|
146
139
|
label: 'Reliable CLI invocation',
|
|
147
|
-
code: `
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
code: `astryx component --list
|
|
141
|
+
astryx component Dialog --dense
|
|
142
|
+
astryx docs styling --dense
|
|
143
|
+
astryx docs tokens --dense`,
|
|
151
144
|
},
|
|
152
145
|
],
|
|
153
146
|
},
|
|
154
147
|
{
|
|
155
|
-
|
|
156
|
-
title: 'Shorter output: --detail and --dense',
|
|
148
|
+
title: 'The --dense Flag',
|
|
157
149
|
content: [
|
|
158
150
|
{
|
|
159
151
|
type: 'prose',
|
|
160
|
-
text: '
|
|
152
|
+
text: 'Every CLI command supports --dense, which outputs a token-efficient format designed for AI context windows. Use it when pasting CLI output into a web-based AI tool like ChatGPT or Claude.',
|
|
161
153
|
},
|
|
162
154
|
{
|
|
163
155
|
type: 'code',
|
|
164
156
|
lang: 'bash',
|
|
165
|
-
label: '
|
|
166
|
-
code: `astryx
|
|
167
|
-
astryx
|
|
168
|
-
astryx docs
|
|
157
|
+
label: 'Dense output for pasting into AI conversations',
|
|
158
|
+
code: `astryx component Dialog --dense
|
|
159
|
+
astryx docs styling --dense
|
|
160
|
+
astryx docs tokens --dense`,
|
|
169
161
|
},
|
|
170
162
|
],
|
|
171
163
|
},
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
6
|
import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
7
|
-
import frFR from '@astryxdesign/core/locales/fr-FR.
|
|
7
|
+
import frFR from '@astryxdesign/core/locales/fr-FR.json';
|
|
8
8
|
import {Stack} from '@astryxdesign/core/Layout';
|
|
9
9
|
import {
|
|
10
10
|
SegmentedControl,
|
|
@@ -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 ' +
|
|
@@ -60,14 +60,6 @@ export const doc = {
|
|
|
60
60
|
example:
|
|
61
61
|
"{ audience: 'internal', async handle(report, {signal}) { return sendGap(report, {signal}); } }",
|
|
62
62
|
},
|
|
63
|
-
{
|
|
64
|
-
name: 'discover',
|
|
65
|
-
type: 'DiscoverSource',
|
|
66
|
-
description:
|
|
67
|
-
'Tell `astryx discover` which integrations this project could add: an async function that returns a catalog. An integration can provide one too, as a `discover` named export from its manifest. Discover calls every source, yours first, and one that fails never hides the others. Discover only reads; your package manager installs.',
|
|
68
|
-
example:
|
|
69
|
-
"async ({signal, package: name, version}) => fetchCatalog({signal, name, version})",
|
|
70
|
-
},
|
|
71
63
|
{
|
|
72
64
|
name: 'experimental',
|
|
73
65
|
type: '{ xle?: { components?: Record<string, XleComponent> } }',
|
|
@@ -77,7 +69,7 @@ export const doc = {
|
|
|
77
69
|
name: 'experimental.xle.components',
|
|
78
70
|
type: 'Record<string, XleComponent>',
|
|
79
71
|
description:
|
|
80
|
-
'
|
|
72
|
+
'Custom components the layout expander (XLE) may emit, keyed by tag.',
|
|
81
73
|
},
|
|
82
74
|
],
|
|
83
75
|
},
|
|
@@ -30,7 +30,6 @@ export type XleComponent = import("./type.js").XleComponent;
|
|
|
30
30
|
export type DebugConfig = import("./type.js").DebugConfig;
|
|
31
31
|
export type DebugEventHandler = import("../debug/type.js").DebugEventHandler;
|
|
32
32
|
export type GapReportHandler = import("../gap-report/type.js").GapReportHandler;
|
|
33
|
-
export type DiscoverSource = import("../discover/type.js").DiscoverSource;
|
|
34
33
|
import { z } from 'zod';
|
|
35
34
|
declare const configSchema: z.ZodObject<{
|
|
36
35
|
integrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -49,7 +48,6 @@ declare const configSchema: z.ZodObject<{
|
|
|
49
48
|
}, z.core.$strict>>;
|
|
50
49
|
debug: z.ZodOptional<z.ZodType<import("../debug/type.js").DebugEventHandler, any, z.core.$ZodTypeInternals<import("../debug/type.js").DebugEventHandler, any>>>;
|
|
51
50
|
gapReport: z.ZodOptional<z.ZodType<import("../gap-report/type.js").GapReportHandler, any, z.core.$ZodTypeInternals<import("../gap-report/type.js").GapReportHandler, any>>>;
|
|
52
|
-
discover: z.ZodOptional<z.ZodType<import("../discover/type.js").DiscoverSource, any, z.core.$ZodTypeInternals<import("../discover/type.js").DiscoverSource, any>>>;
|
|
53
51
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
54
52
|
xle: z.ZodOptional<z.ZodObject<{
|
|
55
53
|
components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import {z} from 'zod';
|
|
13
13
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
14
14
|
import {parseGapReportHandler} from '../gap-report/parse.mjs';
|
|
15
|
-
import {parseDiscoverSource} from '../discover/parse.mjs';
|
|
16
15
|
|
|
17
16
|
/** @typedef {import('./type.js').AstryxConfig} AstryxConfig */
|
|
18
17
|
/** @typedef {import('./type.js').PostCodemodHook} PostCodemodHook */
|
|
@@ -20,7 +19,6 @@ import {parseDiscoverSource} from '../discover/parse.mjs';
|
|
|
20
19
|
/** @typedef {import('./type.js').DebugConfig} DebugConfig */
|
|
21
20
|
/** @typedef {import('../debug/type.js').DebugEventHandler} DebugEventHandler */
|
|
22
21
|
/** @typedef {import('../gap-report/type.js').GapReportHandler} GapReportHandler */
|
|
23
|
-
/** @typedef {import('../discover/type.js').DiscoverSource} DiscoverSource */
|
|
24
22
|
|
|
25
23
|
// Typed `z.custom` so `z.infer` reproduces the real function type (not `unknown`).
|
|
26
24
|
const buildCommand = /** @type {z.ZodType<PostCodemodHook['buildCommand']>} */ (
|
|
@@ -68,22 +66,6 @@ const gapReportHandlerSchema = /** @type {z.ZodType<GapReportHandler>} */ (
|
|
|
68
66
|
)
|
|
69
67
|
);
|
|
70
68
|
|
|
71
|
-
// The same check an integration's `discover` named export passes. Typed
|
|
72
|
-
// z.custom preserves the public function type.
|
|
73
|
-
const discoverSourceSchema = /** @type {z.ZodType<DiscoverSource>} */ (
|
|
74
|
-
z.custom(
|
|
75
|
-
value => {
|
|
76
|
-
try {
|
|
77
|
-
parseDiscoverSource(value, 'discover');
|
|
78
|
-
return true;
|
|
79
|
-
} catch {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{message: 'Expected a discover source function'},
|
|
84
|
-
)
|
|
85
|
-
);
|
|
86
|
-
|
|
87
69
|
const configSchema = z
|
|
88
70
|
.object({
|
|
89
71
|
integrations: z.array(z.string()).optional(),
|
|
@@ -94,7 +76,6 @@ const configSchema = z
|
|
|
94
76
|
.optional(),
|
|
95
77
|
debug: debugSchema.optional(),
|
|
96
78
|
gapReport: gapReportHandlerSchema.optional(),
|
|
97
|
-
discover: discoverSourceSchema.optional(),
|
|
98
79
|
experimental: z
|
|
99
80
|
.object({
|
|
100
81
|
xle: z
|
|
@@ -63,14 +63,6 @@ describe('parseConfig (load boundary)', () => {
|
|
|
63
63
|
).toEqual({audience: 'internal', handle});
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
it('accepts a discover source function and refuses anything else', () => {
|
|
67
|
-
const discover = async () => ({});
|
|
68
|
-
expect(parseConfig({discover}).discover).toBe(discover);
|
|
69
|
-
expect(reason({discover: 'https://example.com/catalog.json'})).toContain(
|
|
70
|
-
'discover',
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
66
|
it('rejects obsolete or extended gap-report handler shapes', () => {
|
|
75
67
|
expect(reason({gapReport: {command: './report.mjs'}})).toContain(
|
|
76
68
|
'gapReport',
|
package/authoring/config/type.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
import type {DebugEventHandler} from '../debug/type.js';
|
|
13
13
|
import type {GapReportHandler} from '../gap-report/type.js';
|
|
14
|
-
import type {DiscoverSource} from '../discover/type.js';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* A command to run as part of a post-codemod hook. Returned by a hook's
|
|
@@ -97,16 +96,6 @@ export interface AstryxConfig {
|
|
|
97
96
|
debug?: DebugConfig;
|
|
98
97
|
/** Route gap reports through a project-owned handler. See {@link GapReportHandler}. */
|
|
99
98
|
gapReport?: GapReportHandler;
|
|
100
|
-
/**
|
|
101
|
-
* Tell `astryx discover` about integrations this project could add. See
|
|
102
|
-
* {@link DiscoverSource}.
|
|
103
|
-
*
|
|
104
|
-
* An integration can provide a source too, as a `discover` named export from
|
|
105
|
-
* its `astryx.integration.*` module. Discover calls every source: this one
|
|
106
|
-
* first, then each integration's in load order, and one that fails never
|
|
107
|
-
* hides the others.
|
|
108
|
-
*/
|
|
109
|
-
discover?: DiscoverSource;
|
|
110
99
|
/**
|
|
111
100
|
* EXPERIMENTAL — shape may change and is not part of the stable config
|
|
112
101
|
* contract. Provisional home for features still being proven out.
|
|
@@ -115,8 +104,8 @@ export interface AstryxConfig {
|
|
|
115
104
|
/** Experimental XLE (layout expression) configuration. */
|
|
116
105
|
xle?: {
|
|
117
106
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
107
|
+
* Register app-local components so XLE layout expressions can
|
|
108
|
+
* reference them by name via {hint}. Keyed by component name.
|
|
120
109
|
*/
|
|
121
110
|
components?: Record<string, XleComponent>;
|
|
122
111
|
};
|