Analyze producing (almost) empty JSON file
Using polymer-cli 1.7.1 with a Polymer 2.0 component
When running polymer analyze > analysis.json, the following output is generated:
{
"schema_version": "1.0.0"
}
Whereas before, the full json file would be created. When explicitly stating which file to analyze (polymer analyze my-component.html > analysis.json) the output is as expected. Not sure if this is to do with the Polymer 3 release expecting there to be a JS file or not? Not a big problem either as you can explicitly say which file to analyze.
The root cause, if specifying source files works for you, is that v1.7 of the CLI's analyze and lint commands will try to infer the source files of your project from fields in polymer.json like sources, entrypoint, shell, fragments, etc.
Then should this documentation https://www.polymer-project.org/3.0/docs/tools/documentation and https://www.polymer-project.org/2.0/docs/tools/documentation be updated?
I just tried the polymer-modulizer in a set of elements...
But with the empty analysis.json after run the: polymer analyze > analysis.json
I can't see the docs from the iron-component-page.
I had a similar issue on an upgraded project using polymer-modulizer. Following comand solved my problem:
polymer analyze -i ./paper-chip.js ./paper-chip-input.js > analysis.json
I recently ran into the same or similar issue when I tried to run polymer analyze for files in a directory where any parent directory is named bower_components or any parent directory ends in -test.
I specifically wanted to generate analysis for components inside a one instance of bower_components so I was able to workaround the issue just by configuring bower to use a different directory name via
--config.directory='alternate_dir' parameter (or you could just copy/move one of the installed bower modules out of bower_components and then run the analysis there).
At first my "project directory" was named something like "analysis-test" or similar and that didn't work either so I had to also remove "-test" from that parent directory name.
This was tested with polymer-cli 1.8.0. I did not run into this empty analysis issue outside of this directory name issue though. It is generating a fine analysis for me in a Polymer 2 component repository without having to specify input files.
I thought I was going crazy ... thanks a lot @Haprog !
I can confirm that polymer analyze will fail (only producing schema-version) if files to analyze are within a bower_component directory. I did not check the -test stuff.
I also have to specify an input file via --input.
Analyzing Polymer 2.0 components with freshly installed polymer-cli (1.8.0).
Running on Linux, node v8.11.4.
The problem still persists in 1.9.4 and the docs dont mention that ne filename need to be passed to analyze. Isse not fixed as 1.9.4
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this repo is still maintained, please don't close this issue. The issue is clear. I could take a stab at a PR if someone can help me figure out what part of code is responsible for this filename filtering.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I encountered a problem with polymer analyze *.html > analysis.json, where the output in analysis.json was just { "schema_version": "1.0.0" }.
The issue seemed to be related to the parent directory name being bower_components. For example, my components were located in a directory like D:/bower_components/iron-icon/*. After renaming this directory to something else, like alternate-dir, the problem was resolved.
D:/bower_components/iron-icon/*. When running bower update -y, it automatically generated subdirectories named bower_components under each component (e.g., D:/bower_components/iron-icon/bower_components/*). This seems to cause complications during the analysis process, possibly due to the naming conflict.