@akinon/projectzero 1.125.0-rc.1 → 1.125.0
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 +1 -9
- package/app-template/.env.example +0 -1
- package/app-template/CHANGELOG.md +27 -87
- package/app-template/README.md +1 -25
- package/app-template/akinon.json +1 -1
- package/app-template/docs/advanced-usage.md +101 -0
- package/app-template/next.config.mjs +4 -4
- package/app-template/package.json +61 -61
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/profile/page.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/layout.tsx +2 -7
- package/app-template/src/hooks/index.ts +0 -2
- package/app-template/src/middleware.ts +1 -2
- package/app-template/src/plugins.js +0 -1
- package/app-template/src/settings.js +1 -0
- package/app-template/src/views/guest-login/index.tsx +1 -1
- package/app-template/src/views/header/search/index.tsx +5 -13
- package/app-template/src/views/product/slider.tsx +38 -85
- package/app-template/tsconfig.json +6 -10
- package/codemods/migrate-segments/index.js +593 -0
- package/commands/plugins.ts +0 -4
- package/dist/commands/plugins.js +0 -4
- package/package.json +1 -1
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/[...prettyurl]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/address/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-email/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-password/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/contact/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/coupons/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/email-verification/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/faq/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/favourite-products/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/my-quotations/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/cancellation/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/address/stores/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/anonymous-tracking/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/oauth-login/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket-b2b/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/client-root.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/contact-us/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/error.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/forms/[pk]/generate/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/not-found.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/checkout/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/product/[pk]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/template.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/email-set-primary/[[...id]]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/password/reset/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/registration/account-confirm-email/[[...id]]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/reset/[[...id]]/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/[node]/route.ts +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/route.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
-
## 1.125.0
|
|
4
|
-
|
|
5
|
-
## 1.125.0-rc.0
|
|
6
|
-
|
|
7
|
-
### Minor Changes
|
|
8
|
-
|
|
9
|
-
- 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
|
|
10
|
-
- d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
|
|
11
|
-
- e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
|
|
3
|
+
## 1.125.0
|
|
12
4
|
|
|
13
5
|
## 1.124.0
|
|
14
6
|
|
|
@@ -7,7 +7,6 @@ NEXT_PUBLIC_URL=http://localhost:3000
|
|
|
7
7
|
SERVICE_BACKEND_URL=https://02fde10fee4440269e695aa10707dfaf.lb.akinoncloud.com
|
|
8
8
|
SITEMAP_S3_BUCKET_NAME=0fb534
|
|
9
9
|
NEXT_PUBLIC_VIRTUAL_TRY_ON_API_URL=https://d2a26507c7094f359aba349b96a96881.lb.akinoncloud.com
|
|
10
|
-
NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true
|
|
11
10
|
|
|
12
11
|
# LOG_LEVEL_DEV=debug # For more details, please refer to the Logging documentation.
|
|
13
12
|
|
|
@@ -1,96 +1,36 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
-
## 1.125.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- c0228aff: ZERO-4159: Upgrade the package versions
|
|
3
|
+
## 1.125.0
|
|
8
4
|
|
|
9
5
|
### Patch Changes
|
|
10
6
|
|
|
11
|
-
- Updated dependencies [c0228aff]
|
|
12
|
-
- @akinon/pz-b2b@1.125.0-rc.1
|
|
13
|
-
- @akinon/next@1.125.0-rc.1
|
|
14
|
-
- @akinon/pz-akifast@1.125.0-rc.1
|
|
15
|
-
- @akinon/pz-apple-pay@1.125.0-rc.1
|
|
16
|
-
- @akinon/pz-basket-gift-pack@1.125.0-rc.1
|
|
17
|
-
- @akinon/pz-bkm@1.125.0-rc.1
|
|
18
|
-
- @akinon/pz-checkout-gift-pack@1.125.0-rc.1
|
|
19
|
-
- @akinon/pz-click-collect@1.125.0-rc.1
|
|
20
|
-
- @akinon/pz-credit-payment@1.125.0-rc.1
|
|
21
|
-
- @akinon/pz-cybersource-uc@1.125.0-rc.1
|
|
22
|
-
- @akinon/pz-flow-payment@1.125.0-rc.1
|
|
23
|
-
- @akinon/pz-google-pay@1.125.0-rc.1
|
|
24
|
-
- @akinon/pz-gpay@1.125.0-rc.1
|
|
25
|
-
- @akinon/pz-haso@1.125.0-rc.1
|
|
26
|
-
- @akinon/pz-hepsipay@1.125.0-rc.1
|
|
27
|
-
- @akinon/pz-masterpass@1.125.0-rc.1
|
|
28
|
-
- @akinon/pz-masterpass-rest@1.125.0-rc.1
|
|
29
|
-
- @akinon/pz-multi-basket@1.125.0-rc.1
|
|
30
|
-
- @akinon/pz-one-click-checkout@1.125.0-rc.1
|
|
31
|
-
- @akinon/pz-otp@1.125.0-rc.1
|
|
32
|
-
- @akinon/pz-pay-on-delivery@1.125.0-rc.1
|
|
33
|
-
- @akinon/pz-saved-card@1.125.0-rc.1
|
|
34
|
-
- @akinon/pz-similar-products@1.125.0-rc.1
|
|
35
|
-
- @akinon/pz-tabby-extension@1.125.0-rc.1
|
|
36
|
-
- @akinon/pz-tamara-extension@1.125.0-rc.1
|
|
37
|
-
- @akinon/pz-virtual-try-on@1.125.0-rc.1
|
|
38
|
-
|
|
39
|
-
## 1.125.0-rc.0
|
|
40
|
-
|
|
41
|
-
### Minor Changes
|
|
42
|
-
|
|
43
|
-
- 1a8622a9: ZERO-3392: Implemented AI Search functionality and update env
|
|
44
|
-
- b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
|
|
45
|
-
- 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
|
|
46
|
-
- 9f8cd3bc: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
|
|
47
|
-
- d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
|
|
48
|
-
- b05c3543: ZERO-2570: Category filters routes to absolute url
|
|
49
|
-
- e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
|
|
50
|
-
- c3244a31: ZERO-4013: Update runtime version to node:25-alpine in project configuration
|
|
51
|
-
|
|
52
|
-
### Patch Changes
|
|
53
|
-
|
|
54
|
-
- Updated dependencies
|
|
55
|
-
- Updated dependencies [b55acb76]
|
|
56
|
-
- Updated dependencies [760258c1]
|
|
57
|
-
- Updated dependencies [143be2b9]
|
|
58
7
|
- Updated dependencies [cd68a97a]
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
- @akinon/
|
|
69
|
-
- @akinon/pz-
|
|
70
|
-
- @akinon/pz-
|
|
71
|
-
- @akinon/pz-
|
|
72
|
-
- @akinon/pz-
|
|
73
|
-
- @akinon/pz-
|
|
74
|
-
- @akinon/pz-
|
|
75
|
-
- @akinon/pz-
|
|
76
|
-
- @akinon/pz-
|
|
77
|
-
- @akinon/pz-
|
|
78
|
-
- @akinon/pz-click-
|
|
79
|
-
- @akinon/pz-
|
|
80
|
-
- @akinon/pz-
|
|
81
|
-
- @akinon/pz-
|
|
82
|
-
- @akinon/pz-
|
|
83
|
-
- @akinon/pz-
|
|
84
|
-
- @akinon/pz-
|
|
85
|
-
- @akinon/pz-hepsipay@1.125.0-rc.0
|
|
86
|
-
- @akinon/pz-masterpass@1.125.0-rc.0
|
|
87
|
-
- @akinon/pz-multi-basket@1.125.0-rc.0
|
|
88
|
-
- @akinon/pz-one-click-checkout@1.125.0-rc.0
|
|
89
|
-
- @akinon/pz-otp@1.125.0-rc.0
|
|
90
|
-
- @akinon/pz-pay-on-delivery@1.125.0-rc.0
|
|
91
|
-
- @akinon/pz-saved-card@1.125.0-rc.0
|
|
92
|
-
- @akinon/pz-tabby-extension@1.125.0-rc.0
|
|
93
|
-
- @akinon/pz-tamara-extension@1.125.0-rc.0
|
|
8
|
+
- @akinon/next@1.125.0
|
|
9
|
+
- @akinon/pz-virtual-try-on@1.125.0
|
|
10
|
+
- @akinon/pz-akifast@1.125.0
|
|
11
|
+
- @akinon/pz-apple-pay@1.125.0
|
|
12
|
+
- @akinon/pz-b2b@1.125.0
|
|
13
|
+
- @akinon/pz-basket-gift-pack@1.125.0
|
|
14
|
+
- @akinon/pz-bkm@1.125.0
|
|
15
|
+
- @akinon/pz-checkout-gift-pack@1.125.0
|
|
16
|
+
- @akinon/pz-click-collect@1.125.0
|
|
17
|
+
- @akinon/pz-credit-payment@1.125.0
|
|
18
|
+
- @akinon/pz-cybersource-uc@1.125.0
|
|
19
|
+
- @akinon/pz-flow-payment@1.125.0
|
|
20
|
+
- @akinon/pz-google-pay@1.125.0
|
|
21
|
+
- @akinon/pz-gpay@1.125.0
|
|
22
|
+
- @akinon/pz-haso@1.125.0
|
|
23
|
+
- @akinon/pz-hepsipay@1.125.0
|
|
24
|
+
- @akinon/pz-masterpass@1.125.0
|
|
25
|
+
- @akinon/pz-masterpass-rest@1.125.0
|
|
26
|
+
- @akinon/pz-multi-basket@1.125.0
|
|
27
|
+
- @akinon/pz-one-click-checkout@1.125.0
|
|
28
|
+
- @akinon/pz-otp@1.125.0
|
|
29
|
+
- @akinon/pz-pay-on-delivery@1.125.0
|
|
30
|
+
- @akinon/pz-saved-card@1.125.0
|
|
31
|
+
- @akinon/pz-similar-products@1.125.0
|
|
32
|
+
- @akinon/pz-tabby-extension@1.125.0
|
|
33
|
+
- @akinon/pz-tamara-extension@1.125.0
|
|
94
34
|
|
|
95
35
|
## 1.124.0
|
|
96
36
|
|
package/app-template/README.md
CHANGED
|
@@ -12,30 +12,6 @@ Run `cp .env.example .env && yarn` command at project root and all dependencies
|
|
|
12
12
|
|
|
13
13
|
- `SITEMAP_S3_BUCKET_NAME`: S3 bucket name for XML sitemaps (e.g., "0fb534"). This is required for the sitemap route to function correctly.
|
|
14
14
|
|
|
15
|
-
### Optional Environment Variables
|
|
16
|
-
|
|
17
|
-
- `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH`: Set to `true` to enable image search feature for all users. If not set or `false`, the feature will only be visible to users who have enabled it via localStorage.
|
|
18
|
-
|
|
19
|
-
## Image Search Feature
|
|
20
|
-
|
|
21
|
-
The image search functionality allows users to search for similar products by uploading images or cropping existing product images.
|
|
22
|
-
|
|
23
|
-
### Feature Visibility Control
|
|
24
|
-
|
|
25
|
-
The image search feature can be controlled in two ways:
|
|
26
|
-
|
|
27
|
-
1. **Environment Variable (Global)**: Set `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true` to enable for all users
|
|
28
|
-
2. **localStorage (Individual Users)**: Users can enable it locally using browser developer tools
|
|
29
|
-
|
|
30
|
-
````
|
|
31
|
-
|
|
32
|
-
### Feature Locations
|
|
33
|
-
|
|
34
|
-
When enabled, the image search feature appears in:
|
|
35
|
-
|
|
36
|
-
- **Header Search**: Camera icon next to the search input
|
|
37
|
-
- **Product Detail Page**: "View Similar Styles" button on product images
|
|
38
|
-
|
|
39
15
|
### Build
|
|
40
16
|
|
|
41
17
|
To build the app, run the following command:
|
|
@@ -43,7 +19,7 @@ To build the app, run the following command:
|
|
|
43
19
|
```bash
|
|
44
20
|
cd projectzeronext # Project root
|
|
45
21
|
yarn build
|
|
46
|
-
|
|
22
|
+
```
|
|
47
23
|
|
|
48
24
|
### Develop
|
|
49
25
|
|
package/app-template/akinon.json
CHANGED
|
@@ -42,6 +42,107 @@ const middleware: NextMiddleware = (
|
|
|
42
42
|
};
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## Custom Segments
|
|
46
|
+
|
|
47
|
+
The `[pz]` segment encodes `locale`, `currency`, and `url` by default. You can add custom segments via `pzSegments` in `settings.js` to encode additional values into the URL.
|
|
48
|
+
|
|
49
|
+
### Configuration
|
|
50
|
+
|
|
51
|
+
Define custom segments in `settings.js` with a `resolve` function that computes the segment value at request time:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
/** @type {import('@akinon/next/types').Settings} */
|
|
55
|
+
module.exports = {
|
|
56
|
+
// ...
|
|
57
|
+
usePzSegment: true,
|
|
58
|
+
pzSegments: {
|
|
59
|
+
segments: [
|
|
60
|
+
{
|
|
61
|
+
name: 'segment',
|
|
62
|
+
resolve: (context) => context.req.cookies.get('pz-segment')?.value ?? 'default'
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Default segments (`locale`, `currency`, `url`) are always included automatically. You only need to define your custom ones.
|
|
70
|
+
|
|
71
|
+
### Resolve Context
|
|
72
|
+
|
|
73
|
+
The `resolve` function receives a context object with the following properties:
|
|
74
|
+
|
|
75
|
+
| Property | Type | Description |
|
|
76
|
+
|------------|------------------|--------------------------------------|
|
|
77
|
+
| `req` | `PzNextRequest` | The incoming request object (cookies, headers, middlewareParams) |
|
|
78
|
+
| `event` | `NextFetchEvent` | The Next.js fetch event (waitUntil, etc.) |
|
|
79
|
+
| `url` | `NextURL` | Cloned URL object of the current request |
|
|
80
|
+
| `locale` | `string` | Resolved locale value |
|
|
81
|
+
| `currency` | `string` | Resolved currency value |
|
|
82
|
+
| `pathname` | `string` | Pathname without locale prefix |
|
|
83
|
+
|
|
84
|
+
### Reading Segment Values
|
|
85
|
+
|
|
86
|
+
In server components, use `parsePzParams` to read all segment values (both built-in and custom):
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { parsePzParams } from '@akinon/next/utils'
|
|
90
|
+
import settings from 'settings'
|
|
91
|
+
|
|
92
|
+
export default function Page({ params }) {
|
|
93
|
+
const { locale, currency, url, segment } = parsePzParams(params, settings)
|
|
94
|
+
// ...
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
In client components, use the `usePzParams` hook:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
'use client'
|
|
102
|
+
import { usePzParams } from '@akinon/next/hooks/use-pz-params'
|
|
103
|
+
|
|
104
|
+
export default function MyComponent() {
|
|
105
|
+
const { locale, currency, url, segment } = usePzParams()
|
|
106
|
+
// ...
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Example: Cookie-based Segment
|
|
111
|
+
|
|
112
|
+
A segment that reads a value from a cookie and falls back to a default:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
pzSegments: {
|
|
116
|
+
segments: [
|
|
117
|
+
{
|
|
118
|
+
name: 'segment',
|
|
119
|
+
resolve: (context) => context.req.cookies.get('pz-segment')?.value ?? 'default'
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This encodes the cookie value into the `[pz]` URL parameter. The resulting URL structure becomes:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
/tr--TL--<encoded-url>--default/page-path
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Migration from Legacy Structure
|
|
132
|
+
|
|
133
|
+
To migrate a project using the legacy `[commerce]/[locale]/[currency]` directory structure to the new `[pz]` segment:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npx projectzero codemod --codemod=migrate-segments
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This codemod will:
|
|
140
|
+
- Detect all dynamic segments and merge them into `[pz]/`
|
|
141
|
+
- Update `settings.js` with `usePzSegment: true`
|
|
142
|
+
- Clean up middleware rewrite blocks
|
|
143
|
+
- Update path references in `tsconfig.json`, `next.config.js`, and source files
|
|
144
|
+
- Replace `params.locale` / `params.currency` / `params.url` usages with `parsePzParams`
|
|
145
|
+
|
|
45
146
|
## Enabling Browser Back/Forward Cache (bfcache)
|
|
46
147
|
|
|
47
148
|
By default, dynamic pages may include `Cache-Control: no-store` headers, which prevents browsers from using the back/forward cache (bfcache). To enable bfcache support, set the `BF_CACHE` environment variable to `true`:
|
|
@@ -8,12 +8,12 @@ const nextConfig = {
|
|
|
8
8
|
rewrites: async () => {
|
|
9
9
|
return [
|
|
10
10
|
{
|
|
11
|
-
source: '/:
|
|
12
|
-
destination: '/:
|
|
11
|
+
source: '/:pz/sitemap.xml',
|
|
12
|
+
destination: '/:pz/xml-sitemap'
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
source: '/:
|
|
16
|
-
destination: '/:
|
|
15
|
+
source: '/:pz/sitemap/:node',
|
|
16
|
+
destination: '/:pz/xml-sitemap/:node'
|
|
17
17
|
}
|
|
18
18
|
];
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.125.0
|
|
3
|
+
"version": "1.125.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,95 +24,95 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "1.125.0
|
|
28
|
-
"@akinon/pz-akifast": "1.125.0
|
|
29
|
-
"@akinon/pz-apple-pay": "1.125.0
|
|
30
|
-
"@akinon/pz-b2b": "1.125.0
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "1.125.0
|
|
32
|
-
"@akinon/pz-bkm": "1.125.0
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "1.125.0
|
|
34
|
-
"@akinon/pz-click-collect": "1.125.0
|
|
35
|
-
"@akinon/pz-credit-payment": "1.125.0
|
|
36
|
-
"@akinon/pz-cybersource-uc": "1.125.0
|
|
37
|
-
"@akinon/pz-flow-payment": "1.125.0
|
|
38
|
-
"@akinon/pz-google-pay": "1.125.0
|
|
39
|
-
"@akinon/pz-gpay": "1.125.0
|
|
40
|
-
"@akinon/pz-haso": "1.125.0
|
|
41
|
-
"@akinon/pz-hepsipay": "1.125.0
|
|
42
|
-
"@akinon/pz-masterpass": "1.125.0
|
|
43
|
-
"@akinon/pz-masterpass-rest": "1.125.0
|
|
44
|
-
"@akinon/pz-multi-basket": "1.125.0
|
|
45
|
-
"@akinon/pz-one-click-checkout": "1.125.0
|
|
46
|
-
"@akinon/pz-otp": "1.125.0
|
|
47
|
-
"@akinon/pz-pay-on-delivery": "1.125.0
|
|
48
|
-
"@akinon/pz-saved-card": "1.125.0
|
|
49
|
-
"@akinon/pz-similar-products": "1.125.0
|
|
50
|
-
"@akinon/pz-tabby-extension": "1.125.0
|
|
51
|
-
"@akinon/pz-tamara-extension": "1.125.0
|
|
52
|
-
"@akinon/pz-virtual-try-on": "1.125.0
|
|
27
|
+
"@akinon/next": "1.125.0",
|
|
28
|
+
"@akinon/pz-akifast": "1.125.0",
|
|
29
|
+
"@akinon/pz-apple-pay": "1.125.0",
|
|
30
|
+
"@akinon/pz-b2b": "1.125.0",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "1.125.0",
|
|
32
|
+
"@akinon/pz-bkm": "1.125.0",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "1.125.0",
|
|
34
|
+
"@akinon/pz-click-collect": "1.125.0",
|
|
35
|
+
"@akinon/pz-credit-payment": "1.125.0",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "1.125.0",
|
|
37
|
+
"@akinon/pz-flow-payment": "1.125.0",
|
|
38
|
+
"@akinon/pz-google-pay": "1.125.0",
|
|
39
|
+
"@akinon/pz-gpay": "1.125.0",
|
|
40
|
+
"@akinon/pz-haso": "1.125.0",
|
|
41
|
+
"@akinon/pz-hepsipay": "1.125.0",
|
|
42
|
+
"@akinon/pz-masterpass": "1.125.0",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "1.125.0",
|
|
44
|
+
"@akinon/pz-multi-basket": "1.125.0",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "1.125.0",
|
|
46
|
+
"@akinon/pz-otp": "1.125.0",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "1.125.0",
|
|
48
|
+
"@akinon/pz-saved-card": "1.125.0",
|
|
49
|
+
"@akinon/pz-similar-products": "1.125.0",
|
|
50
|
+
"@akinon/pz-tabby-extension": "1.125.0",
|
|
51
|
+
"@akinon/pz-tamara-extension": "1.125.0",
|
|
52
|
+
"@akinon/pz-virtual-try-on": "1.125.0",
|
|
53
53
|
"@hookform/resolvers": "2.9.0",
|
|
54
54
|
"@next/third-parties": "14.1.0",
|
|
55
55
|
"@react-google-maps/api": "2.17.1",
|
|
56
|
-
"dayjs": "1.11.
|
|
57
|
-
"lossless-json": "2.0.
|
|
56
|
+
"dayjs": "1.11.5",
|
|
57
|
+
"lossless-json": "2.0.5",
|
|
58
58
|
"next": "14.2.25",
|
|
59
59
|
"next-auth": "4.24.5",
|
|
60
60
|
"next-pwa": "5.6.0",
|
|
61
|
-
"pino": "8.
|
|
61
|
+
"pino": "8.11.0",
|
|
62
62
|
"postcss": "8.4.49",
|
|
63
|
-
"react": "18.
|
|
64
|
-
"react-dom": "18.
|
|
63
|
+
"react": "18.2.0",
|
|
64
|
+
"react-dom": "18.2.0",
|
|
65
65
|
"react-google-recaptcha": "2.1.0",
|
|
66
66
|
"react-hook-form": "7.31.3",
|
|
67
67
|
"react-intersection-observer": "9.4.0",
|
|
68
|
-
"react-multi-carousel": "2.8.
|
|
69
|
-
"react-string-replace": "1.1.
|
|
70
|
-
"start-server-and-test": "2.0.
|
|
71
|
-
"tailwind-merge": "1.
|
|
68
|
+
"react-multi-carousel": "2.8.4",
|
|
69
|
+
"react-string-replace": "1.1.0",
|
|
70
|
+
"start-server-and-test": "2.0.3",
|
|
71
|
+
"tailwind-merge": "1.8.0",
|
|
72
72
|
"yup": "0.32.11"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@akinon/eslint-plugin-projectzero": "1.125.0
|
|
76
|
-
"@semantic-release/changelog": "6.0.
|
|
75
|
+
"@akinon/eslint-plugin-projectzero": "1.125.0",
|
|
76
|
+
"@semantic-release/changelog": "6.0.2",
|
|
77
77
|
"@semantic-release/exec": "6.0.3",
|
|
78
78
|
"@semantic-release/git": "10.0.1",
|
|
79
|
-
"@tailwindcss/typography": "0.5.
|
|
80
|
-
"@testing-library/dom": "8.
|
|
81
|
-
"@testing-library/jest-dom": "5.
|
|
82
|
-
"@testing-library/react": "13.
|
|
83
|
-
"@testing-library/user-event": "14.
|
|
79
|
+
"@tailwindcss/typography": "0.5.10",
|
|
80
|
+
"@testing-library/dom": "8.13.0",
|
|
81
|
+
"@testing-library/jest-dom": "5.16.4",
|
|
82
|
+
"@testing-library/react": "13.1.1",
|
|
83
|
+
"@testing-library/user-event": "14.1.1",
|
|
84
84
|
"@types/googlemaps": "3.43.3",
|
|
85
85
|
"@types/jest": "29.5.14",
|
|
86
|
-
"@types/react": "18.
|
|
87
|
-
"@types/react-dom": "18.
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
89
|
-
"@typescript-eslint/parser": "6.
|
|
86
|
+
"@types/react": "18.2.27",
|
|
87
|
+
"@types/react-dom": "18.2.12",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "6.7.4",
|
|
89
|
+
"@typescript-eslint/parser": "6.7.4",
|
|
90
90
|
"autoprefixer": "10.4.20",
|
|
91
91
|
"client-only": "0.0.1",
|
|
92
|
-
"clsx": "1.
|
|
92
|
+
"clsx": "1.1.1",
|
|
93
93
|
"currency-symbol-map": "5.1.0",
|
|
94
|
-
"eslint": "8.
|
|
95
|
-
"eslint-config-next": "14.2.
|
|
96
|
-
"eslint-config-prettier": "8.
|
|
97
|
-
"husky": "8.0.
|
|
94
|
+
"eslint": "8.14.0",
|
|
95
|
+
"eslint-config-next": "14.2.3",
|
|
96
|
+
"eslint-config-prettier": "8.5.0",
|
|
97
|
+
"husky": "8.0.0",
|
|
98
98
|
"jest": "29.7.0",
|
|
99
|
-
"jest-css-modules-transform": "4.
|
|
99
|
+
"jest-css-modules-transform": "4.3.0",
|
|
100
100
|
"jest-environment-jsdom": "29.7.0",
|
|
101
|
-
"lint-staged": "13.
|
|
102
|
-
"prettier": "2.
|
|
101
|
+
"lint-staged": "13.1.0",
|
|
102
|
+
"prettier": "2.6.2",
|
|
103
103
|
"react-number-format": "5.3.4",
|
|
104
|
-
"sass": "1.
|
|
104
|
+
"sass": "1.49.9",
|
|
105
105
|
"semantic-release": "19.0.5",
|
|
106
106
|
"server-only": "0.0.1",
|
|
107
|
-
"stylelint": "14.
|
|
107
|
+
"stylelint": "14.6.0",
|
|
108
108
|
"stylelint-config-sass-guidelines": "9.0.1",
|
|
109
109
|
"stylelint-config-standard": "25.0.0",
|
|
110
|
-
"stylelint-scss": "4.
|
|
110
|
+
"stylelint-scss": "4.2.0",
|
|
111
111
|
"stylelint-selector-bem-pattern": "2.1.1",
|
|
112
112
|
"tailwindcss": "3.4.17",
|
|
113
|
-
"ts-jest": "29.
|
|
114
|
-
"ts-node": "10.
|
|
115
|
-
"typescript": "5.
|
|
113
|
+
"ts-jest": "29.2.6",
|
|
114
|
+
"ts-node": "10.7.0",
|
|
115
|
+
"typescript": "5.2.2"
|
|
116
116
|
},
|
|
117
117
|
"resolutions": {
|
|
118
118
|
"**/postcss": "8.4.31"
|
package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/profile/page.tsx
RENAMED
|
@@ -252,7 +252,7 @@ export default function Page() {
|
|
|
252
252
|
<Input
|
|
253
253
|
label={t('account.my_profile.form.phone.placeholder')}
|
|
254
254
|
type="tel"
|
|
255
|
-
format={user_phone_format.replace(
|
|
255
|
+
format={user_phone_format.replace(/\9/g, '#')}
|
|
256
256
|
mask="_"
|
|
257
257
|
allowEmptyFormatting={true}
|
|
258
258
|
control={control}
|
|
@@ -290,7 +290,7 @@ export default function Page() {
|
|
|
290
290
|
</div>
|
|
291
291
|
{errors && (
|
|
292
292
|
<div className="mt-1 text-sm text-error">
|
|
293
|
-
{
|
|
293
|
+
{errors.birthdate?.message}
|
|
294
294
|
</div>
|
|
295
295
|
)}
|
|
296
296
|
</div>
|
|
@@ -42,17 +42,12 @@ export async function generateMetadata() {
|
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async function RootLayout({
|
|
46
|
-
params,
|
|
47
|
-
locale,
|
|
48
|
-
translations,
|
|
49
|
-
children
|
|
50
|
-
}: RootLayoutProps) {
|
|
45
|
+
async function RootLayout({ locale, translations, children }: RootLayoutProps) {
|
|
51
46
|
return (
|
|
52
47
|
<html lang={locale.isoCode} {...(locale.rtl ? { dir: 'rtl' } : {})}>
|
|
53
48
|
<head />
|
|
54
49
|
<body className="overflow-x-hidden">
|
|
55
|
-
<PzRoot translations={translations} {
|
|
50
|
+
<PzRoot translations={translations} locale={locale.value}>
|
|
56
51
|
<ClientRoot>
|
|
57
52
|
<div className="overflow-x-hidden">
|
|
58
53
|
<MobileAppToggler>
|
|
@@ -14,8 +14,7 @@ export const config = {
|
|
|
14
14
|
'/((?!api|_next|[\\w-\\/*]+\\.\\w+).*)',
|
|
15
15
|
'/(.*sitemap\\.xml)',
|
|
16
16
|
'/(.+\\.)(html|htm|aspx|asp|php)',
|
|
17
|
-
'/(.*orders\\/checkout-with-token.*)'
|
|
18
|
-
'/(.*orders\\/post-checkout.*)'
|
|
17
|
+
'/(.*orders\\/checkout-with-token.*)'
|
|
19
18
|
]
|
|
20
19
|
};
|
|
21
20
|
|
|
@@ -4,7 +4,8 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
5
5
|
import { closeSearch } from '@akinon/next/redux/reducers/header';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { Icon } from '@theme/components';
|
|
8
9
|
import Results from './results';
|
|
9
10
|
import { ROUTES } from '@theme/routes';
|
|
10
11
|
import { useLocalization, useRouter } from '@akinon/next/hooks';
|
|
@@ -41,14 +42,6 @@ export default function Search() {
|
|
|
41
42
|
};
|
|
42
43
|
}, [isSearchOpen, dispatch]);
|
|
43
44
|
|
|
44
|
-
const handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
-
setSearchText(e.target.value);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleCloseSearch = () => {
|
|
49
|
-
dispatch(closeSearch());
|
|
50
|
-
};
|
|
51
|
-
|
|
52
45
|
return (
|
|
53
46
|
<>
|
|
54
47
|
<div
|
|
@@ -74,9 +67,9 @@ export default function Search() {
|
|
|
74
67
|
{t('common.search.results_for')}
|
|
75
68
|
</span>
|
|
76
69
|
<div className="flex items-center">
|
|
77
|
-
<
|
|
70
|
+
<input
|
|
78
71
|
value={searchText}
|
|
79
|
-
onChange={
|
|
72
|
+
onChange={(e) => setSearchText(e.target.value)}
|
|
80
73
|
onKeyDown={(e) => {
|
|
81
74
|
if (e.key === 'Enter' && searchText.trim() !== '') {
|
|
82
75
|
router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
|
|
@@ -98,12 +91,11 @@ export default function Search() {
|
|
|
98
91
|
<Icon
|
|
99
92
|
name="close"
|
|
100
93
|
size={14}
|
|
101
|
-
onClick={
|
|
94
|
+
onClick={() => dispatch(closeSearch())}
|
|
102
95
|
className="cursor-pointer"
|
|
103
96
|
/>
|
|
104
97
|
</div>
|
|
105
98
|
</div>
|
|
106
|
-
|
|
107
99
|
<Results searchText={searchText} />
|
|
108
100
|
</div>
|
|
109
101
|
</div>
|