@speedkit/cli 3.1.2 → 3.3.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 +1 -0
- package/dist/services/customer-config/customer-config-service.js +3 -1
- package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +8 -0
- package/dist/services/customer-config/templates/config_dynamicBlocks.es6.hbs +6 -1
- package/dist/services/document-handler-runtime/document-handler-server.js +12 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [3.3.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.2.0...v3.3.0) (2025-08-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **wizard:** extend questionnaire ([b36eb9f](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/b36eb9f595f904bd342907408bf40d1ba80c923b))
|
|
7
|
+
* **wizard:** extend questionnaire ([c1770cd](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/c1770cd8642e71c69310659cae9835e4e4db838f))
|
|
8
|
+
|
|
9
|
+
# [3.2.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.1.2...v3.2.0) (2025-08-13)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **onboarding:** visualize completion of fetchRequests ([9b95f5e](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/9b95f5e5f46e54aeb4e09e72007dd5ec8e188bd2))
|
|
15
|
+
|
|
1
16
|
## [3.1.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.1.1...v3.1.2) (2025-08-12)
|
|
2
17
|
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ export interface CustomerConfigSettings {
|
|
|
30
30
|
activateImageOptimisation?: boolean;
|
|
31
31
|
removeLazyLoading?: boolean;
|
|
32
32
|
addPreRendering?: boolean;
|
|
33
|
+
addUADetection?: boolean;
|
|
33
34
|
supportShadowDomInPreRendering?: boolean;
|
|
34
35
|
shadowDomCustomElementPrefix?: string;
|
|
35
36
|
activateRumTracking?: boolean;
|
|
@@ -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, isOxid, isPlentymarkets, } = {};
|
|
139
|
+
let { production, staging, activateScopedDeployments, subRouteScope, includeServiceWorker, activateImageOptimisation, removeLazyLoading, addPreRendering, addUADetection, supportShadowDomInPreRendering, shadowDomCustomElementPrefix, activateRumTracking, useGATracking, useScrapingBee, withGoogleOptimize, activateCfRocketLoaderWorkaround, hasSoftNavigations, isShopify, isShopware, isSalesforce, isOxid, isPlentymarkets, } = {};
|
|
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,
|
|
@@ -181,6 +181,7 @@ class CustomerConfigService {
|
|
|
181
181
|
if (await this.cli.confirm("[Service Worker] Is there a Service Worker which needs to be included?", false)) {
|
|
182
182
|
includeServiceWorker = await this.cli.prompt("[Service Worker] Enter path of Service Worker to be included:", { defaultAnswer: "/sw.js" });
|
|
183
183
|
}
|
|
184
|
+
addUADetection = await this.cli.confirm("[Variation handling] Do mobile and desktop versions of the website differ in their HTML structure, which would require us to add variations?", false);
|
|
184
185
|
activateImageOptimisation = await this.cli.confirm("[IO] Should image optimisation be activated?", false);
|
|
185
186
|
removeLazyLoading = await this.cli.confirm("[Lazy-Loading] Does the shop require us to resolve lazy-loaded content?");
|
|
186
187
|
if (await this.cli.confirm("[Lambda-SSR] Add server-side-rendering? This requires a set-up Lambda function to work. Also requires usage of the DOM-based DocumentHandler.", false)) {
|
|
@@ -217,6 +218,7 @@ class CustomerConfigService {
|
|
|
217
218
|
activateImageOptimisation,
|
|
218
219
|
removeLazyLoading,
|
|
219
220
|
addPreRendering,
|
|
221
|
+
addUADetection,
|
|
220
222
|
supportShadowDomInPreRendering,
|
|
221
223
|
shadowDomCustomElementPrefix,
|
|
222
224
|
activateRumTracking,
|
|
@@ -70,6 +70,14 @@
|
|
|
70
70
|
{{#if addPreRendering}}
|
|
71
71
|
// Lambda SSR specific: detect device to cover different resolutions when rendered in lambda
|
|
72
72
|
userAgentDetection: true,
|
|
73
|
+
{{else if addUADetection}}
|
|
74
|
+
userAgentDetection: true,
|
|
75
|
+
{{/if}}
|
|
76
|
+
{{#if addUADetection}}
|
|
77
|
+
detectDevice: function(doc) {
|
|
78
|
+
// TODO adjust condition to your needs
|
|
79
|
+
return doc.querySelector('<mobile-specific-element>') ? "mobile" : "desktop";
|
|
80
|
+
},
|
|
73
81
|
{{/if}}
|
|
74
82
|
split: CURRENT_HOST_CONFIG.split,
|
|
75
83
|
splitTestId: CURRENT_HOST_CONFIG.splitTestId,
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
// ssr container
|
|
9
9
|
prerendered: [{ selector: "body > .speed-kit-shadow-app-root" }],
|
|
10
10
|
{{/if}}
|
|
11
|
-
|
|
11
|
+
{{#if addUADetection}}
|
|
12
|
+
detectDevice: (doc) => {
|
|
13
|
+
// TODO adjust condition to your needs
|
|
14
|
+
return doc.querySelector('<mobile-specific-element>') ? "mobile" : "desktop";
|
|
15
|
+
},
|
|
16
|
+
{{/if}}
|
|
12
17
|
blocks: [
|
|
13
18
|
// TODO: adjust/replace this exemplary list
|
|
14
19
|
{
|
|
@@ -6,6 +6,7 @@ const document_handler_runtime_context_1 = require("./context/document-handler-r
|
|
|
6
6
|
const required_file_not_found_error_1 = tslib_1.__importDefault(require("./error/required-file-not-found-error"));
|
|
7
7
|
const database_mock_1 = tslib_1.__importDefault(require("./templates/database-mock"));
|
|
8
8
|
const vm = tslib_1.__importStar(require("node:vm"));
|
|
9
|
+
const cli_1 = require("../cli");
|
|
9
10
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
10
11
|
const files_1 = require("../../models/files");
|
|
11
12
|
// documentHandlerDependencies
|
|
@@ -216,9 +217,18 @@ class DocumentHandlerServer {
|
|
|
216
217
|
createFetchMock() {
|
|
217
218
|
return async (url, options) => {
|
|
218
219
|
if (this.verboseLevel) {
|
|
219
|
-
this.cli.
|
|
220
|
+
this.cli.startAction(this.cli.style.yellow(`[documentHandler.fetch]: ${url}`));
|
|
220
221
|
}
|
|
221
|
-
|
|
222
|
+
const result = await (0, safe_1.safe)((0, node_fetch_1.default)(url, options));
|
|
223
|
+
if (result.success === true) {
|
|
224
|
+
this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
|
|
225
|
+
return result.data;
|
|
226
|
+
}
|
|
227
|
+
this.cli.endAction(cli_1.CliActionStatus.FAILED);
|
|
228
|
+
if (result.errorObj) {
|
|
229
|
+
throw result.errorObj;
|
|
230
|
+
}
|
|
231
|
+
throw new Error(result.error);
|
|
222
232
|
};
|
|
223
233
|
}
|
|
224
234
|
createProcessPartial() {
|
package/oclif.manifest.json
CHANGED