@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
|
@@ -71,6 +71,20 @@ export const THEMES_CLI = '0.6.4';
|
|
|
71
71
|
*/
|
|
72
72
|
export const SECTION_IDS_CLI = '0.6.4';
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* The first CLI release that reads a doc section's `before` and `after`.
|
|
76
|
+
* Earlier releases reject the fields and hide every doc topic the package
|
|
77
|
+
* ships.
|
|
78
|
+
*/
|
|
79
|
+
export const SECTION_POSITION_CLI = '0.7.4';
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The first stable CLI release that renders doc tokens (`{@command …}`,
|
|
83
|
+
* `{@pm …}`, `{@pm-only …}`) for the reader. Every earlier release prints
|
|
84
|
+
* them as written, so readers see raw tokens.
|
|
85
|
+
*/
|
|
86
|
+
export const DOC_TOKENS_CLI = '0.7.4';
|
|
87
|
+
|
|
74
88
|
const VERSION_RE = /^v?(\d+|[xX*])(?:\.(\d+|[xX*]))?(?:\.(\d+|[xX*]))?(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
75
89
|
|
|
76
90
|
/**
|
|
@@ -226,6 +240,39 @@ export function sectionIdsCliProblem(pkg) {
|
|
|
226
240
|
);
|
|
227
241
|
}
|
|
228
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Why a package with a doc section that sets `before` or `after` would lose
|
|
245
|
+
* its doc topics on an older CLI, or null when its declared CLI range admits
|
|
246
|
+
* only CLIs that read the fields (spec:AST-046 FR11).
|
|
247
|
+
* @param {any} pkg package.json
|
|
248
|
+
* @returns {string | null}
|
|
249
|
+
*/
|
|
250
|
+
export function sectionPositionCliProblem(pkg) {
|
|
251
|
+
return cliRangeProblem(
|
|
252
|
+
pkg,
|
|
253
|
+
'has a doc section that sets `before` or `after`',
|
|
254
|
+
'rejects the fields, and can hide every doc topic the package ships',
|
|
255
|
+
SECTION_POSITION_CLI,
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Why a package whose docs write doc tokens would show them raw on an older
|
|
261
|
+
* CLI, or null when its declared CLI range admits only CLIs that render
|
|
262
|
+
* them. Every release before the first that renders them prints a token as
|
|
263
|
+
* written.
|
|
264
|
+
* @param {any} pkg package.json
|
|
265
|
+
* @returns {string | null}
|
|
266
|
+
*/
|
|
267
|
+
export function docTokensCliProblem(pkg) {
|
|
268
|
+
return cliRangeProblem(
|
|
269
|
+
pkg,
|
|
270
|
+
'writes doc tokens (`{@command …}`, `{@pm …}` or `{@pm-only …}`) in its docs',
|
|
271
|
+
'prints each token as written, so readers see raw tokens instead of commands',
|
|
272
|
+
DOC_TOKENS_CLI,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
229
276
|
/**
|
|
230
277
|
* Why a package that ships a theme would lose its themes and doc topics on an
|
|
231
278
|
* older CLI, or null when its declared CLI range admits only CLIs that read
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
KEYWORDS_CLI,
|
|
10
10
|
NAMESPACE_DOCS_CLI,
|
|
11
11
|
SECTION_IDS_CLI,
|
|
12
|
+
DOC_TOKENS_CLI,
|
|
12
13
|
TEMPLATE_REPLACES_CLI,
|
|
13
14
|
cliRangeProblem,
|
|
14
15
|
componentReplacesCliProblem,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
keywordsCliProblem,
|
|
19
20
|
replacesCliProblem,
|
|
20
21
|
sectionIdsCliProblem,
|
|
22
|
+
docTokensCliProblem,
|
|
21
23
|
themesCliProblem,
|
|
22
24
|
withCliPeer,
|
|
23
25
|
withDocsTreeCli,
|
|
@@ -162,7 +164,9 @@ describe('template replaces and keywords floors in the shipped docs', () => {
|
|
|
162
164
|
])('gives the %s fix the floor the check asks for', (code, floor) => {
|
|
163
165
|
const row = read('../../assets/docs/tree/troubleshooting.doc.mjs')
|
|
164
166
|
.split('],')
|
|
165
|
-
.find(part => part.includes(`${code}:`))
|
|
167
|
+
.find(part => part.includes(`${code}:`))
|
|
168
|
+
// The doc's single-quoted string escapes the command's own quotes.
|
|
169
|
+
?.replaceAll("\\'", "'");
|
|
166
170
|
expect(row).toContain(`@astryxdesign/cli=>=${floor}'`);
|
|
167
171
|
});
|
|
168
172
|
});
|
|
@@ -222,7 +226,8 @@ describe('componentReplacesCliProblem', () => {
|
|
|
222
226
|
);
|
|
223
227
|
const row = troubleshooting
|
|
224
228
|
.split('],')
|
|
225
|
-
.find(part => part.includes('`component_replaces_needs_cli`'))
|
|
229
|
+
.find(part => part.includes('`component_replaces_needs_cli`'))
|
|
230
|
+
?.replaceAll("\\'", "'");
|
|
226
231
|
expect(row).toContain(`@astryxdesign/cli=>=${COMPONENT_REPLACES_CLI}'`);
|
|
227
232
|
// Every version that row names is the floor.
|
|
228
233
|
expect(new Set(row?.match(/\d+\.\d+\.\d+/g))).toEqual(
|
|
@@ -252,6 +257,18 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
|
|
|
252
257
|
}
|
|
253
258
|
});
|
|
254
259
|
|
|
260
|
+
it('asks for a CLI from 0.7.4 for doc tokens', () => {
|
|
261
|
+
expect(docTokensCliProblem({name: '@acme/kit'})).toContain('writes doc tokens');
|
|
262
|
+
for (const range of ['>=0.7.4', '^0.7.4', '>=0.8.0']) {
|
|
263
|
+
expect(docTokensCliProblem({peerDependencies: {'@astryxdesign/cli': range}})).toBeNull();
|
|
264
|
+
}
|
|
265
|
+
for (const range of ['>=0.6.4', '^0.7.0', '>=0.7.3']) {
|
|
266
|
+
expect(
|
|
267
|
+
docTokensCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
|
|
268
|
+
).toContain('admits a stable CLI before 0.7.4');
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
255
272
|
it('gives replaces and keywords their own floors', () => {
|
|
256
273
|
// `>=0.6.4` admits published 0.6.4 and 0.6.5, which drop a template that
|
|
257
274
|
// sets `keywords` but apply one that sets `replaces`.
|
|
@@ -274,6 +291,7 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
|
|
|
274
291
|
NAMESPACE_DOCS_CLI,
|
|
275
292
|
THEMES_CLI,
|
|
276
293
|
SECTION_IDS_CLI,
|
|
294
|
+
DOC_TOKENS_CLI,
|
|
277
295
|
TEMPLATE_REPLACES_CLI,
|
|
278
296
|
KEYWORDS_CLI,
|
|
279
297
|
]) {
|
|
@@ -320,7 +338,10 @@ describe('every feature check names its CLI floor', () => {
|
|
|
320
338
|
replacesCliProblem: TEMPLATE_REPLACES_CLI,
|
|
321
339
|
keywordsCliProblem: KEYWORDS_CLI,
|
|
322
340
|
sectionIdsCliProblem: '0.6.4',
|
|
341
|
+
sectionPositionCliProblem: '0.7.4',
|
|
323
342
|
themesCliProblem: '0.6.4',
|
|
343
|
+
// The release doc tokens ship in.
|
|
344
|
+
docTokensCliProblem: '0.7.4',
|
|
324
345
|
};
|
|
325
346
|
|
|
326
347
|
it('asks each feature for the CLI release this table names', () => {
|
|
@@ -258,6 +258,15 @@ describe('error codes: human mode stays clean', () => {
|
|
|
258
258
|
expect(stdout).not.toContain('ERR_UNKNOWN_COMPONENT');
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
+
it('refuses --built with a doctor integration check', async () => {
|
|
262
|
+
const json = await runCli(['--json', 'doctor', '--built', 'dist', 'integration', 'validate']);
|
|
263
|
+
expect(json.status).toBe(1);
|
|
264
|
+
expect(JSON.parse(json.stdout)).toMatchObject({code: 'ERR_INVALID_OPTION'});
|
|
265
|
+
const text = await runCli(['doctor', '--built', 'dist', 'integration', 'docs']);
|
|
266
|
+
expect(text.status).toBe(1);
|
|
267
|
+
expect(text.stderr).toContain('goes with `doctor` alone');
|
|
268
|
+
});
|
|
269
|
+
|
|
261
270
|
it('unknown subcommand exits 1, with the code in JSON and not in text', async () => {
|
|
262
271
|
// A group that is not JSON-capable itself still answers an unknown
|
|
263
272
|
// subcommand in JSON, so a JSON caller learns the subcommands it has.
|
|
@@ -78,17 +78,17 @@ export const doc = {
|
|
|
78
78
|
{
|
|
79
79
|
value: 'docs.list',
|
|
80
80
|
description:
|
|
81
|
-
"All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load.",
|
|
81
|
+
"All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?, replacedPackage?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load.",
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
value: 'docs.detail',
|
|
85
85
|
description:
|
|
86
|
-
"One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).",
|
|
86
|
+
"One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). A topic or guide that took another's place carries replaces and replacedPackage, the package whose topic or guide it replaced.",
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
value: 'docs.index',
|
|
90
90
|
description:
|
|
91
|
-
"One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).",
|
|
91
|
+
"One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there); replaces and replacedPackage when the topic or guide took another's place.",
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
value: 'docs.detail.section',
|
|
@@ -98,7 +98,7 @@ export const doc = {
|
|
|
98
98
|
{
|
|
99
99
|
value: 'docs.node',
|
|
100
100
|
description:
|
|
101
|
-
"One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names).",
|
|
101
|
+
"One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package, and a guide an integration replaced its replaces and replacedPackage) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names).",
|
|
102
102
|
},
|
|
103
103
|
|
|
104
104
|
// blog (read from the published RSS feed)
|
|
@@ -117,22 +117,22 @@ export const doc = {
|
|
|
117
117
|
{
|
|
118
118
|
value: 'discover.list',
|
|
119
119
|
description:
|
|
120
|
-
'What the project has, the integrations it loads and the official packages it declares, official packages first (name, category, components, version, a list per other kind they add, and latest when a source knows it); meta.available lists what the project could add, the official packages first, each with the command that adds it, and meta.sources reports each source, the official list last; when it lists no integration it carries meta.configured to tell "nothing configured" from "nothing discovered".',
|
|
120
|
+
'What the project has, the integrations it loads and the official packages it declares, official packages first (package, the npm package and always equal to name; name, category, components, version, a list per other kind they add, and latest when a source knows it); meta.available lists what the project could add, the official packages first, each with its package and the command that adds it, and meta.sources reports each source, the official list last; when it lists no integration it carries meta.configured to tell "nothing configured" from "nothing discovered".',
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
value: 'discover.detail',
|
|
124
124
|
description:
|
|
125
|
-
'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.',
|
|
125
|
+
'One package, for an @scope/name or @scope/name@version query: its package (the npm package the result is about), 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.',
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
value: 'discover.detail.doc',
|
|
129
129
|
description:
|
|
130
|
-
'The validated ComponentDoc for one installed component, for an @scope/name/Component query.',
|
|
130
|
+
'The validated ComponentDoc for one installed component, for an @scope/name/Component query, plus package, the npm package that owns the component.',
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
value: 'discover.item',
|
|
134
134
|
description:
|
|
135
|
-
'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.',
|
|
135
|
+
'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. The envelope\'s package names the same package.',
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
value: 'discover.search',
|
|
@@ -272,7 +272,7 @@ export const doc = {
|
|
|
272
272
|
{
|
|
273
273
|
value: 'theme.palette.generate',
|
|
274
274
|
description:
|
|
275
|
-
'An author-reviewable OKLCH palette candidate,
|
|
275
|
+
'An author-reviewable OKLCH palette response: recipe (`astryx-oklch-v1`), status (`candidate`), familyCount, stopCount, modes, candidate (`TonalPaletteCandidate`), and generationReceipt. The generationReceipt contains schemaVersion (1), recipe, generatorVersion (`palette-generator-v1`), candidateFormatVersion (`palette-typescript-v1` or `palette-json-v1`), candidateSha256, optional preview, resolved request, and diagnostics. File-write fields are output, receipt, preview, written, and reason (`exists` or null).',
|
|
276
276
|
},
|
|
277
277
|
|
|
278
278
|
// upgrade
|
|
@@ -338,7 +338,7 @@ export const doc = {
|
|
|
338
338
|
{
|
|
339
339
|
value: 'integration.validate',
|
|
340
340
|
description:
|
|
341
|
-
'The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning | error, message, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package), and notes when there are any: {code, message} information
|
|
341
|
+
'The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning | error, message, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package), and notes when there are any: {code, message, next?} information beside the issues (text output marks a next note [next minor]); a note fails nothing by default, and one with next: true counts as a warning under integration check --next, fails integration check --strict --next, and fails --strict from the next minor release. Notes include invalid_cli_command for a malformed cliCommand and cli_peer_version when the running CLI is outside the @astryxdesign/cli peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message (duplicate_component_doc, symlinked_root, unreadable_file, invalid_package_json, no_provider_id, source_without_component_doc where a doc and its source still pair), and doc_name_mismatch and unknown_block_component, until they become warnings in the next minor release. For the commands a topic writes, runner_command (written with a package runner), plain_command (written bare), package_manager_command (written for one package manager) and doc_token (a token that does not parse) notes each give the file, line and the token to write. A doc_target_not_found note names a doc whose replaces or extends names no topic and no guide of the CLI docs or the docs of the package (such as a namespace), and a doc_section_unplaced note a section whose before or after names no section of what it extends (it is added at the end), and a duplicate_guide_replacement note two docs of the package that replace one guide; they become warnings in the next minor release. When the manifest loads, docTypes checks each doc against its published authoring type: status (checked | skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked). When the manifest loads, docNames lists the component doc names it could not judge: status (checked), findings (always empty; a doc name the module its import names provably does not export is a doc_name_mismatch note, with its fix in the message) and unchecked ({file, name, reason}: a doc whose name differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, blockComponents lists the component names templates give in exampleFor or componentsUsed that could not be judged: status (checked), findings (always empty; a name neither the package nor Core has, and the template does not import, is an unknown_block_component note, with its fix in the message) and unchecked ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is also a note (its fix in the message), listed only and failing --strict from the next minor. publicImports ({status: checked, findings: [], unchecked}) lists each import the check could not judge as {file, specifier, reason}; never counted or failed on.',
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
344
|
value: 'integration.template-conflicts',
|
|
@@ -358,7 +358,7 @@ export const doc = {
|
|
|
358
358
|
{
|
|
359
359
|
value: 'integration.check',
|
|
360
360
|
description:
|
|
361
|
-
'Every source check of an integration package in one result: validated (false when no integration manifest was found, so nothing was checked), the package name and version, strict, and checks, one entry per check (validate, components, templates, docs), each with check, errors, warnings, skipped, failed, and response, the envelope that check returns on its own. The totals are errors, warnings, and skipped; unchecked counts what the checks could not compare. With --strict, failures lists each warning and each piece of skipped work again as an error, in the issue format the checks use; it is empty without --strict. failed decides the exit code.',
|
|
361
|
+
'Every source check of an integration package in one result: validated (false when no integration manifest was found, so nothing was checked), the package name and version, strict, next (true with --next), and checks, one entry per check (validate, components, templates, docs), each with check, errors, warnings, skipped, failed, and response, the envelope that check returns on its own. The totals are errors, warnings, and skipped; unchecked counts what the checks could not compare, and upcoming how many of the validate notes carry next: true. With --next those notes count as warnings in the validate row and the totals. With --strict, failures lists each warning and each piece of skipped work again as an error, in the issue format the checks use, and with --strict --next each next note too; it is empty without --strict. failed decides the exit code.',
|
|
362
362
|
},
|
|
363
363
|
],
|
|
364
364
|
};
|
|
@@ -172,6 +172,35 @@ describe('response-types EnumDoc names every field', () => {
|
|
|
172
172
|
expectNamed('theme.targets', fieldsOf(res.data));
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
+
it('theme.palette.generate, including receipt provenance', async () => {
|
|
176
|
+
const cwd = fs.mkdtempSync(
|
|
177
|
+
path.join(os.tmpdir(), 'astryx-response-types-palette-'),
|
|
178
|
+
);
|
|
179
|
+
fs.writeFileSync(
|
|
180
|
+
path.join(cwd, 'palette.config.json'),
|
|
181
|
+
JSON.stringify({
|
|
182
|
+
modeStrategy: 'light-only',
|
|
183
|
+
stops: [20, 50, 80],
|
|
184
|
+
families: [{id: 'blue', seed: '#0074e2'}],
|
|
185
|
+
}),
|
|
186
|
+
);
|
|
187
|
+
const res = await data(
|
|
188
|
+
['theme', 'palette', 'generate', 'palette.config.json'],
|
|
189
|
+
cwd,
|
|
190
|
+
);
|
|
191
|
+
expect(res.type).toBe('theme.palette.generate');
|
|
192
|
+
expectNamed('theme.palette.generate', [
|
|
193
|
+
...Object.keys(res.data),
|
|
194
|
+
...Object.keys(res.data.generationReceipt),
|
|
195
|
+
]);
|
|
196
|
+
expect(describedAs('theme.palette.generate')).toMatch(
|
|
197
|
+
/generatorVersion.*palette-generator-v1/,
|
|
198
|
+
);
|
|
199
|
+
expect(describedAs('theme.palette.generate')).toMatch(
|
|
200
|
+
/candidateFormatVersion.*palette-typescript-v1.*palette-json-v1/,
|
|
201
|
+
);
|
|
202
|
+
});
|
|
203
|
+
|
|
175
204
|
it('gap-report.file, including each delivery', async () => {
|
|
176
205
|
const res = await data([
|
|
177
206
|
'gap-report',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4-canary.1a552f2",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"zod": "^4.4.3"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
|
-
"@astryxdesign/charts": "
|
|
110
|
-
"@astryxdesign/core": "
|
|
111
|
-
"@astryxdesign/lab": "
|
|
112
|
-
"@astryxdesign/theme-neutral": "
|
|
109
|
+
"@astryxdesign/charts": "0.7.4-canary.1a552f2",
|
|
110
|
+
"@astryxdesign/core": "0.7.4-canary.1a552f2",
|
|
111
|
+
"@astryxdesign/lab": "0.7.4-canary.1a552f2",
|
|
112
|
+
"@astryxdesign/theme-neutral": "0.7.4-canary.1a552f2"
|
|
113
113
|
},
|
|
114
114
|
"peerDependenciesMeta": {
|
|
115
115
|
"@astryxdesign/charts": {
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@astryxdesign/charts": "
|
|
130
|
-
"@astryxdesign/core": "
|
|
131
|
-
"@astryxdesign/lab": "
|
|
132
|
-
"@astryxdesign/theme-neutral": "
|
|
129
|
+
"@astryxdesign/charts": "0.7.4-canary.1a552f2",
|
|
130
|
+
"@astryxdesign/core": "0.7.4-canary.1a552f2",
|
|
131
|
+
"@astryxdesign/lab": "0.7.4-canary.1a552f2",
|
|
132
|
+
"@astryxdesign/theme-neutral": "0.7.4-canary.1a552f2",
|
|
133
133
|
"@heroicons/react": "^2.2.0",
|
|
134
134
|
"@stylexjs/stylex": "^0.19.0",
|
|
135
135
|
"@types/babel__core": "^7.20.5",
|