@akinon/next 1.86.0-rc.2 โ 1.86.0-rc.4
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/CHANGELOG.md +49 -0
- package/bin/run-prebuild-tests.js +46 -0
- package/data/client/api.ts +1 -0
- package/data/client/basket.ts +7 -45
- package/data/client/product.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.86.0-rc.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6f506afc: ZERO-3229: Implement mini basket query for basket total quantity
|
|
8
|
+
- 5dfeea04: ZERO-2801: Revert ZERO-2801
|
|
9
|
+
- ef75c03: ZERO-3267: Update error-page component to use ROUTES for link navigation
|
|
10
|
+
- 2d9b2b2c: ZERO-2816: Add segment to headers
|
|
11
|
+
- 5e1feca: Revert "ZERO-3286: Add notFound handling for chunk URLs starting with \_next"
|
|
12
|
+
- 40a46853: ZERO-3182: Optimize basket update mutation with optimistic update
|
|
13
|
+
- f49bb74f: ZERO-3097: Add setCookie to logging in payment redirection middlewares
|
|
14
|
+
- e4761d2: Refactor import statement for ROUTES in error-page component
|
|
15
|
+
- e9541a13: ZERO-2816: Add headers to url
|
|
16
|
+
- e2c6d42: ZERO-2935: Add @sentry/nextjs dependency to akinon-next and remove from projectzeronext
|
|
17
|
+
- 4d3deb4f: ZERO-2935: sentry 8 upgrade
|
|
18
|
+
- 72fd4d67: ZERO-3084: Fix URL search parameters encoding in default middleware
|
|
19
|
+
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
20
|
+
- c3f8d4a: ZERO-3274: Adjust button styles
|
|
21
|
+
- 64699d3f: ZERO-2761: Fix invalid import for plugin module
|
|
22
|
+
- 9abd011: ZERO-3267: Refactor error handling in ErrorPage component to set error details in Sentry scope
|
|
23
|
+
- 7727ae55: ZERO-3073: Refactor basket page to use server-side data fetching and simplify component structure
|
|
24
|
+
- d552629f: ZERO-3182: Refactor basketApi to use invalidatesTags and comment out onQueryStarted logic
|
|
25
|
+
- c3b2f3f: ZERO-3267: Enable sentry client errors and filter them by log type
|
|
26
|
+
- 17f87524: ZERO-2816: Make the incoming currency lowercase
|
|
27
|
+
- 70bc0ae: ZERO-3284: Set tracesSampleRate in Sentry configuration
|
|
28
|
+
- 65d3b862: ZERO-3054: Update headers in appFetch
|
|
29
|
+
- bbe18b9f: ZERO-2575: Fix build error
|
|
30
|
+
- 17bfadc: ZERO-3275: Disable OpenTelemetry monitoring in production environment
|
|
31
|
+
- 4920742c: Disable getCachedTranslations
|
|
32
|
+
- b6e5b624: ZERO-3257: Enhance locale middleware to redirect using existing or default locale and support 303 status for POST requests
|
|
33
|
+
- ac65ca9: ZERO-3269: Enhance locale handling by adding Subdomain strategy and updating related functions
|
|
34
|
+
- 7e56d6b6: ZERO-2841: Update api tagTypes
|
|
35
|
+
- 33377cf: ZERO-3267: Refactor import statement for ROUTES in error-page component
|
|
36
|
+
- 0cb3ec0: ZERO-3281: Remove prebuild tests script from pz-prebuild
|
|
37
|
+
- 43c182ee: ZERO-3054: Update Redis variable checks to conditionally include CACHE_SECRET
|
|
38
|
+
- 2d305aaf: ZERO-2935: Update Sentry configuration: remove hideSourceMaps option and add it to withPzConfig
|
|
39
|
+
- eeb20bea: Revert "ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing"
|
|
40
|
+
- 3bf63c8: ZERO-3286: Add notFound handling for chunk URLs starting with \_next
|
|
41
|
+
- 9be2c081: ZERO-3243: Improve basket update query handling with optimistic updates
|
|
42
|
+
- f2c92d5c: ZERO-2816: Update cookie name
|
|
43
|
+
- 2f3588f: ZERO-3287: Add user session handling in authentication flow
|
|
44
|
+
- e5529cd: ZERO-3267: Update error-page component to use root path for links instead of ROUTES
|
|
45
|
+
- 7bd3d992: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
46
|
+
- fdd255ee: ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing
|
|
47
|
+
- 49eeebfa: ZERO-2909: Add deleteCollectionItem query to wishlistApi
|
|
48
|
+
- 3f9b8d7e: ZERO-2761: Update plugins.js for akinon-next
|
|
49
|
+
|
|
50
|
+
## 1.86.0-rc.3
|
|
51
|
+
|
|
3
52
|
## 1.86.0-rc.2
|
|
4
53
|
|
|
5
54
|
### Minor Changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
|
|
4
|
+
function runPrebuildTests() {
|
|
5
|
+
const workspaceRoot = process.cwd()
|
|
6
|
+
const configPath = path.join(workspaceRoot, 'config/prebuild-tests.json')
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
|
10
|
+
|
|
11
|
+
if (config.tests && Array.isArray(config.tests)) {
|
|
12
|
+
for (const testScript of config.tests) {
|
|
13
|
+
console.log(`๐งช Running test script: ${testScript}`)
|
|
14
|
+
const result = require('child_process').spawnSync('yarn', [testScript], {
|
|
15
|
+
stdio: 'inherit',
|
|
16
|
+
shell: true
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
if (result.status !== 0) {
|
|
20
|
+
console.error(`โ Test script '${testScript}' failed`)
|
|
21
|
+
process.exit(1)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
console.log('โ
All prebuild tests passed successfully!')
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (error.code === 'ENOENT') {
|
|
28
|
+
console.log('๐งช Running default test: test:middleware')
|
|
29
|
+
const result = require('child_process').spawnSync('yarn', ['test:middleware'], {
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
shell: true
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
if (result.status !== 0) {
|
|
35
|
+
console.error('โ Middleware test failed')
|
|
36
|
+
process.exit(1)
|
|
37
|
+
}
|
|
38
|
+
console.log('โ
Default test passed successfully!')
|
|
39
|
+
} else {
|
|
40
|
+
console.error('โ Error reading test configuration:', error)
|
|
41
|
+
process.exit(1)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = runPrebuildTests
|
package/data/client/api.ts
CHANGED
package/data/client/basket.ts
CHANGED
|
@@ -32,7 +32,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
32
32
|
buildClientRequestUrl(basket.getMiniBasket, {
|
|
33
33
|
contentType: 'application/json'
|
|
34
34
|
}),
|
|
35
|
-
providesTags: ['
|
|
35
|
+
providesTags: ['MiniBasket']
|
|
36
36
|
}),
|
|
37
37
|
getMiniBasketDetail: build.query<
|
|
38
38
|
{ pk: number | null; total_quantity: number },
|
|
@@ -42,7 +42,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
42
42
|
buildClientRequestUrl(basket.getMiniBasketDetail(namespace), {
|
|
43
43
|
contentType: 'application/json'
|
|
44
44
|
}),
|
|
45
|
-
providesTags: ['
|
|
45
|
+
providesTags: ['MiniBasket']
|
|
46
46
|
}),
|
|
47
47
|
getBasketDetail: build.query<Basket, { namespace: string }>({
|
|
48
48
|
query: ({ namespace }) =>
|
|
@@ -66,7 +66,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
66
66
|
method: 'DELETE',
|
|
67
67
|
body: { pk }
|
|
68
68
|
}),
|
|
69
|
-
invalidatesTags: ['MultiBasket', 'Basket']
|
|
69
|
+
invalidatesTags: ['MultiBasket', 'Basket', 'MiniBasket']
|
|
70
70
|
}),
|
|
71
71
|
selectMainBasket: build.mutation<Basket, { pk: number }>({
|
|
72
72
|
query: ({ pk }) => ({
|
|
@@ -77,7 +77,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
77
77
|
body: { pk }
|
|
78
78
|
}),
|
|
79
79
|
transformResponse: (response: { baskets: Basket }) => response.baskets,
|
|
80
|
-
invalidatesTags: ['MultiBasket', 'Basket']
|
|
80
|
+
invalidatesTags: ['MultiBasket', 'Basket', 'MiniBasket']
|
|
81
81
|
}),
|
|
82
82
|
selectNameSpaceMainBasket: build.mutation<Basket, { namespace: string }>({
|
|
83
83
|
query: ({ namespace }) => ({
|
|
@@ -91,7 +91,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
91
91
|
body: { namespace }
|
|
92
92
|
}),
|
|
93
93
|
transformResponse: (response: { baskets: Basket }) => response.baskets,
|
|
94
|
-
invalidatesTags: ['MultiBasket', 'Basket']
|
|
94
|
+
invalidatesTags: ['MultiBasket', 'Basket', 'MiniBasket']
|
|
95
95
|
}),
|
|
96
96
|
updateQuantity: build.mutation<
|
|
97
97
|
UpdateQuantityResponse,
|
|
@@ -104,45 +104,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
104
104
|
method: 'PUT',
|
|
105
105
|
body
|
|
106
106
|
}),
|
|
107
|
-
|
|
108
|
-
try {
|
|
109
|
-
const { data } = await queryFulfilled;
|
|
110
|
-
|
|
111
|
-
dispatch(
|
|
112
|
-
basketApi.util.updateQueryData(
|
|
113
|
-
'getBasket',
|
|
114
|
-
undefined,
|
|
115
|
-
() => data.basket
|
|
116
|
-
)
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
if (data.basket.namespace) {
|
|
120
|
-
dispatch(
|
|
121
|
-
basketApi.util.updateQueryData(
|
|
122
|
-
'getBasketDetail',
|
|
123
|
-
{ namespace: data.basket.namespace },
|
|
124
|
-
() => data.basket
|
|
125
|
-
)
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
dispatch(
|
|
130
|
-
basketApi.util.updateQueryData(
|
|
131
|
-
'getAllBaskets',
|
|
132
|
-
undefined,
|
|
133
|
-
(baskets) => {
|
|
134
|
-
if (!baskets) return baskets;
|
|
135
|
-
|
|
136
|
-
return baskets.map((basket) =>
|
|
137
|
-
basket.pk === data.basket.pk ? data.basket : basket
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
);
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.error('Error updating quantity:', error);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
107
|
+
invalidatesTags: ['MultiBasket', 'Basket', 'MiniBasket']
|
|
146
108
|
}),
|
|
147
109
|
clearBasket: build.mutation<Basket, void>({
|
|
148
110
|
query: (body) => ({
|
|
@@ -153,7 +115,7 @@ export const basketApi = api.injectEndpoints({
|
|
|
153
115
|
body
|
|
154
116
|
}),
|
|
155
117
|
transformResponse: (response: { basket: Basket }) => response.basket,
|
|
156
|
-
invalidatesTags: ['Basket']
|
|
118
|
+
invalidatesTags: ['Basket', 'MiniBasket', 'MiniBasket']
|
|
157
119
|
}),
|
|
158
120
|
applyVoucherCode: build.mutation<Basket, { voucher_code: string }>({
|
|
159
121
|
query: (body) => ({
|
package/data/client/product.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.86.0-rc.
|
|
4
|
+
"version": "1.86.0-rc.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"set-cookie-parser": "2.6.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@akinon/eslint-plugin-projectzero": "1.86.0-rc.
|
|
34
|
+
"@akinon/eslint-plugin-projectzero": "1.86.0-rc.4",
|
|
35
35
|
"@types/react-redux": "7.1.30",
|
|
36
36
|
"@types/set-cookie-parser": "2.4.7",
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|