attaform 0.26.0 → 0.27.1

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 (163) hide show
  1. package/README.md +21 -11
  2. package/bin/attaform.mjs +125 -0
  3. package/dist/abstract.cjs +47 -0
  4. package/dist/abstract.cjs.map +1 -0
  5. package/dist/abstract.d.cts +42 -0
  6. package/dist/abstract.d.mts +42 -0
  7. package/dist/abstract.d.ts +42 -0
  8. package/dist/abstract.mjs +4 -0
  9. package/dist/abstract.mjs.map +1 -0
  10. package/dist/chunks/devtools.cjs +2 -2
  11. package/dist/chunks/devtools.cjs.map +1 -1
  12. package/dist/chunks/devtools.mjs +1 -1
  13. package/dist/chunks/fingerprint2.cjs +1 -1
  14. package/dist/chunks/fingerprint2.mjs +1 -1
  15. package/dist/esbuild.cjs +2 -2
  16. package/dist/esbuild.cjs.map +1 -1
  17. package/dist/esbuild.d.cts +3 -3
  18. package/dist/esbuild.d.mts +3 -3
  19. package/dist/esbuild.d.ts +3 -3
  20. package/dist/esbuild.mjs +2 -2
  21. package/dist/esbuild.mjs.map +1 -1
  22. package/dist/index.cjs +41 -56
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +194 -282
  25. package/dist/index.d.mts +194 -282
  26. package/dist/index.d.ts +194 -282
  27. package/dist/index.mjs +4 -25
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/nuxt.cjs +3 -1
  30. package/dist/nuxt.cjs.map +1 -1
  31. package/dist/nuxt.d.cts +17 -4
  32. package/dist/nuxt.d.mts +17 -4
  33. package/dist/nuxt.d.ts +17 -4
  34. package/dist/nuxt.mjs +4 -2
  35. package/dist/nuxt.mjs.map +1 -1
  36. package/dist/rollup.cjs +2 -2
  37. package/dist/rollup.cjs.map +1 -1
  38. package/dist/rollup.d.cts +3 -3
  39. package/dist/rollup.d.mts +3 -3
  40. package/dist/rollup.d.ts +3 -3
  41. package/dist/rollup.mjs +2 -2
  42. package/dist/rollup.mjs.map +1 -1
  43. package/dist/rspack.cjs +1 -1
  44. package/dist/rspack.d.cts +1 -1
  45. package/dist/rspack.d.mts +1 -1
  46. package/dist/rspack.d.ts +1 -1
  47. package/dist/rspack.mjs +1 -1
  48. package/dist/runtime/plugins/attaform.cjs +4 -5
  49. package/dist/runtime/plugins/attaform.cjs.map +1 -1
  50. package/dist/runtime/plugins/attaform.mjs +1 -2
  51. package/dist/runtime/plugins/attaform.mjs.map +1 -1
  52. package/dist/shared/{attaform.BRzKBj2g.cjs → attaform.8tFZu1Ub.cjs} +2 -2
  53. package/dist/shared/{attaform.BRzKBj2g.cjs.map → attaform.8tFZu1Ub.cjs.map} +1 -1
  54. package/dist/shared/{attaform.k9V0py0s.mjs → attaform.BERt5YMU.mjs} +2 -2
  55. package/dist/shared/{attaform.k9V0py0s.mjs.map → attaform.BERt5YMU.mjs.map} +1 -1
  56. package/dist/shared/{attaform.DSOIz08n.mjs → attaform.BceJrhQ7.mjs} +5 -5
  57. package/dist/shared/{attaform.DSOIz08n.mjs.map → attaform.BceJrhQ7.mjs.map} +1 -1
  58. package/dist/shared/{attaform.DBNjHgNj.d.cts → attaform.C3WnCDXz.d.cts} +11 -9
  59. package/dist/shared/{attaform.DBNjHgNj.d.mts → attaform.C3WnCDXz.d.mts} +11 -9
  60. package/dist/shared/{attaform.DBNjHgNj.d.ts → attaform.C3WnCDXz.d.ts} +11 -9
  61. package/dist/shared/{attaform.DuzQYscR.d.mts → attaform.C9fPTxjB.d.cts} +5 -5
  62. package/dist/shared/{attaform.DuzQYscR.d.ts → attaform.C9fPTxjB.d.mts} +5 -5
  63. package/dist/shared/{attaform.DuzQYscR.d.cts → attaform.C9fPTxjB.d.ts} +5 -5
  64. package/dist/shared/{attaform.Be5otUVw.d.ts → attaform.CC_y1_Ej.d.ts} +33 -33
  65. package/dist/shared/{attaform.ceYeVkjn.d.ts → attaform.CEXUlUkc.d.ts} +1579 -1192
  66. package/dist/shared/{attaform.tZ0YKisf.cjs → attaform.C__F01CE.cjs} +15 -15
  67. package/dist/shared/{attaform.tZ0YKisf.cjs.map → attaform.C__F01CE.cjs.map} +1 -1
  68. package/dist/shared/{attaform.BPl-ECRT.cjs → attaform.Co5LNRnv.cjs} +162 -129
  69. package/dist/shared/attaform.Co5LNRnv.cjs.map +1 -0
  70. package/dist/shared/{attaform.B71rfNL5.d.mts → attaform.CpXHK60W.d.cts} +33 -33
  71. package/dist/shared/{attaform.BFfY7HRI.d.cts → attaform.CvVYOvZF.d.mts} +33 -33
  72. package/dist/shared/{attaform.BoYqnIPI.mjs → attaform.CyQxTOdX.mjs} +55 -36
  73. package/dist/shared/attaform.CyQxTOdX.mjs.map +1 -0
  74. package/dist/shared/{attaform.CEY_WLRJ.d.mts → attaform.D99pd7JG.d.cts} +1579 -1192
  75. package/dist/shared/{attaform.CXVmZtFq.mjs → attaform.DDAmSFnl.mjs} +4 -4
  76. package/dist/shared/{attaform.CXVmZtFq.mjs.map → attaform.DDAmSFnl.mjs.map} +1 -1
  77. package/dist/shared/{attaform.Du9RZp8m.cjs → attaform.DQT7_-FO.cjs} +272 -252
  78. package/dist/shared/attaform.DQT7_-FO.cjs.map +1 -0
  79. package/dist/shared/{attaform.DGhIix5D.mjs → attaform.Da8EdI2t.mjs} +160 -129
  80. package/dist/shared/attaform.Da8EdI2t.mjs.map +1 -0
  81. package/dist/shared/{attaform.Cs0UZ7q6.cjs → attaform.DhVgG2jh.cjs} +16 -16
  82. package/dist/shared/{attaform.Cs0UZ7q6.cjs.map → attaform.DhVgG2jh.cjs.map} +1 -1
  83. package/dist/shared/{attaform.sHkHv_98.mjs → attaform.DhnPb6nK.mjs} +6 -3
  84. package/dist/shared/attaform.DhnPb6nK.mjs.map +1 -0
  85. package/dist/shared/attaform.DkD0DR7R.mjs +42 -0
  86. package/dist/shared/attaform.DkD0DR7R.mjs.map +1 -0
  87. package/dist/shared/{attaform.CSXDW2tO.mjs → attaform.DlSu08F5.mjs} +4 -4
  88. package/dist/shared/{attaform.CSXDW2tO.mjs.map → attaform.DlSu08F5.mjs.map} +1 -1
  89. package/dist/shared/{attaform.LEWUFqUw.cjs → attaform.DoQm_Vkd.cjs} +7 -3
  90. package/dist/shared/attaform.DoQm_Vkd.cjs.map +1 -0
  91. package/dist/shared/{attaform.BQflyVOL.cjs → attaform.Drsi43GG.cjs} +19 -19
  92. package/dist/shared/{attaform.BQflyVOL.cjs.map → attaform.Drsi43GG.cjs.map} +1 -1
  93. package/dist/shared/attaform.K6Thc6By.cjs +46 -0
  94. package/dist/shared/attaform.K6Thc6By.cjs.map +1 -0
  95. package/dist/shared/{attaform.Vp2-CWZB.mjs → attaform.KvlEedlF.mjs} +3 -3
  96. package/dist/shared/{attaform.Vp2-CWZB.mjs.map → attaform.KvlEedlF.mjs.map} +1 -1
  97. package/dist/shared/{attaform.BRGIpZo4.cjs → attaform.RaTzp1WF.cjs} +3 -3
  98. package/dist/shared/attaform.RaTzp1WF.cjs.map +1 -0
  99. package/dist/shared/{attaform.MgaYKlPP.d.cts → attaform.kBkYlKP_.d.mts} +1579 -1192
  100. package/dist/shared/{attaform.C3Doa9Pt.mjs → attaform.v0fQtWyA.mjs} +3 -3
  101. package/dist/shared/attaform.v0fQtWyA.mjs.map +1 -0
  102. package/dist/shared/{attaform.ZXZ6dH72.cjs → attaform.yUrz7C2z.cjs} +3 -3
  103. package/dist/shared/{attaform.ZXZ6dH72.cjs.map → attaform.yUrz7C2z.cjs.map} +1 -1
  104. package/dist/transforms.cjs +1 -1
  105. package/dist/transforms.mjs +1 -1
  106. package/dist/vite.cjs +21 -3
  107. package/dist/vite.cjs.map +1 -1
  108. package/dist/vite.d.cts +70 -17
  109. package/dist/vite.d.mts +70 -17
  110. package/dist/vite.d.ts +70 -17
  111. package/dist/vite.mjs +20 -4
  112. package/dist/vite.mjs.map +1 -1
  113. package/dist/webpack.cjs +1 -1
  114. package/dist/webpack.d.cts +1 -1
  115. package/dist/webpack.d.mts +1 -1
  116. package/dist/webpack.d.ts +1 -1
  117. package/dist/webpack.mjs +1 -1
  118. package/dist/zod-v3.cjs +41 -10
  119. package/dist/zod-v3.cjs.map +1 -1
  120. package/dist/zod-v3.d.cts +5 -5
  121. package/dist/zod-v3.d.mts +5 -5
  122. package/dist/zod-v3.d.ts +5 -5
  123. package/dist/zod-v3.mjs +4 -2
  124. package/dist/zod-v3.mjs.map +1 -1
  125. package/dist/zod-v4.cjs +41 -10
  126. package/dist/zod-v4.cjs.map +1 -1
  127. package/dist/zod-v4.d.cts +7 -7
  128. package/dist/zod-v4.d.mts +7 -7
  129. package/dist/zod-v4.d.ts +7 -7
  130. package/dist/zod-v4.mjs +4 -2
  131. package/dist/zod-v4.mjs.map +1 -1
  132. package/dist/zod.cjs +44 -49
  133. package/dist/zod.cjs.map +1 -1
  134. package/dist/zod.d.cts +6 -248
  135. package/dist/zod.d.mts +6 -248
  136. package/dist/zod.d.ts +6 -248
  137. package/dist/zod.mjs +4 -42
  138. package/dist/zod.mjs.map +1 -1
  139. package/package.json +12 -2
  140. package/skills/attaform/SKILL.md +128 -0
  141. package/skills/attaform/references/custom-components.md +72 -0
  142. package/skills/attaform/references/errors.md +62 -0
  143. package/skills/attaform/references/ssr.md +26 -0
  144. package/skills/attaform/references/validation.md +40 -0
  145. package/skills/attaform/references/wizards.md +104 -0
  146. package/dist/shared/attaform.55hFR_cl.d.ts +0 -97
  147. package/dist/shared/attaform.BPl-ECRT.cjs.map +0 -1
  148. package/dist/shared/attaform.BRGIpZo4.cjs.map +0 -1
  149. package/dist/shared/attaform.BoYqnIPI.mjs.map +0 -1
  150. package/dist/shared/attaform.C3Doa9Pt.mjs.map +0 -1
  151. package/dist/shared/attaform.D51IwDtP.cjs +0 -39
  152. package/dist/shared/attaform.D51IwDtP.cjs.map +0 -1
  153. package/dist/shared/attaform.DGhIix5D.mjs.map +0 -1
  154. package/dist/shared/attaform.DJRz_bzM.d.cts +0 -97
  155. package/dist/shared/attaform.Du9RZp8m.cjs.map +0 -1
  156. package/dist/shared/attaform.JPsaqjLl.d.mts +0 -97
  157. package/dist/shared/attaform.LEWUFqUw.cjs.map +0 -1
  158. package/dist/shared/attaform.NqYEzRcM.mjs +0 -35
  159. package/dist/shared/attaform.NqYEzRcM.mjs.map +0 -1
  160. package/dist/shared/attaform.sHkHv_98.mjs.map +0 -1
  161. package/dist/shared/{attaform.DdjDqTah.d.ts → attaform.DRUT703x.d.cts} +14 -14
  162. package/dist/shared/{attaform.DdjDqTah.d.cts → attaform.DRUT703x.d.mts} +14 -14
  163. package/dist/shared/{attaform.DdjDqTah.d.mts → attaform.DRUT703x.d.ts} +14 -14
