@speedkit/cli 4.23.0 → 4.23.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 +8 -0
- package/README.md +1 -1
- package/dist/hooks/init/dns-result-order.d.ts +12 -0
- package/dist/hooks/init/dns-result-order.js +14 -0
- package/dist/hooks/init/dns-result-order.spec.d.ts +1 -0
- package/dist/hooks/init/dns-result-order.spec.js +15 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +1 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +4 -0
- package/dist/services/document-handler-runtime/server/request.d.ts +1 -0
- package/dist/services/document-handler-runtime/server/request.js +7 -1
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +2 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +2 -0
- package/dist/services/document-handler-runtime/templates/test.js +3 -0
- package/oclif.manifest.json +1 -1
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [4.23.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.23.0...v4.23.1) (2026-08-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **cli:** resolve IPv4 addresses before IPv6 ([057fa59](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/057fa59bb06f3d49af5b8631681e7850a062d585))
|
|
7
|
+
* **onboarding:** allow one hour Shopify staleness for local runs ([4e31124](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/4e31124aa3c217f698ef3bb48a51c83fb5395ca4))
|
|
8
|
+
|
|
1
9
|
# [4.23.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.22.1...v4.23.0) (2026-08-21)
|
|
2
10
|
|
|
3
11
|
|
package/README.md
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hook } from "@oclif/core";
|
|
2
|
+
/**
|
|
3
|
+
* Puts IPv4 addresses first for every lookup the CLI makes. This is the runtime equivalent of
|
|
4
|
+
* `NODE_OPTIONS=--dns-result-order=ipv4first`, so no entrypoint has to export that variable.
|
|
5
|
+
*
|
|
6
|
+
* Node resolves `localhost` to `::1` first. WSL in mirrored networking mode shares `localhost`
|
|
7
|
+
* between Windows and Linux, but Chrome's remote debugging port and the local dev server both
|
|
8
|
+
* listen on IPv4 only. A lookup that answers `::1` therefore never reaches the listener on the
|
|
9
|
+
* other side of the boundary, and the connection fails instead of crossing over.
|
|
10
|
+
*/
|
|
11
|
+
declare const hook: Hook<"init">;
|
|
12
|
+
export default hook;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { setDefaultResultOrder } from "node:dns";
|
|
2
|
+
/**
|
|
3
|
+
* Puts IPv4 addresses first for every lookup the CLI makes. This is the runtime equivalent of
|
|
4
|
+
* `NODE_OPTIONS=--dns-result-order=ipv4first`, so no entrypoint has to export that variable.
|
|
5
|
+
*
|
|
6
|
+
* Node resolves `localhost` to `::1` first. WSL in mirrored networking mode shares `localhost`
|
|
7
|
+
* between Windows and Linux, but Chrome's remote debugging port and the local dev server both
|
|
8
|
+
* listen on IPv4 only. A lookup that answers `::1` therefore never reaches the listener on the
|
|
9
|
+
* other side of the boundary, and the connection fails instead of crossing over.
|
|
10
|
+
*/
|
|
11
|
+
const hook = async () => {
|
|
12
|
+
setDefaultResultOrder("ipv4first");
|
|
13
|
+
};
|
|
14
|
+
export default hook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { after, describe, it } from "mocha";
|
|
3
|
+
import { getDefaultResultOrder, setDefaultResultOrder } from "node:dns";
|
|
4
|
+
import hook from "./dns-result-order.js";
|
|
5
|
+
describe("dns-result-order hook", () => {
|
|
6
|
+
const previousOrder = getDefaultResultOrder();
|
|
7
|
+
after(() => {
|
|
8
|
+
setDefaultResultOrder(previousOrder);
|
|
9
|
+
});
|
|
10
|
+
it("puts IPv4 addresses first", async () => {
|
|
11
|
+
setDefaultResultOrder("verbatim");
|
|
12
|
+
await hook.call(null, {});
|
|
13
|
+
expect(getDefaultResultOrder()).to.equal("ipv4first");
|
|
14
|
+
});
|
|
15
|
+
});
|
package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
|
|
|
6
6
|
export declare const LOCAL_STYLES = "config_dynamicStyles";
|
|
7
7
|
export declare const LATEST_DOCUMENT_HANDLER_URL = "https://www.baqend.com/speed-kit-handler/latest/DocumentHandler.js";
|
|
8
8
|
export declare const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
|
|
9
|
+
export declare const LOCAL_TRIGGERED_BY = "STREAM:QA";
|
|
9
10
|
export declare const TEST_DOCUMENT_HANDLER_FILE_NAME = "testDocumentHandler";
|
|
10
11
|
export declare const TEST_DATABASE_MOCK_FILE_NAME = "database-mock";
|
|
11
12
|
export declare const TEST_ORESTES_MOCK_FILE_NAME = "orestes-mock";
|
|
@@ -6,6 +6,10 @@ export const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
|
|
|
6
6
|
export const LOCAL_STYLES = "config_dynamicStyles";
|
|
7
7
|
export const LATEST_DOCUMENT_HANDLER_URL = "https://www.baqend.com/speed-kit-handler/latest/DocumentHandler.js";
|
|
8
8
|
export const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
|
|
9
|
+
// Local runs have no persistent cache, so an origin HTML is served straight to the developer and may
|
|
10
|
+
// legitimately be older than the default five minutes. STREAM:QA relaxes the document handler's
|
|
11
|
+
// Shopify staleness check to one hour, see ONE_HOUR_STALENESS_TRIGGERS in document-handler.
|
|
12
|
+
export const LOCAL_TRIGGERED_BY = "STREAM:QA";
|
|
9
13
|
export const TEST_DOCUMENT_HANDLER_FILE_NAME = "testDocumentHandler";
|
|
10
14
|
export const TEST_DATABASE_MOCK_FILE_NAME = "database-mock";
|
|
11
15
|
export const TEST_ORESTES_MOCK_FILE_NAME = "orestes-mock";
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { LOCAL_TRIGGERED_BY } from "../context/document-handler-runtime-context.js";
|
|
1
2
|
export class Request {
|
|
2
3
|
query;
|
|
3
4
|
body;
|
|
4
5
|
headers;
|
|
5
6
|
constructor(url, body, variation, originalHeaders, requestHeaders = {}) {
|
|
6
|
-
this.query = {
|
|
7
|
+
this.query = {
|
|
8
|
+
variation,
|
|
9
|
+
headers: JSON.stringify(originalHeaders),
|
|
10
|
+
url,
|
|
11
|
+
triggeredBy: LOCAL_TRIGGERED_BY,
|
|
12
|
+
};
|
|
7
13
|
this.body = body;
|
|
8
14
|
this.headers = {};
|
|
9
15
|
for (const key of Object.keys(requestHeaders)) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AbstractTemplate from "./abstract-template.js";
|
|
2
|
+
import { LOCAL_TRIGGERED_BY } from "../context/document-handler-runtime-context.js";
|
|
2
3
|
export default class ExecuteDocumentHandler extends AbstractTemplate {
|
|
3
4
|
buildContext(domain, file) {
|
|
4
5
|
return { domain, file };
|
|
@@ -35,6 +36,7 @@ async function run(iterator) {
|
|
|
35
36
|
variation: item.variation || 'DEFAULT',
|
|
36
37
|
headers: item?.headers ? item.headers : JSON.stringify(DEFAULT_HEADERS),
|
|
37
38
|
url: item.url,
|
|
39
|
+
triggeredBy: '${LOCAL_TRIGGERED_BY}',
|
|
38
40
|
}
|
|
39
41
|
let req = {
|
|
40
42
|
query, body: file
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AbstractTemplate from "./abstract-template.js";
|
|
2
|
+
import { LOCAL_TRIGGERED_BY } from "../context/document-handler-runtime-context.js";
|
|
2
3
|
export default class OrestesMock extends AbstractTemplate {
|
|
3
4
|
buildContext() {
|
|
4
5
|
return {};
|
|
@@ -79,6 +80,7 @@ const server = http.createServer(async function (request, response) {
|
|
|
79
80
|
variation: UrlObject.searchParams.has('bqvariation')?UrlObject.searchParams.get('bqvariation'):'DEFAULT',
|
|
80
81
|
headers: '',
|
|
81
82
|
url: url,
|
|
83
|
+
triggeredBy: '${LOCAL_TRIGGERED_BY}',
|
|
82
84
|
}
|
|
83
85
|
let req = {query, body}
|
|
84
86
|
const output = await documentHandler.transform(database,req)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AbstractTemplate from "./abstract-template.js";
|
|
2
|
+
import { LOCAL_TRIGGERED_BY } from "../context/document-handler-runtime-context.js";
|
|
2
3
|
export default class Test extends AbstractTemplate {
|
|
3
4
|
buildContext(domain, name, timeout = 2000) {
|
|
4
5
|
return { domain, name, timeout };
|
|
@@ -25,6 +26,7 @@ describe(\`documentHandler run on \${file}\`, function () {
|
|
|
25
26
|
variation: 'DEFAULT',
|
|
26
27
|
headers: JSON.stringify(DEFAULT_HEADERS),
|
|
27
28
|
url: url,
|
|
29
|
+
triggeredBy: '${LOCAL_TRIGGERED_BY}',
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
let req = {query, body}
|
|
@@ -42,6 +44,7 @@ describe(\`create files to diff for \${file}\`,function (){
|
|
|
42
44
|
variation: 'DEFAULT',
|
|
43
45
|
headers: JSON.stringify(DEFAULT_HEADERS),
|
|
44
46
|
url: url,
|
|
47
|
+
triggeredBy: '${LOCAL_TRIGGERED_BY}',
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
let req = {query, body}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speedkit/cli",
|
|
3
3
|
"description": "Speed Kit CLI",
|
|
4
|
-
"version": "4.23.
|
|
4
|
+
"version": "4.23.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baqend.com",
|
|
7
7
|
"email": "info@baqend.com"
|
|
@@ -64,6 +64,11 @@
|
|
|
64
64
|
],
|
|
65
65
|
"oclif": {
|
|
66
66
|
"commands": "./dist/commands",
|
|
67
|
+
"hooks": {
|
|
68
|
+
"init": [
|
|
69
|
+
"./dist/hooks/init/dns-result-order.js"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
67
72
|
"bin": "sk",
|
|
68
73
|
"dirname": "speed-kit-cli",
|
|
69
74
|
"plugins": [
|