@faststore/core 3.0.12 → 3.0.14

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 (42) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +11 -11
  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/640.js +1 -1
  16. package/.next/server/chunks/646.js +1 -1
  17. package/.next/server/functions-config-manifest.json +1 -1
  18. package/.next/server/middleware-build-manifest.js +1 -1
  19. package/.next/server/pages/500.js +1 -1
  20. package/.next/server/pages/en-US/404.html +2 -2
  21. package/.next/server/pages/en-US/500.html +2 -2
  22. package/.next/server/pages/en-US/account.html +2 -2
  23. package/.next/server/pages/en-US/checkout.html +2 -2
  24. package/.next/server/pages/en-US/login.html +2 -2
  25. package/.next/server/pages/en-US/s.html +2 -2
  26. package/.next/server/pages/en-US.html +2 -2
  27. package/.next/server/pages/en-US.json +1 -1
  28. package/.next/server/pages-manifest.json +1 -1
  29. package/.next/static/{YyyfSkn4MlzCeIY09phdk → OJ8d-uEqYHb0KXVz0Trnt}/_buildManifest.js +1 -1
  30. package/.next/static/chunks/{104-38e7af864df976a8.js → 104-35697aed442af6cd.js} +1 -1
  31. package/.next/trace +91 -91
  32. package/.turbo/turbo-build.log +3 -1
  33. package/.turbo/turbo-test.log +10 -10
  34. package/package.json +4 -4
  35. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +1 -1
  36. package/src/sdk/graphql/prefetchQuery.ts +2 -3
  37. package/src/sdk/graphql/request.ts +3 -2
  38. package/src/sdk/graphql/useLazyQuery.ts +2 -3
  39. package/src/sdk/graphql/useQuery.ts +2 -3
  40. package/src/server/index.ts +2 -2
  41. package/tsconfig.json +2 -0
  42. /package/.next/static/{YyyfSkn4MlzCeIY09phdk → OJ8d-uEqYHb0KXVz0Trnt}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
1
  $ yarn partytown & yarn generate && next build
2
+ $ faststore generate-graphql -c
2
3
  $ partytown copylib ./public/~partytown
3
4
  Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
4
- $ faststore generate-graphql -c
5
5
  success - GraphQL schema, types, and optimizations successfully generated 🎉
6
6
  ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
7
7
  Attention: Next.js now collects completely anonymous telemetry regarding usage.
@@ -27,6 +27,8 @@ Browserslist: caniuse-lite is outdated. Please run:
27
27
  Generating static pages (0/7) ...
28
28
 
29
29
  Generating static pages (1/7)
30
30
 
31
31
  Generating static pages (3/7)
32
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
33
+ warn - SimpleAlert not found. Add a new component for this section or remove it from the CMS
32
34
 
33
35
  Generating static pages (5/7)
34
36
 
35
37
  ✓ Generating static pages (7/7)
36
38
  Finalizing page optimization ...
@@ -1,23 +1,23 @@
1
1
  $ jest
2
- PASS test/server/index.test.ts (21.304 s)
2
+ PASS test/server/index.test.ts (20.679 s)
3
3
  FastStore GraphQL Layer
4
4
  @faststore/api
5
- ✓ should return a valid GraphQL schema (6 ms)
6
- ✓ should return a valid GraphQL schema contain all expected types (5 ms)
5
+ ✓ should return a valid GraphQL schema (8 ms)
6
+ ✓ should return a valid GraphQL schema contain all expected types (6 ms)
7
7
  ✓ should return a valid GraphQL schema contain all expected queries (1 ms)
8
- ✓ should return a valid GraphQL schema contain all expected mutations (1 ms)
8
+ ✓ should return a valid GraphQL schema contain all expected mutations
9
9
  VTEX API Extension
10
- ✓ getTypeDefsFromFolder function should return an Array (5 ms)
10
+ ✓ getTypeDefsFromFolder function should return an Array (21 ms)
11
11
  Third Party API Extension
12
- ✓ getTypeDefsFromFolder function should return an Array (4 ms)
12
+ ✓ getTypeDefsFromFolder function should return an Array (20 ms)
13
13
  Final Schema after merging
14
- ✓ should return a valid merged GraphQL schema (29 ms)
14
+ ✓ should return a valid merged GraphQL schema (49 ms)
15
15
  Envelop
16
- ✓ should exist with its plugins (32 ms)
17
- ✓ should handle options and execute (125 ms)
16
+ ✓ should exist with its plugins (40 ms)
17
+ ✓ should handle options and execute (180 ms)
18
18
 
19
19
  Test Suites: 1 passed, 1 total
20
20
  Tests: 9 passed, 9 total
21
21
  Snapshots: 0 total
22
- Time: 21.349 s
22
+ Time: 20.722 s
23
23
  Ran all test suites.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -41,7 +41,7 @@
41
41
  "@envelop/validation-cache": "^2.2.0",
42
42
  "@faststore/api": "^3.0.7",
43
43
  "@faststore/components": "^3.0.7",
44
- "@faststore/graphql-utils": "^3.0.7",
44
+ "@faststore/graphql-utils": "^3.0.13",
45
45
  "@faststore/sdk": "^3.0.7",
46
46
  "@faststore/ui": "^3.0.7",
47
47
  "@graphql-codegen/cli": "^3.3.1",
