@graphcommerce/react-hook-form 3.1.0 → 3.1.1

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,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ * [#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.
10
+
11
+ - [#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
12
+
3
13
  ## 3.1.0
4
14
 
5
15
  ### Minor Changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
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.0",
5
+ "version": "3.1.1",
6
6
  "sideEffects": false,
7
7
  "engines": {
8
8
  "node": "14.x"
@@ -15,16 +15,16 @@
15
15
  }
16
16
  },
17
17
  "devDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^4.1.4",
19
- "@graphcommerce/prettier-config-pwa": "^4.0.5",
18
+ "@graphcommerce/eslint-config-pwa": "^4.1.5",
19
+ "@graphcommerce/prettier-config-pwa": "^4.0.6",
20
20
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
21
- "@playwright/test": "^1.20.1",
22
- "type-fest": "2.12.1"
21
+ "@playwright/test": "^1.21.1",
22
+ "type-fest": "^2.12.2"
23
23
  },
24
24
  "dependencies": {
25
25
  "@apollo/client": "^3.5.10",
26
- "graphql": "^16.3.0",
27
- "react-hook-form": "7.29.0"
26
+ "graphql": "16.3.0",
27
+ "react-hook-form": "7.30.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "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 */
@@ -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>>,