diff options
| author | 2026-04-03 15:17:13 +0200 | |
|---|---|---|
| committer | 2026-04-03 15:17:13 +0200 | |
| commit | 1e704530cea02cc5b1b5a9049da432f232f0276f (patch) | |
| tree | 749d19dd3ee0a7777cf28393ec38dbd1c9cb481e | |
| parent | 06ec1f69e11fc52c0e2c6b5f12c3c89b9ef18436 (diff) | |
| download | client-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.yml | 8 | ||||
| -rw-r--r-- | dev_requirements.txt | 4 | ||||
| -rw-r--r-- | package.json | 26 | ||||
| -rw-r--r-- | pyproject.toml | 33 | ||||
| -rw-r--r-- | requirements.txt | 4 | ||||
| -rw-r--r-- | setup.cfg | 18 | ||||
| -rw-r--r-- | src/components/Content/Content.tsx | 2 | ||||
| -rw-r--r-- | src/components/Frames/Frames.tsx | 2 | ||||
| -rw-r--r-- | src/index.tsx | 7 | ||||
| -rw-r--r-- | ttun/client.py | 9 | ||||
| -rw-r--r-- | ttun/inspect_server.py | 2 | ||||
| -rw-r--r-- | ttun/pubsub.py | 1 | ||||
| -rw-r--r-- | uv.lock | 1494 | ||||
| -rw-r--r-- | yarn.lock | 1857 |
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 @@ | |||
| 1 | setuptools | ||
| 2 | build | ||
| 3 | setuptools-git-versioning | ||
| 4 | pre-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] |
| 2 | requires = [ "setuptools>=41", "wheel", "setuptools-git-versioning", ] | 2 | requires = ["setuptools>=41", "wheel", "setuptools-git-versioning"] |
| 3 | build-backend = "setuptools.build_meta" | 3 | build-backend = "setuptools.build_meta" |
| 4 | 4 | ||
| 5 | [project] | ||
| 6 | name = "ttun" | ||
| 7 | dynamic = ["version"] | ||
| 8 | authors = [{name = "Tom van der Lee"}] | ||
| 9 | description = "Expose a local port via your selfhosted TTUN Server" | ||
| 10 | readme = "README.rst" | ||
| 11 | license = {text = "BSD-3-Clause"} | ||
| 12 | requires-python = ">=3.10" | ||
| 13 | dependencies = [ | ||
| 14 | "websockets ~= 16.0", | ||
| 15 | "aiohttp[speedups] ~= 3.13.5", | ||
| 16 | "appdirs ~= 1.4", | ||
| 17 | ] | ||
| 18 | |||
| 19 | [project.scripts] | ||
| 20 | ttun = "ttun.__main__:main" | ||
| 21 | |||
| 22 | [tool.setuptools] | ||
| 23 | include-package-data = true | ||
| 24 | |||
| 25 | [tool.setuptools.packages.find] | ||
| 26 | where = ["."] | ||
| 27 | |||
| 5 | [tool.setuptools-git-versioning] | 28 | [tool.setuptools-git-versioning] |
| 6 | enabled = true | 29 | enabled = true |
| 30 | |||
| 31 | [dependency-groups] | ||
| 32 | dev = [ | ||
| 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 | ||
| 2 | websockets ~= 10.0 | ||
| 3 | aiohttp[speedups] ~= 3.8 | ||
| 4 | appdirs ~= 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] | ||
| 2 | name = ttun | ||
| 3 | author = Tom van der Lee | ||
| 4 | description = Expose a local port via your selfhosted TTUN Server | ||
| 5 | long_description = file: README.rst | ||
| 6 | license = BSD-3-Clause | ||
| 7 | |||
| 8 | [options] | ||
| 9 | include_package_data = True | ||
| 10 | packages = find: | ||
| 11 | install_requires = | ||
| 12 | websockets ~= 10.0 | ||
| 13 | aiohttp[speedups] ~= 3.8 | ||
| 14 | appdirs ~= 1.4 | ||
| 15 | |||
| 16 | [options.entry_points] | ||
| 17 | console_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 @@ | |||
| 1 | import * as React from "react"; | 1 | import * as React from "react"; |
| 2 | import { Dispatch, SetStateAction, useContext, useMemo } from "react"; | 2 | import { Dispatch, SetStateAction, useContext, useMemo } from "react"; |
| 3 | import { Headers, RequestPayload, ResponsePayload } from "~hooks/useRequests"; | 3 | import { Headers, RequestPayload, ResponsePayload } from "~hooks/useRequests"; |
| 4 | import ReactJson from "react-json-view"; | 4 | import ReactJson from "@microlink/react-json-view"; |
| 5 | import styles from "~/components/Content/Content.module.scss"; | 5 | import styles from "~/components/Content/Content.module.scss"; |
| 6 | import { Button, Col, Container, Row } from "react-bootstrap"; | 6 | import { Button, Col, Container, Row } from "react-bootstrap"; |
| 7 | import { SettingsContext } from "~/contexts/Settings"; | 7 | import { 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"; | |||
| 4 | import classNames from "classnames"; | 4 | import classNames from "classnames"; |
| 5 | import styles from "./Frames.module.scss"; | 5 | import styles from "./Frames.module.scss"; |
| 6 | import dayjs from "dayjs"; | 6 | import dayjs from "dayjs"; |
| 7 | import ReactJson from "react-json-view"; | 7 | import ReactJson from "@microlink/react-json-view"; |
| 8 | import { SettingsContext } from "~/contexts/Settings"; | 8 | import { SettingsContext } from "~/contexts/Settings"; |
| 9 | 9 | ||
| 10 | function isJson(data: any): boolean { | 10 | function 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 @@ | |||
| 1 | import * as React from "react"; | 1 | import * as React from "react"; |
| 2 | import * as ReactDOM from "react-dom"; | 2 | import { createRoot } from "react-dom/client"; |
| 3 | import App from "~/components/App/App"; | 3 | import App from "~/components/App/App"; |
| 4 | 4 | ||
| 5 | import "~/index.scss"; | 5 | import "~/index.scss"; |
| @@ -10,11 +10,10 @@ import localizedFormat from "dayjs/plugin/localizedFormat"; | |||
| 10 | import ConnectionProvider from "~/contexts/Connection"; | 10 | import ConnectionProvider from "~/contexts/Connection"; |
| 11 | dayjs.extend(localizedFormat); | 11 | dayjs.extend(localizedFormat); |
| 12 | 12 | ||
| 13 | ReactDOM.render( | 13 | createRoot(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 | |||
| 21 | from aiohttp import ClientError | 21 | from aiohttp import ClientError |
| 22 | from aiohttp import ClientSession | 22 | from aiohttp import ClientSession |
| 23 | from aiohttp import DummyCookieJar | 23 | from aiohttp import DummyCookieJar |
| 24 | from websockets import WebSocketClientProtocol | 24 | from websockets.asyncio.client import ClientConnection |
| 25 | from websockets.exceptions import ConnectionClosed | 25 | from websockets.exceptions import ConnectionClosed |
| 26 | 26 | ||
| 27 | from ttun import __version__ | 27 | from 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 | self.ws_proxy_origin = f'{"wss" if https e |
