@faststore/core 3.0.123 → 3.0.124

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.
Files changed (41) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/server-production/0.pack +0 -0
  9. package/.next/cache/webpack/server-production/index.pack +0 -0
  10. package/.next/next-minimal-server.js.nft.json +1 -1
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.js +1 -1
  13. package/.next/prerender-manifest.json +1 -1
  14. package/.next/routes-manifest.json +1 -1
  15. package/.next/server/chunks/350.js +1 -1
  16. package/.next/server/middleware-build-manifest.js +1 -1
  17. package/.next/server/pages/[...slug].js +1 -1
  18. package/.next/server/pages/[slug]/p.js +1 -1
  19. package/.next/server/pages/api/graphql.js +1 -1
  20. package/.next/server/pages/en-US/404.html +1 -1
  21. package/.next/server/pages/en-US/404.json +1 -1
  22. package/.next/server/pages/en-US/500.html +1 -1
  23. package/.next/server/pages/en-US/500.json +1 -1
  24. package/.next/server/pages/en-US/account.html +1 -1
  25. package/.next/server/pages/en-US/account.json +1 -1
  26. package/.next/server/pages/en-US/checkout.html +1 -1
  27. package/.next/server/pages/en-US/checkout.json +1 -1
  28. package/.next/server/pages/en-US/login.html +1 -1
  29. package/.next/server/pages/en-US/login.json +1 -1
  30. package/.next/server/pages/en-US/s.html +1 -1
  31. package/.next/server/pages/en-US/s.json +1 -1
  32. package/.next/server/pages/en-US.html +2 -2
  33. package/.next/server/pages/en-US.json +1 -1
  34. package/.next/server/pages-manifest.json +1 -1
  35. package/.next/trace +94 -95
  36. package/.turbo/turbo-test.log +4 -4
  37. package/package.json +7 -7
  38. package/src/server/index.ts +12 -9
  39. package/test/server/index.test.ts +1 -1
  40. /package/.next/static/{cHSVFirNh-jXHWysm2nDk → grPwLOmkT3DJ4tOETBtzb}/_buildManifest.js +0 -0
  41. /package/.next/static/{cHSVFirNh-jXHWysm2nDk → grPwLOmkT3DJ4tOETBtzb}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
1
  $ jest
2
- PASS test/utils/multipleTemplates.test.ts (35.481 s)
3
- PASS test/server/cms/index.test.ts (36.01 s)
4
- PASS test/server/index.test.ts (39.406 s)
2
+ PASS test/server/cms/index.test.ts (35.355 s)
3
+ PASS test/utils/multipleTemplates.test.ts (36.11 s)
4
+ PASS test/server/index.test.ts (40.2 s)
5
5
 
6
6
  Test Suites: 3 passed, 3 total
7
7
  Tests: 19 passed, 19 total
8
8
  Snapshots: 0 total
9
- Time: 40.597 s
9
+ Time: 41.139 s
10
10
  Ran all test suites.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.0.123",
3
+ "version": "3.0.124",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -39,11 +39,11 @@
39
39
  "dependencies": {
40
40
  "@antfu/ni": "^0.21.12",
41
41
  "@builder.io/partytown": "^0.6.1",
42
- "@envelop/core": "^1.2.0",
43
- "@envelop/graphql-jit": "^1.1.1",
44
- "@envelop/parser-cache": "^2.2.0",
45
- "@envelop/validation-cache": "^2.2.0",
46
- "@faststore/api": "^3.0.122",
42
+ "@envelop/core": "^3.0.0",
43
+ "@envelop/graphql-jit": "^3.0.0",
44
+ "@envelop/parser-cache": "^3.0.0",
45
+ "@envelop/validation-cache": "^3.0.0",
46
+ "@faststore/api": "^3.0.124",
47
47
  "@faststore/components": "^3.0.116",
48
48
  "@faststore/graphql-utils": "^3.0.116",
49
49
  "@faststore/lighthouse": "^3.0.116",
@@ -128,5 +128,5 @@
128
128
  "node": "18.19.0",
129
129
  "yarn": "1.19.1"
130
130
  },
131
- "gitHead": "0aa8ed03a8483fae7cea3948d6fc0cc9656b7d76"
131
+ "gitHead": "0d1c7d8b773cdf7c0583df30ab7d070f1cd17f85"
132
132
  }
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
- import path from 'path'
3
- import type { FormatErrorHandler } from '@envelop/core'
4
2
  import {
5
3
  envelop,
6
- useSchema,
4
+ MaskError,
5
+ useEngine,
7
6
  useExtendContext,
8
7
  useMaskedErrors,
8
+ useSchema,
9
9
  } from '@envelop/core'
10
10
  import { useGraphQlJit } from '@envelop/graphql-jit'
11
11
  import { useParserCache } from '@envelop/parser-cache'
@@ -16,18 +16,20 @@ import {
16
16
  getResolvers,
17
17
  isFastStoreError,
18
18
  } from '@faststore/api'
19
- import { GraphQLError } from 'graphql'
20
- import { makeExecutableSchema } from '@graphql-tools/schema'
21
19
  import { loadFilesSync } from '@graphql-tools/load-files'
20
+ import { makeExecutableSchema } from '@graphql-tools/schema'
22
21
  import type { TypeSource } from '@graphql-tools/utils'
22
+ import * as GraphQLJS from 'graphql'
23
+ import { GraphQLError } from 'graphql'
24
+ import path from 'path'
23
25
 
24
26
  import persisted from '@generated/persisted-documents.json'
25
27
 
26
- import vtexExtensionsResolvers from '../customizations/src/graphql/vtex/resolvers'
27
28
  import thirdPartyResolvers from '../customizations/src/graphql/thirdParty/resolvers'
29
+ import vtexExtensionsResolvers from '../customizations/src/graphql/vtex/resolvers'
28
30
 
29
- import { apiOptions } from './options'
30
31
  import { Operation } from '../sdk/graphql/request'
32
+ import { apiOptions } from './options'
31
33
 
32
34
  interface ExecuteOptions<V = Record<string, unknown>> {
33
35
  operation: Operation
@@ -39,7 +41,7 @@ const persistedQueries = new Map(Object.entries(persisted))
39
41
 
40
42
  const apiContextFactory = getContextFactory(apiOptions)
41
43
 
42
- const formatError: FormatErrorHandler = (err) => {
44
+ const customFormatError: MaskError = (err) => {
43
45
  if (err instanceof GraphQLError && isFastStoreError(err.originalError)) {
44
46
  return err
45
47
  }
@@ -68,9 +70,10 @@ function getFinalAPISchema() {
68
70
  export const getEnvelop = async () =>
69
71
  envelop({
70
72
  plugins: [
73
+ useEngine(GraphQLJS),
71
74
  useSchema(getFinalAPISchema()),
72
75
  useExtendContext(apiContextFactory),
73
- useMaskedErrors({ formatError }),
76
+ useMaskedErrors({ maskError: customFormatError }),
74
77
  useGraphQlJit(),
75
78
  useValidationCache(),
76
79
  useParserCache(),
@@ -132,7 +132,7 @@ describe('FastStore GraphQL Layer', () => {
132
132
  it('should exist with its plugins', async () => {
133
133
  const envelop = await getEnvelop()
134
134
  expect(envelop).toBeDefined()
135
- expect(envelop._plugins).toHaveLength(6)
135
+ expect(envelop._plugins).toHaveLength(7)
136
136
  })
137
137
 
138
138
  it('should handle options and execute', async () => {