chore: scaffold Mudfish VPN decky plugin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
349e44000e
commit
e60873b75a
13 files changed
+187
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
+59
@@ -0,0 +1,59 @@
|
|||||||
|
lib-cov
|
||||||
|
*.seed
|
||||||
|
*.log
|
||||||
|
*.csv
|
||||||
|
*.dat
|
||||||
|
*.out
|
||||||
|
*.pid
|
||||||
|
*.gz
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
pids
|
||||||
|
logs
|
||||||
|
results
|
||||||
|
tmp
|
||||||
|
|
||||||
|
# Coverage reports
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# API keys and secrets
|
||||||
|
.env
|
||||||
|
|
||||||
|
# Dependency directory
|
||||||
|
node_modules
|
||||||
|
bower_components
|
||||||
|
.pnpm-store
|
||||||
|
|
||||||
|
# Editors
|
||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
# OS metadata
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Ignore built ts files
|
||||||
|
dist/
|
||||||
|
|
||||||
|
__pycache__/
|
||||||
|
|
||||||
|
/.yalc
|
||||||
|
yalc.lock
|
||||||
|
|
||||||
|
.vscode/settings.json
|
||||||
|
|
||||||
|
# Ignore output folder
|
||||||
|
|
||||||
|
backend/out
|
||||||
|
|
||||||
|
# Make sure to ignore any instance of the loader's decky_plugin.py
|
||||||
|
decky_plugin.py
|
||||||
|
|
||||||
|
# Ignore decky CLI for building plugins
|
||||||
|
out
|
||||||
|
out/*
|
||||||
|
cli/
|
||||||
|
cli/*
|
||||||
|
cli/decky
|
||||||
|
|
||||||
|
.superpowers/
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "py_modules"))
|
||||||
|
|
||||||
|
import decky # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
|
class Plugin:
|
||||||
|
async def _main(self):
|
||||||
|
decky.logger.info("Mudfish VPN plugin loaded")
|
||||||
|
|
||||||
|
async def _unload(self):
|
||||||
|
decky.logger.info("Mudfish VPN plugin unloaded")
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "mudfish-decky",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Toggle Mudfish Cloud VPN Full VPN mode from Steam Deck Gaming Mode",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "rollup -c",
|
||||||
|
"watch": "rollup -c -w"
|
||||||
|
},
|
||||||
|
"author": "ysj7705",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"devDependencies": {
|
||||||
|
"@decky/rollup": "^1.0.2",
|
||||||
|
"@decky/ui": "^4.11.0",
|
||||||
|
"@types/react": "19.1.1",
|
||||||
|
"@types/react-dom": "19.1.1",
|
||||||
|
"@types/webpack": "^5.28.5",
|
||||||
|
"rollup": "^4.53.3",
|
||||||
|
"typescript": "^5.6.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@decky/api": "^1.1.3",
|
||||||
|
"react-icons": "^5.3.0",
|
||||||
|
"tslib": "^2.7.0"
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"peerDependencyRules": {
|
||||||
|
"ignoreMissing": [
|
||||||
|
"react",
|
||||||
|
"react-dom"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "Mudfish VPN",
|
||||||
|
"author": "ysj7705",
|
||||||
|
"flags": ["root"],
|
||||||
|
"api_version": 1,
|
||||||
|
"publish": {
|
||||||
|
"tags": ["vpn", "mudfish", "root"],
|
||||||
|
"description": "Toggle Mudfish Cloud VPN Full VPN mode from Gaming Mode and pick a Japan node.",
|
||||||
|
"image": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
"""Mudfish Cloud VPN control for the Decky plugin backend."""
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import deckyPlugin from "@decky/rollup";
|
||||||
|
|
||||||
|
export default deckyPlugin({
|
||||||
|
// Add your extra Rollup options here
|
||||||
|
})
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build the frontend and install the plugin on the Steam Deck, then restart Decky.
|
||||||
|
# Needs passwordless sudo for the deck user (development only).
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
DECK="${DECK:-deck@192.168.1.50}"
|
||||||
|
pnpm build
|
||||||
|
tar --exclude='__pycache__' -cf - dist main.py plugin.json package.json py_modules | ssh "$DECK" '
|
||||||
|
D=/home/deck/homebrew/plugins/mudfish-decky
|
||||||
|
sudo rm -rf "$D" && sudo mkdir -p "$D" && sudo tar -xf - -C "$D" &&
|
||||||
|
sudo systemctl restart plugin_loader'
|
||||||
|
echo "deployed to $DECK"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Run the Python unit tests on the Steam Deck (its python3 matches the target runtime closely).
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
DECK="${DECK:-deck@192.168.1.50}"
|
||||||
|
tar -cf - py_modules tests | ssh "$DECK" '
|
||||||
|
rm -rf /tmp/mfd-test && mkdir /tmp/mfd-test && tar -xf - -C /tmp/mfd-test &&
|
||||||
|
cd /tmp/mfd-test && PYTHONPATH=py_modules python3 -m unittest discover -s tests -t . -v'
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { PanelSection, staticClasses } from "@decky/ui";
|
||||||
|
import { definePlugin } from "@decky/api";
|
||||||
|
import { FaFish } from "react-icons/fa";
|
||||||
|
|
||||||
|
export default definePlugin(() => ({
|
||||||
|
name: "Mudfish VPN",
|
||||||
|
titleView: <div className={staticClasses.Title}>Mudfish VPN</div>,
|
||||||
|
content: <PanelSection />,
|
||||||
|
icon: <FaFish />,
|
||||||
|
}));
|
||||||
Whitespace-only changes.
@@ -0,0 +1,12 @@
|
|||||||
|
import unittest
|
||||||
|
|
||||||
|
import mudfish_decky
|
||||||
|
|
||||||
|
|
||||||
|
class SmokeTest(unittest.TestCase):
|
||||||
|
def test_package_imports(self):
|
||||||
|
self.assertTrue(hasattr(mudfish_decky, "__name__"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "dist",
|
||||||
|
"module": "ESNext",
|
||||||
|
"target": "ES2020",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"declaration": false,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noImplicitThis": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"strict": true,
|
||||||
|
"allowSyntheticDefaultImports": true
|
||||||
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
Reference in new issue
Block a user