@astryxdesign/cli 0.7.2-canary.ab79547 → 0.7.2-canary.acfd1ff
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 +74 -73
- package/api/build/help/help.mjs +1 -1
- package/api/component/_adapter.d.mts +41 -1
- package/api/component/_adapter.mjs +93 -7
- package/api/component/component.mjs +22 -5
- package/api/component/integration-export-name.test.mjs +644 -0
- package/api/discover/_adapter.d.mts +119 -12
- package/api/discover/_adapter.mjs +449 -10
- package/api/discover/_adapter.test.mjs +599 -17
- package/api/discover/_catalog-view.d.mts +16 -5
- package/api/discover/_catalog-view.mjs +32 -8
- package/api/discover/discover.d.mts +11 -0
- package/api/discover/discover.doc.mjs +7 -6
- package/api/discover/discover.mjs +107 -19
- package/api/discover/discover.type.d.mts +18 -7
- package/api/discover/discover.type.mjs +15 -7
- package/api/discover/list/list.d.mts +4 -3
- package/api/discover/list/list.mjs +17 -10
- package/api/docs/_adapter.d.mts +11 -0
- package/api/docs/_adapter.mjs +244 -1
- package/api/docs/integrationDocs.test.mjs +124 -0
- package/api/doctor/doctor.mjs +27 -3
- package/api/doctor/doctor.test.mjs +43 -0
- package/api/doctor/theme-checks.mjs +1 -1
- package/api/doctor/theme-checks.test.mjs +136 -0
- package/api/gap-report/gap-report.d.mts +3 -0
- package/api/gap-report/gap-report.doc.mjs +11 -3
- package/api/gap-report/gap-report.mjs +219 -52
- package/api/gap-report/gap-report.test.mjs +233 -0
- package/api/gap-report/gap-report.type.d.mts +41 -0
- package/api/gap-report/gap-report.type.mjs +18 -0
- package/api/index.d.mts +2 -0
- package/api/index.mjs +2 -0
- package/api/init/run/run.mjs +2 -2
- package/api/integration/_adapter.d.mts +32 -0
- package/api/integration/_adapter.mjs +80 -0
- package/api/integration/add-contribution.component-names.test.mjs +66 -0
- package/api/integration/add-contribution.mjs +8 -4
- package/api/integration/add-contribution.test.mjs +4 -2
- package/api/integration/authoring-checks.mjs +44 -4
- package/api/integration/authoring-checks.test.mjs +515 -0
- package/api/integration/authoring-checks.type.d.mts +95 -0
- package/api/integration/authoring-checks.type.mjs +53 -2
- package/api/integration/check/check.d.mts +96 -0
- package/api/integration/check/check.mjs +357 -0
- package/api/integration/check/check.test.mjs +489 -0
- package/api/integration/integration-check.type.d.mts +118 -0
- package/api/integration/integration-check.type.mjs +84 -0
- package/api/integration/integrationCheck.doc.d.mts +10 -0
- package/api/integration/integrationCheck.doc.mjs +73 -0
- package/api/integration/integrationComponentConflicts.doc.mjs +43 -6
- package/api/integration/integrationDocConflicts.doc.mjs +19 -5
- package/api/integration/pack-check.mjs +343 -104
- package/api/integration/pack-check.test.mjs +726 -0
- package/api/integration/validate-integration-fixes.test.mjs +67 -0
- package/api/integration/validate-integration.mjs +8 -0
- package/api/integration/validate-integration.test.mjs +41 -0
- package/api/integration/validate-integration.type.d.mts +8 -0
- package/api/integration/validate-integration.type.mjs +12 -1
- package/api/integration/validateIntegration.doc.mjs +19 -3
- package/api/search/search.d.mts +81 -12
- package/api/search/search.domain-priority.test.mjs +108 -18
- package/api/search/search.integration-check.test.mjs +24 -0
- package/api/search/search.mjs +601 -50
- package/api/search/search.test.mjs +139 -0
- package/api/swizzle/copy/copy.mjs +28 -14
- package/api/theme/build/build.family.test.mjs +54 -6
- package/api/theme/build/build.mjs +114 -17
- package/api/theme/themeBuild.doc.mjs +4 -4
- package/api/upgrade/_adapter.d.mts +40 -2
- package/api/upgrade/_adapter.mjs +117 -4
- package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
- package/api/upgrade/run/run.mjs +30 -1
- package/api/upgrade/status/status.d.mts +21 -5
- package/api/upgrade/status/status.mjs +45 -8
- package/api/upgrade/upgrade.doc.mjs +5 -3
- package/api/upgrade/upgrade.type.d.mts +23 -0
- package/api/upgrade/upgrade.type.mjs +16 -1
- package/assets/codemods/runner.mjs +7 -1
- package/assets/discover/official-packages.json +367 -0
- package/assets/docs/README.md +10 -0
- package/assets/docs/author-a-theme.doc.mjs +3 -3
- package/assets/docs/browser-support.doc.mjs +1 -1
- package/assets/docs/getting-started.doc.mjs +3 -3
- package/assets/docs/styling-overview.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +2 -2
- package/assets/docs/theme.doc.zh.mjs +1 -1
- package/assets/docs/tree/add-a-component.doc.mjs +11 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
- package/assets/docs/tree/add-a-topic.doc.mjs +11 -8
- package/assets/docs/tree/agent-guidance.doc.mjs +2 -2
- package/assets/docs/tree/block-template.doc.mjs +8 -20
- package/assets/docs/tree/build-the-template.doc.mjs +1 -1
- package/assets/docs/tree/check-the-props.doc.mjs +196 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +61 -7
- package/assets/docs/tree/checks.doc.mjs +26 -18
- package/assets/docs/tree/codemods.doc.mjs +4 -4
- package/assets/docs/tree/component-family.doc.mjs +8 -6
- package/assets/docs/tree/component-imports.doc.mjs +10 -2
- package/assets/docs/tree/components.doc.mjs +1 -1
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +30 -21
- package/assets/docs/tree/define-the-theme.doc.mjs +6 -5
- package/assets/docs/tree/describe-the-component.doc.mjs +2 -2
- package/assets/docs/tree/docs.doc.mjs +3 -3
- package/assets/docs/tree/document-the-template.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
- package/assets/docs/tree/extend-or-replace.doc.mjs +6 -6
- package/assets/docs/tree/fonts-and-assets.doc.mjs +2 -2
- package/assets/docs/tree/generate-a-palette.doc.mjs +5 -3
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +1 -1
- package/assets/docs/tree/integrations.doc.mjs +8 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +2 -3
- package/assets/docs/tree/layout.doc.mjs +6 -6
- package/assets/docs/tree/links.doc.mjs +6 -5
- package/assets/docs/tree/migration-setup.doc.mjs +3 -2
- package/assets/docs/tree/migration-verification.doc.mjs +0 -1
- package/assets/docs/tree/migration.doc.mjs +0 -1
- package/assets/docs/tree/package-and-test.doc.mjs +1 -1
- package/assets/docs/tree/page-template.doc.mjs +4 -8
- package/assets/docs/tree/publishing.doc.mjs +4 -4
- package/assets/docs/tree/quick-start.doc.mjs +38 -22
- package/assets/docs/tree/replace-a-core-component.doc.mjs +4 -6
- package/assets/docs/tree/replace-a-core-template.doc.mjs +6 -8
- package/assets/docs/tree/sections-and-placement.doc.mjs +6 -8
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +4 -2
- package/assets/docs/tree/short-and-findable.doc.mjs +6 -5
- package/assets/docs/tree/single-component.doc.mjs +15 -6
- package/assets/docs/tree/start-a-template.doc.mjs +3 -3
- package/assets/docs/tree/subcomponent.doc.mjs +6 -6
- package/assets/docs/tree/template-assets.doc.mjs +2 -2
- package/assets/docs/tree/template-doc-overview.doc.mjs +5 -16
- package/assets/docs/tree/template-fonts.doc.mjs +1 -1
- package/assets/docs/tree/template-icons.doc.mjs +1 -1
- package/assets/docs/tree/template-images-media.doc.mjs +1 -1
- package/assets/docs/tree/template-styles.doc.mjs +2 -2
- package/assets/docs/tree/templates.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +3 -3
- package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
- package/assets/docs/tree/tokens-and-setup.doc.mjs +19 -15
- package/assets/docs/tree/troubleshooting.doc.mjs +16 -8
- package/assets/docs/tree/type-scale.doc.mjs +3 -3
- package/assets/docs/tree/upgrading.doc.mjs +4 -4
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +3 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +7 -6
- package/assets/docs/tree/write-the-template-file.doc.mjs +4 -3
- package/assets/docs/use-a-theme.doc.mjs +2 -2
- package/assets/theme.template.ts +1 -1
- package/authoring/codemod/codemod.doc.mjs +7 -3
- package/authoring/config/config.doc.mjs +9 -6
- package/authoring/config/type.ts +4 -2
- package/authoring/discover/discover.doc.mjs +1 -1
- package/authoring/doctypes/base/graph-fields.doc.mjs +6 -4
- package/authoring/doctypes/command/command.doc.mjs +14 -12
- package/authoring/doctypes/component/component.doc.mjs +30 -27
- package/authoring/doctypes/component/type.ts +13 -8
- package/authoring/doctypes/enum/enum.doc.mjs +7 -4
- package/authoring/doctypes/function/function.doc.mjs +9 -8
- package/authoring/doctypes/hook/hook.doc.mjs +5 -4
- package/authoring/doctypes/namespace/namespace.doc.mjs +7 -6
- package/authoring/doctypes/reference/reference.doc.mjs +11 -10
- package/authoring/doctypes/schema/schema.doc.mjs +9 -9
- package/authoring/doctypes/template/integration-template.doc.d.mts +11 -0
- package/authoring/doctypes/template/integration-template.doc.mjs +49 -0
- package/authoring/doctypes/template/parse.d.mts +6 -2
- package/authoring/doctypes/template/parse.mjs +3 -1
- package/authoring/doctypes/template/template.doc.mjs +3 -3
- package/authoring/doctypes/template/type.ts +22 -0
- package/authoring/doctypes/theme/theme.doc.mjs +2 -2
- package/authoring/gap-report/gap-report.doc.mjs +2 -2
- package/authoring/identity/identity.doc.mjs +3 -3
- package/authoring/index.d.ts +1 -0
- package/authoring/integration/integration.doc.mjs +12 -4
- package/authoring/integration/parse.test.mjs +10 -0
- package/authoring/integration/schema.d.mts +2 -0
- package/authoring/integration/schema.mjs +1 -0
- package/authoring/integration/type.ts +4 -0
- package/clients/cli/commands/build-theme.batch-report.test.mjs +3 -1
- package/clients/cli/commands/build-theme.mjs +1 -1
- package/clients/cli/commands/build-theme.path-safety.test.mjs +155 -21
- package/clients/cli/commands/cli-postinstall.test.mjs +49 -1
- package/clients/cli/commands/discover.broken-integration.test.mjs +4 -1
- package/clients/cli/commands/discover.doc.mjs +1 -1
- package/clients/cli/commands/discover.mjs +144 -93
- package/clients/cli/commands/discover.no-source.test.mjs +447 -33
- package/clients/cli/commands/discover.sources.test.mjs +20 -1
- package/clients/cli/commands/doctor-integration-components.doc.mjs +17 -4
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +18 -5
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +13 -2
- package/clients/cli/commands/doctor-integration.test.mjs +837 -0
- package/clients/cli/commands/doctor.mjs +250 -3
- package/clients/cli/commands/gap-report.doc.mjs +14 -2
- package/clients/cli/commands/gap-report.mjs +24 -2
- package/clients/cli/commands/gap-report.test.mjs +79 -0
- package/clients/cli/commands/integration-check.doc.mjs +85 -0
- package/clients/cli/commands/integration-check.test.mjs +370 -0
- package/clients/cli/commands/integration.doc.mjs +6 -2
- package/clients/cli/commands/integration.mjs +106 -1
- package/clients/cli/commands/json-contract.test.mjs +5 -1
- package/clients/cli/commands/setup-nudge.test.mjs +79 -1
- package/clients/cli/commands/swizzle.mjs +5 -3
- package/clients/cli/commands/swizzle.routing.test.mjs +18 -1
- package/clients/cli/commands/text-json-parity.test.mjs +5 -0
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/commands/upgrade.doc.mjs +14 -0
- package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
- package/clients/cli/index.mjs +30 -5
- package/foundation/agent-docs/agent-doc-state.d.mts +14 -0
- package/foundation/agent-docs/agent-doc-state.mjs +38 -0
- package/foundation/agent-docs/agent-docs.d.mts +2 -1
- package/foundation/agent-docs/agent-docs.mjs +8 -6
- package/foundation/config/project.mjs +82 -0
- package/foundation/discovery/authoring-self-docs.mjs +2 -1
- package/foundation/discovery/component-discovery.d.mts +178 -10
- package/foundation/discovery/component-discovery.export-names.test.mjs +760 -0
- package/foundation/discovery/component-discovery.mjs +659 -62
- package/foundation/discovery/component-replacement.mjs +18 -0
- package/foundation/discovery/component-replacement.test.mjs +40 -0
- package/foundation/discovery/copied-passages.d.mts +216 -0
- package/foundation/discovery/copied-passages.mjs +720 -0
- package/foundation/discovery/copied-passages.test.mjs +124 -0
- package/foundation/discovery/doc-fluff.d.mts +112 -0
- package/foundation/discovery/doc-fluff.mjs +328 -0
- package/foundation/discovery/doc-fluff.test.mjs +142 -0
- package/foundation/discovery/doc-types.d.mts +157 -0
- package/foundation/discovery/doc-types.mjs +1224 -0
- package/foundation/discovery/doc-types.test.mjs +700 -0
- package/foundation/discovery/docs-discovery.d.mts +88 -0
- package/foundation/discovery/docs-discovery.mjs +83 -2
- package/foundation/discovery/integration-doc-files.d.mts +22 -0
- package/foundation/discovery/integration-doc-files.mjs +231 -0
- package/foundation/discovery/integration-doc-files.test.mjs +246 -0
- package/foundation/discovery/module-exports.d.mts +27 -0
- package/foundation/discovery/module-exports.mjs +356 -31
- package/foundation/discovery/module-exports.test.mjs +172 -0
- package/foundation/discovery/package-tsconfig.d.mts +14 -0
- package/foundation/discovery/package-tsconfig.mjs +228 -0
- package/foundation/discovery/package-tsconfig.test.mjs +210 -0
- package/foundation/discovery/project-typescript.d.mts +32 -0
- package/foundation/discovery/project-typescript.mjs +89 -0
- package/foundation/discovery/prop-drift.d.mts +278 -0
- package/foundation/discovery/prop-drift.mjs +2263 -0
- package/foundation/discovery/prop-drift.test.mjs +2272 -0
- package/foundation/discovery/type-match.d.mts +53 -0
- package/foundation/discovery/type-match.mjs +660 -0
- package/foundation/discovery/type-match.test.mjs +169 -0
- package/foundation/discovery/type-text.d.mts +68 -0
- package/foundation/discovery/type-text.mjs +658 -0
- package/foundation/discovery/type-text.test.mjs +196 -0
- package/foundation/discovery/unresolved-references.d.mts +62 -0
- package/foundation/discovery/unresolved-references.mjs +790 -0
- package/foundation/discovery/unresolved-references.test.mjs +567 -0
- package/foundation/doc-compiler/doc-loads.test.mjs +18 -0
- package/foundation/doc-compiler/links.d.mts +9 -5
- package/foundation/doc-compiler/links.mjs +4 -2
- package/foundation/env/package-manager.d.mts +32 -0
- package/foundation/env/package-manager.mjs +47 -0
- package/foundation/env/package-manager.test.mjs +194 -7
- package/foundation/fs/module-loader.d.mts +2 -1
- package/foundation/fs/module-loader.mjs +60 -4
- package/foundation/fs/module-loader.test.mjs +194 -0
- package/foundation/integrations/contribution-inventory.d.mts +11 -0
- package/foundation/integrations/contribution-inventory.mjs +56 -3
- package/foundation/integrations/validate-contributions.mjs +30 -1
- package/foundation/response/response-types.doc.mjs +14 -8
- package/package.json +11 -11
- package/scripts/postinstall.mjs +3 -3
|
@@ -95,6 +95,17 @@ export function compareIdentities(local: ContributionIdentities, packed: Contrib
|
|
|
95
95
|
* @returns {string[]} unregistered PascalCase names
|
|
96
96
|
*/
|
|
97
97
|
export function findSourceOnlyCandidates(componentsRoot: string | undefined, registeredNames: string[]): string[];
|
|
98
|
+
/**
|
|
99
|
+
* Find `.tsx` files directly in a templates root that have no same-stem
|
|
100
|
+
* template metadata, so template discovery never lists them. Like the
|
|
101
|
+
* component check, it scans only direct children of the root: a file in a
|
|
102
|
+
* subfolder may be a helper a template imports. A file with a dotted stem (a
|
|
103
|
+
* test, story, or similar companion) is never a candidate.
|
|
104
|
+
*
|
|
105
|
+
* @param {string|undefined} templatesRoot absolute path
|
|
106
|
+
* @returns {string[]} basenames of the unpaired sources, sorted
|
|
107
|
+
*/
|
|
108
|
+
export function findTemplateSourceOnlyCandidates(templatesRoot: string | undefined): string[];
|
|
98
109
|
export type FileInventoryRoot = {
|
|
99
110
|
kind: "themes" | "components" | "templates" | "codemods" | "docs";
|
|
100
111
|
/**
|
|
@@ -248,11 +248,16 @@ export async function collectIdentities(loaded) {
|
|
|
248
248
|
if (loaded.components && fs.existsSync(loaded.components)) {
|
|
249
249
|
try {
|
|
250
250
|
const records = discoverIntegrationComponents(loaded) ?? [];
|
|
251
|
+
// A family doc backs several records: load it, and report it, once.
|
|
252
|
+
const loads = new Map();
|
|
251
253
|
for (const record of records) {
|
|
254
|
+
const first = !loads.has(record.docPath);
|
|
255
|
+
if (first) loads.set(record.docPath, loadComponentDoc(record.docPath));
|
|
252
256
|
try {
|
|
253
|
-
await
|
|
257
|
+
await loads.get(record.docPath);
|
|
254
258
|
identities.components.push(record.name);
|
|
255
259
|
} catch (err) {
|
|
260
|
+
if (!first) continue;
|
|
256
261
|
errors.push({
|
|
257
262
|
kind: 'components',
|
|
258
263
|
message: `${path.relative(loaded.components, record.docPath)}: ${
|
|
@@ -314,8 +319,11 @@ export async function collectIdentities(loaded) {
|
|
|
314
319
|
|
|
315
320
|
if (loaded.docs && fs.existsSync(loaded.docs)) {
|
|
316
321
|
try {
|
|
317
|
-
const {
|
|
318
|
-
|
|
322
|
+
const {
|
|
323
|
+
records,
|
|
324
|
+
guides,
|
|
325
|
+
errors: docErrors,
|
|
326
|
+
} = await discoverIntegrationDocs(loaded);
|
|
319
327
|
for (const docError of docErrors) {
|
|
320
328
|
errors.push({kind: 'docs', message: docError.message});
|
|
321
329
|
}
|
|
@@ -498,3 +506,48 @@ export function findSourceOnlyCandidates(componentsRoot, registeredNames) {
|
|
|
498
506
|
}
|
|
499
507
|
return candidates.sort();
|
|
500
508
|
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Metadata suffixes that pair a template source with its spec: the canonical
|
|
512
|
+
* `.doc.*` family and the released `.template.*` compatibility family.
|
|
513
|
+
*/
|
|
514
|
+
const TEMPLATE_DOC_SUFFIXES = [
|
|
515
|
+
'.doc.ts',
|
|
516
|
+
'.doc.mjs',
|
|
517
|
+
'.doc.js',
|
|
518
|
+
'.template.ts',
|
|
519
|
+
'.template.mjs',
|
|
520
|
+
'.template.js',
|
|
521
|
+
];
|
|
522
|
+
|
|
523
|
+
/** A `.tsx` source and its stem, which may hold a dot (`landing.page`). */
|
|
524
|
+
const TSX_SOURCE = /^(.+)\.tsx$/u;
|
|
525
|
+
|
|
526
|
+
/** A test, spec or story stem: never a template. */
|
|
527
|
+
const NOT_A_TEMPLATE = /\.(?:test|spec|stories)$/u;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Find `.tsx` files directly in a templates root that have no same-stem
|
|
531
|
+
* template metadata, so template discovery never lists them. Like the
|
|
532
|
+
* component check, it scans only direct children of the root: a file in a
|
|
533
|
+
* subfolder may be a helper a template imports. A file with a dotted stem (a
|
|
534
|
+
* test, story, or similar companion) is never a candidate.
|
|
535
|
+
*
|
|
536
|
+
* @param {string|undefined} templatesRoot absolute path
|
|
537
|
+
* @returns {string[]} basenames of the unpaired sources, sorted
|
|
538
|
+
*/
|
|
539
|
+
export function findTemplateSourceOnlyCandidates(templatesRoot) {
|
|
540
|
+
if (!templatesRoot || !fs.existsSync(templatesRoot)) return [];
|
|
541
|
+
/** @type {string[]} */
|
|
542
|
+
const candidates = [];
|
|
543
|
+
for (const entry of fs.readdirSync(templatesRoot, {withFileTypes: true})) {
|
|
544
|
+
if (!entry.isFile() && !entry.isSymbolicLink()) continue;
|
|
545
|
+
const match = entry.name.match(TSX_SOURCE);
|
|
546
|
+
if (!match || NOT_A_TEMPLATE.test(match[1])) continue;
|
|
547
|
+
const paired = TEMPLATE_DOC_SUFFIXES.some(suffix =>
|
|
548
|
+
fs.existsSync(path.join(templatesRoot, `${match[1]}${suffix}`)),
|
|
549
|
+
);
|
|
550
|
+
if (!paired) candidates.push(entry.name);
|
|
551
|
+
}
|
|
552
|
+
return candidates.sort();
|
|
553
|
+
}
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
import * as fs from 'node:fs';
|
|
25
25
|
import * as path from 'node:path';
|
|
26
26
|
import {isValidSemver} from '../env/semver.mjs';
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
findSourceOnlyCandidates,
|
|
29
|
+
findTemplateSourceOnlyCandidates,
|
|
30
|
+
} from './contribution-inventory.mjs';
|
|
28
31
|
import {
|
|
29
32
|
CODEMOD_FILE_RE,
|
|
30
33
|
CODEMOD_SKIP_DIRS,
|
|
@@ -295,6 +298,32 @@ async function checkTemplates(integration, issues) {
|
|
|
295
298
|
issueError('invalid_template', /** @type {any} */ (err).message),
|
|
296
299
|
);
|
|
297
300
|
}
|
|
301
|
+
checkTemplateSourcesWithoutDoc(integration, issues);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Warn about a `.tsx` directly in the templates root with no same-stem template
|
|
306
|
+
* metadata: template discovery pairs sources with docs, so `astryx template`
|
|
307
|
+
* never lists it. A PascalCase file directly in a shared components root is
|
|
308
|
+
* left to the component check, which already warns about it.
|
|
309
|
+
* @param {LoadedIntegration} integration loaded-integration-shaped object
|
|
310
|
+
* @param {Issue[]} issues
|
|
311
|
+
*/
|
|
312
|
+
function checkTemplateSourcesWithoutDoc(integration, issues) {
|
|
313
|
+
const root = /** @type {string} */ (integration.templates);
|
|
314
|
+
const sharedComponents =
|
|
315
|
+
integration.components != null &&
|
|
316
|
+
path.resolve(integration.components) === path.resolve(root);
|
|
317
|
+
for (const file of findTemplateSourceOnlyCandidates(root)) {
|
|
318
|
+
if (sharedComponents && /^[A-Z]/u.test(file)) continue;
|
|
319
|
+
const stem = file.slice(0, -'.tsx'.length);
|
|
320
|
+
issues.push(
|
|
321
|
+
issueWarning(
|
|
322
|
+
'source_without_template_doc',
|
|
323
|
+
`Template source "${file}" has no same-stem metadata file ${stem}.doc.mjs, so \`astryx template\` never lists it. Fix: add ${stem}.doc.mjs beside it with type: 'page' or 'block'; \`astryx docs authoring integration-template-doc\` lists its fields. If it is not a template, move it out of the templates root.`,
|
|
324
|
+
),
|
|
325
|
+
);
|
|
326
|
+
}
|
|
298
327
|
}
|
|
299
328
|
|
|
300
329
|
/**
|
|
@@ -112,7 +112,7 @@ export const doc = {
|
|
|
112
112
|
{
|
|
113
113
|
value: 'discover.list',
|
|
114
114
|
description:
|
|
115
|
-
'
|
|
115
|
+
'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".',
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
value: 'discover.detail',
|
|
@@ -169,12 +169,13 @@ export const doc = {
|
|
|
169
169
|
// gap reports
|
|
170
170
|
{
|
|
171
171
|
value: 'gap-report.categories',
|
|
172
|
-
description:
|
|
172
|
+
description:
|
|
173
|
+
'The fixed gap category values and human-readable labels; when a loaded integration names its own issues URL, meta.destinations lists every destination ({to, default, issuesUrl}) and meta.ask tells an agent to ask the person.',
|
|
173
174
|
},
|
|
174
175
|
{
|
|
175
176
|
value: 'gap-report.file',
|
|
176
177
|
description:
|
|
177
|
-
'An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project | integration | fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals.',
|
|
178
|
+
'An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project | integration | fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals; without --to, when a loaded integration names its own issues URL, destinations and ask as on gap-report.categories.',
|
|
178
179
|
},
|
|
179
180
|
|
|
180
181
|
// template
|
|
@@ -283,12 +284,12 @@ export const doc = {
|
|
|
283
284
|
{
|
|
284
285
|
value: 'upgrade.status',
|
|
285
286
|
description:
|
|
286
|
-
'A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary.',
|
|
287
|
+
'A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. no_codemods and config_fixable carry cliBehindCore ({cliVersion, command}) when the installed Core is newer than the CLI, which then has no codemods for the releases after its own version.',
|
|
287
288
|
},
|
|
288
289
|
{
|
|
289
290
|
value: 'upgrade.run',
|
|
290
291
|
description:
|
|
291
|
-
'The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors.',
|
|
292
|
+
'The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors. When the installed Core is newer than the CLI, it also carries cliBehindCore ({cliVersion, command}): codemods for the releases after cliVersion did not run.',
|
|
292
293
|
},
|
|
293
294
|
|
|
294
295
|
// manifest
|
|
@@ -332,7 +333,7 @@ export const doc = {
|
|
|
332
333
|
{
|
|
333
334
|
value: 'integration.validate',
|
|
334
335
|
description:
|
|
335
|
-
'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}.',
|
|
336
|
+
'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}. 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).',
|
|
336
337
|
},
|
|
337
338
|
{
|
|
338
339
|
value: 'integration.template-conflicts',
|
|
@@ -342,12 +343,17 @@ export const doc = {
|
|
|
342
343
|
{
|
|
343
344
|
value: 'integration.component-conflicts',
|
|
344
345
|
description:
|
|
345
|
-
'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command.',
|
|
346
|
+
'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. When the manifest loads and declares a components root, propDrift compares documented props with the TypeScript props: status (checked | skipped), reason, typescript, components, typesCompared, typesSkipped, findings (all warnings), unchecked, typesNotCompared, and propsNotChecked.',
|
|
346
347
|
},
|
|
347
348
|
{
|
|
348
349
|
value: 'integration.doc-conflicts',
|
|
349
350
|
description:
|
|
350
|
-
'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` | `error`) and `relationship` (`replaces` | `extends` | `accidental`).',
|
|
351
|
+
'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` | `error`) and `relationship` (`replaces` | `extends` | `accidental`). copiedPassages lists each pair of topics that repeat 10 or more words of prose word for word: topic, section, otherTopic, otherOwner (package | core), words, passages, owner (the topic that should keep the text), text (the passage as the topic writes it), line (where the copy starts in the topic to change, or null), and message (the exact replacement); each is also a copied_passage warning in issues. fluff lists padding phrases and low-density topics: topic, kind (phrase | density), phrase, section, file, line, density, and message (what to cut or write instead); each is also a doc_fluff warning in issues.',
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
value: 'integration.check',
|
|
355
|
+
description:
|
|
356
|
+
'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.',
|
|
351
357
|
},
|
|
352
358
|
],
|
|
353
359
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.2-canary.
|
|
3
|
+
"version": "0.7.2-canary.acfd1ff",
|
|
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",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"zod": "^4.4.3"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@astryxdesign/charts": "0.7.2-canary.
|
|
105
|
-
"@astryxdesign/core": "0.7.2-canary.
|
|
106
|
-
"@astryxdesign/lab": "0.7.2-canary.
|
|
107
|
-
"@astryxdesign/theme-neutral": "0.7.2-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.7.2-canary.acfd1ff",
|
|
105
|
+
"@astryxdesign/core": "0.7.2-canary.acfd1ff",
|
|
106
|
+
"@astryxdesign/lab": "0.7.2-canary.acfd1ff",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.7.2-canary.acfd1ff"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@astryxdesign/charts": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.7.2-canary.
|
|
125
|
-
"@astryxdesign/core": "0.7.2-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.7.2-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.7.2-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.7.2-canary.acfd1ff",
|
|
125
|
+
"@astryxdesign/core": "0.7.2-canary.acfd1ff",
|
|
126
|
+
"@astryxdesign/lab": "0.7.2-canary.acfd1ff",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.7.2-canary.acfd1ff",
|
|
128
128
|
"@heroicons/react": "^2.2.0",
|
|
129
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
130
|
"@types/babel__core": "^7.20.5",
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"scripts": {
|
|
135
135
|
"astryx": "node clients/cli/bin/astryx.mjs",
|
|
136
136
|
"postinstall": "node scripts/postinstall.mjs",
|
|
137
|
-
"test": "vitest run
|
|
138
|
-
"test:watch": "
|
|
137
|
+
"test": "cd ../.. && vitest run packages/cli",
|
|
138
|
+
"test:watch": "cd ../.. && vitest packages/cli",
|
|
139
139
|
"typecheck:template-docs": "tsc --project tsconfig.template-docs.json",
|
|
140
140
|
"typecheck:json-api": "tsc --project tsconfig.json-api.json",
|
|
141
141
|
"typecheck:strict": "tsc --project tsconfig.strict.json",
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* installed as a project dependency and the project hasn't run init yet, print a
|
|
8
8
|
* one-line next-step so agents/humans discover it.
|
|
9
9
|
*
|
|
10
|
-
* Reuses the ONE setup check (
|
|
10
|
+
* Reuses the ONE setup check (isAstryxPromptInReach) from the dependency-free leaf
|
|
11
11
|
* ../foundation/agent-docs/agent-doc-state.mjs — node builtins only, so it is
|
|
12
12
|
* genuinely safe to load at install time (importing agent-docs.mjs would drag in
|
|
13
13
|
* the full CLI module graph). Non-interactive, never fails the install, and
|
|
@@ -41,10 +41,10 @@ async function projectIsSetUp(root) {
|
|
|
41
41
|
// Dep-free leaf (node builtins only) — safe to load mid-install. NOT
|
|
42
42
|
// agent-docs.mjs, whose static graph (component discovery, package-manager
|
|
43
43
|
// detection, …) isn't guaranteed importable yet during this postinstall.
|
|
44
|
-
const {
|
|
44
|
+
const {isAstryxPromptInReach} = await import(
|
|
45
45
|
'../foundation/agent-docs/agent-doc-state.mjs'
|
|
46
46
|
);
|
|
47
|
-
return
|
|
47
|
+
return isAstryxPromptInReach(root);
|
|
48
48
|
} catch {
|
|
49
49
|
return false; // best-effort — if the check can't load, fall through and nudge
|
|
50
50
|
}
|