@faststore/core 2.2.33 → 2.2.35

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 (35) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +4 -4
  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/next-server.js.nft.json +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.json +1 -1
  13. package/.next/routes-manifest.json +1 -1
  14. package/.next/server/chunks/350.js +1 -1
  15. package/.next/server/chunks/732.js +1 -1
  16. package/.next/server/middleware-build-manifest.js +1 -1
  17. package/.next/server/pages/_document.js +8 -10
  18. package/.next/server/pages/api/graphql.js +1 -1
  19. package/.next/server/pages/en-US/404.html +4 -4
  20. package/.next/server/pages/en-US/500.html +4 -4
  21. package/.next/server/pages/en-US/account.html +4 -4
  22. package/.next/server/pages/en-US/checkout.html +4 -4
  23. package/.next/server/pages/en-US/login.html +4 -4
  24. package/.next/server/pages/en-US/s.html +4 -4
  25. package/.next/server/pages/en-US/s.json +1 -1
  26. package/.next/server/pages/en-US.html +4 -4
  27. package/.next/static/{JRq4v3MrJM0drwdq94NMb → IZNOnn5vp9kP41CzhMUhE}/_buildManifest.js +1 -1
  28. package/.next/static/chunks/{400-a09ccc622ec96daa.js → 400-8a0173291a21a213.js} +1 -1
  29. package/.next/trace +78 -78
  30. package/.turbo/turbo-build.log +1 -1
  31. package/.turbo/turbo-test.log +7 -7
  32. package/package.json +4 -4
  33. package/src/components/ThirdPartyScripts/GoogleTagManager.tsx +1 -1
  34. package/src/components/ThirdPartyScripts/ThirdPartyScripts.tsx +15 -9
  35. /package/.next/static/{JRq4v3MrJM0drwdq94NMb → IZNOnn5vp9kP41CzhMUhE}/_ssgManifest.js +0 -0
@@ -26,8 +26,8 @@ info - Generating static pages (1/7)
26
26
  warn - AlertSectionIcon not found. Add a new component for this section or remove it from the CMS
27
27
  info - Generating static pages (3/7)
28
28
  warn - AlertSectionIcon not found. Add a new component for this section or remove it from the CMS
29
- info - Generating static pages (5/7)
30
29
  warn - AlertSectionIcon not found. Add a new component for this section or remove it from the CMS
30
+ info - Generating static pages (5/7)
31
31
  warn - AlertSectionIcon not found. Add a new component for this section or remove it from the CMS
32
32
  info - Generating static pages (7/7)
33
33
  info - Finalizing page optimization...
@@ -1,25 +1,25 @@
1
1
  $ tsdx test
2
2
  ts-jest[versions] (WARN) Version 29.1.0 of jest installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=25.0.0 <26.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
3
3
  ts-jest[versions] (WARN) Version 4.9.4 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=3.4.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
4
- PASS test/server/index.test.ts (13.202s)
4
+ PASS test/server/index.test.ts (5.867s)
5
5
  FastStore GraphQL Layer
6
6
  @faststore/api
7
7
  ✓ should return a valid GraphQL schema (5ms)
8
- ✓ should return a valid GraphQL schema contain all expected types (8ms)
8
+ ✓ should return a valid GraphQL schema contain all expected types (4ms)
9
9
  ✓ should return a valid GraphQL schema contain all expected queries (1ms)
10
- ✓ should return a valid GraphQL schema contain all expected mutations (1ms)
10
+ ✓ should return a valid GraphQL schema contain all expected mutations
11
11
  VTEX API Extension
12
12
  ✓ getTypeDefsFromFolder function should return an Array (6ms)
13
13
  Third Party API Extension
14
14
  ✓ getTypeDefsFromFolder function should return an Array (5ms)
15
15
  Final Schema after merging
16
- ✓ should return a valid merged GraphQL schema (26ms)
16
+ ✓ should return a valid merged GraphQL schema (25ms)
17
17
  Envelop
18
- ✓ should exist with its plugins (24ms)
19
- ✓ should handle options and execute (506ms)
18
+ ✓ should exist with its plugins (28ms)
19
+ ✓ should handle options and execute (152ms)
20
20
 
