@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
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* @input A package.json object.
|
|
7
7
|
* @output Whether its `peerDependencies` range for `@astryxdesign/cli` admits
|
|
8
8
|
* only CLIs that read namespace docs, and the package.json that declares it.
|
|
9
|
-
* @position foundation/integrations; read by `integration add doc --parent
|
|
10
|
-
* and `integration
|
|
11
|
-
* `integration verify`, which requires it.
|
|
9
|
+
* @position foundation/integrations; read by `integration add doc --parent`,
|
|
10
|
+
* which declares the peer, and `integration pack --check`, which requires it.
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
import {semverCompare} from '../env/semver.mjs';
|
|
@@ -17,12 +16,10 @@ export const CLI_PACKAGE = '@astryxdesign/cli';
|
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* The first CLI release that reads an integration's docs tree (namespace docs
|
|
20
|
-
* and placed guides)
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* rejects a themes root without the `manifest.json` catalog the CLI no longer
|
|
25
|
-
* writes, withholding the package's themes and doc topics.
|
|
19
|
+
* and placed guides) and its templates' `replaces`. A release before it can
|
|
20
|
+
* hide every doc topic a package with a namespace doc or a placed guide
|
|
21
|
+
* ships, with no warning, and it rejects `replaces` and withholds the
|
|
22
|
+
* package's templates and doc topics.
|
|
26
23
|
*/
|
|
27
24
|
export const DOCS_TREE_CLI = '0.7.0';
|
|
28
25
|
|
|
@@ -95,11 +92,11 @@ function cliRangeProblem(pkg, feature, loss) {
|
|
|
95
92
|
const range = pkg?.peerDependencies?.[CLI_PACKAGE];
|
|
96
93
|
const fix = `"${CLI_PACKAGE}": ">=${DOCS_TREE_CLI}" in peerDependencies (optional in peerDependenciesMeta, if the CLI is not required)`;
|
|
97
94
|
if (typeof range !== 'string') {
|
|
98
|
-
return `The package ${feature} but declares no ${CLI_PACKAGE} peer. A
|
|
95
|
+
return `The package ${feature} but declares no ${CLI_PACKAGE} peer. A CLI older than ${DOCS_TREE_CLI} ${loss}. Declare ${fix}.`;
|
|
99
96
|
}
|
|
100
97
|
const lowest = lowestAdmitted(range);
|
|
101
98
|
if (lowest == null || semverCompare(lowest, DOCS_TREE_CLI) < 0) {
|
|
102
|
-
return `The package ${feature}, but its ${CLI_PACKAGE} peer range "${range}" admits a
|
|
99
|
+
return `The package ${feature}, but its ${CLI_PACKAGE} peer range "${range}" admits a CLI older than ${DOCS_TREE_CLI}, which ${loss}. Declare ${fix}.`;
|
|
103
100
|
}
|
|
104
101
|
return null;
|
|
105
102
|
}
|
|
@@ -122,8 +119,8 @@ export function docsTreeCliProblem(pkg) {
|
|
|
122
119
|
}
|
|
123
120
|
|
|
124
121
|
/**
|
|
125
|
-
* Why a package with a template that sets `replaces` would lose templates
|
|
126
|
-
* doc topics on an older CLI (spec:AST-035), or null when its declared CLI
|
|
122
|
+
* Why a package with a template that sets `replaces` would lose its templates
|
|
123
|
+
* and doc topics on an older CLI (spec:AST-035), or null when its declared CLI
|
|
127
124
|
* range admits only CLIs that read the field.
|
|
128
125
|
* @param {any} pkg package.json
|
|
129
126
|
* @returns {string | null}
|
|
@@ -132,39 +129,7 @@ export function replacesCliProblem(pkg) {
|
|
|
132
129
|
return cliRangeProblem(
|
|
133
130
|
pkg,
|
|
134
131
|
'has a template that sets `replaces`',
|
|
135
|
-
"rejects the field,
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Why a package with a doc section that sets `id` would lose its doc topics on
|
|
141
|
-
* an older CLI, or null when its declared CLI range admits only CLIs that read
|
|
142
|
-
* the field. Published 0.6.3 rejects a section `id` and hides every doc topic
|
|
143
|
-
* the package ships.
|
|
144
|
-
* @param {any} pkg package.json
|
|
145
|
-
* @returns {string | null}
|
|
146
|
-
*/
|
|
147
|
-
export function sectionIdsCliProblem(pkg) {
|
|
148
|
-
return cliRangeProblem(
|
|
149
|
-
pkg,
|
|
150
|
-
'has a doc section that sets `id`',
|
|
151
|
-
'rejects the field, and can hide every doc topic the package ships',
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Why a package that ships a theme would lose its themes and doc topics on an
|
|
157
|
-
* older CLI, or null when its declared CLI range admits only CLIs that read
|
|
158
|
-
* typed theme descriptors. Published 0.6.3 rejects a themes root with no
|
|
159
|
-
* `manifest.json` catalog, which `integration add theme` no longer writes.
|
|
160
|
-
* @param {any} pkg package.json
|
|
161
|
-
* @returns {string | null}
|
|
162
|
-
*/
|
|
163
|
-
export function themesCliProblem(pkg) {
|
|
164
|
-
return cliRangeProblem(
|
|
165
|
-
pkg,
|
|
166
|
-
'ships a theme',
|
|
167
|
-
"cannot read typed theme descriptors, and can drop the package's themes and hide its doc topics",
|
|
132
|
+
"rejects the field, and withholds the package's templates and doc topics",
|
|
168
133
|
);
|
|
169
134
|
}
|
|
170
135
|
|
|
@@ -32,11 +32,6 @@ describe('docsTreeCliProblem', () => {
|
|
|
32
32
|
expect(docsTreeCliProblem({name: '@acme/kit'})).toContain(
|
|
33
33
|
'declares no @astryxdesign/cli peer',
|
|
34
34
|
);
|
|
35
|
-
// Stable releases: a canary built from main before its release reports
|
|
36
|
-
// the older version and reads every feature.
|
|
37
|
-
expect(docsTreeCliProblem({name: '@acme/kit'})).toContain(
|
|
38
|
-
'A stable CLI before 0.7.0 does not read the docs tree',
|
|
39
|
-
);
|
|
40
35
|
});
|
|
41
36
|
|
|
42
37
|
it.each(['^0.6.0', '^0.6.0 || >=0.7.0', '*', '>=0.6.3'])(
|
|
@@ -44,7 +39,7 @@ describe('docsTreeCliProblem', () => {
|
|
|
44
39
|
range => {
|
|
45
40
|
expect(
|
|
46
41
|
docsTreeCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
|
|
47
|
-
).toContain('admits a
|
|
42
|
+
).toContain('admits a CLI older than');
|
|
48
43
|
},
|
|
49
44
|
);
|
|
50
45
|
|
|
@@ -81,7 +76,7 @@ describe('replacesCliProblem', () => {
|
|
|
81
76
|
);
|
|
82
77
|
expect(
|
|
83
78
|
replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '^0.6.0'}}),
|
|
84
|
-
).toContain('admits a
|
|
79
|
+
).toContain('admits a CLI older than');
|
|
85
80
|
expect(
|
|
86
81
|
replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.7.0'}}),
|
|
87
82
|
).toBeNull();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file Contribution inventory for
|
|
4
|
+
* @file Contribution inventory for integration pack-check.
|
|
5
5
|
*
|
|
6
6
|
* Enumerates the files and contribution identities an integration package
|
|
7
7
|
* declares, for cross-referencing against the npm tarball. The file inventory
|
|
@@ -45,7 +45,7 @@ export function findManifestPaths(dir: string): string[];
|
|
|
45
45
|
* @param {string} file absolute manifest path
|
|
46
46
|
* @param {string} [label] used in error messages
|
|
47
47
|
* @param {{fresh?: boolean}} [options]
|
|
48
|
-
* @returns {Promise<{manifest: import('../../authoring/integration/type').AstryxIntegration, unknownKeys: string[], debug?: import('../../authoring/debug/type').DebugEventHandler, gapReport?: import('../../authoring/gap-report/type').GapReportHandler, gapReportError?: string,
|
|
48
|
+
* @returns {Promise<{manifest: import('../../authoring/integration/type').AstryxIntegration, unknownKeys: string[], debug?: import('../../authoring/debug/type').DebugEventHandler, gapReport?: import('../../authoring/gap-report/type').GapReportHandler, gapReportError?: string, agentDocsError?: string}>}
|
|
49
49
|
*/
|
|
50
50
|
export function loadManifest(file: string, label?: string, { fresh }?: {
|
|
51
51
|
fresh?: boolean;
|
|
@@ -55,8 +55,6 @@ export function loadManifest(file: string, label?: string, { fresh }?: {
|
|
|
55
55
|
debug?: import("../../authoring/debug/type").DebugEventHandler;
|
|
56
56
|
gapReport?: import("../../authoring/gap-report/type").GapReportHandler;
|
|
57
57
|
gapReportError?: string;
|
|
58
|
-
discover?: import("../../authoring/discover/type").DiscoverSource;
|
|
59
|
-
discoverError?: string;
|
|
60
58
|
agentDocsError?: string;
|
|
61
59
|
}>;
|
|
62
60
|
/**
|
|
@@ -156,9 +154,6 @@ export function loadIntegrations(specs?: string[], { cwd, fresh, resolveProvider
|
|
|
156
154
|
* validated package-owned handler from the `gapReport` NAMED export.
|
|
157
155
|
* @property {string} [__gapReportError] isolated named-handler validation error.
|
|
158
156
|
* Named exports are not manifest keys — see {@link loadManifest}.
|
|
159
|
-
* @property {import('../../authoring/discover/type').DiscoverSource} [__discover]
|
|
160
|
-
* validated catalog source from the `discover` NAMED export.
|
|
161
|
-
* @property {string} [__discoverError] isolated discover-source validation error.
|
|
162
157
|
*/
|
|
163
158
|
/** Conventional manifest basenames, in load-precedence order. */
|
|
164
159
|
export const MANIFEST_BASENAMES: string[];
|
|
@@ -250,12 +245,4 @@ export type LoadedIntegration = {
|
|
|
250
245
|
* Named exports are not manifest keys — see {@link loadManifest}.
|
|
251
246
|
*/
|
|
252
247
|
__gapReportError?: string | undefined;
|
|
253
|
-
/**
|
|
254
|
-
* validated catalog source from the `discover` NAMED export.
|
|
255
|
-
*/
|
|
256
|
-
__discover?: import("../../authoring/discover/type").DiscoverSource | undefined;
|
|
257
|
-
/**
|
|
258
|
-
* isolated discover-source validation error.
|
|
259
|
-
*/
|
|
260
|
-
__discoverError?: string | undefined;
|
|
261
248
|
};
|
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
} from '../../authoring/integration/schema.mjs';
|
|
30
30
|
import {importUserModule, findPresentFiles} from '../fs/module-loader.mjs';
|
|
31
31
|
import {parseGapReportHandler} from '../../authoring/gap-report/parse.mjs';
|
|
32
|
-
import {parseDiscoverSource} from '../../authoring/discover/parse.mjs';
|
|
33
32
|
import {resolveProviders} from './provider-resolution.mjs';
|
|
34
33
|
|
|
35
34
|
/**
|
|
@@ -81,9 +80,6 @@ import {resolveProviders} from './provider-resolution.mjs';
|
|
|
81
80
|
* validated package-owned handler from the `gapReport` NAMED export.
|
|
82
81
|
* @property {string} [__gapReportError] isolated named-handler validation error.
|
|
83
82
|
* Named exports are not manifest keys — see {@link loadManifest}.
|
|
84
|
-
* @property {import('../../authoring/discover/type').DiscoverSource} [__discover]
|
|
85
|
-
* validated catalog source from the `discover` NAMED export.
|
|
86
|
-
* @property {string} [__discoverError] isolated discover-source validation error.
|
|
87
83
|
*/
|
|
88
84
|
|
|
89
85
|
/** Conventional manifest basenames, in load-precedence order. */
|
|
@@ -171,23 +167,6 @@ function parseGapReportHandlerExport(value, label) {
|
|
|
171
167
|
}
|
|
172
168
|
}
|
|
173
169
|
|
|
174
|
-
/**
|
|
175
|
-
* Parse the optional named discover source the same way: a malformed one is
|
|
176
|
-
* isolated from every other contribution and reported by `astryx discover`.
|
|
177
|
-
*
|
|
178
|
-
* @param {unknown} value
|
|
179
|
-
* @param {string} label
|
|
180
|
-
* @returns {{source?: import('../../authoring/discover/type').DiscoverSource, error?: string}}
|
|
181
|
-
*/
|
|
182
|
-
function parseDiscoverSourceExport(value, label) {
|
|
183
|
-
if (value === undefined) return {};
|
|
184
|
-
try {
|
|
185
|
-
return {source: parseDiscoverSource(value, `${label} named export "discover"`)};
|
|
186
|
-
} catch (error) {
|
|
187
|
-
return {error: error instanceof Error ? error.message : String(error)};
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
170
|
/**
|
|
192
171
|
* Load and validate a manifest module's default export, while isolating the
|
|
193
172
|
* optional `agentDocs` contribution from the manifest's other fields.
|
|
@@ -204,7 +183,7 @@ function parseDiscoverSourceExport(value, label) {
|
|
|
204
183
|
* @param {string} file absolute manifest path
|
|
205
184
|
* @param {string} [label] used in error messages
|
|
206
185
|
* @param {{fresh?: boolean}} [options]
|
|
207
|
-
* @returns {Promise<{manifest: import('../../authoring/integration/type').AstryxIntegration, unknownKeys: string[], debug?: import('../../authoring/debug/type').DebugEventHandler, gapReport?: import('../../authoring/gap-report/type').GapReportHandler, gapReportError?: string,
|
|
186
|
+
* @returns {Promise<{manifest: import('../../authoring/integration/type').AstryxIntegration, unknownKeys: string[], debug?: import('../../authoring/debug/type').DebugEventHandler, gapReport?: import('../../authoring/gap-report/type').GapReportHandler, gapReportError?: string, agentDocsError?: string}>}
|
|
208
187
|
*/
|
|
209
188
|
export async function loadManifest(
|
|
210
189
|
file,
|
|
@@ -215,7 +194,6 @@ export async function loadManifest(
|
|
|
215
194
|
const raw = mod?.default;
|
|
216
195
|
const baseManifest = parseIntegrationBase(raw, label);
|
|
217
196
|
const gapReport = parseGapReportHandlerExport(mod?.gapReport, label);
|
|
218
|
-
const discover = parseDiscoverSourceExport(mod?.discover, label);
|
|
219
197
|
const hasAgentDocs =
|
|
220
198
|
raw != null &&
|
|
221
199
|
typeof raw === 'object' &&
|
|
@@ -250,8 +228,6 @@ export async function loadManifest(
|
|
|
250
228
|
: undefined,
|
|
251
229
|
gapReport: gapReport.handler,
|
|
252
230
|
gapReportError: gapReport.error,
|
|
253
|
-
discover: discover.source,
|
|
254
|
-
discoverError: discover.error,
|
|
255
231
|
agentDocsError,
|
|
256
232
|
};
|
|
257
233
|
}
|
|
@@ -369,10 +345,6 @@ export async function loadLocalIntegration(packageDir, {fresh = false} = {}) {
|
|
|
369
345
|
let gapReportHandler;
|
|
370
346
|
/** @type {string | undefined} */
|
|
371
347
|
let gapReportError;
|
|
372
|
-
/** @type {import('../../authoring/discover/type').DiscoverSource | undefined} */
|
|
373
|
-
let discoverSource;
|
|
374
|
-
/** @type {string | undefined} */
|
|
375
|
-
let discoverError;
|
|
376
348
|
/** @type {string | undefined} */
|
|
377
349
|
let agentDocsError;
|
|
378
350
|
try {
|
|
@@ -382,8 +354,6 @@ export async function loadLocalIntegration(packageDir, {fresh = false} = {}) {
|
|
|
382
354
|
debug: debugHandler,
|
|
383
355
|
gapReport: gapReportHandler,
|
|
384
356
|
gapReportError,
|
|
385
|
-
discover: discoverSource,
|
|
386
|
-
discoverError,
|
|
387
357
|
agentDocsError,
|
|
388
358
|
} = await loadManifest(manifestFile, `Integration ${spec}`, {fresh}));
|
|
389
359
|
} catch (err) {
|
|
@@ -427,8 +397,6 @@ export async function loadLocalIntegration(packageDir, {fresh = false} = {}) {
|
|
|
427
397
|
__debug: debugHandler,
|
|
428
398
|
__gapReport: gapReportHandler,
|
|
429
399
|
__gapReportError: gapReportError,
|
|
430
|
-
__discover: discoverSource,
|
|
431
|
-
__discoverError: discoverError,
|
|
432
400
|
__spec: spec,
|
|
433
401
|
__packageDir: packageDir,
|
|
434
402
|
__packageExports: pkg.exports ?? null,
|
|
@@ -480,10 +448,6 @@ export async function loadIntegrations(
|
|
|
480
448
|
let gapReportHandler;
|
|
481
449
|
/** @type {string | undefined} */
|
|
482
450
|
let gapReportError;
|
|
483
|
-
/** @type {import('../../authoring/discover/type').DiscoverSource | undefined} */
|
|
484
|
-
let discoverSource;
|
|
485
|
-
/** @type {string | undefined} */
|
|
486
|
-
let discoverError;
|
|
487
451
|
/** @type {string | undefined} */
|
|
488
452
|
let agentDocsError;
|
|
489
453
|
try {
|
|
@@ -493,8 +457,6 @@ export async function loadIntegrations(
|
|
|
493
457
|
debug: debugHandler,
|
|
494
458
|
gapReport: gapReportHandler,
|
|
495
459
|
gapReportError,
|
|
496
|
-
discover: discoverSource,
|
|
497
|
-
discoverError,
|
|
498
460
|
agentDocsError,
|
|
499
461
|
} = await loadManifest(manifestFile, `Integration ${spec}`, {fresh}));
|
|
500
462
|
} catch (err) {
|
|
@@ -545,8 +507,6 @@ export async function loadIntegrations(
|
|
|
545
507
|
__debug: debugHandler,
|
|
546
508
|
__gapReport: gapReportHandler,
|
|
547
509
|
__gapReportError: gapReportError,
|
|
548
|
-
__discover: discoverSource,
|
|
549
|
-
__discoverError: discoverError,
|
|
550
510
|
__spec: spec,
|
|
551
511
|
__packageDir: packageDir,
|
|
552
512
|
__packageExports: pkg.exports ?? null,
|
|
@@ -785,34 +785,3 @@ describe('the `gapReport` named export', () => {
|
|
|
785
785
|
expect(loaded.__unknownKeys).toEqual(['gapReport']);
|
|
786
786
|
});
|
|
787
787
|
});
|
|
788
|
-
|
|
789
|
-
describe('the `discover` named export', () => {
|
|
790
|
-
it('is carried out of the manifest module as __discover', async () => {
|
|
791
|
-
writeManifestPackage(tmpDir, {
|
|
792
|
-
body:
|
|
793
|
-
`export async function discover() { return {schemaVersion: 1}; }\n` +
|
|
794
|
-
`export default {issuesUrl: 'https://example.com/i'};\n`,
|
|
795
|
-
});
|
|
796
|
-
|
|
797
|
-
const [loaded] = await loadIntegrations(['@acme/widgets'], {cwd: tmpDir});
|
|
798
|
-
|
|
799
|
-
expect(typeof loaded.__discover).toBe('function');
|
|
800
|
-
expect(loaded.__discoverError).toBeUndefined();
|
|
801
|
-
expect(loaded.__unknownKeys).toEqual([]);
|
|
802
|
-
expect(loaded.issuesUrl).toBe('https://example.com/i');
|
|
803
|
-
});
|
|
804
|
-
|
|
805
|
-
it('keeps the manifest and records why when the export is not a function', async () => {
|
|
806
|
-
writeManifestPackage(tmpDir, {
|
|
807
|
-
body:
|
|
808
|
-
`export const discover = {url: 'https://example.com/catalog.json'};\n` +
|
|
809
|
-
`export default {issuesUrl: 'https://example.com/i'};\n`,
|
|
810
|
-
});
|
|
811
|
-
|
|
812
|
-
const [loaded] = await loadIntegrations(['@acme/widgets'], {cwd: tmpDir});
|
|
813
|
-
|
|
814
|
-
expect(loaded.__discover).toBeUndefined();
|
|
815
|
-
expect(loaded.__discoverError).toContain('must be a function');
|
|
816
|
-
expect(loaded.issuesUrl).toBe('https://example.com/i');
|
|
817
|
-
});
|
|
818
|
-
});
|
|
@@ -36,16 +36,17 @@ export const doc = {
|
|
|
36
36
|
{
|
|
37
37
|
value: 'ERR_INVALID_OPTION',
|
|
38
38
|
description:
|
|
39
|
-
'An unknown option was passed
|
|
39
|
+
'An unknown flag/option was passed (Commander `unknownOption`).',
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
value: 'ERR_INVALID_ARGUMENT',
|
|
43
43
|
description:
|
|
44
|
-
|
|
44
|
+
"An option/argument had a value Commander's parser rejected.",
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
value: 'ERR_MISSING_ARGUMENT',
|
|
48
|
-
description:
|
|
48
|
+
description:
|
|
49
|
+
'A required positional argument was omitted (Commander `missingArgument`).',
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
52
|
value: 'ERR_INVALID_LANG',
|
|
@@ -133,11 +134,12 @@ export const doc = {
|
|
|
133
134
|
},
|
|
134
135
|
{
|
|
135
136
|
value: 'ERR_UNKNOWN_PACKAGE',
|
|
136
|
-
description: 'No package matched the requested name.',
|
|
137
|
+
description: 'No package matched the requested name (discover).',
|
|
137
138
|
},
|
|
138
139
|
{
|
|
139
140
|
value: 'ERR_UNKNOWN_AGENT',
|
|
140
|
-
description:
|
|
141
|
+
description:
|
|
142
|
+
'An unrecognized `--agent` value was passed to agent-docs/init.',
|
|
141
143
|
},
|
|
142
144
|
{
|
|
143
145
|
value: 'ERR_UNKNOWN_FEATURE',
|
|
@@ -270,7 +272,7 @@ export const doc = {
|
|
|
270
272
|
{
|
|
271
273
|
value: 'ERR_UNCLASSIFIED_EXIT',
|
|
272
274
|
description:
|
|
273
|
-
'Recorded in the debug log, never printed: a command exited non-zero without
|
|
275
|
+
'Recorded in the debug log, never printed: a command exited non-zero without going through cliError/jsonError, so no stable code was available.',
|
|
274
276
|
},
|
|
275
277
|
{
|
|
276
278
|
value: 'ERR_SIGNAL_TERMINATED',
|
|
@@ -195,15 +195,8 @@ describe('error codes: end-to-end JSON envelopes', () => {
|
|
|
195
195
|
// is rejected at the preAction gate with a stable invalid-option code.
|
|
196
196
|
{
|
|
197
197
|
name: 'json not supported',
|
|
198
|
-
args: ['theme', '--json'],
|
|
199
|
-
code: 'ERR_INVALID_OPTION',
|
|
200
|
-
},
|
|
201
|
-
// A group given a word it does not have names the unknown subcommand,
|
|
202
|
-
// in JSON as in text.
|
|
203
|
-
{
|
|
204
|
-
name: 'unknown subcommand of a group',
|
|
205
198
|
args: ['theme', 'bogus-sub', '--json'],
|
|
206
|
-
code: '
|
|
199
|
+
code: 'ERR_INVALID_OPTION',
|
|
207
200
|
},
|
|
208
201
|
];
|
|
209
202
|
|
|
@@ -256,31 +249,13 @@ describe('error codes: human mode stays clean', () => {
|
|
|
256
249
|
expect(stdout).not.toContain('ERR_UNKNOWN_COMPONENT');
|
|
257
250
|
});
|
|
258
251
|
|
|
259
|
-
it('unknown subcommand exits 1
|
|
260
|
-
//
|
|
261
|
-
//
|
|
252
|
+
it('unknown subcommand exits 1 in human mode (code carried internally)', async () => {
|
|
253
|
+
// `theme` is not JSON-capable, so this path is human-only; we assert the
|
|
254
|
+
// failure surfaces with exit 1 and a helpful message. The stable
|
|
255
|
+
// ERR_UNKNOWN_SUBCOMMAND code rides along on the cliError call.
|
|
262
256
|
const {status, stderr} = await runCli(['theme', 'bogus-sub']);
|
|
263
257
|
expect(status).toBe(1);
|
|
264
258
|
expect(stderr).toContain("unknown subcommand 'theme bogus-sub'");
|
|
265
259
|
expect(stderr).not.toContain('ERR_UNKNOWN_SUBCOMMAND');
|
|
266
|
-
for (const args of [
|
|
267
|
-
['--json', 'theme', 'bogus-sub'],
|
|
268
|
-
['theme', 'bogus-sub', '--json'],
|
|
269
|
-
['--json', 'doctor', 'integration', 'bogus-sub'],
|
|
270
|
-
]) {
|
|
271
|
-
const json = await runCli(args);
|
|
272
|
-
expect(json.status, args.join(' ')).toBe(1);
|
|
273
|
-
expect(JSON.parse(json.stdout), args.join(' ')).toMatchObject({
|
|
274
|
-
code: 'ERR_UNKNOWN_SUBCOMMAND',
|
|
275
|
-
suggestions: expect.arrayContaining([expect.objectContaining({reason: 'available subcommand'})]),
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
// Text and JSON agree for a group that shows help when run bare.
|
|
279
|
-
const text = await runCli(['doctor', 'integration', 'bogus-sub']);
|
|
280
|
-
expect(text.status).toBe(1);
|
|
281
|
-
expect(text.stderr).toContain("unknown subcommand 'doctor integration bogus-sub'");
|
|
282
|
-
const doctor = await runCli(['doctor', 'integrations']);
|
|
283
|
-
expect(doctor.status).toBe(1);
|
|
284
|
-
expect(doctor.stderr).toContain("unknown subcommand 'doctor integrations'");
|
|
285
260
|
});
|
|
286
261
|
});
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @file EnumDoc for the `type` discriminant carried on every --json success
|
|
6
6
|
* envelope. The vocabulary mirrors the RESPONSE_TYPES map (each command's
|
|
7
|
-
* `jsonOut(...)` call sites)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* projection, not a future package-version boundary.
|
|
7
|
+
* `jsonOut(...)` call sites) in `clients/cli/lib/manifest.mjs`; a consumer
|
|
8
|
+
* switches on `type` to narrow the `data` payload. Descriptions follow the
|
|
9
|
+
* currently published response projection, not a future package-version boundary.
|
|
11
10
|
*
|
|
12
11
|
* @input Public response discriminants and their currently released payloads.
|
|
13
12
|
* @output Generated consumer reference for every typed JSON success response.
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file EnumDoc for the `type` discriminant carried on every --json success
|
|
5
5
|
* envelope. The vocabulary mirrors the RESPONSE_TYPES map (each command's
|
|
6
|
-
* `jsonOut(...)` call sites)
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* projection, not a future package-version boundary.
|
|
6
|
+
* `jsonOut(...)` call sites) in `clients/cli/lib/manifest.mjs`; a consumer
|
|
7
|
+
* switches on `type` to narrow the `data` payload. Descriptions follow the
|
|
8
|
+
* currently published response projection, not a future package-version boundary.
|
|
10
9
|
*
|
|
11
10
|
* @input Public response discriminants and their currently released payloads.
|
|
12
11
|
* @output Generated consumer reference for every typed JSON success response.
|
|
@@ -36,12 +35,7 @@ export const doc = {
|
|
|
36
35
|
{
|
|
37
36
|
value: 'component.list',
|
|
38
37
|
description:
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
value: 'component.batch',
|
|
43
|
-
description:
|
|
44
|
-
'The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found | not_found | ambiguous | error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}).',
|
|
38
|
+
'The component catalog grouped by category: `detail` (the level: names | compact | full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries, or a full ComponentDoc per entry.',
|
|
45
39
|
},
|
|
46
40
|
{
|
|
47
41
|
value: 'component.detail',
|
|
@@ -110,27 +104,21 @@ export const doc = {
|
|
|
110
104
|
{
|
|
111
105
|
value: 'discover.list',
|
|
112
106
|
description:
|
|
113
|
-
'The
|
|
107
|
+
'The configured external packages (name, category, components, version, description); when empty it carries meta.configured to tell "nothing configured" from "nothing discovered".',
|
|
114
108
|
},
|
|
115
109
|
{
|
|
116
110
|
value: 'discover.detail',
|
|
117
|
-
description:
|
|
118
|
-
'One package, for an @scope/name or @scope/name@version query: what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it.',
|
|
111
|
+
description: 'A single external package entry, for an @scope/name query.',
|
|
119
112
|
},
|
|
120
113
|
{
|
|
121
114
|
value: 'discover.detail.doc',
|
|
122
115
|
description:
|
|
123
|
-
'The validated ComponentDoc for one
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
value: 'discover.item',
|
|
127
|
-
description:
|
|
128
|
-
'One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package.',
|
|
116
|
+
'The validated ComponentDoc for one external component: an @scope/name/Component query, or a free-text term resolving to exactly one component.',
|
|
129
117
|
},
|
|
130
118
|
{
|
|
131
119
|
value: 'discover.search',
|
|
132
120
|
description:
|
|
133
|
-
'The echoed query plus
|
|
121
|
+
'The echoed query plus the matching {package, component} pairs, when a free-text term matches several components.',
|
|
134
122
|
},
|
|
135
123
|
|
|
136
124
|
// search
|
|
@@ -161,7 +149,7 @@ export const doc = {
|
|
|
161
149
|
{
|
|
162
150
|
value: 'swizzle.copy',
|
|
163
151
|
description:
|
|
164
|
-
'An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and
|
|
152
|
+
'An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and an optional maintainer note.',
|
|
165
153
|
},
|
|
166
154
|
|
|
167
155
|
// gap reports
|
|
@@ -263,11 +251,6 @@ export const doc = {
|
|
|
263
251
|
description:
|
|
264
252
|
'Every available codemod, oldest→newest, as {name, title, version, optional}; returned for --list without running anything.',
|
|
265
253
|
},
|
|
266
|
-
{
|
|
267
|
-
value: 'upgrade.registry',
|
|
268
|
-
description:
|
|
269
|
-
'The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items.',
|
|
270
|
-
},
|
|
271
254
|
{
|
|
272
255
|
value: 'upgrade.status',
|
|
273
256
|
description:
|
|
@@ -286,24 +269,11 @@ export const doc = {
|
|
|
286
269
|
'The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index.',
|
|
287
270
|
},
|
|
288
271
|
|
|
289
|
-
// help and version, which no single command owns
|
|
290
|
-
{
|
|
291
|
-
value: 'help',
|
|
292
|
-
description:
|
|
293
|
-
'Help, in one of two shapes. A bare `astryx --json` returns the root manifest: name, version, commands (the command names), jsonSupported, and manifest (the full payload `astryx manifest --json` returns). ' +
|
|
294
|
-
"`--help --json` on any command, or `astryx help [command] --json`, returns that command's help: command, description, usage, options (each flags, description, and defaultValue and choices when set), and subcommands (each name and description). " +
|
|
295
|
-
'data.manifest marks the first shape; data.usage marks the second.',
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
value: 'version',
|
|
299
|
-
description: 'The CLI version, for `astryx --version --json`: {version}.',
|
|
300
|
-
},
|
|
301
|
-
|
|
302
272
|
// doctor
|
|
303
273
|
{
|
|
304
274
|
value: 'doctor',
|
|
305
275
|
description:
|
|
306
|
-
'The health-check report: `checks` (each with id, label, status: pass | warn | fail | info, a message, and
|
|
276
|
+
'The health-check report: `checks` (each with id, label, status: pass | warn | fail | info, a message, and a fix when not passing) plus a `summary` of counts per status.',
|
|
307
277
|
},
|
|
308
278
|
|
|
309
279
|
// integration authoring
|
|
@@ -337,5 +307,22 @@ export const doc = {
|
|
|
337
307
|
description:
|
|
338
308
|
'The integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` | `error`) and `relationship` (`replaces` | `extends` | `accidental`).',
|
|
339
309
|
},
|
|
310
|
+
|
|
311
|
+
// layout (XLE/XLO)
|
|
312
|
+
{
|
|
313
|
+
value: 'layout.expand',
|
|
314
|
+
description:
|
|
315
|
+
'The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, and written (the output path, or null when nothing was written).',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
value: 'layout.check',
|
|
319
|
+
description:
|
|
320
|
+
'The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline).',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
value: 'layout.grammar',
|
|
324
|
+
description:
|
|
325
|
+
"The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry.",
|
|
326
|
+
},
|
|
340
327
|
],
|
|
341
328
|
};
|
|
@@ -53,29 +53,6 @@ function expectNamed(type, fields) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
describe('response-types EnumDoc names every field', () => {
|
|
56
|
-
it('component.batch names every row field and state', async () => {
|
|
57
|
-
const res = await data(['component', 'Button', 'Badge']);
|
|
58
|
-
expect(res.type).toBe('component.batch');
|
|
59
|
-
expect(describedAs('component.batch')).toMatch(/BatchResponse.*BatchRow/);
|
|
60
|
-
expectNamed('component.batch', [
|
|
61
|
-
'count',
|
|
62
|
-
'results',
|
|
63
|
-
'selector',
|
|
64
|
-
'status',
|
|
65
|
-
'result',
|
|
66
|
-
'code',
|
|
67
|
-
'error',
|
|
68
|
-
'candidates',
|
|
69
|
-
'package',
|
|
70
|
-
'component',
|
|
71
|
-
'kind',
|
|
72
|
-
'installed',
|
|
73
|
-
'suggestions',
|
|
74
|
-
'name',
|
|
75
|
-
'reason',
|
|
76
|
-
]);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
56
|
it('component.detail: the ownership fields and parentDoc', async () => {
|
|
80
57
|
const res = await data(['component', 'HStack']);
|
|
81
58
|
expect(res.type).toBe('component.detail');
|