ubiquity-os / plugin-template

Template repository for plugins that will run within Ubiquibot.
0 stars 9 forks source link

Update configuration action #29

Open whilefoo opened 14 hours ago

whilefoo commented 14 hours ago

The update-configuration.yml doesn't apply formatting according to the prettier configuration

Also I think it would be better to make this a custom action which would prevent duplication, we can use Typescript instead of writing code in the YML and allow us to change it without having to apply changes to every repo that forks plugin-template.

The only question is how to specify where the schema is located in the code, it could be something like this:

- name: update configuration
  uses: ubiquity-os/update-configuration
  with:
    filepath: './src/types'
    typeboxSchemaName: 'pluginSettingsSchema'

and then we can dynamically import it!

In the future we could also support different schema libraries (zod, joi...)

@0x4007 rfc

gentlementlegen commented 9 hours ago

It used to format with prettier: https://github.com/ubiquity-os/action-deploy-plugin/blob/main/action.yml#L124

Also be careful not to run prettier on the dist otherwise it will segfault.


Edit: I see now that the template does not use the custom action I wrote for that which makes sense now. Should be changed to something like https://github.com/ubiquity-os-marketplace/text-conversation-rewards/blob/development/.github/workflows/update-configuration.yml

0x4007 commented 3 hours ago

Also be careful not to run prettier on the dist otherwise it will segfault.

segfaults aren't really a thing in the world of TypeScript - are you referring to prettier crashing due to memory constraints?

Will importing the custom action close this issue?

gentlementlegen commented 2 hours ago

Node will overflow in memory, which I believe technically is a segfault (triggers a sigsegv), force of habit to use that word. Yes I believe using the custom action should resolve this issue.

whilefoo commented 2 hours ago

Oh I didn't notice that updating manifest is now part of the deploy action.