feat(http): initialize @webnet/http package and wire into test-app

- Add packages/http with package.json, tsconfig.json, and empty index.ts
- Add @webnet/http as a dependency of test-app
- Expose http namespace on window for console testing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-11 22:19:55 +00:00
parent 7900e63b93
commit 61ec60b46c
6 changed files with 53 additions and 0 deletions
+26
View File
@@ -1540,6 +1540,10 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
} }
}, },
"node_modules/@webnet/http": {
"resolved": "packages/http",
"link": true
},
"node_modules/@webnet/test-app": { "node_modules/@webnet/test-app": {
"resolved": "packages/test-app", "resolved": "packages/test-app",
"link": true "link": true
@@ -4030,10 +4034,32 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"packages/http": {
"name": "@webnet/http",
"version": "0.1.0",
"devDependencies": {
"typescript": "^6.0.2"
}
},
"packages/http/node_modules/typescript": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz",
"integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"packages/test-app": { "packages/test-app": {
"name": "@webnet/test-app", "name": "@webnet/test-app",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@webnet/http": "*",
"@webnet/tsconnect": "*" "@webnet/tsconnect": "*"
}, },
"devDependencies": { "devDependencies": {
+10
View File
@@ -0,0 +1,10 @@
{
"name": "@webnet/http",
"version": "0.1.0",
"description": "HTTP/1.1 server over Tailscale WASM networking",
"type": "module",
"main": "src/index.ts",
"devDependencies": {
"typescript": "^6.0.2"
}
}
+1
View File
@@ -0,0 +1 @@
export {}
+12
View File
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"skipLibCheck": true,
"lib": ["ES2020", "DOM"],
"noEmit": true
},
"include": ["src/**/*"]
}
+1
View File
@@ -9,6 +9,7 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@webnet/http": "*",
"@webnet/tsconnect": "*" "@webnet/tsconnect": "*"
}, },
"devDependencies": { "devDependencies": {
+3
View File
@@ -1,6 +1,7 @@
import { initIPN } from "@webnet/tsconnect" import { initIPN } from "@webnet/tsconnect"
import wasmURL from "@webnet/tsconnect/main.wasm?url" import wasmURL from "@webnet/tsconnect/main.wasm?url"
import cacertURL from "@webnet/tsconnect/cacert.pem?url" import cacertURL from "@webnet/tsconnect/cacert.pem?url"
import * as http from "@webnet/http"
declare global { declare global {
interface Window { interface Window {
@@ -8,6 +9,7 @@ declare global {
wasmURL: string wasmURL: string
cacertURL: string cacertURL: string
loadCACerts: () => Promise<string> loadCACerts: () => Promise<string>
http: typeof http
} }
} }
@@ -32,6 +34,7 @@ window.initIPN = initIPN
window.wasmURL = wasmURL window.wasmURL = wasmURL
window.cacertURL = cacertURL window.cacertURL = cacertURL
window.loadCACerts = loadCACerts window.loadCACerts = loadCACerts
window.http = http
const status = document.getElementById("status") const status = document.getElementById("status")
if (status) { if (status) {