DelphiPackageManager / PackageManagerRFC

Delphi Package Manager RFC
Apache License 2.0
30 stars 0 forks source link

Package Spec/MetaData files - XML or JSON? #11

Open vincentparrett opened 5 years ago

vincentparrett commented 5 years ago

Nuget uses xml NPM uses json. Ruby Gems use - Ruby

My preference is for xml because I

I should also mention, I've actually been using xml in my development of this project, but I'm interested to hear what others think.

landrix commented 5 years ago

+1 for XML - simpler editing than JSON

casteng commented 5 years ago

I'd prefer JSON as it's simpler and less boilerplate. Maven uses XML and is often criticized for this. Also a project file which specifies dependencies for a project may be quite big and obviously should have the same format. But XML will be ok too.

vincentparrett commented 5 years ago

My issue with JSON is the lack of ability to comment things. Comments in the metadata file aren't really needed since it would be generated when the package is produced, but comments in the spec file are a must.

code-kungfu commented 5 years ago

I would recommend XML too, since it's possible to attach more detailed information and/or package install instructions while retaining readability. JSON would be easier to parse, but with package management, it would quickly become very complex compared to XML.

luebbe commented 5 years ago

Generally I like the way PlatformIO handles libraries and their dependencies. They are source only, but I guess we can still draw some inspiration from there: An example config file is here: https://github.com/homieiot/homie-esp8266/blob/develop/library.json

wlandgraf commented 5 years ago

I'd vote for JSON, as the package will have a strict format and "comments" can be checked in documentation. If XML is adopted, it would be good we have some tooling to generate the file.

luebbe commented 5 years ago

There's a good spec of the PlatformIO library.json file

jcangas commented 5 years ago

I totally agree with @wlandgraf. I don't see the case for comments in a spec file: only choose good names for keys and write a good doc for the file format.

vincentparrett commented 5 years ago

I'm not suggesting comments are documentation, but they are useful for package authors, the spec file is in effect source code.

Also as I mentioned in the first post

xml is supported in every delphi version, whereas json support is variable

I'm not totally sold either way yet.

casteng commented 5 years ago

Comments are useful for example to specify why a dependency on some package is needed. Or warn about some possible issues with it.

JBontes commented 5 years ago

Space for comments could easily be built into the json spec. Just have a optional comments field.
I would much prefer json over xml.