@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.
Files changed (196) hide show
  1. package/README.md +2 -1
  2. package/api/build/build.type.d.mts +2 -2
  3. package/api/build/build.type.mjs +2 -2
  4. package/api/component/component.type.d.mts +6 -6
  5. package/api/component/component.type.mjs +19 -19
  6. package/api/discover/discover.type.d.mts +4 -4
  7. package/api/discover/discover.type.mjs +10 -10
  8. package/api/docs/_adapter.d.mts +37 -24
  9. package/api/docs/_adapter.mjs +169 -83
  10. package/api/docs/compiled-topics.test.mjs +78 -0
  11. package/api/docs/detail/detail.mjs +14 -63
  12. package/api/docs/detail/section/section.d.mts +1 -1
  13. package/api/docs/detail/section/section.mjs +44 -20
  14. package/api/docs/detail/section/section.test.mjs +41 -0
  15. package/api/docs/docs.d.mts +7 -2
  16. package/api/docs/docs.doc.mjs +27 -10
  17. package/api/docs/docs.mjs +16 -9
  18. package/api/docs/docs.test.mjs +6 -0
  19. package/api/docs/docs.type.d.mts +40 -3
  20. package/api/docs/docs.type.mjs +36 -8
  21. package/api/docs/index/index.d.mts +18 -0
  22. package/api/docs/index/index.mjs +32 -0
  23. package/api/docs/index/index.test.mjs +62 -0
  24. package/api/docs/integrationDocs.test.mjs +106 -0
  25. package/api/doctor/doctor.d.mts +48 -0
  26. package/api/doctor/doctor.mjs +232 -0
  27. package/api/doctor/doctor.test.mjs +196 -0
  28. package/api/hook/hook.type.d.mts +3 -3
  29. package/api/hook/hook.type.mjs +11 -11
  30. package/api/hook/list/list.d.mts +1 -1
  31. package/api/integration/add-contribution.mjs +5 -3
  32. package/api/integration/add-contribution.test.mjs +4 -4
  33. package/api/integration/integration-authoring.type.d.mts +1 -1
  34. package/api/integration/pack-check.mjs +49 -7
  35. package/api/integration/pack-check.test.mjs +249 -0
  36. package/api/search/search.d.mts +1 -1
  37. package/api/search/search.mjs +5 -5
  38. package/api/search/search.type.d.mts +2 -2
  39. package/api/search/search.type.mjs +1 -1
  40. package/api/swizzle/swizzle.type.d.mts +2 -2
  41. package/api/swizzle/swizzle.type.mjs +2 -2
  42. package/api/template/template.d.mts +1 -1
  43. package/api/template/template.type.d.mts +6 -6
  44. package/api/template/template.type.mjs +12 -12
  45. package/api/theme/build/build.mjs +20 -6
  46. package/api/theme/build/build.test.mjs +127 -0
  47. package/api/theme/palette/generate/generate.mjs +1 -1
  48. package/api/theme/palette/generate/generator.d.mts +10 -13
  49. package/api/theme/palette/generate/generator.mjs +7 -3
  50. package/api/theme/theme.type.d.mts +170 -11
  51. package/api/theme/theme.type.mjs +94 -27
  52. package/api/upgrade/_adapter.mjs +71 -5
  53. package/api/upgrade/project-context.test.mjs +272 -0
  54. package/api/upgrade/upgrade.doc.mjs +4 -3
  55. package/api/upgrade/upgrade.type.d.mts +5 -5
  56. package/api/upgrade/upgrade.type.mjs +11 -11
  57. package/assets/codemods/integration-discovery.mjs +40 -2
  58. package/assets/codemods/integration-discovery.test.mjs +58 -0
  59. package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +27 -5
  60. package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +20 -5
  61. package/assets/docs/README.md +9 -0
  62. package/assets/docs/authoring.doc.mjs +14 -0
  63. package/assets/docs/cli-integrations.doc.mjs +86 -15
  64. package/assets/docs/styling-libraries.doc.mjs +1 -1
  65. package/assets/docs/working-with-ai.doc.mjs +1 -1
  66. package/assets/templates/blocks/components/Timer/TimerFormats.doc.mjs +14 -0
  67. package/assets/templates/blocks/components/Timer/TimerFormats.tsx +34 -0
  68. package/assets/templates/blocks/components/Timer/TimerInline.doc.mjs +14 -0
  69. package/assets/templates/blocks/components/Timer/TimerInline.tsx +14 -0
  70. package/assets/templates/blocks/components/Timer/TimerShowcase.doc.mjs +13 -0
  71. package/assets/templates/blocks/components/Timer/TimerShowcase.tsx +47 -0
  72. package/assets/templates/blocks/components/Timer/TimerTypography.doc.mjs +14 -0
  73. package/assets/templates/blocks/components/Timer/TimerTypography.tsx +31 -0
  74. package/authoring/_shared/contract.ts +22 -0
  75. package/authoring/codemod/codemod.doc.mjs +6 -1
  76. package/authoring/codemod/parse.d.mts +8 -8
  77. package/authoring/codemod/parse.mjs +8 -6
  78. package/authoring/config/parse.d.mts +13 -13
  79. package/authoring/config/parse.mjs +8 -8
  80. package/authoring/config/type.ts +3 -3
  81. package/authoring/debug/parse.d.mts +5 -5
  82. package/authoring/debug/parse.mjs +3 -3
  83. package/authoring/doctypes/_schema.d.mts +788 -23
  84. package/authoring/doctypes/_schema.mjs +492 -39
  85. package/authoring/doctypes/base/graph-fields.doc.d.mts +9 -0
  86. package/authoring/doctypes/base/graph-fields.doc.mjs +62 -0
  87. package/authoring/doctypes/base/type.ts +40 -0
  88. package/authoring/doctypes/command/command.doc.mjs +3 -2
  89. package/authoring/doctypes/command/parse.d.mts +2 -2
  90. package/authoring/doctypes/command/parse.mjs +1 -1
  91. package/authoring/doctypes/command/type.ts +3 -2
  92. package/authoring/doctypes/component/component.doc.mjs +6 -3
  93. package/authoring/doctypes/component/parse.d.mts +2 -2
  94. package/authoring/doctypes/component/parse.mjs +1 -1
  95. package/authoring/doctypes/component/type.ts +4 -3
  96. package/authoring/doctypes/enum/parse.d.mts +2 -2
  97. package/authoring/doctypes/enum/parse.mjs +1 -1
  98. package/authoring/doctypes/enum/type.ts +3 -1
  99. package/authoring/doctypes/function/function.doc.mjs +4 -0
  100. package/authoring/doctypes/function/parse.d.mts +2 -2
  101. package/authoring/doctypes/function/parse.mjs +1 -1
  102. package/authoring/doctypes/function/type.ts +6 -2
  103. package/authoring/doctypes/hook/hook.doc.mjs +4 -0
  104. package/authoring/doctypes/hook/parse.d.mts +2 -2
  105. package/authoring/doctypes/hook/parse.mjs +1 -1
  106. package/authoring/doctypes/hook/type.ts +3 -2
  107. package/authoring/doctypes/legacy.d.mts +8 -6
  108. package/authoring/doctypes/legacy.mjs +5 -4
  109. package/authoring/doctypes/load-contract.test.mjs +207 -0
  110. package/authoring/doctypes/namespace/namespace.doc.d.mts +9 -0
  111. package/authoring/doctypes/namespace/namespace.doc.mjs +132 -0
  112. package/authoring/doctypes/namespace/parse.d.mts +12 -0
  113. package/authoring/doctypes/namespace/parse.mjs +25 -0
  114. package/authoring/doctypes/namespace/parse.test.mjs +165 -0
  115. package/authoring/doctypes/namespace/type.ts +71 -0
  116. package/authoring/doctypes/parse.d.mts +20 -18
  117. package/authoring/doctypes/parse.mjs +16 -10
  118. package/authoring/doctypes/parse.test.mjs +77 -3
  119. package/authoring/doctypes/reference/parse.d.mts +2 -2
  120. package/authoring/doctypes/reference/parse.mjs +8 -5
  121. package/authoring/doctypes/reference/reference.doc.mjs +17 -4
  122. package/authoring/doctypes/reference/type.ts +51 -5
  123. package/authoring/doctypes/schema/parse.d.mts +2 -2
  124. package/authoring/doctypes/schema/parse.mjs +1 -1
  125. package/authoring/doctypes/schema/type.ts +3 -2
  126. package/authoring/doctypes/template/parse.d.mts +92 -1
  127. package/authoring/doctypes/template/parse.mjs +36 -2
  128. package/authoring/doctypes/template/parse.test.mjs +8 -2
  129. package/authoring/doctypes/template/template.doc.mjs +4 -0
  130. package/authoring/doctypes/template/type.ts +5 -2
  131. package/authoring/doctypes/types.ts +10 -9
  132. package/authoring/gap-report/parse.d.mts +10 -10
  133. package/authoring/gap-report/parse.mjs +6 -6
  134. package/authoring/gap-report/type.ts +1 -1
  135. package/authoring/identity/identity.doc.d.mts +9 -0
  136. package/authoring/identity/identity.doc.mjs +61 -0
  137. package/authoring/identity/type.ts +132 -0
  138. package/authoring/index.d.mts +1 -0
  139. package/authoring/index.d.ts +49 -17
  140. package/authoring/index.mjs +1 -0
  141. package/authoring/integration/integration.doc.mjs +13 -6
  142. package/authoring/integration/parse.d.mts +2 -2
  143. package/authoring/integration/parse.mjs +1 -1
  144. package/authoring/integration/parse.test.mjs +10 -1
  145. package/authoring/integration/schema.d.mts +6 -4
  146. package/authoring/integration/schema.mjs +9 -3
  147. package/authoring/integration/type.ts +23 -6
  148. package/authoring/shadcn/receipt.d.mts +6 -6
  149. package/clients/cli/commands/docs.doc.mjs +13 -3
  150. package/clients/cli/commands/docs.mjs +121 -21
  151. package/clients/cli/commands/docs.test.mjs +88 -0
  152. package/clients/cli/commands/integration-authoring.test.mjs +13 -9
  153. package/clients/cli/commands/theme-palette-generate.doc.mjs +8 -4
  154. package/clients/cli/commands/upgrade.doc.mjs +2 -2
  155. package/clients/cli/formatters/index.mjs +162 -1
  156. package/clients/cli/formatters/index.test.mjs +91 -0
  157. package/clients/cli/lib/manifest.mjs +7 -2
  158. package/foundation/config/project.mjs +21 -6
  159. package/foundation/discovery/authoring-self-docs.d.mts +69 -0
  160. package/foundation/discovery/authoring-self-docs.mjs +214 -0
  161. package/foundation/discovery/authoring-self-docs.test.mjs +154 -0
  162. package/foundation/discovery/component-discovery.d.mts +1 -1
  163. package/foundation/discovery/component-discovery.mjs +2 -1
  164. package/foundation/discovery/docs-discovery.d.mts +11 -4
  165. package/foundation/discovery/docs-discovery.mjs +208 -88
  166. package/foundation/discovery/docs-discovery.test.mjs +279 -13
  167. package/foundation/discovery/docs-output-budget.d.mts +28 -0
  168. package/foundation/discovery/docs-output-budget.mjs +50 -0
  169. package/foundation/discovery/docs-section-key.d.mts +98 -0
  170. package/foundation/discovery/docs-section-key.mjs +221 -0
  171. package/foundation/discovery/docs-section-key.test.mjs +224 -0
  172. package/foundation/discovery/template-adapter.mjs +2 -1
  173. package/foundation/discovery/theming-targets.test.mjs +4 -0
  174. package/foundation/doc-compiler/compile.d.mts +162 -0
  175. package/foundation/doc-compiler/compile.mjs +262 -0
  176. package/foundation/doc-compiler/doc-compiler.test.mjs +687 -0
  177. package/foundation/doc-compiler/ir.d.mts +9 -0
  178. package/foundation/doc-compiler/ir.mjs +287 -0
  179. package/foundation/doc-compiler/lenses.d.mts +33 -0
  180. package/foundation/doc-compiler/lenses.mjs +127 -0
  181. package/foundation/identity/provider-identity.d.mts +90 -0
  182. package/foundation/identity/provider-identity.mjs +320 -0
  183. package/foundation/identity/provider-identity.test.mjs +254 -0
  184. package/foundation/identity/providers.d.mts +7 -0
  185. package/foundation/identity/providers.mjs +16 -0
  186. package/foundation/integrations/autolink.mjs +12 -5
  187. package/foundation/integrations/integration-warnings.mjs +6 -0
  188. package/foundation/integrations/integrations.d.mts +46 -2
  189. package/foundation/integrations/integrations.mjs +167 -8
  190. package/foundation/integrations/integrations.test.mjs +384 -1
  191. package/foundation/integrations/provider-conflicts.test.mjs +125 -0
  192. package/foundation/integrations/validate-contributions.d.mts +2 -0
  193. package/foundation/integrations/validate-contributions.mjs +10 -0
  194. package/foundation/response/json-contract.test.mjs +46 -17
  195. package/foundation/response/response-types.doc.mjs +6 -1
  196. 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', {message: 'Expected a 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
 
@@ -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?: NodeJS.ProcessEnv;
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