admin管理员组文章数量:1429996
I have a very large project with numerous bower dependencies. In many cases it is unclear whether these dependencies are even still in use within the application or if the version specified was chosen for a reason. Ideally, I would like to be able to put a ment for each dependency to state for which part of the application it is required, so as functionality in the application is removed, we can also remove unnecessary packages from the bower_ponents. Something like:
// videojs plug-in for adding navigable waveforms; used by the video ponent
"videojs-wavesurfer": "^1.2.2"
Unfortunately, json doesn't support menting, but are there any possible solutions for annotating or better organizing a bower.json file to make it more understandable?
I have a very large project with numerous bower dependencies. In many cases it is unclear whether these dependencies are even still in use within the application or if the version specified was chosen for a reason. Ideally, I would like to be able to put a ment for each dependency to state for which part of the application it is required, so as functionality in the application is removed, we can also remove unnecessary packages from the bower_ponents. Something like:
// videojs plug-in for adding navigable waveforms; used by the video ponent
"videojs-wavesurfer": "^1.2.2"
Unfortunately, json doesn't support menting, but are there any possible solutions for annotating or better organizing a bower.json file to make it more understandable?
Share Improve this question asked Aug 10, 2016 at 15:41 alisonmsmithalisonmsmith 1175 bronze badges 9- 2 1) bower is a dead project. It has not been updated in months. 2) you cannot put ments in a json file. 3) Consider starting to use NPM. – Naftali Commented Aug 10, 2016 at 15:43
- 4 In addition to what @Neal said, if you want to document your dependencies, you could always add a section to your README file that does just that. – TW80000 Commented Aug 10, 2016 at 15:44
- 1 @Neal Completely wrong. I don't use bower but it has been updated recently. – VtoCorleone Commented Aug 10, 2016 at 15:45
- Ha! I was just about to say that @TW80000 – Naftali Commented Aug 10, 2016 at 15:45
- @VtoCorleone it has mainly been README changes... – Naftali Commented Aug 10, 2016 at 15:45
2 Answers
Reset to default 4You cannot put ments in a JSON file. JSON is for data and nothing else.
If you would like to document your dependencies, consider adding a section to your README file that contains all of the information relevant to dependencies.
The classic approach to menting JSON files is to add fake entries, which hopefully will be ignored by the consumer, such as:
"video-wavesurfer-ment":
"videojs plug-in for adding navigable waveforms; used by the video ponent"
For longer ments, use arrays:
"video-wavesurfer-ment": [
"videojs plug-in for adding navigable waveforms; used by the video ponent",
"Remove this for the non-video version."
]
Of course, you'll have to put these somewhere where someone won't try to parse them. For instance, they could not go WITHIN "dependencies":
.
本文标签: javascriptIs there any way to comment in or better organize a bowerjson fileStack Overflow
版权声明:本文标题:javascript - Is there any way to comment in or better organize a bower.json file? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745541452a2662513.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论