@akinon/next 1.118.0-rc.2 → 1.118.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 +12 -0
- package/bin/pz-generate-routes.js +10 -1
- package/lib/cache-handler.mjs +8 -2
- package/lib/cache.ts +8 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.118.0-rc.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0754c835: ZERO-4063: Add support for optional Redis password in cache handlers
|
|
8
|
+
|
|
9
|
+
## 1.118.0-rc.3
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 94a86fcc: ZERO-4065: Expand skipSegments array to include additional segments for route generation
|
|
14
|
+
|
|
3
15
|
## 1.118.0-rc.2
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -25,7 +25,16 @@ const generateRoutes = () => {
|
|
|
25
25
|
const routes = [];
|
|
26
26
|
const excludedDirs = ['api', 'pz-not-found'];
|
|
27
27
|
|
|
28
|
-
const skipSegments = [
|
|
28
|
+
const skipSegments = [
|
|
29
|
+
'[commerce]',
|
|
30
|
+
'[locale]',
|
|
31
|
+
'[currency]',
|
|
32
|
+
'[session]',
|
|
33
|
+
'[segment]',
|
|
34
|
+
'[url]',
|
|
35
|
+
'[theme]',
|
|
36
|
+
'[member_type]'
|
|
37
|
+
];
|
|
29
38
|
const skipCatchAllRoutes = ['[...prettyurl]', '[...not_found]'];
|
|
30
39
|
|
|
31
40
|
const walkDirectory = (dir, basePath = '') => {
|
package/lib/cache-handler.mjs
CHANGED
|
@@ -364,11 +364,17 @@ CacheHandler.onCreation(async () => {
|
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
const
|
|
367
|
+
const redisOptions = {
|
|
368
368
|
client,
|
|
369
369
|
timeoutMs: CACHE_CONFIG.redis.timeoutMs,
|
|
370
370
|
keyExpirationStrategy: 'EXPIREAT'
|
|
371
|
-
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
if (process.env.CACHE_PASSWORD) {
|
|
374
|
+
redisOptions.password = process.env.CACHE_PASSWORD;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const redisHandler = createRedisHandler(redisOptions);
|
|
372
378
|
|
|
373
379
|
const localHandler = createLruHandler(CACHE_CONFIG.lru);
|
|
374
380
|
|
package/lib/cache.ts
CHANGED
|
@@ -155,9 +155,14 @@ export class Cache {
|
|
|
155
155
|
process.env.CACHE_PORT
|
|
156
156
|
}/${process.env.CACHE_BUCKET ?? '0'}`;
|
|
157
157
|
|
|
158
|
-
const
|
|
159
|
-
url: redisUrl
|
|
160
|
-
|
|
158
|
+
const options = {
|
|
159
|
+
url: redisUrl,
|
|
160
|
+
...(process.env.CACHE_PASSWORD && {
|
|
161
|
+
password: process.env.CACHE_PASSWORD
|
|
162
|
+
})
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const client: RedisClientType = createClient(options);
|
|
161
166
|
|
|
162
167
|
client.on('error', (error) => {
|
|
163
168
|
logger.error('Redis client error', { redisUrl, error });
|
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.118.0-rc.
|
|
4
|
+
"version": "1.118.0-rc.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"set-cookie-parser": "2.6.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@akinon/eslint-plugin-projectzero": "1.118.0-rc.
|
|
38
|
+
"@akinon/eslint-plugin-projectzero": "1.118.0-rc.4",
|
|
39
39
|
"@babel/core": "7.26.10",
|
|
40
40
|
"@babel/preset-env": "7.26.9",
|
|
41
41
|
"@babel/preset-typescript": "7.27.0",
|