@@ -83,7 +83,7 @@
83
83
  "devDependencies": {
84
84
  "@cypress/code-coverage": "^3.12.1",
85
85
  "@envelop/testing": "^6.0.0",
86
- "@faststore/cli": "^3.0.7",
86
+ "@faststore/cli": "^3.0.13",
87
87
  "@faststore/eslint-config": "^3.0.7",
88
88
  "@faststore/lighthouse": "^1.12.32",
89
89
  "@lhci/cli": "^0.9.0",
@@ -128,5 +128,5 @@
128
128
  "node": "18.19.0",
129
129
  "yarn": "1.19.1"
130
130
  },
131
- "gitHead": "110cdfee8c6b8149f44606b7de82d5488ce90420"
131
+ "gitHead": "2cf5776a96f56a356ab958e4aa488ad239e54a62"
132
132
  }
@@ -49,7 +49,7 @@ function NavbarSlider({
49
49
  >
50
50
  <NavbarSliderHeader.Component
51
51
  onClose={fadeOut}
52
- {...NavbarSliderWrapper.props}
52
+ {...NavbarSliderHeader.props}
53
53
  >
54
54
  <Link
55
55
  data-fs-navbar-slider-logo
@@ -3,11 +3,10 @@ import type { Cache } from 'swr'
3
3
 
4
4
  import { request } from './request'
5
5
  import { getKey } from './useQuery'
6
- import type { RequestOptions } from './request'
7
- import { TypedDocumentString } from '@generated/graphql'
6
+ import type { Operation, RequestOptions } from './request'
8
7
 
9
8
  export const prefetchQuery = <Data, Variables = Record<string, unknown>>(
10
- operation: TypedDocumentString<any, any>,
9
+ operation: Operation,
11
10
  variables: Variables,
12
11
  { cache, ...options }: Partial<RequestOptions> & { cache: Cache }
13
12
  ) => {
@@ -1,6 +1,7 @@
1
1
  import { TypedDocumentString } from '@generated/graphql'
2
2
 
3
3
  export type RequestOptions = Omit<BaseRequestOptions, 'operation' | 'variables'>
4
+ export type Operation = Pick<TypedDocumentString<any, any>, '__meta__'>
4
5
 
5
6
  export interface GraphQLResponse<D = any> {
6
7
  data: D
@@ -8,7 +9,7 @@ export interface GraphQLResponse<D = any> {
8
9
  }
9
10
 
10
11
  export interface BaseRequestOptions<V = any> {
11
- operation: TypedDocumentString<any, any>
12
+ operation: Operation
12
13
  variables: V
13
14
  fetchOptions?: RequestInit
14
15
  }
@@ -20,7 +21,7 @@ const DEFAULT_HEADERS_BY_VERB: Record<string, Record<string, string>> = {
20
21
  }
21
22
 
22
23
  export const request = async <Query = unknown, Variables = unknown>(
23
- operation: TypedDocumentString<any, any>,
24
+ operation: Operation,
24
25
  variables: Variables,
25
26
  options?: RequestOptions
26
27
  ) => {
@@ -1,12 +1,11 @@
1
1
  import useSWR from 'swr'
2
2
 
3
- import { request } from './request'
3
+ import { type Operation, request } from './request'
4
4
  import { DEFAULT_OPTIONS, getKey } from './useQuery'
5
5
  import type { QueryOptions } from './useQuery'
6
- import { TypedDocumentString } from '@generated/graphql'
7
6
 
8
7
  export const useLazyQuery = <Data, Variables = Record<string, unknown>>(
9
- operation: TypedDocumentString<any, any>,
8
+ operation: Operation,
10
9
  variables: Variables,
11
10
  options?: QueryOptions
12
11
  ) => {
@@ -2,8 +2,7 @@ import useSWR from 'swr'
2
2
  import type { SWRConfiguration } from 'swr'
3
3
 
4
4
  import { request } from './request'
5
- import type { RequestOptions } from './request'
6
- import { TypedDocumentString } from '@generated/graphql'
5
+ import type { Operation, RequestOptions } from './request'
7
6
 
8
7
  export type QueryOptions = SWRConfiguration &
9
8
  RequestOptions & { doNotRun?: boolean }
@@ -23,7 +22,7 @@ export const DEFAULT_OPTIONS = {
23
22
  }
24
23
 
25
24
  export const useQuery = <Data, Variables = Record<string, unknown>>(
26
- operation: TypedDocumentString<any, any>,
25
+ operation: Operation,
27
26
  variables: Variables,
28
27
  options?: QueryOptions
29
28
  ) =>
@@ -27,10 +27,10 @@ import vtexExtensionsResolvers from '../customizations/src/graphql/vtex/resolver
27
27
  import thirdPartyResolvers from '../customizations/src/graphql/thirdParty/resolvers'
28
28
 
29
29
  import { apiOptions } from './options'
30
- import { TypedDocumentString } from '@generated/graphql'
30
+ import { Operation } from '../sdk/graphql/request'
31
31
 
32
32
  interface ExecuteOptions<V = Record<string, unknown>> {
33
- operation: Pick<TypedDocumentString<any, any>, '__meta__'>
33
+ operation: Operation
34
34
  variables: V
35
35
  query?: string | null
36
36
  }
package/tsconfig.json CHANGED
@@ -14,6 +14,8 @@
14
14
  "paths": {
15
15
  "src/*": ["src/*"],
16
16
  "@generated/*": ["@generated/*"],
17
+ "@faststore/core": ["index.ts"],
18
+ "@faststore/core/api": ["api/index.ts"],
17
19
  "@faststore/core/experimental": ["src/experimental/index.ts"]
18
20
  },
19
21
  "forceConsistentCasingInFileNames": true,