refactor: convert to bun workspaces monorepo
- Move web app into apps/web/ - Create packages/shared/ with shared types - Create plugins/decky-vault/ scaffold - Root package.json manages workspaces only
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "@deckyvault/plugin",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w"
|
||||
},
|
||||
"dependencies": {
|
||||
"@deckyvault/shared": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^28",
|
||||
"@rollup/plugin-typescript": "^12",
|
||||
"rollup": "^4",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "DeckyVault",
|
||||
"version": "0.1.0",
|
||||
"description": "Automatically record performance metrics and export/upload to DeckyVault",
|
||||
"author": "DeckyVault",
|
||||
"license": "MIT",
|
||||
"icon": "",
|
||||
"permissions": ["system"]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import typescript from "@rollup/plugin-typescript"
|
||||
import commonjs from "@rollup/plugin-commonjs"
|
||||
|
||||
export default {
|
||||
input: "src/index.tsx",
|
||||
output: {
|
||||
file: "dist/index.js",
|
||||
format: "esm",
|
||||
sourcemap: false,
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
commonjs(),
|
||||
],
|
||||
external: [
|
||||
"react",
|
||||
"react-dom",
|
||||
"@deckyvault/shared",
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { DeckyVaultImportV1 } from "@deckyvault/shared"
|
||||
|
||||
interface PluginSettings {
|
||||
apiKey: string
|
||||
autoRecord: boolean
|
||||
exportPath: string
|
||||
}
|
||||
|
||||
let settings: PluginSettings = {
|
||||
apiKey: "",
|
||||
autoRecord: false,
|
||||
exportPath: "/home/deck/Downloads",
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "DeckyVault",
|
||||
content: () => {
|
||||
// Main plugin UI — will be implemented in a future phase
|
||||
return <div>DeckyVault Plugin</div>
|
||||
},
|
||||
onSettingUpdate: (newSettings: Partial<PluginSettings>) => {
|
||||
settings = { ...settings, ...newSettings }
|
||||
},
|
||||
onGameSessionStart: (appId: number) => {
|
||||
DeckyPlugin.log(`[DeckyVault] Game started: ${appId}`)
|
||||
// Future: start MangoHud monitoring
|
||||
},
|
||||
onGameSessionEnd: (appId: number) => {
|
||||
DeckyPlugin.log(`[DeckyVault] Game stopped: ${appId}`)
|
||||
// Future: stop monitoring, prompt export/upload
|
||||
},
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// Decky Loader API type declarations
|
||||
// These mirror the APIs available in the Steam Deck game mode CEF context
|
||||
|
||||
declare global {
|
||||
const DeckyPlugin: {
|
||||
log: (...args: unknown[]) => void
|
||||
debug: (...args: unknown[]) => void
|
||||
info: (...args: unknown[]) => void
|
||||
error: (...args: unknown[]) => void
|
||||
}
|
||||
|
||||
const SteamClient: {
|
||||
Apps: {
|
||||
GetAppData: (appId: number) => Promise<{
|
||||
strAppName: string
|
||||
strShortcutName: string
|
||||
strExePath: string
|
||||
}>
|
||||
RegisterForGameStarted: (
|
||||
callback: (appId: number) => void,
|
||||
) => { unregister: () => void }
|
||||
RegisterForGameStopped: (
|
||||
callback: (appId: number) => void,
|
||||
) => { unregister: () => void }
|
||||
}
|
||||
System: {
|
||||
GetOSVersion: () => Promise<string>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": false,
|
||||
"sourceMap": false,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [
|
||||
{ "path": "../../packages/shared" }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user