FritzAndFriends/StreamDeckToolkit

Add manifest.json content as part of ConfigurationBuilder

TylerLeonhardt opened this issue · 2 comments

Is your feature request related to a problem? Please describe.

I want to be able to dynamically register actions based on the Actions that are present in the manifest.json.

It would be nice to already have an manifest object available at startup to interact with.

Describe the solution you'd like

The ConfigurationBuilder has a LoggerFactory today. It would be nice to expose the manifest.json as a part of the ConfigurationBuilder.

or

Let it be its own entity like ManifestParser or something like that that can supply you with a parsed Manifest object on start up.

I'd love to be able to do:

foreach( Action action in Manifest.Actions)
{
    cm.RegisterAction(new MyAction(action.uuid);
}

Additional context

My goal is to use StreamDeckToolkit to create a totally self contained PowerShell script runner. You will be able to do:

New-StreamDeckAction -X 3 -Y 4 -Icon foo.png -ScriptBlock {
   Write-Host "hello world"
}

and then once you restart StreamDeck.exe, it will show up.

To do this, I'd like to still only have 1 instance of the StreamDeckToolkit running so I need to be able to dynamically make Actions.

Not sure this is the best approach, as the manifest is never used by our code and is an artifact used by the StreamDeck application.

Are you just looking for bootstrapping all of the actions?

Yeah I mainly want this feature as an easy way to get the Actions field so I can dynamically register Action objects based on the Actions in the manifest.json.

new PowerShellAction(uuid: action.UUID)

The only reason I suggested the whole manifest.json in this issue is that it's probably not too much additional work than just getting the Actions

This would also mean a User's plugin could have access to the entire Stream Deck metadata of their plugin and Actions which seemed like something people may want, potentially.