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

Improve configuration, parameters, packaging #16

Open
swarnat opened this issue May 29, 2022 · 1 comment
Open

Improve configuration, parameters, packaging #16

swarnat opened this issue May 29, 2022 · 1 comment

Comments

@swarnat
Copy link

swarnat commented May 29, 2022

Hy,

I just push my first TP Plugin with your SDK: https://github.com/swarnat/TouchPortal_OSC_General
Thanks for your work.

I have some notes, if we can improve this node-api a little bit, because I created functions, which makes it easier to work with the sdk in three points.
When you will agree, I would like to prepare a merge request from this new repository, after the topics are tested in production environments:

  • There should be a base repository a developer can use to start from.

Configuration

  • I added a config.js File, which contain pluginId and updateUrl. This allows me to use the plugin in several places and make index.js independent from pluginId.
  • Basically this index.js is almost a generic one and can be a start point within an example. It simple calls a function from a file for a defined action. So the plugin developer for "simple" plugins can be focus on their topics. Maybe we got something similar for events and states. But about this I need to understand how they are working.

Parameter

  • Because this is my first TouchPortal plugin, maybe it won't work or will got problems I currently not see. But this function should be a part of API. For me it makes it much easier to work with action data.

Packaging
Your Discord Plugin was my preset for this first plugin. But I do not have "7z" as available command. So I removed this external dependency and implemented the zip/tpp creation within nodejs code. I think this is much better to use: https://github.com/swarnat/TouchPortal_OSC_General/blob/main/bin/tp-packaging-win.js

Stefan

@spdermn02
Copy link
Owner

hey - sorry I'm so behind on commenting on this Issue.
I completely agree we need to make improvements to this code. Honestly, I'd written JS before, but Node.JS especially server side Node.JS was kind of a learning experience for me building this sort of thing.

what do you mean by There should be a base repository a developer can use to start from you mean like a "TouchPortal-Example-Plugin" repository? sort of a boilerplate default repo? I concur that could be very useful to use for a "get started" project.

I'll review the Parameters function and see what I can do about bringing it in, or if you want to make a PR feel free.

Just had another user create a PR for using ESLint to fix some of my styling mistakes.

Contributions are always welcome of course.

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