@speedkit/cli 3.43.0 → 3.43.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 +7 -0
- package/README.md +1 -1
- package/dist/helpers/evaluate-speed-kit-config.d.ts +6 -0
- package/dist/helpers/evaluate-speed-kit-config.js +14 -0
- package/dist/services/query-builder/query-builder-factory.js +7 -7
- package/dist/services/query-builder/query-builder-service.js +12 -4
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.43.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.43.0...v3.43.1) (2026-04-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* make queryBuilder compatible to plugins ([14374d0](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/14374d00d48da1b1316dc69fd5949022acb62ede))
|
|
7
|
+
|
|
1
8
|
# [3.43.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.42.0...v3.43.0) (2026-04-23)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { InstallResourceFile } from "../services/integration-api";
|
|
2
|
+
export declare function evaluateLocalSpeedKitConfig(app: string, origin: string, speedKitConfigFile: InstallResourceFile): Promise<{
|
|
3
|
+
split: any;
|
|
4
|
+
splitTestId: any;
|
|
5
|
+
detectDevice: () => void;
|
|
6
|
+
customVariation: any[];
|
|
7
|
+
}>;
|
|
2
8
|
export declare function evaluateLocalAndRemoteSpeedKit(app: string, origin: string, speedKitConfigFile: InstallResourceFile, activeSpeedKitConfig: string): Promise<{
|
|
3
9
|
localSpeedKit: {
|
|
4
10
|
split: any;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evaluateLocalSpeedKitConfig = evaluateLocalSpeedKitConfig;
|
|
3
4
|
exports.evaluateLocalAndRemoteSpeedKit = evaluateLocalAndRemoteSpeedKit;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const evaluate_sk_config_error_1 = require("../services/deploy/error/evaluate-sk-config-error");
|
|
6
7
|
const vm = tslib_1.__importStar(require("node:vm"));
|
|
7
8
|
const bundler_1 = require("../services/bundler");
|
|
9
|
+
async function evaluateLocalSpeedKitConfig(app, origin, speedKitConfigFile) {
|
|
10
|
+
const localBrowserContext = buildBrowserMock(origin, app);
|
|
11
|
+
const localFileContent = safeFileContentWrapper(await bundle(speedKitConfigFile.getContent(), app));
|
|
12
|
+
vm.runInNewContext(localFileContent, localBrowserContext, {
|
|
13
|
+
filename: speedKitConfigFile.path,
|
|
14
|
+
displayErrors: false,
|
|
15
|
+
breakOnSigint: true,
|
|
16
|
+
});
|
|
17
|
+
if (localBrowserContext.vmError !== null) {
|
|
18
|
+
throw new evaluate_sk_config_error_1.EvaluateSkConfigError(`[config_Speedkit.js] ${localBrowserContext.vmError?.message}`);
|
|
19
|
+
}
|
|
20
|
+
return localBrowserContext.window.speedKit;
|
|
21
|
+
}
|
|
8
22
|
async function evaluateLocalAndRemoteSpeedKit(app, origin, speedKitConfigFile, activeSpeedKitConfig) {
|
|
9
23
|
const localBrowserContext = buildBrowserMock(origin, app);
|
|
10
24
|
const localFileContent = safeFileContentWrapper(await bundle(speedKitConfigFile.getContent(), app));
|
|
@@ -4,10 +4,10 @@ exports.QueryBuilderFactory = void 0;
|
|
|
4
4
|
const query_builder_service_1 = require("./query-builder-service");
|
|
5
5
|
const integration_api_1 = require("../integration-api");
|
|
6
6
|
const files_1 = require("../../models/files");
|
|
7
|
-
const get_parsed_config_1 = require("../../helpers/get-parsed-config");
|
|
8
7
|
const cli_1 = require("../cli");
|
|
9
8
|
const safe_1 = require("../../helpers/safe");
|
|
10
9
|
const parse_config_speed_kit_error_1 = require("./error/parse-config-speed-kit-error");
|
|
10
|
+
const evaluate_speed_kit_config_1 = require("../../helpers/evaluate-speed-kit-config");
|
|
11
11
|
class QueryBuilderFactory {
|
|
12
12
|
context;
|
|
13
13
|
userConfig;
|
|
@@ -18,9 +18,11 @@ class QueryBuilderFactory {
|
|
|
18
18
|
async buildService(queryType) {
|
|
19
19
|
const cli = new cli_1.CliServiceFactory().getService();
|
|
20
20
|
const files = await this.getIntegrationFiles();
|
|
21
|
-
const
|
|
21
|
+
const customerConfig = files.getCustomerConfig().config;
|
|
22
|
+
const app = customerConfig.app;
|
|
23
|
+
const origin = customerConfig.origins[0];
|
|
22
24
|
const speedKitConfigFile = files.getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT);
|
|
23
|
-
const speedKitConfig = this.getSpeedKitConfig(speedKitConfigFile
|
|
25
|
+
const speedKitConfig = await this.getSpeedKitConfig(app, origin, speedKitConfigFile);
|
|
24
26
|
const serviceContext = {
|
|
25
27
|
app,
|
|
26
28
|
queryType,
|
|
@@ -34,11 +36,9 @@ class QueryBuilderFactory {
|
|
|
34
36
|
const integrationApi = new integration_api_1.IntegrationApiFactory(integrationApiContext, this.userConfig).buildService();
|
|
35
37
|
return await integrationApi.run();
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
// this service then can also be used in: deploy/checks/pre-deploy
|
|
39
|
-
getSpeedKitConfig(fileContentString) {
|
|
39
|
+
getSpeedKitConfig(app, origin, speedKitConfigFile) {
|
|
40
40
|
const result = (0, safe_1.safe)(() => {
|
|
41
|
-
return (0,
|
|
41
|
+
return (0, evaluate_speed_kit_config_1.evaluateLocalSpeedKitConfig)(app, origin, speedKitConfigFile);
|
|
42
42
|
});
|
|
43
43
|
if (result.success !== true) {
|
|
44
44
|
throw new parse_config_speed_kit_error_1.ParseConfigSpeedKitError(result.error);
|
|
@@ -9,6 +9,7 @@ const query_builder_model_1 = require("./query-builder-model");
|
|
|
9
9
|
const prewarm_1 = require("./query/prewarm");
|
|
10
10
|
const parameter_1 = require("./query/parameter");
|
|
11
11
|
const cli_1 = require("../cli");
|
|
12
|
+
const safe_1 = require("../../helpers/safe");
|
|
12
13
|
class QueryBuilderService {
|
|
13
14
|
context;
|
|
14
15
|
speedKitConfig;
|
|
@@ -20,22 +21,29 @@ class QueryBuilderService {
|
|
|
20
21
|
}
|
|
21
22
|
async run() {
|
|
22
23
|
this.cli.startAction(`build ${this.context.queryType}-query`);
|
|
24
|
+
console.log(this.speedKitConfig);
|
|
23
25
|
const parameters = (0, build_query_helper_1.getStrippedParameters)(this.speedKitConfig);
|
|
24
26
|
const parameterReplaceFilter = (0, build_query_helper_1.getParameterReplaceFilter)(parameters, (0, get_parsed_config_1.getSpeedKitConfigVersion)(this.speedKitConfig));
|
|
25
27
|
const whitelistedFilter = (0, build_query_helper_1.getWhitelistedFilter)(this.speedKitConfig);
|
|
26
28
|
const blacklistedFilter = (0, build_query_helper_1.getBlacklistedFilter)(this.speedKitConfig);
|
|
27
29
|
const skConfigVersion = (0, get_parsed_config_1.getSpeedKitConfigVersion)(this.speedKitConfig);
|
|
28
30
|
const parameterFilter = (0, build_query_helper_1.getParameterFilter)(parameters, skConfigVersion);
|
|
29
|
-
const result = this.buildQuery(this.context.app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter);
|
|
31
|
+
const result = (0, safe_1.safe)(() => this.buildQuery(this.context.app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter));
|
|
32
|
+
if (result.success !== true) {
|
|
33
|
+
this.cli.endAction(cli_1.CliActionStatus.FAILED);
|
|
34
|
+
this.cli.writeError(result.error);
|
|
35
|
+
console.error(result.errorObj);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
30
38
|
this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
|
|
31
39
|
if (this.context.quiet) {
|
|
32
|
-
process.stdout.write(result);
|
|
40
|
+
process.stdout.write(result.data);
|
|
33
41
|
return;
|
|
34
42
|
}
|
|
35
43
|
if (!this.context.isWindows) {
|
|
36
|
-
clipboardy_cjs_1.default.writeSync(result);
|
|
44
|
+
clipboardy_cjs_1.default.writeSync(result.data);
|
|
37
45
|
}
|
|
38
|
-
this.cli.write(this.cli.style.dim.italic(result));
|
|
46
|
+
this.cli.write(this.cli.style.dim.italic(result.data));
|
|
39
47
|
if (!this.context.isWindows) {
|
|
40
48
|
this.cli.writeSuccess("Result has been copied to the clipboard 📋");
|
|
41
49
|
}
|
package/oclif.manifest.json
CHANGED