21
21
  Test Suites: 1 passed, 1 total
22
22
  Tests: 9 passed, 9 total
23
23
  Snapshots: 0 total
24
- Time: 13.901s
24
+ Time: 6.297s
25
25
  Ran all test suites.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.2.33",
3
+ "version": "2.2.35",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "exports": {
@@ -36,10 +36,10 @@
36
36
  "@envelop/graphql-jit": "^1.1.1",
37
37
  "@envelop/parser-cache": "^2.2.0",
38
38
  "@envelop/validation-cache": "^2.2.0",
39
- "@faststore/api": "^2.2.33",
39
+ "@faststore/api": "^2.2.35",
40
40
  "@faststore/components": "^2.2.33",
41
41
  "@faststore/graphql-utils": "^2.2.33",
42
- "@faststore/sdk": "^2.2.33",
42
+ "@faststore/sdk": "^2.2.35",
43
43
  "@faststore/ui": "^2.2.33",
44
44
  "@graphql-codegen/cli": "^3.3.1",
45
45
  "@graphql-codegen/typescript": "^3.0.4",
@@ -118,5 +118,5 @@
118
118
  "msw": {
119
119
  "workerDirectory": "public"
120
120
  },
121
- "gitHead": "3ef3bacdc55e2a9719398e5920a564b231a86bc5"
121
+ "gitHead": "dbb59ea5a444b7b542481b6842ab8bc230ed9a94"
122
122
  }
@@ -3,7 +3,7 @@ interface Props {
3
3
  dataLayerName?: string
4
4
  }
5
5
 
6
- const GTM_DEBUG_QUERY_STRING = 'gtm_debug'
6
+ export const GTM_DEBUG_QUERY_STRING = 'gtm_debug'
7
7
 
8
8
  const useSnippet = (opts: Props & { partytownScript: boolean }) => `${
9
9
  opts.partytownScript ? '!' : ''
@@ -1,11 +1,9 @@
1
1
  import { Partytown } from '@builder.io/partytown/react'
2
2
  import OverrideComponents from 'src/customizations/src/GlobalOverrides'
3
3
  import storeConfig from '../../../faststore.config'
4
- import GoogleTagManager from './GoogleTagManager'
4
+ import GoogleTagManager, { GTM_DEBUG_QUERY_STRING } from './GoogleTagManager'
5
5
  import VTEX from './vtex'
6
6
 
7
- const isString = (obj: unknown): obj is string => typeof obj === 'string'
8
-
9
7
  const gtmContainerId = storeConfig.analytics?.gtmContainerId
10
8
 
11
9
  const includeGTM = typeof gtmContainerId === 'string'
@@ -20,18 +18,26 @@ if (process.env.NODE_ENV === 'development' && !includeGTM) {
20
18
  function ThirdPartyScripts() {
21
19
  const forwards = []
22
20
  if (includeVTEX) forwards.push('sendrc', 'vtexaf')
23
- if (includeGTM) forwards.push('dataLayer.push')
24
21
 
25
22
  return (
26
23
  <>
24
+ {/* We're setting the partytown config (forward property) dynamically based on the gtm_debug query string
25
+ * This helps users see the GTM events properly when using GTM preview. All it does is NOT forward dataLayer.push
26
+ * calls to partytown when the gtm_debug query string is present.
27
+ *
28
+ * This is not done in the component because the window var is not available yet.
29
+ */}
30
+ <script
31
+ dangerouslySetInnerHTML={{
32
+ __html: `var partytown={forward:[...${JSON.stringify(
33
+ forwards
34
+ )},!window.location.search.includes('${GTM_DEBUG_QUERY_STRING}=')&&${includeGTM}?'dataLayer.push':null].filter(Boolean)}`,
35
+ }}
36
+ />
27
37
  {includeGTM && <GoogleTagManager containerId={gtmContainerId} />}
28
38
  {includeVTEX && <VTEX />}
29
39
  <OverrideComponents.ThirdPartyScripts />
30
- <Partytown
31
- key="partytown"
32
- // Variables to forward to from main to worker
33
- forward={forwards}
34
- />
40
+ <Partytown key="partytown" />
35
41
  </>
36
42
  )
37
43
  }