@astryxdesign/cli 0.6.3-canary.db4e378 → 0.6.3-canary.db7b338
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 +22 -1
- package/api/blog/blog.doc.mjs +1 -0
- package/api/build/build.doc.mjs +1 -0
- package/api/component/component.doc.mjs +1 -0
- package/api/discover/discover.doc.mjs +1 -0
- package/api/docs/_adapter.d.mts +3 -8
- package/api/docs/_adapter.mjs +13 -105
- package/api/docs/detail/section/section.mjs +9 -15
- package/api/docs/detail/section/section.test.mjs +15 -6
- package/api/docs/docs.doc.mjs +1 -0
- package/api/docs/list/list.mjs +3 -7
- package/api/doctor/doctor.d.mts +25 -3
- package/api/doctor/doctor.doc.mjs +1 -0
- package/api/doctor/doctor.mjs +186 -14
- package/api/doctor/doctor.test.mjs +332 -7
- package/api/gap-report/gap-report.doc.mjs +1 -0
- package/api/hook/_adapter.mjs +19 -5
- package/api/hook/hook.doc.mjs +1 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/hook/list/list.mjs +69 -17
- package/api/init/init.doc.mjs +1 -0
- package/api/integration/add-contribution.mjs +7 -7
- package/api/integration/add-contribution.test.mjs +37 -3
- package/api/integration/add-theme.mjs +34 -64
- package/api/integration/add-theme.test.mjs +105 -21
- package/api/integration/authoring-checks.test.mjs +8 -4
- package/api/integration/integration-block-exports.test.mjs +10 -6
- package/api/integration/integrationAdd.doc.mjs +1 -0
- package/api/integration/integrationAddAgentDoc.doc.mjs +1 -0
- package/api/integration/integrationAddCodemod.doc.mjs +1 -0
- package/api/integration/integrationAddComponent.doc.mjs +1 -0
- package/api/integration/integrationAddDoc.doc.mjs +1 -0
- package/api/integration/integrationAddTemplate.doc.mjs +1 -0
- package/api/integration/integrationAddTheme.doc.mjs +6 -5
- package/api/integration/integrationComponentConflicts.doc.mjs +1 -0
- package/api/integration/integrationDocConflicts.doc.mjs +1 -0
- package/api/integration/integrationPackCheck.doc.mjs +1 -0
- package/api/integration/integrationTemplateConflicts.doc.mjs +1 -0
- package/api/integration/pack-check.test.mjs +17 -47
- package/api/integration/summarizeIssues.doc.mjs +1 -0
- package/api/integration/validate-integration-fixes.test.mjs +1389 -0
- package/api/integration/validate-integration.mjs +50 -102
- package/api/integration/validate-integration.test.mjs +85 -23
- package/api/integration/validate-unread-theme-folders.test.mjs +110 -0
- package/api/integration/validateIntegration.doc.mjs +1 -0
- package/api/json/assertResponse.doc.mjs +1 -0
- package/api/json/isError.doc.mjs +1 -0
- package/api/json/parseResponse.doc.mjs +1 -0
- package/api/layout/layoutCheck.doc.mjs +1 -0
- package/api/layout/layoutExpand.doc.mjs +1 -0
- package/api/layout/layoutGrammar.doc.mjs +1 -0
- package/api/search/search.doc.mjs +1 -0
- package/api/search/search.mjs +16 -6
- package/api/swizzle/swizzle.doc.mjs +1 -0
- package/api/template/template-suffix.test.mjs +41 -21
- package/api/template/template.doc.mjs +1 -0
- package/api/theme/_adapter.d.mts +2 -3
- package/api/theme/_adapter.mjs +4 -5
- package/api/theme/add/add.binary.test.mjs +10 -17
- package/api/theme/add/add.test.mjs +14 -1
- package/api/theme/generateTonalPalette.doc.mjs +1 -0
- package/api/theme/integration-themes.test.mjs +39 -28
- package/api/theme/list/list.test.mjs +19 -20
- package/api/theme/listThemes.doc.mjs +6 -5
- package/api/theme/themeAdd.doc.mjs +4 -3
- package/api/theme/themeBuild.doc.mjs +1 -0
- package/api/theme/themeList.doc.mjs +6 -3
- package/api/theme/themeListAvailable.doc.mjs +5 -3
- package/api/theme/themePaletteGenerate.doc.mjs +1 -0
- package/api/theme/themeTargets.doc.mjs +1 -0
- package/api/theme/themeTemplate.doc.mjs +1 -0
- package/api/upgrade/_adapter.d.mts +32 -5
- package/api/upgrade/_adapter.mjs +97 -69
- package/api/upgrade/provider-agreement.test.mjs +152 -0
- package/api/upgrade/run/run.mjs +356 -59
- package/api/upgrade/upgrade.doc.mjs +6 -1
- package/api/upgrade/upgrade.type.d.mts +34 -0
- package/api/upgrade/upgrade.type.mjs +15 -0
- package/assets/codemods/__tests__/runner.test.mjs +330 -8
- package/assets/codemods/integration-discovery.mjs +8 -2
- package/assets/codemods/integration-discovery.test.mjs +15 -0
- package/assets/codemods/integration-runner.mjs +56 -4
- package/assets/codemods/integration-runner.protection.test.mjs +153 -0
- package/assets/codemods/run-codemod.mjs +177 -34
- package/assets/codemods/runner.mjs +350 -102
- package/assets/codemods/transforms/next/__tests__/migrate-native-picker-to-presentation.test.mjs +63 -0
- package/assets/codemods/transforms/next/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +220 -0
- package/assets/codemods/transforms/next/index.mjs +19 -1
- package/assets/codemods/transforms/next/migrate-native-picker-to-presentation.mjs +148 -0
- package/assets/codemods/transforms/next/migrate-theme-catalog-to-descriptors.mjs +141 -0
- package/assets/docs/cli-integrations.doc.mjs +30 -30
- package/assets/docs/cli.doc.mjs +15 -0
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/templates/blocks/components/DateInput/DateInputDateRange.tsx +1 -1
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +14 -0
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +100 -0
- package/assets/templates/blocks/components/TimeInput/TimeInputConstrained.tsx +1 -0
- package/assets/templates/themes/butter/butterTheme.doc.mjs +11 -0
- package/assets/templates/themes/chocolate/chocolateTheme.doc.mjs +11 -0
- package/assets/templates/themes/gothic/gothicTheme.doc.mjs +11 -0
- package/assets/templates/themes/matcha/matchaTheme.doc.mjs +11 -0
- package/assets/templates/themes/neutral/neutralTheme.doc.mjs +11 -0
- package/assets/templates/themes/stone/stoneTheme.doc.mjs +11 -0
- package/assets/templates/themes/y2k/y2kTheme.doc.mjs +11 -0
- package/authoring/codemod/codemod.doc.mjs +1 -1
- package/authoring/codemod/type.ts +12 -0
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/debug/debug.doc.d.mts +11 -0
- package/authoring/debug/debug.doc.mjs +182 -0
- package/authoring/doctypes/_schema.d.mts +71 -141
- package/authoring/doctypes/_schema.mjs +29 -2
- package/authoring/doctypes/base/graph-fields.doc.mjs +1 -1
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/command/type.ts +1 -1
- package/authoring/doctypes/component/type.ts +2 -2
- package/authoring/doctypes/doctypes-new.test.mjs +48 -6
- package/authoring/doctypes/enum/enum.doc.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +1 -1
- package/authoring/doctypes/function/function.doc.mjs +1 -1
- package/authoring/doctypes/function/type.ts +1 -1
- package/authoring/doctypes/hook/type.ts +2 -2
- package/authoring/doctypes/load-contract.test.mjs +3 -2
- package/authoring/doctypes/namespace/namespace.doc.mjs +2 -2
- package/authoring/doctypes/namespace/parse.test.mjs +23 -25
- package/authoring/doctypes/namespace/type.ts +5 -2
- package/authoring/doctypes/parse.d.mts +4 -2
- package/authoring/doctypes/parse.mjs +10 -5
- package/authoring/doctypes/reference/reference.doc.mjs +6 -4
- package/authoring/doctypes/reference/type.ts +9 -10
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +1 -2
- package/authoring/doctypes/template/template.doc.mjs +3 -3
- package/authoring/doctypes/theme/parse.d.mts +35 -0
- package/authoring/doctypes/theme/parse.mjs +76 -0
- package/authoring/doctypes/theme/theme.doc.d.mts +9 -0
- package/authoring/doctypes/theme/theme.doc.mjs +79 -0
- package/authoring/doctypes/theme/type.ts +42 -0
- package/authoring/doctypes/types.ts +2 -1
- package/authoring/gap-report/gap-report.doc.d.mts +12 -0
- package/authoring/gap-report/gap-report.doc.mjs +183 -0
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +7 -4
- package/authoring/index.mjs +2 -1
- package/authoring/integration/integration.doc.mjs +2 -2
- package/authoring/integration/type.ts +3 -9
- package/clients/cli/__tests__/cliManifest.test.ts +27 -29
- package/clients/cli/commands/blog.doc.mjs +1 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
- package/clients/cli/commands/build-theme.mjs +10 -44
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/discover.doc.mjs +1 -1
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +15 -58
- package/clients/cli/commands/docs.test.mjs +11 -14
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration.test.mjs +15 -7
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/gap-report.doc.mjs +1 -1
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +1 -1
- package/clients/cli/commands/integration-add.controls.test.mjs +1 -1
- package/clients/cli/commands/integration-add.doc.mjs +1 -1
- package/clients/cli/commands/integration-pack.doc.mjs +1 -1
- package/clients/cli/commands/integration-real-world.test.mjs +3 -9
- package/clients/cli/commands/integration.doc.mjs +1 -1
- package/clients/cli/commands/layout-check.doc.mjs +1 -1
- package/clients/cli/commands/layout-expand.doc.mjs +1 -1
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -1
- package/clients/cli/commands/layout.doc.mjs +1 -1
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +1 -1
- 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 +718 -0
- package/clients/cli/commands/theme-add.doc.mjs +2 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-list.doc.mjs +2 -2
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -3
- package/clients/cli/commands/theme-palette.doc.mjs +1 -1
- package/clients/cli/commands/theme-targets.behavior.test.mjs +4 -3
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands/upgrade.file-protection.test.mjs +228 -0
- package/clients/cli/commands/upgrade.mjs +29 -7
- package/clients/cli/formatters/index.mjs +2 -0
- package/clients/cli/formatters/index.test.mjs +6 -0
- package/clients/cli/lib/hook-format.mjs +14 -5
- package/foundation/config/project-themes.test.mjs +11 -19
- package/foundation/config/project.d.mts +8 -0
- package/foundation/config/project.mjs +50 -21
- package/foundation/config/project.test.mjs +3 -16
- package/foundation/discovery/authoring-self-docs.d.mts +6 -0
- package/foundation/discovery/authoring-self-docs.mjs +17 -7
- package/foundation/discovery/authoring-self-docs.test.mjs +3 -2
- package/foundation/discovery/authoring-surface.d.mts +74 -0
- package/foundation/discovery/authoring-surface.mjs +525 -0
- package/foundation/discovery/authoring-surface.test.mjs +392 -0
- package/foundation/discovery/cli-self-docs.d.mts +113 -0
- package/foundation/discovery/cli-self-docs.mjs +514 -0
- package/foundation/discovery/cli-self-docs.test.mjs +437 -0
- package/foundation/discovery/component-loader.d.mts +35 -38
- package/foundation/discovery/component-loader.mjs +53 -222
- package/foundation/discovery/docs-discovery.d.mts +3 -2
- package/foundation/discovery/docs-discovery.mjs +14 -17
- package/foundation/discovery/docs-discovery.test.mjs +15 -15
- package/foundation/discovery/docs-section-key.d.mts +19 -8
- package/foundation/discovery/docs-section-key.mjs +119 -32
- package/foundation/discovery/docs-section-key.test.mjs +41 -19
- package/foundation/discovery/template-adapter.d.mts +7 -0
- package/foundation/discovery/template-adapter.mjs +27 -40
- package/foundation/discovery/template-adapter.test.mjs +15 -0
- package/foundation/discovery/theme-discovery.d.mts +67 -7
- package/foundation/discovery/theme-discovery.mjs +916 -186
- package/foundation/discovery/theme-discovery.test.mjs +613 -219
- package/foundation/doc-compiler/bundle.d.mts +47 -0
- package/foundation/doc-compiler/bundle.mjs +218 -0
- package/foundation/doc-compiler/bundle.test.mjs +255 -0
- package/foundation/doc-compiler/compile.d.mts +200 -0
- package/foundation/doc-compiler/compile.mjs +259 -9
- package/foundation/doc-compiler/diagnostics.d.mts +126 -0
- package/foundation/doc-compiler/diagnostics.mjs +277 -0
- package/foundation/doc-compiler/doc-compiler.test.mjs +28 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +1642 -0
- package/foundation/doc-compiler/import.d.mts +24 -0
- package/foundation/doc-compiler/import.mjs +59 -0
- package/foundation/doc-compiler/inputs.d.mts +102 -0
- package/foundation/doc-compiler/inputs.mjs +286 -0
- package/foundation/doc-compiler/inputs.test.mjs +299 -0
- package/foundation/doc-compiler/ir.d.mts +13 -0
- package/foundation/doc-compiler/ir.mjs +189 -12
- package/foundation/doc-compiler/lower-doc.test.mjs +492 -0
- package/foundation/doc-compiler/overlays.d.mts +37 -0
- package/foundation/doc-compiler/overlays.mjs +206 -0
- package/foundation/doc-compiler/parse-readable.d.mts +9 -0
- package/foundation/doc-compiler/parse-readable.mjs +29 -0
- package/foundation/doc-compiler/read.d.mts +126 -0
- package/foundation/doc-compiler/read.mjs +320 -0
- package/foundation/doc-compiler/read.test.mjs +313 -0
- package/foundation/doc-compiler/source.d.mts +33 -0
- package/foundation/doc-compiler/source.mjs +128 -0
- package/foundation/fs/file-protection.d.mts +33 -0
- package/foundation/fs/file-protection.mjs +825 -0
- package/foundation/fs/file-protection.test.mjs +250 -0
- package/foundation/integrations/autolink.d.mts +58 -1
- package/foundation/integrations/autolink.mjs +143 -57
- package/foundation/integrations/contribution-fixes.d.mts +145 -0
- package/foundation/integrations/contribution-fixes.mjs +1284 -0
- package/foundation/integrations/contribution-inventory.d.mts +1 -1
- package/foundation/integrations/contribution-inventory.mjs +17 -20
- package/foundation/integrations/contribution-inventory.test.mjs +67 -27
- package/foundation/integrations/integrations.d.mts +3 -0
- package/foundation/integrations/integrations.mjs +11 -97
- package/foundation/integrations/provider-ledger.test.mjs +275 -0
- package/foundation/integrations/provider-resolution.d.mts +152 -0
- package/foundation/integrations/provider-resolution.mjs +576 -0
- package/foundation/integrations/provider-resolution.test.mjs +369 -0
- package/foundation/integrations/theme-descriptor.d.mts +8 -0
- package/foundation/integrations/theme-descriptor.mjs +44 -0
- package/foundation/integrations/validate-contributions.mjs +104 -10
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +2 -0
- package/foundation/response/error-codes.doc.mjs +12 -2
- package/foundation/response/error-codes.mjs +7 -1
- package/foundation/response/error-codes.test.mjs +55 -11
- package/foundation/response/response-types.doc.mjs +1 -1
- package/foundation/response/response.doc.mjs +1 -1
- package/foundation/text/string-utils.mjs +22 -10
- package/package.json +10 -9
- package/assets/templates/themes/manifest.json +0 -95
|
@@ -23,8 +23,6 @@ import {
|
|
|
23
23
|
text,
|
|
24
24
|
code,
|
|
25
25
|
wrapText,
|
|
26
|
-
displayWidth,
|
|
27
|
-
WRAP_WIDTH,
|
|
28
26
|
} from '../formatters/index.mjs';
|
|
29
27
|
import {cliError} from '../lib/cli-error.mjs';
|
|
30
28
|
import {defineCommand} from '../lib/define-command.mjs';
|
|
@@ -52,28 +50,6 @@ function formatTable(headers, rows) {
|
|
|
52
50
|
return `${head}\n${sep}\n${body}`;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
/**
|
|
56
|
-
* A table too wide for {@link WRAP_WIDTH}: one `header: cell` line per cell and
|
|
57
|
-
* a blank line between rows, so nothing runs off the side of a terminal.
|
|
58
|
-
* @param {string[]} headers
|
|
59
|
-
* @param {string[][]} rows
|
|
60
|
-
* @returns {string}
|
|
61
|
-
*/
|
|
62
|
-
function formatTableVertical(headers, rows) {
|
|
63
|
-
const width = Math.max(...headers.map(h => h.length)) + 2;
|
|
64
|
-
return rows
|
|
65
|
-
.map(row =>
|
|
66
|
-
headers
|
|
67
|
-
.map((h, i) =>
|
|
68
|
-
wrapText(`${`${h}:`.padEnd(width)}${row[i] ?? ''}`, {
|
|
69
|
-
indent: ' '.repeat(width),
|
|
70
|
-
}),
|
|
71
|
-
)
|
|
72
|
-
.join('\n'),
|
|
73
|
-
)
|
|
74
|
-
.join('\n\n');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
53
|
/**
|
|
78
54
|
* @param {string[]} headers
|
|
79
55
|
* @param {string[][]} rows
|
|
@@ -91,7 +67,7 @@ function formatTableCompact(headers, rows) {
|
|
|
91
67
|
function formatBlock(block, detail) {
|
|
92
68
|
switch (block.type) {
|
|
93
69
|
case 'prose':
|
|
94
|
-
return
|
|
70
|
+
return block.text;
|
|
95
71
|
|
|
96
72
|
case 'heading':
|
|
97
73
|
return `${'#'.repeat(block.level || 3)} ${block.text}`;
|
|
@@ -110,12 +86,7 @@ function formatBlock(block, detail) {
|
|
|
110
86
|
if (detail === 'compact') {
|
|
111
87
|
return formatTableCompact(block.headers, block.rows);
|
|
112
88
|
}
|
|
113
|
-
|
|
114
|
-
const table = formatTable(block.headers, block.rows);
|
|
115
|
-
return table.split('\n').some(line => displayWidth(line) > WRAP_WIDTH)
|
|
116
|
-
? formatTableVertical(block.headers, block.rows)
|
|
117
|
-
: table;
|
|
118
|
-
}
|
|
89
|
+
return formatTable(block.headers, block.rows);
|
|
119
90
|
|
|
120
91
|
case 'list': {
|
|
121
92
|
const prefix =
|
|
@@ -126,21 +97,9 @@ function formatBlock(block, detail) {
|
|
|
126
97
|
: block.style === 'do'
|
|
127
98
|
? () => '+ '
|
|
128
99
|
: () => '- ';
|
|
129
|
-
return block.items
|
|
130
|
-
.map((item, i) => {
|
|
131
|
-
const head = prefix(i);
|
|
132
|
-
return wrapText(`${head}${item}`, {indent: ' '.repeat(head.length)});
|
|
133
|
-
})
|
|
134
|
-
.join('\n');
|
|
100
|
+
return block.items.map((item, i) => `${prefix(i)}${item}`).join('\n');
|
|
135
101
|
}
|
|
136
102
|
|
|
137
|
-
case 'workflow':
|
|
138
|
-
case 'collection':
|
|
139
|
-
case 'reference':
|
|
140
|
-
throw new Error(
|
|
141
|
-
`Documentation block "${block.type}" requires the compiled graph renderer.`,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
103
|
default:
|
|
145
104
|
return null;
|
|
146
105
|
}
|
|
@@ -173,16 +132,15 @@ function formatSection(section, detail) {
|
|
|
173
132
|
*/
|
|
174
133
|
function formatReferenceFull(docs, detail) {
|
|
175
134
|
if (detail === 'brief') {
|
|
176
|
-
const header =
|
|
135
|
+
const header = `${docs.title}: ${docs.description}`;
|
|
177
136
|
const sections = docs.sections.map(s => formatSection(s, detail));
|
|
178
137
|
return `${header}\n${sections.join('\n')}`;
|
|
179
138
|
}
|
|
180
139
|
|
|
181
|
-
const description = wrapText(docs.description);
|
|
182
140
|
const header =
|
|
183
141
|
detail === 'compact'
|
|
184
|
-
? `# ${docs.title}\n${description}`
|
|
185
|
-
: `# ${docs.title}\n\n${description}`;
|
|
142
|
+
? `# ${docs.title}\n${docs.description}`
|
|
143
|
+
: `# ${docs.title}\n\n${docs.description}`;
|
|
186
144
|
const sections = docs.sections.map(s => formatSection(s, detail));
|
|
187
145
|
const sep = detail === 'compact' ? '\n\n' : '\n\n';
|
|
188
146
|
return `${header}\n\n${sections.join(sep)}`;
|
|
@@ -196,7 +154,10 @@ function formatReferenceFull(docs, detail) {
|
|
|
196
154
|
*/
|
|
197
155
|
function emitIndex(index, run) {
|
|
198
156
|
emit(
|
|
199
|
-
section(
|
|
157
|
+
section(
|
|
158
|
+
index.title,
|
|
159
|
+
index.description ? wrapText(index.description) : undefined,
|
|
160
|
+
),
|
|
200
161
|
records(index.sections, {
|
|
201
162
|
fields: ['id', 'title', 'summary'],
|
|
202
163
|
layout: 'inline',
|
|
@@ -275,19 +236,15 @@ export function registerDocs(program) {
|
|
|
275
236
|
|
|
276
237
|
switch (result.type) {
|
|
277
238
|
case 'docs.list': {
|
|
278
|
-
//
|
|
279
|
-
// description
|
|
239
|
+
// Keep the published 0.6 text projection: stacked topic and
|
|
240
|
+
// description fields, followed by the two original usage lines.
|
|
280
241
|
emit(
|
|
281
242
|
section('Available docs'),
|
|
282
|
-
records(result.data, {
|
|
283
|
-
fields: ['topic', 'description'],
|
|
284
|
-
layout: 'inline',
|
|
285
|
-
}),
|
|
243
|
+
records(result.data, {fields: ['topic', 'description']}),
|
|
286
244
|
text(
|
|
287
245
|
[
|
|
288
|
-
`Usage: ${run} docs <topic
|
|
289
|
-
` ${run} docs <topic>
|
|
290
|
-
` ${run} docs <topic> <section> read one section`,
|
|
246
|
+
`Usage: ${run} docs <topic>`,
|
|
247
|
+
` ${run} docs <topic> <section>`,
|
|
291
248
|
].join('\n'),
|
|
292
249
|
),
|
|
293
250
|
);
|
|
@@ -108,11 +108,11 @@ describe('progressive reads', () => {
|
|
|
108
108
|
/** @param {string} out */
|
|
109
109
|
const widest = out => Math.max(...out.split('\n').map(line => line.length));
|
|
110
110
|
|
|
111
|
-
it('
|
|
111
|
+
it('keeps the 0.6.x stacked topic list', async () => {
|
|
112
112
|
const {status, stdout} = await runCli(['docs']);
|
|
113
113
|
expect(status).toBe(0);
|
|
114
|
-
expect(stdout).toMatch(/^principles
|
|
115
|
-
expect(
|
|
114
|
+
expect(stdout).toMatch(/^topic: +principles$/m);
|
|
115
|
+
expect(stdout).toContain('Usage: pnpm exec astryx docs <topic>');
|
|
116
116
|
}, SLOW);
|
|
117
117
|
|
|
118
118
|
it("prints a topic's section index with the keys to read by", async () => {
|
|
@@ -139,9 +139,6 @@ describe('progressive reads', () => {
|
|
|
139
139
|
expect((await runCli(['--detail', 'full', 'docs', 'theme'])).stdout).toBe(
|
|
140
140
|
full.stdout,
|
|
141
141
|
);
|
|
142
|
-
expect(widest(full.stdout.replace(/```[\s\S]*?```/g, ''))).toBeLessThanOrEqual(
|
|
143
|
-
120,
|
|
144
|
-
);
|
|
145
142
|
}, SLOW);
|
|
146
143
|
|
|
147
144
|
it('returns the matching envelopes as JSON', async () => {
|
|
@@ -176,14 +173,14 @@ describe('text width in every language', () => {
|
|
|
176
173
|
return max;
|
|
177
174
|
};
|
|
178
175
|
|
|
179
|
-
it
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
176
|
+
it('keeps the additive section index within 120 columns', async () => {
|
|
177
|
+
const {status, stdout} = await runCli([
|
|
178
|
+
'docs',
|
|
179
|
+
'theme',
|
|
180
|
+
'--index',
|
|
181
|
+
'--lang',
|
|
182
|
+
'zh',
|
|
183
|
+
]);
|
|
187
184
|
expect(status).toBe(0);
|
|
188
185
|
expect(widest(stdout)).toBeLessThanOrEqual(120);
|
|
189
186
|
}, SLOW);
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
type: 'command',
|
|
8
8
|
name: 'doctor integration components',
|
|
9
9
|
displayName: 'astryx doctor integration components',
|
|
10
|
-
namespace: 'cli',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
11
|
summary: 'Warn when integration component names conflict with Core',
|
|
12
12
|
description:
|
|
13
13
|
'Compares one local or installed integration with Core component names. A ' +
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
type: 'command',
|
|
8
8
|
name: 'doctor integration docs',
|
|
9
9
|
displayName: 'astryx doctor integration docs',
|
|
10
|
-
namespace: 'cli',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
11
|
summary: 'Classify integration doc overlaps with Core topics',
|
|
12
12
|
description:
|
|
13
13
|
'Reports intentional Core topic replacements and extensions as information. ' +
|
|
@@ -9,7 +9,7 @@ export const doc = {
|
|
|
9
9
|
type: 'command',
|
|
10
10
|
name: 'doctor integration templates',
|
|
11
11
|
displayName: 'astryx doctor integration templates',
|
|
12
|
-
namespace: 'cli',
|
|
12
|
+
namespace: 'cli/commands',
|
|
13
13
|
summary: 'Warn when integration template ids conflict with Core',
|
|
14
14
|
description:
|
|
15
15
|
'Compares one local or installed integration with the built-in Core page and ' +
|
|
@@ -9,7 +9,7 @@ export const doc = {
|
|
|
9
9
|
type: 'command',
|
|
10
10
|
name: 'doctor integration validate',
|
|
11
11
|
displayName: 'astryx doctor integration validate',
|
|
12
|
-
namespace: 'cli',
|
|
12
|
+
namespace: 'cli/commands',
|
|
13
13
|
summary: 'Validate an integration manifest and its contributions',
|
|
14
14
|
description:
|
|
15
15
|
'Validates one integration at a time: the local package rooted at cwd, or an ' +
|
|
@@ -9,7 +9,7 @@ export const doc = {
|
|
|
9
9
|
type: 'command',
|
|
10
10
|
name: 'doctor integration',
|
|
11
11
|
displayName: 'astryx doctor integration',
|
|
12
|
-
namespace: 'cli',
|
|
12
|
+
namespace: 'cli/commands',
|
|
13
13
|
summary: 'Check an integration package while authoring it',
|
|
14
14
|
description:
|
|
15
15
|
'The integration-authoring diagnostics group. Validate a manifest and all ' +
|
|
@@ -44,7 +44,7 @@ function writeIntegration({
|
|
|
44
44
|
const stem = path.join(tmpDir, 'templates', id);
|
|
45
45
|
fs.mkdirSync(path.dirname(stem), {recursive: true});
|
|
46
46
|
fs.writeFileSync(
|
|
47
|
-
`${stem}.
|
|
47
|
+
`${stem}.doc.mjs`,
|
|
48
48
|
`export default {type: 'page', name: ${JSON.stringify(name)}, description: 'fixture'};\n`,
|
|
49
49
|
);
|
|
50
50
|
fs.writeFileSync(
|
|
@@ -124,7 +124,12 @@ describe('doctor integration — command', () => {
|
|
|
124
124
|
return true;
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
await createProgram().parseAsync([
|
|
127
|
+
await createProgram().parseAsync([
|
|
128
|
+
'node',
|
|
129
|
+
'astryx',
|
|
130
|
+
'doctor',
|
|
131
|
+
'integration',
|
|
132
|
+
]);
|
|
128
133
|
|
|
129
134
|
const output = writes.join('');
|
|
130
135
|
expect(output).toContain('validate [package]');
|
|
@@ -136,7 +141,9 @@ describe('doctor integration — command', () => {
|
|
|
136
141
|
|
|
137
142
|
it('explains the optional package argument in every leaf help', () => {
|
|
138
143
|
const program = createProgram();
|
|
139
|
-
const doctor = program.commands.find(
|
|
144
|
+
const doctor = program.commands.find(
|
|
145
|
+
command => command.name() === 'doctor',
|
|
146
|
+
);
|
|
140
147
|
const integration = doctor?.commands.find(
|
|
141
148
|
command => command.name() === 'integration',
|
|
142
149
|
);
|
|
@@ -152,7 +159,10 @@ describe('doctor integration — command', () => {
|
|
|
152
159
|
});
|
|
153
160
|
|
|
154
161
|
it('templates explains how to check an installed package when no local manifest exists', async () => {
|
|
155
|
-
fs.writeFileSync(
|
|
162
|
+
fs.writeFileSync(
|
|
163
|
+
path.join(tmpDir, 'package.json'),
|
|
164
|
+
JSON.stringify({name: 'plain'}),
|
|
165
|
+
);
|
|
156
166
|
process.chdir(tmpDir);
|
|
157
167
|
|
|
158
168
|
await createProgram().parseAsync([
|
|
@@ -278,9 +288,7 @@ describe('doctor integration — command', () => {
|
|
|
278
288
|
const output = logCalls.join('\n');
|
|
279
289
|
expect(output).toContain('[warn]');
|
|
280
290
|
expect(output).toContain(core.name);
|
|
281
|
-
expect(output).toContain(
|
|
282
|
-
`component ${core.name} --package @acme/widgets`,
|
|
283
|
-
);
|
|
291
|
+
expect(output).toContain(`component ${core.name} --package @acme/widgets`);
|
|
284
292
|
expect(process.exitCode).toBeUndefined();
|
|
285
293
|
});
|
|
286
294
|
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'doctor',
|
|
14
14
|
displayName: 'astryx doctor',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'Diagnose Astryx projects and integration packages',
|
|
17
17
|
description:
|
|
18
18
|
'Runs read-only project health diagnostics by default: Node version, @astryxdesign/core ' +
|
|
@@ -10,7 +10,7 @@ export const doc = {
|
|
|
10
10
|
type: 'command',
|
|
11
11
|
name: 'gap-report',
|
|
12
12
|
displayName: 'astryx gap-report',
|
|
13
|
-
namespace: 'cli',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
14
|
summary: 'Route a design-system gap to its owning package',
|
|
15
15
|
description:
|
|
16
16
|
'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability. The command selects an explicit package first, then a unique component owner, then Core. The report fans out to every effective handler: project config first, then each loaded integration in config order. Public handlers require --confirm-public per handler; internal handlers always run. A handler failure is isolated and does not prevent later handlers.',
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'hook',
|
|
14
14
|
displayName: 'astryx hook',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'List hooks or print hook docs',
|
|
17
17
|
description:
|
|
18
18
|
'Resolves a hook by name and prints its authored doc, or lists the catalog grouped ' +
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'init',
|
|
14
14
|
displayName: 'astryx init',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'Initialize the design system in your project',
|
|
17
17
|
description:
|
|
18
18
|
'Non-interactive project setup (no prompts, so it behaves the same for humans, ' +
|
|
@@ -126,7 +126,7 @@ describe('integration add control definitions', () => {
|
|
|
126
126
|
);
|
|
127
127
|
expect(page.status).toBe(0);
|
|
128
128
|
expect(
|
|
129
|
-
fs.readFileSync(path.join(tmpDir, 'templates', 'acme-page.
|
|
129
|
+
fs.readFileSync(path.join(tmpDir, 'templates', 'acme-page.doc.mjs'), 'utf-8'),
|
|
130
130
|
).toContain("type: 'page'");
|
|
131
131
|
});
|
|
132
132
|
});
|
|
@@ -5,7 +5,7 @@ export const doc = {
|
|
|
5
5
|
type: 'command',
|
|
6
6
|
name: 'integration add',
|
|
7
7
|
displayName: 'astryx integration add',
|
|
8
|
-
namespace: 'cli',
|
|
8
|
+
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Add one working contribution to an integration package',
|
|
10
10
|
description:
|
|
11
11
|
'Writes the complete minimum shape the selected contribution needs, creates the integration manifest on first use, declares the root only after a valid contribution exists, and verifies the result through the same discovery contract the packed-package check uses.',
|
|
@@ -5,7 +5,7 @@ export const doc = {
|
|
|
5
5
|
type: 'command',
|
|
6
6
|
name: 'integration pack',
|
|
7
7
|
displayName: 'astryx integration pack',
|
|
8
|
-
namespace: 'cli',
|
|
8
|
+
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Prove the packed integration is what consumers receive',
|
|
10
10
|
description:
|
|
11
11
|
'Runs the package lifecycle, packs with npm, checks every required contribution file against the real tarball, extracts it into a scratch consumer, and compares the local and packed contribution inventories through one shared contract.',
|
|
@@ -201,13 +201,6 @@ export const oceanTheme = defineTheme({
|
|
|
201
201
|
});
|
|
202
202
|
`,
|
|
203
203
|
);
|
|
204
|
-
const catalogFile = path.join(providerDir, 'themes', 'manifest.json');
|
|
205
|
-
const catalog = JSON.parse(fs.readFileSync(catalogFile, 'utf-8'));
|
|
206
|
-
catalog.themes[0].files.push(
|
|
207
|
-
'tokens/ocean.palette.ts',
|
|
208
|
-
'tokens/ocean.palette.receipt.json',
|
|
209
|
-
);
|
|
210
|
-
writeJson(catalogFile, catalog);
|
|
211
204
|
|
|
212
205
|
const providerPackage = JSON.parse(
|
|
213
206
|
fs.readFileSync(path.join(providerDir, 'package.json'), 'utf-8'),
|
|
@@ -464,8 +457,9 @@ export const oceanTheme = defineTheme({
|
|
|
464
457
|
outputDir: target,
|
|
465
458
|
files: [
|
|
466
459
|
'oceanTheme.ts',
|
|
467
|
-
'
|
|
460
|
+
'oceanTheme.doc.mjs',
|
|
468
461
|
'tokens/ocean.palette.receipt.json',
|
|
462
|
+
'tokens/ocean.palette.ts',
|
|
469
463
|
],
|
|
470
464
|
},
|
|
471
465
|
});
|
|
@@ -612,7 +606,7 @@ export const oceanTheme = defineTheme({
|
|
|
612
606
|
expect(corruptedInstall.status).not.toBe(0);
|
|
613
607
|
expect(parseEnvelope(corruptedInstall.stdout)).toMatchObject({
|
|
614
608
|
code: 'ERR_THEME_INVALID',
|
|
615
|
-
error: expect.stringContaining('ocean.palette
|
|
609
|
+
error: expect.stringContaining('./tokens/ocean.palette'),
|
|
616
610
|
});
|
|
617
611
|
}, 120_000);
|
|
618
612
|
});
|
|
@@ -5,7 +5,7 @@ export const doc = {
|
|
|
5
5
|
type: 'command',
|
|
6
6
|
name: 'integration',
|
|
7
7
|
displayName: 'astryx integration',
|
|
8
|
-
namespace: 'cli',
|
|
8
|
+
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Author and verify an Astryx integration package',
|
|
10
10
|
description:
|
|
11
11
|
'Add contributions that are valid on arrival, then prove the packed package exposes the same contributions a consumer will receive.',
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
type: 'command',
|
|
14
14
|
name: 'layout expand',
|
|
15
15
|
displayName: 'astryx layout expand',
|
|
16
|
-
namespace: 'cli',
|
|
16
|
+
namespace: 'cli/commands',
|
|
17
17
|
summary: 'Expand a layout expression into validated XDS TSX',
|
|
18
18
|
description:
|
|
19
19
|
'Parses and validates a compressed XLE/XLO expression, then expands it into ' +
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
type: 'command',
|
|
14
14
|
name: 'layout grammar',
|
|
15
15
|
displayName: 'astryx layout grammar',
|
|
16
|
-
namespace: 'cli',
|
|
16
|
+
namespace: 'cli/commands',
|
|
17
17
|
summary:
|
|
18
18
|
'Print the XLE/XLO cheatsheet (alias table generated from this branch)',
|
|
19
19
|
description:
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'layout',
|
|
14
14
|
displayName: 'astryx layout',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'Generate XDS layouts from compressed expressions (XLE/XLO)',
|
|
17
17
|
description:
|
|
18
18
|
'The layout command group. Running astryx layout with no subcommand prints the ' +
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'manifest',
|
|
14
14
|
displayName: 'astryx manifest',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'Print the full CLI capability manifest (use with --json).',
|
|
17
17
|
description:
|
|
18
18
|
'Emits the complete CLI surface: every command with its arguments, options, ' +
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'search',
|
|
14
14
|
displayName: 'astryx search',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'Search components, hooks, docs, and templates in one ranked list',
|
|
17
17
|
description:
|
|
18
18
|
'Terminal front-end to search(): prints one ranked, greppable list across ' +
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'command',
|
|
13
13
|
name: 'swizzle',
|
|
14
14
|
displayName: 'astryx swizzle',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/commands',
|
|
16
16
|
summary: 'Copy component source for customization',
|
|
17
17
|
description:
|
|
18
18
|
"Ejects a component's source from the resolved @astryxdesign/core (or its owning " +
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
type: 'command',
|
|
14
14
|
name: 'template',
|
|
15
15
|
displayName: 'astryx template',
|
|
16
|
-
namespace: 'cli',
|
|
16
|
+
namespace: 'cli/commands',
|
|
17
17
|
summary: 'Inject a page or block template',
|
|
18
18
|
description:
|
|
19
19
|
'One entry point for the template family: with no name it lists the discovered ' +
|