@speedkit/cli 4.35.0 → 4.35.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/hooks/init/http1-global-dispatcher.d.ts +12 -0
- package/dist/hooks/init/http1-global-dispatcher.js +14 -0
- package/dist/hooks/init/http1-global-dispatcher.spec.d.ts +1 -0
- package/dist/hooks/init/http1-global-dispatcher.spec.js +42 -0
- package/oclif.manifest.json +34 -34
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [4.35.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.35.0...v4.35.1) (2026-09-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* disallow https until a bug in package unici is fixed ([e407651](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/e4076518e4a270b676c86c1e7f8c84cd5153f631))
|
|
7
|
+
|
|
1
8
|
# [4.35.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.34.0...v4.35.0) (2026-09-23)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hook } from "@oclif/core";
|
|
2
|
+
/**
|
|
3
|
+
* Keeps every request through the global dispatcher on HTTP/1.1.
|
|
4
|
+
*
|
|
5
|
+
* Importing the `undici` package installs its Agent as the global dispatcher, and Node's
|
|
6
|
+
* built-in `fetch` then sends through it. Up to undici 8.10 that path was forced to HTTP/1.1.
|
|
7
|
+
* Since 8.11 it negotiates HTTP/2, and the built-in `fetch` gets a response without any
|
|
8
|
+
* headers: no `content-encoding`, so a gzip body stays compressed, and no custom headers.
|
|
9
|
+
* Requests with their own dispatcher (the origin proxy) are not affected.
|
|
10
|
+
*/
|
|
11
|
+
declare const hook: Hook<"init">;
|
|
12
|
+
export default hook;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Agent, setGlobalDispatcher } from "undici";
|
|
2
|
+
/**
|
|
3
|
+
* Keeps every request through the global dispatcher on HTTP/1.1.
|
|
4
|
+
*
|
|
5
|
+
* Importing the `undici` package installs its Agent as the global dispatcher, and Node's
|
|
6
|
+
* built-in `fetch` then sends through it. Up to undici 8.10 that path was forced to HTTP/1.1.
|
|
7
|
+
* Since 8.11 it negotiates HTTP/2, and the built-in `fetch` gets a response without any
|
|
8
|
+
* headers: no `content-encoding`, so a gzip body stays compressed, and no custom headers.
|
|
9
|
+
* Requests with their own dispatcher (the origin proxy) are not affected.
|
|
10
|
+
*/
|
|
11
|
+
const hook = async () => {
|
|
12
|
+
setGlobalDispatcher(new Agent({ allowH2: false }));
|
|
13
|
+
};
|
|
14
|
+
export default hook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { after, before, describe, it } from "mocha";
|
|
3
|
+
import tls from "node:tls";
|
|
4
|
+
import { Agent, getGlobalDispatcher, setGlobalDispatcher } from "undici";
|
|
5
|
+
import hook from "./http1-global-dispatcher.js";
|
|
6
|
+
describe("http1-global-dispatcher hook", () => {
|
|
7
|
+
const previousDispatcher = getGlobalDispatcher();
|
|
8
|
+
let server;
|
|
9
|
+
let offeredProtocols;
|
|
10
|
+
before(async () => {
|
|
11
|
+
// no certificate: the handshake fails, but the offered ALPN protocols
|
|
12
|
+
// arrive before that
|
|
13
|
+
server = tls.createServer({
|
|
14
|
+
ALPNCallback: ({ protocols }) => {
|
|
15
|
+
offeredProtocols = protocols;
|
|
16
|
+
return undefined;
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
// the aborted handshake is expected
|
|
20
|
+
server.on("tlsClientError", () => undefined);
|
|
21
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
22
|
+
});
|
|
23
|
+
after(() => {
|
|
24
|
+
server.close();
|
|
25
|
+
setGlobalDispatcher(previousDispatcher);
|
|
26
|
+
});
|
|
27
|
+
async function offeredByBuiltInFetch() {
|
|
28
|
+
offeredProtocols = undefined;
|
|
29
|
+
const { port } = server.address();
|
|
30
|
+
// fails on the missing certificate, only the offer matters
|
|
31
|
+
await fetch(`https://127.0.0.1:${port}/`).catch(() => undefined);
|
|
32
|
+
return offeredProtocols;
|
|
33
|
+
}
|
|
34
|
+
it("offers HTTP/2 to the built-in fetch without it", async () => {
|
|
35
|
+
setGlobalDispatcher(new Agent());
|
|
36
|
+
expect(await offeredByBuiltInFetch()).to.include("h2");
|
|
37
|
+
});
|
|
38
|
+
it("keeps the built-in fetch on HTTP/1.1", async () => {
|
|
39
|
+
await hook.call(null, {});
|
|
40
|
+
expect(await offeredByBuiltInFetch()).to.deep.equal(["http/1.1"]);
|
|
41
|
+
});
|
|
42
|
+
});
|
package/oclif.manifest.json
CHANGED
|
@@ -1050,39 +1050,6 @@
|
|
|
1050
1050
|
"wpt-launcher.js"
|
|
1051
1051
|
]
|
|
1052
1052
|
},
|
|
1053
|
-
"autocomplete:fish": {
|
|
1054
|
-
"aliases": [],
|
|
1055
|
-
"args": {},
|
|
1056
|
-
"description": "Generate fish shell completions and install them to ~/.config/fish/completions.",
|
|
1057
|
-
"examples": [
|
|
1058
|
-
"$ sk autocomplete fish",
|
|
1059
|
-
"$ sk autocomplete fish --print > sk.fish"
|
|
1060
|
-
],
|
|
1061
|
-
"flags": {
|
|
1062
|
-
"print": {
|
|
1063
|
-
"char": "p",
|
|
1064
|
-
"description": "Print the completion script to stdout instead of installing it",
|
|
1065
|
-
"name": "print",
|
|
1066
|
-
"allowNo": false,
|
|
1067
|
-
"type": "boolean"
|
|
1068
|
-
}
|
|
1069
|
-
},
|
|
1070
|
-
"hasDynamicHelp": false,
|
|
1071
|
-
"hiddenAliases": [],
|
|
1072
|
-
"id": "autocomplete:fish",
|
|
1073
|
-
"pluginAlias": "@speedkit/cli",
|
|
1074
|
-
"pluginName": "@speedkit/cli",
|
|
1075
|
-
"pluginType": "core",
|
|
1076
|
-
"strict": true,
|
|
1077
|
-
"enableJsonFlag": false,
|
|
1078
|
-
"isESM": true,
|
|
1079
|
-
"relativePath": [
|
|
1080
|
-
"dist",
|
|
1081
|
-
"commands",
|
|
1082
|
-
"autocomplete",
|
|
1083
|
-
"fish.js"
|
|
1084
|
-
]
|
|
1085
|
-
},
|
|
1086
1053
|
"browser:clean": {
|
|
1087
1054
|
"aliases": [],
|
|
1088
1055
|
"args": {},
|
|
@@ -1681,7 +1648,40 @@
|
|
|
1681
1648
|
"query",
|
|
1682
1649
|
"prewarm.js"
|
|
1683
1650
|
]
|
|
1651
|
+
},
|
|
1652
|
+
"autocomplete:fish": {
|
|
1653
|
+
"aliases": [],
|
|
1654
|
+
"args": {},
|
|
1655
|
+
"description": "Generate fish shell completions and install them to ~/.config/fish/completions.",
|
|
1656
|
+
"examples": [
|
|
1657
|
+
"$ sk autocomplete fish",
|
|
1658
|
+
"$ sk autocomplete fish --print > sk.fish"
|
|
1659
|
+
],
|
|
1660
|
+
"flags": {
|
|
1661
|
+
"print": {
|
|
1662
|
+
"char": "p",
|
|
1663
|
+
"description": "Print the completion script to stdout instead of installing it",
|
|
1664
|
+
"name": "print",
|
|
1665
|
+
"allowNo": false,
|
|
1666
|
+
"type": "boolean"
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1669
|
+
"hasDynamicHelp": false,
|
|
1670
|
+
"hiddenAliases": [],
|
|
1671
|
+
"id": "autocomplete:fish",
|
|
1672
|
+
"pluginAlias": "@speedkit/cli",
|
|
1673
|
+
"pluginName": "@speedkit/cli",
|
|
1674
|
+
"pluginType": "core",
|
|
1675
|
+
"strict": true,
|
|
1676
|
+
"enableJsonFlag": false,
|
|
1677
|
+
"isESM": true,
|
|
1678
|
+
"relativePath": [
|
|
1679
|
+
"dist",
|
|
1680
|
+
"commands",
|
|
1681
|
+
"autocomplete",
|
|
1682
|
+
"fish.js"
|
|
1683
|
+
]
|
|
1684
1684
|
}
|
|
1685
1685
|
},
|
|
1686
|
-
"version": "4.35.
|
|
1686
|
+
"version": "4.35.1"
|
|
1687
1687
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speedkit/cli",
|
|
3
3
|
"description": "Speed Kit CLI",
|
|
4
|
-
"version": "4.35.
|
|
4
|
+
"version": "4.35.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baqend.com",
|
|
7
7
|
"email": "info@baqend.com"
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
"commands": "./dist/commands",
|
|
69
69
|
"hooks": {
|
|
70
70
|
"init": [
|
|
71
|
-
"./dist/hooks/init/dns-result-order.js"
|
|
71
|
+
"./dist/hooks/init/dns-result-order.js",
|
|
72
|
+
"./dist/hooks/init/http1-global-dispatcher.js"
|
|
72
73
|
]
|
|
73
74
|
},
|
|
74
75
|
"topics": {
|
|
@@ -143,7 +144,7 @@
|
|
|
143
144
|
"strip-comments": "^2.0.1",
|
|
144
145
|
"tsx": "^4.21.0",
|
|
145
146
|
"tty-table": "^5.0.0",
|
|
146
|
-
"undici": "^8.
|
|
147
|
+
"undici": "^8.11.0",
|
|
147
148
|
"uuid": "^13.0.0"
|
|
148
149
|
},
|
|
149
150
|
"devDependencies": {
|