Migrate bash scripts to package scripts. Update VSCode tasks to use package scripts. Use ssh key instead of password.

This commit is contained in:
Kim T 2025-10-10 21:41:05 -07:00
commit 14dfd8e8c2
9 changed files with 78 additions and 221 deletions

View file

@ -4,7 +4,13 @@
"description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack",
"type": "module",
"scripts": {
"setup": "echo 'If you are using alpine linux, do not expect any support.' && pnpm i && pnpm update @decky/ui --latest && ([ -f ./cli/decky ] || pnpm run setup:cli) && (which docker >/dev/null || echo 'Docker not found, you will need it for backend development.')",
"setup:cli": "mkdir -p cli && case \"$(uname -s)-$(uname -m)\" in 'Linux-x86_64') url=decky-linux-x86_64 ;; 'Darwin-x86_64') url=decky-macOS-x86_64 ;; 'Darwin-arm64') url=decky-macOS-aarch64 ;; *) echo \"Unsupported system: $(uname -s)-$(uname -m)\"; exit 1 ;; esac && curl -L \"https://github.com/SteamDeckHomebrew/cli/releases/latest/download/$url\" -o ./cli/decky && chmod +x ./cli/decky",
"build": "rollup -c",
"build:plugin": "pnpm run build && ./cli/decky plugin build .",
"build:deploy": "pnpm run build:plugin && pnpm run deploy",
"deploy": "dotenv -- pnpm run deploy:run",
"deploy:run": "set -e; PLUGIN_SAFE_NAME=$(echo \"$PLUGIN_NAME\" | tr ' ' '-'); SSH_OPTS=\"-C -p $DECK_PORT -o StrictHostKeyChecking=no -o ConnectTimeout=10\"; [ -n \"$DECK_KEY\" ] && SSH_OPTS=\"$SSH_OPTS $DECK_KEY\"; echo \"📦 Deploying 'out/$PLUGIN_NAME.zip' to $DECK_USER@$DECK_IP:$DECK_DIR/homebrew/plugins/$PLUGIN_SAFE_NAME\"; cat \"out/$PLUGIN_NAME.zip\" | ssh $SSH_OPTS $DECK_USER@$DECK_IP \"set -e; mkdir -p '$DECK_DIR/homebrew/plugins/$PLUGIN_SAFE_NAME'; bsdtar -xpf - -C '$DECK_DIR/homebrew/plugins/$PLUGIN_SAFE_NAME' --strip-components=1\"",
"watch": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@ -27,10 +33,11 @@
"homepage": "https://github.com/SteamDeckHomebrew/decky-plugin-template#readme",
"devDependencies": {
"@decky/rollup": "^1.0.1",
"@decky/ui": "^4.7.2",
"@decky/ui": "^4.10.6",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/webpack": "^5.28.5",
"dotenv-cli": "^7.4.2",
"rollup": "^4.22.5",
"typescript": "^5.6.2"
},