@speedkit/cli 2.29.1 → 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 +17 -0
- package/README.md +10 -9
- package/dist/commands/onboarding.js +4 -4
- package/dist/models/cli-parameters.d.ts +4 -1
- package/dist/models/cli-parameters.js +4 -1
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +9 -7
- package/dist/services/integration-api/struct/customer-config.js +1 -1
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +2 -1
- package/dist/services/onboarding/onboarding-model.d.ts +3 -1
- package/dist/services/onboarding/onboarding-model.js +9 -2
- package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -0
- package/dist/services/onboarding/onboarding-service-factory.js +16 -6
- package/dist/services/onboarding/virtual-orestes-app/index.js +2 -1
- package/oclif.manifest.json +16 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
11
|
+
# [2.30.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.29.1...v2.30.0) (2024-05-29)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **onboarding:** optimise start domain handling ([4128094](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/4128094f16fc208085654e4b8fc84d44f7c85307))
|
|
17
|
+
|
|
1
18
|
## [2.29.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.29.0...v2.29.1) (2024-05-29)
|
|
2
19
|
|
|
3
20
|
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
|
|
|
21
21
|
$ sk COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ sk (--version)
|
|
24
|
-
@speedkit/cli/2.
|
|
24
|
+
@speedkit/cli/2.30.1 linux-x64 node-v20.14.0
|
|
25
25
|
$ sk --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ sk COMMAND
|
|
@@ -133,7 +133,7 @@ DESCRIPTION
|
|
|
133
133
|
EXAMPLES
|
|
134
134
|
$ sk build-parameter-query <customerPath> -c <configName>
|
|
135
135
|
|
|
136
|
-
$ sk build-parameter-query
|
|
136
|
+
$ sk build-parameter-query customers/decathlon.de -c production
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
## `sk build-prewarm-query CUSTOMERPATH`
|
|
@@ -156,7 +156,7 @@ DESCRIPTION
|
|
|
156
156
|
EXAMPLES
|
|
157
157
|
$ sk build-prewarm-query <customerPath> -c <configName>
|
|
158
158
|
|
|
159
|
-
$ sk build-prewarm-query
|
|
159
|
+
$ sk build-prewarm-query customers/decathlon.de -c production
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
## `sk deploy CUSTOMERPATH`
|
|
@@ -182,7 +182,7 @@ DESCRIPTION
|
|
|
182
182
|
EXAMPLES
|
|
183
183
|
$ sk deploy <customerPath> -c <configName> -t <slackToken> -a <artifacts> -d <dryRun>
|
|
184
184
|
|
|
185
|
-
$ sk deploy
|
|
185
|
+
$ sk deploy customers/decathlon.de -c production -t someSlackToken -a dynamic,SpeedKit -d
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
## `sk diff-url-parameters PAGEURL`
|
|
@@ -232,7 +232,7 @@ DESCRIPTION
|
|
|
232
232
|
EXAMPLES
|
|
233
233
|
$ sk documentHandler <customerPath> -c <configName>
|
|
234
234
|
|
|
235
|
-
$ sk deploy
|
|
235
|
+
$ sk deploy customers/decathlon.de -c production
|
|
236
236
|
```
|
|
237
237
|
|
|
238
238
|
## `sk find-pops APP`
|
|
@@ -364,13 +364,14 @@ Start a local dev environment for building and testing the Speed Kit configurati
|
|
|
364
364
|
|
|
365
365
|
```
|
|
366
366
|
USAGE
|
|
367
|
-
$ sk onboarding CUSTOMERPATH [-c <value>] [-l] [-v] [-s]
|
|
367
|
+
$ sk onboarding CUSTOMERPATH [-c <value>] [-d <value>] [-l] [-v] [-s]
|
|
368
368
|
|
|
369
369
|
ARGUMENTS
|
|
370
370
|
CUSTOMERPATH The customer config path
|
|
371
371
|
|
|
372
372
|
FLAGS
|
|
373
373
|
-c, --configName=<value> [default: production] The costumer config name
|
|
374
|
+
-d, --domain=<value> Startup domain (optional)
|
|
374
375
|
-l, --local Run with local documentHandler
|
|
375
376
|
-s, --ignoreContentSecurityPolicy Removes header/meta "content-security-policy" for origin-responses
|
|
376
377
|
-v, --verboseLevel Show all messages
|
|
@@ -379,9 +380,9 @@ DESCRIPTION
|
|
|
379
380
|
Start a local dev environment for building and testing the Speed Kit configuration
|
|
380
381
|
|
|
381
382
|
EXAMPLES
|
|
382
|
-
$ sk onboarding <customerPath> -c <configName>
|
|
383
|
+
$ sk onboarding <customerPath> -c <configName> -d <domain>
|
|
383
384
|
|
|
384
|
-
$ sk onboarding
|
|
385
|
+
$ sk onboarding customers/decathlon.de -c production -d www.decathlon.de
|
|
385
386
|
```
|
|
386
387
|
|
|
387
388
|
## `sk param-diff PAGEURL`
|
|
@@ -470,7 +471,7 @@ DESCRIPTION
|
|
|
470
471
|
EXAMPLES
|
|
471
472
|
$ sk pull <customerPath>
|
|
472
473
|
|
|
473
|
-
$ sk pull
|
|
474
|
+
$ sk pull customers/decathlon.de -c production
|
|
474
475
|
```
|
|
475
476
|
|
|
476
477
|
## `sk wpt-launcher URLS TESTID`
|
|
@@ -9,12 +9,12 @@ class Onboarding extends core_1.Command {
|
|
|
9
9
|
static flags = onboarding_1.OnboardingContext.flags;
|
|
10
10
|
static args = cli_parameters_1.CLI_CUSTOMER_CONFIG;
|
|
11
11
|
static examples = [
|
|
12
|
-
`$ sk onboarding <${cli_parameters_1.CLIParameters.CustomerPath}> -${cli_parameters_1.CLIParametersChar.ConfigName} <${cli_parameters_1.CLIParameters.ConfigName}>`,
|
|
13
|
-
`$ sk onboarding ${cli_parameters_1.CLIParametersExample.CustomerPath} -${cli_parameters_1.CLIParametersChar.ConfigName} ${cli_parameters_1.CLIParametersExample.ConfigName}`,
|
|
12
|
+
`$ sk onboarding <${cli_parameters_1.CLIParameters.CustomerPath}> -${cli_parameters_1.CLIParametersChar.ConfigName} <${cli_parameters_1.CLIParameters.ConfigName}> -${cli_parameters_1.CLIParametersChar.Domain} <${cli_parameters_1.CLIParameters.Domain}>`,
|
|
13
|
+
`$ sk onboarding ${cli_parameters_1.CLIParametersExample.CustomerPath} -${cli_parameters_1.CLIParametersChar.ConfigName} ${cli_parameters_1.CLIParametersExample.ConfigName} -${cli_parameters_1.CLIParametersChar.Domain} ${cli_parameters_1.CLIParametersExample.Domain}`,
|
|
14
14
|
];
|
|
15
15
|
async run() {
|
|
16
|
-
const { args: { customerPath }, flags: { configName, local, verboseLevel, ignoreContentSecurityPolicy }, } = await this.parse(Onboarding);
|
|
17
|
-
const service = await new onboarding_1.OnboardingServiceFactory(new onboarding_1.OnboardingContext(customerPath, configName, local, verboseLevel, ignoreContentSecurityPolicy), new cli_config_1.CliConfig(this.config).load()).getService();
|
|
16
|
+
const { args: { customerPath }, flags: { configName, domain, local, verboseLevel, ignoreContentSecurityPolicy, }, } = await this.parse(Onboarding);
|
|
17
|
+
const service = await new onboarding_1.OnboardingServiceFactory(new onboarding_1.OnboardingContext(customerPath, configName, domain, local, verboseLevel, ignoreContentSecurityPolicy), new cli_config_1.CliConfig(this.config).load()).getService();
|
|
18
18
|
await service.run();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -8,6 +8,7 @@ export declare enum CLIParameters {
|
|
|
8
8
|
CustomerPath = "customerPath",
|
|
9
9
|
CustomersDirectory = "customersDirectory",
|
|
10
10
|
Delay = "delay",
|
|
11
|
+
Domain = "domain",
|
|
11
12
|
DryRun = "dryRun",
|
|
12
13
|
Group = "group",
|
|
13
14
|
HideDiff = "hideDiff",
|
|
@@ -33,6 +34,7 @@ export declare enum CLIParametersChar {
|
|
|
33
34
|
CustomerPath = "p",
|
|
34
35
|
CustomersDirectory = "d",
|
|
35
36
|
Delay = "d",
|
|
37
|
+
Domain = "d",
|
|
36
38
|
DryRun = "d",
|
|
37
39
|
Group = "g",
|
|
38
40
|
HideDiff = "h",
|
|
@@ -51,9 +53,10 @@ export declare enum CLIParametersExample {
|
|
|
51
53
|
ConfigName = "production",
|
|
52
54
|
ContentTypes = "image,style",
|
|
53
55
|
Cookies = "consentCookies",
|
|
54
|
-
CustomerPath = "
|
|
56
|
+
CustomerPath = "customers/decathlon.de",
|
|
55
57
|
CustomersDirectory = "customers",
|
|
56
58
|
Delay = "1200",
|
|
59
|
+
Domain = "www.decathlon.de",
|
|
57
60
|
Group = "B",
|
|
58
61
|
Ips = "151.101.120.194",
|
|
59
62
|
Mobile = "Y",
|
|
@@ -13,6 +13,7 @@ var CLIParameters;
|
|
|
13
13
|
CLIParameters["CustomerPath"] = "customerPath";
|
|
14
14
|
CLIParameters["CustomersDirectory"] = "customersDirectory";
|
|
15
15
|
CLIParameters["Delay"] = "delay";
|
|
16
|
+
CLIParameters["Domain"] = "domain";
|
|
16
17
|
CLIParameters["DryRun"] = "dryRun";
|
|
17
18
|
CLIParameters["Group"] = "group";
|
|
18
19
|
CLIParameters["HideDiff"] = "hideDiff";
|
|
@@ -40,6 +41,7 @@ var CLIParametersChar;
|
|
|
40
41
|
CLIParametersChar["CustomerPath"] = "p";
|
|
41
42
|
CLIParametersChar["CustomersDirectory"] = "d";
|
|
42
43
|
CLIParametersChar["Delay"] = "d";
|
|
44
|
+
CLIParametersChar["Domain"] = "d";
|
|
43
45
|
CLIParametersChar["DryRun"] = "d";
|
|
44
46
|
CLIParametersChar["Group"] = "g";
|
|
45
47
|
CLIParametersChar["HideDiff"] = "h";
|
|
@@ -60,9 +62,10 @@ var CLIParametersExample;
|
|
|
60
62
|
CLIParametersExample["ConfigName"] = "production";
|
|
61
63
|
CLIParametersExample["ContentTypes"] = "image,style";
|
|
62
64
|
CLIParametersExample["Cookies"] = "consentCookies";
|
|
63
|
-
CLIParametersExample["CustomerPath"] = "
|
|
65
|
+
CLIParametersExample["CustomerPath"] = "customers/decathlon.de";
|
|
64
66
|
CLIParametersExample["CustomersDirectory"] = "customers";
|
|
65
67
|
CLIParametersExample["Delay"] = "1200";
|
|
68
|
+
CLIParametersExample["Domain"] = "www.decathlon.de";
|
|
66
69
|
CLIParametersExample["Group"] = "B";
|
|
67
70
|
CLIParametersExample["Ips"] = "151.101.120.194";
|
|
68
71
|
CLIParametersExample["Mobile"] = "Y";
|
|
@@ -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
|
}
|
|
@@ -32,7 +32,7 @@ class CustomerConfig {
|
|
|
32
32
|
}
|
|
33
33
|
static createFrom(configFile, configName) {
|
|
34
34
|
const { app, origins, domain, swPath, scope, appDomain, installPath, installParams, name, forceInstall, chromeFlags, dependencies, } = configFile;
|
|
35
|
-
return new CustomerConfig(new RequiredParameter("app", app).isString().getValue(), new RequiredParameter("origins", origins).isArray().getValue(),
|
|
35
|
+
return new CustomerConfig(new RequiredParameter("app", app).isString().getValue(), new RequiredParameter("origins", origins).isArray().getValue(), domain, new RequiredParameter("swPath", swPath).isString().getValue(), new RequiredParameter("scope", scope).isString().getValue(), appDomain || `${app}.app.baqend.com`, installPath ||
|
|
36
36
|
`https://${app}.app.baqend.com/v1/speedkit/install.js?d=${name || configName}`, installParams || 'async="" crossorigin="anonymous"', name, forceInstall || true, chromeFlags, dependencies || {});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -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
|
});
|
|
@@ -20,6 +20,7 @@ export interface FetchRequestPausedEventHandler {
|
|
|
20
20
|
export declare class OnboardingContext {
|
|
21
21
|
readonly customerPath: string;
|
|
22
22
|
readonly configName: string;
|
|
23
|
+
readonly domain: string;
|
|
23
24
|
readonly local: boolean;
|
|
24
25
|
readonly verboseLevel?: boolean;
|
|
25
26
|
readonly ignoreContentSecurityPolicy: boolean;
|
|
@@ -28,7 +29,7 @@ export declare class OnboardingContext {
|
|
|
28
29
|
readonly DEFAULT_DOCUMENT_HANDLER_PATH = "https://www.baqend.com/speed-kit-handler/latest/DocumentHandler.js";
|
|
29
30
|
readonly DEFAULT_SNIPPET_PATH = "https://www.baqend.com/speed-kit/latest/snippet.js";
|
|
30
31
|
readonly DEFAULT_SW_PATH = "https://www.baqend.com/speed-kit/latest/sw.js";
|
|
31
|
-
constructor(customerPath: string, configName: string, local: boolean, verboseLevel?: boolean, ignoreContentSecurityPolicy?: boolean);
|
|
32
|
+
constructor(customerPath: string, configName: string, domain: string, local: boolean, verboseLevel?: boolean, ignoreContentSecurityPolicy?: boolean);
|
|
32
33
|
}
|
|
33
34
|
export type SpeedKitServerConfigAuthentication = {
|
|
34
35
|
password: string;
|
|
@@ -72,3 +73,4 @@ export declare const USER_AGENT: {
|
|
|
72
73
|
DESKTOP: string;
|
|
73
74
|
MOBILE: string;
|
|
74
75
|
};
|
|
76
|
+
export declare const SpeedKitInstallRegex: RegExp;
|
|
@@ -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 = [
|
|
@@ -42,11 +42,16 @@ exports.BrowserContext = BrowserContext;
|
|
|
42
42
|
class OnboardingContext {
|
|
43
43
|
customerPath;
|
|
44
44
|
configName;
|
|
45
|
+
domain;
|
|
45
46
|
local;
|
|
46
47
|
verboseLevel;
|
|
47
48
|
ignoreContentSecurityPolicy;
|
|
48
49
|
static flags = {
|
|
49
50
|
...cli_parameters_1.CLI_CONFIG_NAME,
|
|
51
|
+
[cli_parameters_1.CLIParameters.Domain]: core_1.Flags.string({
|
|
52
|
+
char: cli_parameters_1.CLIParametersChar.Domain,
|
|
53
|
+
description: "Startup domain (optional)",
|
|
54
|
+
}),
|
|
50
55
|
local: core_1.Flags.boolean({
|
|
51
56
|
char: "l",
|
|
52
57
|
default: false,
|
|
@@ -67,9 +72,10 @@ class OnboardingContext {
|
|
|
67
72
|
DEFAULT_DOCUMENT_HANDLER_PATH = "https://www.baqend.com/speed-kit-handler/latest/DocumentHandler.js";
|
|
68
73
|
DEFAULT_SNIPPET_PATH = "https://www.baqend.com/speed-kit/latest/snippet.js";
|
|
69
74
|
DEFAULT_SW_PATH = "https://www.baqend.com/speed-kit/latest/sw.js";
|
|
70
|
-
constructor(customerPath, configName, local, verboseLevel, ignoreContentSecurityPolicy = false) {
|
|
75
|
+
constructor(customerPath, configName, domain, local, verboseLevel, ignoreContentSecurityPolicy = false) {
|
|
71
76
|
this.customerPath = customerPath;
|
|
72
77
|
this.configName = configName;
|
|
78
|
+
this.domain = domain;
|
|
73
79
|
this.local = local;
|
|
74
80
|
this.verboseLevel = verboseLevel;
|
|
75
81
|
this.ignoreContentSecurityPolicy = ignoreContentSecurityPolicy;
|
|
@@ -80,3 +86,4 @@ exports.USER_AGENT = {
|
|
|
80
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)",
|
|
81
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)",
|
|
82
88
|
};
|
|
89
|
+
exports.SpeedKitInstallRegex = /<script(?:(?!<\/script>).)*app\.baqend\.com\/v1\/speedkit\/install.js(?:(?!<\/script>).)*<\/script>/s;
|
|
@@ -147,13 +147,23 @@ class OnboardingServiceFactory {
|
|
|
147
147
|
]);
|
|
148
148
|
}
|
|
149
149
|
async getUrlForTest(customerConfig, cli) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
// Consider startup domain based on the following priority:
|
|
151
|
+
// 1. domain flag (-d)
|
|
152
|
+
// 2. customerConfig.domain
|
|
153
|
+
// 3. customerConfig.origins (prompt selection if more than 1 entry)
|
|
154
|
+
let domainToStart = this.context.domain || customerConfig.domain;
|
|
155
|
+
if (!domainToStart) {
|
|
156
|
+
domainToStart = customerConfig.origins[0];
|
|
157
|
+
if (customerConfig.origins.length > 1) {
|
|
158
|
+
domainToStart = await cli.select("Select domain to start", customerConfig.origins.map((origin) => {
|
|
159
|
+
return { name: origin, value: origin };
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
155
162
|
}
|
|
156
|
-
return domainToStart;
|
|
163
|
+
return this.ensureHttps(domainToStart);
|
|
164
|
+
}
|
|
165
|
+
ensureHttps(url = "") {
|
|
166
|
+
return url.startsWith("https://") ? url : `https://${url}`;
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
169
|
exports.OnboardingServiceFactory = OnboardingServiceFactory;
|
|
@@ -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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"description": "Build a parameter query that can be executed in Athena",
|
|
13
13
|
"examples": [
|
|
14
14
|
"$ sk build-parameter-query <customerPath> -c <configName>",
|
|
15
|
-
"$ sk build-parameter-query
|
|
15
|
+
"$ sk build-parameter-query customers/decathlon.de -c production"
|
|
16
16
|
],
|
|
17
17
|
"flags": {
|
|
18
18
|
"configName": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"description": "Build a prewarm query that can be executed in Athena",
|
|
53
53
|
"examples": [
|
|
54
54
|
"$ sk build-prewarm-query <customerPath> -c <configName>",
|
|
55
|
-
"$ sk build-prewarm-query
|
|
55
|
+
"$ sk build-prewarm-query customers/decathlon.de -c production"
|
|
56
56
|
],
|
|
57
57
|
"flags": {
|
|
58
58
|
"configName": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"description": "Deploys the specified customer config while comparing to the live version before",
|
|
93
93
|
"examples": [
|
|
94
94
|
"$ sk deploy <customerPath> -c <configName> -t <slackToken> -a <artifacts> -d <dryRun>",
|
|
95
|
-
"$ sk deploy
|
|
95
|
+
"$ sk deploy customers/decathlon.de -c production -t someSlackToken -a dynamic,SpeedKit -d"
|
|
96
96
|
],
|
|
97
97
|
"flags": {
|
|
98
98
|
"configName": {
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
"description": "Creates testable documentHandler in folder {CUSTOMER_PATH}/test/src/",
|
|
197
197
|
"examples": [
|
|
198
198
|
"$ sk documentHandler <customerPath> -c <configName>",
|
|
199
|
-
"$ sk deploy
|
|
199
|
+
"$ sk deploy customers/decathlon.de -c production"
|
|
200
200
|
],
|
|
201
201
|
"flags": {
|
|
202
202
|
"configName": {
|
|
@@ -433,8 +433,8 @@
|
|
|
433
433
|
},
|
|
434
434
|
"description": "Start a local dev environment for building and testing the Speed Kit configuration",
|
|
435
435
|
"examples": [
|
|
436
|
-
"$ sk onboarding <customerPath> -c <configName>",
|
|
437
|
-
"$ sk onboarding
|
|
436
|
+
"$ sk onboarding <customerPath> -c <configName> -d <domain>",
|
|
437
|
+
"$ sk onboarding customers/decathlon.de -c production -d www.decathlon.de"
|
|
438
438
|
],
|
|
439
439
|
"flags": {
|
|
440
440
|
"configName": {
|
|
@@ -446,6 +446,14 @@
|
|
|
446
446
|
"multiple": false,
|
|
447
447
|
"type": "option"
|
|
448
448
|
},
|
|
449
|
+
"domain": {
|
|
450
|
+
"char": "d",
|
|
451
|
+
"description": "Startup domain (optional)",
|
|
452
|
+
"name": "domain",
|
|
453
|
+
"hasDynamicHelp": false,
|
|
454
|
+
"multiple": false,
|
|
455
|
+
"type": "option"
|
|
456
|
+
},
|
|
449
457
|
"local": {
|
|
450
458
|
"char": "l",
|
|
451
459
|
"description": "Run with local documentHandler",
|
|
@@ -579,7 +587,7 @@
|
|
|
579
587
|
"description": "Pull the specified customer config from orestes",
|
|
580
588
|
"examples": [
|
|
581
589
|
"$ sk pull <customerPath>",
|
|
582
|
-
"$ sk pull
|
|
590
|
+
"$ sk pull customers/decathlon.de -c production"
|
|
583
591
|
],
|
|
584
592
|
"flags": {
|
|
585
593
|
"configName": {
|
|
@@ -667,5 +675,5 @@
|
|
|
667
675
|
]
|
|
668
676
|
}
|
|
669
677
|
},
|
|
670
|
-
"version": "2.
|
|
678
|
+
"version": "2.30.1"
|
|
671
679
|
}
|