@astryxdesign/cli 0.6.3-canary.bcf01fe → 0.6.3-canary.c13ef6b
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/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +2 -2
- package/api/component/component.type.d.mts +6 -6
- package/api/component/component.type.mjs +19 -19
- package/api/discover/discover.type.d.mts +4 -4
- package/api/discover/discover.type.mjs +10 -10
- package/api/docs/docs.type.d.mts +4 -4
- package/api/docs/docs.type.mjs +10 -10
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/integration/add-contribution.mjs +5 -3
- package/api/integration/add-contribution.test.mjs +4 -4
- package/api/integration/pack-check.mjs +49 -7
- package/api/integration/pack-check.test.mjs +249 -0
- package/api/search/search.type.d.mts +1 -1
- package/api/search/search.type.mjs +1 -1
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/template.type.d.mts +5 -5
- package/api/template/template.type.mjs +12 -12
- package/api/theme/build/build.mjs +20 -6
- package/api/theme/build/build.test.mjs +127 -0
- package/api/theme/palette/generate/generate.mjs +1 -1
- package/api/theme/palette/generate/generator.d.mts +10 -13
- package/api/theme/palette/generate/generator.mjs +7 -3
- package/api/theme/theme.type.d.mts +170 -11
- package/api/theme/theme.type.mjs +94 -27
- package/api/upgrade/upgrade.type.d.mts +4 -4
- package/api/upgrade/upgrade.type.mjs +10 -10
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- package/authoring/_shared/contract.ts +22 -0
- package/authoring/codemod/codemod.doc.mjs +6 -1
- package/authoring/codemod/parse.d.mts +8 -8
- package/authoring/codemod/parse.mjs +8 -6
- package/authoring/config/parse.d.mts +13 -13
- package/authoring/config/parse.mjs +8 -8
- package/authoring/config/type.ts +3 -3
- package/authoring/debug/parse.d.mts +4 -4
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/doctypes/_schema.d.mts +121 -11
- package/authoring/doctypes/_schema.mjs +144 -13
- package/authoring/doctypes/base/graph-fields.doc.mjs +11 -4
- package/authoring/doctypes/base/type.ts +8 -4
- package/authoring/doctypes/command/command.doc.mjs +3 -2
- package/authoring/doctypes/command/parse.d.mts +2 -2
- package/authoring/doctypes/command/parse.mjs +1 -1
- package/authoring/doctypes/command/type.ts +2 -2
- package/authoring/doctypes/component/component.doc.mjs +5 -2
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +1 -1
- package/authoring/doctypes/enum/parse.d.mts +2 -2
- package/authoring/doctypes/enum/parse.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +1 -1
- package/authoring/doctypes/function/function.doc.mjs +4 -0
- package/authoring/doctypes/function/parse.d.mts +2 -2
- package/authoring/doctypes/function/parse.mjs +1 -1
- package/authoring/doctypes/function/type.ts +1 -1
- package/authoring/doctypes/hook/hook.doc.mjs +4 -0
- package/authoring/doctypes/hook/parse.d.mts +2 -2
- package/authoring/doctypes/hook/parse.mjs +1 -1
- package/authoring/doctypes/hook/type.ts +1 -1
- package/authoring/doctypes/legacy.d.mts +6 -6
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/load-contract.test.mjs +207 -0
- package/authoring/doctypes/namespace/namespace.doc.mjs +7 -3
- package/authoring/doctypes/namespace/parse.d.mts +2 -2
- package/authoring/doctypes/namespace/parse.mjs +1 -1
- package/authoring/doctypes/namespace/type.ts +2 -2
- package/authoring/doctypes/parse.d.mts +18 -18
- package/authoring/doctypes/parse.mjs +9 -9
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +1 -1
- package/authoring/doctypes/reference/reference.doc.mjs +6 -2
- package/authoring/doctypes/reference/type.ts +1 -1
- package/authoring/doctypes/schema/parse.d.mts +2 -2
- package/authoring/doctypes/schema/parse.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +2 -2
- package/authoring/doctypes/template/parse.d.mts +92 -1
- package/authoring/doctypes/template/parse.mjs +33 -1
- package/authoring/doctypes/template/template.doc.mjs +4 -0
- package/authoring/doctypes/template/type.ts +4 -1
- package/authoring/doctypes/types.ts +10 -10
- package/authoring/gap-report/parse.d.mts +9 -9
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/identity/identity.doc.mjs +3 -2
- package/authoring/identity/type.ts +10 -10
- package/authoring/index.d.ts +19 -19
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/schema.d.mts +4 -4
- package/authoring/integration/schema.mjs +3 -3
- package/authoring/integration/type.ts +1 -1
- package/clients/cli/commands/integration-authoring.test.mjs +13 -9
- package/foundation/discovery/authoring-self-docs.test.mjs +71 -12
- package/foundation/discovery/docs-discovery.d.mts +4 -0
- package/foundation/discovery/docs-discovery.mjs +16 -2
- package/foundation/discovery/docs-discovery.test.mjs +47 -11
- package/package.json +9 -11
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
6
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof receiptSchema>, GapReportHandlerReceipt>
|
|
5
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
6
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof receiptSchema>, GapReportHandlerReceipt>
|
|
7
7
|
* >} _GapReportReceiptDriftLock
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
@@ -25,23 +25,23 @@ export function parseGapReportHandler(input: unknown, label?: string): GapReport
|
|
|
25
25
|
* @returns {GapReportHandlerReceipt | null}
|
|
26
26
|
*/
|
|
27
27
|
export function parseGapReportReceipt(input: unknown): GapReportHandlerReceipt | null;
|
|
28
|
-
export type _GapReportReceiptDriftLock = import("../_shared/contract").Expect<import("../_shared/contract").MutuallyAssignable<z.infer<typeof receiptSchema>, GapReportHandlerReceipt>>;
|
|
29
|
-
export type GapReportHandler = import("./type").GapReportHandler;
|
|
30
|
-
export type GapReportHandlerReceipt = import("./type").GapReportHandlerReceipt;
|
|
28
|
+
export type _GapReportReceiptDriftLock = import("../_shared/contract.js").Expect<import("../_shared/contract.js").MutuallyAssignable<z.infer<typeof receiptSchema>, GapReportHandlerReceipt>>;
|
|
29
|
+
export type GapReportHandler = import("./type.js").GapReportHandler;
|
|
30
|
+
export type GapReportHandlerReceipt = import("./type.js").GapReportHandlerReceipt;
|
|
31
31
|
/**
|
|
32
32
|
* Compile-time drift-lock: the sealed schema must infer EXACTLY the public
|
|
33
33
|
* {@link GapReportHandler} type. If they drift, `MutuallyAssignable` becomes
|
|
34
34
|
* `false` and `Expect<false>` fails `tsconfig.authoring-contract.json`.
|
|
35
35
|
*/
|
|
36
|
-
export type _GapReportHandlerDriftLock = import("../_shared/contract").Expect<import("../_shared/contract").MutuallyAssignable<z.infer<typeof handlerSchema>, GapReportHandler>>;
|
|
36
|
+
export type _GapReportHandlerDriftLock = import("../_shared/contract.js").Expect<import("../_shared/contract.js").MutuallyAssignable<z.infer<typeof handlerSchema>, GapReportHandler>>;
|
|
37
37
|
import { z } from 'zod';
|
|
38
38
|
/**
|
|
39
39
|
* Compile-time drift-lock: the sealed schema must infer EXACTLY the public
|
|
40
40
|
* {@link GapReportHandler} type. If they drift, `MutuallyAssignable` becomes
|
|
41
41
|
* `false` and `Expect<false>` fails `tsconfig.authoring-contract.json`.
|
|
42
42
|
*
|
|
43
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
44
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof handlerSchema>, GapReportHandler>
|
|
43
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
44
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof handlerSchema>, GapReportHandler>
|
|
45
45
|
* >} _GapReportHandlerDriftLock
|
|
46
46
|
*/
|
|
47
47
|
declare const receiptSchema: z.ZodObject<{
|
|
@@ -58,6 +58,6 @@ declare const handlerSchema: z.ZodObject<{
|
|
|
58
58
|
public: "public";
|
|
59
59
|
internal: "internal";
|
|
60
60
|
}>;
|
|
61
|
-
handle: z.ZodType<(report: import("./type").GapReport, context: import("./type").GapReportHandlerContext) => import("./type").GapReportHandlerReceipt | Promise<import("./type").GapReportHandlerReceipt>, any, z.core.$ZodTypeInternals<(report: import("./type").GapReport, context: import("./type").GapReportHandlerContext) => import("./type").GapReportHandlerReceipt | Promise<import("./type").GapReportHandlerReceipt>, any>>;
|
|
61
|
+
handle: z.ZodType<(report: import("./type.js").GapReport, context: import("./type.js").GapReportHandlerContext) => import("./type.js").GapReportHandlerReceipt | Promise<import("./type.js").GapReportHandlerReceipt>, any, z.core.$ZodTypeInternals<(report: import("./type.js").GapReport, context: import("./type.js").GapReportHandlerContext) => import("./type.js").GapReportHandlerReceipt | Promise<import("./type.js").GapReportHandlerReceipt>, any>>;
|
|
62
62
|
}, z.core.$strict>;
|
|
63
63
|
export {};
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
import {z} from 'zod';
|
|
14
14
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
15
15
|
|
|
16
|
-
/** @typedef {import('./type').GapReportHandler} GapReportHandler */
|
|
17
|
-
/** @typedef {import('./type').GapReportHandlerReceipt} GapReportHandlerReceipt */
|
|
16
|
+
/** @typedef {import('./type.js').GapReportHandler} GapReportHandler */
|
|
17
|
+
/** @typedef {import('./type.js').GapReportHandlerReceipt} GapReportHandlerReceipt */
|
|
18
18
|
|
|
19
19
|
// Typed z.custom so z.infer reproduces the real function type, matching the
|
|
20
20
|
// pattern used by the debug handler and post-codemod hook parsers.
|
|
@@ -36,8 +36,8 @@ const handlerSchema = z
|
|
|
36
36
|
* {@link GapReportHandler} type. If they drift, `MutuallyAssignable` becomes
|
|
37
37
|
* `false` and `Expect<false>` fails `tsconfig.authoring-contract.json`.
|
|
38
38
|
*
|
|
39
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
40
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof handlerSchema>, GapReportHandler>
|
|
39
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
40
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof handlerSchema>, GapReportHandler>
|
|
41
41
|
* >} _GapReportHandlerDriftLock
|
|
42
42
|
*/
|
|
43
43
|
|
|
@@ -50,8 +50,8 @@ const receiptSchema = z
|
|
|
50
50
|
.strict();
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
54
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof receiptSchema>, GapReportHandlerReceipt>
|
|
53
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
54
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof receiptSchema>, GapReportHandlerReceipt>
|
|
55
55
|
* >} _GapReportReceiptDriftLock
|
|
56
56
|
*/
|
|
57
57
|
|
|
@@ -12,8 +12,9 @@ export const doc = {
|
|
|
12
12
|
displayName: 'Provider and artifact identity',
|
|
13
13
|
namespace: 'authoring',
|
|
14
14
|
description:
|
|
15
|
-
'Separates stable provider/artifact identity from package instances and runtime lifecycle state.',
|
|
16
|
-
appliesTo:
|
|
15
|
+
'Separates stable provider/artifact identity from package instances and runtime lifecycle state. providerId is in use today: an integration manifest may declare it, and Doctor and every command report two packages that claim one. The artifact, doc, instance, and compiler-input identities are defined for the docs graph, which is not built yet, and no command reads them.',
|
|
16
|
+
appliesTo:
|
|
17
|
+
'Integration manifests and provider conflicts today; the docs graph once it ships',
|
|
17
18
|
fields: [
|
|
18
19
|
{
|
|
19
20
|
name: 'ProviderId',
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
* artifact ID stays stable across those instances.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {AuthoredDocKind} from '../doctypes/base/type';
|
|
12
|
-
import type {CommandDoc} from '../doctypes/command/type';
|
|
13
|
-
import type {ComponentDoc} from '../doctypes/component/type';
|
|
14
|
-
import type {EnumDoc} from '../doctypes/enum/type';
|
|
15
|
-
import type {FunctionDoc} from '../doctypes/function/type';
|
|
16
|
-
import type {HookDoc} from '../doctypes/hook/type';
|
|
17
|
-
import type {NamespaceDoc} from '../doctypes/namespace/type';
|
|
18
|
-
import type {ReferenceDoc} from '../doctypes/reference/type';
|
|
19
|
-
import type {SchemaDoc} from '../doctypes/schema/type';
|
|
20
|
-
import type {TemplateDoc} from '../doctypes/template/type';
|
|
11
|
+
import type {AuthoredDocKind} from '../doctypes/base/type.js';
|
|
12
|
+
import type {CommandDoc} from '../doctypes/command/type.js';
|
|
13
|
+
import type {ComponentDoc} from '../doctypes/component/type.js';
|
|
14
|
+
import type {EnumDoc} from '../doctypes/enum/type.js';
|
|
15
|
+
import type {FunctionDoc} from '../doctypes/function/type.js';
|
|
16
|
+
import type {HookDoc} from '../doctypes/hook/type.js';
|
|
17
|
+
import type {NamespaceDoc} from '../doctypes/namespace/type.js';
|
|
18
|
+
import type {ReferenceDoc} from '../doctypes/reference/type.js';
|
|
19
|
+
import type {SchemaDoc} from '../doctypes/schema/type.js';
|
|
20
|
+
import type {TemplateDoc} from '../doctypes/template/type.js';
|
|
21
21
|
|
|
22
22
|
declare const providerIdBrand: unique symbol;
|
|
23
23
|
declare const artifactIdBrand: unique symbol;
|
package/authoring/index.d.ts
CHANGED
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
// ═══════════════════════════════════════════════════════════════════════
|
|
24
24
|
// AUTHOR THESE — each is the default export of one authored file.
|
|
25
25
|
// ═══════════════════════════════════════════════════════════════════════
|
|
26
|
-
export type {ComponentDoc} from './doctypes/types'; // Button.doc.{ts,mjs}
|
|
27
|
-
export type {HookDoc} from './doctypes/types'; // useToast.doc.{ts,mjs}
|
|
28
|
-
export type {FunctionDoc} from './doctypes/types'; // search.doc.mjs (hook | api)
|
|
29
|
-
export type {ReferenceDoc} from './doctypes/types'; // theming.doc.{ts,mjs}
|
|
30
|
-
export type {TemplateDoc} from './doctypes/types'; // Foo.template.{ts,mjs}
|
|
31
|
-
export type {SchemaDoc} from './doctypes/types'; // config.doc.mjs (object shape)
|
|
32
|
-
export type {CommandDoc} from './doctypes/types'; // search.doc.mjs (CLI command)
|
|
33
|
-
export type {EnumDoc} from './doctypes/types'; // error-codes.doc.mjs (vocabulary)
|
|
34
|
-
export type {NamespaceDoc} from './doctypes/types'; // cli.doc.mjs (hierarchy)
|
|
35
|
-
export type {AstryxConfig} from './config/type'; // astryx.config.{ts,mjs}
|
|
36
|
-
export type {DebugEvent} from './debug/type'; // one recorded CLI run
|
|
37
|
-
export type {AstryxIntegration} from './integration/type'; // astryx.integration.{ts,mjs}
|
|
26
|
+
export type {ComponentDoc} from './doctypes/types.js'; // Button.doc.{ts,mjs}
|
|
27
|
+
export type {HookDoc} from './doctypes/types.js'; // useToast.doc.{ts,mjs}
|
|
28
|
+
export type {FunctionDoc} from './doctypes/types.js'; // search.doc.mjs (hook | api)
|
|
29
|
+
export type {ReferenceDoc} from './doctypes/types.js'; // theming.doc.{ts,mjs}
|
|
30
|
+
export type {TemplateDoc} from './doctypes/types.js'; // Foo.template.{ts,mjs}
|
|
31
|
+
export type {SchemaDoc} from './doctypes/types.js'; // config.doc.mjs (object shape)
|
|
32
|
+
export type {CommandDoc} from './doctypes/types.js'; // search.doc.mjs (CLI command)
|
|
33
|
+
export type {EnumDoc} from './doctypes/types.js'; // error-codes.doc.mjs (vocabulary)
|
|
34
|
+
export type {NamespaceDoc} from './doctypes/types.js'; // cli.doc.mjs (hierarchy)
|
|
35
|
+
export type {AstryxConfig} from './config/type.js'; // astryx.config.{ts,mjs}
|
|
36
|
+
export type {DebugEvent} from './debug/type.js'; // one recorded CLI run
|
|
37
|
+
export type {AstryxIntegration} from './integration/type.js'; // astryx.integration.{ts,mjs}
|
|
38
38
|
export type {
|
|
39
39
|
GapReportHandler,
|
|
40
40
|
GapReportHandlerContext,
|
|
@@ -42,8 +42,8 @@ export type {
|
|
|
42
42
|
GapReportCategory,
|
|
43
43
|
GapReportTarget,
|
|
44
44
|
GapReportHandlerReceipt,
|
|
45
|
-
} from './gap-report/type'; // gap-report handler contract
|
|
46
|
-
export type {AstryxCodemod, AstryxConfigCodemod} from './codemod/type'; // codemods/*
|
|
45
|
+
} from './gap-report/type.js'; // gap-report handler contract
|
|
46
|
+
export type {AstryxCodemod, AstryxConfigCodemod} from './codemod/type.js'; // codemods/*
|
|
47
47
|
|
|
48
48
|
// ═══════════════════════════════════════════════════════════════════════
|
|
49
49
|
// PARSERS — the CLI's load boundary (types come from each parser's JSDoc).
|
|
@@ -87,7 +87,7 @@ export type {
|
|
|
87
87
|
AuthoredDocSnapshot,
|
|
88
88
|
AuthoredDocSource,
|
|
89
89
|
AuthoredDocEntry,
|
|
90
|
-
} from './identity/type';
|
|
90
|
+
} from './identity/type.js';
|
|
91
91
|
export type {
|
|
92
92
|
// shared graph
|
|
93
93
|
AuthoredDocKind,
|
|
@@ -151,8 +151,8 @@ export type {
|
|
|
151
151
|
CommandExampleDoc,
|
|
152
152
|
// enum
|
|
153
153
|
EnumMemberDoc,
|
|
154
|
-
} from './doctypes/types';
|
|
155
|
-
export type {PostCodemodHook, DebugConfig} from './config/type';
|
|
154
|
+
} from './doctypes/types.js';
|
|
155
|
+
export type {PostCodemodHook, DebugConfig} from './config/type.js';
|
|
156
156
|
export type {
|
|
157
157
|
// debug
|
|
158
158
|
DebugSchemaVersion,
|
|
@@ -165,11 +165,11 @@ export type {
|
|
|
165
165
|
DebugEventEnv,
|
|
166
166
|
DebugEventProject,
|
|
167
167
|
DebugEventHandler,
|
|
168
|
-
} from './debug/type';
|
|
168
|
+
} from './debug/type.js';
|
|
169
169
|
export type {
|
|
170
170
|
AstryxCodemodDef,
|
|
171
171
|
AstryxConfigCodemodDef,
|
|
172
172
|
AstryxCodemodFile,
|
|
173
173
|
AstryxCodemodApi,
|
|
174
174
|
AstryxCodemodTransform,
|
|
175
|
-
} from './codemod/type';
|
|
175
|
+
} from './codemod/type.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
-
/** @typedef {import('./type').AstryxIntegration} AstryxIntegration */
|
|
4
|
+
/** @typedef {import('./type.js').AstryxIntegration} AstryxIntegration */
|
|
5
5
|
/**
|
|
6
6
|
* Validate an unknown value as an Astryx integration manifest, or throw.
|
|
7
7
|
*
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
* @returns {AstryxIntegration}
|
|
15
15
|
*/
|
|
16
16
|
export function parseIntegration(input: unknown, label?: string): AstryxIntegration;
|
|
17
|
-
export type AstryxIntegration = import("./type").AstryxIntegration;
|
|
17
|
+
export type AstryxIntegration = import("./type.js").AstryxIntegration;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
15
15
|
import {integrationSchema} from './schema.mjs';
|
|
16
16
|
|
|
17
|
-
/** @typedef {import('./type').AstryxIntegration} AstryxIntegration */
|
|
17
|
+
/** @typedef {import('./type.js').AstryxIntegration} AstryxIntegration */
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Validate an unknown value as an Astryx integration manifest, or throw.
|
|
@@ -55,8 +55,8 @@ export const integrationSchema: z.ZodObject<{
|
|
|
55
55
|
/**
|
|
56
56
|
* Compile-time drift-lock: sealed schema must infer exactly {@link AstryxIntegration}.
|
|
57
57
|
*
|
|
58
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
59
|
-
* import('../_shared/contract').Equal<z.infer<typeof integrationSchema>, AstryxIntegration>
|
|
58
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
59
|
+
* import('../_shared/contract.js').Equal<z.infer<typeof integrationSchema>, AstryxIntegration>
|
|
60
60
|
* >} _IntegrationDriftLock
|
|
61
61
|
*/
|
|
62
62
|
/**
|
|
@@ -69,9 +69,9 @@ export const integrationSchema: z.ZodObject<{
|
|
|
69
69
|
* @type {string[]}
|
|
70
70
|
*/
|
|
71
71
|
export const KNOWN_INTEGRATION_KEYS: string[];
|
|
72
|
-
export type AstryxIntegration = import("./type").AstryxIntegration;
|
|
72
|
+
export type AstryxIntegration = import("./type.js").AstryxIntegration;
|
|
73
73
|
/**
|
|
74
74
|
* Compile-time drift-lock: sealed schema must infer exactly {@link AstryxIntegration}.
|
|
75
75
|
*/
|
|
76
|
-
export type _IntegrationDriftLock = import("../_shared/contract").Expect<import("../_shared/contract").Equal<z.infer<typeof integrationSchema>, AstryxIntegration>>;
|
|
76
|
+
export type _IntegrationDriftLock = import("../_shared/contract.js").Expect<import("../_shared/contract.js").Equal<z.infer<typeof integrationSchema>, AstryxIntegration>>;
|
|
77
77
|
import { z } from 'zod';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import {z} from 'zod';
|
|
17
17
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
18
18
|
|
|
19
|
-
/** @typedef {import('./type').AstryxIntegration} AstryxIntegration */
|
|
19
|
+
/** @typedef {import('./type.js').AstryxIntegration} AstryxIntegration */
|
|
20
20
|
|
|
21
21
|
const MAX_AGENT_DOC_LINES = 8;
|
|
22
22
|
const MAX_AGENT_DOC_LINE_CODE_POINTS = 240;
|
|
@@ -121,8 +121,8 @@ export function parseAgentDocsField(input, label) {
|
|
|
121
121
|
/**
|
|
122
122
|
* Compile-time drift-lock: sealed schema must infer exactly {@link AstryxIntegration}.
|
|
123
123
|
*
|
|
124
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
125
|
-
* import('../_shared/contract').Equal<z.infer<typeof integrationSchema>, AstryxIntegration>
|
|
124
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
125
|
+
* import('../_shared/contract.js').Equal<z.infer<typeof integrationSchema>, AstryxIntegration>
|
|
126
126
|
* >} _IntegrationDriftLock
|
|
127
127
|
*/
|
|
128
128
|
|
|
@@ -120,7 +120,7 @@ describe('integration authoring CLI', () => {
|
|
|
120
120
|
);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
it('
|
|
123
|
+
it('pack-check rejects a generated component without an exports map (no-map false green)', async () => {
|
|
124
124
|
const added = await runCli(
|
|
125
125
|
['integration', 'add', 'component', 'AcmeWidget', '--json'],
|
|
126
126
|
tmpDir,
|
|
@@ -131,19 +131,23 @@ describe('integration authoring CLI', () => {
|
|
|
131
131
|
['integration', 'pack', '--check', '--json'],
|
|
132
132
|
tmpDir,
|
|
133
133
|
);
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
// Without an exports map, the extensionless import cannot resolve —
|
|
135
|
+
// pack-check must fail, not false-green.
|
|
136
|
+
expect(checked.status).not.toBe(0);
|
|
137
|
+
const envelope = parseEnvelope(checked.stdout);
|
|
138
|
+
expect(envelope).toMatchObject({
|
|
136
139
|
type: 'integration.pack-check',
|
|
137
140
|
data: {
|
|
138
141
|
name: '@acme/widgets',
|
|
139
|
-
|
|
140
|
-
packable: true,
|
|
141
|
-
contributions: {
|
|
142
|
-
local: {components: ['AcmeWidget']},
|
|
143
|
-
packed: {components: ['AcmeWidget']},
|
|
144
|
-
},
|
|
142
|
+
packable: false,
|
|
145
143
|
},
|
|
146
144
|
});
|
|
145
|
+
expect(envelope.data.issues).toContainEqual(
|
|
146
|
+
expect.objectContaining({
|
|
147
|
+
severity: 'error',
|
|
148
|
+
message: expect.stringContaining('AcmeWidget'),
|
|
149
|
+
}),
|
|
150
|
+
);
|
|
147
151
|
});
|
|
148
152
|
|
|
149
153
|
it('requires the explicit --check gate on pack', async () => {
|
|
@@ -9,7 +9,14 @@ import {
|
|
|
9
9
|
buildAuthoringTopic,
|
|
10
10
|
discoverAuthoringSelfDocSources,
|
|
11
11
|
} from './authoring-self-docs.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
GRAPH_BLOCK_TYPES,
|
|
14
|
+
GRAPH_ONLY_FIELDS,
|
|
15
|
+
problemsInTopic,
|
|
16
|
+
} from './docs-discovery.mjs';
|
|
17
|
+
import {doc as graphFieldsDoc} from '../../authoring/doctypes/base/graph-fields.doc.mjs';
|
|
18
|
+
import {doc as namespaceDoc} from '../../authoring/doctypes/namespace/namespace.doc.mjs';
|
|
19
|
+
import {doc as referenceDoc} from '../../authoring/doctypes/reference/reference.doc.mjs';
|
|
13
20
|
import {docs} from '../../api/docs/docs.mjs';
|
|
14
21
|
|
|
15
22
|
const SLOW = 60_000;
|
|
@@ -37,14 +44,58 @@ describe('authoring self-docs', () => {
|
|
|
37
44
|
expect(topic.sections).toHaveLength(AUTHORING_SELF_DOCS.length);
|
|
38
45
|
});
|
|
39
46
|
|
|
40
|
-
it(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
it(
|
|
48
|
+
'is readable progressively through the docs API',
|
|
49
|
+
async () => {
|
|
50
|
+
const index = await docs('authoring', undefined, {index: true});
|
|
51
|
+
expect(index.type).toBe('docs.index');
|
|
52
|
+
expect(index.data.sections.map(s => s.id)).toContain('integration');
|
|
53
|
+
const section = await docs('authoring', 'integration');
|
|
54
|
+
expect(section.data.title).toBe('Astryx Integration');
|
|
55
|
+
expect(section.data.content.some(block => block.type === 'table')).toBe(
|
|
56
|
+
true,
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
SLOW,
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('what the authoring docs say about the unbuilt docs graph', () => {
|
|
64
|
+
it('marks exactly the fields topic loading rejects as not read yet', () => {
|
|
65
|
+
const notReadYet = graphFieldsDoc.fields
|
|
66
|
+
.filter(field => /Not read yet/.test(field.description))
|
|
67
|
+
.map(field => field.name);
|
|
68
|
+
expect(notReadYet.sort()).toEqual([...GRAPH_ONLY_FIELDS].sort());
|
|
69
|
+
for (const field of graphFieldsDoc.fields) {
|
|
70
|
+
if (notReadYet.includes(field.name)) {
|
|
71
|
+
expect(field.description).toMatch(/fails to load/);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
expect(graphFieldsDoc.description).toMatch(/not built yet/);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('says a topic using a graph block fails to load', () => {
|
|
78
|
+
const content = referenceDoc.fields
|
|
79
|
+
.flatMap(field => [field, ...(field.fields ?? [])])
|
|
80
|
+
.find(field => field.name === 'sections[].content');
|
|
81
|
+
for (const type of GRAPH_BLOCK_TYPES) {
|
|
82
|
+
expect(content.description).toContain(type);
|
|
83
|
+
}
|
|
84
|
+
expect(content.description).toMatch(/fails to load/);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('says namespace docs are not loaded yet', () => {
|
|
88
|
+
expect(namespaceDoc.description).toMatch(/Not loaded yet/);
|
|
89
|
+
expect(
|
|
90
|
+
problemsInTopic({
|
|
91
|
+
...namespaceDoc.examples?.[0],
|
|
92
|
+
type: 'namespace',
|
|
93
|
+
name: 'x',
|
|
94
|
+
}),
|
|
95
|
+
).toEqual([
|
|
96
|
+
'"x" is a namespace doc. Only the docs graph reads namespace docs, and it is not built yet; remove this file from the docs directory.',
|
|
97
|
+
]);
|
|
98
|
+
});
|
|
48
99
|
});
|
|
49
100
|
|
|
50
101
|
describe('auditAuthoringSelfDocs', () => {
|
|
@@ -68,17 +119,25 @@ describe('auditAuthoringSelfDocs', () => {
|
|
|
68
119
|
path.join(root, 'kept', 'forgotten.doc.mjs'),
|
|
69
120
|
"export const doc = {name: 'forgotten', description: 'Not listed.'};\n",
|
|
70
121
|
);
|
|
71
|
-
const audit = await auditAuthoringSelfDocs({
|
|
122
|
+
const audit = await auditAuthoringSelfDocs({
|
|
123
|
+
root,
|
|
124
|
+
sources: ['kept/kept.doc.mjs'],
|
|
125
|
+
});
|
|
72
126
|
expect(audit.unreachable).toEqual(['kept/forgotten.doc.mjs']);
|
|
73
127
|
});
|
|
74
128
|
|
|
75
129
|
it('reports a self-doc that fails to load instead of throwing', async () => {
|
|
76
|
-
fs.writeFileSync(
|
|
130
|
+
fs.writeFileSync(
|
|
131
|
+
path.join(root, 'kept', 'broken.doc.mjs'),
|
|
132
|
+
'export const doc = {;\n',
|
|
133
|
+
);
|
|
77
134
|
const audit = await auditAuthoringSelfDocs({
|
|
78
135
|
root,
|
|
79
136
|
sources: ['kept/kept.doc.mjs', 'kept/broken.doc.mjs'],
|
|
80
137
|
});
|
|
81
|
-
expect(audit.failed.map(entry => entry.source)).toEqual([
|
|
138
|
+
expect(audit.failed.map(entry => entry.source)).toEqual([
|
|
139
|
+
'kept/broken.doc.mjs',
|
|
140
|
+
]);
|
|
82
141
|
expect(audit.sections).toBe(1);
|
|
83
142
|
});
|
|
84
143
|
|
|
@@ -94,6 +94,10 @@ export { withSourceTitle };
|
|
|
94
94
|
* unlike component discovery, whose built-ins belong to core.
|
|
95
95
|
*/
|
|
96
96
|
export const BUILTIN_DOCS_PACKAGE: import("../../authoring/index.js").ProviderId;
|
|
97
|
+
/** Blocks that are valid authoring but require the compiled graph renderer. */
|
|
98
|
+
export const GRAPH_BLOCK_TYPES: Set<string>;
|
|
99
|
+
/** Doc fields only the docs graph reads; a topic that sets one fails to load. */
|
|
100
|
+
export const GRAPH_ONLY_FIELDS: string[];
|
|
97
101
|
/**
|
|
98
102
|
* Every topic a project can read, and the relationships between them.
|
|
99
103
|
*
|
|
@@ -138,7 +138,14 @@ const BLOCK_FIELDS = {
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
/** Blocks that are valid authoring but require the compiled graph renderer. */
|
|
141
|
-
const GRAPH_BLOCK_TYPES = new Set([
|
|
141
|
+
export const GRAPH_BLOCK_TYPES = new Set([
|
|
142
|
+
'workflow',
|
|
143
|
+
'collection',
|
|
144
|
+
'reference',
|
|
145
|
+
]);
|
|
146
|
+
|
|
147
|
+
/** Doc fields only the docs graph reads; a topic that sets one fails to load. */
|
|
148
|
+
export const GRAPH_ONLY_FIELDS = ['placement', 'aliases', 'audience'];
|
|
142
149
|
|
|
143
150
|
/**
|
|
144
151
|
* Fields a block kind may carry but does not need. Kept per kind rather than
|
|
@@ -176,6 +183,13 @@ const SECTION_FIELDS = ['id', 'title', 'category', 'content', 'previewType'];
|
|
|
176
183
|
* @returns {string[]} problems, each already pointed at a place in the doc
|
|
177
184
|
*/
|
|
178
185
|
export function problemsInTopic(doc) {
|
|
186
|
+
// A namespace doc is valid authoring that only the docs graph reads. Said
|
|
187
|
+
// plainly, instead of as the topic fields it does not have.
|
|
188
|
+
if (doc?.type === 'namespace') {
|
|
189
|
+
return [
|
|
190
|
+
`"${doc.name}" is a namespace doc. Only the docs graph reads namespace docs, and it is not built yet; remove this file from the docs directory.`,
|
|
191
|
+
];
|
|
192
|
+
}
|
|
179
193
|
/** @type {string[]} */
|
|
180
194
|
const problems = [];
|
|
181
195
|
for (const field of ['name', 'title', 'description']) {
|
|
@@ -188,7 +202,7 @@ export function problemsInTopic(doc) {
|
|
|
188
202
|
`name: "${doc.name}" is not URL-safe. A topic name is its CLI argument and its docsite path, so it may hold only letters, digits, "_" and "-".`,
|
|
189
203
|
);
|
|
190
204
|
}
|
|
191
|
-
for (const field of
|
|
205
|
+
for (const field of GRAPH_ONLY_FIELDS) {
|
|
192
206
|
if (doc?.[field] != null) {
|
|
193
207
|
problems.push(
|
|
194
208
|
`${field}: requires the compiled graph reader and is not supported by legacy topic readers`,
|
|
@@ -182,6 +182,26 @@ describe('discoverIntegrationDocs', () => {
|
|
|
182
182
|
expect(records).toEqual([]);
|
|
183
183
|
expect(errors[0].message).toContain('requires the compiled graph renderer');
|
|
184
184
|
});
|
|
185
|
+
|
|
186
|
+
it('names a namespace doc instead of listing topic fields it lacks', async () => {
|
|
187
|
+
const {records, errors} = await discoverIntegrationDocs(
|
|
188
|
+
integration('@acme/namespace', {
|
|
189
|
+
'guides.doc.mjs': {
|
|
190
|
+
type: 'namespace',
|
|
191
|
+
name: 'guides',
|
|
192
|
+
title: 'Guides',
|
|
193
|
+
summary: 'Every guide.',
|
|
194
|
+
slots: {guides: {title: 'Guides', accepts: {kinds: ['generic']}}},
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
197
|
+
);
|
|
198
|
+
expect(records).toEqual([]);
|
|
199
|
+
expect(errors).toHaveLength(1);
|
|
200
|
+
expect(errors[0].message).toContain(
|
|
201
|
+
'"guides" is a namespace doc. Only the docs graph reads namespace docs',
|
|
202
|
+
);
|
|
203
|
+
expect(errors[0].message).not.toContain('sections:');
|
|
204
|
+
});
|
|
185
205
|
});
|
|
186
206
|
|
|
187
207
|
describe('problemsInTopic', () => {
|
|
@@ -500,7 +520,10 @@ describe('problemsInTopic section keys', () => {
|
|
|
500
520
|
name: 'keys',
|
|
501
521
|
title: 'Keys',
|
|
502
522
|
description: 'Section keys.',
|
|
503
|
-
sections: sections.map(s => ({
|
|
523
|
+
sections: sections.map(s => ({
|
|
524
|
+
content: [{type: 'prose', text: 'x'}],
|
|
525
|
+
...s,
|
|
526
|
+
})),
|
|
504
527
|
});
|
|
505
528
|
|
|
506
529
|
it('rejects two sections that derive the same key', () => {
|
|
@@ -512,18 +535,18 @@ describe('problemsInTopic section keys', () => {
|
|
|
512
535
|
});
|
|
513
536
|
|
|
514
537
|
it('rejects an unsafe id', () => {
|
|
515
|
-
expect(
|
|
516
|
-
[
|
|
517
|
-
);
|
|
538
|
+
expect(
|
|
539
|
+
problemsInTopic(doc([{id: 'Quick Start', title: 'Quick Start'}])),
|
|
540
|
+
).toEqual([expect.stringContaining('is not a stable key')]);
|
|
518
541
|
});
|
|
519
542
|
|
|
520
543
|
it('rejects a title no key derives from, unless it has an id', () => {
|
|
521
544
|
expect(problemsInTopic(doc([{title: '亮/暗模式'}]))).toEqual([
|
|
522
545
|
expect.stringContaining('Give the section an id'),
|
|
523
546
|
]);
|
|
524
|
-
expect(
|
|
525
|
-
[],
|
|
526
|
-
);
|
|
547
|
+
expect(
|
|
548
|
+
problemsInTopic(doc([{id: 'light-dark', title: '亮/暗模式'}])),
|
|
549
|
+
).toEqual([]);
|
|
527
550
|
});
|
|
528
551
|
});
|
|
529
552
|
|
|
@@ -535,12 +558,17 @@ describe('mergeTopic by section key', () => {
|
|
|
535
558
|
{title: 'Light/Dark Mode', content: [{type: 'prose', text: 'base'}]},
|
|
536
559
|
],
|
|
537
560
|
};
|
|
538
|
-
const titles = doc =>
|
|
561
|
+
const titles = doc =>
|
|
562
|
+
doc.sections.map(s => [s.id ?? null, s.title, s.content[0].text]);
|
|
539
563
|
|
|
540
564
|
it('replaces the section whose derived key an extension id names', () => {
|
|
541
565
|
const merged = mergeTopic(base, {
|
|
542
566
|
sections: [
|
|
543
|
-
{
|
|
567
|
+
{
|
|
568
|
+
id: 'quick-start',
|
|
569
|
+
title: 'Quick Start with Acme',
|
|
570
|
+
content: [{type: 'prose', text: 'acme'}],
|
|
571
|
+
},
|
|
544
572
|
],
|
|
545
573
|
});
|
|
546
574
|
expect(titles(merged)).toEqual([
|
|
@@ -551,7 +579,9 @@ describe('mergeTopic by section key', () => {
|
|
|
551
579
|
|
|
552
580
|
it('replaces the section a title variant derives the same key as', () => {
|
|
553
581
|
const merged = mergeTopic(base, {
|
|
554
|
-
sections: [
|
|
582
|
+
sections: [
|
|
583
|
+
{title: 'Light-Dark Mode', content: [{type: 'prose', text: 'acme'}]},
|
|
584
|
+
],
|
|
555
585
|
});
|
|
556
586
|
expect(titles(merged)).toEqual([
|
|
557
587
|
[null, 'Quick Start', 'base'],
|
|
@@ -561,7 +591,13 @@ describe('mergeTopic by section key', () => {
|
|
|
561
591
|
|
|
562
592
|
it('prefers the key over a legacy title for an extension with an id', () => {
|
|
563
593
|
const merged = mergeTopic(base, {
|
|
564
|
-
sections: [
|
|
594
|
+
sections: [
|
|
595
|
+
{
|
|
596
|
+
id: 'light-dark-mode',
|
|
597
|
+
title: 'Quick Start',
|
|
598
|
+
content: [{type: 'prose', text: 'acme'}],
|
|
599
|
+
},
|
|
600
|
+
],
|
|
565
601
|
});
|
|
566
602
|
expect(titles(merged)).toEqual([
|
|
567
603
|
[null, 'Quick Start', 'base'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.3-canary.
|
|
3
|
+
"version": "0.6.3-canary.c13ef6b",
|
|
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",
|
|
@@ -100,11 +100,10 @@
|
|
|
100
100
|
"zod": "^4.4.3"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
104
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
105
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
106
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
107
|
-
"gpt-tokenizer": "^3.4.0"
|
|
103
|
+
"@astryxdesign/charts": "0.6.3-canary.c13ef6b",
|
|
104
|
+
"@astryxdesign/core": "0.6.3-canary.c13ef6b",
|
|
105
|
+
"@astryxdesign/lab": "0.6.3-canary.c13ef6b",
|
|
106
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.c13ef6b"
|
|
108
107
|
},
|
|
109
108
|
"peerDependenciesMeta": {
|
|
110
109
|
"@astryxdesign/charts": {
|
|
@@ -121,14 +120,13 @@
|
|
|
121
120
|
}
|
|
122
121
|
},
|
|
123
122
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
125
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
123
|
+
"@astryxdesign/charts": "0.6.3-canary.c13ef6b",
|
|
124
|
+
"@astryxdesign/core": "0.6.3-canary.c13ef6b",
|
|
125
|
+
"@astryxdesign/lab": "0.6.3-canary.c13ef6b",
|
|
126
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.c13ef6b",
|
|
128
127
|
"@heroicons/react": "^2.2.0",
|
|
129
128
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
129
|
"@types/babel__core": "^7.20.5",
|
|
131
|
-
"gpt-tokenizer": "^3.4.0",
|
|
132
130
|
"lucide-react": "^1.18.0",
|
|
133
131
|
"recharts": "^3.9.2"
|
|
134
132
|
},
|