htmx
htmx copied to clipboard
Automatically generate Web Types for the package based on current documentation
Description
This change adds a build step, which will regenerate web-types based on existing documentation. Special support for htmx-on: has been added as well.
Checklist
- [x] I have read the contribution guidelines
- [x] I have targeted this PR against the correct branch (
masterfor website changes,devfor source changes) - [ ] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
- [x] I ran the test suite locally (
npm run test) and verified that it succeeded
It would be great if you can provide an SVG 32x32 with the HTMX icon. I could then set the icon for all of HTMX attributes, css classes and events.
Heya @piotrtomiak thank you very much for this contribution. I am not really qualified to review it, but I will ask if anyone on the core team feels like they can. If not, I will pluck up the courage to look at it. :)
There is a (dark mode) svg icon for htmx here:
https://bestofjs.org/logos/htmx.dark.svg
@1cg - thanks! The code doesn't touch any of the HTMX code, it just adds a build script to generate the web-types file based on the available documentation, so I guess it's a new stuff for anyone reviewing ;) I'll update the PR with the icon soon.
@1cg - I've added default icon, so all of the HTMX symbol are going to have the HTMX icon:
One thing I am not sure is whether the web-types file should be checked in. Since it's generated, it would be natural to not check it in, but on the other hand, if something goes wrong with generation, you wouldn't notice that. So I think it's better to check it in.
@1cg - any chance you could review this?
Hi @piotrtomiak sorry for such a long delay on this. I am going to merge it. Can I ask that you be available for any maintenance issues on it, because I don't know how web types work at all. Is it possible to add a canary test that will alert us if something has gone wrong?
This functionality looks fantastic, by the way.
@1cg - thanks for merging that! There are two kinds of problems, which may arise:
- The build fails, which is pretty easy to spot ;)
- Something goes wrong with the generated contents.
The second one is slightly harder to notice, but since the file is being checked in into the repo, you can verify that the updates are OK. This would mainly arise if you drastically change how you structure your documentation files.
In any case I am available for help.
Oh, and it would be good to regenerate the file each time you change documentation, just to have the current version checked in into the repo.