JetBrains / web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
Apache License 2.0
279 stars 25 forks source link

How to generate web-types for local library #17

Closed zigzaggin closed 3 years ago

zigzaggin commented 3 years ago

I have an internally developed global component library I would like to generate web-types for. I've built a basic web-types.json file and added a single component to it to test functionality and would like to generate docs for all of the components in our library.

I've attempted to run the extract.sh file, but this appears to try and pull the library off NPM, which will not work with our unpublished library.

Is there a script I can interact with directly to call into my local library?

What assumptions are made about the shape of the library? Can I run this system over a vue-cli generated library? Or should I have this library simply look at the index file for the component library?

Thanks!

zigzaggin commented 3 years ago

Investigated how Quasar approached the generation of the file and am going to replicate that strategy. Disregard issue.

piotrtomiak commented 3 years ago

Hi! Thanks for asking. The extract script is usable only for already published versions to provide web-types for older versions. As far as extracting info from source it depends on type of documentation you're using in the project. If you use JSDoc, you can try https://www.npmjs.com/package/vue-docgen-web-types . I've published it few minutes ago.

zigzaggin commented 3 years ago

Awesome! Hilariously, I also wrote a quick little script using styleguidists docgen-api after spending time reading through this library and what Quasar did. I will compare what you did with mine and see if I've missed anything. Hopefully this conversation helps other devs in the future, because this feature in intellij is an absolute game changer for us. Thanks for the follow up!

piotrtomiak commented 3 years ago

@zigzaggin Amazing :) If I missed something, or if you would have any suggestions on usability, do not hesitate to contribute. The plugin is hosted in this repo under new folder gen.