package/dist/zod.d.mts CHANGED
@@ -1,249 +1,7 @@
1
- import { G as GenericForm, F as FormKey, U as UseFormConfiguration, a as AbstractSchema, ar as AcceptableDefaults, af as ValidateOnConfig, b as UseFormReturnType, D as DefaultValuesInput, q as FieldMetaPayload } from './shared/attaform.DBNjHgNj.mjs';
2
- export { ad as Unset, ao as isUnset, aq as unset } from './shared/attaform.DBNjHgNj.mjs';
3
- import { S as SupportedRootSchema, b as StorageShape } from './shared/attaform.B71rfNL5.mjs';
4
- export { P as PathInput, a as PathOutput } from './shared/attaform.B71rfNL5.mjs';
5
- import { S as SupportedRootSchema$1, U as UnwrapZodRoot, a as StorageShape$1 } from './shared/attaform.DdjDqTah.mjs';
6
- import { z } from 'zod';
7
- export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, t as injectForm, u as injectWizard, w as lazy, x as useRegister, z as useWizard } from './shared/attaform.CEY_WLRJ.mjs';
1
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEFAULT_TIMINGS, f as DEVTOOLS_WINDOW_KEY, g as DisplayTimings, F as FormStatus, I as InjectWizardInput, h as InvalidPathError, i as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, j as ReservedFormKeyError, S as SerializedAttaformState, k as SerializedFormData, l as StepSlot, m as SubmitErrorHandlerError, U as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as defaultCoercionRules, G as defaultDisplayState, H as defineCoercion, J as escapeForInlineScript, K as getRegistryFromApp, M as hydrateAttaformState, N as injectForm, P as injectWizard, Q as isRegisterValue, T as kAttaformRegistry, V as lazy, X as makeDefaultDisplayState, Y as renderAttaformState, Z as useRegister, _ as useRegistry, $ as useWizard, a0 as vRegister } from './shared/attaform.kBkYlKP_.mjs';
2
+ export { b as ArrayItem, c as ArrayPath, d as AttaformDefaults, C as CoercionEntry, e as CoercionRegistry, f as CoercionResult, g as CustomDirectiveRegisterAssignerFn, h as DeepPartial, D as DefaultValuesInput, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, o as FieldMetaPayload, p as FieldState, q as FieldStateMap, r as FieldStateMapEntry, s as FlatPath, t as FormErrorRecord, u as FormErrorsSurface, F as FormKey, v as FormMeta, G as GenericForm, w as GetDisplayState, H as HandleSubmit, x as HistoryConfig, I as IsTuple, y as IsUnion, J as JoinSegments, z as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, B as NestedType, O as OnError, P as OnInvalidSubmitPolicy, Q as OnSubmit, R as PartialFlatPath, S as Path, T as PathKey, V as PendingValidationStatus, W as Primitive, X as ROOT_PATH, Y as ROOT_PATH_KEY, Z as ReactiveValidationStatus, _ as RegisterDirective, $ as RegisterFlatPath, a0 as RegisterOptions, a1 as RegisterSelectModifier, a2 as RegisterTextModifier, a3 as RegisterTransform, a4 as RegisterValue, a5 as Segment, a6 as SetValueCallback, a7 as SetValuePayload, a8 as SettledValidationStatus, a9 as SlimPrimitiveKind, aa as SlimRuntimeOf, ab as SubmitHandler, ac as Unset, U as UseFormConfiguration, a as UseFormReturnType, ad as ValidateOn, ae as ValidateOnConfig, af as ValidationError, ag as ValidationResponse, ah as ValidationResponseWithoutValue, ai as ValueOfUnion, aj as WriteMeta, ak as WriteShape, al as canonicalizePath, am as isPathPrefix, an as isUnset, ao as parseDottedPath, ap as unset } from './shared/attaform.C3WnCDXz.mjs';
3
+ export { UseFormConfig, UseFormConfigV3, UseFormConfigV4, UseFormReturn, UseFormReturnV3, UseFormReturnV4, fieldMeta, useForm, withMeta } from './index.mjs';
4
+ export { P as PathInput, a as PathOutput } from './shared/attaform.CvVYOvZF.mjs';
8
5
  import 'vue';
