@faststore/core 3.97.0-dev.0 → 3.97.0-dev.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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +21 -21
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- 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/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +7 -7
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/83.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/api/graphql.js +3 -3
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/{2927.23bae2c79f0ac0f3.js → 2927.5a79877943a6bf7c.js} +1 -1
- package/.next/static/chunks/{83.f765ce2ffc1915be.js → 83.98ce246c274ee7e4.js} +1 -1
- package/.next/static/chunks/{UIToast.de15325248043ce5.js → UIToast.19a8664c01a00d3a.js} +1 -1
- package/.next/static/chunks/{webpack-5ac0858ff0030797.js → webpack-c6f7dbc72e738310.js} +1 -1
- package/.next/trace +139 -139
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +18 -0
- package/package.json +2 -2
- package/src/components/search/Filter/FilterSlider.tsx +3 -1
- package/src/pages/api/graphql.ts +83 -18
- /package/.next/static/{Z0c2a1GLclZ_BFVFkwmK6 → TfWAwIRiLLmgPy8iyBQtG}/_buildManifest.js +0 -0
- /package/.next/static/{Z0c2a1GLclZ_BFVFkwmK6 → TfWAwIRiLLmgPy8iyBQtG}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.97.0-dev.0 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.97.0-dev.0 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.97.0-dev.0 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.97.0-dev.0 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.97.0-dev.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.97.0-dev.0 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.97.0-dev.0 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -58,7 +58,7 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
58
58
|
Creating an optimized production build ...
|
|
59
59
|
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc.js" https://nextjs.org/docs/messages/swc-disabled
|
|
60
60
|
Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
|
|
61
|
-
Browserslist: browsers data (caniuse-lite) is
|
|
61
|
+
Browserslist: browsers data (caniuse-lite) is 13 months old. Please run:
|
|
62
62
|
npx update-browserslist-db@latest
|
|
63
63
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
64
64
|
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/home/runner/work/faststore/faststore/node_modules/.pnpm/next@13.5.11_@babel+core@7.26.7_@opentelemetry+api@1.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.83.4/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[7].oneOf[9].use[1]!/home/runner/work/faststore/faststore/node_modules/.pnpm/next@13.5.11_@babel+core@7.26.7_@opentelemetry+api@1.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.83.4/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[7].oneOf[9].use[2]!/home/runner/work/faststore/faststore/node_modules/.pnpm/next@13.5.11_@babel+core@7.26.7_@opentelemetry+api@1.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.83.4/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[7].oneOf[9].use[3]!/home/runner/work/faststore/faststore/node_modules/.pnpm/next@13.5.11_@babel+core@7.26.7_@opentelemetry+api@1.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.83.4/node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[7].oneOf[9].use[4]!/home/runner/work/faststore/faststore/packages/core/src/components/common/Toast/section.module.scss': No serializer registered for Warning
|
|
@@ -124,7 +124,7 @@ Route (pages) Size First Load JS
|
|
|
124
124
|
├ chunks/framework-d514426edf885c68.js 45.4 kB
|
|
125
125
|
├ chunks/main-ec03882c4375091d.js 33.2 kB
|
|
126
126
|
├ chunks/pages/_app-dbee0add24c249fe.js 25.8 kB
|
|
127
|
-
├ chunks/webpack-
|
|
127
|
+
├ chunks/webpack-c6f7dbc72e738310.js 3.85 kB
|
|
128
128
|
└ css/0f070d03aacd9cc5.css 3.57 kB
|
|
129
129
|
|
|
130
130
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.97.0-dev.0 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/utils/multipleTemplates.test.ts (
|
|
6
|
-
PASS test/utils/clearCookies.test.ts (
|
|
5
|
+
PASS test/utils/multipleTemplates.test.ts (28.944 s)
|
|
6
|
+
PASS test/utils/clearCookies.test.ts (28.834 s)
|
|
7
7
|
PASS test/utils/cookieCacheBusting.test.ts
|
|
8
8
|
PASS test/server/cms/global.test.ts
|
|
9
9
|
PASS test/server/cms/index.test.ts
|
|
10
|
-
PASS test/server/index.test.ts (
|
|
10
|
+
PASS test/server/index.test.ts (33.061 s)
|
|
11
11
|
|
|
12
12
|
Test Suites: 6 passed, 6 total
|
|
13
13
|
Tests: 47 passed, 47 total
|
|
14
14
|
Snapshots: 0 total
|
|
15
|
-
Time:
|
|
15
|
+
Time: 34.431 s
|
|
16
16
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.97.0-dev.1](https://github.com/vtex/faststore/compare/v3.96.5...v3.97.0-dev.1) (2026-02-03)
|
|
7
|
+
|
|
8
|
+
# 3.97.0-dev.0 (2026-01-27)
|
|
9
|
+
|
|
10
|
+
**Note:** Version bump only for package @faststore/core
|
|
11
|
+
|
|
6
12
|
# [3.97.0-dev.0](https://github.com/vtex/faststore/compare/v3.96.4-dev.0...v3.97.0-dev.0) (2026-01-27)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
@@ -15,6 +21,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
15
21
|
|
|
16
22
|
**Note:** Version bump only for package @faststore/core
|
|
17
23
|
|
|
24
|
+
## [3.96.5](https://github.com/vtex/faststore/compare/v3.96.4...v3.96.5) (2026-02-02)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
- normalize set cookies domain host - SFS-3034 ([#3190](https://github.com/vtex/faststore/issues/3190)) ([645c91d](https://github.com/vtex/faststore/commit/645c91debeb16379f41aff6cb2225e2ed3b6086b))
|
|
29
|
+
|
|
30
|
+
## [3.96.4](https://github.com/vtex/faststore/compare/v3.96.3...v3.96.4) (2026-01-26)
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
- close filter on apply button click in FilterSlider component ([#3187](https://github.com/vtex/faststore/issues/3187)) ([f3c96eb](https://github.com/vtex/faststore/commit/f3c96eb5e73178d8c863a3e40ac576dc623a0624))
|
|
35
|
+
|
|
18
36
|
## [3.96.3](https://github.com/vtex/faststore/compare/v3.96.2...v3.96.3) (2026-01-21)
|
|
19
37
|
|
|
20
38
|
**Note:** Version bump only for package @faststore/core
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.97.0-dev.
|
|
3
|
+
"version": "3.97.0-dev.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"ts-jest": "29.1.1",
|
|
124
124
|
"typescript": "5.3.2"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "03c4793a9a9e2ffcf22cf5eb2820b8d17c5f1387"
|
|
127
127
|
}
|
|
@@ -97,7 +97,7 @@ function FilterSlider({
|
|
|
97
97
|
applyButtonLabel,
|
|
98
98
|
}: FilterSliderProps & ReturnType<typeof useFilter>) {
|
|
99
99
|
const { resetInfiniteScroll, setState, state } = useSearch()
|
|
100
|
-
const { openRegionSlider } = useUI()
|
|
100
|
+
const { closeFilter, openRegionSlider } = useUI()
|
|
101
101
|
|
|
102
102
|
const cmsData = getGlobalSettings()
|
|
103
103
|
const { deliveryPromise: deliveryPromiseSettings } = cmsData ?? {}
|
|
@@ -147,6 +147,8 @@ function FilterSlider({
|
|
|
147
147
|
: selected,
|
|
148
148
|
page: 0,
|
|
149
149
|
})
|
|
150
|
+
|
|
151
|
+
closeFilter()
|
|
150
152
|
},
|
|
151
153
|
children: applyButtonLabel ?? 'Apply',
|
|
152
154
|
}}
|
package/src/pages/api/graphql.ts
CHANGED
|
@@ -13,24 +13,91 @@ import { execute } from '../../server'
|
|
|
13
13
|
|
|
14
14
|
const DEFAULT_MAX_AGE = 5 * 60 // 5 minutes
|
|
15
15
|
const DEFAULT_STALE_WHILE_REVALIDATE = 60 * 60 // 1 hour
|
|
16
|
+
const ALLOWED_HOST_SUFFIXES = ['localhost', '.vtex.app', '.localhost']
|
|
17
|
+
|
|
18
|
+
// Example: "Set-Cookie: key=value; Domain=example.com; Path=/"
|
|
19
|
+
const MATCH_DOMAIN_REGEXP = /(?:^|;\s*)(?:domain=)([^;]+)/i
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @param request NextApiRequest
|
|
21
|
-
* @param setCookie setCookie string that comes from FastStore API
|
|
22
|
-
* @returns setCookie string with it domains replace
|
|
22
|
+
* Extracts hostname from the incoming request.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
const getRequestHostname = ({
|
|
25
|
+
request,
|
|
26
|
+
}: {
|
|
27
|
+
request: NextApiRequest
|
|
28
|
+
}): string | null => {
|
|
29
|
+
const hostHeader = request.headers.host?.trim()
|
|
30
|
+
if (!hostHeader) {
|
|
31
|
+
return null
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
return new URL(`https://${hostHeader}`).hostname
|
|
36
|
+
} catch {
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Checks whether the cookie domain should be replaced by host.
|
|
43
|
+
*/
|
|
44
|
+
const shouldReplaceCookieDomain = ({
|
|
45
|
+
cookieDomain,
|
|
46
|
+
host,
|
|
47
|
+
}: {
|
|
48
|
+
cookieDomain: string
|
|
49
|
+
host: string
|
|
50
|
+
}) => {
|
|
51
|
+
const normalizedDomain = cookieDomain.replace(/^\./, '').toLowerCase()
|
|
52
|
+
const normalizedHost = host.toLowerCase()
|
|
53
|
+
|
|
54
|
+
return normalizedDomain !== normalizedHost
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Determines if host is eligible for domain normalization.
|
|
59
|
+
*/
|
|
60
|
+
const isAllowedHost = ({
|
|
61
|
+
host,
|
|
62
|
+
allowList,
|
|
63
|
+
}: {
|
|
64
|
+
host: string
|
|
65
|
+
allowList: string[]
|
|
66
|
+
}) => {
|
|
67
|
+
const normalizedHost = host.toLowerCase()
|
|
68
|
+
|
|
69
|
+
return allowList.some((suffix) => normalizedHost.endsWith(suffix))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Ensure the cookie domain matches the current host so the browser can store it.
|
|
74
|
+
*/
|
|
75
|
+
const normalizeSetCookieDomain = ({
|
|
76
|
+
request,
|
|
77
|
+
setCookie,
|
|
78
|
+
}: {
|
|
79
|
+
request: NextApiRequest
|
|
80
|
+
setCookie: string
|
|
81
|
+
}) => {
|
|
82
|
+
const domainMatch = setCookie.match(MATCH_DOMAIN_REGEXP)
|
|
83
|
+
if (!domainMatch) {
|
|
84
|
+
return setCookie
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const host = getRequestHostname({ request })
|
|
88
|
+
if (!host) {
|
|
89
|
+
return setCookie
|
|
90
|
+
}
|
|
91
|
+
const cookieDomain = domainMatch[1]
|
|
92
|
+
|
|
93
|
+
if (
|
|
94
|
+
!isAllowedHost({ host, allowList: ALLOWED_HOST_SUFFIXES }) ||
|
|
95
|
+
!shouldReplaceCookieDomain({ cookieDomain, host })
|
|
96
|
+
) {
|
|
97
|
+
return setCookie
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return setCookie.replace(MATCH_DOMAIN_REGEXP, `; domain=${host}`)
|
|
34
101
|
}
|
|
35
102
|
|
|
36
103
|
const parseRequest = (request: NextApiRequest) => {
|
|
@@ -201,9 +268,7 @@ const handler: NextApiHandler = async (request, response) => {
|
|
|
201
268
|
response.setHeader(
|
|
202
269
|
'set-cookie',
|
|
203
270
|
setCookieValues.map(({ setCookie }) =>
|
|
204
|
-
|
|
205
|
-
? replaceSetCookieDomain(request, setCookie)
|
|
206
|
-
: setCookie
|
|
271
|
+
normalizeSetCookieDomain({ request, setCookie })
|
|
207
272
|
)
|
|
208
273
|
)
|
|
209
274
|
}
|
|
File without changes
|
|
File without changes
|