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:
Generated
+26
@@ -1540,6 +1540,10 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@webnet/http": {
|
||||
"resolved": "packages/http",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@webnet/test-app": {
|
||||
"resolved": "packages/test-app",
|
||||
"link": true
|
||||
@@ -4030,10 +4034,32 @@
|
||||
"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": {
|
||||
"name": "@webnet/test-app",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@webnet/http": "*",
|
||||
"@webnet/tsconnect": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export {}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"lib": ["ES2020", "DOM"],
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@webnet/http": "*",
|
||||
"@webnet/tsconnect": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { initIPN } from "@webnet/tsconnect"
|
||||
import wasmURL from "@webnet/tsconnect/main.wasm?url"
|
||||
import cacertURL from "@webnet/tsconnect/cacert.pem?url"
|
||||
import * as http from "@webnet/http"
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -8,6 +9,7 @@ declare global {
|
||||
wasmURL: string
|
||||
cacertURL: string
|
||||
loadCACerts: () => Promise<string>
|
||||
http: typeof http
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +34,7 @@ window.initIPN = initIPN
|
||||
window.wasmURL = wasmURL
|
||||
window.cacertURL = cacertURL
|
||||
window.loadCACerts = loadCACerts
|
||||
window.http = http
|
||||
|
||||
const status = document.getElementById("status")
|
||||
if (status) {
|
||||
|
||||
Reference in New Issue
Block a user