targets: support comments in target json files
New dependency
- muzzammil.xyz/jsonc This JSONC library is most up-to-date and widely used, also does not bring any extra dependencies.
Cleanup
load() function was completely dropped, since it does not serve its purpose anymore, as its outdated comment hints upon. Target inheritance is handled by resolveInherits() function instead.
Related This PR replaces #2222
@deadprogram can you see what's wrong with CircleCI's "test-all" check?
Obviously this breaks any other tooling that expects "normal" JSON, such as https://github.com/tinygo-org/tinygo/pull/3533 . We might want to write our own formatting tool to keep the targets files consistent.
Good point, so I'd rather switch to YAML for target files, but community wants "JSON with comments" 🤷
Adding comments to JSON obviously breaks compatibility with tools that do not expect comments and this is something was probably overlooked during JSONC discussion.
@soypat @aykevl @deadprogram opinions?
Maybe we can avoid comments for internal use? Sorry, I forget if this change was meant for UX or so we could better document internal target.json files.