SteamDeckHomebrew / decky-plugin-template

A template for quickly creating a decky plugin from scratch
https://deckbrew.xyz
Other
219 stars 107 forks source link

Add support for the 'decky_plugin' module exposed by decky-loader #16

Closed popsUlfr closed 1 year ago

popsUlfr commented 1 year ago

This is the pull request relating to https://github.com/SteamDeckHomebrew/decky-loader/pull/353

Shows a simple example on how to use the _migration method with the exposed helpers.

For intellisense of the decky_plugin module add the path to decky-loader's plugin/ path to python.analysis.extraPaths in .vscode/settings.json or checkout the decky-loader repo one directory up and generate a .vscode/settings.json from .vscode/defsettings.json.

TrainDoctor commented 1 year ago

@AAGaming00 Please review when you have the chance.

popsUlfr commented 1 year ago

@TrainDoctor I think the pull request in the loader should be validated and merged first since this one depends on it.

AAGaming00 commented 1 year ago

How will we handle keeping this stub up to date? Can it be generated from the source and pulled from an npm task or package or something? Or maybe a pip package?

popsUlfr commented 1 year ago

How will we handle keeping this stub up to date? Can it be generated from the source and pulled from an npm task or package or something? Or maybe a pip package?

The lib is way too simple to go to such lengths at this time. Just update this template with the new stub from time to time whenever more stuff is added. Then it's up to the plugin devs to decide if any new constants/functions are interesting to them and they update to it. If they stay on an old stub it's no issue since the old API is never supposed to break with more recent versions anyway (or maybe with major version changes if really needed in the future). A nice bonus feature is that when plugins commit their decky_plugin.pyi, the version of the stub (__version__) will be available and the CI could do compatibility checks if ever needed in the future.