@astryxdesign/cli 0.7.3 → 0.7.4-canary.1a552f2
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 +63 -63
- package/api/component/_adapter.mjs +4 -3
- package/api/component/component.mjs +13 -6
- package/api/component/doc-links.test.mjs +33 -0
- package/api/discover/_adapter.mjs +22 -10
- package/api/discover/_catalog-view.d.mts +2 -0
- package/api/discover/_catalog-view.mjs +1 -0
- package/api/discover/_catalog-view.test.mjs +1 -0
- package/api/discover/detail/detail.mjs +1 -0
- package/api/discover/detail/detail.test.mjs +3 -0
- package/api/discover/detail/doc/doc.mjs +5 -1
- package/api/discover/detail/doc/doc.test.mjs +1 -0
- package/api/discover/detail/item/item.mjs +2 -0
- package/api/discover/detail/item/item.test.mjs +2 -0
- package/api/discover/discover.doc.mjs +4 -4
- package/api/discover/discover.type.d.mts +20 -0
- package/api/discover/discover.type.mjs +5 -0
- package/api/discover/list/list.test.mjs +2 -0
- package/api/discover/search/search.d.mts +3 -2
- package/api/discover/search/search.mjs +26 -7
- package/api/discover/search/search.test.mjs +67 -0
- package/api/docs/_adapter.d.mts +80 -0
- package/api/docs/_adapter.mjs +261 -11
- package/api/docs/detail/detail.mjs +8 -0
- package/api/docs/docOverlays.test.mjs +2 -1
- package/api/docs/docs.d.mts +16 -6
- package/api/docs/docs.doc.mjs +1 -1
- package/api/docs/docs.mjs +55 -6
- package/api/docs/docs.type.d.mts +28 -2
- package/api/docs/docs.type.mjs +13 -3
- package/api/docs/guide-route-targets.test.mjs +1002 -0
- package/api/docs/index/index.mjs +9 -0
- package/api/docs/integration-tree.test.mjs +22 -0
- package/api/docs/integrationDocs.test.mjs +85 -0
- package/api/docs/list/list.mjs +7 -1
- package/api/docs/node/node.mjs +9 -1
- package/api/docs/reference-blocks.test.mjs +1 -1
- package/api/doctor/_adapter.d.mts +40 -0
- package/api/doctor/_adapter.mjs +171 -1
- package/api/doctor/built-checks.d.mts +85 -0
- package/api/doctor/built-checks.mjs +837 -0
- package/api/doctor/built-checks.test.mjs +531 -0
- package/api/doctor/doctor.d.mts +6 -5
- package/api/doctor/doctor.doc.mjs +11 -1
- package/api/doctor/doctor.mjs +18 -3
- package/api/doctor/doctor.type.d.mts +6 -0
- package/api/doctor/doctor.type.mjs +3 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/integration/_adapter.d.mts +11 -2
- package/api/integration/_adapter.mjs +30 -4
- package/api/integration/authoring-checks.mjs +29 -2
- package/api/integration/authoring-checks.test.mjs +131 -1
- package/api/integration/check/check.d.mts +4 -1
- package/api/integration/check/check.mjs +34 -4
- package/api/integration/check/check.test.mjs +49 -0
- package/api/integration/integration-check.type.d.mts +8 -0
- package/api/integration/integration-check.type.mjs +4 -1
- package/api/integration/integrationCheck.doc.mjs +8 -1
- package/api/integration/integrationDocConflicts.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +71 -2
- package/api/integration/pack-check.test.mjs +77 -0
- package/api/integration/validate-integration-case-disk.test.mjs +2 -0
- package/api/integration/validate-integration-gaps.test.mjs +7 -4
- package/api/integration/validate-integration.mjs +96 -14
- package/api/integration/validate-integration.type.d.mts +10 -4
- package/api/integration/validate-integration.type.mjs +10 -5
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_candidate-score.d.mts +3 -2
- package/api/search/_candidate-score.mjs +66 -3
- package/api/search/_gather-docs.mjs +12 -2
- package/api/search/_priority.mjs +2 -1
- package/api/search/_score.d.mts +2 -1
- package/api/search/_score.mjs +2 -2
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.family-members.test.mjs +124 -0
- package/api/search/search.mjs +28 -0
- package/api/theme/palette/generate/generate.d.mts +8 -0
- package/api/theme/palette/generate/generate.mjs +38 -11
- package/api/theme/palette/generate/generate.test.mjs +83 -4
- package/api/theme/palette/generate/generator.d.mts +6 -0
- package/api/theme/palette/generate/generator.mjs +6 -0
- package/api/theme/theme.type.d.mts +12 -1
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeTargets.doc.mjs +1 -1
- package/assets/discover/official-packages.json +16 -0
- package/assets/docs/author-a-theme.doc.mjs +15 -15
- package/assets/docs/browser-support.doc.mjs +1 -1
- package/assets/docs/getting-started.doc.mjs +16 -16
- package/assets/docs/is-my-code-good.doc.mjs +6 -6
- package/assets/docs/styling-overview.doc.mjs +5 -5
- package/assets/docs/theme.doc.mjs +5 -5
- package/assets/docs/tree/add-a-component.doc.mjs +1 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
- package/assets/docs/tree/add-a-topic.doc.mjs +6 -6
- package/assets/docs/tree/agent-guidance.doc.mjs +5 -5
- package/assets/docs/tree/authoring.doc.mjs +2 -2
- package/assets/docs/tree/block-template.doc.mjs +1 -1
- package/assets/docs/tree/check-the-props.doc.mjs +3 -3
- package/assets/docs/tree/check-your-docs.doc.mjs +6 -6
- package/assets/docs/tree/checks.doc.mjs +11 -11
- package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +6 -6
- package/assets/docs/tree/codemods.doc.mjs +7 -7
- package/assets/docs/tree/component-family.doc.mjs +1 -1
- package/assets/docs/tree/component-imports.doc.mjs +2 -2
- package/assets/docs/tree/component-lookups.doc.mjs +6 -5
- package/assets/docs/tree/computer-agent-guide.doc.mjs +7 -7
- package/assets/docs/tree/computer-integrations.doc.mjs +5 -5
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +3 -3
- 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/doc-syntax.doc.mjs +219 -0
- package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
- package/assets/docs/tree/extend-or-replace.doc.mjs +39 -7
- package/assets/docs/tree/font-setup.doc.mjs +1 -1
- package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
- package/assets/docs/tree/global-integrations.doc.mjs +11 -11
- package/assets/docs/tree/global.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +1 -1
- package/assets/docs/tree/install-once.doc.mjs +4 -4
- package/assets/docs/tree/layout.doc.mjs +1 -1
- package/assets/docs/tree/links.doc.mjs +2 -2
- package/assets/docs/tree/migration-setup.doc.mjs +15 -15
- package/assets/docs/tree/migration.doc.mjs +2 -1
- package/assets/docs/tree/other-libraries.doc.mjs +1 -1
- package/assets/docs/tree/page-template.doc.mjs +2 -2
- package/assets/docs/tree/problems.doc.mjs +8 -8
- package/assets/docs/tree/project-global-or-both.doc.mjs +2 -2
- package/assets/docs/tree/publishing.doc.mjs +7 -7
- package/assets/docs/tree/quick-start.doc.mjs +9 -9
- package/assets/docs/tree/reference.doc.mjs +2 -2
- package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
- package/assets/docs/tree/scaffold.doc.mjs +1 -1
- package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +3 -3
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/single-component.doc.mjs +4 -4
- package/assets/docs/tree/start-a-template.doc.mjs +5 -5
- package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
- package/assets/docs/tree/styling-libraries.doc.mjs +2 -1
- package/assets/docs/tree/styling.doc.mjs +1 -1
- package/assets/docs/tree/tailwind.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +5 -5
- package/assets/docs/tree/test-template-in-app.doc.mjs +6 -6
- package/assets/docs/tree/tokens-and-setup.doc.mjs +1 -1
- package/assets/docs/tree/troubleshooting.doc.mjs +24 -20
- package/assets/docs/tree/uninstall.doc.mjs +2 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/upgrading.doc.mjs +3 -3
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +3 -3
- package/assets/docs/tree/versioning.doc.mjs +4 -4
- package/assets/docs/tree/who-answers.doc.mjs +4 -4
- package/assets/docs/tree/write-the-template-file.doc.mjs +4 -4
- package/assets/docs/use-a-theme.doc.mjs +10 -10
- package/assets/docs/use-integrations.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +15 -15
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +1 -1
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +54 -0
- package/assets/templates/themes/butter/butterPalettes.generated.receipt.json +1499 -0
- package/assets/templates/themes/butter/butterPalettes.generated.ts +550 -0
- package/assets/templates/themes/butter/butterTheme.ts +274 -234
- package/assets/templates/themes/butter/palette.config.json +484 -0
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +41 -0
- package/assets/templates/themes/gothic/gothicPalettes.generated.receipt.json +979 -0
- package/assets/templates/themes/gothic/gothicPalettes.generated.ts +271 -0
- package/assets/templates/themes/gothic/gothicTheme.ts +130 -160
- package/assets/templates/themes/gothic/palette.config.json +371 -0
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +51 -0
- package/assets/templates/themes/matcha/matchaPalettes.generated.receipt.json +1502 -0
- package/assets/templates/themes/matcha/matchaPalettes.generated.ts +501 -0
- package/assets/templates/themes/matcha/matchaPalettes.ts +21 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +164 -103
- package/assets/templates/themes/matcha/palette.config.json +448 -0
- package/assets/templates/themes/stone/palette.config.json +262 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +51 -0
- package/assets/templates/themes/stone/stonePalettes.generated.receipt.json +840 -0
- package/assets/templates/themes/stone/stonePalettes.generated.ts +501 -0
- package/assets/templates/themes/stone/stoneTheme.ts +190 -207
- package/assets/templates/themes/y2k/palette.config.json +166 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +54 -0
- package/assets/templates/themes/y2k/y2kPalettes.generated.receipt.json +872 -0
- package/assets/templates/themes/y2k/y2kPalettes.generated.ts +550 -0
- package/assets/templates/themes/y2k/y2kPalettes.ts +257 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +164 -391
- package/authoring/codemod/codemod.doc.mjs +1 -1
- package/authoring/config/config.doc.mjs +4 -4
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/discover/discover.doc.mjs +1 -1
- package/authoring/doctypes/_schema.d.mts +4 -0
- package/authoring/doctypes/_schema.mjs +4 -0
- package/authoring/doctypes/reference/type.ts +14 -2
- package/authoring/gap-report/gap-report.doc.mjs +1 -1
- package/authoring/integration/integration.doc.mjs +6 -6
- package/clients/cli/commands/discover.mjs +1 -1
- package/clients/cli/commands/discover.sources.test.mjs +6 -0
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +27 -2
- package/clients/cli/commands/docs.test.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
- package/clients/cli/commands/doctor.doc.mjs +13 -1
- package/clients/cli/commands/doctor.mjs +25 -9
- package/clients/cli/commands/integration-check.doc.mjs +11 -0
- package/clients/cli/commands/integration-check.test.mjs +36 -3
- package/clients/cli/commands/integration-pack.doc.mjs +1 -1
- package/clients/cli/commands/integration-verify.doc.mjs +1 -1
- package/clients/cli/commands/integration.mjs +15 -3
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +2 -2
- package/clients/cli/lib/define-command.mjs +5 -3
- package/foundation/agent-docs/agent-docs.d.mts +14 -2
- package/foundation/agent-docs/agent-docs.mjs +65 -4
- package/foundation/agent-docs/agent-docs.test.mjs +107 -0
- package/foundation/discovery/docs-discovery.d.mts +93 -2
- package/foundation/discovery/docs-discovery.mjs +237 -8
- package/foundation/discovery/runner-allowlist.d.mts +2 -0
- package/foundation/discovery/runner-allowlist.mjs +4 -0
- package/foundation/discovery/runner-commands.d.mts +29 -13
- package/foundation/discovery/runner-commands.mjs +253 -17
- package/foundation/discovery/stray-pointers.mjs +11 -5
- package/foundation/discovery/stray-pointers.test.mjs +6 -0
- package/foundation/doc-compiler/compile.mjs +8 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +3 -0
- package/foundation/doc-compiler/doc-syntax.d.mts +194 -0
- package/foundation/doc-compiler/doc-syntax.mjs +739 -0
- package/foundation/doc-compiler/doc-syntax.test.mjs +383 -0
- package/foundation/doc-compiler/links.d.mts +13 -16
- package/foundation/doc-compiler/links.mjs +40 -7
- package/foundation/doc-compiler/tree.d.mts +5 -0
- package/foundation/doc-compiler/tree.mjs +9 -0
- package/foundation/env/package-manager.d.mts +18 -0
- package/foundation/env/package-manager.mjs +40 -0
- package/foundation/integrations/cli-requirement.d.mts +29 -0
- package/foundation/integrations/cli-requirement.mjs +47 -0
- package/foundation/integrations/cli-requirement.test.mjs +23 -2
- package/foundation/response/error-codes.test.mjs +9 -0
- package/foundation/response/response-types.doc.mjs +11 -11
- package/foundation/response/response-types.doc.test.mjs +29 -0
- package/package.json +9 -9
|
@@ -76,7 +76,6 @@ declare const eventSchema: z.ZodObject<{
|
|
|
76
76
|
emptyResult: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
|
|
77
77
|
resultKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
78
78
|
command: "command";
|
|
79
|
-
none: "none";
|
|
80
79
|
component: "component";
|
|
81
80
|
hook: "hook";
|
|
82
81
|
theme: "theme";
|
|
@@ -85,6 +84,7 @@ declare const eventSchema: z.ZodObject<{
|
|
|
85
84
|
integration: "integration";
|
|
86
85
|
migration: "migration";
|
|
87
86
|
mixed: "mixed";
|
|
87
|
+
none: "none";
|
|
88
88
|
}>>>;
|
|
89
89
|
directMatch: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
|
|
90
90
|
stdout: z.ZodString;
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
displayName: 'DiscoverSource',
|
|
17
17
|
namespace: 'authoring',
|
|
18
18
|
description:
|
|
19
|
-
|
|
19
|
+
"A source for `{@command discover}`: an async function that returns a catalog of packages a project could add, their versions, and what each version adds. Set it as `discover` in astryx.config, or export it as `discover` from an integration manifest. Discover calls every source, the project one first, and then reads the official list the CLI carries; another source's entry for an official package is kept. A source that throws, runs past 30 seconds, or returns an invalid catalog never hides the others; discover then uses the last good answer that source gave for the same request, or reports the source as failed when it saved none. Discover only reads: it prints the command that adds a package and never runs it.",
|
|
20
20
|
appliesTo:
|
|
21
21
|
'`discover` in astryx.config.*, or the `discover` named export of astryx.integration.*',
|
|
22
22
|
fields: [
|
|
@@ -364,6 +364,8 @@ export const GenericDocKindSchema: z.ZodObject<{
|
|
|
364
364
|
full: "full";
|
|
365
365
|
}>>;
|
|
366
366
|
}, z.core.$strict>], "type">>;
|
|
367
|
+
before: z.ZodOptional<z.ZodString>;
|
|
368
|
+
after: z.ZodOptional<z.ZodString>;
|
|
367
369
|
previewType: z.ZodOptional<z.ZodEnum<{
|
|
368
370
|
swatch: "swatch";
|
|
369
371
|
"shadow-box": "shadow-box";
|
|
@@ -917,6 +919,8 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
917
919
|
full: "full";
|
|
918
920
|
}>>;
|
|
919
921
|
}, z.core.$strict>], "type">>;
|
|
922
|
+
before: z.ZodOptional<z.ZodString>;
|
|
923
|
+
after: z.ZodOptional<z.ZodString>;
|
|
920
924
|
previewType: z.ZodOptional<z.ZodEnum<{
|
|
921
925
|
swatch: "swatch";
|
|
922
926
|
"shadow-box": "shadow-box";
|
|
@@ -240,6 +240,10 @@ const ReferenceSectionSchema = z
|
|
|
240
240
|
title: nonEmptyString,
|
|
241
241
|
category: z.string().optional(),
|
|
242
242
|
content: z.array(SectionContentBlockSchema),
|
|
243
|
+
// Where an extension adds this section to the topic it extends: before
|
|
244
|
+
// or after the section with this key. Ignored on any other section.
|
|
245
|
+
before: nonEmptyString.optional(),
|
|
246
|
+
after: nonEmptyString.optional(),
|
|
243
247
|
previewType: z
|
|
244
248
|
.enum([
|
|
245
249
|
'swatch',
|
|
@@ -137,12 +137,16 @@ export interface ReferenceDoc extends AuthoredDocGraphFields {
|
|
|
137
137
|
* `replaces: 'getting-started'` on a doc named `getting-started` swaps the
|
|
138
138
|
* content, and on a doc named something else swaps it and leaves the old
|
|
139
139
|
* name as an alias, so `astryx docs getting-started` still resolves.
|
|
140
|
+
* A route (`'authoring/quick-start'`) names a guide the docs tree
|
|
141
|
+
* places: readers who open that route get this doc.
|
|
140
142
|
* Ignored on a built-in topic (there is nothing above it to replace). */
|
|
141
143
|
replaces?: string;
|
|
142
144
|
/** Name of an existing topic this doc merges onto, section by section: a
|
|
143
145
|
* section whose title matches one in the base replaces it, and a section
|
|
144
|
-
* the base does not have is
|
|
145
|
-
*
|
|
146
|
+
* the base does not have is added where its `before` or `after` says, else
|
|
147
|
+
* at the end. A route (`'authoring/quick-start'`) names a guide the
|
|
148
|
+
* docs tree places. For correcting or adding to a topic rather than owning
|
|
149
|
+
* it — `replaces` and `extends` are exclusive. */
|
|
146
150
|
extends?: string;
|
|
147
151
|
/** Ordered sections that make up the doc. */
|
|
148
152
|
sections: ReferenceSection[];
|
|
@@ -170,6 +174,14 @@ export interface ReferenceSection {
|
|
|
170
174
|
* `reference` block includes another doc from its canonical source, so a
|
|
171
175
|
* guide never copies a schema's fields or a command's options. */
|
|
172
176
|
content: (ReferenceContentBlock | ReferenceDocBlock)[];
|
|
177
|
+
/** In a doc that `extends` a topic, the key of the base section (as
|
|
178
|
+
* `astryx docs <topic> --index` shows it) to add this section before,
|
|
179
|
+
* when it replaces none. Set `before` or `after`, not both; with neither,
|
|
180
|
+
* the section is added at the end. Ignored on any other doc. */
|
|
181
|
+
before?: string;
|
|
182
|
+
/** In a doc that `extends` a topic, the key of the base section to add this
|
|
183
|
+
* section after, when it replaces none. */
|
|
184
|
+
after?: string;
|
|
173
185
|
/** Preview type for token tables in this section. When set, the docsite
|
|
174
186
|
* renders a visual preview column using the token's computed CSS value
|
|
175
187
|
* from the current theme. Omit for non-token sections. */
|
|
@@ -15,7 +15,7 @@ export const doc = {
|
|
|
15
15
|
displayName: 'GapReportHandler',
|
|
16
16
|
namespace: 'authoring',
|
|
17
17
|
description:
|
|
18
|
-
"A handler for `
|
|
18
|
+
"A handler for `{@command gap-report}`: a plain object with an `audience` and a `handle` function. Set it as `gapReport` in astryx.config, or export it as `gapReport` from an integration manifest. Handlers add up rather than replace each other: the project handler first, then each loaded integration's in load order (the `integrations` list, then autolinked ones), whichever package the report is about.",
|
|
19
19
|
appliesTo:
|
|
20
20
|
'`gapReport` in astryx.config.*, or the `gapReport` named export of astryx.integration.*',
|
|
21
21
|
fields: [
|
|
@@ -51,14 +51,14 @@ export const doc = {
|
|
|
51
51
|
name: 'docs',
|
|
52
52
|
type: 'string',
|
|
53
53
|
description:
|
|
54
|
-
'The folder that holds your doc topics, relative to package.json. Every {topic}.doc.{ts,mjs,js} under it shows up in `
|
|
54
|
+
'The folder that holds your doc topics, relative to package.json. Every {topic}.doc.{ts,mjs,js} under it shows up in `{@command docs}`: a flat topic next to the built-in topics, where it can set `replaces` or `extends` to take over a built-in topic or add to it, and a guide with `placement` at its own route in the docs tree, under a namespace doc of the same package.',
|
|
55
55
|
example: "'./docs'",
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
name: 'themes',
|
|
59
59
|
type: 'string',
|
|
60
60
|
description:
|
|
61
|
-
'The folder that holds your themes, relative to package.json, with one folder per theme. Each theme folder has the theme source and a matching .doc.mjs file with the same name. Installed themes show up in `
|
|
61
|
+
'The folder that holds your themes, relative to package.json, with one folder per theme. Each theme folder has the theme source and a matching .doc.mjs file with the same name. Installed themes show up in `{@command theme list}`; `theme add` imports their built package exports, and `theme eject` creates an editable local fork.',
|
|
62
62
|
example: "'./themes'",
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -72,7 +72,7 @@ export const doc = {
|
|
|
72
72
|
name: 'issuesUrl',
|
|
73
73
|
type: 'string',
|
|
74
74
|
description:
|
|
75
|
-
"Where people file issues for this package: an absolute URL, such as its GitHub issues page. A value that is not a URL fails the whole manifest; the scheme is not checked. Nothing warns when it is missing, but without it `
|
|
75
|
+
"Where people file issues for this package: an absolute URL, such as its GitHub issues page. A value that is not a URL fails the whole manifest; the scheme is not checked. Nothing warns when it is missing, but without it `{@command gap-report}` about this package fails unless the project or a loaded integration has a gapReport handler, and `{@command swizzle}` prints no feedback link for this package's components. When no handler is loaded, a github.com issues URL is filed with the GitHub CLI once the reporter passes `--confirm-public`; any other URL is returned for the reporter to open.",
|
|
76
76
|
example: "'https://github.com/acme/widgets/issues'",
|
|
77
77
|
},
|
|
78
78
|
{
|
|
@@ -86,7 +86,7 @@ export const doc = {
|
|
|
86
86
|
name: 'cliCommand',
|
|
87
87
|
type: 'string',
|
|
88
88
|
description:
|
|
89
|
-
'The command your users run the Astryx CLI with, when it is not their package manager, such as a wrapper your company ships. Every command the CLI prints in an app that loads your package starts with it, in place of `pnpm exec astryx` or `yarn astryx`: hints, errors, Doctor fixes, and doc text. One line, without a subcommand. If two loaded packages set different commands, neither is used and `
|
|
89
|
+
'The command your users run the Astryx CLI with, when it is not their package manager, such as a wrapper your company ships. Every command the CLI prints in an app that loads your package starts with it, in place of `pnpm exec astryx` or `yarn astryx`: hints, errors, Doctor fixes, and doc text. One line, without a subcommand. If two loaded packages set different commands, neither is used and `{@command doctor}` warns. An invalid value is ignored with an `invalid_cli_command` warning, and the rest of the manifest still loads. JSON output keeps commands bare.',
|
|
90
90
|
example: "'acme astryx'",
|
|
91
91
|
},
|
|
92
92
|
],
|
|
@@ -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 `
|
|
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 `{@command doctor}` warns in its `cli-command` check. See `{@command docs authoring/building-blocks/configuration/cli-command}`.",
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
type: 'prose',
|
|
@@ -140,7 +140,7 @@ export const doc = {
|
|
|
140
140
|
{
|
|
141
141
|
type: 'prose',
|
|
142
142
|
text:
|
|
143
|
-
'Validate the manifest with `
|
|
143
|
+
'Validate the manifest with `{@command doctor integration validate}`. At the ' +
|
|
144
144
|
'load boundary, a known field of the wrong type is an error, issuesUrl ' +
|
|
145
145
|
'and docsiteUrl must be valid URLs, and unknown fields become warnings so an older CLI ' +
|
|
146
146
|
'can still load the fields it understands. Before publishing, also run ' +
|
|
@@ -154,6 +154,7 @@ describe('astryx discover with a discover source', () => {
|
|
|
154
154
|
expect(meta.available.slice(official.length)).toEqual([
|
|
155
155
|
{
|
|
156
156
|
name: '@test/charts',
|
|
157
|
+
package: '@test/charts',
|
|
157
158
|
components: ['Chart'],
|
|
158
159
|
version: '2.0.0',
|
|
159
160
|
templates: ['pages/Report'],
|
|
@@ -162,6 +163,7 @@ describe('astryx discover with a discover source', () => {
|
|
|
162
163
|
},
|
|
163
164
|
{
|
|
164
165
|
name: '@test/boards',
|
|
166
|
+
package: '@test/boards',
|
|
165
167
|
components: [],
|
|
166
168
|
version: '1.0.0',
|
|
167
169
|
templates: ['pages/DialBoard'],
|
|
@@ -269,6 +271,10 @@ describe('astryx discover with a discover source', () => {
|
|
|
269
271
|
cwd: project,
|
|
270
272
|
});
|
|
271
273
|
expect(JSON.parse(opened.stdout).type).toBe('discover.detail.doc');
|
|
274
|
+
|
|
275
|
+
// Text mode names the package on stdout, so a pipe keeps it.
|
|
276
|
+
const text = await runCli(['discover', '@test/kit/Dial'], {cwd: project});
|
|
277
|
+
expect(text.stdout).toMatch(/package: @test\/kit/);
|
|
272
278
|
});
|
|
273
279
|
|
|
274
280
|
it('saves the answer in the user cache and writes nothing into the project', async () => {
|
|
@@ -23,7 +23,7 @@ export const doc = {
|
|
|
23
23
|
'opens a node of the docs tree: `cli` lists its guides and reference, ' +
|
|
24
24
|
'`cli/api/functions` lists every API function, and `cli/api/functions/search` prints ' +
|
|
25
25
|
'one. A namespace plus a section prints that section from the one guide below it ' +
|
|
26
|
-
'that has it (`
|
|
26
|
+
'that has it (`{@command docs layout side-panels}`). `--depth` reads as far down the tree as you ask, from the doc alone (0) to ' +
|
|
27
27
|
'everything below it (all), and with it `--detail` sets how much of each doc below ' +
|
|
28
28
|
'shows: one line (brief, the default), its sections (compact), or all of it (full).',
|
|
29
29
|
fn: 'docs',
|
|
@@ -431,6 +431,29 @@ function linkLines(links) {
|
|
|
431
431
|
];
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
+
/**
|
|
435
|
+
* A section title naming the package that wrote it, once: a title an author
|
|
436
|
+
* already ended with that package keeps its own.
|
|
437
|
+
* @param {string} title
|
|
438
|
+
* @param {string} pkg
|
|
439
|
+
* @returns {string}
|
|
440
|
+
*/
|
|
441
|
+
function titledWithPackage(title, pkg) {
|
|
442
|
+
const label = `(${pkg})`;
|
|
443
|
+
return title.endsWith(label) ? title : `${title} ${label}`;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* What a topic or guide took the place of, and whose it was, as the line
|
|
448
|
+
* read right after its `package:` line (INV28); nothing for any other read.
|
|
449
|
+
* @param {{replaces?: string, replacedPackage?: string}} data
|
|
450
|
+
* @returns {ReturnType<typeof text>[]}
|
|
451
|
+
*/
|
|
452
|
+
function replacedLine(data) {
|
|
453
|
+
if (data.replaces == null || data.replacedPackage == null) return [];
|
|
454
|
+
return [text(`replaces ${data.replacedPackage}'s ${data.replaces}`)];
|
|
455
|
+
}
|
|
456
|
+
|
|
434
457
|
/**
|
|
435
458
|
* A topic's section index: what the topic is, one line per section with the
|
|
436
459
|
* key to read it by, and how to read further.
|
|
@@ -445,6 +468,7 @@ function emitIndex(index, owner, run) {
|
|
|
445
468
|
index.description ? wrapText(index.description) : undefined,
|
|
446
469
|
),
|
|
447
470
|
record({package: owner}),
|
|
471
|
+
...replacedLine(index),
|
|
448
472
|
// Summaries wrap rather than being cut: the summary is how a reader picks
|
|
449
473
|
// the one section to open. A section another package wrote says which one.
|
|
450
474
|
records(
|
|
@@ -452,7 +476,7 @@ function emitIndex(index, owner, run) {
|
|
|
452
476
|
const shown = {...s, summary: prefixCliCommands(s.summary ?? '', run)};
|
|
453
477
|
return s.package === owner
|
|
454
478
|
? shown
|
|
455
|
-
: {...shown, title:
|
|
479
|
+
: {...shown, title: titledWithPackage(s.title, s.package)};
|
|
456
480
|
}),
|
|
457
481
|
{
|
|
458
482
|
fields: ['id', 'title', 'summary'],
|
|
@@ -717,6 +741,7 @@ export function registerDocs(program) {
|
|
|
717
741
|
const owner = result.package;
|
|
718
742
|
emit(
|
|
719
743
|
record({package: owner}),
|
|
744
|
+
...replacedLine(result.data),
|
|
720
745
|
code(
|
|
721
746
|
formatReferenceFull(
|
|
722
747
|
{
|
|
@@ -725,7 +750,7 @@ export function registerDocs(program) {
|
|
|
725
750
|
sections: result.data.sections.map(s =>
|
|
726
751
|
s.package === owner
|
|
727
752
|
? s
|
|
728
|
-
: {...s, title:
|
|
753
|
+
: {...s, title: titledWithPackage(s.title, s.package)},
|
|
729
754
|
),
|
|
730
755
|
},
|
|
731
756
|
detail,
|
|
@@ -97,7 +97,7 @@ describe('migration docs', () => {
|
|
|
97
97
|
await program.parseAsync(['node', 'astryx', 'docs', 'migration']);
|
|
98
98
|
|
|
99
99
|
const output = console.log.mock.calls.map(c => c[0]).join('\n');
|
|
100
|
-
expect(output).toContain('Migration
|
|
100
|
+
expect(output).toContain('Migration');
|
|
101
101
|
expect(output).toContain('migration');
|
|
102
102
|
});
|
|
103
103
|
});
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
'and fails until the author declares the relationship or renames it. ' +
|
|
18
18
|
'It also lists each pair of topics (two of the package, or one of them and a Core topic other than the one it replaces) ' +
|
|
19
19
|
'that repeat 10 or more words of prose word for word, each padding phrase and low-density topic, ' +
|
|
20
|
-
'and each written `
|
|
20
|
+
'and each written `{@command docs <name>}` that should be a link, ' +
|
|
21
21
|
'each as a warning (`copied_passage`, `doc_fluff`, `stray_doc_pointer`; exit 0, and `integration check --strict` fails on it). See {@link generic:check-your-docs}.',
|
|
22
22
|
fn: 'integrationDocConflicts',
|
|
23
23
|
args: [
|
|
@@ -21,13 +21,25 @@ export const doc = {
|
|
|
21
21
|
"the docs the CLI reads, the newest release the computer knows of, with the install and upgrade commands when the project's release is older, and every `astryx` command on the search path, warning when the first one is not the Astryx CLI or predates the hand-off. It writes nothing, but loading astryx.config runs that file's code. " +
|
|
22
22
|
'The `integration` subcommands provide authoring checks for one integration package. ' +
|
|
23
23
|
'Outside a project it checks the computer instead: the Node version, the release that answered, ' +
|
|
24
|
-
"the newest release this computer knows of, with the command that upgrades the CLI installed for the computer when it is older, the astryx commands on the search path, the integrations installed for the computer (warning about one it skips), and whether the computer-level agent text (`
|
|
24
|
+
"the newest release this computer knows of, with the command that upgrades the CLI installed for the computer when it is older, the astryx commands on the search path, the integrations installed for the computer (warning about one it skips), and whether the computer-level agent text (`{@command init --user}`) is present, matches this release, was edited, or is turned off (info only); when that text names `astryx` and no `astryx` command is on the search path, apart from a package runner's own copy, it says so and names the install step the text records, or npm's when it records none. " +
|
|
25
25
|
'It never fails a check because the folder has no project.',
|
|
26
26
|
fn: 'doctor',
|
|
27
27
|
subcommands: ['integration'],
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
flag: '--built <path>',
|
|
31
|
+
param: 'options.built',
|
|
32
|
+
description:
|
|
33
|
+
'Also check a finished build before you deliver it: a project folder, a build output folder, or one built HTML file. Fails when it does not use Astryx at all, and warns with each raw element, icon or custom style in its source.',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
28
36
|
examples: [
|
|
29
37
|
{label: 'Run project diagnostics', cli: 'astryx doctor'},
|
|
30
38
|
{label: 'Machine-readable project report', cli: 'astryx doctor --json'},
|
|
39
|
+
{
|
|
40
|
+
label: 'Before you deliver a build: check that it uses Astryx',
|
|
41
|
+
cli: 'astryx doctor --built dist',
|
|
42
|
+
},
|
|
31
43
|
{
|
|
32
44
|
label: 'Validate an integration',
|
|
33
45
|
cli: 'astryx doctor integration validate @acme/widgets',
|
|
@@ -225,7 +225,8 @@ function printIntegrationValidation(data) {
|
|
|
225
225
|
]
|
|
226
226
|
: [text('[ok] No integration issues found.')]),
|
|
227
227
|
...(data.notes ?? []).map(note =>
|
|
228
|
-
|
|
228
|
+
// A note marked next fails --strict from the next minor release.
|
|
229
|
+
text(`note (${note.code}): ${note.next ? '[next minor] ' : ''}${note.message}`),
|
|
229
230
|
),
|
|
230
231
|
text(
|
|
231
232
|
`Summary: ${errors} error${errors === 1 ? '' : 's'}, ` +
|
|
@@ -563,9 +564,14 @@ export function printIntegrationCheckResponse(response) {
|
|
|
563
564
|
}
|
|
564
565
|
}
|
|
565
566
|
|
|
566
|
-
/**
|
|
567
|
-
|
|
568
|
-
|
|
567
|
+
/**
|
|
568
|
+
* @param {import('commander').Command} program
|
|
569
|
+
* @param {{built?: string}} [options]
|
|
570
|
+
*/
|
|
571
|
+
async function runProjectDoctor(program, options = {}) {
|
|
572
|
+
const report = await runChecks(
|
|
573
|
+
options.built != null ? {built: options.built} : {},
|
|
574
|
+
);
|
|
569
575
|
if (program.opts().json) jsonOut({type: 'doctor', data: report});
|
|
570
576
|
else printHuman(report);
|
|
571
577
|
if (report.summary.fail > 0) process.exitCode = 1;
|
|
@@ -689,7 +695,7 @@ export function registerDoctor(program) {
|
|
|
689
695
|
action: async (options, invoked) => {
|
|
690
696
|
const word = unknownWord(invoked);
|
|
691
697
|
if (word != null) return unknownSubcommand(doctorCmd, 'doctor', word);
|
|
692
|
-
return runProjectDoctor(program);
|
|
698
|
+
return runProjectDoctor(program, options);
|
|
693
699
|
},
|
|
694
700
|
});
|
|
695
701
|
/** @type {import('commander').Command} */
|
|
@@ -704,20 +710,30 @@ export function registerDoctor(program) {
|
|
|
704
710
|
return NO_RESULT_SET;
|
|
705
711
|
},
|
|
706
712
|
});
|
|
713
|
+
// `--built` checks a project's build; an integration check has none.
|
|
714
|
+
const refuseBuilt = () =>
|
|
715
|
+
doctorCmd.opts().built != null
|
|
716
|
+
? cliError(
|
|
717
|
+
'`--built` checks a finished build and goes with `doctor` alone, not with a `doctor integration` check',
|
|
718
|
+
{code: ERROR_CODES.ERR_INVALID_OPTION},
|
|
719
|
+
)
|
|
720
|
+
: null;
|
|
707
721
|
defineCommand(integrationCmd, doctorIntegrationValidateCommand, {
|
|
708
722
|
fn: validateIntegrationFn,
|
|
709
|
-
action: async pkg => runIntegrationValidation(program, pkg),
|
|
723
|
+
action: async pkg => refuseBuilt() ?? runIntegrationValidation(program, pkg),
|
|
710
724
|
});
|
|
711
725
|
defineCommand(integrationCmd, doctorIntegrationTemplatesCommand, {
|
|
712
726
|
fn: integrationTemplateConflictsFn,
|
|
713
|
-
action: async pkg =>
|
|
727
|
+
action: async pkg =>
|
|
728
|
+
refuseBuilt() ?? runAuthoringCheck(program, pkg, 'templates'),
|
|
714
729
|
});
|
|
715
730
|
defineCommand(integrationCmd, doctorIntegrationComponentsCommand, {
|
|
716
731
|
fn: integrationComponentConflictsFn,
|
|
717
|
-
action: async pkg =>
|
|
732
|
+
action: async pkg =>
|
|
733
|
+
refuseBuilt() ?? runAuthoringCheck(program, pkg, 'components'),
|
|
718
734
|
});
|
|
719
735
|
defineCommand(integrationCmd, doctorIntegrationDocsCommand, {
|
|
720
736
|
fn: integrationDocConflictsFn,
|
|
721
|
-
action: async pkg => runAuthoringCheck(program, pkg, 'docs'),
|
|
737
|
+
action: async pkg => refuseBuilt() ?? runAuthoringCheck(program, pkg, 'docs'),
|
|
722
738
|
});
|
|
723
739
|
}
|
|
@@ -45,6 +45,12 @@ export const doc = {
|
|
|
45
45
|
description:
|
|
46
46
|
'Also exit 1 on any warning and on any check that did not run. A new check or failure code joins only in a minor release, named in the release notes; until then, a malformed `cliCommand` is reported as a note (`invalid_cli_command`) that fails nothing.',
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
flag: '--next',
|
|
50
|
+
param: 'options.next',
|
|
51
|
+
description:
|
|
52
|
+
'Also count the findings the next minor release turns into warnings (the notes marked `next`) as warnings now, so `--strict --next` fails on them. Run it to fix them ahead of the release; every run says how many there are.',
|
|
53
|
+
},
|
|
48
54
|
],
|
|
49
55
|
examples: [
|
|
50
56
|
{
|
|
@@ -56,6 +62,11 @@ export const doc = {
|
|
|
56
62
|
label: 'Errors only, while you fix the warnings a package already has',
|
|
57
63
|
cli: 'integration check',
|
|
58
64
|
},
|
|
65
|
+
{
|
|
66
|
+
label:
|
|
67
|
+
'Fix ahead: fail on the findings the next minor release will fail on',
|
|
68
|
+
cli: 'integration check --strict --next',
|
|
69
|
+
},
|
|
59
70
|
{
|
|
60
71
|
label: 'Read the result as JSON',
|
|
61
72
|
cli: 'integration check --strict --json',
|
|
@@ -289,7 +289,7 @@ describe('astryx integration check', () => {
|
|
|
289
289
|
'invalid_cli_command',
|
|
290
290
|
);
|
|
291
291
|
expect(validate.notes).toEqual([
|
|
292
|
-
{code: 'invalid_cli_command', message: expect.any(String)},
|
|
292
|
+
{code: 'invalid_cli_command', message: expect.any(String), next: true},
|
|
293
293
|
]);
|
|
294
294
|
expect(envelope.data.failed).toBe(false);
|
|
295
295
|
expect(json.status).toBe(0);
|
|
@@ -302,6 +302,39 @@ describe('astryx integration check', () => {
|
|
|
302
302
|
).toHaveLength(1);
|
|
303
303
|
});
|
|
304
304
|
|
|
305
|
+
it('--next counts next notes as warnings, and --strict --next fails on them', async () => {
|
|
306
|
+
writePackage({
|
|
307
|
+
id: 'acme-next-fixture',
|
|
308
|
+
extraManifest: ", cliCommand: ' acme astryx\\n'",
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
const plain = JSON.parse(
|
|
312
|
+
(await runCli(['--json', 'integration', 'check'], tmpDir)).stdout,
|
|
313
|
+
).data;
|
|
314
|
+
expect(plain).toMatchObject({next: false, upcoming: 1, warnings: 0});
|
|
315
|
+
|
|
316
|
+
const next = await runCli(['--json', 'integration', 'check', '--next'], tmpDir);
|
|
317
|
+
const nextData = JSON.parse(next.stdout).data;
|
|
318
|
+
expect(nextData).toMatchObject({next: true, upcoming: 1, warnings: 1, failed: false});
|
|
319
|
+
expect(nextData.checks[0].warnings).toBe(1);
|
|
320
|
+
expect(next.status).toBe(0);
|
|
321
|
+
|
|
322
|
+
const strict = await runCli(
|
|
323
|
+
['--json', 'integration', 'check', '--strict', '--next'],
|
|
324
|
+
tmpDir,
|
|
325
|
+
);
|
|
326
|
+
const strictData = JSON.parse(strict.stdout).data;
|
|
327
|
+
expect(strictData.failed).toBe(true);
|
|
328
|
+
expect(strictData.failures).toContainEqual(
|
|
329
|
+
expect.objectContaining({check: 'validate', code: 'invalid_cli_command'}),
|
|
330
|
+
);
|
|
331
|
+
expect(strict.status).toBe(1);
|
|
332
|
+
|
|
333
|
+
const text = await runCli(['integration', 'check', '--next'], tmpDir);
|
|
334
|
+
expect(text.stdout).toContain('note (invalid_cli_command): [next minor] ');
|
|
335
|
+
expect(text.stdout).toContain('(next)');
|
|
336
|
+
});
|
|
337
|
+
|
|
305
338
|
it('takes no package name: one passed is an error, not a check of the current folder', async () => {
|
|
306
339
|
writePackage({id: 'acme-page'});
|
|
307
340
|
|
|
@@ -470,9 +503,9 @@ describe('a command written with a runner', () => {
|
|
|
470
503
|
const doctor = await runCli(['doctor', 'integration', 'validate'], tmpDir);
|
|
471
504
|
expect(doctor.status).toBe(0);
|
|
472
505
|
expect(doctor.stdout).toContain(
|
|
473
|
-
'note (runner_command): docs/acme-setup.doc.mjs:',
|
|
506
|
+
'note (runner_command): [next minor] docs/acme-setup.doc.mjs:',
|
|
474
507
|
);
|
|
475
|
-
expect(doctor.stdout).toContain('Write `
|
|
508
|
+
expect(doctor.stdout).toContain('Write the token `{@command doctor}`');
|
|
476
509
|
|
|
477
510
|
const strict = await runCli(
|
|
478
511
|
['--json', 'integration', 'check', '--strict'],
|
|
@@ -8,7 +8,7 @@ export const doc = {
|
|
|
8
8
|
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Deprecated: the old name of `integration verify`',
|
|
10
10
|
description:
|
|
11
|
-
'`
|
|
11
|
+
'`{@command integration pack --check}` is the name this check had before {@link command:integration verify}. It still runs the same check, with the same output, JSON, and exit codes, and prints a note that names `integration verify`. It will be removed in a later release. Outside a package it writes nothing and reports one failed check, no_package, naming the integration package it needs (exit 1).',
|
|
12
12
|
fn: 'integrationPackCheck',
|
|
13
13
|
options: [
|
|
14
14
|
{
|
|
@@ -8,7 +8,7 @@ export const doc = {
|
|
|
8
8
|
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Check the package the way npm will publish it, before you publish',
|
|
10
10
|
description:
|
|
11
|
-
'Packs the package with npm, unpacks the tarball into a temporary app without installing its dependencies, and checks that the app sees the same components, templates, themes, docs, and codemods as the package, that every public import resolves, and that the package declares a CLI new enough to read it. It publishes nothing and leaves no tarball behind. It runs the package\'s own pack lifecycle scripts, as `npm pack` does. Outside a package it writes nothing and reports one failed check, no_package, naming the integration package it needs (exit 1).',
|
|
11
|
+
'Packs the package with npm, unpacks the tarball into a temporary app without installing its dependencies, and checks that the app sees the same components, templates, themes, docs, and codemods as the package, that every public import resolves, and that the package declares a CLI new enough to read it. It publishes nothing and leaves no tarball behind. It runs the package\'s own pack lifecycle scripts, as `{@pm-only npm "the tarball the registry receives" pack}` does. Outside a package it writes nothing and reports one failed check, no_package, naming the integration package it needs (exit 1).',
|
|
12
12
|
fn: 'integrationPackCheck',
|
|
13
13
|
examples: [
|
|
14
14
|
{label: 'Check before publishing', cli: 'astryx integration verify'},
|
|
@@ -104,10 +104,13 @@ async function verifyPackage(program) {
|
|
|
104
104
|
* it, then one summary: each check's errors, warnings and skipped work, and
|
|
105
105
|
* what decided the exit code.
|
|
106
106
|
* @param {import('commander').Command} program
|
|
107
|
-
* @param {{strict?: boolean}} options
|
|
107
|
+
* @param {{strict?: boolean, next?: boolean}} options
|
|
108
108
|
*/
|
|
109
109
|
async function checkPackage(program, options) {
|
|
110
|
-
const result = await integrationCheck({
|
|
110
|
+
const result = await integrationCheck({
|
|
111
|
+
strict: options.strict === true,
|
|
112
|
+
next: options.next === true,
|
|
113
|
+
});
|
|
111
114
|
if (program.opts().json) {
|
|
112
115
|
jsonOut(result);
|
|
113
116
|
} else {
|
|
@@ -182,12 +185,21 @@ async function checkPackage(program, options) {
|
|
|
182
185
|
]
|
|
183
186
|
: []),
|
|
184
187
|
section(
|
|
185
|
-
`Integration check: ${identity ?? '(local package)'}${data.strict ? ' (strict)' : ''}`,
|
|
188
|
+
`Integration check: ${identity ?? '(local package)'}${data.strict ? ' (strict)' : ''}${data.next ? ' (next)' : ''}`,
|
|
186
189
|
),
|
|
187
190
|
records(data.checks, {
|
|
188
191
|
fields: ['check', 'failed', 'errors', 'warnings', 'skipped'],
|
|
189
192
|
}),
|
|
190
193
|
text(closing),
|
|
194
|
+
// Every build runs this check, so this is where a package learns what
|
|
195
|
+
// the next minor release will fail.
|
|
196
|
+
...(data.upcoming > 0 && !data.next
|
|
197
|
+
? [
|
|
198
|
+
text(
|
|
199
|
+
`${plural(data.upcoming, 'finding')} above (the notes) will fail --strict from the next minor release. Fix ${data.upcoming === 1 ? 'it' : 'them'} ahead: ${formatCliCommand('astryx integration check --strict --next')}`,
|
|
200
|
+
),
|
|
201
|
+
]
|
|
202
|
+
: []),
|
|
191
203
|
);
|
|
192
204
|
}
|
|
193
205
|
if (result.data.failed) process.exitCode = 1;
|
|
@@ -19,7 +19,7 @@ export const doc = {
|
|
|
19
19
|
'Prints every `defineTheme` components key across the system: the stable class it paints, ' +
|
|
20
20
|
'the component that declares it, and the props and states that are legal override keys ' +
|
|
21
21
|
'under it. This is the whole themeable surface in one command: what auditing a theme, or ' +
|
|
22
|
-
'answering "which key paints this pixel?", used to need one `
|
|
22
|
+
'answering "which key paints this pixel?", used to need one `{@command component <Name>}` per ' +
|
|
23
23
|
'component to assemble. Pass a component name to scope it; pass any other text to search ' +
|
|
24
24
|
'target keys, classes, and components. `--json` for a list a repo can lint its own theme against.',
|
|
25
25
|
fn: 'themeTargets',
|
|
@@ -123,7 +123,7 @@ export const doc = {
|
|
|
123
123
|
notes: [
|
|
124
124
|
{
|
|
125
125
|
type: 'prose',
|
|
126
|
-
text: "In global mode: in a project, upgrade runs the codemods of the project's own CLI, whichever astryx command you start; in a project with no CLI of its own, the astryx command you started runs them, so install the CLI at the new Core's version first (`
|
|
126
|
+
text: "In global mode: in a project, upgrade runs the codemods of the project's own CLI, whichever astryx command you start; in a project with no CLI of its own, the astryx command you started runs them, so install the CLI at the new Core's version first (`{@command doctor}` prints the command). Outside a project, `--list` lists this version's codemods, `--registry` finds no copied compositions, and a migration writes nothing and stops with `ERR_VERSION_DETECT`. See {@link namespace:global} and {@link generic:who-answers}.",
|
|
127
127
|
},
|
|
128
128
|
{type: 'heading', level: 3, text: 'A CLI older than your Core'},
|
|
129
129
|
{
|
|
@@ -180,7 +180,7 @@ export const doc = {
|
|
|
180
180
|
text:
|
|
181
181
|
'When a codemod would change a protected file, upgrade makes the change only in memory and leaves the file as it is. ' +
|
|
182
182
|
'The rest of the upgrade goes ahead. With --apply, your other files are written, then upgrade runs the ' +
|
|
183
|
-
'`hooks.postCodemod` commands from astryx.config (see `
|
|
183
|
+
'`hooks.postCodemod` commands from astryx.config (see `{@command docs authoring config}`) and checks the protected ' +
|
|
184
184
|
'files again. If one still needs the change, the run is incomplete: it exits 1, prints ' +
|
|
185
185
|
'ERR_CODEMOD_PROTECTED with each file and the rule that protects it, and does not refresh the agent docs. ' +
|
|
186
186
|
'Regenerate or edit those files, then run the same upgrade again. A dry run reports the same files and writes nothing.',
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
import {recordCommandResult} from '../../../foundation/debug/index.mjs';
|
|
28
28
|
import {routeSegment} from '../../../foundation/discovery/docs-section-key.mjs';
|
|
29
29
|
import {formatCliCommand} from '../../../foundation/env/package-manager.mjs';
|
|
30
|
+
import {renderTokens} from '../../../foundation/doc-compiler/links.mjs';
|
|
30
31
|
import {text} from '../formatters/index.mjs';
|
|
31
32
|
|
|
32
33
|
/**
|
|
@@ -126,7 +127,8 @@ export function defineCommand(parent, doc, {fn, action, hidden} = {}) {
|
|
|
126
127
|
hidden ? {hidden: true} : {},
|
|
127
128
|
);
|
|
128
129
|
Object.defineProperty(cmd, COMMAND_DOCS, {value: {doc, fn}, configurable: true});
|
|
129
|
-
|
|
130
|
+
// Help shows doc tokens as commands, the way `astryx docs` does.
|
|
131
|
+
if (doc.summary) cmd.description(renderTokens(doc.summary));
|
|
130
132
|
if (doc.deprecated) {
|
|
131
133
|
const base = cmd.description() || '';
|
|
132
134
|
cmd.description(`${base} [DEPRECATED: ${doc.deprecated}]`);
|
|
@@ -143,13 +145,13 @@ export function defineCommand(parent, doc, {fn, action, hidden} = {}) {
|
|
|
143
145
|
// its description instead.)
|
|
144
146
|
if (arg.description) {
|
|
145
147
|
const argument = cmd.registeredArguments?.find(a => a.name() === arg.name);
|
|
146
|
-
if (argument) argument.description = arg.description;
|
|
148
|
+
if (argument) argument.description = renderTokens(arg.description);
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
for (const o of doc.options ?? []) {
|
|
151
153
|
const desc = o.description ?? (o.param ? paramDesc(o.param) : '');
|
|
152
|
-
const option = cmd.createOption(o.flag, desc);
|
|
154
|
+
const option = cmd.createOption(o.flag, renderTokens(desc));
|
|
153
155
|
if (o.default != null) option.default(o.default);
|
|
154
156
|
cmd.addOption(option);
|
|
155
157
|
}
|