Open SavoInfostream opened 11 months ago
Ah, interesting. I didn't realize this is part of the web-types.json
spec. I think that should be possible. We would likely need to add a config to specify the output path since that info isn't in the CEM.
Isn't that the same path on 3rd line?
{
"kind": "javascript-module",
"path": "webComponents/flagInput.ts",
"declarations": [
{
"kind": "class",
"description": "",
"name": "FlagInputComponent",
"members": [
{
"kind": "field",
"name": "prop",
"type": {
"text": "string"
},
"privacy": "private",
"description": "What property binds to this input.",
"attribute": "prop"
},
{
"kind": "field",
"name": "text",
"type": {
"text": "string"
},
"privacy": "private",
"attribute": "text"
},
{
"kind": "field",
"name": "shortcut",
"type": {
"text": "[string, boolean]"
},
"privacy": "private",
"attribute": "shortcut"
},
{
"kind": "field",
"name": "savo",
"type": {
"text": "(a: InputChangeEvent) => any"
},
"privacy": "public",
"attribute": "savo"
},
{
"kind": "method",
"name": "render",
"privacy": "private"
}
],
"events": [
{
"type": {
"text": "InputChangeEvent"
},
"description": "some description for typed-event",
"name": "savo"
}
],
"attributes": [
{
"name": "prop",
"type": {
"text": "string"
},
"description": "What property binds to this input.",
"fieldName": "prop"
},
{
"name": "text",
"type": {
"text": "string"
},
"fieldName": "text"
},
{
"name": "shortcut",
"type": {
"text": "[string, boolean]"
},
"fieldName": "shortcut"
},
{
"name": "savo",
"type": {
"text": "(a: InputChangeEvent) => any"
},
"fieldName": "savo"
}
],
"superclass": {
"name": "HTMLElement"
},
"tagName": "flag-input",
"customElement": true
}
],
"exports": [
{
"kind": "custom-element-definition",
"name": "flag-input",
"declaration": {
"name": "FlagInputComponent",
"module": "webComponents/flagInput.ts"
}
}
]
}
Not usually. The CEM captures the source of the component, but that's not typically included in deployed package.
Hmm, this UI library does deploy the source: Adobe Spectrum.
It seems to be essential to deploy it like this for component libraries.
They are actually updating the value in the CEM before they deploy.
https://github.com/adobe/spectrum-web-components/blob/main/custom-elements-manifest.config.js#L33
Well, yeah but you get the navigation to .dts which is the same as for any other symbol in jetbrains. So, any plans for this feature atm?
I'll have to think about how we could implement this and provide a way for teams to ensure it points to the right resource.
I am wondering if it's possible to add support for "source" property for custom-elements, like this:
which would allow to go to declaration class from html. It would be useful, no?