Skip to content

Commit e1eb4e6

Browse files
committed
split bare-mux-custom, epoxy-transport, libcurl-transport into discrete subpackages
1 parent a4e66b1 commit e1eb4e6

File tree

11 files changed

+412
-24
lines changed

11 files changed

+412
-24
lines changed

packages/scramjet/src/bare-mux-custom.ts renamed to packages/bare-mux-custom/index.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import LibcurlClient from "./curltransport";
2-
import EpoxyTransport from "./epoxytransport";
3-
import { config } from "./shared";
4-
51
export type BareHeaders = Record<string, string | string[]>;
62

73
export type BareMeta = {
@@ -86,15 +82,10 @@ export interface BareResponseFetch extends BareResponse {
8682
finalURL: string;
8783
}
8884
export class BareClient {
89-
transport: BareTransport;
9085
/**
9186
* Create a BareClient. Calls to fetch and connect will wait for an implementation to be ready.
9287
*/
93-
constructor() {
94-
this.transport = new LibcurlClient({
95-
wisp: config.wisp,
96-
});
97-
}
88+
constructor(public transport: BareTransport) {}
9889

9990
createWebSocket(
10091
remote: string | URL,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "@mercuryworkshop/bare-mux-custom",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"packageManager": "[email protected]",
6+
"main": "index.ts"
7+
}

packages/scramjet/src/epoxytransport.ts renamed to packages/epoxy-transport/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
BareHeaders,
33
TransferrableResponse,
44
BareTransport,
5-
} from "./bare-mux-custom";
5+
} from "@mercuryworkshop/bare-mux-custom";
66
import initEpoxy, {
77
EpoxyClient,
88
EpoxyClientOptions,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@mercuryworkshop/epoxy-transport",
3+
"version": "2.0.0",
4+
"description": "a bare transport that implements end-to-end encryption with libcurl.js and wisp",
5+
"author": "ading2210",
6+
"license": "AGPL-3.0-only",
7+
"type": "module",
8+
"scripts": {
9+
"build": "node esbuild.bundle.mjs; cp dist/index.cjs dist/index.js",
10+
"prepack": "npm run build"
11+
},
12+
"dependencies": {
13+
"@mercuryworkshop/bare-mux-custom": "workspace:*",
14+
"@mercuryworkshop/epoxy-tls": "2.1.18-1",
15+
"libcurl.js": "^0.7.1"
16+
},
17+
"main": "index.ts"
18+
}

packages/inject/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"license": "ISC",
1313
"packageManager": "[email protected]",
1414
"dependencies": {
15-
"@mercuryworkshop/scramjet": "link:../scramjet",
15+
"@mercuryworkshop/scramjet": "workspace:*",
1616
"chobitsu": "workspace:*",
1717
"html-to-image": "^1.11.13"
1818
}

packages/scramjet/src/curltransport.ts renamed to packages/libcurl-transport/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
BareResponse,
44
TransferrableResponse,
55
BareTransport,
6-
} from "./bare-mux-custom";
6+
} from "@mercuryworkshop/bare-mux-custom";
77
import { libcurl } from "libcurl.js/bundled";
88
export default class LibcurlClient implements BareTransport {
99
wisp: string;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "@mercuryworkshop/libcurl-transport",
3+
"version": "2.0.0",
4+
"description": "a bare transport that implements end-to-end encryption with libcurl.js and wisp",
5+
"author": "ading2210",
6+
"license": "AGPL-3.0-only",
7+
"type": "module",
8+
"scripts": {
9+
"build": "node esbuild.bundle.mjs; cp dist/index.cjs dist/index.js",
10+
"prepack": "npm run build"
11+
},
12+
"dependencies": {
13+
"@mercuryworkshop/bare-mux-custom": "workspace:*",
14+
"libcurl.js": "^0.7.1"
15+
},
16+
"main": "index.ts"
17+
}

packages/rewriter_demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"vite": "^7.1.2"
1313
},
1414
"dependencies": {
15-
"@mercuryworkshop/scramjet": "link:..",
16-
"dreamland": "link:../dreamlandjs",
15+
"@mercuryworkshop/scramjet": "workspace:*",
16+
"dreamland": "workspace:*",
1717
"monaco-editor": "^0.52.2",
1818
"vite-plugin-static-copy": "^3.1.1"
1919
}

packages/scramjet/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"@typescript-eslint/parser": "^8.43.0",
8989
"actionlint": "^2.0.6",
9090
"ava": "^6.4.1",
91+
"@mercuryworkshop/bare-mux-custom": "workspace:*",
9192
"dotenv": "^17.2.2",
9293
"eslint": "^9.35.0",
9394
"fastify": "^5.6.0",
@@ -111,12 +112,10 @@
111112
"typescript": "^5.9.2"
112113
},
113114
"dependencies": {
114-
"@mercuryworkshop/epoxy-tls": "2.1.18-1",
115115
"dom-serializer": "^2.0.0",
116116
"domhandler": "^5.0.3",
117117
"domutils": "^3.2.2",
118118
"htmlparser2": "10.0.0",
119-
"libcurl.js": "^0.7.2",
120119
"idb": "^8.0.3",
121120
"parse-domain": "^8.2.2",
122121
"set-cookie-parser": "^2.7.1"

0 commit comments

Comments
 (0)