@speedkit/cli 4.50.0 → 4.50.2
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/dist/services/diff/diff-engine.d.ts +5 -2
- package/dist/services/diff/diff-engine.js +6 -2
- package/dist/services/diff/spec/diff-engine.spec.js +11 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +0 -7
- package/dist/services/onboarding/onboarding-service-factory.js +0 -29
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [4.50.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.50.1...v4.50.2) (2026-10-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **diff:** treat a null content as empty in the equality check ([9986540](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/9986540048c2243d338cfe54c9807eae6c1d2c76))
|
|
7
|
+
|
|
8
|
+
## [4.50.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.50.0...v4.50.1) (2026-10-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **onboarding:** drop the --device warning about device detection ([e7325a6](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/e7325a6bea67b5ba502a0cda5943b28048372411))
|
|
14
|
+
|
|
1
15
|
# [4.50.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.49.0...v4.50.0) (2026-10-27)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -11,8 +11,11 @@ export interface DiffEngineDeps {
|
|
|
11
11
|
export declare class DiffEngine {
|
|
12
12
|
private readonly deps;
|
|
13
13
|
constructor(deps: DiffEngineDeps);
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Whether the two contents are equal once all whitespace is removed.
|
|
16
|
+
* A null content counts as empty: an unset install field holds null.
|
|
17
|
+
*/
|
|
18
|
+
isContentEqual(left?: string | null, right?: string | null): boolean;
|
|
16
19
|
compare(left: DiffSide, right: DiffSide): Promise<DiffResult>;
|
|
17
20
|
/**
|
|
18
21
|
* Compares a remote content with its local counterpart, as a deploy does.
|
|
@@ -13,9 +13,13 @@ export class DiffEngine {
|
|
|
13
13
|
constructor(deps) {
|
|
14
14
|
this.deps = deps;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Whether the two contents are equal once all whitespace is removed.
|
|
18
|
+
* A null content counts as empty: an unset install field holds null.
|
|
19
|
+
*/
|
|
17
20
|
isContentEqual(left = "", right = "") {
|
|
18
|
-
|
|
21
|
+
const strip = (content) => (content ?? "").replaceAll(/\s/g, "");
|
|
22
|
+
return strip(left) === strip(right);
|
|
19
23
|
}
|
|
20
24
|
async compare(left, right) {
|
|
21
25
|
const result = {
|
|
@@ -44,4 +44,15 @@ describe("DiffEngine", () => {
|
|
|
44
44
|
const result = await engine.compare({ label: "a", content: undefined }, { label: "b", content: "" });
|
|
45
45
|
expect(result.equal).to.equal(true);
|
|
46
46
|
});
|
|
47
|
+
it("treats a null remote content as empty, as an unset install field holds", async () => {
|
|
48
|
+
const engine = new DiffEngine({ sink: recordingSink() });
|
|
49
|
+
const { equal, updatedFile } = await engine.diffContent("config_dynamicStyles.css", null, "body {}");
|
|
50
|
+
expect(equal).to.equal(false);
|
|
51
|
+
expect(updatedFile).to.equal("body {}");
|
|
52
|
+
});
|
|
53
|
+
it("treats a null content as empty in an equality check", () => {
|
|
54
|
+
const engine = new DiffEngine({ sink: recordingSink() });
|
|
55
|
+
expect(engine.isContentEqual(null, " \n")).to.equal(true);
|
|
56
|
+
expect(engine.isContentEqual("a", null)).to.equal(false);
|
|
57
|
+
});
|
|
47
58
|
});
|
|
@@ -50,13 +50,6 @@ export declare class OnboardingServiceFactory {
|
|
|
50
50
|
customerChromeFlags?: string[];
|
|
51
51
|
}): BrowserContext;
|
|
52
52
|
private getOnboardingService;
|
|
53
|
-
/**
|
|
54
|
-
* `--device` only changes what Speed Kit does if the config derives the device from the user
|
|
55
|
-
* agent. `RequestContext.getDevice` short-circuits on a pinned `customDevice` and returns nothing
|
|
56
|
-
* at all when `userAgentDetection` is off. In both cases no `bqvariation` is appended and the
|
|
57
|
-
* emulated device silently gets desktop assets. Say so up front.
|
|
58
|
-
*/
|
|
59
|
-
private warnAboutDeviceDetection;
|
|
60
53
|
private prepareMessagehandler;
|
|
61
54
|
/**
|
|
62
55
|
* The app token for the devtools extension, or `null` when nobody is logged
|
|
@@ -240,9 +240,6 @@ export class OnboardingServiceFactory {
|
|
|
240
240
|
const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate);
|
|
241
241
|
await this.buildInstallResource(speedKitInstallContext, files, cli);
|
|
242
242
|
const { browserContext, browserExtensions } = await this.prepareBrowser(domainToStart, customerConfig.chromeFlags);
|
|
243
|
-
if (this.context.device) {
|
|
244
|
-
await this.warnAboutDeviceDetection(files, customerConfig, domainToStart);
|
|
245
|
-
}
|
|
246
243
|
const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
|
|
247
244
|
const athenaClient = (await this.getAthenaClient(customerConfig.app)) || null;
|
|
248
245
|
const messageHandler = await this.prepareMessagehandler(athenaClient, files, customerConfig);
|
|
@@ -251,32 +248,6 @@ export class OnboardingServiceFactory {
|
|
|
251
248
|
const extensionBridge = new ExtensionBridge(cli, browserExtensions.hasDevtoolsExtension);
|
|
252
249
|
return new OnboardingService(browserContext, customerConfig, fetchHandler, fileWatcher, cli, messageHandler, extensionBridge, speedKitServiceWorkerJs, browserFetch);
|
|
253
250
|
}
|
|
254
|
-
/**
|
|
255
|
-
* `--device` only changes what Speed Kit does if the config derives the device from the user
|
|
256
|
-
* agent. `RequestContext.getDevice` short-circuits on a pinned `customDevice` and returns nothing
|
|
257
|
-
* at all when `userAgentDetection` is off. In both cases no `bqvariation` is appended and the
|
|
258
|
-
* emulated device silently gets desktop assets. Say so up front.
|
|
259
|
-
*/
|
|
260
|
-
async warnAboutDeviceDetection(files, customerConfig, domain) {
|
|
261
|
-
const cli = this.context.environment.cli;
|
|
262
|
-
const speedKitConfig = files.getSpeedKitConfig();
|
|
263
|
-
if (!speedKitConfig) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const config = await safe(speedKitConfig.evaluate(customerConfig.app, new URL(domain).origin));
|
|
267
|
-
if (config.success !== true) {
|
|
268
|
-
cli.writeWarning(`Could not check the Speed Kit config for device detection: ${config.error}`);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
// `raw` for the pin: `SSRPlugin` wraps `detectDevice` in `effective` for every config.
|
|
272
|
-
const { raw, effective } = config.data;
|
|
273
|
-
if (!effective.userAgentDetection && this.context.device !== "desktop") {
|
|
274
|
-
cli.writeWarning(`userAgentDetection is off in the Speed Kit config — Speed Kit resolves the desktop variation regardless of --device ${this.context.device}.`);
|
|
275
|
-
}
|
|
276
|
-
if (raw.customDevice || raw.detectDevice) {
|
|
277
|
-
cli.writeWarning("The Speed Kit config pins the device via customDevice/detectDevice, which takes precedence over the emulated user agent.");
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
251
|
async prepareMessagehandler(athenaClient, files, customerConfig) {
|
|
281
252
|
const messageHandler = new DevtoolsExtensionApi();
|
|
282
253
|
messageHandler.addMessage({
|
package/oclif.manifest.json
CHANGED