@speedkit/cli 4.41.1 → 4.42.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 -2
- package/dist/commands/generate-pop-config.js +8 -1
- 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 +2 -6
- 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 +6 -8
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +0 -1
- package/dist/templates/speedKit.Revalidated.js +1 -5
- package/oclif.manifest.json +6 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [4.42.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.41.2...v4.42.0) (2026-10-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **onboarding:** always run the documentHandler locally ([03702f0](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/03702f0a872a7dd3563100b216526ebf87c9fea3))
|
|
7
|
+
|
|
8
|
+
## [4.41.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.41.1...v4.41.2) (2026-10-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* wrong template escape for generate-pop-config ([c0689e1](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/c0689e1af52e16e40065a5bafbcc1735c498b79d))
|
|
14
|
+
|
|
1
15
|
## [4.41.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.41.0...v4.41.1) (2026-10-05)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -727,7 +727,7 @@ Start a local dev environment for building and testing the Speed Kit configurati
|
|
|
727
727
|
|
|
728
728
|
```
|
|
729
729
|
USAGE
|
|
730
|
-
$ sk onboarding [CUSTOMERPATH] [-c <value>] [-t] [-d <value>] [-
|
|
730
|
+
$ sk onboarding [CUSTOMERPATH] [-c <value>] [-t] [-d <value>] [-p] [--debugPort <value>] [-v] [-s]
|
|
731
731
|
[--headless] [--browse] [--browserFetch]
|
|
732
732
|
|
|
733
733
|
ARGUMENTS
|
|
@@ -736,7 +736,6 @@ ARGUMENTS
|
|
|
736
736
|
FLAGS
|
|
737
737
|
-c, --configName=<value> [default: production] The costumer config name
|
|
738
738
|
-d, --domain=<value> Startup domain (optional)
|
|
739
|
-
-l, --local Run with local documentHandler
|
|
740
739
|
-p, --debuggingPort Enable remote debugging port (disables speculation rules/prerendering)
|
|
741
740
|
-s, --ignoreContentSecurityPolicy Removes header/meta "content-security-policy" for origin-responses
|
|
742
741
|
-t, --useTestConfig Override app with configured testApp
|
|
@@ -129,7 +129,14 @@ export default class GeneratePopConfig extends SkCommand {
|
|
|
129
129
|
const revalidationTemplate = await readFile(path.resolve(__dirname, "../templates/speedKit.Revalidated.js"), "utf-8");
|
|
130
130
|
const pops = await readFile(path.resolve(__dirname, "../templates/pops.js"), "utf-8");
|
|
131
131
|
popConfig = pops + popConfig;
|
|
132
|
-
|
|
132
|
+
// Inside a comment so that a formatter leaves it alone: as a bare
|
|
133
|
+
// `{{config}}` it was once reformatted into a block statement, and the
|
|
134
|
+
// module was generated without any PoPs.
|
|
135
|
+
const placeholder = "/* {{config}} */";
|
|
136
|
+
if (!revalidationTemplate.includes(placeholder)) {
|
|
137
|
+
this.error(`speedKit.Revalidated.js template lacks ${placeholder}`);
|
|
138
|
+
}
|
|
139
|
+
return revalidationTemplate.replace(placeholder, () => popConfig);
|
|
133
140
|
}
|
|
134
141
|
async deployPrewarmingConfig(app, config, deploy) {
|
|
135
142
|
const moduleName = "speedKit.Revalidated";
|
|
@@ -7,10 +7,10 @@ export declare class SpeedKitInstallContext {
|
|
|
7
7
|
private files;
|
|
8
8
|
private bundler;
|
|
9
9
|
private skTemplate;
|
|
10
|
-
|
|
11
|
-
constructor(customerConfig: CustomerConfig, configName: string, files: FileListInterface, bundler: BundleService, skTemplate: InstallSpeedKitJsTemplate, isLocalRuntime?: boolean);
|
|
10
|
+
constructor(customerConfig: CustomerConfig, configName: string, files: FileListInterface, bundler: BundleService, skTemplate: InstallSpeedKitJsTemplate);
|
|
12
11
|
getSpeedKitInstallJs(): Promise<string>;
|
|
13
12
|
private prepareConfigLoadHandler;
|
|
13
|
+
/** The Speed Kit config, with `delayRacedOrigin` set to 100 ms for the local documentHandler. */
|
|
14
14
|
private getConfigSpeedKit;
|
|
15
15
|
/**
|
|
16
16
|
* Fetches and returns the latest dynamic fetcher from the code repository. If a new version is available online it is
|
|
@@ -11,14 +11,12 @@ export class SpeedKitInstallContext {
|
|
|
11
11
|
files;
|
|
12
12
|
bundler;
|
|
13
13
|
skTemplate;
|
|
14
|
-
|
|
15
|
-
constructor(customerConfig, configName, files, bundler, skTemplate, isLocalRuntime = false) {
|
|
14
|
+
constructor(customerConfig, configName, files, bundler, skTemplate) {
|
|
16
15
|
this.customerConfig = customerConfig;
|
|
17
16
|
this.configName = configName;
|
|
18
17
|
this.files = files;
|
|
19
18
|
this.bundler = bundler;
|
|
20
19
|
this.skTemplate = skTemplate;
|
|
21
|
-
this.isLocalRuntime = isLocalRuntime;
|
|
22
20
|
}
|
|
23
21
|
async getSpeedKitInstallJs() {
|
|
24
22
|
const configJs = this.skTemplate.render({
|
|
@@ -64,13 +62,11 @@ export class SpeedKitInstallContext {
|
|
|
64
62
|
// `import debugPreloading from "predictive-preloading/predictivePreloading.dev.js"`,
|
|
65
63
|
// );
|
|
66
64
|
}
|
|
65
|
+
/** The Speed Kit config, with `delayRacedOrigin` set to 100 ms for the local documentHandler. */
|
|
67
66
|
getConfigSpeedKit() {
|
|
68
67
|
const configString = this.files
|
|
69
68
|
.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT)
|
|
70
69
|
.getContent();
|
|
71
|
-
if (!this.isLocalRuntime) {
|
|
72
|
-
return configString;
|
|
73
|
-
}
|
|
74
70
|
if (configString.includes("delayRacedOrigin")) {
|
|
75
71
|
return configString.replace(/delayRacedOrigin:[^\d,|](\d*)[^,]*,/, (config, value) => {
|
|
76
72
|
return config.replace(value, "100");
|
|
@@ -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,
|
|
@@ -152,7 +152,7 @@ export class OnboardingServiceFactory {
|
|
|
152
152
|
}), files).buildDocumentHandlerServer();
|
|
153
153
|
const bundler = new BundleServiceFactory(this.context.customerPath).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,11 +5,7 @@ const https = require("node:https");
|
|
|
5
5
|
|
|
6
6
|
const agent = new https.Agent({ rejectUnauthorized: false });
|
|
7
7
|
|
|
8
|
-
{
|
|
9
|
-
{
|
|
10
|
-
config;
|
|
11
|
-
}
|
|
12
|
-
} // eslint-disable-line
|
|
8
|
+
/* {{config}} */ // eslint-disable-line
|
|
13
9
|
|
|
14
10
|
const ORIGIN_PATHS = Object.keys(ORIGIN_POPS).filter((origin) =>
|
|
15
11
|
origin.endsWith("/"),
|
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.42.0"
|
|
1765
1769
|
}
|