@astryxdesign/cli 0.6.3-canary.e9b8aa1 → 0.6.3-canary.ebaebc4
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 +2 -1
- 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/_adapter.d.mts +37 -24
- package/api/docs/_adapter.mjs +169 -83
- package/api/docs/compiled-topics.test.mjs +78 -0
- package/api/docs/detail/detail.mjs +14 -63
- package/api/docs/detail/section/section.d.mts +1 -1
- package/api/docs/detail/section/section.mjs +44 -20
- package/api/docs/detail/section/section.test.mjs +41 -0
- package/api/docs/docs.d.mts +7 -2
- package/api/docs/docs.doc.mjs +27 -10
- package/api/docs/docs.mjs +16 -9
- package/api/docs/docs.test.mjs +6 -0
- package/api/docs/docs.type.d.mts +40 -3
- package/api/docs/docs.type.mjs +36 -8
- package/api/docs/index/index.d.mts +18 -0
- package/api/docs/index/index.mjs +32 -0
- package/api/docs/index/index.test.mjs +62 -0
- package/api/docs/integrationDocs.test.mjs +106 -0
- package/api/doctor/doctor.d.mts +48 -0
- package/api/doctor/doctor.mjs +232 -0
- package/api/doctor/doctor.test.mjs +196 -0
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/hook/list/list.d.mts +1 -1
- package/api/integration/add-contribution.mjs +5 -3
- package/api/integration/add-contribution.test.mjs +4 -4
- package/api/integration/integration-authoring.type.d.mts +1 -1
- package/api/integration/pack-check.mjs +49 -7
- package/api/integration/pack-check.test.mjs +249 -0
- package/api/search/search.d.mts +1 -1
- package/api/search/search.mjs +5 -5
- package/api/search/search.type.d.mts +2 -2
- 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.d.mts +1 -1
- package/api/template/template.type.d.mts +6 -6
- 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/_adapter.mjs +71 -5
- package/api/upgrade/project-context.test.mjs +272 -0
- package/api/upgrade/upgrade.doc.mjs +4 -3
- package/api/upgrade/upgrade.type.d.mts +5 -5
- package/api/upgrade/upgrade.type.mjs +11 -11
- package/assets/codemods/integration-discovery.mjs +40 -2
- package/assets/codemods/integration-discovery.test.mjs +58 -0
- package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +27 -5
- package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +20 -5
- package/assets/docs/README.md +9 -0
- package/assets/docs/authoring.doc.mjs +14 -0
- package/assets/docs/cli-integrations.doc.mjs +86 -15
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- package/assets/templates/blocks/components/Timer/TimerFormats.doc.mjs +14 -0
- package/assets/templates/blocks/components/Timer/TimerFormats.tsx +34 -0
- package/assets/templates/blocks/components/Timer/TimerInline.doc.mjs +14 -0
- package/assets/templates/blocks/components/Timer/TimerInline.tsx +14 -0
- package/assets/templates/blocks/components/Timer/TimerShowcase.doc.mjs +13 -0
- package/assets/templates/blocks/components/Timer/TimerShowcase.tsx +47 -0
- package/assets/templates/blocks/components/Timer/TimerTypography.doc.mjs +14 -0
- package/assets/templates/blocks/components/Timer/TimerTypography.tsx +31 -0
- 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 +5 -5
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/doctypes/_schema.d.mts +788 -23
- package/authoring/doctypes/_schema.mjs +492 -39
- package/authoring/doctypes/base/graph-fields.doc.d.mts +9 -0
- package/authoring/doctypes/base/graph-fields.doc.mjs +62 -0
- package/authoring/doctypes/base/type.ts +40 -0
- 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 +3 -2
- package/authoring/doctypes/component/component.doc.mjs +6 -3
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +4 -3
- package/authoring/doctypes/enum/parse.d.mts +2 -2
- package/authoring/doctypes/enum/parse.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +3 -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 +6 -2
- 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 +3 -2
- package/authoring/doctypes/legacy.d.mts +8 -6
- package/authoring/doctypes/legacy.mjs +5 -4
- package/authoring/doctypes/load-contract.test.mjs +207 -0
- package/authoring/doctypes/namespace/namespace.doc.d.mts +9 -0
- package/authoring/doctypes/namespace/namespace.doc.mjs +132 -0
- package/authoring/doctypes/namespace/parse.d.mts +12 -0
- package/authoring/doctypes/namespace/parse.mjs +25 -0
- package/authoring/doctypes/namespace/parse.test.mjs +165 -0
- package/authoring/doctypes/namespace/type.ts +71 -0
- package/authoring/doctypes/parse.d.mts +20 -18
- package/authoring/doctypes/parse.mjs +16 -10
- package/authoring/doctypes/parse.test.mjs +77 -3
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +8 -5
- package/authoring/doctypes/reference/reference.doc.mjs +17 -4
- package/authoring/doctypes/reference/type.ts +51 -5
- package/authoring/doctypes/schema/parse.d.mts +2 -2
- package/authoring/doctypes/schema/parse.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +3 -2
- package/authoring/doctypes/template/parse.d.mts +92 -1
- package/authoring/doctypes/template/parse.mjs +36 -2
- package/authoring/doctypes/template/parse.test.mjs +8 -2
- package/authoring/doctypes/template/template.doc.mjs +4 -0
- package/authoring/doctypes/template/type.ts +5 -2
- package/authoring/doctypes/types.ts +10 -9
- package/authoring/gap-report/parse.d.mts +10 -10
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/identity/identity.doc.d.mts +9 -0
- package/authoring/identity/identity.doc.mjs +61 -0
- package/authoring/identity/type.ts +132 -0
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +49 -17
- package/authoring/index.mjs +1 -0
- package/authoring/integration/integration.doc.mjs +13 -6
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/parse.test.mjs +10 -1
- package/authoring/integration/schema.d.mts +6 -4
- package/authoring/integration/schema.mjs +9 -3
- package/authoring/integration/type.ts +23 -6
- package/authoring/shadcn/receipt.d.mts +6 -6
- package/clients/cli/commands/docs.doc.mjs +13 -3
- package/clients/cli/commands/docs.mjs +121 -21
- package/clients/cli/commands/docs.test.mjs +88 -0
- package/clients/cli/commands/integration-authoring.test.mjs +13 -9
- package/clients/cli/commands/theme-palette-generate.doc.mjs +8 -4
- package/clients/cli/commands/upgrade.doc.mjs +2 -2
- package/clients/cli/formatters/index.mjs +162 -1
- package/clients/cli/formatters/index.test.mjs +91 -0
- package/clients/cli/lib/manifest.mjs +7 -2
- package/foundation/config/project.mjs +21 -6
- package/foundation/discovery/authoring-self-docs.d.mts +69 -0
- package/foundation/discovery/authoring-self-docs.mjs +214 -0
- package/foundation/discovery/authoring-self-docs.test.mjs +154 -0
- package/foundation/discovery/component-discovery.d.mts +1 -1
- package/foundation/discovery/component-discovery.mjs +2 -1
- package/foundation/discovery/docs-discovery.d.mts +11 -4
- package/foundation/discovery/docs-discovery.mjs +208 -88
- package/foundation/discovery/docs-discovery.test.mjs +279 -13
- package/foundation/discovery/docs-output-budget.d.mts +28 -0
- package/foundation/discovery/docs-output-budget.mjs +50 -0
- package/foundation/discovery/docs-section-key.d.mts +98 -0
- package/foundation/discovery/docs-section-key.mjs +221 -0
- package/foundation/discovery/docs-section-key.test.mjs +224 -0
- package/foundation/discovery/template-adapter.mjs +2 -1
- package/foundation/discovery/theming-targets.test.mjs +4 -0
- package/foundation/doc-compiler/compile.d.mts +162 -0
- package/foundation/doc-compiler/compile.mjs +262 -0
- package/foundation/doc-compiler/doc-compiler.test.mjs +687 -0
- package/foundation/doc-compiler/ir.d.mts +9 -0
- package/foundation/doc-compiler/ir.mjs +287 -0
- package/foundation/doc-compiler/lenses.d.mts +33 -0
- package/foundation/doc-compiler/lenses.mjs +127 -0
- package/foundation/identity/provider-identity.d.mts +90 -0
- package/foundation/identity/provider-identity.mjs +320 -0
- package/foundation/identity/provider-identity.test.mjs +254 -0
- package/foundation/identity/providers.d.mts +7 -0
- package/foundation/identity/providers.mjs +16 -0
- package/foundation/integrations/autolink.mjs +12 -5
- package/foundation/integrations/integration-warnings.mjs +6 -0
- package/foundation/integrations/integrations.d.mts +46 -2
- package/foundation/integrations/integrations.mjs +167 -8
- package/foundation/integrations/integrations.test.mjs +384 -1
- package/foundation/integrations/provider-conflicts.test.mjs +125 -0
- package/foundation/integrations/validate-contributions.d.mts +2 -0
- package/foundation/integrations/validate-contributions.mjs +10 -0
- package/foundation/response/json-contract.test.mjs +46 -17
- package/foundation/response/response-types.doc.mjs +6 -1
- package/package.json +9 -11
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Timer} from '@astryxdesign/core/Timer';
|
|
6
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
7
|
+
|
|
8
|
+
export default function TimerInline() {
|
|
9
|
+
return (
|
|
10
|
+
<Text type="body" color="primary">
|
|
11
|
+
Processing for <Timer type="inherit" color="inherit" />
|
|
12
|
+
</Text>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'Timer',
|
|
7
|
+
name: 'Timer',
|
|
8
|
+
displayName: 'Timer',
|
|
9
|
+
isReady: true,
|
|
10
|
+
aspectRatio: 16 / 9,
|
|
11
|
+
isShowcase: true,
|
|
12
|
+
componentsUsed: ['Timer', 'Layout', 'Text'],
|
|
13
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Timer} from '@astryxdesign/core/Timer';
|
|
7
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
8
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
9
|
+
|
|
10
|
+
export default function TimerShowcase() {
|
|
11
|
+
const [startedAt] = useState(() => Date.now() - 3_753_000);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Stack direction="vertical" gap={4}>
|
|
15
|
+
<Text type="large" color="primary" weight="semibold">
|
|
16
|
+
Processing
|
|
17
|
+
</Text>
|
|
18
|
+
<Stack direction="horizontal" gap={6} vAlign="center">
|
|
19
|
+
<Stack direction="vertical" gap={1}>
|
|
20
|
+
<Text type="supporting" color="secondary">
|
|
21
|
+
Elapsed
|
|
22
|
+
</Text>
|
|
23
|
+
<Timer
|
|
24
|
+
startTime={startedAt}
|
|
25
|
+
type="body"
|
|
26
|
+
size="xl"
|
|
27
|
+
color="primary"
|
|
28
|
+
weight="semibold"
|
|
29
|
+
/>
|
|
30
|
+
</Stack>
|
|
31
|
+
<Stack direction="vertical" gap={1}>
|
|
32
|
+
<Text type="supporting" color="secondary">
|
|
33
|
+
Clock
|
|
34
|
+
</Text>
|
|
35
|
+
<Timer
|
|
36
|
+
format="clock"
|
|
37
|
+
startTime={startedAt}
|
|
38
|
+
type="body"
|
|
39
|
+
size="xl"
|
|
40
|
+
color="primary"
|
|
41
|
+
weight="semibold"
|
|
42
|
+
/>
|
|
43
|
+
</Stack>
|
|
44
|
+
</Stack>
|
|
45
|
+
</Stack>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'Timer',
|
|
7
|
+
name: 'Timer — Typography',
|
|
8
|
+
displayName: 'Timer — Typography',
|
|
9
|
+
description:
|
|
10
|
+
'Timer using its Timestamp-matched default typography and an emphasized override.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Timer', 'Layout', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Timer} from '@astryxdesign/core/Timer';
|
|
7
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
8
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
9
|
+
|
|
10
|
+
export default function TimerTypography() {
|
|
11
|
+
const [startedAt] = useState(() => Date.now() - 128_000);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Stack direction="vertical" gap={3}>
|
|
15
|
+
<Text type="supporting" color="secondary">
|
|
16
|
+
Default
|
|
17
|
+
</Text>
|
|
18
|
+
<Timer startTime={startedAt} />
|
|
19
|
+
<Text type="supporting" color="secondary">
|
|
20
|
+
Emphasized
|
|
21
|
+
</Text>
|
|
22
|
+
<Timer
|
|
23
|
+
startTime={startedAt}
|
|
24
|
+
type="body"
|
|
25
|
+
size="xl"
|
|
26
|
+
color="primary"
|
|
27
|
+
weight="semibold"
|
|
28
|
+
/>
|
|
29
|
+
</Stack>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -28,5 +28,27 @@ export type MutuallyAssignable<A, B> = [A] extends [B]
|
|
|
28
28
|
: false
|
|
29
29
|
: false;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* `T` without string or number index signatures, at every depth. A
|
|
33
|
+
* `.passthrough()` schema infers one and a hand-written interface never has
|
|
34
|
+
* one, so a lock drops them before comparing named fields. Recursive fields
|
|
35
|
+
* that a schema casts to their public type compare equal by construction.
|
|
36
|
+
*/
|
|
37
|
+
export type NamedFields<T> = T extends readonly (infer U)[]
|
|
38
|
+
? NamedFields<U>[]
|
|
39
|
+
: T extends (...args: never[]) => unknown
|
|
40
|
+
? T
|
|
41
|
+
: T extends object
|
|
42
|
+
? {
|
|
43
|
+
[
|
|
44
|
+
K in keyof T as string extends K
|
|
45
|
+
? never
|
|
46
|
+
: number extends K
|
|
47
|
+
? never
|
|
48
|
+
: K
|
|
49
|
+
]: NamedFields<T[K]>;
|
|
50
|
+
}
|
|
51
|
+
: T;
|
|
52
|
+
|
|
31
53
|
/** Compiles only when `T` is exactly `true`; otherwise a type error. */
|
|
32
54
|
export type Expect<T extends true> = T;
|
|
@@ -63,11 +63,13 @@ export const doc = {
|
|
|
63
63
|
name: 'file.path',
|
|
64
64
|
type: 'string',
|
|
65
65
|
description: 'Absolute path to the file being transformed.',
|
|
66
|
+
required: true,
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
name: 'file.source',
|
|
69
70
|
type: 'string',
|
|
70
71
|
description: 'The current source contents of the file.',
|
|
72
|
+
required: true,
|
|
71
73
|
},
|
|
72
74
|
],
|
|
73
75
|
},
|
|
@@ -81,18 +83,21 @@ export const doc = {
|
|
|
81
83
|
type: 'unknown',
|
|
82
84
|
description:
|
|
83
85
|
'A jscodeshift instance configured with a parser for the file.',
|
|
86
|
+
required: true,
|
|
84
87
|
},
|
|
85
88
|
{
|
|
86
89
|
name: 'api.stats',
|
|
87
90
|
type: '(...args: unknown[]) => void',
|
|
88
91
|
description:
|
|
89
92
|
'Report a statistic (no-op-friendly; provided for jscodeshift parity).',
|
|
93
|
+
required: true,
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
96
|
name: 'api.report',
|
|
93
97
|
type: '(...args: unknown[]) => void',
|
|
94
98
|
description:
|
|
95
99
|
'Report progress (no-op-friendly; provided for jscodeshift parity).',
|
|
100
|
+
required: true,
|
|
96
101
|
},
|
|
97
102
|
],
|
|
98
103
|
},
|
|
@@ -100,7 +105,7 @@ export const doc = {
|
|
|
100
105
|
},
|
|
101
106
|
{
|
|
102
107
|
name: 'type',
|
|
103
|
-
type: "'code'",
|
|
108
|
+
type: "'code' | 'config'",
|
|
104
109
|
description:
|
|
105
110
|
"Discriminant for the file-transforming variant. Use 'config' for a " +
|
|
106
111
|
'codemod that rewrites astryx.config.* instead (see notes).',
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Compile-time drift-lock: sealed envelope must infer exactly the public
|
|
6
6
|
* stamped-codemod union.
|
|
7
7
|
*
|
|
8
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
9
|
-
* import('../_shared/contract').Equal<
|
|
8
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
9
|
+
* import('../_shared/contract.js').Equal<
|
|
10
10
|
* z.infer<typeof codemodEnvelopeSchema>,
|
|
11
11
|
* AstryxCodemod | AstryxConfigCodemod
|
|
12
12
|
* >
|
|
@@ -24,10 +24,10 @@ export function parseCodemod(input: unknown, label?: string): AstryxCodemod | As
|
|
|
24
24
|
* Compile-time drift-lock: sealed envelope must infer exactly the public
|
|
25
25
|
* stamped-codemod union.
|
|
26
26
|
*/
|
|
27
|
-
export type _CodemodDriftLock = import("../_shared/contract").Expect<import("../_shared/contract").Equal<z.infer<typeof codemodEnvelopeSchema>, AstryxCodemod | AstryxConfigCodemod>>;
|
|
28
|
-
export type AstryxCodemod = import("./type").AstryxCodemod;
|
|
29
|
-
export type AstryxConfigCodemod = import("./type").AstryxConfigCodemod;
|
|
30
|
-
export type AstryxCodemodTransform = import("./type").AstryxCodemodTransform;
|
|
27
|
+
export type _CodemodDriftLock = import("../_shared/contract.js").Expect<import("../_shared/contract.js").Equal<z.infer<typeof codemodEnvelopeSchema>, AstryxCodemod | AstryxConfigCodemod>>;
|
|
28
|
+
export type AstryxCodemod = import("./type.js").AstryxCodemod;
|
|
29
|
+
export type AstryxConfigCodemod = import("./type.js").AstryxConfigCodemod;
|
|
30
|
+
export type AstryxCodemodTransform = import("./type.js").AstryxCodemodTransform;
|
|
31
31
|
import { z } from 'zod';
|
|
32
32
|
/**
|
|
33
33
|
* The load-boundary contract: a stamped codemod default export, discriminated
|
|
@@ -38,13 +38,13 @@ declare const codemodEnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
38
38
|
description: z.ZodOptional<z.ZodString>;
|
|
39
39
|
isOptional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
40
40
|
fileExtensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
-
transform: z.ZodType<import("./type").AstryxCodemodTransform, any, z.core.$ZodTypeInternals<import("./type").AstryxCodemodTransform, any>>;
|
|
41
|
+
transform: z.ZodType<import("./type.js").AstryxCodemodTransform, any, z.core.$ZodTypeInternals<import("./type.js").AstryxCodemodTransform, any>>;
|
|
42
42
|
type: z.ZodLiteral<"code">;
|
|
43
43
|
}, z.core.$strict>, z.ZodObject<{
|
|
44
44
|
title: z.ZodString;
|
|
45
45
|
description: z.ZodOptional<z.ZodString>;
|
|
46
46
|
isOptional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
47
|
-
transform: z.ZodType<import("./type").AstryxCodemodTransform, any, z.core.$ZodTypeInternals<import("./type").AstryxCodemodTransform, any>>;
|
|
47
|
+
transform: z.ZodType<import("./type.js").AstryxCodemodTransform, any, z.core.$ZodTypeInternals<import("./type.js").AstryxCodemodTransform, any>>;
|
|
48
48
|
type: z.ZodLiteral<"config">;
|
|
49
49
|
}, z.core.$strict>], "type">;
|
|
50
50
|
export {};
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
import {z} from 'zod';
|
|
11
11
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
12
12
|
|
|
13
|
-
/** @typedef {import('./type').AstryxCodemod} AstryxCodemod */
|
|
14
|
-
/** @typedef {import('./type').AstryxConfigCodemod} AstryxConfigCodemod */
|
|
15
|
-
/** @typedef {import('./type').AstryxCodemodTransform} AstryxCodemodTransform */
|
|
13
|
+
/** @typedef {import('./type.js').AstryxCodemod} AstryxCodemod */
|
|
14
|
+
/** @typedef {import('./type.js').AstryxConfigCodemod} AstryxConfigCodemod */
|
|
15
|
+
/** @typedef {import('./type.js').AstryxCodemodTransform} AstryxCodemodTransform */
|
|
16
16
|
|
|
17
17
|
const transform = /** @type {z.ZodType<AstryxCodemodTransform>} */ (
|
|
18
|
-
z.custom(value => typeof value === 'function', {
|
|
18
|
+
z.custom(value => typeof value === 'function', {
|
|
19
|
+
message: 'Expected a function',
|
|
20
|
+
})
|
|
19
21
|
);
|
|
20
22
|
|
|
21
23
|
const codeCodemodSchema = z
|
|
@@ -52,8 +54,8 @@ const codemodEnvelopeSchema = z.discriminatedUnion('type', [
|
|
|
52
54
|
* Compile-time drift-lock: sealed envelope must infer exactly the public
|
|
53
55
|
* stamped-codemod union.
|
|
54
56
|
*
|
|
55
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
56
|
-
* import('../_shared/contract').Equal<
|
|
57
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
58
|
+
* import('../_shared/contract.js').Equal<
|
|
57
59
|
* z.infer<typeof codemodEnvelopeSchema>,
|
|
58
60
|
* AstryxCodemod | AstryxConfigCodemod
|
|
59
61
|
* >
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* {@link AstryxConfig} type. If they drift, `Equal` becomes `false` and
|
|
7
7
|
* `Expect<false>` fails the `tsconfig.authoring-contract.json` typecheck.
|
|
8
8
|
*
|
|
9
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
10
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof configSchema>, AstryxConfig>
|
|
9
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
10
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof configSchema>, AstryxConfig>
|
|
11
11
|
* >} _ConfigDriftLock
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
@@ -23,13 +23,13 @@ export function parseConfig(input: unknown, label?: string): AstryxConfig;
|
|
|
23
23
|
* {@link AstryxConfig} type. If they drift, `Equal` becomes `false` and
|
|
24
24
|
* `Expect<false>` fails the `tsconfig.authoring-contract.json` typecheck.
|
|
25
25
|
*/
|
|
26
|
-
export type _ConfigDriftLock = import("../_shared/contract").Expect<import("../_shared/contract").MutuallyAssignable<z.infer<typeof configSchema>, AstryxConfig>>;
|
|
27
|
-
export type AstryxConfig = import("./type").AstryxConfig;
|
|
28
|
-
export type PostCodemodHook = import("./type").PostCodemodHook;
|
|
29
|
-
export type XleComponent = import("./type").XleComponent;
|
|
30
|
-
export type DebugConfig = import("./type").DebugConfig;
|
|
31
|
-
export type DebugEventHandler = import("../debug/type").DebugEventHandler;
|
|
32
|
-
export type GapReportHandler = import("../gap-report/type").GapReportHandler;
|
|
26
|
+
export type _ConfigDriftLock = import("../_shared/contract.js").Expect<import("../_shared/contract.js").MutuallyAssignable<z.infer<typeof configSchema>, AstryxConfig>>;
|
|
27
|
+
export type AstryxConfig = import("./type.js").AstryxConfig;
|
|
28
|
+
export type PostCodemodHook = import("./type.js").PostCodemodHook;
|
|
29
|
+
export type XleComponent = import("./type.js").XleComponent;
|
|
30
|
+
export type DebugConfig = import("./type.js").DebugConfig;
|
|
31
|
+
export type DebugEventHandler = import("../debug/type.js").DebugEventHandler;
|
|
32
|
+
export type GapReportHandler = import("../gap-report/type.js").GapReportHandler;
|
|
33
33
|
import { z } from 'zod';
|
|
34
34
|
declare const configSchema: z.ZodObject<{
|
|
35
35
|
integrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -40,14 +40,14 @@ declare const configSchema: z.ZodObject<{
|
|
|
40
40
|
buildCommand: z.ZodType<(ctx: {
|
|
41
41
|
packageDir: string;
|
|
42
42
|
files: string[];
|
|
43
|
-
}) => import("./type").PostCodemodCommand | null | undefined | Promise<import("./type").PostCodemodCommand | null | undefined>, any, z.core.$ZodTypeInternals<(ctx: {
|
|
43
|
+
}) => import("./type.js").PostCodemodCommand | null | undefined | Promise<import("./type.js").PostCodemodCommand | null | undefined>, any, z.core.$ZodTypeInternals<(ctx: {
|
|
44
44
|
packageDir: string;
|
|
45
45
|
files: string[];
|
|
46
|
-
}) => import("./type").PostCodemodCommand | null | undefined | Promise<import("./type").PostCodemodCommand | null | undefined>, any>>;
|
|
46
|
+
}) => import("./type.js").PostCodemodCommand | null | undefined | Promise<import("./type.js").PostCodemodCommand | null | undefined>, any>>;
|
|
47
47
|
}, z.core.$strict>>>;
|
|
48
48
|
}, z.core.$strict>>;
|
|
49
|
-
debug: z.ZodOptional<z.ZodType<import("../debug/type").DebugEventHandler, any, z.core.$ZodTypeInternals<import("../debug/type").DebugEventHandler, any>>>;
|
|
50
|
-
gapReport: z.ZodOptional<z.ZodType<import("../gap-report/type").GapReportHandler, any, z.core.$ZodTypeInternals<import("../gap-report/type").GapReportHandler, any>>>;
|
|
49
|
+
debug: z.ZodOptional<z.ZodType<import("../debug/type.js").DebugEventHandler, any, z.core.$ZodTypeInternals<import("../debug/type.js").DebugEventHandler, any>>>;
|
|
50
|
+
gapReport: z.ZodOptional<z.ZodType<import("../gap-report/type.js").GapReportHandler, any, z.core.$ZodTypeInternals<import("../gap-report/type.js").GapReportHandler, any>>>;
|
|
51
51
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
52
52
|
xle: z.ZodOptional<z.ZodObject<{
|
|
53
53
|
components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -13,12 +13,12 @@ import {z} from 'zod';
|
|
|
13
13
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
14
14
|
import {parseGapReportHandler} from '../gap-report/parse.mjs';
|
|
15
15
|
|
|
16
|
-
/** @typedef {import('./type').AstryxConfig} AstryxConfig */
|
|
17
|
-
/** @typedef {import('./type').PostCodemodHook} PostCodemodHook */
|
|
18
|
-
/** @typedef {import('./type').XleComponent} XleComponent */
|
|
19
|
-
/** @typedef {import('./type').DebugConfig} DebugConfig */
|
|
20
|
-
/** @typedef {import('../debug/type').DebugEventHandler} DebugEventHandler */
|
|
21
|
-
/** @typedef {import('../gap-report/type').GapReportHandler} GapReportHandler */
|
|
16
|
+
/** @typedef {import('./type.js').AstryxConfig} AstryxConfig */
|
|
17
|
+
/** @typedef {import('./type.js').PostCodemodHook} PostCodemodHook */
|
|
18
|
+
/** @typedef {import('./type.js').XleComponent} XleComponent */
|
|
19
|
+
/** @typedef {import('./type.js').DebugConfig} DebugConfig */
|
|
20
|
+
/** @typedef {import('../debug/type.js').DebugEventHandler} DebugEventHandler */
|
|
21
|
+
/** @typedef {import('../gap-report/type.js').GapReportHandler} GapReportHandler */
|
|
22
22
|
|
|
23
23
|
// Typed `z.custom` so `z.infer` reproduces the real function type (not `unknown`).
|
|
24
24
|
const buildCommand = /** @type {z.ZodType<PostCodemodHook['buildCommand']>} */ (
|
|
@@ -95,8 +95,8 @@ const configSchema = z
|
|
|
95
95
|
* {@link AstryxConfig} type. If they drift, `Equal` becomes `false` and
|
|
96
96
|
* `Expect<false>` fails the `tsconfig.authoring-contract.json` typecheck.
|
|
97
97
|
*
|
|
98
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
99
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof configSchema>, AstryxConfig>
|
|
98
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
99
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof configSchema>, AstryxConfig>
|
|
100
100
|
* >} _ConfigDriftLock
|
|
101
101
|
*/
|
|
102
102
|
|
package/authoring/config/type.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* boundary; there is no factory to call.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type {DebugEventHandler} from '../debug/type';
|
|
13
|
-
import type {GapReportHandler} from '../gap-report/type';
|
|
12
|
+
import type {DebugEventHandler} from '../debug/type.js';
|
|
13
|
+
import type {GapReportHandler} from '../gap-report/type.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* A command to run as part of a post-codemod hook. Returned by a hook's
|
|
@@ -21,7 +21,7 @@ export interface PostCodemodCommand {
|
|
|
21
21
|
args?: string[];
|
|
22
22
|
options?: {
|
|
23
23
|
cwd?: string;
|
|
24
|
-
env?:
|
|
24
|
+
env?: Record<string, string | undefined>;
|
|
25
25
|
timeout?: number;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* `Expect<false>` fails the `tsconfig.authoring-contract.json` typecheck —
|
|
8
8
|
* so a field added to the recorder without being published here breaks CI.
|
|
9
9
|
*
|
|
10
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
11
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof eventSchema>, DebugEvent>
|
|
10
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
11
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof eventSchema>, DebugEvent>
|
|
12
12
|
* >} _DebugEventDriftLock
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
@@ -29,8 +29,8 @@ export function parseDebugEvent(input: unknown, label?: string): DebugEvent;
|
|
|
29
29
|
* `Expect<false>` fails the `tsconfig.authoring-contract.json` typecheck —
|
|
30
30
|
* so a field added to the recorder without being published here breaks CI.
|
|
31
31
|
*/
|
|
32
|
-
export type _DebugEventDriftLock = import("../_shared/contract").Expect<import("../_shared/contract").MutuallyAssignable<z.infer<typeof eventSchema>, DebugEvent>>;
|
|
33
|
-
export type DebugEvent = import("./type").DebugEvent;
|
|
32
|
+
export type _DebugEventDriftLock = import("../_shared/contract.js").Expect<import("../_shared/contract.js").MutuallyAssignable<z.infer<typeof eventSchema>, DebugEvent>>;
|
|
33
|
+
export type DebugEvent = import("./type.js").DebugEvent;
|
|
34
34
|
import { z } from 'zod';
|
|
35
35
|
declare const eventSchema: z.ZodObject<{
|
|
36
36
|
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
@@ -77,12 +77,12 @@ declare const eventSchema: z.ZodObject<{
|
|
|
77
77
|
resultKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
78
78
|
theme: "theme";
|
|
79
79
|
component: "component";
|
|
80
|
+
command: "command";
|
|
80
81
|
hook: "hook";
|
|
81
82
|
doc: "doc";
|
|
82
83
|
template: "template";
|
|
83
84
|
integration: "integration";
|
|
84
85
|
migration: "migration";
|
|
85
|
-
command: "command";
|
|
86
86
|
mixed: "mixed";
|
|
87
87
|
none: "none";
|
|
88
88
|
}>>>;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import {z} from 'zod';
|
|
23
23
|
import {formatZodError} from '../_shared/errors.mjs';
|
|
24
24
|
|
|
25
|
-
/** @typedef {import('./type').DebugEvent} DebugEvent */
|
|
25
|
+
/** @typedef {import('./type.js').DebugEvent} DebugEvent */
|
|
26
26
|
|
|
27
27
|
const outcomeSchema = z.enum([
|
|
28
28
|
'ok',
|
|
@@ -169,8 +169,8 @@ const eventSchema = z
|
|
|
169
169
|
* `Expect<false>` fails the `tsconfig.authoring-contract.json` typecheck —
|
|
170
170
|
* so a field added to the recorder without being published here breaks CI.
|
|
171
171
|
*
|
|
172
|
-
* @typedef {import('../_shared/contract').Expect<
|
|
173
|
-
* import('../_shared/contract').MutuallyAssignable<z.infer<typeof eventSchema>, DebugEvent>
|
|
172
|
+
* @typedef {import('../_shared/contract.js').Expect<
|
|
173
|
+
* import('../_shared/contract.js').MutuallyAssignable<z.infer<typeof eventSchema>, DebugEvent>
|
|
174
174
|
* >} _DebugEventDriftLock
|
|
175
175
|
*/
|
|
176
176
|
|