runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
504 stars 64 forks source link

Introduce 'debug' CLI output format #84

Closed MatthieuLebigre closed 5 years ago

MatthieuLebigre commented 5 years ago

Hi ! Thanks for your tool, it's really appreciated ! I've seen a regression in version 0.1.12 : cssprop are no longer generated in json output. It's working in markdown output thought. It was working in 0.1.11.

Thanks

runem commented 5 years ago

Hi, thank you so much for opening an issue!

First of all, I will have to see an example/repro where it doesn't pick up your cssprops, because the following example works for me:

/**
 * @cssprop --this-is-a-css-prop - Here is a comment
 */
 class MyElement extends HTMLElement { 
 }

 customElements.define("my-element", MyElement);

I'm really sorry if there has been a regression! I'll make sure to fix it as soon as possible when I can reproduce it :tada:

MatthieuLebigre commented 5 years ago

Thanks for the quick answer !

But there is something I don't understand.

I try your exact same code in my project, and it doesn't work. Here's the output:

{
  "version": 2,
  "tags": [
    {
      "name": "my-element",
      "jsDoc": "/**\r\n * @cssprop --this-is-a-css-prop - Here is a comment\r\n */",
      "attributes": [],
      "properties": [],
      "events": [],
      "slots": []
    }
  ]
}

If I switch to the markdown output, it works fine ... Any clue ?

runem commented 5 years ago

Oh! Right now the JSON format is in the experimental state. Up until now I just converted the internal data structure to JSON and this was why the format contained all possible information. The JSON format is still being developed and will eventual have breaking changes. I also think it will get "cssprops" in the future, but not right now.

Would it work for you if I introduced a "debug" format that outputs the same format as you were used to? I'm not sure if I can promise this format not to have breaking changes in the future, but you would always be able to get all possible information from your elements, including cssprops :-)

MatthieuLebigre commented 5 years ago

Ok, the debug format would be great. I don't mind having breaking changes, I can handle them as they come. That's what I did for the last version, but I can't loose the cssprops :)

runem commented 5 years ago

The debug format is now available in version 0.1.16 of the CLI. I haven't documented it because it's not considered a stable output format :+1: