Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deps): Update dependencies 2024.01.21 #38

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
cache: yarn
- run: yarn install --immutable
- run: yarn docs
- uses: tj-actions/verify-changed-files@v16
- uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
with:
files: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.3.0
21.6.0
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
"turbo": "turbo"
},
"devDependencies": {
"@types/node": "^20.10.3",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"eslint": "^8.55.0",
"@types/node": "^20.11.5",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-etc": "^2.0.3",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^46.9.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.0.2",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-sonarjs": "^0.23.0",
"semantic-release": "^22.0.8",
"ts-node": "^10.9.1",
"semantic-release": "^23.0.0",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"turbo": "^1.10.16",
"typedoc": "^0.25.4",
"turbo": "^1.11.3",
"typedoc": "^0.25.7",
"typedoc-plugin-markdown": "^3.17.1",
"typedoc-plugin-merge-modules": "^5.1.0",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
}
}
20 changes: 10 additions & 10 deletions packages/core/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@

Ƭ **ArrayFieldOf**\<`T`\>: \<K\>(`props`: [`ArrayFieldProps`](interfaces/ArrayFieldProps.md)\<`T`, `K`\>) => `ReactNode`

Helper type to describe an [ArrayField](README.md#arrayfield) component of an specific
struct `T`.

#### Type parameters

| Name | Type | Description |
Expand All @@ -61,9 +64,6 @@

▸ \<`K`\>(`props`): `ReactNode`

Helper type to describe an [ArrayField](README.md#arrayfield) component of an specific
struct `T`.

##### Type parameters

| Name | Type |
Expand Down Expand Up @@ -109,6 +109,9 @@ ___

Ƭ **ChangeCallback**\<`T`, `K`, `A`\>: (...`args`: `A`) => [`Optional`](README.md#optional)\<[`ValueByPath`](README.md#valuebypath)\<`T`, `K`\>\>

Generic callback function. Infers the arguments types and the return type is
resolved from the path type.

#### Type parameters

| Name | Type | Description |
Expand All @@ -121,9 +124,6 @@ ___

▸ (`...args`): [`Optional`](README.md#optional)\<[`ValueByPath`](README.md#valuebypath)\<`T`, `K`\>\>

Generic callback function. Infers the arguments types and the return type is
resolved from the path type.

##### Parameters

| Name | Type |
Expand Down Expand Up @@ -163,6 +163,8 @@ ___

Ƭ **FieldOf**\<`T`\>: \<K, D\>(`props`: [`FieldProps`](interfaces/FieldProps.md)\<`T`, `K`, `D`\>) => `ReactNode`

Helper type to describe a [Field](README.md#field) component of an specific struct `T`.

#### Type parameters

| Name | Type | Description |
Expand All @@ -173,8 +175,6 @@ ___

▸ \<`K`, `D`\>(`props`): `ReactNode`

Helper type to describe a [Field](README.md#field) component of an specific struct `T`.

##### Type parameters

| Name | Type |
Expand Down Expand Up @@ -259,6 +259,8 @@ ___

Ƭ **SetValue**\<`V`\>: (`action`: `SetStateAction`\<[`Optional`](README.md#optional)\<`V`\>\>) => `void`

Function that receives an action to set a value of `V` and retunrs void.

#### Type parameters

| Name | Description |
Expand All @@ -269,8 +271,6 @@ ___

▸ (`action`): `void`

Function that receives an action to set a value of `V` and retunrs void.

##### Parameters

| Name | Type |
Expand Down
34 changes: 34 additions & 0 deletions packages/core/docs/interfaces/Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ form validations and their hooks.

• **required**: (`path`: [`Path`](../README.md#path)\<`T`\>) => `boolean`

Should return `true` if the field in the `path` is required in the
validation schema. I.e., whenever the field cannot be `null`,
`undefined`, non-empty, etc.

**`Param`**

the path to check if it's requried

#### Type declaration

▸ (`path`): `boolean`
Expand Down Expand Up @@ -55,6 +63,17 @@ ___

• **validate**: (`values`: `Partial`\<`T`\>) => `Promise`\<[`Result`](../README.md#result)\<`T`, `Map`\<[`Path`](../README.md#path)\<`T`\>, `string`\>\>\>

Should return a promise containing the `Result<S, E>` of the validation.
Where `S` represents the success and `E` the error.

If the validation success, the promise should resolve to the form values.
Otherwise, if the validation fails, the promise should resolve to a
`Map<Path<T>, string>` of the path/message for the invalid fields.

**`Param`**

the form values to validate

#### Type declaration

▸ (`values`): `Promise`\<[`Result`](../README.md#result)\<`T`, `Map`\<[`Path`](../README.md#path)\<`T`\>, `string`\>\>\>
Expand Down Expand Up @@ -88,6 +107,21 @@ ___

• **validateAt**: \<K\>(`path`: `K`, `value`: [`Optional`](../README.md#optional)\<[`ValueByPath`](../README.md#valuebypath)\<`T`, `K`\>\>) => `Promise`\<[`Result`](../README.md#result)\<``true``, `string`\>\>

Should return a promise containing the `Result<S, E>` of the field
validation. Where `S` represents the success and `E` the error.

If the validation success, the promise should resolve to a simple `true`.
Otherwise, if the validation fails, the promise should resolve to a
`Map<Path<T>, string>` of the path/message for the invalid fields.

**`Param`**

the path on the schema to validate

**`Param`**

the value to validate against

#### Type declaration

▸ \<`K`\>(`path`, `value`): `Promise`\<[`Result`](../README.md#result)\<``true``, `string`\>\>
Expand Down
7 changes: 7 additions & 0 deletions packages/core/docs/interfaces/ArrayFieldProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ The props of the [ArrayField](../README.md#arrayfield) component.

• **children**: (`props`: [`UseArrayField`](UseArrayField.md)\<[`ArrayValue`](../README.md#arrayvalue)\<`T`, `K`\>\>) => `ReactNode`

The children is a function which takes the result of [useArrayField](../README.md#usearrayfield)
hook in the first argument and returns a React.js node.

**`Param`**

render props same as the `useArrayField` hook result

#### Type declaration

▸ (`props`): `ReactNode`
Expand Down
8 changes: 8 additions & 0 deletions packages/core/docs/interfaces/FieldProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ The props of the [ArrayField](../README.md#arrayfield) component.

• **children**: (`props`: [`FieldRenderProps`](FieldRenderProps.md)\<`T`, `K`, `D`\>) => `ReactNode`

The children is a function which takes the result of [useField](../README.md#usefield) and
[useFieldValidation](../README.md#usefieldvalidation) hooks in the first argument and returns a
React.js node.

**`Param`**

the render props same as `useField` result

#### Type declaration

▸ (`props`): `ReactNode`
Expand Down
9 changes: 9 additions & 0 deletions packages/core/docs/interfaces/FieldRenderProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ ___

• **handleChange**: \<A\>(`mapper`: (...`args`: `A`) => [`ValueByPath`](../README.md#valuebypath)\<`T`, `K`\> \| `D`) => (...`args`: `A`) => `void`

Helper function that creates a handler function which runs the field
setter with the value obtaioed by the `mapper`.

**`Param`**

a function to map the callback arguments to the next value

#### Type declaration

▸ \<`A`\>(`mapper`): (...`args`: `A`) => `void`
Expand Down Expand Up @@ -116,6 +123,8 @@ ___

• **setTouched**: () => `void`

Changes the touched state of the field to `true`

#### Type declaration

▸ (): `void`
Expand Down
2 changes: 2 additions & 0 deletions packages/core/docs/interfaces/FormCtxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ ___

• **submit**: () => `void`

Submits the form when called.

#### Type declaration

▸ (): `void`
Expand Down
6 changes: 6 additions & 0 deletions packages/core/docs/interfaces/FormProviderProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ ___

• **onSubmit**: (`values`: `T`) => `void`

The function to be called uppon form submision.

**`Param`**

the validated values `T` of the form

#### Type declaration

▸ (`values`): `void`
Expand Down
43 changes: 43 additions & 0 deletions packages/core/docs/interfaces/RenderProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ The renders props when the children of [FormProvider](../README.md#formprovider)

• **handleChange**: \<K, A\>(`path`: `K`, `valueOrCallback`: [`Optional`](../README.md#optional)\<[`ValueByPath`](../README.md#valuebypath)\<`T`, `K`\>\> \| [`ChangeCallback`](../README.md#changecallback)\<`T`, `K`, `A`\>) => (...`args`: `A`) => `void`

Helper function which creates a handler to use on callback props and
change form values. It infers the arguments of the callback so they can be
used dreing the change callback.

**`Example`**

```
<Input<Foo>
name="foo"
onChange={handleChange("foo", event => event.target.value)}
value={values.foo}
/>
```

**`Param`**

the path to change the value

**`Param`**

either a value or a callback to change it

#### Type declaration

▸ \<`K`, `A`\>(`path`, `valueOrCallback`): (...`args`: `A`) => `void`
Expand Down Expand Up @@ -86,6 +108,25 @@ ___

• **setValue**: \<K\>(`path`: `K`) => [`SetValue`](../README.md#setvalue)\<[`ValueByPath`](../README.md#valuebypath)\<`T`, `K`\>\>

Helper function which creates a setter function for the specified path.

**`Example`**

```
<Input<Foo>
name="foo"
onChange={event => {
const setFoo = setValue("foo");
setFoo(event.target.value);
}}
value={values.foo}
/>
```

**`Param`**

the path to change the value

#### Type declaration

▸ \<`K`\>(`path`): [`SetValue`](../README.md#setvalue)\<[`ValueByPath`](../README.md#valuebypath)\<`T`, `K`\>\>
Expand Down Expand Up @@ -133,6 +174,8 @@ ___

• **submit**: () => `void`

Helper function that triggers the form submit on demand.

#### Type declaration

▸ (): `void`
Expand Down
Loading