Skip to content

Commit 4503caf

Browse files
authored
fix: remove dependency from standard schema and internalize it (#1076)
* fix: reintroduce mandatori standard schema adapter * ci: apply automated fixes and generate docs * fix: add standard any * ci: apply automated fixes and generate docs * fix: embed standard schema types * ci: apply automated fixes and generate docs * fix: make standar adapter optional again * ci: apply automated fixes and generate docs * fix: remove again adapter in example - it works now
1 parent 8042428 commit 4503caf

16 files changed

+647
-333
lines changed

Diff for: docs/reference/classes/fieldapi.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Initializes a new `FieldApi` instance.
4747

4848
#### Defined in
4949

50-
[packages/form-core/src/FieldApi.ts:518](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L518)
50+
[packages/form-core/src/FieldApi.ts:474](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L474)
5151

5252
## Properties
5353

@@ -61,7 +61,7 @@ A reference to the form API instance.
6161

6262
#### Defined in
6363

64-
[packages/form-core/src/FieldApi.ts:480](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L480)
64+
[packages/form-core/src/FieldApi.ts:436](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L436)
6565

6666
***
6767

@@ -75,7 +75,7 @@ The field name.
7575

7676
#### Defined in
7777

78-
[packages/form-core/src/FieldApi.ts:490](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L490)
78+
[packages/form-core/src/FieldApi.ts:446](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L446)
7979

8080
***
8181

@@ -89,7 +89,7 @@ The field options.
8989

9090
#### Defined in
9191

92-
[packages/form-core/src/FieldApi.ts:494](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L494)
92+
[packages/form-core/src/FieldApi.ts:450](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L450)
9393

9494
***
9595

@@ -103,7 +103,7 @@ The current field state.
103103

104104
#### Defined in
105105

106-
[packages/form-core/src/FieldApi.ts:508](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L508)
106+
[packages/form-core/src/FieldApi.ts:464](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L464)
107107

108108
***
109109

@@ -117,7 +117,7 @@ The field state store.
117117

118118
#### Defined in
119119

120-
[packages/form-core/src/FieldApi.ts:504](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L504)
120+
[packages/form-core/src/FieldApi.ts:460](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L460)
121121

122122
***
123123

@@ -129,7 +129,7 @@ timeoutIds: Record<ValidationCause, null | Timeout>;
129129

130130
#### Defined in
131131

132-
[packages/form-core/src/FieldApi.ts:513](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L513)
132+
[packages/form-core/src/FieldApi.ts:469](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L469)
133133

134134
## Methods
135135

@@ -147,7 +147,7 @@ Gets the field information object.
147147

148148
#### Defined in
149149

150-
[packages/form-core/src/FieldApi.ts:757](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L757)
150+
[packages/form-core/src/FieldApi.ts:713](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L713)
151151

152152
***
153153

@@ -165,7 +165,7 @@ Gets the current field metadata.
165165

166166
#### Defined in
167167

168-
[packages/form-core/src/FieldApi.ts:735](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L735)
168+
[packages/form-core/src/FieldApi.ts:691](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L691)
169169

170170
***
171171

@@ -187,7 +187,7 @@ Use `field.state.value` instead.
187187

188188
#### Defined in
189189

190-
[packages/form-core/src/FieldApi.ts:709](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L709)
190+
[packages/form-core/src/FieldApi.ts:665](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L665)
191191

192192
***
193193

@@ -205,7 +205,7 @@ Handles the blur event.
205205

206206
#### Defined in
207207

208-
[packages/form-core/src/FieldApi.ts:1109](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1109)
208+
[packages/form-core/src/FieldApi.ts:1065](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1065)
209209

210210
***
211211

@@ -229,7 +229,7 @@ Handles the change event.
229229

230230
#### Defined in
231231

232-
[packages/form-core/src/FieldApi.ts:1102](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1102)
232+
[packages/form-core/src/FieldApi.ts:1058](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1058)
233233

234234
***
235235

@@ -264,7 +264,7 @@ Inserts a value at the specified index, shifting the subsequent values to the ri
264264
265265
#### Defined in
266266
267-
[packages/form-core/src/FieldApi.ts:770](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L770)
267+
[packages/form-core/src/FieldApi.ts:726](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L726)
268268
269269
***
270270
@@ -286,7 +286,7 @@ Mounts the field instance to the form.
286286
287287
#### Defined in
288288
289-
[packages/form-core/src/FieldApi.ts:619](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L619)
289+
[packages/form-core/src/FieldApi.ts:575](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L575)
290290
291291
***
292292
@@ -321,7 +321,7 @@ Moves the value at the first specified index to the second specified index.
321321
322322
#### Defined in
323323
324-
[packages/form-core/src/FieldApi.ts:800](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L800)
324+
[packages/form-core/src/FieldApi.ts:756](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L756)
325325
326326
***
327327
@@ -349,7 +349,7 @@ Pushes a new value to the field.
349349
350350
#### Defined in
351351
352-
[packages/form-core/src/FieldApi.ts:762](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L762)
352+
[packages/form-core/src/FieldApi.ts:718](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L718)
353353
354354
***
355355
@@ -377,7 +377,7 @@ Removes a value at the specified index.
377377
378378
#### Defined in
379379
380-
[packages/form-core/src/FieldApi.ts:788](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L788)
380+
[packages/form-core/src/FieldApi.ts:744](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L744)
381381
382382
***
383383
@@ -412,7 +412,7 @@ Replaces a value at the specified index.
412412
413413
#### Defined in
414414
415-
[packages/form-core/src/FieldApi.ts:779](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L779)
415+
[packages/form-core/src/FieldApi.ts:735](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L735)
416416
417417
***
418418
@@ -436,7 +436,7 @@ Updates the field's errorMap
436436
437437
#### Defined in
438438
439-
[packages/form-core/src/FieldApi.ts:1129](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1129)
439+
[packages/form-core/src/FieldApi.ts:1085](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1085)
440440
441441
***
442442
@@ -460,7 +460,7 @@ Sets the field metadata.
460460
461461
#### Defined in
462462
463-
[packages/form-core/src/FieldApi.ts:751](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L751)
463+
[packages/form-core/src/FieldApi.ts:707](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L707)
464464
465465
***
466466
@@ -488,7 +488,7 @@ Sets the field value and run the `change` validator.
488488
489489
#### Defined in
490490
491-
[packages/form-core/src/FieldApi.ts:716](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L716)
491+
[packages/form-core/src/FieldApi.ts:672](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L672)
492492
493493
***
494494
@@ -523,7 +523,7 @@ Swaps the values at the specified indices.
523523
524524
#### Defined in
525525
526-
[packages/form-core/src/FieldApi.ts:794](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L794)
526+
[packages/form-core/src/FieldApi.ts:750](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L750)
527527
528528
***
529529
@@ -547,7 +547,7 @@ Updates the field instance with new options.
547547
548548
#### Defined in
549549
550-
[packages/form-core/src/FieldApi.ts:672](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L672)
550+
[packages/form-core/src/FieldApi.ts:628](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L628)
551551
552552
***
553553
@@ -571,4 +571,4 @@ Validates the field value.
571571
572572
#### Defined in
573573
574-
[packages/form-core/src/FieldApi.ts:1074](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1074)
574+
[packages/form-core/src/FieldApi.ts:1030](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1030)

Diff for: docs/reference/functions/isstandardschemavalidator.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: isStandardSchemaValidator
66
# Function: isStandardSchemaValidator()
77

88
```ts
9-
function isStandardSchemaValidator(validator): validator is StandardSchemaV1
9+
function isStandardSchemaValidator(validator): validator is StandardSchemaV1<unknown, unknown>
1010
```
1111

1212
## Parameters
@@ -17,8 +17,8 @@ function isStandardSchemaValidator(validator): validator is StandardSchemaV1
1717

1818
## Returns
1919

20-
`validator is StandardSchemaV1`
20+
`validator is StandardSchemaV1<unknown, unknown>`
2121

2222
## Defined in
2323

24-
[packages/form-core/src/standardSchemaValidator.ts:87](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L87)
24+
[packages/form-core/src/standardSchemaValidator.ts:86](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L86)

Diff for: docs/reference/functions/standardschemavalidator.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: standardSchemaValidator
66
# Function: standardSchemaValidator()
77

88
```ts
9-
function standardSchemaValidator(params): Validator<unknown, StandardSchemaV1>
9+
function standardSchemaValidator(params): Validator<unknown, StandardSchemaV1<any, any>>
1010
```
1111

1212
## Parameters
@@ -17,8 +17,8 @@ function standardSchemaValidator(params): Validator<unknown, StandardSchemaV1>
1717

1818
## Returns
1919

20-
`Validator`\<`unknown`, `StandardSchemaV1`\>
20+
`Validator`\<`unknown`, [`StandardSchemaV1`](../type-aliases/standardschemav1.md)\<`any`, `any`\>\>
2121

2222
## Defined in
2323

24-
[packages/form-core/src/standardSchemaValidator.ts:49](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L49)
24+
[packages/form-core/src/standardSchemaValidator.ts:48](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L48)

Diff for: docs/reference/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ title: "@tanstack/form-core"
3030
- [FormState](type-aliases/formstate.md)
3131
- [FormValidateFn](type-aliases/formvalidatefn.md)
3232
- [FormValidator](type-aliases/formvalidator.md)
33+
- [StandardSchemaV1](type-aliases/standardschemav1.md)
3334
- [Updater](type-aliases/updater.md)
3435
- [UpdaterFn](type-aliases/updaterfn.md)
3536
- [ValidationError](type-aliases/validationerror.md)

Diff for: docs/reference/interfaces/fieldapioptions.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If `true`, always run async validation, even if there are errors emitted during
3939

4040
#### Defined in
4141

42-
[packages/form-core/src/FieldApi.ts:355](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L355)
42+
[packages/form-core/src/FieldApi.ts:311](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L311)
4343

4444
***
4545

@@ -57,7 +57,7 @@ The default time to debounce async validation if there is not a more specific de
5757

5858
#### Defined in
5959

60-
[packages/form-core/src/FieldApi.ts:351](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L351)
60+
[packages/form-core/src/FieldApi.ts:307](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L307)
6161

6262
***
6363

@@ -75,7 +75,7 @@ An optional object with default metadata for the field.
7575

7676
#### Defined in
7777

78-
[packages/form-core/src/FieldApi.ts:373](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L373)
78+
[packages/form-core/src/FieldApi.ts:329](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L329)
7979

8080
***
8181

@@ -93,7 +93,7 @@ An optional default value for the field.
9393

9494
#### Defined in
9595

96-
[packages/form-core/src/FieldApi.ts:347](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L347)
96+
[packages/form-core/src/FieldApi.ts:303](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L303)
9797

9898
***
9999

@@ -105,7 +105,7 @@ form: FormApi<TParentData, TFormValidator>;
105105

106106
#### Defined in
107107

108-
[packages/form-core/src/FieldApi.ts:406](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L406)
108+
[packages/form-core/src/FieldApi.ts:362](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L362)
109109

110110
***
111111

@@ -123,7 +123,7 @@ A list of listeners which attach to the corresponding events
123123

124124
#### Defined in
125125

126-
[packages/form-core/src/FieldApi.ts:377](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L377)
126+
[packages/form-core/src/FieldApi.ts:333](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L333)
127127

128128
***
129129

@@ -141,7 +141,7 @@ The field name. The type will be `DeepKeys<TParentData>` to ensure your name is
141141

142142
#### Defined in
143143

144-
[packages/form-core/src/FieldApi.ts:343](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L343)
144+
[packages/form-core/src/FieldApi.ts:299](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L299)
145145

146146
***
147147

@@ -159,7 +159,7 @@ A validator provided by an extension, like `yupValidator` from `@tanstack/yup-fo
159159

160160
#### Defined in
161161

162-
[packages/form-core/src/FieldApi.ts:359](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L359)
162+
[packages/form-core/src/FieldApi.ts:315](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L315)
163163

164164
***
165165

@@ -177,4 +177,4 @@ A list of validators to pass to the field
177177

178178
#### Defined in
179179

180-
[packages/form-core/src/FieldApi.ts:363](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L363)
180+
[packages/form-core/src/FieldApi.ts:319](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L319)

Diff for: docs/reference/interfaces/fieldlisteners.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ optional onBlur: FieldListenerFn<TParentData, TName, TFieldValidator, TFormValid
2727

2828
#### Defined in
2929

30-
[packages/form-core/src/FieldApi.ts:303](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L303)
30+
[packages/form-core/src/FieldApi.ts:259](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L259)
3131

3232
***
3333

@@ -39,7 +39,7 @@ optional onChange: FieldListenerFn<TParentData, TName, TFieldValidator, TFormVal
3939

4040
#### Defined in
4141

42-
[packages/form-core/src/FieldApi.ts:296](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L296)
42+
[packages/form-core/src/FieldApi.ts:252](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L252)
4343

4444
***
4545

@@ -51,7 +51,7 @@ optional onMount: FieldListenerFn<TParentData, TName, TFieldValidator, TFormVali
5151

5252
#### Defined in
5353

54-
[packages/form-core/src/FieldApi.ts:310](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L310)
54+
[packages/form-core/src/FieldApi.ts:266](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L266)
5555

5656
***
5757

@@ -63,4 +63,4 @@ optional onSubmit: FieldListenerFn<TParentData, TName, TFieldValidator, TFormVal
6363

6464
#### Defined in
6565

66-
[packages/form-core/src/FieldApi.ts:317](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L317)
66+
[packages/form-core/src/FieldApi.ts:273](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L273)

0 commit comments

Comments
 (0)