custom-elements-manifest icon indicating copy to clipboard operation
custom-elements-manifest copied to clipboard

cem-plugin-template: 'SourceFile' becomes 'JsDocUnknownType' in analyzer >= 0.5.6

Open au-z opened this issue 2 years ago • 0 comments

Hi, I am working on a new cem-plugin using a fork of the cem-plugin-template provided here (thanks for this template btw!)

I noticed some odd behavior between versions 0.5.5 and 0.5.6 of the analyzer plugin. I'm hoping you can offer some clarification on the differences between these versions and what I can do to test my plugin against the latest version of the analyzer.

The behavior is observed with the unchanged plugin template files.

  1. I install "@custom-elements-manifest/analyzer": "0.5.5", and run the analyzer on my file using the start script. analyzePhase prints 305 SourceFile for the root node of the source and continues to each of the node's children. My plugin works as expected with this version and produces the "correct" custom-elements.json.

  2. I bump the package version to "@custom-elements-manifest/analyzer": "0.5.6",, install, and re-run the analyzer on my file. analyzePhase prints 305 JSDocUnknownType for the root node and fails to continue to any children. The subsequent custom-elements.json file contains no declarations nor exports.

Isn't the analyzePhase function supposed to iterate over each node in the AST? Is there a change I should make to the template to make the plugin behave in this way?

Thanks for any help you can provide!

au-z avatar Jul 21 '22 04:07 au-z