Skip to content

Commit 0fd67dc

Browse files
committed
Init
1 parent b021e9d commit 0fd67dc

26 files changed

+482
-14
lines changed

cli.ts

Whitespace-only changes.

deno.json

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
{
2-
"name": "@denoplayground/template",
2+
"name": "@typescriptplayground/socket",
33
"version": "0.1.0",
4+
"license": "./LICENSE",
5+
"exports": {
6+
".": "./src/index.ts"
7+
},
48
"tasks": {
5-
"run": {
6-
"description": "Run the main application.",
7-
"command": "deno run -A --check ./src/index.ts"
8-
},
9-
"run:watch": {
10-
"description": "Run the main application in watch mode.",
11-
"command": "deno run -A --check --watch ./src/index.ts"
12-
},
139
"lint": {
14-
"description": "Run the linting tool.",
10+
"description": "Run linter.",
1511
"command": "deno lint"
1612
},
13+
"format": {
14+
"description": "Run formatter.",
15+
"command": "deno lint --fix"
16+
},
1717
"test": {
1818
"description": "Run the test suite.",
1919
"command": "deno test -A --check --permit-no-files --reload --doc --junit-path=\"./reports/report.xml\""
2020
}
2121
},
2222
"compilerOptions": {
23-
"allowJs": false,
2423
"lib": [
2524
"deno.ns",
2625
"deno.window",
27-
"deno.worker",
28-
"decorators",
29-
"esnext"
26+
"deno.worker"
3027
]
3128
},
3229
"test": {
@@ -35,6 +32,11 @@
3532
]
3633
},
3734
"lint": {
35+
"plugins": [
36+
"jsr:@loat-dev/lint-plugins@0.3.6/colon_spacing",
37+
"jsr:@loat-dev/lint-plugins@0.3.6/imports",
38+
"jsr:@loat-dev/lint-plugins@0.3.6/arrays"
39+
],
3840
"rules": {
3941
"tags": [
4042
"recommended"
@@ -62,5 +64,8 @@
6264
"lineWidth": 120,
6365
"typeLiteral.separatorKind": "comma",
6466
"useBraces": "always"
67+
},
68+
"imports": {
69+
"@std/assert": "jsr:@std/assert@^1.0.15"
6570
}
6671
}

deno.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

response.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
HTTP/1.1 200 OK
2+
Api-Version: 1.51
3+
Content-Type: application/json
4+
Docker-Experimental: false
5+
Ostype: linux
6+
Server: Docker/28.3.3 (linux)
7+
Date: Mon, 10 Nov 2025 15:42:24 GMT
8+
Connection: close
9+
Transfer-Encoding: chunked
10+
11+
bb7
12+
[{"Id":"0954fa1ee0b11120eeabb22c2b4bc924221840a8d8d8a408ac8881616019161a","Names":["/infallible_newton"],"Image":"node:20","ImageID":"sha256:d05db19b2fc951de57277a69bef61300129cfa87385b241b9201db91f01376ea","Command":"/bin/sh -c 'echo Container started\ntrap \"exit 0\" 15\n\nexec \"$@\"\nwhile sleep 1 & wait $!; do :; done' -","Created":1760434443,"Ports":[],"Labels":{"devcontainer.config_file":"/mnt/c/Users/17000181/Development/gitlab/me-optronic/webui/imc/imc5xx0/.devcontainer/devcontainer.json","devcontainer.local_folder":"c:\\Users\\17000181\\Development\\gitlab\\me-optronic\\webui\\imc\\imc5xx0","devcontainer.metadata":"[{\"postCreateCommand\":\"npm config set //gitlab02.micro-epsilon.de/api/v4/packages/npm/:_authToken=${localEnv:GL_AUTH_TOKEN} && npm ci && chmod -R a+rwx build && chmod -R a+rwx node_modules\",\"customizations\":{\"vscode\":{\"extensions\":[\"vunguyentuan.vscode-css-variables\",\"streetsidesoftware.code-spell-checker\",\"yzhang.markdown-all-in-one\",\"streetsidesoftware.code-spell-checker-german\",\"dbaeumer.vscode-eslint\"]}},\"mounts\":[{\"type\":\"volume\",\"target\":\"${containerWorkspaceFolder}/node_modules\"},{\"type\":\"volume\",\"target\":\"${containerWorkspaceFolder}/build\"}],\"containerEnv\":{\"NODE_ENV\":\"development\"},\"forwardPorts\":[\"localhost:8000\",\"localhost:8888\"]}]"},"State":"running","Status":"Up 8 hours","HostConfig":{"NetworkMode":"bridge"},"NetworkSettings":{"Networks":{"bridge":{"IPAMConfig":null,"Links":null,"Aliases":null,"MacAddress":"92:78:de:f3:58:a7","DriverOpts":null,"GwPriority":0,"NetworkID":"1aa367c5042af469d2505bf36f4ac40862cd222f4d6e743a6c8af8b44d48b15c","EndpointID":"5ebbb39dc5a779be73c516a4a8fe978a72825e7965714e6500a0844113e5d28d","Gateway":"172.17.0.1","IPAddress":"172.17.0.2","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"DNSNames":null}}},"Mounts":[{"Type":"volume","Name":"79c2c791138c00c10561ba5e325519138f33b4f57bc87951ef04a1ae039d91d9","Source":"/var/lib/docker/volumes/79c2c791138c00c10561ba5e325519138f33b4f57bc87951ef04a1ae039d91d9/_data","Destination":"/workspaces/imc5xx0/node_modules","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"bind","Source":"/run/user/1001/wayland-0","Destination":"/tmp/vscode-wayland-9559a141-0286-44b8-8ab6-f67dc78d9af5.sock","Mode":"","RW":true,"Propagation":"rprivate"},{"Type":"volume","Name":"vscode","Source":"/var/lib/docker/volumes/vscode/_data","Destination":"/vscode","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"bind","Source":"/mnt/c/Users/17000181/Development/gitlab/me-optronic/webui/imc/imc5xx0","Destination":"/workspaces/imc5xx0","Mode":"","RW":true,"Propagation":"rprivate"},{"Type":"volume","Name":"a1db817e930b814a9d8dd921cf2e663e7f0d21f336f1e8bc19e12f61de965b45","Source":"/var/lib/docker/volumes/a1db817e930b814a9d8dd921cf2e663e7f0d21f336f1e8bc19e12f61de965b45/_data","Destination":"/workspaces/imc5xx0/build","Driver":"local","Mode":"z","RW":true,"Propagation":""}]}]
13+
14+
0
15+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* This error represents a connection that was closed before receiving a response.
3+
*/
4+
export class ConnectionClosedError extends Error {
5+
constructor() {
6+
super('Connection closed before receiving response')
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* This error represents an incomplete HTTP response.
3+
*/
4+
export class IncompleteHttpResponseError extends Error {
5+
constructor() {
6+
super('Incomplete HTTP response');
7+
}
8+
}

src/error/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export { ConnectionClosedError } from './connection_closed_error.ts'
2+
export { IncompleteHttpResponseError } from './inclomplete_http_response_error.ts'
3+
export { InvalidHttpResponseError } from './invalid_http_response_error.ts'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export class InvalidHttpResponseError extends Error {
2+
constructor(message : string) {
3+
super(message);
4+
}
5+
}

src/http/error/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { InvalidStartLineError } from './invalid_start_line_error.ts'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export class InvalidStartLineError extends Error {
2+
content : string;
3+
constructor(content : string) {
4+
super(`Invalid HTTP status. Trying to parse: "${content}"`);
5+
this.content = content;
6+
}
7+
}

0 commit comments

Comments
 (0)