9
-
10
- /**
11
- * Type-level Zod-major discriminator for the unified `attaform/zod`
12
- * entry. The runtime dispatch (`use-form.ts`'s impl) already routes on
13
- * the schema's shape via `isZodV4SchemaShape`; this is the type-level
14
- * mirror so the overloads and projection helpers discriminate the same
15
- * way.
16
- *
17
- * Why a structural marker instead of `z.ZodObject`: the unified entry's
18
- * overloads constrain on `z.ZodObject`, but the published `.d.mts`
19
- * resolves `z` against whichever single Zod major the consumer
20
- * installed. In a v3-only install `z.ZodObject` is v3's `ZodObject`
21
- * (and, lacking its required type arguments, degrades to an `any`-like
22
- * error type under `skipLibCheck`), so a v3 schema satisfies the v4
23
- * overload's constraint and binds it — collapsing the read slot to
24
- * `never`. A Zod v4 schema carries the `_zod` internals brand; a v3
25
- * schema never does.
26
- * Intersecting a v4-only constraint or conditional branch with this
27
- * marker keeps it unreachable for a v3 schema regardless of how `zod`
28
- * resolves, so v3 schemas fall through to the v3 overload.
29
- *
30
- * Distinct from `core/zod-shape.ts`'s runtime `ZodV4Shape` (which reads
31
- * the public `def` getter): at the type level the stable v4 brand is
32
- * `_zod.def`, the same internals `StorageShape` (v4) already reads.
33
- *
34
- * Pairing requirement: a v4 overload/branch must constrain on
35
- * `z.ZodObject<z.ZodRawShape> & ZodV4Internals`, NOT bare
36
- * `z.ZodObject & ZodV4Internals`. In a v3-only install `z.ZodObject`
37
- * with no type argument is `ZodObject<T, ...>` missing its required
38
- * arguments — an error type that behaves like `any` under
39
- * `skipLibCheck`, so `any & ZodV4Internals` collapses back to `any` and
40
- * the marker stops excluding v3 schemas. Supplying `z.ZodRawShape`
41
- * keeps it a concrete object type in both majors, so the intersection
42
- * stays meaningful.
43
- */
44
- type ZodV4Internals = {
45
- _zod: {
46
- def: unknown;
47
- };
48
- };
49
-
50
- /**
51
- * Per-major projection helpers shared by the unified `attaform/zod`
52
- * entry. Each maps an arbitrary Zod v4 OR v3 object schema to the
53
- * `GenericForm`-shaped input / output / storage-read projections the
54
- * form types are parameterised over. The constraint on each alias scopes
55
- * `S` to one Zod major, so the projection is a direct read with no
56
- * dispatch in the type body.
57
- *
58
- * Hoisted out of `types-unified.ts` and `use-form.ts` so the two entry
59
- * points share one definition. Internal — consumer code never reaches
60
- * for these; the overloaded `useForm` already gives full inference at
61
- * call sites.
62
- */
63
-
64
- /**
65
- * The schema's own input type, exactly as a consumer would reference it
66
- * (`z.input<S>`) — NOT routed through `GenericForm` / `UnwrapZodRoot`. This
67
- * is the reflexive escape arm `AcceptableDefaults` adds to the
68
- * `defaultValues` slot so a generic form wrapper forwarding `z.input<S>`
69
- * type-checks under a free `S` (#422). It must stay syntactically identical
70
- * to what the wrapper forwards: wrapping it in a conditional makes it a
71
- * deferred conditional that no longer matches the forwarded value under a
72
- * generic. Wrong-major schemas can't actually bind the slot — they are
73
- * rejected at the overload's `schema` constraint — so the raw input never
74
- * widens the slot for the wrong major.
75
- */
76
- type V4SchemaInput<S extends SupportedRootSchema> = z.input<S>;
77
- type V3SchemaInput<S extends SupportedRootSchema$1> = z.input<S>;
78
- type V4FormOf<S extends SupportedRootSchema> = z.input<S> extends GenericForm ? z.input<S> : never;
79
- type V4OutOf<S extends SupportedRootSchema> = z.output<S> extends GenericForm ? z.output<S> : never;
80
- type V4ReadOf<S extends SupportedRootSchema> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
81
- type V3FormOf<S extends SupportedRootSchema$1> = z.input<UnwrapZodRoot<S>> extends GenericForm ? z.input<UnwrapZodRoot<S>> : never;
82
- type V3OutOf<S extends SupportedRootSchema$1> = z.output<UnwrapZodRoot<S>> extends GenericForm ? z.output<UnwrapZodRoot<S>> : never;
83
- type V3ReadOf<S extends SupportedRootSchema$1> = StorageShape$1<UnwrapZodRoot<S>> extends GenericForm ? StorageShape$1<UnwrapZodRoot<S>> : never;
84
-
85
- /**
86
- * Create a form bound to a Zod v4 schema.
87
- *
88
- * ```ts
89
- * import { useForm } from 'attaform/zod'
90
- * import { z } from 'zod'
91
- *
92
- * const form = useForm({
93
- * schema: z.object({
94
- * username: z.string().min(2, 'At least 2 characters'),
95
- * password: z.string().min(8, 'At least 8 characters'),
96
- * }),
97
- * })
98
- * ```
99
- *
100
- * The constraint intersects `ZodV4Internals` (the v4-only `_zod`
101
- * brand) so a v3 schema can't bind this overload even when `z`
102
- * resolves to v3 in a single-major consumer install; v3 schemas fall
103
- * through to the v3 overload below. See `types-zod-major.ts`.
104
- */
105
- declare function useForm<Schema extends SupportedRootSchema & ZodV4Internals, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, never, K>, 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'> & {
106
- schema: Schema;
107
- defaultValues?: AcceptableDefaults<V4FormOf<Schema>, V4SchemaInput<Schema>>;
108
- } & ValidateOnConfig): UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
109
- /**
110
- * Create a form bound to a Zod v3 schema.
111
- *
112
- * ```ts
113
- * import { useForm } from 'attaform/zod'
114
- * import { z } from 'zod-v3'
115
- *
116
- * const form = useForm({
117
- * schema: z.object({
118
- * username: z.string().min(2, 'At least 2 characters'),
119
- * password: z.string().min(8, 'At least 8 characters'),
120
- * }),
121
- * })
122
- * ```
123
- *
124
- * v3 schemas match this overload; v4 schemas hit the v4 overload
125
- * above first and never reach here.
126
- */
127
- declare function useForm<Schema extends SupportedRootSchema$1, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, never, K>, 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'> & {
128
- schema: Schema;
129
- defaultValues?: AcceptableDefaults<V3FormOf<Schema>, V3SchemaInput<Schema>>;
130
- } & ValidateOnConfig): UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>;
131
-
132
- /**
133
- * Type-level helpers for the unified `attaform/zod` entry. These give
134
- * tests and other type-query call sites a deterministic projection
135
- * over an arbitrary v4 OR v3 schema, sidestepping the brittle
136
- * instantiation-expression resolution rules TypeScript applies to
137
- * overloaded functions (`typeof useForm<X>` can pick the wrong
138
- * overload or the impl signature, depending on whether the type
139
- * argument is a concrete schema, a generic, or a constraint).
140
- *
141
- * The helpers dispatch ONCE per use site via a binary conditional —
142
- * no stacking, no amplification across the return type. Equivalent
143
- * to writing `ReturnType<typeof useForm<S>>` but cache-stable across
144
- * call patterns.
145
- *
146
- * Per `inference-first DX`, these helpers are test- and
147
- * internal-facing. Consumer code shouldn't reach for them — the
148
- * overloaded `useForm` already gives full inference at call sites.
149
- */
150
-
151
- /**
152
- * Direct V4 projection — no major-dispatch. Use when the schema's
153
- * Zod major is known statically (typical for V4 generic helpers like
154
- * `function setup<S extends z.ZodObject>(s: S)`). TS simplifies the
155
- * helper cleanly under generic constraints because no conditional
156
- * is present.
157
- */
158
- type UseFormReturnV4<Schema extends z.ZodObject, K extends FormKey = FormKey> = UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
159
- /**
160
- * Direct V4 configuration projection. Mirrors `UseFormReturnV4`.
161
- */
162
- type UseFormConfigV4<Schema extends z.ZodObject, K extends FormKey = FormKey> = Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
163
- schema: Schema;
164
- } & ValidateOnConfig;
165
- /**
166
- * Direct V3 projection — no major-dispatch. Use when the schema's
167
- * Zod major is known statically.
168
- */
169
- type UseFormReturnV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey> = UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>;
170
- /**
171
- * Direct V3 configuration projection. Mirrors `UseFormReturnV3`.
172
- */
173
- type UseFormConfigV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey> = Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
174
- schema: Schema;
175
- } & ValidateOnConfig;
176
- /**
177
- * The return shape of `useForm` for a given Zod schema. Dispatches
178
- * once on the schema's major version and projects to the matching
179
- * adapter's `Form` / `Out` / `Read` slots. The dispatch matches the
180
- * full `SupportedRootSchema` per major, so an object, record, or
181
- * discriminated-union root all resolve here exactly as the runtime
182
- * `useForm` overloads accept them.
183
- *
184
- * Replaces `ReturnType<typeof useForm<Schema, K>>` in test code with
185
- * concrete schemas. For generic helpers (`<S extends z.ZodObject>`),
186
- * use `UseFormReturnV4<S>` directly — TS doesn't simplify
187
- * conditional types under generic constraints, so the dispatch in
188
- * this helper stays deferred and TS can't prove return-type
189
- * compatibility.
190
- */
191
- type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema & ZodV4Internals ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends SupportedRootSchema$1 ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
192
- /**
193
- * The configuration parameter shape of `useForm` for a given Zod
194
- * schema. Mirrors `UseFormReturn`'s dispatch — replaces
195
- * `Parameters<typeof useForm<Schema, K>>[0]` in test code.
196
- */
197
- type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema & ZodV4Internals ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
198
- schema: Schema;
199
- } & ValidateOnConfig : Schema extends SupportedRootSchema$1 ? Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
200
- schema: Schema;
201
- } & ValidateOnConfig : never;
202
-
203
- /**
204
- * Field-metadata write/read API for the unified `attaform/zod` entry.
205
- *
206
- * Storage is shared with both adapters via `field-meta-store` — a
207
- * payload written here is visible to whichever adapter the unified
208
- * `useForm` dispatches to at runtime, regardless of Zod major. No
209
- * `zod` runtime import; the type-only `import type` is erased at
210
- * build, so `attaform/zod` carries no `z.registry` reference even
211
- * when consumed by a Zod 3 project without the Vite plugin alias.
212
- *
213
- * The native v4 chain `schema.register(fieldMeta, payload)` continues
214
- * to work — Zod 4's `.register()` only calls `.add(this, payload)`
215
- * structurally, satisfied by the shared store.
216
- */
217
-
218
- type ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>;
219
- /**
220
- * The shared registry every Attaform-aware Zod schema can register
221
- * field metadata against, regardless of major. Same instance the v3
222
- * and v4 adapter entries expose — write in one place, read from
223
- * any.
224
- *
225
- * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native
226
- * `schema.register(fieldMeta, payload)` chain type-checks for v4
227
- * users; the runtime call only needs `.add` structurally, which the
228
- * shared store provides.
229
- */
230
- declare const fieldMeta: ZodFieldMetaRegistry;
231
- /**
232
- * Attach `payload` to `schema` in the shared registry and return a
233
- * clone of `schema` so each call gets its own identity (the registry
234
- * keys on schema reference, so cloning prevents last-write-wins
235
- * collisions for sub-schemas reused at multiple paths).
236
- *
237
- * Works on both Zod 3 and Zod 4 schemas — branches on the runtime
238
- * shape of the schema:
239
- * - Zod 4 schemas expose a public `.clone()` method; we call it.
240
- * - Zod 3 schemas don't, so we reconstruct via
241
- * `new schema.constructor(schema._def)`.
242
- *
243
- * Both forms produce a fresh schema with the same effective
244
- * structure, so the registry slot is unique to this call site.
245
- */
246
- declare function withMeta<S>(schema: S, payload: FieldMetaPayload): S;
247
-
248
- export { FieldMetaPayload, fieldMeta, useForm, withMeta };
249
- export type { UseFormConfig, UseFormConfigV3, UseFormConfigV4, UseFormReturn, UseFormReturnV3, UseFormReturnV4 };
6
+ import './shared/attaform.DRUT703x.mjs';
7
+ import 'zod';
package/dist/zod.d.ts CHANGED
@@ -1,249 +1,7 @@
1
- import { G as GenericForm, F as FormKey, U as UseFormConfiguration, a as AbstractSchema, ar as AcceptableDefaults, af as ValidateOnConfig, b as UseFormReturnType, D as DefaultValuesInput, q as FieldMetaPayload } from './shared/attaform.DBNjHgNj.js';
2
- export { ad as Unset, ao as isUnset, aq as unset } from './shared/attaform.DBNjHgNj.js';
3
- import { S as SupportedRootSchema, b as StorageShape } from './shared/attaform.Be5otUVw.js';
4
- export { P as PathInput, a as PathOutput } from './shared/attaform.Be5otUVw.js';
5
- import { S as SupportedRootSchema$1, U as UnwrapZodRoot, a as StorageShape$1 } from './shared/attaform.DdjDqTah.js';
6
- import { z } from 'zod';
7
- export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, t as injectForm, u as injectWizard, w as lazy, x as useRegister, z as useWizard } from './shared/attaform.ceYeVkjn.js';
1
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEFAULT_TIMINGS, f as DEVTOOLS_WINDOW_KEY, g as DisplayTimings, F as FormStatus, I as InjectWizardInput, h as InvalidPathError, i as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, j as ReservedFormKeyError, S as SerializedAttaformState, k as SerializedFormData, l as StepSlot, m as SubmitErrorHandlerError, U as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as defaultCoercionRules, G as defaultDisplayState, H as defineCoercion, J as escapeForInlineScript, K as getRegistryFromApp, M as hydrateAttaformState, N as injectForm, P as injectWizard, Q as isRegisterValue, T as kAttaformRegistry, V as lazy, X as makeDefaultDisplayState, Y as renderAttaformState, Z as useRegister, _ as useRegistry, $ as useWizard, a0 as vRegister } from './shared/attaform.CEXUlUkc.js';
2
+ export { b as ArrayItem, c as ArrayPath, d as AttaformDefaults, C as CoercionEntry, e as CoercionRegistry, f as CoercionResult, g as CustomDirectiveRegisterAssignerFn, h as DeepPartial, D as DefaultValuesInput, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, o as FieldMetaPayload, p as FieldState, q as FieldStateMap, r as FieldStateMapEntry, s as FlatPath, t as FormErrorRecord, u as FormErrorsSurface, F as FormKey, v as FormMeta, G as GenericForm, w as GetDisplayState, H as HandleSubmit, x as HistoryConfig, I as IsTuple, y as IsUnion, J as JoinSegments, z as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, B as NestedType, O as OnError, P as OnInvalidSubmitPolicy, Q as OnSubmit, R as PartialFlatPath, S as Path, T as PathKey, V as PendingValidationStatus, W as Primitive, X as ROOT_PATH, Y as ROOT_PATH_KEY, Z as ReactiveValidationStatus, _ as RegisterDirective, $ as RegisterFlatPath, a0 as RegisterOptions, a1 as RegisterSelectModifier, a2 as RegisterTextModifier, a3 as RegisterTransform, a4 as RegisterValue, a5 as Segment, a6 as SetValueCallback, a7 as SetValuePayload, a8 as SettledValidationStatus, a9 as SlimPrimitiveKind, aa as SlimRuntimeOf, ab as SubmitHandler, ac as Unset, U as UseFormConfiguration, a as UseFormReturnType, ad as ValidateOn, ae as ValidateOnConfig, af as ValidationError, ag as ValidationResponse, ah as ValidationResponseWithoutValue, ai as ValueOfUnion, aj as WriteMeta, ak as WriteShape, al as canonicalizePath, am as isPathPrefix, an as isUnset, ao as parseDottedPath, ap as unset } from './shared/attaform.C3WnCDXz.js';
3
+ export { UseFormConfig, UseFormConfigV3, UseFormConfigV4, UseFormReturn, UseFormReturnV3, UseFormReturnV4, fieldMeta, useForm, withMeta } from './index.js';
4
+ export { P as PathInput, a as PathOutput } from './shared/attaform.CC_y1_Ej.js';
8
5
  import 'vue';
