@faststore/core 3.0.122 → 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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/350.js +1 -1
- package/.next/server/chunks/371.js +1 -1
- package/.next/server/chunks/430.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/404.json +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/500.json +1 -1
- package/.next/server/pages/en-US/account.html +1 -1
- package/.next/server/pages/en-US/account.json +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/checkout.json +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/login.json +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US/s.json +1 -1
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/en-US.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/pages/{_app-1137bddee8be825f.js → _app-68b16ab75cae8271.js} +1 -1
- package/.next/trace +94 -95
- package/.turbo/turbo-build.log +8 -28
- package/.turbo/turbo-test.log +4 -4
- package/discovery.config.js +2 -15
- package/package.json +7 -7
- package/src/server/index.ts +12 -9
- package/test/server/index.test.ts +1 -1
- /package/.next/static/{L_uh5W_Q_OoxZnMAIsC5n → grPwLOmkT3DJ4tOETBtzb}/_buildManifest.js +0 -0
- /package/.next/static/{L_uh5W_Q_OoxZnMAIsC5n → grPwLOmkT3DJ4tOETBtzb}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -33,27 +33,7 @@ https://nextjs.org/telemetry
|
|
|
33
33
|
Creating an optimized production build ...
|
|
34
34
|
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc.js" https://nextjs.org/docs/messages/swc-disabled
|
|
35
35
|
Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
./discovery.config.js
|
|
39
|
-
Module not found: Can't resolve './src/customizations/faststore.config' in '/home/runner/work/faststore/faststore/packages/core'
|
|
40
|
-
|
|
41
|
-
Import trace for requested module:
|
|
42
|
-
./discovery.config.js
|
|
43
|
-
|
|
44
|
-
./discovery.config.js
|
|
45
|
-
Module not found: Can't resolve './src/customizations/faststore.config' in '/home/runner/work/faststore/faststore/packages/core'
|
|
46
|
-
|
|
47
|
-
Import trace for requested module:
|
|
48
|
-
./discovery.config.js
|
|
49
|
-
|
|
50
|
-
./discovery.config.js
|
|
51
|
-
Module not found: Can't resolve './src/customizations/faststore.config' in '/home/runner/work/faststore/faststore/packages/core'
|
|
52
|
-
|
|
53
|
-
Import trace for requested module:
|
|
54
|
-
./discovery.config.js
|
|
55
|
-
./src/pages/api/preview.ts
|
|
56
|
-
|
|
36
|
+
✓ Compiled successfully
|
|
57
37
|
Collecting page data ...
|
|
58
38
|
Generating static pages (0/7) ...
|
|
59
39
|
|
|
60
40
|
Generating static pages (1/7)
|
|
@@ -67,7 +47,7 @@ Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Cont
|
|
|
67
47
|
Route (pages) Size First Load JS
|
|
68
48
|
┌ ● / 1.24 kB 143 kB
|
|
69
49
|
├ └ css/197e314c5a03eabd.css 740 B
|
|
70
|
-
├ /_app 0 B 90.
|
|
50
|
+
├ /_app 0 B 90.7 kB
|
|
71
51
|
├ ● /[...slug] 2.79 kB 155 kB
|
|
72
52
|
├ └ css/e47f1a002bdcf76f.css 2.38 kB
|
|
73
53
|
├ ● /[slug]/p 10.8 kB 152 kB
|
|
@@ -75,17 +55,17 @@ Route (pages) Size First Load JS
|
|
|
75
55
|
├ ○ /404 1.28 kB 126 kB
|
|
76
56
|
├ ● /500 1.29 kB 126 kB
|
|
77
57
|
├ ● /account 676 B 126 kB
|
|
78
|
-
├ λ /api/graphql 0 B 90.
|
|
79
|
-
├ λ /api/health/live 0 B 90.
|
|
80
|
-
├ λ /api/health/ready 0 B 90.
|
|
81
|
-
├ λ /api/preview 0 B 90.
|
|
58
|
+
├ λ /api/graphql 0 B 90.7 kB
|
|
59
|
+
├ λ /api/health/live 0 B 90.7 kB
|
|
60
|
+
├ λ /api/health/ready 0 B 90.7 kB
|
|
61
|
+
├ λ /api/preview 0 B 90.7 kB
|
|
82
62
|
├ ● /checkout 661 B 126 kB
|
|
83
|
-
├ ● /login 1.4 kB
|
|
63
|
+
├ ● /login 1.4 kB 126 kB
|
|
84
64
|
└ ● /s 2.22 kB 154 kB
|
|
85
65
|
+ First Load JS shared by all 93.8 kB
|
|
86
66
|
├ chunks/framework-8e279965036b6169.js 45.4 kB
|
|
87
67
|
├ chunks/main-029f1328cfee9686.js 33.1 kB
|
|
88
|
-
├ chunks/pages/_app-
|
|
68
|
+
├ chunks/pages/_app-68b16ab75cae8271.js 9.87 kB
|
|
89
69
|
├ chunks/webpack-5b0bd69e10af14e4.js 2.38 kB
|
|
90
70
|
└ css/ee0556daedda6306.css 3.07 kB
|
|
91
71
|
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/
|
|
3
|
-
PASS test/
|
|
4
|
-
PASS test/server/index.test.ts (
|
|
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:
|
|
9
|
+
Time: 41.139 s
|
|
10
10
|
Ran all test suites.
|
package/discovery.config.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
const defaultConfig = require('./discovery.config.default')
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
let starterConfig
|
|
2
|
+
const starterConfig = require('./src/customizations/discovery.config')
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
starterConfig = require('./src/customizations/discovery.config')
|
|
8
|
-
} catch (e) {
|
|
9
|
-
try {
|
|
10
|
-
starterConfig = require('./src/customizations/faststore.config')
|
|
11
|
-
} catch (e) {
|
|
12
|
-
console.error(
|
|
13
|
-
"Failed to load './src/customizations/faststore.config'. Please ensure the file exists."
|
|
14
|
-
)
|
|
15
|
-
throw e // Re-throw the error after logging
|
|
16
|
-
}
|
|
17
|
-
}
|
|
4
|
+
const deepmerge = require('deepmerge')
|
|
18
5
|
|
|
19
6
|
/**
|
|
20
7
|
* @type {typeof defaultConfig & Record<string, any>}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.0.
|
|
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": "^
|
|
43
|
-
"@envelop/graphql-jit": "^
|
|
44
|
-
"@envelop/parser-cache": "^
|
|
45
|
-
"@envelop/validation-cache": "^
|
|
46
|
-
"@faststore/api": "^3.0.
|
|
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": "
|
|
131
|
+
"gitHead": "0d1c7d8b773cdf7c0583df30ab7d070f1cd17f85"
|
|
132
132
|
}
|
package/src/server/index.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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({
|
|
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(
|
|
135
|
+
expect(envelop._plugins).toHaveLength(7)
|
|
136
136
|
})
|
|
137
137
|
|
|
138
138
|
it('should handle options and execute', async () => {
|
|
File without changes
|
|
File without changes
|