Skip to content

Commit

Permalink
fix: remove dependency from standard schema and internalize it (#1076)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Balastrong authored Dec 14, 2024
1 parent 8042428 commit 4503caf
Show file tree
Hide file tree
Showing 16 changed files with 647 additions and 333 deletions.
48 changes: 24 additions & 24 deletions docs/reference/classes/fieldapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Initializes a new `FieldApi` instance.

#### Defined in

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

## Properties

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

#### Defined in

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

***

Expand All @@ -75,7 +75,7 @@ The field name.

#### Defined in

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

***

Expand All @@ -89,7 +89,7 @@ The field options.

#### Defined in

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

***

Expand All @@ -103,7 +103,7 @@ The current field state.

#### Defined in

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

***

Expand All @@ -117,7 +117,7 @@ The field state store.

#### Defined in

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

***

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

#### Defined in

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

## Methods

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

Expand All @@ -205,7 +205,7 @@ Handles the blur event.

#### Defined in

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

***

Expand All @@ -229,7 +229,7 @@ Handles the change event.

#### Defined in

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

***

Expand Down Expand Up @@ -264,7 +264,7 @@ Inserts a value at the specified index, shifting the subsequent values to the ri
#### Defined in
[packages/form-core/src/FieldApi.ts:770](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L770)
[packages/form-core/src/FieldApi.ts:726](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L726)
***
Expand All @@ -286,7 +286,7 @@ Mounts the field instance to the form.
#### Defined in
[packages/form-core/src/FieldApi.ts:619](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L619)
[packages/form-core/src/FieldApi.ts:575](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L575)
***
Expand Down Expand Up @@ -321,7 +321,7 @@ Moves the value at the first specified index to the second specified index.
#### Defined in
[packages/form-core/src/FieldApi.ts:800](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L800)
[packages/form-core/src/FieldApi.ts:756](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L756)
***
Expand Down Expand Up @@ -349,7 +349,7 @@ Pushes a new value to the field.
#### Defined in
[packages/form-core/src/FieldApi.ts:762](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L762)
[packages/form-core/src/FieldApi.ts:718](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L718)
***
Expand Down Expand Up @@ -377,7 +377,7 @@ Removes a value at the specified index.
#### Defined in
[packages/form-core/src/FieldApi.ts:788](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L788)
[packages/form-core/src/FieldApi.ts:744](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L744)
***
Expand Down Expand Up @@ -412,7 +412,7 @@ Replaces a value at the specified index.
#### Defined in
[packages/form-core/src/FieldApi.ts:779](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L779)
[packages/form-core/src/FieldApi.ts:735](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L735)
***
Expand All @@ -436,7 +436,7 @@ Updates the field's errorMap
#### Defined in
[packages/form-core/src/FieldApi.ts:1129](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1129)
[packages/form-core/src/FieldApi.ts:1085](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1085)
***
Expand All @@ -460,7 +460,7 @@ Sets the field metadata.
#### Defined in
[packages/form-core/src/FieldApi.ts:751](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L751)
[packages/form-core/src/FieldApi.ts:707](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L707)
***
Expand Down Expand Up @@ -488,7 +488,7 @@ Sets the field value and run the `change` validator.
#### Defined in
[packages/form-core/src/FieldApi.ts:716](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L716)
[packages/form-core/src/FieldApi.ts:672](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L672)
***
Expand Down Expand Up @@ -523,7 +523,7 @@ Swaps the values at the specified indices.
#### Defined in
[packages/form-core/src/FieldApi.ts:794](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L794)
[packages/form-core/src/FieldApi.ts:750](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L750)
***
Expand All @@ -547,7 +547,7 @@ Updates the field instance with new options.
#### Defined in
[packages/form-core/src/FieldApi.ts:672](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L672)
[packages/form-core/src/FieldApi.ts:628](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L628)
***
Expand All @@ -571,4 +571,4 @@ Validates the field value.
#### Defined in
[packages/form-core/src/FieldApi.ts:1074](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1074)
[packages/form-core/src/FieldApi.ts:1030](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1030)
6 changes: 3 additions & 3 deletions docs/reference/functions/isstandardschemavalidator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: isStandardSchemaValidator
# Function: isStandardSchemaValidator()

```ts
function isStandardSchemaValidator(validator): validator is StandardSchemaV1
function isStandardSchemaValidator(validator): validator is StandardSchemaV1<unknown, unknown>
```

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

## Returns

`validator is StandardSchemaV1`
`validator is StandardSchemaV1<unknown, unknown>`

## Defined in

[packages/form-core/src/standardSchemaValidator.ts:87](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L87)
[packages/form-core/src/standardSchemaValidator.ts:86](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L86)
6 changes: 3 additions & 3 deletions docs/reference/functions/standardschemavalidator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: standardSchemaValidator
# Function: standardSchemaValidator()

```ts
function standardSchemaValidator(params): Validator<unknown, StandardSchemaV1>
function standardSchemaValidator(params): Validator<unknown, StandardSchemaV1<any, any>>
```

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

## Returns

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

## Defined in

[packages/form-core/src/standardSchemaValidator.ts:49](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L49)
[packages/form-core/src/standardSchemaValidator.ts:48](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L48)
1 change: 1 addition & 0 deletions docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ title: "@tanstack/form-core"
- [FormState](type-aliases/formstate.md)
- [FormValidateFn](type-aliases/formvalidatefn.md)
- [FormValidator](type-aliases/formvalidator.md)
- [StandardSchemaV1](type-aliases/standardschemav1.md)
- [Updater](type-aliases/updater.md)
- [UpdaterFn](type-aliases/updaterfn.md)
- [ValidationError](type-aliases/validationerror.md)
Expand Down
18 changes: 9 additions & 9 deletions docs/reference/interfaces/fieldapioptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If `true`, always run async validation, even if there are errors emitted during

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

[packages/form-core/src/FieldApi.ts:363](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L363)
[packages/form-core/src/FieldApi.ts:319](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L319)
8 changes: 4 additions & 4 deletions docs/reference/interfaces/fieldlisteners.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ optional onBlur: FieldListenerFn<TParentData, TName, TFieldValidator, TFormValid

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

***

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

#### Defined in

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

0 comments on commit 4503caf

Please sign in to comment.