attaform 0.21.0 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/dev-key-collision-warnings.cjs +1 -1
- package/dist/chunks/dev-key-collision-warnings.mjs +1 -1
- package/dist/chunks/devtools.cjs +1 -1
- package/dist/chunks/devtools.mjs +1 -1
- package/dist/chunks/fingerprint2.cjs +1 -1
- package/dist/chunks/fingerprint2.mjs +1 -1
- package/dist/chunks/indexeddb.cjs +1 -1
- package/dist/chunks/indexeddb.mjs +1 -1
- package/dist/chunks/local-storage.cjs +1 -1
- package/dist/chunks/local-storage.mjs +1 -1
- package/dist/chunks/multi-tab-sync.cjs +2 -2
- package/dist/chunks/multi-tab-sync.mjs +2 -2
- package/dist/chunks/session-storage.cjs +1 -1
- package/dist/chunks/session-storage.mjs +1 -1
- package/dist/chunks/wire-persistence.cjs +2 -2
- package/dist/chunks/wire-persistence.mjs +2 -2
- package/dist/index.cjs +37 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -28
- package/dist/index.d.mts +31 -28
- package/dist/index.d.ts +31 -28
- package/dist/index.mjs +38 -25
- package/dist/index.mjs.map +1 -1
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.mts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/runtime/components/AttaformDevtoolsPanel.vue +396 -216
- package/dist/runtime/components/DevtoolsValueTree.vue +176 -114
- package/dist/runtime/plugins/attaform.cjs +2 -2
- package/dist/runtime/plugins/attaform.mjs +2 -2
- package/dist/shared/{attaform.BA3vRDos.cjs → attaform.B5LNzqQh.cjs} +349 -277
- package/dist/shared/attaform.B5LNzqQh.cjs.map +1 -0
- package/dist/shared/{attaform.PnqML3xW.cjs → attaform.BBDIKtKY.cjs} +13 -16
- package/dist/shared/attaform.BBDIKtKY.cjs.map +1 -0
- package/dist/shared/{attaform.CRsXyy-Y.d.ts → attaform.BCcrLApm.d.mts} +131 -64
- package/dist/shared/{attaform.BupwXkj_.mjs → attaform.BFWb6hDk.mjs} +29 -23
- package/dist/shared/attaform.BFWb6hDk.mjs.map +1 -0
- package/dist/shared/{attaform.7lzO9pdM.d.mts → attaform.BGf_J22U.d.ts} +131 -64
- package/dist/shared/{attaform.BnK_bfcb.mjs → attaform.BVeLgfEh.mjs} +14 -17
- package/dist/shared/attaform.BVeLgfEh.mjs.map +1 -0
- package/dist/shared/{attaform.BK1RE2ha.d.ts → attaform.BYgioWLF.d.ts} +2 -2
- package/dist/shared/{attaform.F8LMHHWV.d.cts → attaform.BkjJfMvJ.d.cts} +131 -64
- package/dist/shared/{attaform.BDIEq9qP.d.cts → attaform.BoY6RZUl.d.cts} +2 -2
- package/dist/shared/{attaform.CEf6wYfD.cjs → attaform.BwLp9KM7.cjs} +2 -2
- package/dist/shared/{attaform.CEf6wYfD.cjs.map → attaform.BwLp9KM7.cjs.map} +1 -1
- package/dist/shared/{attaform._rsCZy2j.cjs → attaform.BwrowMp2.cjs} +25 -45
- package/dist/shared/attaform.BwrowMp2.cjs.map +1 -0
- package/dist/shared/{attaform.ezb5Nh2t.mjs → attaform.C41gjp-a.mjs} +2 -2
- package/dist/shared/{attaform.ezb5Nh2t.mjs.map → attaform.C41gjp-a.mjs.map} +1 -1
- package/dist/shared/{attaform.BM6YD9kZ.cjs → attaform.CR6wGvNu.cjs} +29 -23
- package/dist/shared/attaform.CR6wGvNu.cjs.map +1 -0
- package/dist/shared/{attaform.DSqO6Db7.mjs → attaform.CTheKoTc.mjs} +705 -282
- package/dist/shared/attaform.CTheKoTc.mjs.map +1 -0
- package/dist/shared/{attaform.BzvOdiSI.cjs → attaform.CcnF1AKJ.cjs} +4 -4
- package/dist/shared/attaform.CcnF1AKJ.cjs.map +1 -0
- package/dist/shared/{attaform.BQ6drorq.d.mts → attaform.CnEl--PF.d.mts} +2 -2
- package/dist/shared/{attaform.CkjTapyq.mjs → attaform.CrD73S4m.mjs} +4 -4
- package/dist/shared/attaform.CrD73S4m.mjs.map +1 -0
- package/dist/shared/{attaform.BUszFoKq.cjs → attaform.D2ZuIOCf.cjs} +711 -287
- package/dist/shared/attaform.D2ZuIOCf.cjs.map +1 -0
- package/dist/shared/{attaform.r3PePkDR.mjs → attaform.D6GYGshL.mjs} +25 -45
- package/dist/shared/attaform.D6GYGshL.mjs.map +1 -0
- package/dist/shared/{attaform.Y_Mgg0Yp.mjs → attaform.DP-u7_tk.mjs} +348 -277
- package/dist/shared/attaform.DP-u7_tk.mjs.map +1 -0
- package/dist/shared/{attaform.B1nyO4ec.d.cts → attaform.ory-3WhV.d.cts} +395 -176
- package/dist/shared/{attaform.B1nyO4ec.d.mts → attaform.ory-3WhV.d.mts} +395 -176
- package/dist/shared/{attaform.B1nyO4ec.d.ts → attaform.ory-3WhV.d.ts} +395 -176
- package/dist/transforms.cjs +1 -1
- package/dist/transforms.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/zod-v3.cjs +3 -4
- package/dist/zod-v3.cjs.map +1 -1
- package/dist/zod-v3.d.cts +4 -4
- package/dist/zod-v3.d.mts +4 -4
- package/dist/zod-v3.d.ts +4 -4
- package/dist/zod-v3.mjs +2 -3
- package/dist/zod-v3.mjs.map +1 -1
- package/dist/zod-v4.cjs +3 -4
- package/dist/zod-v4.cjs.map +1 -1
- package/dist/zod-v4.d.cts +4 -4
- package/dist/zod-v4.d.mts +4 -4
- package/dist/zod-v4.d.ts +4 -4
- package/dist/zod-v4.mjs +2 -3
- package/dist/zod-v4.mjs.map +1 -1
- package/dist/zod.cjs +6 -6
- package/dist/zod.cjs.map +1 -1
- package/dist/zod.d.cts +77 -26
- package/dist/zod.d.mts +77 -26
- package/dist/zod.d.ts +77 -26
- package/dist/zod.mjs +5 -6
- package/dist/zod.mjs.map +1 -1
- package/package.json +3 -11
- package/dist/shared/attaform.BA3vRDos.cjs.map +0 -1
- package/dist/shared/attaform.BM6YD9kZ.cjs.map +0 -1
- package/dist/shared/attaform.BUszFoKq.cjs.map +0 -1
- package/dist/shared/attaform.BnK_bfcb.mjs.map +0 -1
- package/dist/shared/attaform.BupwXkj_.mjs.map +0 -1
- package/dist/shared/attaform.BzvOdiSI.cjs.map +0 -1
- package/dist/shared/attaform.CkjTapyq.mjs.map +0 -1
- package/dist/shared/attaform.DSqO6Db7.mjs.map +0 -1
- package/dist/shared/attaform.PnqML3xW.cjs.map +0 -1
- package/dist/shared/attaform.Y_Mgg0Yp.mjs.map +0 -1
- package/dist/shared/attaform._rsCZy2j.cjs.map +0 -1
- package/dist/shared/attaform.r3PePkDR.mjs.map +0 -1
- package/dist/shared/{attaform.DSD85fHb.d.cts → attaform.nf83TIR5.d.cts} +10 -10
- package/dist/shared/{attaform.DSD85fHb.d.mts → attaform.nf83TIR5.d.mts} +10 -10
- package/dist/shared/{attaform.DSD85fHb.d.ts → attaform.nf83TIR5.d.ts} +10 -10
package/dist/zod.d.mts
CHANGED
|
@@ -1,12 +1,73 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
2
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, am as ValidateOnConfig, b as UseFormReturnType, s as FieldMetaPayload } from './shared/attaform.ory-3WhV.mjs';
|
|
3
|
+
export { ak as Unset, au as isUnset, aw as unset } from './shared/attaform.ory-3WhV.mjs';
|
|
4
|
+
import { S as StorageShape } from './shared/attaform.CnEl--PF.mjs';
|
|
5
|
+
export { P as PathInput, a as PathOutput } from './shared/attaform.CnEl--PF.mjs';
|
|
6
|
+
import { U as UnwrapZodObject, S as StorageShape$1 } from './shared/attaform.nf83TIR5.mjs';
|
|
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.BCcrLApm.mjs';
|
|
8
8
|
import 'vue';
|
|
9
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
|
+
type V4FormOf<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never;
|
|
65
|
+
type V4OutOf<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never;
|
|
66
|
+
type V4ReadOf<S extends z.ZodObject> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
|
|
67
|
+
type V3FormOf<S extends z.ZodObject<z.ZodRawShape>> = z.input<UnwrapZodObject<S>> extends GenericForm ? z.input<UnwrapZodObject<S>> : never;
|
|
68
|
+
type V3OutOf<S extends z.ZodObject<z.ZodRawShape>> = z.output<UnwrapZodObject<S>> extends GenericForm ? z.output<UnwrapZodObject<S>> : never;
|
|
69
|
+
type V3ReadOf<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZodObject<S>> extends GenericForm ? StorageShape$1<UnwrapZodObject<S>> : never;
|
|
70
|
+
|
|
10
71
|
/**
|
|
11
72
|
* Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches
|
|
12
73
|
* on schema shape: a Zod v4 schema (`def.type` truthy) routes to the
|
|
@@ -41,12 +102,6 @@ import 'vue';
|
|
|
41
102
|
* adapter.
|
|
42
103
|
*/
|
|
43
104
|
|
|
44
|
-
type V4FormOf$1<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never;
|
|
45
|
-
type V4OutOf$1<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never;
|
|
46
|
-
type V4ReadOf$1<S extends z.ZodObject> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
|
|
47
|
-
type V3FormOf$1<S extends z.ZodObject<z.ZodRawShape>> = z.input<UnwrapZodObject<S>> extends GenericForm ? z.input<UnwrapZodObject<S>> : never;
|
|
48
|
-
type V3OutOf$1<S extends z.ZodObject<z.ZodRawShape>> = z.output<UnwrapZodObject<S>> extends GenericForm ? z.output<UnwrapZodObject<S>> : never;
|
|
49
|
-
type V3ReadOf$1<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZodObject<S>> extends GenericForm ? StorageShape$1<UnwrapZodObject<S>> : never;
|
|
50
105
|
/**
|
|
51
106
|
* Create a form bound to a Zod v4 schema.
|
|
52
107
|
*
|
|
@@ -62,12 +117,14 @@ type V3ReadOf$1<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZod
|
|
|
62
117
|
* })
|
|
63
118
|
* ```
|
|
64
119
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
120
|
+
* The constraint intersects `ZodV4Internals` (the v4-only `_zod`
|
|
121
|
+
* brand) so a v3 schema can't bind this overload even when `z`
|
|
122
|
+
* resolves to v3 in a single-major consumer install; v3 schemas fall
|
|
123
|
+
* through to the v3 overload below. See `types-zod-major.ts`.
|
|
67
124
|
*/
|
|
68
|
-
declare function useForm<Schema extends z.ZodObject, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf
|
|
125
|
+
declare function useForm<Schema extends z.ZodObject<z.ZodRawShape> & ZodV4Internals, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
69
126
|
schema: Schema;
|
|
70
|
-
} & ValidateOnConfig): UseFormReturnType<V4FormOf
|
|
127
|
+
} & ValidateOnConfig): UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
|
|
71
128
|
/**
|
|
72
129
|
* Create a form bound to a Zod v3 schema.
|
|
73
130
|
*
|
|
@@ -86,9 +143,9 @@ declare function useForm<Schema extends z.ZodObject, K extends FormKey = FormKey
|
|
|
86
143
|
* v3 schemas match this overload; v4 schemas hit the v4 overload
|
|
87
144
|
* above first and never reach here.
|
|
88
145
|
*/
|
|
89
|
-
declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V3FormOf
|
|
146
|
+
declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
90
147
|
schema: Schema;
|
|
91
|
-
} & ValidateOnConfig): UseFormReturnType<V3FormOf
|
|
148
|
+
} & ValidateOnConfig): UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>;
|
|
92
149
|
|
|
93
150
|
/**
|
|
94
151
|
* Type-level helpers for the unified `attaform/zod` entry. These give
|
|
@@ -109,12 +166,6 @@ declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, K extends Fo
|
|
|
109
166
|
* overloaded `useForm` already gives full inference at call sites.
|
|
110
167
|
*/
|
|
111
168
|
|
|
112
|
-
type V4FormOf<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never;
|
|
113
|
-
type V4OutOf<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never;
|
|
114
|
-
type V4ReadOf<S extends z.ZodObject> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
|
|
115
|
-
type V3FormOf<S extends z.ZodObject<z.ZodRawShape>> = z.input<UnwrapZodObject<S>> extends GenericForm ? z.input<UnwrapZodObject<S>> : never;
|
|
116
|
-
type V3OutOf<S extends z.ZodObject<z.ZodRawShape>> = z.output<UnwrapZodObject<S>> extends GenericForm ? z.output<UnwrapZodObject<S>> : never;
|
|
117
|
-
type V3ReadOf<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZodObject<S>> extends GenericForm ? StorageShape$1<UnwrapZodObject<S>> : never;
|
|
118
169
|
/**
|
|
119
170
|
* Direct V4 projection — no major-dispatch. Use when the schema's
|
|
120
171
|
* Zod major is known statically (typical for V4 generic helpers like
|
|
@@ -152,13 +203,13 @@ type UseFormConfigV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKe
|
|
|
152
203
|
* this helper stays deferred and TS can't prove return-type
|
|
153
204
|
* compatibility.
|
|
154
205
|
*/
|
|
155
|
-
type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends z.ZodObject<z.ZodRawShape> ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
|
|
206
|
+
type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject<z.ZodRawShape> & ZodV4Internals ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends z.ZodObject<z.ZodRawShape> ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
|
|
156
207
|
/**
|
|
157
208
|
* The configuration parameter shape of `useForm` for a given Zod
|
|
158
209
|
* schema. Mirrors `UseFormReturn`'s dispatch — replaces
|
|
159
210
|
* `Parameters<typeof useForm<Schema, K>>[0]` in test code.
|
|
160
211
|
*/
|
|
161
|
-
type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
212
|
+
type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject<z.ZodRawShape> & ZodV4Internals ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
162
213
|
schema: Schema;
|
|
163
214
|
} & ValidateOnConfig : Schema extends z.ZodObject<z.ZodRawShape> ? Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
164
215
|
schema: Schema;
|
package/dist/zod.d.ts
CHANGED
|
@@ -1,12 +1,73 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
2
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, am as ValidateOnConfig, b as UseFormReturnType, s as FieldMetaPayload } from './shared/attaform.ory-3WhV.js';
|
|
3
|
+
export { ak as Unset, au as isUnset, aw as unset } from './shared/attaform.ory-3WhV.js';
|
|
4
|
+
import { S as StorageShape } from './shared/attaform.BYgioWLF.js';
|
|
5
|
+
export { P as PathInput, a as PathOutput } from './shared/attaform.BYgioWLF.js';
|
|
6
|
+
import { U as UnwrapZodObject, S as StorageShape$1 } from './shared/attaform.nf83TIR5.js';
|
|
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.BGf_J22U.js';
|
|
8
8
|
import 'vue';
|
|
9
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
|
+
type V4FormOf<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never;
|
|
65
|
+
type V4OutOf<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never;
|
|
66
|
+
type V4ReadOf<S extends z.ZodObject> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
|
|
67
|
+
type V3FormOf<S extends z.ZodObject<z.ZodRawShape>> = z.input<UnwrapZodObject<S>> extends GenericForm ? z.input<UnwrapZodObject<S>> : never;
|
|
68
|
+
type V3OutOf<S extends z.ZodObject<z.ZodRawShape>> = z.output<UnwrapZodObject<S>> extends GenericForm ? z.output<UnwrapZodObject<S>> : never;
|
|
69
|
+
type V3ReadOf<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZodObject<S>> extends GenericForm ? StorageShape$1<UnwrapZodObject<S>> : never;
|
|
70
|
+
|
|
10
71
|
/**
|
|
11
72
|
* Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches
|
|
12
73
|
* on schema shape: a Zod v4 schema (`def.type` truthy) routes to the
|
|
@@ -41,12 +102,6 @@ import 'vue';
|
|
|
41
102
|
* adapter.
|
|
42
103
|
*/
|
|
43
104
|
|
|
44
|
-
type V4FormOf$1<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never;
|
|
45
|
-
type V4OutOf$1<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never;
|
|
46
|
-
type V4ReadOf$1<S extends z.ZodObject> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
|
|
47
|
-
type V3FormOf$1<S extends z.ZodObject<z.ZodRawShape>> = z.input<UnwrapZodObject<S>> extends GenericForm ? z.input<UnwrapZodObject<S>> : never;
|
|
48
|
-
type V3OutOf$1<S extends z.ZodObject<z.ZodRawShape>> = z.output<UnwrapZodObject<S>> extends GenericForm ? z.output<UnwrapZodObject<S>> : never;
|
|
49
|
-
type V3ReadOf$1<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZodObject<S>> extends GenericForm ? StorageShape$1<UnwrapZodObject<S>> : never;
|
|
50
105
|
/**
|
|
51
106
|
* Create a form bound to a Zod v4 schema.
|
|
52
107
|
*
|
|
@@ -62,12 +117,14 @@ type V3ReadOf$1<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZod
|
|
|
62
117
|
* })
|
|
63
118
|
* ```
|
|
64
119
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
120
|
+
* The constraint intersects `ZodV4Internals` (the v4-only `_zod`
|
|
121
|
+
* brand) so a v3 schema can't bind this overload even when `z`
|
|
122
|
+
* resolves to v3 in a single-major consumer install; v3 schemas fall
|
|
123
|
+
* through to the v3 overload below. See `types-zod-major.ts`.
|
|
67
124
|
*/
|
|
68
|
-
declare function useForm<Schema extends z.ZodObject, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf
|
|
125
|
+
declare function useForm<Schema extends z.ZodObject<z.ZodRawShape> & ZodV4Internals, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
69
126
|
schema: Schema;
|
|
70
|
-
} & ValidateOnConfig): UseFormReturnType<V4FormOf
|
|
127
|
+
} & ValidateOnConfig): UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
|
|
71
128
|
/**
|
|
72
129
|
* Create a form bound to a Zod v3 schema.
|
|
73
130
|
*
|
|
@@ -86,9 +143,9 @@ declare function useForm<Schema extends z.ZodObject, K extends FormKey = FormKey
|
|
|
86
143
|
* v3 schemas match this overload; v4 schemas hit the v4 overload
|
|
87
144
|
* above first and never reach here.
|
|
88
145
|
*/
|
|
89
|
-
declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V3FormOf
|
|
146
|
+
declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
90
147
|
schema: Schema;
|
|
91
|
-
} & ValidateOnConfig): UseFormReturnType<V3FormOf
|
|
148
|
+
} & ValidateOnConfig): UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K>;
|
|
92
149
|
|
|
93
150
|
/**
|
|
94
151
|
* Type-level helpers for the unified `attaform/zod` entry. These give
|
|
@@ -109,12 +166,6 @@ declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, K extends Fo
|
|
|
109
166
|
* overloaded `useForm` already gives full inference at call sites.
|
|
110
167
|
*/
|
|
111
168
|
|
|
112
|
-
type V4FormOf<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never;
|
|
113
|
-
type V4OutOf<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never;
|
|
114
|
-
type V4ReadOf<S extends z.ZodObject> = StorageShape<S> extends GenericForm ? StorageShape<S> : never;
|
|
115
|
-
type V3FormOf<S extends z.ZodObject<z.ZodRawShape>> = z.input<UnwrapZodObject<S>> extends GenericForm ? z.input<UnwrapZodObject<S>> : never;
|
|
116
|
-
type V3OutOf<S extends z.ZodObject<z.ZodRawShape>> = z.output<UnwrapZodObject<S>> extends GenericForm ? z.output<UnwrapZodObject<S>> : never;
|
|
117
|
-
type V3ReadOf<S extends z.ZodObject<z.ZodRawShape>> = StorageShape$1<UnwrapZodObject<S>> extends GenericForm ? StorageShape$1<UnwrapZodObject<S>> : never;
|
|
118
169
|
/**
|
|
119
170
|
* Direct V4 projection — no major-dispatch. Use when the schema's
|
|
120
171
|
* Zod major is known statically (typical for V4 generic helpers like
|
|
@@ -152,13 +203,13 @@ type UseFormConfigV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKe
|
|
|
152
203
|
* this helper stays deferred and TS can't prove return-type
|
|
153
204
|
* compatibility.
|
|
154
205
|
*/
|
|
155
|
-
type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends z.ZodObject<z.ZodRawShape> ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
|
|
206
|
+
type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject<z.ZodRawShape> & ZodV4Internals ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends z.ZodObject<z.ZodRawShape> ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
|
|
156
207
|
/**
|
|
157
208
|
* The configuration parameter shape of `useForm` for a given Zod
|
|
158
209
|
* schema. Mirrors `UseFormReturn`'s dispatch — replaces
|
|
159
210
|
* `Parameters<typeof useForm<Schema, K>>[0]` in test code.
|
|
160
211
|
*/
|
|
161
|
-
type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
212
|
+
type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends z.ZodObject<z.ZodRawShape> & ZodV4Internals ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
162
213
|
schema: Schema;
|
|
163
214
|
} & ValidateOnConfig : Schema extends z.ZodObject<z.ZodRawShape> ? Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
164
215
|
schema: Schema;
|
package/dist/zod.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { d as InvalidUseFormConfigError } from './shared/attaform.
|
|
2
|
-
|
|
3
|
-
import { u as useForm$
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export { A as AttaformErrorCode, k as injectForm, l as injectWizard, n as isUnset, o as lazy, z as unset, C as useWizard } from './shared/attaform.DSqO6Db7.mjs';
|
|
1
|
+
import { d as InvalidUseFormConfigError } from './shared/attaform.DP-u7_tk.mjs';
|
|
2
|
+
import { u as useForm$2 } from './shared/attaform.CrD73S4m.mjs';
|
|
3
|
+
import { u as useForm$1 } from './shared/attaform.BVeLgfEh.mjs';
|
|
4
|
+
import { f as fieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.D6GYGshL.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.CTheKoTc.mjs';
|
|
7
6
|
|
|
8
7
|
function isZodV4SchemaShape(value) {
|
|
9
8
|
if (typeof value !== "object" || value === null) return false;
|
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 type { z } from 'zod'\nimport type { z as zV3 } from 'zod-v3'\nimport { InvalidUseFormConfigError } from '../../core/errors'\nimport { isZodV4SchemaShape } from '../../core/zod-shape'\nimport { useForm as useFormV3 } from '../../composables/use-form'\nimport { useForm as useFormV4 } from '../zod-v4'\nimport type { StorageShape as StorageShapeV4 } from '../zod-v4/types-storage-shape'\nimport type { StorageShape as StorageShapeV3 } from '../zod-v3/types-storage-shape'\nimport type { UnwrapZodObject } from '../zod-v3/types-zod-adapter'\nimport type {\n AbstractSchema,\n FormKey,\n ValidateOnConfig,\n UseFormReturnType,\n UseFormConfiguration,\n} from '../../types/types-api'\nimport type { DefaultValuesInput, GenericForm } from '../../types/types-core'\n\n// ───────────────────────────────────────────────────────────────────\n// Per-major projection helpers. Each overload's constraint scopes the\n// Schema to one Zod major, so the projection is a direct read — no\n// dispatch in the type body. Mirrors the direct adapter shapes so the\n// unified entry pays the same per-call depth cost as a direct import.\n// ───────────────────────────────────────────────────────────────────\n\ntype V4FormOf<S extends z.ZodObject> = z.input<S> extends GenericForm ? z.input<S> : never\ntype V4OutOf<S extends z.ZodObject> = z.output<S> extends GenericForm ? z.output<S> : never\ntype V4ReadOf<S extends z.ZodObject> =\n StorageShapeV4<S> extends GenericForm ? StorageShapeV4<S> : never\n\ntype V3FormOf<S extends zV3.ZodObject<zV3.ZodRawShape>> =\n zV3.input<UnwrapZodObject<S>> extends GenericForm ? zV3.input<UnwrapZodObject<S>> : never\ntype V3OutOf<S extends zV3.ZodObject<zV3.ZodRawShape>> =\n zV3.output<UnwrapZodObject<S>> extends GenericForm ? zV3.output<UnwrapZodObject<S>> : never\ntype V3ReadOf<S extends zV3.ZodObject<zV3.ZodRawShape>> =\n StorageShapeV3<UnwrapZodObject<S>> extends GenericForm\n ? StorageShapeV3<UnwrapZodObject<S>>\n : never\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 * v4 schemas match this overload first via their structural `def`\n * field. v3 schemas fall through to the v3 overload below.\n */\nexport function useForm<Schema extends z.ZodObject, K extends FormKey = FormKey>(\n configuration: Omit<\n UseFormConfiguration<\n V4FormOf<Schema>,\n V4OutOf<Schema>,\n AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>,\n DefaultValuesInput<V4FormOf<Schema>>,\n K\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & 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 zV3.ZodObject<zV3.ZodRawShape>, K extends FormKey = FormKey>(\n configuration: Omit<\n UseFormConfiguration<\n V3FormOf<Schema>,\n V3OutOf<Schema>,\n AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>,\n DefaultValuesInput<V3FormOf<Schema>>,\n K\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & 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;;ACwFO,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;;AC9GO,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":["../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 type { z } from 'zod'\nimport type { z as zV3 } from 'zod-v3'\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 { DefaultValuesInput } from '../../types/types-core'\nimport type { V3FormOf, V3OutOf, V3ReadOf, V4FormOf, V4OutOf, V4ReadOf } 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 z.ZodObject<z.ZodRawShape> & 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 DefaultValuesInput<V4FormOf<Schema>>,\n K\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & 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 zV3.ZodObject<zV3.ZodRawShape>, K extends FormKey = FormKey>(\n configuration: Omit<\n UseFormConfiguration<\n V3FormOf<Schema>,\n V3OutOf<Schema>,\n AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>,\n DefaultValuesInput<V3FormOf<Schema>>,\n K\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & 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;;ACuEO,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;;AC7FO,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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "attaform",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"types": "./dist/index.d.mts",
|
|
6
6
|
"files": [
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
],
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"engines": {
|
|
11
|
-
"node": ">=22.0.0
|
|
12
|
-
"pnpm": ">=11.0.0"
|
|
11
|
+
"node": ">=22.0.0"
|
|
13
12
|
},
|
|
14
13
|
"publishConfig": {
|
|
15
14
|
"access": "public",
|
|
@@ -108,17 +107,13 @@
|
|
|
108
107
|
"@eslint/js": "^10.0.1",
|
|
109
108
|
"@fast-check/vitest": "^0.4.0",
|
|
110
109
|
"@nuxt/devtools-kit": "^3.2.0",
|
|
111
|
-
"@nuxt/eslint-config": "^1.15.2",
|
|
112
110
|
"@nuxt/kit": "^4.4.2",
|
|
113
|
-
"@nuxt/module-builder": "^1.0.2",
|
|
114
111
|
"@nuxt/schema": "^4.4.2",
|
|
115
112
|
"@nuxt/test-utils": "^4.0.2",
|
|
116
113
|
"@rollup/plugin-alias": "^6.0.0",
|
|
117
114
|
"@size-limit/preset-small-lib": "^12.1.0",
|
|
118
115
|
"@types/jsdom": "^28.0.1",
|
|
119
116
|
"@types/node": "^25.6.0",
|
|
120
|
-
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
121
|
-
"@typescript-eslint/parser": "^8.59.0",
|
|
122
117
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
123
118
|
"@vitest/coverage-v8": "^4.1.5",
|
|
124
119
|
"@vue/compiler-core": "^3.5.33",
|
|
@@ -127,19 +122,16 @@
|
|
|
127
122
|
"@vue/language-server": "^3.2.7",
|
|
128
123
|
"@vue/server-renderer": "^3.5.33",
|
|
129
124
|
"@vue/typescript-plugin": "^3.2.7",
|
|
130
|
-
"changelogen": "^0.6.2",
|
|
131
125
|
"cheerio": "^1.2.0",
|
|
132
126
|
"chokidar-cli": "^3.0.0",
|
|
133
127
|
"devalue": "^5.8.1",
|
|
134
128
|
"eslint": "^10.2.1",
|
|
135
|
-
"eslint-config-prettier": "^10.1.8",
|
|
136
129
|
"eslint-plugin-prettier": "^5.5.5",
|
|
137
130
|
"eslint-plugin-vue": "^10.9.0",
|
|
138
131
|
"fake-indexeddb": "^6.2.5",
|
|
139
132
|
"fast-check": "^4.7.0",
|
|
140
133
|
"globals": "^17.5.0",
|
|
141
134
|
"husky": "^9.1.7",
|
|
142
|
-
"immer": "^11.1.4",
|
|
143
135
|
"jsdom": "^29.0.2",
|
|
144
136
|
"lint-staged": "^17.0.4",
|
|
145
137
|
"nuxt": "^4.4.2",
|
|
@@ -150,7 +142,6 @@
|
|
|
150
142
|
"typescript-eslint": "^8.59.0",
|
|
151
143
|
"unbuild": "^3.6.1",
|
|
152
144
|
"vite": "^8.0.10",
|
|
153
|
-
"vite-plugin-dts": "^5.0.0",
|
|
154
145
|
"vitest": "^4.1.5",
|
|
155
146
|
"vue": "^3.5.33",
|
|
156
147
|
"vue-eslint-parser": "^10.4.0",
|
|
@@ -209,6 +200,7 @@
|
|
|
209
200
|
"check:bench": "node scripts/check-bench.mjs",
|
|
210
201
|
"check:bundled-types": "node scripts/check-bundled-types.mjs",
|
|
211
202
|
"check:site": "pnpm dev:prepare && pnpm --filter attaform-site typecheck",
|
|
203
|
+
"fallow": "DO_NOT_TRACK=1 FALLOW_TELEMETRY=0 npx --yes fallow@2.88.3 --score",
|
|
212
204
|
"version": "node scripts/promote-changelog.mjs && (node scripts/generate-release-notes.mjs || echo '[version] release-notes step failed; continuing') && git add CHANGELOG.md RELEASES.md"
|
|
213
205
|
}
|
|
214
206
|
}
|