@akinon/next 1.93.0-snapshot-ZERO-3586-20250827093151 → 1.93.0-snapshot-ZERO-3586-20250827123110
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 +2 -2
- package/data/server/product.ts +2 -1
- package/lib/cache-handler.mjs +7 -9
- package/lib/cache.ts +9 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
-
## 1.93.0-snapshot-ZERO-3586-
|
|
3
|
+
## 1.93.0-snapshot-ZERO-3586-20250827123110
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
- 4de5303c: ZERO-2504: add cookie filter to api client request
|
|
70
70
|
- dc678c3: ZERO-3523: Enhance redirect tests with dynamic locale handling and settings integration
|
|
71
71
|
- f2c92d5c7: ZERO-2816: Update cookie name
|
|
72
|
-
-
|
|
72
|
+
- a420947d: ZERO-3517: Fix optional chaining for rawData in error logging for category data handlers
|
|
73
73
|
- 7bd3d9928: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
74
74
|
- acd2afd: ZERO-3431: Fix import statement for findBaseDir in next-config test
|
|
75
75
|
- 2d3f1788: ZERO-3417: Enhance FileInput component with additional props for customization
|
package/data/server/product.ts
CHANGED
package/lib/cache-handler.mjs
CHANGED
|
@@ -155,17 +155,15 @@ CacheHandler.onCreation(async () => {
|
|
|
155
155
|
|
|
156
156
|
const localHandler = createLruHandler(CACHE_CONFIG.lru);
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
const versionPrefix =
|
|
158
|
+
const CACHE_VERSION = 'v2';
|
|
159
|
+
const versionPrefix = `${CACHE_VERSION}_`;
|
|
160
160
|
|
|
161
161
|
// Create optimized functions for each scenario
|
|
162
|
-
const versionKeyString = versionPrefix
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
? (key) => ({ ...key, key: `${versionPrefix}${key.key}` })
|
|
168
|
-
: (key) => key;
|
|
162
|
+
const versionKeyString = (key) => `${versionPrefix}${key}`;
|
|
163
|
+
const versionKeyObject = (key) => ({
|
|
164
|
+
...key,
|
|
165
|
+
key: `${versionPrefix}${key.key}`
|
|
166
|
+
});
|
|
169
167
|
|
|
170
168
|
// Main version key function that routes to optimized paths
|
|
171
169
|
const versionKey = (key) => {
|
package/lib/cache.ts
CHANGED
|
@@ -382,10 +382,12 @@ export class Cache {
|
|
|
382
382
|
zstd.compress(new Uint8Array(Buffer.from(serializedValue, 'utf8')), 3)
|
|
383
383
|
);
|
|
384
384
|
|
|
385
|
+
const compressedBase64 = compressed.toString('base64');
|
|
386
|
+
|
|
385
387
|
if (expire) {
|
|
386
|
-
await client.set(key,
|
|
388
|
+
await client.set(key, compressedBase64, { EX: expire });
|
|
387
389
|
} else {
|
|
388
|
-
await client.set(key,
|
|
390
|
+
await client.set(key, compressedBase64);
|
|
389
391
|
}
|
|
390
392
|
|
|
391
393
|
success = true;
|
|
@@ -428,15 +430,15 @@ export class Cache {
|
|
|
428
430
|
const compressed = await client.get(key);
|
|
429
431
|
|
|
430
432
|
if (compressed) {
|
|
431
|
-
const compressedBuffer = Buffer.
|
|
432
|
-
? compressed
|
|
433
|
-
: Buffer.from(compressed, 'binary');
|
|
433
|
+
const compressedBuffer = Buffer.from(compressed, 'base64');
|
|
434
434
|
|
|
435
435
|
await initZstd();
|
|
436
436
|
|
|
437
437
|
let decompressed: Buffer;
|
|
438
438
|
try {
|
|
439
|
-
decompressed = Buffer.from(
|
|
439
|
+
decompressed = Buffer.from(
|
|
440
|
+
zstd.decompress(new Uint8Array(compressedBuffer))
|
|
441
|
+
);
|
|
440
442
|
} catch (error) {
|
|
441
443
|
logger.debug(
|
|
442
444
|
'Failed to decompress with zstd, trying fallback methods',
|
|
@@ -447,7 +449,7 @@ export class Cache {
|
|
|
447
449
|
const { gunzip } = await import('zlib');
|
|
448
450
|
const { promisify } = await import('util');
|
|
449
451
|
const gunzipAsync = promisify(gunzip);
|
|
450
|
-
decompressed = await gunzipAsync(compressedBuffer);
|
|
452
|
+
decompressed = await gunzipAsync(compressedBuffer as any);
|
|
451
453
|
logger.debug('Successfully decompressed with gzip fallback', {
|
|
452
454
|
key
|
|
453
455
|
});
|
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.93.0-snapshot-ZERO-3586-
|
|
4
|
+
"version": "1.93.0-snapshot-ZERO-3586-20250827123110",
|
|
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.93.0-snapshot-ZERO-3586-
|
|
38
|
+
"@akinon/eslint-plugin-projectzero": "1.93.0-snapshot-ZERO-3586-20250827123110",
|
|
39
39
|
"@babel/core": "7.26.10",
|
|
40
40
|
"@babel/preset-env": "7.26.9",
|
|
41
41
|
"@babel/preset-typescript": "7.27.0",
|