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

Question about other librairies support #25

Open
gcusnieux opened this issue Dec 2, 2020 · 8 comments
Open

Question about other librairies support #25

gcusnieux opened this issue Dec 2, 2020 · 8 comments

Comments

@gcusnieux
Copy link

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

@piotrtomiak
Copy link
Collaborator

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.

@minijus
Copy link

minijus commented Oct 29, 2021

@piotrtomiak Any update on this? Is there any way of providing definitions for web components library so WebStorm could autocomplete it?

@piotrtomiak
Copy link
Collaborator

@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

@marcobeierer
Copy link

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...

@piotrtomiak
Copy link
Collaborator

@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.

@jpradelle
Copy link

@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 runem/web-component-analyzer#239 . I hope it will be merged :)

I started few projects with it:

@break-stuff
Copy link

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

@piotrtomiak
Copy link
Collaborator

@break-stuff Thanks!

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

6 participants