bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.57k stars 499 forks source link

[Request]provide clean boilerplate to start v3 module development #2838

Closed dewiweb closed 5 months ago

dewiweb commented 5 months ago

Is this a feature relevant to companion itself, and not a module?

Is there an existing issue for this?

Describe the feature

There are many differences between existing boilerplate and generic modules. Some of them use "require" others "import", some of them use "index.js" others "main.js" as entry point. So it's not really clear for beginners. For example "config.js" file is used to declare config fields in generic-tcpudp module but this file doesn't exist in the "template-js" structure (conf fields are declared in the "main.js" file) ...

Usecases

. Use boilerplate as starting module development point . Same folder/structure from boilerplate to generic modules . Clearest module dev for beginners . copy features from generic modules to in dev module

dnmeid commented 5 months ago

We have https://github.com/bitfocus/companion-module-template-js for common Javascript and https://github.com/bitfocus/companion-module-template-ts for typescript.

Naturally there are many modules in the wild using different variations. It depends heavily on the developer and on the needs of the module if you e.g. want to externalise some functions to different files or keep it all together. So the template shows both possibilities.