@decocms/blocks-cli 7.71.1 → 7.71.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/blocks-cli",
|
|
3
|
-
"version": "7.71.
|
|
3
|
+
"version": "7.71.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deco codegen (generate-blocks, generate-schema, generate-invoke) and Fresh-to-TanStack migration tooling",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"lint:unused": "knip"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@decocms/blocks": "7.71.
|
|
36
|
+
"@decocms/blocks": "7.71.2",
|
|
37
37
|
"ts-morph": "^27.0.0",
|
|
38
38
|
"tsx": "^4.22.5"
|
|
39
39
|
},
|
|
@@ -98,14 +98,10 @@ const decoWorker = createDecoWorkerEntry(serverEntry, {
|
|
|
98
98
|
handleRender,
|
|
99
99
|
corsHeaders,
|
|
100
100
|
},
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
const cf = (request as unknown as { cf?: { regionCode?: string } }).cf;
|
|
106
|
-
const regionCode = request.headers.get("cf-region-code") ?? cf?.regionCode ?? "";
|
|
107
|
-
return regionCode ? { regionId: regionCode } : {};
|
|
108
|
-
},
|
|
101
|
+
// No geo in buildSegment: createDecoWorkerEntry's geoCacheKey: "auto" already
|
|
102
|
+
// backfills the region into the segment — but only when the decofile has a
|
|
103
|
+
// website/matchers/location.ts block. Setting it here unconditionally split
|
|
104
|
+
// every page's cache per state (~27 copies per URL in Brazil) for nothing.
|
|
109
105
|
});
|
|
110
106
|
|
|
111
107
|
export default instrumentWorker(decoWorker, {
|
|
@@ -174,16 +170,15 @@ const decoWorker = createDecoWorkerEntry(serverEntry, {
|
|
|
174
170
|
csp: CSP_DIRECTIVES,
|
|
175
171
|
buildSegment: (request) => {
|
|
176
172
|
const vtx = extractVtexContext(request);
|
|
177
|
-
const cf = (request as unknown as { cf?: { regionCode?: string } }).cf;
|
|
178
|
-
const geoRegion = request.headers.get("cf-region-code") ?? cf?.regionCode ?? "";
|
|
179
173
|
return {
|
|
180
174
|
device: MOBILE_RE.test(request.headers.get("user-agent") ?? "") ? "mobile" : "desktop",
|
|
181
175
|
loggedIn: vtx.isLoggedIn,
|
|
182
176
|
salesChannel: vtx.salesChannel,
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
|
|
177
|
+
// VTEX regionalization only. Don't fall back to Cloudflare geo here:
|
|
178
|
+
// geoCacheKey: "auto" adds the region only when a
|
|
179
|
+
// website/matchers/location.ts block exists; doing it unconditionally
|
|
180
|
+
// splits every page's cache per state.
|
|
181
|
+
regionId: (vtx as any).regionId,
|
|
187
182
|
};
|
|
188
183
|
},
|
|
189
184
|
admin: {
|