@graphcommerce/react-hook-form 3.1.0 → 3.1.3
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1451](https://github.com/graphcommerce-org/graphcommerce/pull/1451) [`50188e378`](https://github.com/graphcommerce-org/graphcommerce/commit/50188e378b4c77561ebc600958ea11cd114fa61a) Thanks [@paales](https://github.com/paales)! - Loosen node requirement
|
|
8
|
+
|
|
9
|
+
## 3.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1426](https://github.com/graphcommerce-org/graphcommerce/pull/1426) [`100f4c38c`](https://github.com/graphcommerce-org/graphcommerce/commit/100f4c38c8fcda4bc6e0425e38028b550b60adc2) Thanks [@paales](https://github.com/paales)! - Upgrade packages
|
|
14
|
+
|
|
15
|
+
## 3.1.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Now using [@graphql-yoga](https://github.com/dotansimha/graphql-yoga) for GraphQL which has full support for [envelop](https://www.envelop.dev/) plugins.
|
|
20
|
+
|
|
21
|
+
* [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Added a new @graphcommerce/cli package to generate the mesh so it can be generated _inside_ the @graphcommerce/graphql-mesh package to allow for better future extensibility.
|
|
22
|
+
|
|
23
|
+
- [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4) Thanks [@paales](https://github.com/paales)! - Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 3.1.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
"name": "@graphcommerce/react-hook-form",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.3",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": "14.x"
|
|
9
|
-
},
|
|
10
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
11
8
|
"eslintConfig": {
|
|
12
9
|
"extends": "@graphcommerce/eslint-config-pwa",
|
|
@@ -15,16 +12,16 @@
|
|
|
15
12
|
}
|
|
16
13
|
},
|
|
17
14
|
"devDependencies": {
|
|
18
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
19
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
20
|
-
"@graphcommerce/typescript-config-pwa": "^4.0.
|
|
21
|
-
"@playwright/test": "^1.
|
|
22
|
-
"type-fest": "2.12.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.7",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "^4.0.3",
|
|
18
|
+
"@playwright/test": "^1.21.1",
|
|
19
|
+
"type-fest": "^2.12.2"
|
|
23
20
|
},
|
|
24
21
|
"dependencies": {
|
|
25
|
-
"@apollo/client": "^3.
|
|
26
|
-
"graphql": "
|
|
27
|
-
"react-hook-form": "7.
|
|
22
|
+
"@apollo/client": "^3.6.0",
|
|
23
|
+
"graphql": "16.4.0",
|
|
24
|
+
"react-hook-form": "7.30.0"
|
|
28
25
|
},
|
|
29
26
|
"peerDependencies": {
|
|
30
27
|
"react": "^17.0.2",
|
|
@@ -58,6 +58,7 @@ export function ComposedSubmit(props: ComposedSubmitProps) {
|
|
|
58
58
|
let formsToProcess = formEntries
|
|
59
59
|
if (invalidKeys.length === 0) {
|
|
60
60
|
if (process.env.NODE_ENV !== 'production') {
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
61
62
|
console.log(
|
|
62
63
|
'[ComposedForm] All forms are valid, submitting...',
|
|
63
64
|
formsToProcess.map(([, { key }]) => key),
|
|
@@ -66,6 +67,7 @@ export function ComposedSubmit(props: ComposedSubmitProps) {
|
|
|
66
67
|
} else {
|
|
67
68
|
formsToProcess = formEntries.filter(([, { key }]) => invalidKeys.includes(key))
|
|
68
69
|
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
+
// eslint-disable-next-line no-console
|
|
69
71
|
console.log(
|
|
70
72
|
'[ComposedForm] Found invalid forms, triggering error messages by submitting...',
|
|
71
73
|
Object.fromEntries(
|
|
@@ -88,6 +90,7 @@ export function ComposedSubmit(props: ComposedSubmitProps) {
|
|
|
88
90
|
*/
|
|
89
91
|
for (const [, { submit, key }] of formsToProcess) {
|
|
90
92
|
try {
|
|
93
|
+
// eslint-disable-next-line no-console
|
|
91
94
|
console.log(`[ComposedForm] Submitting ${key}`)
|
|
92
95
|
// eslint-disable-next-line no-await-in-loop
|
|
93
96
|
await submit?.()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApolloError } from '@apollo/client'
|
|
2
|
-
import { FieldValues, FormState, UseFormReturn } from 'react-hook-form'
|
|
3
|
-
import { SetOptional } from 'type-fest'
|
|
2
|
+
import type { FieldValues, FormState, UseFormReturn } from 'react-hook-form'
|
|
3
|
+
import type { SetOptional } from 'type-fest'
|
|
4
4
|
|
|
5
5
|
export type UseFormComposeOptions<V extends FieldValues = FieldValues> = {
|
|
6
6
|
/** The form that is used to submit */
|
package/src/useFormPersist.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { persistCache } from '@graphcommerce/graphql'
|
|
2
1
|
import { useEffect } from 'react'
|
|
3
2
|
import {
|
|
4
3
|
FieldValues,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
|
|
12
11
|
export type UseFormPersistOptions<
|
|
13
12
|
TFieldValues extends FieldValues = FieldValues,
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
14
|
TContext = any,
|
|
15
15
|
> = {
|
|
16
16
|
/** Instance of current form, used to watch value */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypedDocumentNode } from '@apollo/client'
|
|
1
|
+
import type { TypedDocumentNode } from '@apollo/client'
|
|
2
2
|
import {
|
|
3
3
|
DefinitionNode,
|
|
4
4
|
OperationDefinitionNode,
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
OperationTypeNode,
|
|
13
13
|
} from 'graphql'
|
|
14
14
|
import { useMemo } from 'react'
|
|
15
|
-
import { FieldValues } from 'react-hook-form'
|
|
16
|
-
import { LiteralUnion } from 'type-fest'
|
|
15
|
+
import type { FieldValues } from 'react-hook-form'
|
|
16
|
+
import type { LiteralUnion } from 'type-fest'
|
|
17
17
|
|
|
18
18
|
type Scalars = {
|
|
19
19
|
ID: string
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useLazyQuery,
|
|
8
8
|
} from '@apollo/client'
|
|
9
9
|
import { useEffect, useRef } from 'react'
|
|
10
|
-
import { Promisable } from 'type-fest'
|
|
10
|
+
import type { Promisable } from 'type-fest'
|
|
11
11
|
|
|
12
12
|
export type LazyQueryTuple<Q, V> = [
|
|
13
13
|
(options?: QueryLazyOptions<V>) => Promisable<LazyQueryResult<Q, V>>,
|