@speedkit/cli 3.31.1 → 3.32.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 +14 -0
- package/README.md +1 -1
- package/dist/commands/generate-pop-config.js +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 +63 -36
- package/dist/services/deploy/handler/customer-config-handler.js +2 -2
- package/dist/services/deploy/handler/install-resource-handler.js +2 -2
- package/dist/services/deploy/handler/module-handler.js +2 -2
- package/dist/services/deploy/handler/server-config-handler.js +2 -2
- package/dist/services/diff/diff-service.d.ts +1 -1
- package/dist/services/diff/diff-service.js +4 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.32.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.31.2...v3.32.0) (2026-03-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **customer-config:** add disabled sites approach template snippet ([38da0c3](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/38da0c3936b42b4ae003c6b3836aab66f6e73b4a))
|
|
7
|
+
|
|
8
|
+
## [3.31.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.31.1...v3.31.2) (2026-03-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **diff:** return updatedFile instead of originalFile after diff ([4894d1b](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/4894d1bc93387665add4d85af35b93650a911103))
|
|
14
|
+
|
|
1
15
|
## [3.31.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.31.0...v3.31.1) (2026-03-09)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ class GeneratePopConfig extends core_1.Command {
|
|
|
138
138
|
const remoteConfig = await configService.getRemoteModule(moduleName);
|
|
139
139
|
const result = await diffService.diffContent(moduleName, remoteConfig, // remoteContent
|
|
140
140
|
popPrewarmingCode);
|
|
141
|
-
const content = result.
|
|
141
|
+
const content = result.updatedFile;
|
|
142
142
|
const isEqual = result.diff;
|
|
143
143
|
if (isEqual) {
|
|
144
144
|
cliService.write(`created config is the same as the deployed one`);
|
|
@@ -136,7 +136,7 @@ class CustomerConfigService {
|
|
|
136
136
|
return true;
|
|
137
137
|
}
|
|
138
138
|
async getConfigSettings() {
|
|
139
|
-
let { production, staging, includeServiceWorker, activateImageOptimisation, removeLazyLoading, addSSR, addSSRInnerShadowDomSupport, addDeviceDetection, useGATracking, useScrapingBee, withGoogleOptimize, activateCfRocketLoaderPlugin, hasSoftNavigations, convertSoftToHardNavigations, isShopify, isShopware, isSalesforce, isOxid, isPlentymarkets, isPOV, } = {};
|
|
139
|
+
let { production, staging, includeServiceWorker, activateImageOptimisation, removeLazyLoading, addSSR, addSSRInnerShadowDomSupport, addDeviceDetection, useGATracking, useScrapingBee, withGoogleOptimize, activateCfRocketLoaderPlugin, hasSoftNavigations, convertSoftToHardNavigations, useDisabledSitesApproach, isShopify, isShopware, isSalesforce, isOxid, isPlentymarkets, isPOV, } = {};
|
|
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,
|
|
@@ -176,6 +176,7 @@ class CustomerConfigService {
|
|
|
176
176
|
if (await this.cli.confirm("[Service Worker] Is there a Service Worker which needs to be included?", false)) {
|
|
177
177
|
includeServiceWorker = await this.cli.prompt("[Service Worker] Enter path of Service Worker to be included:", { defaultAnswer: "/sw.js" });
|
|
178
178
|
}
|
|
179
|
+
useDisabledSitesApproach = await this.cli.confirm("[Disabled Sites] Use disabled sites approach as the given URL structure makes it hard to identify specific page types?", false);
|
|
179
180
|
activateImageOptimisation = await this.cli.confirm("[IO] Should image optimisation be activated?", false);
|
|
180
181
|
removeLazyLoading = await this.cli.confirm("[Lazy Loading] Does the shop require us to resolve lazy-loaded content?");
|
|
181
182
|
if (await this.cli.confirm("[Lambda SSR] Add server-side-rendering? This requires a set-up Lambda function to work.", false)) {
|
|
@@ -215,6 +216,7 @@ class CustomerConfigService {
|
|
|
215
216
|
activateCfRocketLoaderPlugin,
|
|
216
217
|
hasSoftNavigations,
|
|
217
218
|
convertSoftToHardNavigations,
|
|
219
|
+
useDisabledSitesApproach,
|
|
218
220
|
isShopify,
|
|
219
221
|
isShopware,
|
|
220
222
|
isSalesforce,
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
{{#*inline "disabledSites"}}
|
|
2
|
+
// TODO: adjust/replace this exemplary list
|
|
3
|
+
{{#if isPlentymarkets}}
|
|
4
|
+
|
|
5
|
+
// Plentymarkets specific:
|
|
6
|
+
/kundenkonto/i,
|
|
7
|
+
/warenkorb/i,
|
|
8
|
+
{{/if}}
|
|
9
|
+
|
|
10
|
+
// Login & Account:
|
|
11
|
+
/account/i,
|
|
12
|
+
/profile/i,
|
|
13
|
+
/password/i,
|
|
14
|
+
/registration/i,
|
|
15
|
+
/register/i,
|
|
16
|
+
/login/i,
|
|
17
|
+
/authenticate/i,
|
|
18
|
+
/wish(-)?list/i,
|
|
19
|
+
|
|
20
|
+
// Checkout & Payment:
|
|
21
|
+
/cart/i,
|
|
22
|
+
/basket/i,
|
|
23
|
+
/checkout/i,
|
|
24
|
+
/order/i,
|
|
25
|
+
/success/i,
|
|
26
|
+
/confirmation/i,
|
|
27
|
+
/payment/i,
|
|
28
|
+
/success/i,
|
|
29
|
+
|
|
30
|
+
// Admin:
|
|
31
|
+
/\/admin/i,
|
|
32
|
+
/\/backend/i,
|
|
33
|
+
{{/inline}}
|
|
34
|
+
|
|
1
35
|
(function() {
|
|
2
36
|
var ENABLED_HOSTS_CONFIGS = [
|
|
3
37
|
// Production:
|
|
@@ -24,6 +58,16 @@
|
|
|
24
58
|
];
|
|
25
59
|
var ENABLED_HOSTS = getEnabledHosts(ENABLED_HOSTS_CONFIGS);
|
|
26
60
|
var CURRENT_HOST_CONFIG = getCurrentHostConfig(ENABLED_HOSTS_CONFIGS);
|
|
61
|
+
{{#if useDisabledSitesApproach}}
|
|
62
|
+
|
|
63
|
+
var DISABLED_SITES = [
|
|
64
|
+
// Used as pathnames in...
|
|
65
|
+
// - disabled sites
|
|
66
|
+
// - blacklist
|
|
67
|
+
|
|
68
|
+
{{> disabledSites}}
|
|
69
|
+
];
|
|
70
|
+
{{/if}}
|
|
27
71
|
|
|
28
72
|
/**
|
|
29
73
|
* @type {SpeedKitConfig}
|
|
@@ -143,56 +187,39 @@
|
|
|
143
187
|
{{/if}}
|
|
144
188
|
],
|
|
145
189
|
blacklist: [
|
|
190
|
+
{{#if useDisabledSitesApproach}}
|
|
191
|
+
{
|
|
192
|
+
pathname: DISABLED_SITES,
|
|
193
|
+
},
|
|
194
|
+
{{/if}}
|
|
146
195
|
{
|
|
147
196
|
pathname: [
|
|
148
|
-
|
|
197
|
+
{{#if isPlentymarkets}}
|
|
149
198
|
|
|
150
|
-
//
|
|
151
|
-
/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
/checkout/i,
|
|
164
|
-
/order/i,
|
|
165
|
-
/success/i,
|
|
166
|
-
/confirmation/i,
|
|
167
|
-
/payment/i,
|
|
199
|
+
// Plentymarkets specific:
|
|
200
|
+
/\/rest/i, // REST API
|
|
201
|
+
{{/if}}
|
|
202
|
+
{{#if isSalesforce}}
|
|
203
|
+
|
|
204
|
+
// SFCC specific:
|
|
205
|
+
/\/demandware\.store/i, // high-level api blacklist
|
|
206
|
+
{{/if}}
|
|
207
|
+
{{#unless useDisabledSitesApproach}}
|
|
208
|
+
{{> disabledSites}}
|
|
209
|
+
{{/unless}}
|
|
210
|
+
|
|
211
|
+
// Payment Services:
|
|
168
212
|
/paypal/i,
|
|
169
213
|
/klarna/i,
|
|
170
214
|
/amazon/i,
|
|
171
215
|
/ratepay/i,
|
|
172
216
|
/payone/i,
|
|
173
|
-
/success/i,
|
|
174
|
-
|
|
175
|
-
// Admin:
|
|
176
|
-
/\/admin/i,
|
|
177
|
-
/\/backend/i,
|
|
178
217
|
|
|
179
218
|
// Misc:
|
|
180
219
|
/\/akam\//i, // Akamai telemetry data
|
|
181
220
|
/\.pdf/,
|
|
182
221
|
/\/adyen/i,
|
|
183
222
|
/\/cdn-cgi\//i, // dynamic scripts
|
|
184
|
-
{{#if isPlentymarkets}}
|
|
185
|
-
|
|
186
|
-
// Plentymarkets specific:
|
|
187
|
-
/\/rest/i, // REST API
|
|
188
|
-
/kundenkonto/i,
|
|
189
|
-
/warenkorb/i,
|
|
190
|
-
{{/if}}
|
|
191
|
-
{{#if isSalesforce}}
|
|
192
|
-
|
|
193
|
-
// SFCC specific:
|
|
194
|
-
/\/demandware\.store/i, // high-level api blacklist
|
|
195
|
-
{{/if}}
|
|
196
223
|
],
|
|
197
224
|
},
|
|
198
225
|
{
|
|
@@ -43,8 +43,8 @@ class CustomerConfigHandler {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
// todo: add changedThrowable, let the handler catch and decide what to do with it
|
|
46
|
-
const {
|
|
47
|
-
const origins = JSON.parse(
|
|
46
|
+
const { updatedFile } = await this.diffService.diffContent(file.name, JSON.stringify(config.origins, null, 4), JSON.stringify(installResource.origins, null, 4));
|
|
47
|
+
const origins = JSON.parse(updatedFile);
|
|
48
48
|
file.updateOrigins(origins);
|
|
49
49
|
if (!(await this.cli.confirm("Update origins?", true))) {
|
|
50
50
|
file.skipFile();
|
|
@@ -94,10 +94,10 @@ class InstallResourceHandler {
|
|
|
94
94
|
await this.confirm(file, true);
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
const {
|
|
97
|
+
const { updatedFile, diff } = await this.diffService.diffContent(file.name, // fileName
|
|
98
98
|
installResource[file.remoteKey], // remote file content
|
|
99
99
|
file.getContent());
|
|
100
|
-
file.setContent(
|
|
100
|
+
file.setContent(updatedFile);
|
|
101
101
|
if (diff) {
|
|
102
102
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
103
103
|
file.skipFile();
|
|
@@ -32,8 +32,8 @@ class ModuleHandler {
|
|
|
32
32
|
await this.confirm(file, true);
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
const {
|
|
36
|
-
file.setContent(
|
|
35
|
+
const { updatedFile, diff } = await this.diffService.diffContent(file.name, remote, file.getContent());
|
|
36
|
+
file.setContent(updatedFile);
|
|
37
37
|
if (diff) {
|
|
38
38
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
39
39
|
file.skipFile();
|
|
@@ -27,8 +27,8 @@ class ServerConfigHandler {
|
|
|
27
27
|
const remoteConfig = JSON.parse(remote);
|
|
28
28
|
// @ts-expect-error revision is unknown
|
|
29
29
|
file.config.revision.version = remoteConfig.revision.version;
|
|
30
|
-
const {
|
|
31
|
-
file.setContent(
|
|
30
|
+
const { updatedFile, diff } = await this.diffService.diffContent(file.name, remote, file.getContent());
|
|
31
|
+
file.setContent(updatedFile);
|
|
32
32
|
if (diff) {
|
|
33
33
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
34
34
|
file.skipFile();
|
|
@@ -7,7 +7,7 @@ export declare class DiffService {
|
|
|
7
7
|
constructor(cli: CliService, diffExecutablePath?: string, diffExecutableTemplate?: string);
|
|
8
8
|
diff(localPath: string, fileName: string, temporaryContent: string): Promise<boolean>;
|
|
9
9
|
diffContent(fileName: string, firstContent: string, secondContent: string, diffSuffix?: string[]): Promise<{
|
|
10
|
-
|
|
10
|
+
updatedFile: string;
|
|
11
11
|
diff: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
/**
|
|
@@ -26,8 +26,10 @@ class DiffService {
|
|
|
26
26
|
const temporaryFirstFilePath = await this.writeContentToTemporalFile(`${fileName}-${diffSuffix[0]}`, firstContent);
|
|
27
27
|
const temporarySecondFilePath = await this.writeContentToTemporalFile(`${fileName}-${diffSuffix[1]}`, secondContent);
|
|
28
28
|
const diff = await this.executeDiff(temporaryFirstFilePath, temporarySecondFilePath);
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// return changes made in diffView
|
|
30
|
+
// eg adding changes from remote to safe locally
|
|
31
|
+
const changedFile = await (0, promises_1.readFile)(temporarySecondFilePath, "utf-8");
|
|
32
|
+
return { updatedFile: changedFile, diff };
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Returns a temporal directory path.
|
package/oclif.manifest.json
CHANGED