Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
dewiweb opened this issue Apr 16, 2024 · 1 comment
Closed
2 tasks done

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

dewiweb opened this issue Apr 16, 2024 · 1 comment

Comments

@dewiweb
Copy link

dewiweb commented Apr 16, 2024

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

  • I believe this to be a feature for companion, not a module

Is there an existing issue for this?

  • I have searched the existing issues

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

@dewiweb dewiweb changed the title provide cleaner boilerplate to start v3 module development provide clean boilerplate to start v3 module development Apr 16, 2024
@dewiweb dewiweb changed the title provide clean boilerplate to start v3 module development [Request]provide clean boilerplate to start v3 module development Apr 16, 2024
@dnmeid
Copy link
Member

dnmeid commented Apr 16, 2024

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.

@dnmeid dnmeid closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants