summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <tom@vanderlee.io>2026-04-03 15:17:13 +0200
committerGravatar Tom van der Lee <tom@vanderlee.io>2026-04-03 15:17:13 +0200
commit1e704530cea02cc5b1b5a9049da432f232f0276f (patch)
tree749d19dd3ee0a7777cf28393ec38dbd1c9cb481e
parent06ec1f69e11fc52c0e2c6b5f12c3c89b9ef18436 (diff)
downloadclient-1e704530cea02cc5b1b5a9049da432f232f0276f.tar.gz
client-1e704530cea02cc5b1b5a9049da432f232f0276f.tar.bz2
client-1e704530cea02cc5b1b5a9049da432f232f0276f.zip
Upgraded librariesv2.3.0
Python: - Migrate to uv for dependency management; consolidate setup.cfg and requirements files into pyproject.toml (PEP 621) - Upgrade websockets 10 → 16; update import to ClientConnection and remove deprecated WebSocketClientProtocol - Fix PubSub.history classmethod/property combo removed in Python 3.13 - Set requires-python = ">=3.10" (minimum for match statement) JavaScript: - Upgrade React 18 → 19, Vite 5 → 8, TypeScript 5 → 6 and all other frontend dependencies to latest - Replace ReactDOM.render with createRoot (removed in React 18) - Swap react-json-view for @microlink/react-json-view (React 19 support) CI: - Switch GitHub Actions build to uv and --frozen-lockfile yarn install
-rw-r--r--.github/workflows/python-publish.yml8
-rw-r--r--dev_requirements.txt4
-rw-r--r--package.json26
-rw-r--r--pyproject.toml33
-rw-r--r--requirements.txt4
-rw-r--r--setup.cfg18
-rw-r--r--src/components/Content/Content.tsx2
-rw-r--r--src/components/Frames/Frames.tsx2
-rw-r--r--src/index.tsx7
-rw-r--r--ttun/client.py9
-rw-r--r--ttun/inspect_server.py2
-rw-r--r--ttun/pubsub.py1
-rw-r--r--uv.lock1494
-rw-r--r--yarn.lock1857
14 files changed, 2385 insertions, 1082 deletions
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
index 506f187..3c34e1f 100644
--- a/.github/workflows/python-publish.yml
+++ b/.github/workflows/python-publish.yml
@@ -23,15 +23,15 @@ jobs:
23 node-version: '22' 23 node-version: '22'
24 - name: Install node dependencies 24 - name: Install node dependencies
25 run: | 25 run: |
26 yarn install 26 yarn install --frozen-lockfile
27 - name: Install python dependencies 27 - name: Install python dependencies
28 run: | 28 run: |
29 python -m pip install --upgrade pip 29 pip install uv
30 pip install build 30 uv sync --no-group dev
31 - name: Build package 31 - name: Build package
32 run: | 32 run: |
33 yarn build 33 yarn build
34 python -m build 34 uv build
35 - name: Publish package 35 - name: Publish package
36 uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 36 uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37 if: github.event_name != 'pull_request' 37 if: github.event_name != 'pull_request'
diff --git a/dev_requirements.txt b/dev_requirements.txt
deleted file mode 100644
index d5ce409..0000000
--- a/dev_requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
1setuptools
2build
3setuptools-git-versioning
4pre-commit
diff --git a/package.json b/package.json
index 948e21f..f46b714 100644
--- a/package.json
+++ b/package.json
@@ -10,22 +10,22 @@
10 }, 10 },
11 "license": "MIT", 11 "license": "MIT",
12 "dependencies": { 12 "dependencies": {
13 "bootstrap": "^5.3.3", 13 "@microlink/react-json-view": "^1.31.15",
14 "bootstrap-icons": "^1.11.3", 14 "bootstrap": "^5.3.8",
15 "bootstrap-icons": "^1.13.1",
15 "classnames": "^2.5.1", 16 "classnames": "^2.5.1",
16 "dayjs": "^1.11.13", 17 "dayjs": "^1.11.20",
17 "react": "^18.3.1", 18 "react": "^19.2.4",
18 "react-bootstrap": "^2.10.4", 19 "react-bootstrap": "^2.10.10",
19 "react-dom": "^18.3.1", 20 "react-dom": "^19.2.4"
20 "react-json-view": "^1.21.3"
21 }, 21 },
22 "devDependencies": { 22 "devDependencies": {
23 "@types/react": "^18.3.5", 23 "@types/react": "^19.2.14",
24 "@types/react-dom": "^18.3.0", 24 "@types/react-dom": "^19.2.3",
25 "@vitejs/plugin-react": "^4.3.1", 25 "@vitejs/plugin-react": "^6.0.1",
26 "babel-preset-nano-react-app": "^0.1.0", 26 "babel-preset-nano-react-app": "^0.1.0",
27 "sass": "^1.78.0", 27 "sass": "^1.99.0",
28 "typescript": "^5.5.4", 28 "typescript": "^6.0.2",
29 "vite": "^5.4.3" 29 "vite": "^8.0.3"
30 } 30 }
31} 31}
diff --git a/pyproject.toml b/pyproject.toml
index ba7a2d8..08140a3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,37 @@
1[build-system] 1[build-system]
2requires = [ "setuptools>=41", "wheel", "setuptools-git-versioning", ] 2requires = ["setuptools>=41", "wheel", "setuptools-git-versioning"]
3build-backend = "setuptools.build_meta" 3build-backend = "setuptools.build_meta"
4 4
5[project]
6name = "ttun"
7dynamic = ["version"]
8authors = [{name = "Tom van der Lee"}]
9description = "Expose a local port via your selfhosted TTUN Server"
10readme = "README.rst"
11license = {text = "BSD-3-Clause"}
12requires-python = ">=3.10"
13dependencies = [
14 "websockets ~= 16.0",
15 "aiohttp[speedups] ~= 3.13.5",
16 "appdirs ~= 1.4",
17]
18
19[project.scripts]
20ttun = "ttun.__main__:main"
21
22[tool.setuptools]
23include-package-data = true
24
25[tool.setuptools.packages.find]
26where = ["."]
27
5[tool.setuptools-git-versioning] 28[tool.setuptools-git-versioning]
6enabled = true 29enabled = true
30
31[dependency-groups]
32dev = [
33 "setuptools",
34 "build",
35 "setuptools-git-versioning",
36 "pre-commit",
37]
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 8f0d7cb..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
1-r dev_requirements.txt
2websockets ~= 10.0
3aiohttp[speedups] ~= 3.8
4appdirs ~= 1.4
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 51a7e79..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,18 +0,0 @@
1[metadata]
2name = ttun
3author = Tom van der Lee
4description = Expose a local port via your selfhosted TTUN Server
5long_description = file: README.rst
6license = BSD-3-Clause
7
8[options]
9include_package_data = True
10packages = find:
11install_requires =
12 websockets ~= 10.0
13 aiohttp[speedups] ~= 3.8
14 appdirs ~= 1.4
15
16[options.entry_points]
17console_scripts =
18 ttun = ttun.__main__:main
diff --git a/src/components/Content/Content.tsx b/src/components/Content/Content.tsx
index 19736fb..312a1e5 100644
--- a/src/components/Content/Content.tsx
+++ b/src/components/Content/Content.tsx
@@ -1,7 +1,7 @@
1import * as React from "react"; 1import * as React from "react";
2import { Dispatch, SetStateAction, useContext, useMemo } from "react"; 2import { Dispatch, SetStateAction, useContext, useMemo } from "react";
3import { Headers, RequestPayload, ResponsePayload } from "~hooks/useRequests"; 3import { Headers, RequestPayload, ResponsePayload } from "~hooks/useRequests";
4import ReactJson from "react-json-view"; 4import ReactJson from "@microlink/react-json-view";
5import styles from "~/components/Content/Content.module.scss"; 5import styles from "~/components/Content/Content.module.scss";
6import { Button, Col, Container, Row } from "react-bootstrap"; 6import { Button, Col, Container, Row } from "react-bootstrap";
7import { SettingsContext } from "~/contexts/Settings"; 7import { SettingsContext } from "~/contexts/Settings";
diff --git a/src/components/Frames/Frames.tsx b/src/components/Frames/Frames.tsx
index 1d31d92..6779a3c 100644
--- a/src/components/Frames/Frames.tsx
+++ b/src/components/Frames/Frames.tsx
@@ -4,7 +4,7 @@ import { Col, ListGroup, Row } from "react-bootstrap";
4import classNames from "classnames"; 4import classNames from "classnames";
5import styles from "./Frames.module.scss"; 5import styles from "./Frames.module.scss";
6import dayjs from "dayjs"; 6import dayjs from "dayjs";
7import ReactJson from "react-json-view"; 7import ReactJson from "@microlink/react-json-view";
8import { SettingsContext } from "~/contexts/Settings"; 8import { SettingsContext } from "~/contexts/Settings";
9 9
10function isJson(data: any): boolean { 10function isJson(data: any): boolean {
diff --git a/src/index.tsx b/src/index.tsx
index c1a4211..d239501 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,5 +1,5 @@
1import * as React from "react"; 1import * as React from "react";
2import * as ReactDOM from "react-dom"; 2import { createRoot } from "react-dom/client";
3import App from "~/components/App/App"; 3import App from "~/components/App/App";
4 4
5import "~/index.scss"; 5import "~/index.scss";
@@ -10,11 +10,10 @@ import localizedFormat from "dayjs/plugin/localizedFormat";
10import ConnectionProvider from "~/contexts/Connection"; 10import ConnectionProvider from "~/contexts/Connection";
11dayjs.extend(localizedFormat); 11dayjs.extend(localizedFormat);
12 12
13ReactDOM.render( 13createRoot(document.getElementById("root")).render(
14 <SettingsProvider> 14 <SettingsProvider>
15 <ConnectionProvider> 15 <ConnectionProvider>
16 <App /> 16 <App />
17 </ConnectionProvider> 17 </ConnectionProvider>
18 </SettingsProvider>, 18 </SettingsProvider>
19 document.getElementById("root")
20); 19);
diff --git a/ttun/client.py b/ttun/client.py
index b19bb47..0cc5012 100644
--- a/ttun/client.py
+++ b/ttun/client.py
@@ -21,7 +21,7 @@ from aiohttp import ClientConnectionError
21from aiohttp import ClientError 21from aiohttp import ClientError
22from aiohttp import ClientSession 22from aiohttp import ClientSession
23from aiohttp import DummyCookieJar 23from aiohttp import DummyCookieJar
24from websockets import WebSocketClientProtocol 24from websockets.asyncio.client import ClientConnection
25from websockets.exceptions import ConnectionClosed 25from websockets.exceptions import ConnectionClosed
26 26
27from ttun import __version__ 27from ttun import __version__
@@ -56,7 +56,7 @@ class Client:
56 self.subdomain = subdomain 56 self.subdomain = subdomain
57 57
58 self.config: Optional[Config] = None 58 self.config: Optional[Config] = None
59 self.connection: WebSocketClientProtocol = None 59 self.connection: ClientConnection = None
60 60
61 self.proxy_origin = f'{"https" if https else "http"}://{to}:{port}' 61 self.proxy_origin = f'{"https" if https else "http"}://{to}:{port}'
62 self.ws_proxy_origin = f'{"wss" if https else "ws"}://{to}:{port}' 62<