@speedkit/cli 4.41.2 → 4.43.0-beta.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 +14 -0
- package/README.md +1 -2
- package/dist/services/bundler/bundle-service-factory.d.ts +6 -1
- package/dist/services/bundler/bundle-service-factory.js +9 -2
- package/dist/services/bundler/bundle-service.d.ts +10 -1
- package/dist/services/bundler/bundle-service.js +16 -1
- package/dist/services/bundler/error/packjockel-error.d.ts +3 -0
- package/dist/services/bundler/error/packjockel-error.js +3 -0
- package/dist/services/bundler/index.d.ts +1 -0
- package/dist/services/bundler/index.js +1 -0
- package/dist/services/bundler/packjockel-service.d.ts +70 -0
- package/dist/services/bundler/packjockel-service.js +171 -0
- package/dist/services/bundler/spec/packjockel-service.spec.d.ts +1 -0
- package/dist/services/bundler/spec/packjockel-service.spec.js +149 -0
- package/dist/services/cli/cli-environment.js +1 -0
- package/dist/services/cli/cli-settings.d.ts +5 -0
- package/dist/services/cli/cli-settings.js +1 -0
- package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +2 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +2 -3
- package/dist/services/deploy/deploy-service-factory.js +1 -1
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +1 -1
- package/dist/services/document-handler-runtime/document-handler-runtime-model.d.ts +2 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-model.js +2 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +17 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +82 -20
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +1 -1
- package/dist/services/integration-api/integration-api-factory.js +1 -1
- package/dist/services/integration-api/integration-api-model.d.ts +2 -1
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +70 -8
- package/dist/services/integration-api/struct/customer-config.d.ts +19 -1
- package/dist/services/integration-api/struct/customer-config.js +11 -3
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +9 -4
- package/dist/services/integration-api/struct/speed-kit-config-file.js +30 -10
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +2 -2
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +26 -14
- package/dist/services/onboarding/file-events/file-watcher.d.ts +1 -1
- package/dist/services/onboarding/file-events/file-watcher.js +3 -3
- package/dist/services/onboarding/onboarding-model.d.ts +1 -1
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +0 -1
- package/dist/services/onboarding/onboarding-service-build-context.js +7 -3
- package/dist/services/onboarding/onboarding-service-factory.js +7 -9
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +0 -1
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +5 -0
- package/dist/services/query-builder/query-builder-factory.js +3 -3
- package/oclif.manifest.json +6 -2
- package/package.json +2 -1
|
@@ -20,7 +20,7 @@ export declare class FileWatcher {
|
|
|
20
20
|
setCacheRefresher(cacheRefresher: VirtualOrestesApp): void;
|
|
21
21
|
/**
|
|
22
22
|
* Drop the dh-cache after a config change. When a cache refresher is wired
|
|
23
|
-
*
|
|
23
|
+
* the currently open page is re-warmed in the background so it
|
|
24
24
|
* stays instant and fresh; otherwise the cache is simply cleared.
|
|
25
25
|
*
|
|
26
26
|
* @param page the browser page whose current url should be re-warmed
|
|
@@ -12,8 +12,8 @@ export class FileWatcher {
|
|
|
12
12
|
documentHandler;
|
|
13
13
|
browserContext;
|
|
14
14
|
cache;
|
|
15
|
-
// Set
|
|
16
|
-
//
|
|
15
|
+
// Set by OnboardingServiceFactory. When present, config changes re-warm the
|
|
16
|
+
// dh-cache in the background instead of just clearing it.
|
|
17
17
|
cacheRefresher;
|
|
18
18
|
constructor(cli, customerConfig, files, documentHandler, browserContext, cache) {
|
|
19
19
|
this.cli = cli;
|
|
@@ -28,7 +28,7 @@ export class FileWatcher {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Drop the dh-cache after a config change. When a cache refresher is wired
|
|
31
|
-
*
|
|
31
|
+
* the currently open page is re-warmed in the background so it
|
|
32
32
|
* stays instant and fresh; otherwise the cache is simply cleared.
|
|
33
33
|
*
|
|
34
34
|
* @param page the browser page whose current url should be re-warmed
|
|
@@ -136,7 +136,7 @@ export interface SkCliSessionInfo {
|
|
|
136
136
|
swPath: string;
|
|
137
137
|
/** The customer config's `scope`: the URL prefix that service worker controls. */
|
|
138
138
|
scope: string;
|
|
139
|
-
/**
|
|
139
|
+
/** The documentHandler is built and served from this machine. Always true: the panel still reads it. */
|
|
140
140
|
local: boolean;
|
|
141
141
|
/** The customer config's `forceInstall`: Speed Kit is installed on every page. */
|
|
142
142
|
forceInstall: boolean;
|
|
@@ -23,7 +23,6 @@ export interface OnboardingServiceBuildContextValues extends CommandContextValue
|
|
|
23
23
|
readonly customerPath?: string;
|
|
24
24
|
readonly configName: string;
|
|
25
25
|
readonly domain?: string;
|
|
26
|
-
readonly local: boolean;
|
|
27
26
|
readonly ignoreContentSecurityPolicy: boolean;
|
|
28
27
|
/** Where the CLI is installed, for the templates it ships. */
|
|
29
28
|
readonly cliPath: string;
|
|
@@ -16,10 +16,15 @@ const flags = {
|
|
|
16
16
|
char: "d",
|
|
17
17
|
description: "Startup domain (optional)",
|
|
18
18
|
}),
|
|
19
|
+
// Accepted so that existing scripts keep working. The documentHandler always runs locally.
|
|
20
|
+
// No default: oclif prints the deprecation for a flag that has a value, passed or not.
|
|
19
21
|
local: Flags.boolean({
|
|
20
22
|
char: "l",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
hidden: true,
|
|
24
|
+
deprecated: {
|
|
25
|
+
message: "The flag -l/--local has no effect: onboarding always runs the documentHandler locally.",
|
|
26
|
+
},
|
|
27
|
+
description: "Deprecated: the documentHandler always runs locally",
|
|
23
28
|
}),
|
|
24
29
|
debuggingPort: Flags.boolean({
|
|
25
30
|
char: "p",
|
|
@@ -63,7 +68,6 @@ export class OnboardingServiceBuildContext extends Context() {
|
|
|
63
68
|
customerPath: parsedArgs.customerPath,
|
|
64
69
|
configName: parsedFlags.configName,
|
|
65
70
|
domain: parsedFlags["domain"],
|
|
66
|
-
local: parsedFlags.local,
|
|
67
71
|
ignoreContentSecurityPolicy: parsedFlags.ignoreContentSecurityPolicy,
|
|
68
72
|
cliPath: environment.oclif.root,
|
|
69
73
|
verboseLevel: parsedFlags.verboseLevel,
|
|
@@ -150,9 +150,9 @@ export class OnboardingServiceFactory {
|
|
|
150
150
|
customerPath: this.context.customerPath,
|
|
151
151
|
verboseLevel: this.context.verboseLevel,
|
|
152
152
|
}), files).buildDocumentHandlerServer();
|
|
153
|
-
const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
|
|
153
|
+
const bundler = new BundleServiceFactory(this.context.customerPath, this.context.environment.settings.packjockelPath).buildService();
|
|
154
154
|
const skTemplate = new InstallSpeedKitJsTemplate();
|
|
155
|
-
const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate
|
|
155
|
+
const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate);
|
|
156
156
|
await this.buildInstallResource(speedKitInstallContext, files, cli);
|
|
157
157
|
const { browserContext, browserExtensions } = await this.prepareBrowser(domainToStart, customerConfig.chromeFlags);
|
|
158
158
|
const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
|
|
@@ -253,12 +253,10 @@ export class OnboardingServiceFactory {
|
|
|
253
253
|
speedKitServiceWorkerJs,
|
|
254
254
|
new DashboardRequest(new Dashboard(customerConfig, parameterQueryBuilder, athenaClient, requestDiffService, new DiffAgainstCurrentPage(DiffService, documentHandler, crawler, cli), cache)),
|
|
255
255
|
];
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
handlers.push(new SpeedKitAssetRequest(customerConfig, orestesApp), new SpeedKitRumPiRequest(customerConfig, orestesApp));
|
|
261
|
-
}
|
|
256
|
+
const orestesApp = new VirtualOrestesApp(customerConfig, crawler, documentHandler, cache, cli, messageHandler, this.context.ignoreContentSecurityPolicy);
|
|
257
|
+
// let config-file changes re-warm the dh-cache in the background
|
|
258
|
+
fileWatcher.setCacheRefresher(orestesApp);
|
|
259
|
+
handlers.push(new SpeedKitAssetRequest(customerConfig, orestesApp), new SpeedKitRumPiRequest(customerConfig, orestesApp));
|
|
262
260
|
return new FetchEventHandler(handlers, customerConfig, cli, configApi);
|
|
263
261
|
}
|
|
264
262
|
async getSpeedKitServerConfig(configApi, cli) {
|
|
@@ -339,7 +337,7 @@ export class OnboardingServiceFactory {
|
|
|
339
337
|
origins: customerConfig.origins ?? [],
|
|
340
338
|
swPath: customerConfig.swPath,
|
|
341
339
|
scope: customerConfig.scope,
|
|
342
|
-
local:
|
|
340
|
+
local: true,
|
|
343
341
|
forceInstall: Boolean(customerConfig.forceInstall),
|
|
344
342
|
proxy: proxy
|
|
345
343
|
? {
|
|
@@ -5,6 +5,11 @@ export class InstallSpeedKitJsTemplate extends AbstractTemplate {
|
|
|
5
5
|
// Config
|
|
6
6
|
{{{config}}}
|
|
7
7
|
|
|
8
|
+
{{#if configPlugins}}
|
|
9
|
+
// The config writes SpeedKit.config, which packjockel exposes; the overrides below change it.
|
|
10
|
+
var speedKit = SpeedKit.config;
|
|
11
|
+
{{/if}}
|
|
12
|
+
|
|
8
13
|
// Reset potential split test parameters
|
|
9
14
|
speedKit.split = 1.0;
|
|
10
15
|
speedKit.splitTestId = 'debug';
|
|
@@ -22,7 +22,7 @@ export class QueryBuilderFactory {
|
|
|
22
22
|
const customerConfig = files.getCustomerConfig().config;
|
|
23
23
|
const app = customerConfig.app;
|
|
24
24
|
const origins = customerConfig.origins ?? [];
|
|
25
|
-
const speedKitConfig = await this.getSpeedKitConfig(
|
|
25
|
+
const speedKitConfig = await this.getSpeedKitConfig(customerConfig, origins[0], files.getSpeedKitConfig());
|
|
26
26
|
const serviceContext = {
|
|
27
27
|
app,
|
|
28
28
|
bySet: this.context.bySet,
|
|
@@ -72,8 +72,8 @@ export class QueryBuilderFactory {
|
|
|
72
72
|
const integrationApi = new IntegrationApiFactory(integrationApiContext).buildService();
|
|
73
73
|
return await integrationApi.run();
|
|
74
74
|
}
|
|
75
|
-
async getSpeedKitConfig(
|
|
76
|
-
const result = await safe(speedKitConfigFile.evaluate(
|
|
75
|
+
async getSpeedKitConfig(customer, origin, speedKitConfigFile) {
|
|
76
|
+
const result = await safe(speedKitConfigFile.evaluate(customer, origin));
|
|
77
77
|
if (result.success !== true) {
|
|
78
78
|
throw new ParseConfigSpeedKitError(result.error);
|
|
79
79
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -687,7 +687,11 @@
|
|
|
687
687
|
},
|
|
688
688
|
"local": {
|
|
689
689
|
"char": "l",
|
|
690
|
-
"
|
|
690
|
+
"deprecated": {
|
|
691
|
+
"message": "The flag -l/--local has no effect: onboarding always runs the documentHandler locally."
|
|
692
|
+
},
|
|
693
|
+
"description": "Deprecated: the documentHandler always runs locally",
|
|
694
|
+
"hidden": true,
|
|
691
695
|
"name": "local",
|
|
692
696
|
"allowNo": false,
|
|
693
697
|
"type": "boolean"
|
|
@@ -1761,5 +1765,5 @@
|
|
|
1761
1765
|
]
|
|
1762
1766
|
}
|
|
1763
1767
|
},
|
|
1764
|
-
"version": "4.
|
|
1768
|
+
"version": "4.43.0-beta.1"
|
|
1765
1769
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speedkit/cli",
|
|
3
3
|
"description": "Speed Kit CLI",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.43.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baqend.com",
|
|
7
7
|
"email": "info@baqend.com"
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"@oclif/plugin-help": "^6.2.45",
|
|
111
111
|
"@oclif/plugin-not-found": "^3.2.81",
|
|
112
112
|
"@oclif/plugin-warn-if-update-available": "^3.1.61",
|
|
113
|
+
"@speedkit/packjockel": "2.0.0-beta",
|
|
113
114
|
"@speedkit/rules": "^1.3.0-0",
|
|
114
115
|
"baqend": "^4.2.5",
|
|
115
116
|
"chalk": "^5.6.2",
|