@speedkit/cli 4.17.0 → 4.17.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/services/onboarding/browser/baqend-response.d.ts +0 -5
- package/dist/services/onboarding/browser/baqend-response.js +0 -9
- package/dist/services/onboarding/file-events/file-watcher.d.ts +3 -3
- package/dist/services/onboarding/file-events/file-watcher.js +11 -7
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +7 -7
- package/dist/services/onboarding/virtual-orestes-app/index.js +13 -14
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [4.17.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.17.0...v4.17.1) (2026-07-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* reFetching the last 10Urls is a big problem for ssrConfigs ([99604b5](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/99604b5f11b853ee11543e141e6aa0f66a7de487))
|
|
7
|
+
|
|
1
8
|
# [4.17.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.16.0...v4.17.0) (2026-07-17)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -7,11 +7,6 @@ export declare class BaqendResponse implements Partial<Protocol.Fetch.FulfillReq
|
|
|
7
7
|
private readonly contentType;
|
|
8
8
|
private readonly contentLength;
|
|
9
9
|
constructor(body: string | Buffer, contentType?: string, headers?: Protocol.Fetch.HeaderEntry[], status?: number);
|
|
10
|
-
/**
|
|
11
|
-
* Epoch ms parsed from the `last-modified` header (set when the response was
|
|
12
|
-
* built), or 0 if absent/unparseable. Used to order cache entries by recency.
|
|
13
|
-
*/
|
|
14
|
-
getLastModified(): number;
|
|
15
10
|
setHeader(name: string, value: string): void;
|
|
16
11
|
protected addCustomHeaders(headers?: Protocol.Fetch.HeaderEntry[]): Protocol.Fetch.HeaderEntry[];
|
|
17
12
|
}
|
|
@@ -23,15 +23,6 @@ export class BaqendResponse {
|
|
|
23
23
|
? body.toString("base64")
|
|
24
24
|
: Buffer.from(body).toString("base64");
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Epoch ms parsed from the `last-modified` header (set when the response was
|
|
28
|
-
* built), or 0 if absent/unparseable. Used to order cache entries by recency.
|
|
29
|
-
*/
|
|
30
|
-
getLastModified() {
|
|
31
|
-
const header = this.responseHeaders.find((h) => h.name.toLowerCase() === "last-modified");
|
|
32
|
-
const timestamp = header ? Date.parse(header.value) : NaN;
|
|
33
|
-
return Number.isNaN(timestamp) ? 0 : timestamp;
|
|
34
|
-
}
|
|
35
26
|
setHeader(name, value) {
|
|
36
27
|
for (const header of this.responseHeaders) {
|
|
37
28
|
if (header.name === name) {
|
|
@@ -20,10 +20,10 @@ 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
|
-
* (local mode) the
|
|
24
|
-
*
|
|
25
|
-
* simply cleared.
|
|
23
|
+
* (local mode) the currently open page is re-warmed in the background so it
|
|
24
|
+
* stays instant and fresh; otherwise the cache is simply cleared.
|
|
26
25
|
*
|
|
26
|
+
* @param page the browser page whose current url should be re-warmed
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
29
|
private clearOrRefreshCache;
|
|
@@ -28,16 +28,20 @@ export class FileWatcher {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Drop the dh-cache after a config change. When a cache refresher is wired
|
|
31
|
-
* (local mode) the
|
|
32
|
-
*
|
|
33
|
-
* simply cleared.
|
|
31
|
+
* (local mode) the currently open page is re-warmed in the background so it
|
|
32
|
+
* stays instant and fresh; otherwise the cache is simply cleared.
|
|
34
33
|
*
|
|
34
|
+
* @param page the browser page whose current url should be re-warmed
|
|
35
35
|
* @private
|
|
36
36
|
*/
|
|
37
|
-
clearOrRefreshCache() {
|
|
37
|
+
clearOrRefreshCache(page) {
|
|
38
38
|
if (this.cacheRefresher) {
|
|
39
|
+
// page.url() carries a hash fragment that never reaches the server, so it
|
|
40
|
+
// is not part of the cache key — strip it before matching.
|
|
41
|
+
const currentUrl = new URL(page.url());
|
|
42
|
+
currentUrl.hash = "";
|
|
39
43
|
// fire-and-forget: refresh clears the cache first, then re-warms
|
|
40
|
-
void this.cacheRefresher.
|
|
44
|
+
void this.cacheRefresher.refreshCurrentUrl(currentUrl.href);
|
|
41
45
|
return;
|
|
42
46
|
}
|
|
43
47
|
this.cache.clear();
|
|
@@ -179,7 +183,7 @@ export class FileWatcher {
|
|
|
179
183
|
this.cli.writeWarning(`changed file: ${file.name}`);
|
|
180
184
|
await this.safeClearPageBrowsersCacheStorage(page);
|
|
181
185
|
await this.documentHandler.buildDocumentHandler();
|
|
182
|
-
this.clearOrRefreshCache();
|
|
186
|
+
this.clearOrRefreshCache(page);
|
|
183
187
|
await installResource.buildContent();
|
|
184
188
|
}
|
|
185
189
|
/**
|
|
@@ -192,7 +196,7 @@ export class FileWatcher {
|
|
|
192
196
|
async onChangeDynamicStyleCallback(file, page) {
|
|
193
197
|
this.cli.writeWarning(`changed file: ${file.name}`);
|
|
194
198
|
await this.documentHandler.buildDocumentHandler();
|
|
195
|
-
this.clearOrRefreshCache();
|
|
199
|
+
this.clearOrRefreshCache(page);
|
|
196
200
|
const escapedStyles = encodeURI(file.getContent());
|
|
197
201
|
const evaluateResult = await safe(race(Promise.all([
|
|
198
202
|
page.evaluate(this.updateStylesInlineFunction, escapedStyles),
|
|
@@ -28,15 +28,15 @@ export declare class VirtualOrestesApp {
|
|
|
28
28
|
*/
|
|
29
29
|
refreshUrl(originUrl: string): Promise<void>;
|
|
30
30
|
/**
|
|
31
|
-
* Clear the whole dh-cache, then re-warm the
|
|
32
|
-
* the background
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
31
|
+
* Clear the whole dh-cache, then re-warm only the currently open page's
|
|
32
|
+
* cached entries in the background. Used as a replacement for a bare cache
|
|
33
|
+
* clear on config changes: every stale entry is dropped, but the page the
|
|
34
|
+
* developer is currently looking at is rebuilt proactively so it stays
|
|
35
|
+
* instant and fresh after the change.
|
|
36
36
|
*
|
|
37
|
-
* @param
|
|
37
|
+
* @param currentUrl the url currently open in the browser (page.url())
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
refreshCurrentUrl(currentUrl: string): Promise<void>;
|
|
40
40
|
/**
|
|
41
41
|
* Rebuild a single cache entry (by its full asset request url), replacing the
|
|
42
42
|
* previously cached response. On failure the stale entry is dropped so we
|
|
@@ -58,25 +58,24 @@ export class VirtualOrestesApp {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Clear the whole dh-cache, then re-warm the
|
|
62
|
-
* the background
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
61
|
+
* Clear the whole dh-cache, then re-warm only the currently open page's
|
|
62
|
+
* cached entries in the background. Used as a replacement for a bare cache
|
|
63
|
+
* clear on config changes: every stale entry is dropped, but the page the
|
|
64
|
+
* developer is currently looking at is rebuilt proactively so it stays
|
|
65
|
+
* instant and fresh after the change.
|
|
66
66
|
*
|
|
67
|
-
* @param
|
|
67
|
+
* @param currentUrl the url currently open in the browser (page.url())
|
|
68
68
|
*/
|
|
69
|
-
async
|
|
70
|
-
const
|
|
71
|
-
.
|
|
72
|
-
.
|
|
73
|
-
.map(([key]) => key);
|
|
69
|
+
async refreshCurrentUrl(currentUrl) {
|
|
70
|
+
const matchingKeys = [...this.cache.getAll()]
|
|
71
|
+
.map(([key]) => key)
|
|
72
|
+
.filter((key) => key.includes(currentUrl));
|
|
74
73
|
this.cache.clear();
|
|
75
|
-
if (
|
|
74
|
+
if (matchingKeys.length === 0) {
|
|
76
75
|
return;
|
|
77
76
|
}
|
|
78
|
-
this.cli.write(`refreshing ${
|
|
79
|
-
for (const key of
|
|
77
|
+
this.cli.write(`refreshing ${matchingKeys.length} dh-cache entries for current url ${currentUrl} in background`);
|
|
78
|
+
for (const key of matchingKeys) {
|
|
80
79
|
await this.refreshEntry(key);
|
|
81
80
|
}
|
|
82
81
|
}
|
package/oclif.manifest.json
CHANGED