9
-
10
- /**
11
- * Type-level Zod-major discriminator for the unified `attaform/zod`
12
- * entry. The runtime dispatch (`use-form.ts`'s impl) already routes on
13
- * the schema's shape via `isZodV4SchemaShape`; this is the type-level
14
- * mirror so the overloads and projection helpers discriminate the same
15
- * way.
16
- *
17
- * Why a structural marker instead of `z.ZodObject`: the unified entry's
18
- * overloads constrain on `z.ZodObject`, but the published `.d.mts`
19
- * resolves `z` against whichever single Zod major the consumer
20
- * installed. In a v3-only install `z.ZodObject` is v3's `ZodObject`
21
- * (and, lacking its required type arguments, degrades to an `any`-like
22
- * error type under `skipLibCheck`), so a v3 schema satisfies the v4
23
- * overload's constraint and binds it — collapsing the read slot to
24
- * `never`. A Zod v4 schema carries the `_zod` internals brand; a v3
25
- * schema never does.
26
- * Intersecting a v4-only constraint or conditional branch with this
27
- * marker keeps it unreachable for a v3 schema regardless of how `zod`
28
- * resolves, so v3 schemas fall through to the v3 overload.
29
- *
30
- * Distinct from `core/zod-shape.ts`'s runtime `ZodV4Shape` (which reads
31
- * the public `def` getter): at the type level the stable v4 brand is
32
- * `_zod.def`, the same internals `StorageShape` (v4) already reads.
33
- *
34
- * Pairing requirement: a v4 overload/branch must constrain on
35
- * `z.ZodObject<z.ZodRawShape> & ZodV4Internals`, NOT bare
36
- * `z.ZodObject & ZodV4Internals`. In a v3-only install `z.ZodObject`
37
- * with no type argument is `ZodObject<T, ...>` missing its required
38
- * arguments — an error type that behaves like `any` under
39
- * `skipLibCheck`, so `any & ZodV4Internals` collapses back to `any` and
40
- * the marker stops excluding v3 schemas. Supplying `z.ZodRawShape`
41
- * keeps it a concrete object type in both majors, so the intersection
42
- * stays meaningful.
43
- */
44
- type ZodV4Internals = {
45
- _zod: {
46
- def: unknown;
47
- };
48
- };
49
-
50
- /**
51
- * Per-major projection helpers shared by the unified `attaform/zod`
52
- * entry. Each maps an arbitrary Zod v4 OR v3 object schema to the
53
- * `GenericForm`-shaped input / output / storage-read projections the
54
- * form types are parameterised over. The constraint on each alias scopes
55
- * `S` to one Zod major, so the projection is a direct read with no
56
- * dispatch in the type body.
57
- *
58
- * Hoisted out of `types-unified.ts` and `use-form.ts` so the two entry
59
- * points share one definition. Internal — consumer code never reaches
60
- * for these; the overloaded `useForm` already gives full inference at
61
- * call sites.
62
- */
63
-
64
- /**
65
- * The schema's own input type, exactly as a consumer would reference it
66
- * (`z.input<S>`) — NOT routed through `GenericForm` / `UnwrapZodRoot`. This
67
- * is the reflexive escape arm `AcceptableDefaults` adds to the
68
- * `defaultValues` slot so a generic form wrapper forwarding `z.input<S>`
69
- * type-checks under a free `S` (#422). It must stay syntactically identical
70
- * to what the wrapper forwards: wrapping it in a conditional makes it a
71
- * deferred conditional that no longer matches the forwarded value under a
72
- * generic. Wrong-major schemas can't actually bind the slot — they are
73
- * rejected at the overload's `schema` constraint — so the raw input never
74
- * widens the slot for the wrong major.
75
- */
76
- type V4SchemaInput<S extends SupportedRootSchema> = z.input<S>;
77
- type V3SchemaInput<S extends SupportedRootSchema$1> = z.input<S>;
78
- type V4FormOf<S extends SupportedRootSchema> = z.input<S> extends GenericForm ? z.input<S> : never;
79
- type V4OutOf<S extends SupportedRootSchema> = z.output<S> extends GenericForm ? z.output<S> : never;
80
- type V4ReadOf<S extends SupportedRootSchema> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
81
- type V3FormOf<S extends SupportedRootSchema$1> = z.input<UnwrapZodRoot<S>> extends GenericForm ? z.input<UnwrapZodRoot<S>> : never;
82
- type V3OutOf<S extends SupportedRootSchema$1> = z.output<UnwrapZodRoot<S>> extends GenericForm ? z.output<UnwrapZodRoot<S>> : never;
83
- type V3ReadOf<S extends SupportedRootSchema$1> = StorageShape$1<UnwrapZodRoot<S>> extends GenericForm ? StorageShape$1<UnwrapZodRoot<S>> : never;
84
-
85
- /**
86
- * Create a form bound to a Zod v4 schema.
87
- *
88
- * ```ts
89
- * import { useForm } from 'attaform/zod'
90
- * import { z } from 'zod'
91
- *
92
- * const form = useForm({
93
- * schema: z.object({
94
- * username: z.string().min(2, 'At least 2 characters'),
95
- * password: z.string().min(8, 'At least 8 characters'),
96
- * }),
97
- * })
98
- * ```
99
- *
100
- * The constraint intersects `ZodV4Internals` (the v4-only `_zod`
101
- * brand) so a v3 schema can't bind this overload even when `z`
102
- * resolves to v3 in a single-major consumer install; v3 schemas fall
103
- * through to the v3 overload below. See `types-zod-major.ts`.
104
- */
105
- declare function useForm<Schema extends SupportedRootSchema & ZodV4Internals, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, never, K>, 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'> & {
106
- schema: Schema;
107
- defaultValues?: AcceptableDefaults<V4FormOf<Schema>, V4SchemaInput<Schema>>;
108
- } & ValidateOnConfig): UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
109
- /**
110
- * Create a form bound to a Zod v3 schema.
111
- *
112
- * ```ts
113
- * import { useForm } from 'attaform/zod'
114
- * import { z } from 'zod-v3'
115
- *
116
- * const form = useForm({
117
- * schema: z.object({
118
- * username: z.string().min(2, 'At least 2 characters'),
119
- * password: z.string().min(8, 'At least 8 characters'),
120
- * }),
121
- * })
122
- * ```
123
- *
124
- * v3 schemas match this overload; v4 schemas hit the v4 overload
125
- * above first and never reach here.
126
- */
127
- declare function useForm<Schema extends SupportedRootSchema$1, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, never, K>, 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'> & {
128
- schema: Schema;
129
- defaultValues?: AcceptableDefaults<V3FormOf<Schema>, V3SchemaInput<Schema>>;
130
- } & ValidateOnConfig): UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>;
131
-
132
- /**
133
- * Type-level helpers for the unified `attaform/zod` entry. These give
134
- * tests and other type-query call sites a deterministic projection
135
- * over an arbitrary v4 OR v3 schema, sidestepping the brittle
136
- * instantiation-expression resolution rules TypeScript applies to
137
- * overloaded functions (`typeof useForm<X>` can pick the wrong
138
- * overload or the impl signature, depending on whether the type
139
- * argument is a concrete schema, a generic, or a constraint).
140
- *
141
- * The helpers dispatch ONCE per use site via a binary conditional —
142
- * no stacking, no amplification across the return type. Equivalent
143
- * to writing `ReturnType<typeof useForm<S>>` but cache-stable across
144
- * call patterns.
145
- *
146
- * Per `inference-first DX`, these helpers are test- and
147
- * internal-facing. Consumer code shouldn't reach for them — the
148
- * overloaded `useForm` already gives full inference at call sites.
149
- */
150
-
151
- /**
152
- * Direct V4 projection — no major-dispatch. Use when the schema's
153
- * Zod major is known statically (typical for V4 generic helpers like
154
- * `function setup<S extends z.ZodObject>(s: S)`). TS simplifies the
155
- * helper cleanly under generic constraints because no conditional
156
- * is present.
157
- */
158
- type UseFormReturnV4<Schema extends z.ZodObject, K extends FormKey = FormKey> = UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
159
- /**
160
- * Direct V4 configuration projection. Mirrors `UseFormReturnV4`.
161
- */
162
- type UseFormConfigV4<Schema extends z.ZodObject, K extends FormKey = FormKey> = Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
163
- schema: Schema;
164
- } & ValidateOnConfig;
165
- /**
166
- * Direct V3 projection — no major-dispatch. Use when the schema's
167
- * Zod major is known statically.
168
- */
169
- type UseFormReturnV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey> = UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>;
170
- /**
171
- * Direct V3 configuration projection. Mirrors `UseFormReturnV3`.
172
- */
173
- type UseFormConfigV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey> = Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
174
- schema: Schema;
175
- } & ValidateOnConfig;
176
- /**
177
- * The return shape of `useForm` for a given Zod schema. Dispatches
178
- * once on the schema's major version and projects to the matching
179
- * adapter's `Form` / `Out` / `Read` slots. The dispatch matches the
180
- * full `SupportedRootSchema` per major, so an object, record, or
181
- * discriminated-union root all resolve here exactly as the runtime
182
- * `useForm` overloads accept them.
183
- *
184
- * Replaces `ReturnType<typeof useForm<Schema, K>>` in test code with
185
- * concrete schemas. For generic helpers (`<S extends z.ZodObject>`),
186
- * use `UseFormReturnV4<S>` directly — TS doesn't simplify
187
- * conditional types under generic constraints, so the dispatch in
188
- * this helper stays deferred and TS can't prove return-type
189
- * compatibility.
190
- */
191
- type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema & ZodV4Internals ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends SupportedRootSchema$1 ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
192
- /**
193
- * The configuration parameter shape of `useForm` for a given Zod
194
- * schema. Mirrors `UseFormReturn`'s dispatch — replaces
195
- * `Parameters<typeof useForm<Schema, K>>[0]` in test code.
196
- */
197
- type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema & ZodV4Internals ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
198
- schema: Schema;
199
- } & ValidateOnConfig : Schema extends SupportedRootSchema$1 ? Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
200
- schema: Schema;
201
- } & ValidateOnConfig : never;
202
-
203
- /**
204
- * Field-metadata write/read API for the unified `attaform/zod` entry.
205
- *
206
- * Storage is shared with both adapters via `field-meta-store` — a
207
- * payload written here is visible to whichever adapter the unified
208
- * `useForm` dispatches to at runtime, regardless of Zod major. No
209
- * `zod` runtime import; the type-only `import type` is erased at
210
- * build, so `attaform/zod` carries no `z.registry` reference even
211
- * when consumed by a Zod 3 project without the Vite plugin alias.
212
- *
213
- * The native v4 chain `schema.register(fieldMeta, payload)` continues
214
- * to work — Zod 4's `.register()` only calls `.add(this, payload)`
215
- * structurally, satisfied by the shared store.
216
- */
217
-
218
- type ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>;
219
- /**
220
- * The shared registry every Attaform-aware Zod schema can register
221
- * field metadata against, regardless of major. Same instance the v3
222
- * and v4 adapter entries expose — write in one place, read from
223
- * any.
224
- *
225
- * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native
226
- * `schema.register(fieldMeta, payload)` chain type-checks for v4
227
- * users; the runtime call only needs `.add` structurally, which the
228
- * shared store provides.
229
- */
230
- declare const fieldMeta: ZodFieldMetaRegistry;
231
- /**
232
- * Attach `payload` to `schema` in the shared registry and return a
233
- * clone of `schema` so each call gets its own identity (the registry
234
- * keys on schema reference, so cloning prevents last-write-wins
235
- * collisions for sub-schemas reused at multiple paths).
236
- *
237
- * Works on both Zod 3 and Zod 4 schemas — branches on the runtime
238
- * shape of the schema:
239
- * - Zod 4 schemas expose a public `.clone()` method; we call it.
240
- * - Zod 3 schemas don't, so we reconstruct via
241
- * `new schema.constructor(schema._def)`.
242
- *
243
- * Both forms produce a fresh schema with the same effective
244
- * structure, so the registry slot is unique to this call site.
245
- */
246
- declare function withMeta<S>(schema: S, payload: FieldMetaPayload): S;
247
-
248
- export { FieldMetaPayload, fieldMeta, useForm, withMeta };
249
- export type { UseFormConfig, UseFormConfigV3, UseFormConfigV4, UseFormReturn, UseFormReturnV3, UseFormReturnV4 };
6
+ import './shared/attaform.DRUT703x.js';
7
+ import 'zod';
package/dist/zod.mjs CHANGED
@@ -1,43 +1,5 @@
1
- import { a as InvalidUseFormConfigError } from './shared/attaform.DGhIix5D.mjs';
2
- import { u as useForm$2 } from './shared/attaform.CSXDW2tO.mjs';
3
- import { u as useForm$1 } from './shared/attaform.DSOIz08n.mjs';
4
- import { f as fieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.CXVmZtFq.mjs';
5
- export { A as AttaformErrorCode, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, c as useRegister, d as useWizard } from './shared/attaform.BoYqnIPI.mjs';
6
-
7
- function isZodV4SchemaShape(value) {
8
- if (typeof value !== "object" || value === null) return false;
9
- const def = value.def;
10
- if (typeof def !== "object" || def === null) return false;
11
- return typeof def.type === "string";
12
- }
13
-
14
- function useForm(configuration) {
15
- if (configuration === void 0 || configuration === null || configuration.schema === void 0) {
16
- throw new InvalidUseFormConfigError();
17
- }
18
- const { schema } = configuration;
19
- if (isZodV4SchemaShape(schema)) {
20
- return useForm$1(configuration);
21
- }
22
- return useForm$2(configuration);
23
- }
24
-
25
- const fieldMeta = fieldMetaStore;
26
- function withMeta(schema, payload) {
27
- const target = schema;
28
- const existing = getFieldMetaForSchema(target) ?? {};
29
- const cloned = cloneSchema(schema);
30
- fieldMetaStore.add(cloned, { ...existing, ...payload });
31
- return cloned;
32
- }
33
- function cloneSchema(schema) {
34
- const candidate = schema;
35
- if (typeof candidate.clone === "function") {
36
- return candidate.clone();
37
- }
38
- const Ctor = candidate.constructor;
39
- return new Ctor(candidate._def);
40
- }
41
-
42
- export { fieldMeta, useForm, withMeta };
1
+ export { A as AttaformError, D as DEVTOOLS_WINDOW_KEY, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as assignKey, f as canonicalizePath, g as createAttaform, h as createRegistry, i as getRegistryFromApp, j as hydrateAttaformState, k as isPathPrefix, l as kAttaformRegistry, p as parseDottedPath, r as renderAttaformState, u as useRegistry, v as vRegister } from './shared/attaform.Da8EdI2t.mjs';
2
+ export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useRegister, j as useWizard } from './shared/attaform.CyQxTOdX.mjs';
3
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.DkD0DR7R.mjs';
4
+ export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
43
5
  //# sourceMappingURL=zod.mjs.map
