@astryxdesign/cli 0.7.3-canary.b74cf21 → 0.7.3-canary.ca48bb7
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 +68 -68
- package/api/build/blocks/blocks.d.mts +6 -4
- package/api/build/blocks/blocks.mjs +103 -20
- package/api/build/blocks/blocks.test.mjs +126 -13
- package/api/build/blocks/blocks.weights.json +1 -1
- package/api/build/kit/answer.d.mts +5 -4
- package/api/build/kit/answer.mjs +114 -12
- package/api/build/kit/answer.test.mjs +73 -3
- package/api/build/kit/signals.d.mts +8 -0
- package/api/build/kit/signals.mjs +10 -0
- package/api/build/tree.test.mjs +19 -11
- package/api/component/component-replacement.test.mjs +1 -0
- package/api/component/component.mjs +17 -3
- package/api/component/component.test.mjs +15 -0
- package/api/component/doc-links.test.mjs +2 -2
- package/api/docs/_adapter.d.mts +2 -2
- package/api/docs/_adapter.mjs +61 -18
- package/api/docs/docs-homes.test.mjs +127 -0
- package/api/docs/docs.doc.mjs +3 -3
- package/api/docs/docs.test.mjs +28 -18
- package/api/docs/integration-tree.test.mjs +20 -20
- package/api/docs/integrationDocs.test.mjs +1 -1
- package/api/docs/namespace-section.test.mjs +6 -6
- package/api/docs/reference-blocks.test.mjs +2 -2
- package/api/doctor/doctor.mjs +16 -12
- package/api/doctor/doctor.test.mjs +37 -12
- package/api/hook/hook.mjs +1 -1
- package/api/integration/_adapter.d.mts +8 -0
- package/api/integration/_adapter.mjs +21 -1
- package/api/integration/authoring-checks.test.mjs +220 -0
- package/api/integration/pack-check.mjs +110 -4
- package/api/integration/pack-check.test.mjs +69 -0
- package/api/integration/validate-integration-fixes.test.mjs +6 -5
- package/api/integration/validate-integration-gaps.test.mjs +304 -1
- package/api/integration/validate-integration.d.mts +6 -1
- package/api/integration/validate-integration.mjs +82 -13
- package/api/integration/validate-integration.type.d.mts +37 -4
- package/api/integration/validate-integration.type.mjs +28 -5
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_adapter.d.mts +16 -0
- package/api/search/_adapter.mjs +39 -0
- package/api/search/_adapter.test.mjs +173 -0
- package/api/search/_candidate-score.mjs +1 -1
- package/api/search/_entries.d.mts +11 -0
- package/api/search/_entries.mjs +77 -3
- package/api/search/_entries.test.mjs +48 -0
- package/api/search/_gather-docs.mjs +3 -3
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.mjs +6 -2
- package/api/search/search.test.mjs +14 -14
- package/api/upgrade/_adapter.d.mts +57 -3
- package/api/upgrade/_adapter.mjs +149 -27
- package/api/upgrade/registry/registry.d.mts +10 -4
- package/api/upgrade/registry/registry.mjs +33 -16
- package/api/upgrade/registry/registry.test.mjs +85 -0
- package/api/upgrade/run/run.d.mts +4 -2
- package/api/upgrade/run/run.mjs +13 -2
- package/api/upgrade/run/run.test.mjs +417 -3
- package/api/upgrade/upgrade.doc.mjs +10 -5
- package/api/upgrade/upgrade.mjs +13 -2
- package/api/upgrade/upgrade.type.d.mts +5 -3
- package/api/upgrade/upgrade.type.mjs +8 -6
- package/assets/docs/author-a-theme.doc.mjs +2 -2
- package/assets/docs/is-my-code-good.doc.mjs +287 -0
- package/assets/docs/tree/add-a-component.doc.mjs +1 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
- package/assets/docs/tree/add-a-topic.doc.mjs +2 -2
- package/assets/docs/tree/agent-guidance.doc.mjs +1 -1
- package/assets/docs/tree/{integrations.doc.mjs → authoring.doc.mjs} +15 -6
- package/assets/docs/tree/block-template.doc.mjs +1 -1
- package/assets/docs/tree/build-the-template.doc.mjs +1 -1
- package/assets/docs/tree/building-blocks.doc.mjs +2 -2
- package/assets/docs/tree/check-the-props.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
- package/assets/docs/tree/checks.doc.mjs +3 -3
- package/assets/docs/tree/cli-command.doc.mjs +1 -1
- package/assets/docs/tree/cli.doc.mjs +1 -1
- package/assets/docs/tree/codemods.doc.mjs +1 -1
- package/assets/docs/tree/component-family.doc.mjs +1 -1
- package/assets/docs/tree/component-imports.doc.mjs +1 -1
- package/assets/docs/tree/components.doc.mjs +1 -1
- package/assets/docs/tree/configuration.doc.mjs +1 -1
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
- package/assets/docs/tree/docs.doc.mjs +1 -1
- package/assets/docs/tree/document-the-template.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
- package/assets/docs/tree/extend-or-replace.doc.mjs +1 -1
- package/assets/docs/{authoring.doc.mjs → tree/field-reference.doc.mjs} +4 -3
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
- package/assets/docs/tree/global-integrations.doc.mjs +2 -2
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
- package/assets/docs/tree/help.doc.mjs +2 -2
- package/assets/docs/tree/links.doc.mjs +1 -1
- package/assets/docs/tree/package-and-test.doc.mjs +1 -1
- package/assets/docs/tree/page-template.doc.mjs +1 -1
- package/assets/docs/tree/publishing.doc.mjs +1 -1
- package/assets/docs/tree/quick-start.doc.mjs +1 -1
- package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
- package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/ship.doc.mjs +2 -2
- package/assets/docs/tree/short-and-findable.doc.mjs +1 -1
- package/assets/docs/tree/single-component.doc.mjs +1 -1
- package/assets/docs/tree/start-a-template.doc.mjs +1 -1
- package/assets/docs/tree/subcomponent.doc.mjs +1 -1
- package/assets/docs/tree/template-assets.doc.mjs +1 -1
- package/assets/docs/tree/template-doc-overview.doc.mjs +2 -2
- package/assets/docs/tree/template-fonts.doc.mjs +1 -1
- package/assets/docs/tree/template-grading-rubric.doc.mjs +17 -38
- package/assets/docs/tree/template-icons.doc.mjs +1 -1
- package/assets/docs/tree/template-images-media.doc.mjs +1 -1
- package/assets/docs/tree/template-styles.doc.mjs +1 -1
- package/assets/docs/tree/templates.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
- package/assets/docs/tree/themes.doc.mjs +1 -1
- package/assets/docs/tree/troubleshooting.doc.mjs +1 -1
- package/assets/docs/tree/upgrading.doc.mjs +1 -1
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +5 -1
- package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
- package/assets/docs/tree/write-the-template-file.doc.mjs +1 -1
- package/assets/docs/use-integrations.doc.mjs +120 -0
- package/assets/templates/themes/butter/butterTheme.ts +4 -2
- package/assets/templates/themes/stone/stoneTheme.ts +4 -2
- package/assets/templates/themes/y2k/y2kTheme.ts +4 -2
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/integration/integration.doc.mjs +1 -1
- package/authoring/integration/type.ts +1 -1
- package/clients/cli/command-result-coverage.test.mjs +6 -5
- package/clients/cli/commands/build-theme.color-scheme.test.mjs +1 -1
- package/clients/cli/commands/{component/index.mjs → component.mjs} +37 -37
- package/clients/cli/commands/component.test.mjs +6 -6
- package/clients/cli/commands/docs.doc.mjs +2 -2
- package/clients/cli/commands/docs.mjs +1 -1
- package/clients/cli/commands/docs.test.mjs +14 -14
- package/clients/cli/commands/doctor-integration.test.mjs +49 -1
- package/clients/cli/commands/doctor.mjs +10 -0
- package/clients/cli/commands/{hook/index.mjs → hook.mjs} +22 -22
- package/clients/cli/commands/import-hint-correctness.test.mjs +1 -1
- package/clients/cli/commands/integration-check.test.mjs +48 -0
- package/clients/cli/commands/integration.doc.mjs +1 -1
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/manifest.mjs +67 -0
- package/clients/cli/commands/postinstall.doc.mjs +23 -0
- package/clients/cli/commands/postinstall.mjs +31 -0
- package/clients/cli/commands/{build-theme.mjs → theme.mjs} +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +4 -2
- package/clients/cli/commands/upgrade.mjs +9 -2
- package/clients/cli/commands/upgrade.subfolder-path.test.mjs +97 -0
- package/clients/cli/index.mjs +10 -85
- package/clients/cli/lib/component-format.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +12 -7
- package/clients/cli/lib/exit-codes.test.mjs +5 -0
- package/clients/cli/lib/manifest.test.mjs +12 -0
- package/clients/cli/lib/welcome-box.mjs +50 -0
- package/foundation/agent-docs/agent-docs.mjs +2 -1
- package/foundation/agent-docs/agent-docs.test.mjs +5 -4
- package/foundation/config/project.mjs +5 -20
- package/foundation/config/project.test.mjs +56 -0
- package/foundation/discovery/authoring-self-docs.d.mts +7 -0
- package/foundation/discovery/authoring-self-docs.mjs +16 -4
- package/foundation/discovery/authoring-self-docs.test.mjs +15 -3
- package/foundation/discovery/authoring-surface.d.mts +1 -1
- package/foundation/discovery/authoring-surface.mjs +2 -2
- package/foundation/discovery/authoring-surface.test.mjs +1 -1
- package/foundation/discovery/cli-self-docs.d.mts +2 -1
- package/foundation/discovery/cli-self-docs.mjs +4 -3
- package/foundation/discovery/cli-self-docs.test.mjs +2 -2
- package/foundation/discovery/runner-allowlist.d.mts +2 -4
- package/foundation/discovery/runner-allowlist.mjs +2 -4
- package/foundation/discovery/runner-commands.d.mts +77 -0
- package/foundation/discovery/runner-commands.mjs +294 -0
- package/foundation/discovery/runner-commands.test.mjs +128 -0
- package/foundation/discovery/stray-pointers.test.mjs +1 -1
- package/foundation/discovery/template-adapter.mjs +18 -1
- package/foundation/discovery/template-needs.mjs +1 -44
- package/foundation/discovery/theme-discovery.mjs +147 -3
- package/foundation/doc-compiler/doc-loads.test.mjs +25 -9
- package/foundation/doc-compiler/read.mjs +59 -1
- package/foundation/doc-compiler/read.test.mjs +11 -2
- package/foundation/doc-compiler/split-topic-keywords.test.mjs +3 -2
- package/foundation/doc-compiler/tree.d.mts +32 -6
- package/foundation/doc-compiler/tree.mjs +77 -43
- package/foundation/doc-compiler/tree.test.mjs +7 -7
- package/foundation/fs/paths.d.mts +70 -8
- package/foundation/fs/paths.mjs +526 -35
- package/foundation/fs/paths.test.mjs +430 -54
- package/foundation/fs/read-record.d.mts +18 -0
- package/foundation/fs/read-record.mjs +131 -0
- package/foundation/fs/read-record.test.mjs +77 -0
- package/foundation/integrations/autolink.d.mts +2 -1
- package/foundation/integrations/autolink.mjs +4 -13
- package/foundation/integrations/cli-peer-version.d.mts +36 -0
- package/foundation/integrations/cli-peer-version.mjs +132 -0
- package/foundation/integrations/cli-peer-version.test.mjs +354 -0
- package/foundation/integrations/exports-subpaths.d.mts +57 -0
- package/foundation/integrations/exports-subpaths.mjs +113 -0
- package/foundation/integrations/integrations.d.mts +20 -1
- package/foundation/integrations/integrations.mjs +59 -2
- package/foundation/integrations/public-imports.d.mts +118 -0
- package/foundation/integrations/public-imports.mjs +1769 -0
- package/foundation/integrations/public-imports.test.mjs +1793 -0
- package/foundation/integrations/validate-contributions.d.mts +19 -0
- package/foundation/integrations/validate-contributions.mjs +172 -3
- package/foundation/response/response-types.doc.mjs +1 -1
- package/package.json +9 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/help/troubleshooting`: the messages the CLI
|
|
5
5
|
* prints while you build, verify, and install an integration, and the fix
|
|
6
6
|
* for each.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/ship/upgrading`: update an integration
|
|
5
5
|
* package for each Astryx release, and the command apps run to upgrade with
|
|
6
6
|
* it.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/building-blocks/themes/use-a-theme-in-an-app`:
|
|
5
5
|
* an app installs the integration and applies or extends the theme, like any theme.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/building-blocks/templates/build-the-template/package-and-test/verify-packed-template`:
|
|
5
5
|
* what `integration verify` checks for templates, and what it leaves to the
|
|
6
6
|
* app test.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/ship/versioning`: version an integration
|
|
5
5
|
* package, know which changes break apps, declare peer ranges, keep apps on
|
|
6
6
|
* older CLIs working, and match codemod folders to versions.
|
|
7
7
|
*/
|
|
@@ -120,6 +120,10 @@ export const docs = {
|
|
|
120
120
|
type: 'prose',
|
|
121
121
|
text: '`integration verify` fails a package that needs the CLI peer and lacks it, or whose range admits a stable CLI too old for what it ships. `integration add doc --parent` and `integration add theme` write the peer for you.',
|
|
122
122
|
},
|
|
123
|
+
{
|
|
124
|
+
type: 'prose',
|
|
125
|
+
text: "When the CLI is outside that range, `doctor integration validate` and `integration check` list a `cli_peer_version` note naming your package. A note fails nothing, `--strict` included, and `integration verify` does not report it. Below the range the note gives the commands that install a newer Core and CLI together, as dev dependencies in your own package folder, and then run `upgrade --apply`. Above it, in an app the note asks for a release of your package that supports that CLI, and in your own package folder it asks you to test your package with that CLI and widen the range.",
|
|
126
|
+
},
|
|
123
127
|
],
|
|
124
128
|
},
|
|
125
129
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/building-blocks/templates/write-good-templates`:
|
|
5
5
|
* what makes a template good, the rubric that scores it, and grading with an agent.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `astryx docs
|
|
4
|
+
* @file `astryx docs authoring/building-blocks/templates/build-the-template/write-the-template-file`:
|
|
5
5
|
* what gets copied, where the copied file lands, and the imports and
|
|
6
6
|
* export a copied template needs.
|
|
7
7
|
*/
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
4
|
+
|
|
5
|
+
export const docs = {
|
|
6
|
+
type: 'generic',
|
|
7
|
+
name: 'use-integrations',
|
|
8
|
+
title: 'Use integrations',
|
|
9
|
+
category: 'guide',
|
|
10
|
+
description:
|
|
11
|
+
'Install, discover, and use integration packages that add components, templates, themes, and docs to your app.',
|
|
12
|
+
keywords: [
|
|
13
|
+
'install an integration',
|
|
14
|
+
'add an integration',
|
|
15
|
+
'install a package',
|
|
16
|
+
'use an integration',
|
|
17
|
+
'discover integrations',
|
|
18
|
+
'integration',
|
|
19
|
+
'package',
|
|
20
|
+
'third party',
|
|
21
|
+
'plugin',
|
|
22
|
+
'extension',
|
|
23
|
+
],
|
|
24
|
+
|
|
25
|
+
sections: [
|
|
26
|
+
{
|
|
27
|
+
title: 'Discover integrations',
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'prose',
|
|
31
|
+
text: 'Integration packages extend Astryx with extra components, templates, themes, docs, and codemods. They are published as regular npm packages.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'prose',
|
|
35
|
+
text: 'Search for what you need:',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'code',
|
|
39
|
+
lang: 'bash',
|
|
40
|
+
code: 'astryx search carousel\nastryx discover',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 'prose',
|
|
44
|
+
text: '`search` looks across everything the CLI knows (components, docs, templates, themes, and hooks), so a word like "carousel" finds it whether it is a component, a template, or a doc page. `discover` lists every integration the project has, and, with a discover source, packages it could add.',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: 'Install an integration',
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: 'prose',
|
|
53
|
+
text: 'Install the package with your package manager. Integrations autolink: the CLI finds them among your dependencies, so installing is all it takes:',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: 'code',
|
|
57
|
+
lang: 'bash',
|
|
58
|
+
code: 'npm install @acme/brand-integration',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'prose',
|
|
62
|
+
text: 'Run `astryx doctor` to confirm everything is wired up. If you need to load a package that is not a direct dependency, add it explicitly to `astryx.config.mjs`:',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'code',
|
|
66
|
+
lang: 'js',
|
|
67
|
+
label: 'Optional: explicit config entry',
|
|
68
|
+
code: "export default {\n integrations: ['@acme/brand-integration'],\n};",
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: 'Use what it adds',
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: 'prose',
|
|
77
|
+
text: 'Once installed, the integration\'s contributions appear alongside Core:',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'list',
|
|
81
|
+
style: 'unordered',
|
|
82
|
+
items: [
|
|
83
|
+
'`astryx component --list` shows its components next to Core components.',
|
|
84
|
+
'`astryx template --list` includes its page and block templates.',
|
|
85
|
+
'`astryx theme list` lists its themes; add one with `astryx theme add <slug> --package @acme/brand-integration`.',
|
|
86
|
+
'`astryx docs` shows any guides it provides.',
|
|
87
|
+
'`astryx search <query>` finds everything, from every installed integration.',
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'prose',
|
|
92
|
+
text: 'Import components at the subpath the integration documents. Run `astryx component <Name>` to see the exact import:',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: 'code',
|
|
96
|
+
lang: 'jsx',
|
|
97
|
+
code: "import {AcmeCarousel} from '@acme/brand-integration/components/AcmeCarousel';",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'prose',
|
|
101
|
+
text: 'For themes, see {@link generic:use-a-theme}. To build an integration of your own, see {@link namespace:authoring}.',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: 'Check for problems',
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: 'prose',
|
|
110
|
+
text: 'Run `astryx doctor` to see integration issues: missing roots, invalid contributions, or a CLI version mismatch. The doctor check is the one place every issue for every package is listed.',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'code',
|
|
114
|
+
lang: 'bash',
|
|
115
|
+
code: 'astryx doctor',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
@@ -81,7 +81,8 @@ const SECONDARY_SELECTOR = {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
|
|
84
|
-
* the hover kept off a disabled trigger, whose inner button is disabled
|
|
84
|
+
* the hover kept off a disabled trigger, whose inner button is disabled
|
|
85
|
+
* (natively or, keeping its tab stop, with `aria-disabled`).
|
|
85
86
|
*/
|
|
86
87
|
const SECONDARY_COMPLEX_SELECTOR = {
|
|
87
88
|
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
@@ -89,7 +90,8 @@ const SECONDARY_COMPLEX_SELECTOR = {
|
|
|
89
90
|
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
90
91
|
borderColor: SECONDARY_BUTTON.borderColor,
|
|
91
92
|
color: SECONDARY_BUTTON.color,
|
|
92
|
-
':hover:not(:has(> :disabled))':
|
|
93
|
+
':hover:not(:has(> :is(:disabled, [aria-disabled="true"])))':
|
|
94
|
+
SECONDARY_BUTTON[':hover'],
|
|
93
95
|
} as const;
|
|
94
96
|
|
|
95
97
|
export const butterTheme = defineTheme({
|
|
@@ -100,14 +100,16 @@ const SECONDARY_SELECTOR = {
|
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
|
|
103
|
-
* the hover kept off a disabled trigger, whose inner button is disabled
|
|
103
|
+
* the hover kept off a disabled trigger, whose inner button is disabled
|
|
104
|
+
* (natively or, keeping its tab stop, with `aria-disabled`).
|
|
104
105
|
*/
|
|
105
106
|
const SECONDARY_COMPLEX_SELECTOR = {
|
|
106
107
|
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
107
108
|
borderWidth: SECONDARY_BUTTON.borderWidth,
|
|
108
109
|
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
109
110
|
borderColor: SECONDARY_BUTTON.borderColor,
|
|
110
|
-
':hover:not(:has(> :disabled))':
|
|
111
|
+
':hover:not(:has(> :is(:disabled, [aria-disabled="true"])))':
|
|
112
|
+
SECONDARY_BUTTON[':hover'],
|
|
111
113
|
} as const;
|
|
112
114
|
|
|
113
115
|
export const stoneTheme = defineTheme({
|
|
@@ -76,7 +76,8 @@ const SECONDARY_SELECTOR = {
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
|
|
79
|
-
* the hover kept off a disabled trigger, whose inner button is disabled
|
|
79
|
+
* the hover kept off a disabled trigger, whose inner button is disabled
|
|
80
|
+
* (natively or, keeping its tab stop, with `aria-disabled`).
|
|
80
81
|
*/
|
|
81
82
|
const SECONDARY_COMPLEX_SELECTOR = {
|
|
82
83
|
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
@@ -84,7 +85,8 @@ const SECONDARY_COMPLEX_SELECTOR = {
|
|
|
84
85
|
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
85
86
|
borderColor: SECONDARY_BUTTON.borderColor,
|
|
86
87
|
color: SECONDARY_BUTTON.color,
|
|
87
|
-
':hover:not(:has(> :disabled))':
|
|
88
|
+
':hover:not(:has(> :is(:disabled, [aria-disabled="true"])))':
|
|
89
|
+
SECONDARY_BUTTON[':hover'],
|
|
88
90
|
} as const;
|
|
89
91
|
|
|
90
92
|
export const y2kTheme = defineTheme({
|
|
@@ -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 {@link generic:
|
|
52
|
+
"The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:field-reference}), 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',
|
|
@@ -131,7 +131,7 @@ export const doc = {
|
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
type: 'prose',
|
|
134
|
-
text: "Set `cliCommand` only when your users run the CLI with a command other than their package manager's, such as `acme astryx`. The CLI picks the command it prints in this order: the `cliCommand` of the loaded integrations when they name one command, then the command a host tool names, then the package manager's. Two different `cliCommand` values cancel out, and `astryx doctor` warns in its `cli-command` check. See `astryx docs
|
|
134
|
+
text: "Set `cliCommand` only when your users run the CLI with a command other than their package manager's, such as `acme astryx`. The CLI picks the command it prints in this order: the `cliCommand` of the loaded integrations when they name one command, then the command a host tool names, then the package manager's. Two different `cliCommand` values cancel out, and `astryx doctor` warns in its `cli-command` check. See `astryx docs authoring/building-blocks/configuration/cli-command`.",
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
type: 'prose',
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* The manifest module may also carry `debug` and `gapReport` NAMED exports.
|
|
12
12
|
* They are not fields here on purpose: a CLI released before a given manifest
|
|
13
13
|
* field existed could reject it and lose every contribution, while an unknown
|
|
14
|
-
* named export is simply not read. See `astryx docs
|
|
14
|
+
* named export is simply not read. See `astryx docs authoring`.
|
|
15
15
|
*/
|
|
16
16
|
export interface AstryxIntegration {
|
|
17
17
|
/** Stable logical provider ID. Omit to use package.json#name. Set this only
|
|
@@ -44,12 +44,13 @@ const NO_ACTION_OF_THEIR_OWN = [];
|
|
|
44
44
|
/**
|
|
45
45
|
* Commands that record for themselves instead of returning a descriptor.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
47
|
+
* Empty: every command, `manifest` and the hidden `postinstall` hook included,
|
|
48
|
+
* registers through defineCommand. The mark is a hatch, and a hatch nobody
|
|
49
|
+
* watches is a hole: this list is the watch. The root program is checked
|
|
50
|
+
* separately below.
|
|
51
|
+
* @type {string[]}
|
|
51
52
|
*/
|
|
52
|
-
const RECORD_FOR_THEMSELVES = [
|
|
53
|
+
const RECORD_FOR_THEMSELVES = [];
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* Every command in the program, depth first, with its fully qualified name.
|
|
@@ -73,7 +73,7 @@ describe('theme build color-scheme output', () => {
|
|
|
73
73
|
const project = path.join(tmpDir, 'project');
|
|
74
74
|
const themesDir = path.join(project, 'themes');
|
|
75
75
|
// A raw light-dark() token value is what triggers the color-scheme
|
|
76
|
-
// injection in
|
|
76
|
+
// injection in theme.mjs. `defineTheme.test.ts` already covers the
|
|
77
77
|
// separate [light, dark] tuple -> light-dark() conversion; this fixture
|
|
78
78
|
// writes the string directly so this test stays focused on the CLI's own
|
|
79
79
|
// color-scheme decision, not on that conversion.
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
* Global options: --detail full|compact|brief, --lang en|zh|dense
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {findCoreDir} from '
|
|
9
|
+
import {findCoreDir} from '../../../foundation/fs/paths.mjs';
|
|
10
10
|
import {
|
|
11
11
|
resolveImportPath,
|
|
12
|
-
} from '
|
|
12
|
+
} from '../../../foundation/discovery/component-discovery.mjs';
|
|
13
13
|
import {
|
|
14
14
|
formatFull,
|
|
15
15
|
formatCompact,
|
|
16
16
|
formatBrief,
|
|
17
17
|
formatProps,
|
|
18
18
|
formatBriefAll,
|
|
19
|
-
} from '
|
|
20
|
-
import {resolveTheme} from '
|
|
21
|
-
import {getCliInvocation} from '
|
|
22
|
-
import {jsonOut} from '
|
|
23
|
-
import {emit, section, text, list, record, records, code} from '
|
|
24
|
-
import {cliError} from '
|
|
25
|
-
import {defineCommand} from '
|
|
26
|
-
import {resultSet} from '
|
|
27
|
-
import {ERROR_CODES} from '
|
|
28
|
-
import {component as componentApi} from '
|
|
29
|
-
import {Project} from '
|
|
30
|
-
import {warnOnIntegrationIssues} from '
|
|
31
|
-
import {doc as componentCommand} from '
|
|
32
|
-
import {doc as componentFn} from '
|
|
19
|
+
} from '../lib/component-format.mjs';
|
|
20
|
+
import {resolveTheme} from '../lib/resolve-theme.mjs';
|
|
21
|
+
import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
|
|
22
|
+
import {jsonOut} from '../../../foundation/response/json.mjs';
|
|
23
|
+
import {emit, section, text, list, record, records, code} from '../formatters/index.mjs';
|
|
24
|
+
import {cliError} from '../lib/cli-error.mjs';
|
|
25
|
+
import {defineCommand} from '../lib/define-command.mjs';
|
|
26
|
+
import {resultSet} from '../../../foundation/debug/index.mjs';
|
|
27
|
+
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
28
|
+
import {component as componentApi} from '../../../api/component/component.mjs';
|
|
29
|
+
import {Project} from '../../../foundation/config/project.mjs';
|
|
30
|
+
import {warnOnIntegrationIssues} from '../../../foundation/integrations/integration-warnings.mjs';
|
|
31
|
+
import {doc as componentCommand} from './component.doc.mjs';
|
|
32
|
+
import {doc as componentFn} from '../../../api/component/component.doc.mjs';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* The api layer's component() widens its return to `{type: string, data: unknown}`,
|
|
@@ -37,13 +37,13 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
|
|
|
37
37
|
* src/types/component to get narrowing + typed data.
|
|
38
38
|
*
|
|
39
39
|
* @typedef {(
|
|
40
|
-
* | import('
|
|
41
|
-
* | import('
|
|
42
|
-
* | import('
|
|
43
|
-
* | import('
|
|
44
|
-
* | import('
|
|
45
|
-
* | import('
|
|
46
|
-
* | import('
|
|
40
|
+
* | import('../../../api/component/component.type.mjs').ComponentListResponse
|
|
41
|
+
* | import('../../../api/component/component.type.mjs').ComponentBatchResponse
|
|
42
|
+
* | import('../../../api/component/component.type.mjs').ComponentDetailResponse
|
|
43
|
+
* | import('../../../api/component/component.type.mjs').ComponentDetailPropsResponse
|
|
44
|
+
* | import('../../../api/component/component.type.mjs').ComponentDetailSourceResponse
|
|
45
|
+
* | import('../../../api/component/component.type.mjs').ComponentDetailShowcaseResponse
|
|
46
|
+
* | import('../../../api/component/component.type.mjs').ComponentDetailBlocksResponse
|
|
47
47
|
* )} ComponentResult
|
|
48
48
|
*/
|
|
49
49
|
|
|
@@ -57,7 +57,7 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
|
|
|
57
57
|
* the thing that resolved (the component) is not the thing being counted.
|
|
58
58
|
*
|
|
59
59
|
* @param {ComponentResult} result
|
|
60
|
-
* @returns {import('
|
|
60
|
+
* @returns {import('../../../foundation/debug/command-result.mjs').CommandResult}
|
|
61
61
|
*/
|
|
62
62
|
function summarize(result) {
|
|
63
63
|
switch (result.type) {
|
|
@@ -90,11 +90,11 @@ function summarize(result) {
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Project one single-component API result through the existing formatter kit.
|
|
93
|
-
* @param {import('
|
|
93
|
+
* @param {import('../../../api/component/component.type.mjs').ComponentSingleResponse} result
|
|
94
94
|
* @param {string} requestedName
|
|
95
95
|
* @param {'full'|'compact'|'brief'} detail
|
|
96
96
|
* @param {Awaited<ReturnType<typeof resolveTheme>>} themeData
|
|
97
|
-
* @returns {import('
|
|
97
|
+
* @returns {import('../formatters/index.mjs').Block[]}
|
|
98
98
|
*/
|
|
99
99
|
function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
100
100
|
const requested = (requestedName.split('/').pop() ?? requestedName).replace(
|
|
@@ -111,7 +111,7 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
|
111
111
|
: requested;
|
|
112
112
|
switch (result.type) {
|
|
113
113
|
case 'component.detail': {
|
|
114
|
-
/** @type {import('
|
|
114
|
+
/** @type {import('../formatters/index.mjs').Block[]} */
|
|
115
115
|
const out = [record({package: result.package})];
|
|
116
116
|
if (result.data.parentDoc) {
|
|
117
117
|
out.push(record(result.data, {fields: ['parentDoc']}));
|
|
@@ -150,7 +150,7 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
|
150
150
|
/** @param {{package: string}} block @param {string} label */
|
|
151
151
|
const owned = (block, label) =>
|
|
152
152
|
block.package === result.package ? label : `${label} (${block.package})`;
|
|
153
|
-
/** @type {import('
|
|
153
|
+
/** @type {import('../formatters/index.mjs').Block[]} */
|
|
154
154
|
const out = [record({package: result.package})];
|
|
155
155
|
if (showcase) {
|
|
156
156
|
out.push(
|
|
@@ -243,7 +243,7 @@ export function registerComponent(program) {
|
|
|
243
243
|
lang, zh, dense,
|
|
244
244
|
}));
|
|
245
245
|
} catch (e) {
|
|
246
|
-
const err = /** @type {import('
|
|
246
|
+
const err = /** @type {import('../../../api/error.mjs').AstryxError} */ (e);
|
|
247
247
|
return cliError(err.message, {suggestions: err.suggestions, code: err.code});
|
|
248
248
|
}
|
|
249
249
|
|
|
@@ -326,7 +326,7 @@ export function registerComponent(program) {
|
|
|
326
326
|
// description), grouped by category. Fields mirror the JSON keys.
|
|
327
327
|
const groups = result.data.components;
|
|
328
328
|
const entries = Object.entries(groups);
|
|
329
|
-
/** @type {import('
|
|
329
|
+
/** @type {import('../formatters/index.mjs').Block[]} */
|
|
330
330
|
const out = [];
|
|
331
331
|
for (const [cat, items] of entries) {
|
|
332
332
|
// Skip the synthetic group header when there's only one ungrouped category
|
|
@@ -362,7 +362,7 @@ export function registerComponent(program) {
|
|
|
362
362
|
nameCounts.set(item.name, set);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
/** @param {import('
|
|
365
|
+
/** @param {import('../../../api/component/component.type.mjs').ComponentListEntry} item */
|
|
366
366
|
const importCell = item => {
|
|
367
367
|
// Use a precomputed import when the API supplies one (integration
|
|
368
368
|
// components carry it); only fall back to the core resolver for
|
|
@@ -392,7 +392,7 @@ export function registerComponent(program) {
|
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
case 'component.batch': {
|
|
395
|
-
/** @type {import('
|
|
395
|
+
/** @type {import('../formatters/index.mjs').Block[]} */
|
|
396
396
|
const out = [
|
|
397
397
|
section('Component batch'),
|
|
398
398
|
record({count: result.data.count}),
|
|
@@ -474,8 +474,8 @@ export function registerComponent(program) {
|
|
|
474
474
|
|
|
475
475
|
// Re-export lib functions for backward compatibility
|
|
476
476
|
// (agent-docs.mjs, tests, and generate-skill-doc.sh import from here)
|
|
477
|
-
export {discoverComponents, discoverExternalComponentsGrouped, findComponentReadme, findComponentSource, findExternalComponentDoc, resolveImportPath} from '
|
|
478
|
-
export {discoverExternalPackages} from '
|
|
479
|
-
export {loadDocs} from '
|
|
480
|
-
export {formatFull, formatCompact, formatBrief, formatProps, formatBriefAll} from '
|
|
481
|
-
export {levenshteinDistance, findClosestComponents, searchComponents} from '
|
|
477
|
+
export {discoverComponents, discoverExternalComponentsGrouped, findComponentReadme, findComponentSource, findExternalComponentDoc, resolveImportPath} from '../../../foundation/discovery/component-discovery.mjs';
|
|
478
|
+
export {discoverExternalPackages} from '../../../foundation/fs/paths.mjs';
|
|
479
|
+
export {loadDocs} from '../../../foundation/discovery/component-loader.mjs';
|
|
480
|
+
export {formatFull, formatCompact, formatBrief, formatProps, formatBriefAll} from '../lib/component-format.mjs';
|
|
481
|
+
export {levenshteinDistance, findClosestComponents, searchComponents} from '../../../foundation/text/string-utils.mjs';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
findComponentSource,
|
|
13
13
|
levenshteinDistance,
|
|
14
14
|
findClosestComponents,
|
|
15
|
-
} from './component
|
|
15
|
+
} from './component.mjs';
|
|
16
16
|
import {runCli} from '../../../test-utils/run-cli.mjs';
|
|
17
17
|
|
|
18
18
|
const REPO_ROOT = path.resolve(import.meta.dirname, '../../../../..');
|
|
@@ -528,7 +528,7 @@ describe('findExternalComponentDoc', () => {
|
|
|
528
528
|
describe('searchComponents', () => {
|
|
529
529
|
it('finds Collapsible when searching "accordion"', async () => {
|
|
530
530
|
const {searchComponents, discoverComponents} =
|
|
531
|
-
await import('./component
|
|
531
|
+
await import('./component.mjs');
|
|
532
532
|
const components = discoverComponents('packages/core');
|
|
533
533
|
const results = await searchComponents(
|
|
534
534
|
'accordion',
|
|
@@ -542,7 +542,7 @@ describe('searchComponents', () => {
|
|
|
542
542
|
|
|
543
543
|
it('finds Dialog when searching "modal"', async () => {
|
|
544
544
|
const {searchComponents, discoverComponents} =
|
|
545
|
-
await import('./component
|
|
545
|
+
await import('./component.mjs');
|
|
546
546
|
const components = discoverComponents('packages/core');
|
|
547
547
|
const results = await searchComponents(
|
|
548
548
|
'modal',
|
|
@@ -556,7 +556,7 @@ describe('searchComponents', () => {
|
|
|
556
556
|
|
|
557
557
|
it('returns multiple matches for ambiguous terms like "select"', async () => {
|
|
558
558
|
const {searchComponents, discoverComponents} =
|
|
559
|
-
await import('./component
|
|
559
|
+
await import('./component.mjs');
|
|
560
560
|
const components = discoverComponents('packages/core');
|
|
561
561
|
const results = await searchComponents(
|
|
562
562
|
'select',
|
|
@@ -571,7 +571,7 @@ describe('searchComponents', () => {
|
|
|
571
571
|
|
|
572
572
|
it('finds exact name matches with score 100', async () => {
|
|
573
573
|
const {searchComponents, discoverComponents} =
|
|
574
|
-
await import('./component
|
|
574
|
+
await import('./component.mjs');
|
|
575
575
|
const components = discoverComponents('packages/core');
|
|
576
576
|
const results = await searchComponents(
|
|
577
577
|
'Button',
|
|
@@ -584,7 +584,7 @@ describe('searchComponents', () => {
|
|
|
584
584
|
|
|
585
585
|
it('returns empty array for complete gibberish', async () => {
|
|
586
586
|
const {searchComponents, discoverComponents} =
|
|
587
|
-
await import('./component
|
|
587
|
+
await import('./component.mjs');
|
|
588
588
|
const components = discoverComponents('packages/core');
|
|
589
589
|
const results = await searchComponents(
|
|
590
590
|
'zzzzzzzzzzz',
|
|
@@ -58,10 +58,10 @@ export const doc = {
|
|
|
58
58
|
{label: 'Every CLI doc, one line each', cli: 'astryx docs cli --depth all'},
|
|
59
59
|
{
|
|
60
60
|
label: 'The integration guides as one read',
|
|
61
|
-
cli: 'astryx docs
|
|
61
|
+
cli: 'astryx docs authoring --depth all --detail full',
|
|
62
62
|
},
|
|
63
63
|
{label: 'One API function', cli: 'astryx docs cli/api/functions/search'},
|
|
64
|
-
{label: 'A whole guide', cli: 'astryx docs
|
|
64
|
+
{label: 'A whole guide', cli: 'astryx docs authoring/quick-start --full'},
|
|
65
65
|
],
|
|
66
66
|
outsideProject: 'same',
|
|
67
67
|
exitCodes: [
|
|
@@ -535,7 +535,7 @@ function emitNode(node, detail, run) {
|
|
|
535
535
|
text(
|
|
536
536
|
[
|
|
537
537
|
// A child's route is its parent's route and its name, except a flat
|
|
538
|
-
// topic in
|
|
538
|
+
// topic in a topic level, which keeps its own name.
|
|
539
539
|
node.slots.every(slot =>
|
|
540
540
|
slot.children.every(child => child.route.startsWith(`${node.route}/`)),
|
|
541
541
|
)
|