@speedkit/cli 2.77.0 → 2.79.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 +15 -0
- package/README.md +1 -1
- package/dist/services/customer-config/customer-config-service-model.d.ts +2 -0
- package/dist/services/customer-config/customer-config-service-model.js +1 -0
- package/dist/services/customer-config/customer-config-service.js +6 -1
- package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +21 -0
- package/dist/services/customer-config/templates/config_customer.js.hbs +2 -0
- package/dist/services/customer-config/templates/config_loadHandler.js.hbs +48 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [2.79.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.78.0...v2.79.0) (2025-02-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **customer-config:** add blacklist block for CORS image domains ([78a8802](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/78a8802f6f91496c52ac16d3c808786ea0426eb1))
|
|
7
|
+
|
|
8
|
+
# [2.78.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.77.0...v2.78.0) (2025-02-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **customer-config:** add oxid eshop specific page type tracking ([129c08c](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/129c08cda03d15a085982c33e391d3a6751cb775))
|
|
14
|
+
* **customer-config:** add oxid eshop specifics ([5ef91ac](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/5ef91ac15a759d5b76075badbe105bffc13a1c02))
|
|
15
|
+
|
|
1
16
|
# [2.77.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.76.2...v2.77.0) (2025-02-07)
|
|
2
17
|
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ export declare enum ShopSystem {
|
|
|
8
8
|
SHOPIFY = "Shopify",
|
|
9
9
|
SHOPWARE = "Shopware",
|
|
10
10
|
SALESFORCE = "Salesforce Commerce Cloud",
|
|
11
|
+
OXID = "OXID eShop",
|
|
11
12
|
PLENTYMARKETS = "Plentymarkets"
|
|
12
13
|
}
|
|
13
14
|
export declare enum EnvironmentType {
|
|
@@ -40,6 +41,7 @@ export interface CustomerConfigSettings {
|
|
|
40
41
|
isShopify?: boolean;
|
|
41
42
|
isShopware?: boolean;
|
|
42
43
|
isSalesforce?: boolean;
|
|
44
|
+
isOxid?: boolean;
|
|
43
45
|
isPlentymarkets?: boolean;
|
|
44
46
|
shopifyId?: string;
|
|
45
47
|
}
|
|
@@ -13,6 +13,7 @@ var ShopSystem;
|
|
|
13
13
|
ShopSystem["SHOPIFY"] = "Shopify";
|
|
14
14
|
ShopSystem["SHOPWARE"] = "Shopware";
|
|
15
15
|
ShopSystem["SALESFORCE"] = "Salesforce Commerce Cloud";
|
|
16
|
+
ShopSystem["OXID"] = "OXID eShop";
|
|
16
17
|
ShopSystem["PLENTYMARKETS"] = "Plentymarkets";
|
|
17
18
|
})(ShopSystem || (exports.ShopSystem = ShopSystem = {}));
|
|
18
19
|
var EnvironmentType;
|
|
@@ -136,7 +136,7 @@ class CustomerConfigService {
|
|
|
136
136
|
return true;
|
|
137
137
|
}
|
|
138
138
|
async getConfigSettings() {
|
|
139
|
-
let { production, staging, activateScopedDeployments, subRouteScope, includeServiceWorker, activateImageOptimisation, removeLazyLoading, addPreRendering, supportShadowDomInPreRendering, shadowDomCustomElementPrefix, activateRumTracking, useGATracking, useScrapingBee, withGoogleOptimize, activateCfRocketLoaderWorkaround, hasSoftNavigations, isShopify, isShopware, isSalesforce, isPlentymarkets, shopifyId, } = {};
|
|
139
|
+
let { production, staging, activateScopedDeployments, subRouteScope, includeServiceWorker, activateImageOptimisation, removeLazyLoading, addPreRendering, supportShadowDomInPreRendering, shadowDomCustomElementPrefix, activateRumTracking, useGATracking, useScrapingBee, withGoogleOptimize, activateCfRocketLoaderWorkaround, hasSoftNavigations, isShopify, isShopware, isSalesforce, isOxid, isPlentymarkets, shopifyId, } = {};
|
|
140
140
|
this.appName = await this.cli.prompt(`[App Name] Enter desired SK app name:`, {
|
|
141
141
|
validator: (input) => /^[\da-z]+(?:-[\da-z]+)*$/.test(input) ? "" : "No valid kebab-case",
|
|
142
142
|
defaultAnswer: this.appName,
|
|
@@ -158,6 +158,10 @@ class CustomerConfigService {
|
|
|
158
158
|
isSalesforce = true;
|
|
159
159
|
break;
|
|
160
160
|
}
|
|
161
|
+
case customer_config_service_model_1.ShopSystem.OXID: {
|
|
162
|
+
isOxid = true;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
161
165
|
case customer_config_service_model_1.ShopSystem.PLENTYMARKETS: {
|
|
162
166
|
isPlentymarkets = true;
|
|
163
167
|
}
|
|
@@ -227,6 +231,7 @@ class CustomerConfigService {
|
|
|
227
231
|
isShopify,
|
|
228
232
|
isShopware,
|
|
229
233
|
isSalesforce,
|
|
234
|
+
isOxid,
|
|
230
235
|
isPlentymarkets,
|
|
231
236
|
shopifyId,
|
|
232
237
|
};
|
|
@@ -214,6 +214,14 @@
|
|
|
214
214
|
{
|
|
215
215
|
host: ["www.paypal.com", "www.paypalobjects.com"],
|
|
216
216
|
},
|
|
217
|
+
{
|
|
218
|
+
// CORS LCP Image Domain / CORS Image Domain with missing timing-allow-origin header:
|
|
219
|
+
host: [
|
|
220
|
+
// TODO: add CORS image domains if domain provides LCP resource or timing-allow-origin header is missing
|
|
221
|
+
// – remove whole block if there are no domains to be listed
|
|
222
|
+
],
|
|
223
|
+
contentType: ["image"],
|
|
224
|
+
},
|
|
217
225
|
{{#if isShopify}}
|
|
218
226
|
|
|
219
227
|
// Shopify specific:
|
|
@@ -241,6 +249,19 @@
|
|
|
241
249
|
],
|
|
242
250
|
},
|
|
243
251
|
{{/if}}
|
|
252
|
+
{{#if isOxid}}
|
|
253
|
+
|
|
254
|
+
// OXID eShop specific:
|
|
255
|
+
{
|
|
256
|
+
url: [
|
|
257
|
+
/[?&]cl=/i,
|
|
258
|
+
// "cl" parameter specifying the OXID controller class, which can affect the entire page layout and content
|
|
259
|
+
// – common values: start, alist, details, basket, order, register, login
|
|
260
|
+
// TODO: check in the fine-tuning phase at the latest whether the resulting blacklisted rate is not too high
|
|
261
|
+
/[?&]searchparam/i,
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
{{/if}}
|
|
244
265
|
{{#if isPlentymarkets}}
|
|
245
266
|
|
|
246
267
|
// Plentymarkets specific:
|
|
@@ -17,6 +17,10 @@ import { PredictivePreloading } from 'predictive-preloading/predictivePreloading
|
|
|
17
17
|
var softLcpPending = false;
|
|
18
18
|
var latestUrl = location.href;
|
|
19
19
|
{{/if}}
|
|
20
|
+
{{#if isOxid}}
|
|
21
|
+
|
|
22
|
+
var pageTypeSent = false;
|
|
23
|
+
{{/if}}
|
|
20
24
|
|
|
21
25
|
window.SpeedKit = window.SpeedKit || {};
|
|
22
26
|
SpeedKit.rumPlugins = SpeedKit.rumPlugins || [];
|
|
@@ -192,18 +196,61 @@ import { PredictivePreloading } from 'predictive-preloading/predictivePreloading
|
|
|
192
196
|
{{else}}
|
|
193
197
|
{{#if useGATracking}}
|
|
194
198
|
on: 'dataLayer',
|
|
195
|
-
set: function(pushedEvent) {
|
|
199
|
+
set: function (pushedEvent) {
|
|
196
200
|
// TODO: verify event property
|
|
201
|
+
{{#if isOxid}}
|
|
202
|
+
var pageType = pushedEvent?.ecomm_pagetype;
|
|
203
|
+
if (pageType) {
|
|
204
|
+
pageTypeSent = true;
|
|
205
|
+
return pageType;
|
|
206
|
+
}
|
|
207
|
+
{{else}}
|
|
197
208
|
return pushedEvent?.pageCategory;
|
|
209
|
+
{{/if}}
|
|
198
210
|
},
|
|
199
211
|
{{else}}
|
|
200
212
|
// TODO: set proper 'on' event listener
|
|
201
213
|
set: function() {
|
|
214
|
+
{{#if isOxid}}
|
|
215
|
+
var pageType; // TODO: assign value
|
|
216
|
+
if (pageType) {
|
|
217
|
+
pageTypeSent = true;
|
|
218
|
+
return pageType;
|
|
219
|
+
}
|
|
220
|
+
{{else}}
|
|
202
221
|
// TODO: return value
|
|
222
|
+
{{/if}}
|
|
203
223
|
},
|
|
204
224
|
{{/if}}
|
|
205
225
|
{{/if}}
|
|
206
226
|
},
|
|
227
|
+
{{#if isOxid}}
|
|
228
|
+
// OXID eShop specific fallback tracking for page type using URL:
|
|
229
|
+
{
|
|
230
|
+
key: "pageType",
|
|
231
|
+
type: "PiDimension",
|
|
232
|
+
on: "leavePage",
|
|
233
|
+
set: function () {
|
|
234
|
+
if (pageTypeSent) return;
|
|
235
|
+
|
|
236
|
+
var pageType = "";
|
|
237
|
+
|
|
238
|
+
// Use first segment of the url path as page type if pageType was not identified yet
|
|
239
|
+
var firstPathnameSegment = location.pathname.match(/^\/([^/]+)/);
|
|
240
|
+
if (firstPathnameSegment) {
|
|
241
|
+
pageType = firstPathnameSegment[1];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Extend page type by value of cl query parameter as it also can point to the type of the page
|
|
245
|
+
var clParam = new URL(location.href).searchParams.get("cl");
|
|
246
|
+
if (clParam) {
|
|
247
|
+
pageType += "_" + clParam;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return pageType.toLowerCase();
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{{/if}}
|
|
207
254
|
{{#if useGATracking}}
|
|
208
255
|
|
|
209
256
|
// TODO: remove or adapt if events are not properly covered by GAEcommerceTrackingPlugin
|
package/oclif.manifest.json
CHANGED