Open gcusnieux opened 3 years ago
Hi Guillaume!
At this moment, web-types
specification is supporting only vue
framework, however I am currently working on support for other frameworks including web-components
. This also means WebStorm support. Once the specification updates are finished and WebStorm code is updated, I am pretty sure you will be able to convert custom-elements.json
into web-types.json
.
@piotrtomiak Any update on this? Is there any way of providing definitions for web components library so WebStorm could autocomplete it?
@minijus We have just finished major part of the work and in this week's 2021.3 EAP you can create web-types for any frameworks or with no framework at all with CSS properties and classes support. There is a lot of documentation to be made, but you can already provide web-types. See https://github.com/JetBrains/web-types#upcoming-version-20-of-the-standard
I have evaluated the conversation from custom-elements.json
to web-types.json
a little bit, but it seemed to cumbersome.
I have thus forked the web-component-analyzer today and started with the implementation of a transformer for web-types: https://github.com/marcobeierer/web-component-analyzer/tree/master/src/transformers/webtypes
So far the generated web-types.json
works for basic auto completion, but there's still a lot of work to do.
I don't plan to keep the fork, it's just for playing around, maybe the transformer can be merged back into the original repo as soon as it is stable...
@marcobeierer That's really, really cool. I've made an attempt to support custom-elements.json
, but it's really complicated and it looks like it replicates stuff, which is in d.ts
files, doesn't it? So, in the end I think WebStorm will not support custom-elements.json
.
@marcobeierer Thanks for the project init. I took the freedom to continue your work. Web-Types project is absolutely awesome, I needed a generator for Polymer and Lit !
I temporary released it here https://www.npmjs.com/package/web-component-analyzer-webtypes and put it in Pull request https://github.com/runem/web-component-analyzer/pull/239 . I hope it will be merged :)
I started few projects with it:
I know this issue is a little old, but I created this package based on the Custom Elements Manifest to generate web types. You can use it with the CEM Analyzer as a plugin or as a standalone build script. I hope this helps
https://www.npmjs.com/package/custom-element-jet-brains-integration
@break-stuff Thanks!
Hello,
I'm working on a lit-element based web-components library and I would like projects that use it to be able to have autocompletion. I'm use this project web-component-analyzer to extract the documentation of the components. Do you think it's possible to generate a web-types.json from a custom-elements.json?
Thx, Guillaume