egon.io icon indicating copy to clipboard operation
egon.io copied to clipboard

Improve tracing of changes in DST files - format DST json in pretty print instead of single line in order to see changes more easily in DIFF

Open sebawagner opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Currently when tracing changes in Domain Stories in DDX files it is very hard to use Git tools in order to visualise the Diff between two DDX files. This is because the - although the file is JSON which is easy to compare - it is formatted as a single line. Editors can't even produce a diff, cause the line is too long.

Describe the solution you'd like If we would just Pretty print the Json (formatting them with pretty print is an option is pretty much all JSON libraries support) it will format the JSON nicely. So you can actually produce a much more meaningful DIFF. However it requires to remove some of the escaping.

Describe alternatives you've considered You can manually post process the files after exporting it from the modeller. But its a manual task

Additional context This should be an easy fix but it will make tracing the changes in DDX files much more easy. And you can truely use versioning tools like Git to discuss changes.

sebawagner avatar May 19 '22 23:05 sebawagner

Sry it won't be that straightforward because of:

  1. Escaping is used without really requiring it everywhere. E.g. attribute names are escaped, rather then attribute values
  2. Mix of JSON and XML into same file

But we could at least pretty print the "dst" part of the domain model. That is actually the essential part.

I don't quite understand why it requires to escape the JSON in that part of the file like it. If we want to support freeform text and are concerned about the formatting of that text we can just escape that part. Not the entire dst section as a single string.

sebawagner avatar May 19 '22 23:05 sebawagner

With the angular port and subsequent renaming of the project to Egon, the default-File type will be changed to .egn and .egn.svg respectively. The new Filte-Type .egn will be human readable / properly formatted, but won't be compatable with versions previous 1.5. For backwards-compatability, we wil provide a .dst download and update the old Verion to 1.5 to be able to read .egn Files

AlexanderZellober avatar Feb 20 '23 10:02 AlexanderZellober

Done in v2.

tdymel avatar Dec 20 '23 13:12 tdymel