@speedkit/cli 2.30.0 → 2.30.1
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 +10 -0
- package/README.md +1 -1
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +9 -7
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +2 -1
- package/dist/services/onboarding/onboarding-model.d.ts +1 -0
- package/dist/services/onboarding/onboarding-model.js +2 -1
- package/dist/services/onboarding/virtual-orestes-app/index.js +2 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [2.30.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.30.0...v2.30.1) (2024-06-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **onboarding:** install resource regex ([3fe4ef9](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/3fe4ef9aadaedef45edd2a91f07ab8bb14b00687))
|
|
7
|
+
* **split-change-check:** allow void return type for active install resource getter ([ed39aab](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/ed39aab739b85830f8d5c1ef57d57b5b794beb7b))
|
|
8
|
+
* **split-change-check:** prevent deployment abort if origin do not exist yet ([32c722f](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/32c722f4c2af2c41a0a3bf6ee5aced3bb0b64c05))
|
|
9
|
+
* **split-change-check:** replace try catch with simple active install resource check ([d588122](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/d588122a8dd91accde473c2b8eaedcfdb7b9460f))
|
|
10
|
+
|
|
1
11
|
# [2.30.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.29.1...v2.30.0) (2024-05-29)
|
|
2
12
|
|
|
3
13
|
|
package/README.md
CHANGED
|
@@ -22,21 +22,23 @@ class SplitChangeCheck {
|
|
|
22
22
|
this.isProduction = isProduction;
|
|
23
23
|
}
|
|
24
24
|
async check() {
|
|
25
|
-
this.cli.startAction("check SplitTestId");
|
|
26
25
|
if (
|
|
27
|
-
// do not check for
|
|
26
|
+
// do not check for environments other than production
|
|
28
27
|
!this.isProduction ||
|
|
29
|
-
// check if
|
|
28
|
+
// do not check if speedKitConfigFile is not to be deployed
|
|
30
29
|
!this.fileList.hasFile(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT) ||
|
|
31
|
-
// check if we skipped the speedKitConfigFile
|
|
32
30
|
this.fileList
|
|
33
31
|
.getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT)
|
|
34
32
|
.shouldSkipFile()) {
|
|
35
|
-
this.cli.endAction(cli_1.CliActionStatus.SKIPPED);
|
|
36
33
|
return;
|
|
37
34
|
}
|
|
38
|
-
const speedKitConfigFile = this.fileList.getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT);
|
|
39
35
|
const activeInstallResource = await this.getActiveInstallResource();
|
|
36
|
+
// do not check if there is no active install resource to be updated
|
|
37
|
+
if (!activeInstallResource) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.cli.startAction("Checking Split Test ID");
|
|
41
|
+
const speedKitConfigFile = this.fileList.getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT);
|
|
40
42
|
const activeSpeedKitConfig = activeInstallResource[speedKitConfigFile.remoteKey];
|
|
41
43
|
const changesResponse = (0, safe_1.safe)(() => {
|
|
42
44
|
return this.checkSplitsForEachOrigin(speedKitConfigFile, activeSpeedKitConfig);
|
|
@@ -132,7 +134,7 @@ class SplitChangeCheck {
|
|
|
132
134
|
const activeInstallResourceResponse = await (0, safe_1.safe)(this.configApi.getActiveInstall(this.configName));
|
|
133
135
|
if (activeInstallResourceResponse.success !== true) {
|
|
134
136
|
this.cli.endAction(cli_1.CliActionStatus.FAILED);
|
|
135
|
-
this.cli.writeError("Could not load active
|
|
137
|
+
this.cli.writeError("Could not load active install resource");
|
|
136
138
|
this.cli.exit(1);
|
|
137
139
|
return;
|
|
138
140
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustomerDomainDocumentResponse = void 0;
|
|
4
|
+
const onboarding_model_1 = require("../onboarding-model");
|
|
4
5
|
const origin_response_1 = require("../browser/origin-response");
|
|
5
6
|
/**
|
|
6
7
|
* Intercepts any request to the customersOrigin and equivalent requests to baqendAssetApi
|
|
@@ -109,7 +110,7 @@ class CustomerDomainDocumentResponse {
|
|
|
109
110
|
return text.includes("speed-kit-dynamic");
|
|
110
111
|
}
|
|
111
112
|
rewriteInstallResource(text) {
|
|
112
|
-
text = text.replace(
|
|
113
|
+
text = text.replace(onboarding_model_1.SpeedKitInstallRegex, "");
|
|
113
114
|
return text.replace(/<\s*head\b[^>]*>/, (head) => {
|
|
114
115
|
return `${head}\n<script src="${this.customerConfig.installPath}" ${this.customerConfig.installParams}></script>`;
|
|
115
116
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.USER_AGENT = exports.OnboardingContext = exports.BrowserContext = void 0;
|
|
3
|
+
exports.SpeedKitInstallRegex = exports.USER_AGENT = exports.OnboardingContext = exports.BrowserContext = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const cli_parameters_1 = require("../../models/cli-parameters");
|
|
6
6
|
const DEFAULT_BROWSER_ARGS = [
|
|
@@ -86,3 +86,4 @@ exports.USER_AGENT = {
|
|
|
86
86
|
DESKTOP: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36 (compatible; SpeedKit/1.0)",
|
|
87
87
|
MOBILE: "Mozilla/5.0 (Linux; Android 7.1.1; ONEPLUS A5000 Build/NMF26X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36 (compatible; SpeedKit/1.0)",
|
|
88
88
|
};
|
|
89
|
+
exports.SpeedKitInstallRegex = /<script(?:(?!<\/script>).)*app\.baqend\.com\/v1\/speedkit\/install.js(?:(?!<\/script>).)*<\/script>/s;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VirtualOrestesApp = void 0;
|
|
4
4
|
const baqend_response_1 = require("../browser/baqend-response");
|
|
5
5
|
const safe_1 = require("../../../helpers/safe");
|
|
6
|
+
const onboarding_model_1 = require("../onboarding-model");
|
|
6
7
|
class VirtualOrestesApp {
|
|
7
8
|
customerConfig;
|
|
8
9
|
crawler;
|
|
@@ -181,7 +182,7 @@ class VirtualOrestesApp {
|
|
|
181
182
|
return text.includes("<html");
|
|
182
183
|
}
|
|
183
184
|
rewriteInstallResource(text) {
|
|
184
|
-
text = text.replace(
|
|
185
|
+
text = text.replace(onboarding_model_1.SpeedKitInstallRegex, "");
|
|
185
186
|
return text.replace(/<\s*head\b[^>]*>/, (head) => {
|
|
186
187
|
return `${head}\n<script src="${this.customerConfig.installPath}" ${this.customerConfig.installParams}></script>`;
|
|
187
188
|
});
|
package/oclif.manifest.json
CHANGED