package/dist/zod.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"zod.mjs","sources":["../src/runtime/core/zod-shape.ts","../src/runtime/adapters/unified/use-form.ts","../src/runtime/adapters/unified/field-meta.ts"],"sourcesContent":["/**\n * Shape detectors for Zod schemas. Used by the unified `attaform/zod`\n * entry's runtime dispatch (`runtime/adapters/unified/use-form.ts`)\n * to route to the v3 or v4 adapter based on the schema's runtime\n * shape. Mirrors the discrimination already used by the v4\n * introspection helper (`adapters/zod-v4/introspect.ts`'s\n * `assertZodVersion`, which reads `def.type`) and the v3 wrapper's\n * legitimate-input branch (`composables/use-form.ts`'s `isZodType`,\n * which reads `_def`).\n *\n * Why this discriminator and not `_zod` / `_def`:\n * - Zod v4 retained `_def` for backward compat — reading `_def` alone\n * misclassifies v4 schemas as v3.\n * - Zod v4's stable shape is `def.type: string` (lowercase tag like\n * `'object'`); Zod v3's is `_def.typeName: string` (capitalised tag\n * like `'ZodObject'`). Both are checked structurally so consumers\n * who alias one Zod major to a non-standard import path still work.\n */\n\ninterface ZodV4Shape {\n def: { type: unknown }\n}\n\ninterface ZodV3Shape {\n _def: { typeName: unknown }\n}\n\n/**\n * Returns true when `value` looks like a Zod schema of either major\n * version. Convenience wrapper around the v3 / v4 detectors.\n */\nexport function isZodSchemaShape(value: unknown): boolean {\n return isZodV4SchemaShape(value) || isZodV3SchemaShape(value)\n}\n\n/**\n * Returns true when `value` looks like a Zod v4 schema (has\n * `def.type: string`). Used by the unified entry's runtime-dispatch\n * to route to the v4 adapter.\n */\nexport function isZodV4SchemaShape(value: unknown): value is ZodV4Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { def?: unknown }).def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { type?: unknown }).type === 'string'\n}\n\n/**\n * Returns true when `value` looks like a Zod v3 schema (has\n * `_def.typeName: string`). Kept distinct from `isZodV4SchemaShape`\n * because some v4 schemas also expose `_def` for backward compat —\n * the v4 detector wins first in `isZodSchemaShape`.\n */\nexport function isZodV3SchemaShape(value: unknown): value is ZodV3Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { _def?: unknown })._def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { typeName?: unknown }).typeName === 'string'\n}\n","/**\n * Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches\n * on schema shape: a Zod v4 schema (`def.type` truthy) routes to the\n * v4 adapter; a Zod v3 schema (or any other `AbstractSchema`) routes\n * to the v3 wrapper, which already accepts both Zod v3 input and\n * `AbstractSchema` directly via its built-in shape branch.\n *\n * Type-level dispatch happens via TWO typed overloads — v4 first, v3\n * second — plus an untyped impl. Each overload mirrors the matching\n * direct adapter's signature exactly, so a v4-schema call site pays\n * the same per-call depth cost as importing from `attaform/zod-v4`\n * directly. Overload resolution at concrete call sites commits to one\n * overload immediately on argument shape — no type-level dispatch tax.\n *\n * Tests and other call sites that need the equivalent of\n * `typeof useForm<X>` should reach for the `UseFormReturn<X>` /\n * `UseFormConfig<X>` helpers in `types-api.ts` — instantiation\n * expressions on overloaded functions follow brittle resolution rules,\n * and the helper types give a deterministic projection.\n *\n * This module is the FALLBACK path. Vite consumers see the\n * `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`\n * imports to either `attaform/zod-v3` or `attaform/zod-v4` at build\n * time — in that case this dispatch never runs and the consumer\n * bundle ships only the matching adapter. Other bundlers (and\n * non-bundled ESM consumption) hit this dispatch instead, paying a\n * modest size cost for the convenience of a single hello-world import.\n *\n * Power users who want a guaranteed lean bundle on non-Vite tooling\n * can import directly from `attaform/zod-v3` or `attaform/zod-v4` —\n * those subpaths are never rewritten and never load the other\n * adapter.\n */\nimport { InvalidUseFormConfigError } from '../../core/errors'\nimport { isZodV4SchemaShape } from '../../core/zod-shape'\nimport type { ZodV4Internals } from './types-zod-major'\nimport { useForm as useFormV3 } from '../../composables/use-form'\nimport { useForm as useFormV4 } from '../zod-v4'\nimport type {\n AbstractSchema,\n FormKey,\n ValidateOnConfig,\n UseFormReturnType,\n UseFormConfiguration,\n} from '../../types/types-api'\nimport type { AcceptableDefaults } from '../../types/types-core'\nimport type { SupportedRootSchema as SupportedRootSchemaV4 } from '../zod-v4/types-root'\nimport type { SupportedRootSchema as SupportedRootSchemaV3 } from '../zod-v3/types-root'\nimport type {\n V3FormOf,\n V3OutOf,\n V3ReadOf,\n V3SchemaInput,\n V4FormOf,\n V4OutOf,\n V4ReadOf,\n V4SchemaInput,\n} from './types-projections'\n\n/**\n * Create a form bound to a Zod v4 schema.\n *\n * ```ts\n * import { useForm } from 'attaform/zod'\n * import { z } from 'zod'\n *\n * const form = useForm({\n * schema: z.object({\n * username: z.string().min(2, 'At least 2 characters'),\n * password: z.string().min(8, 'At least 8 characters'),\n * }),\n * })\n * ```\n *\n * The constraint intersects `ZodV4Internals` (the v4-only `_zod`\n * brand) so a v3 schema can't bind this overload even when `z`\n * resolves to v3 in a single-major consumer install; v3 schemas fall\n * through to the v3 overload below. See `types-zod-major.ts`.\n */\nexport function useForm<\n Schema extends SupportedRootSchemaV4 & ZodV4Internals,\n K extends FormKey = FormKey,\n>(\n configuration: Omit<\n UseFormConfiguration<\n V4FormOf<Schema>,\n V4OutOf<Schema>,\n AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>,\n // `defaultValues` is Omitted below and re-supplied via the\n // `AcceptableDefaults` intersection, so this `DefaultValues` slot is\n // inert. `never` keeps it from re-instantiating the deep\n // `DefaultValuesInput` cascade here — that redundant instantiation,\n // across both overloads at a concrete call site, tips the bundled\n // `.d.ts` into TS2589.\n never,\n K\n >,\n 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'\n > & {\n schema: Schema\n // #422: the `AcceptableDefaults` slot adds the schema's own input\n // (`V4SchemaInput<Schema>`) as a reflexive escape arm so a generic form\n // wrapper forwarding `defaultValues` does not trip TS2589 / TS2769.\n // The arm is redundant at concrete call sites (a schema's input is a\n // subset of its `DefaultValuesInput`), so concrete checking is\n // unchanged. The return type never references the slot, so field\n // inference is preserved through the wrapper. See `AcceptableDefaults`.\n defaultValues?: AcceptableDefaults<V4FormOf<Schema>, V4SchemaInput<Schema>>\n } & ValidateOnConfig\n): UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>\n/**\n * Create a form bound to a Zod v3 schema.\n *\n * ```ts\n * import { useForm } from 'attaform/zod'\n * import { z } from 'zod-v3'\n *\n * const form = useForm({\n * schema: z.object({\n * username: z.string().min(2, 'At least 2 characters'),\n * password: z.string().min(8, 'At least 8 characters'),\n * }),\n * })\n * ```\n *\n * v3 schemas match this overload; v4 schemas hit the v4 overload\n * above first and never reach here.\n */\nexport function useForm<Schema extends SupportedRootSchemaV3, K extends FormKey = FormKey>(\n configuration: Omit<\n UseFormConfiguration<\n V3FormOf<Schema>,\n V3OutOf<Schema>,\n AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>,\n // Inert `DefaultValues` slot — see the v4 overload above.\n never,\n K\n >,\n 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'\n > & {\n schema: Schema\n // #422 — see the v4 overload above for the escape-arm rationale.\n defaultValues?: AcceptableDefaults<V3FormOf<Schema>, V3SchemaInput<Schema>>\n } & ValidateOnConfig\n): UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useForm(configuration: any): any {\n if (\n configuration === undefined ||\n configuration === null ||\n (configuration as { schema?: unknown }).schema === undefined\n ) {\n throw new InvalidUseFormConfigError()\n }\n const { schema } = configuration as { schema: unknown }\n if (isZodV4SchemaShape(schema)) {\n return useFormV4(configuration as Parameters<typeof useFormV4>[0])\n }\n return useFormV3(configuration as Parameters<typeof useFormV3>[0])\n}\n","/**\n * Field-metadata write/read API for the unified `attaform/zod` entry.\n *\n * Storage is shared with both adapters via `field-meta-store` — a\n * payload written here is visible to whichever adapter the unified\n * `useForm` dispatches to at runtime, regardless of Zod major. No\n * `zod` runtime import; the type-only `import type` is erased at\n * build, so `attaform/zod` carries no `z.registry` reference even\n * when consumed by a Zod 3 project without the Vite plugin alias.\n *\n * The native v4 chain `schema.register(fieldMeta, payload)` continues\n * to work — Zod 4's `.register()` only calls `.add(this, payload)`\n * structurally, satisfied by the shared store.\n */\nimport type { z } from 'zod'\nimport type { FieldMetaPayload } from '../../core/field-meta'\nimport { fieldMetaStore, getFieldMetaForSchema } from '../../core/field-meta-store'\n\n// Zod v4's `$ZodRegistry` class isn't surfaced under the `z` namespace\n// of the classic external entry, but `z.registry()` returns one — so\n// `ReturnType<typeof z.registry<T>>` resolves to the registry type\n// without needing a direct import. The `import type` keeps the\n// reference type-only; nothing about `z.registry` lands in the bundle.\ntype ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>\n\n/**\n * The shared registry every Attaform-aware Zod schema can register\n * field metadata against, regardless of major. Same instance the v3\n * and v4 adapter entries expose — write in one place, read from\n * any.\n *\n * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native\n * `schema.register(fieldMeta, payload)` chain type-checks for v4\n * users; the runtime call only needs `.add` structurally, which the\n * shared store provides.\n */\nexport const fieldMeta = fieldMetaStore as unknown as ZodFieldMetaRegistry\n\n/**\n * Attach `payload` to `schema` in the shared registry and return a\n * clone of `schema` so each call gets its own identity (the registry\n * keys on schema reference, so cloning prevents last-write-wins\n * collisions for sub-schemas reused at multiple paths).\n *\n * Works on both Zod 3 and Zod 4 schemas — branches on the runtime\n * shape of the schema:\n * - Zod 4 schemas expose a public `.clone()` method; we call it.\n * - Zod 3 schemas don't, so we reconstruct via\n * `new schema.constructor(schema._def)`.\n *\n * Both forms produce a fresh schema with the same effective\n * structure, so the registry slot is unique to this call site.\n */\nexport function withMeta<S>(schema: S, payload: FieldMetaPayload): S {\n const target = schema as object\n const existing = getFieldMetaForSchema(target) ?? {}\n const cloned = cloneSchema(schema)\n fieldMetaStore.add(cloned as object, { ...existing, ...payload })\n return cloned\n}\n\nfunction cloneSchema<S>(schema: S): S {\n const candidate = schema as { clone?: unknown; constructor: unknown; _def: unknown }\n if (typeof candidate.clone === 'function') {\n return (candidate.clone as () => S)()\n }\n // Zod 3 path: reconstruct via constructor + _def (no public\n // `.clone()` on v3).\n const Ctor = candidate.constructor as new (def: unknown) => S\n return new Ctor(candidate._def)\n}\n"],"names":["useFormV4","useFormV3"],"mappings":";;;;;;AAwCO,SAAS,mBAAmB,KAAA,EAAqC;AACtE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AACxD,EAAA,MAAM,MAAO,KAAA,CAA4B,GAAA;AACzC,EAAA,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,GAAA,KAAQ,MAAM,OAAO,KAAA;AACpD,EAAA,OAAO,OAAQ,IAA2B,IAAA,KAAS,QAAA;AACrD;;ACqGO,SAAS,QAAQ,aAAA,EAAyB;AAC/C,EAAA,IACE,kBAAkB,MAAA,IAClB,aAAA,KAAkB,IAAA,IACjB,aAAA,CAAuC,WAAW,MAAA,EACnD;AACA,IAAA,MAAM,IAAI,yBAAA,EAA0B;AAAA,EACtC;AACA,EAAA,MAAM,EAAE,QAAO,GAAI,aAAA;AACnB,EAAA,IAAI,kBAAA,CAAmB,MAAM,CAAA,EAAG;AAC9B,IAAA,OAAOA,UAAU,aAAgD,CAAA;AAAA,EACnE;AACA,EAAA,OAAOC,UAAU,aAAgD,CAAA;AACnE;;AC3HO,MAAM,SAAA,GAAY;AAiBlB,SAAS,QAAA,CAAY,QAAW,OAAA,EAA8B;AACnE,EAAA,MAAM,MAAA,GAAS,MAAA;AACf,EAAA,MAAM,QAAA,GAAW,qBAAA,CAAsB,MAAM,CAAA,IAAK,EAAC;AACnD,EAAA,MAAM,MAAA,GAAS,YAAY,MAAM,CAAA;AACjC,EAAA,cAAA,CAAe,IAAI,MAAA,EAAkB,EAAE,GAAG,QAAA,EAAU,GAAG,SAAS,CAAA;AAChE,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,YAAe,MAAA,EAAc;AACpC,EAAA,MAAM,SAAA,GAAY,MAAA;AAClB,EAAA,IAAI,OAAO,SAAA,CAAU,KAAA,KAAU,UAAA,EAAY;AACzC,IAAA,OAAQ,UAAU,KAAA,EAAkB;AAAA,EACtC;AAGA,EAAA,MAAM,OAAO,SAAA,CAAU,WAAA;AACvB,EAAA,OAAO,IAAI,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAChC;;;;"}
1
+ {"version":3,"file":"zod.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "name": "attaform",
3
- "version": "0.26.0",
3
+ "version": "0.27.1",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "files": [
7
- "dist"
7
+ "dist",
8
+ "skills",
9
+ "bin"
8
10
  ],
11
+ "bin": {
12
+ "attaform": "./bin/attaform.mjs"
13
+ },
9
14
  "sideEffects": false,
10
15
  "engines": {
11
16
  "node": ">=22.0.0"
@@ -75,6 +80,10 @@
75
80
  "types": "./dist/zod-v4.d.mts",
76
81
  "import": "./dist/zod-v4.mjs"
77
82
  },
83
+ "./abstract": {
84
+ "types": "./dist/abstract.d.mts",
85
+ "import": "./dist/abstract.mjs"
86
+ },
78
87
  "./types": {
79
88
  "types": "./dist/index.d.mts"
80
89
  }
@@ -203,6 +212,7 @@
203
212
  "check:coverage": "node scripts/run-with-webstorage-flag.mjs vitest run --coverage",
204
213
  "check:bench": "node scripts/check-bench.mjs",
205
214
  "check:bundled-types": "node scripts/check-bundled-types.mjs",
215
+ "check:doc-snippets": "node scripts/check-doc-snippets.mjs",
206
216
  "check:site": "pnpm dev:prepare && pnpm --filter attaform-site typecheck",
207
217
  "fallow": "DO_NOT_TRACK=1 FALLOW_TELEMETRY=0 npx --yes fallow@2.88.3 --score",
208
218
  "version": "node scripts/promote-changelog.mjs && (node scripts/generate-release-notes.mjs || echo '[version] release-notes step failed; continuing') && node scripts/sync-doc-versions.mjs && git add CHANGELOG.md RELEASES.md docs/scorecard/cii-best-practices-answers.md"