Releases: j-brooke/FracturedJson
Release list
CLI v1.0.1
Set InvariantGlobalization=true. This should allow running even on OS builds without globalization support.
fracjson CLI v1.0.0
The new CLI. It's written in C#, but published here as self-contained executables. You can run these natively - you don't need to install .NET. (If you do have .NET installed, you can use the .NET global tool version instead, if you prefer.). See the fracjson CLI wiki page for more info.
v5.0.0
Features
Properties of expanded objects (ones that aren't inlined or table-formatted) are now aligned so that their values begin in the same column. This makes for a more consistent look between table-formatted and expanded objects. The new setting MaxPropNamePadding controls how much space FracturedJson is allowed to add, since it looks bad and wastes space if some property names are much longer than others. (Set to -1 to disable this feature. Use ColonBeforePropNamePadding to put colons next to the property names instead of in a line of their own.)
Example:
{
"ModuleId" : "armor",
"Name" : "",
"FreeformLocations": [
[11, 2], [11, 3], [11, 4], [11, 5], [11, 6], [11, 7], [11, 8], [11, 9],
[11, 10], [11, 11], [11, 12], [11, 13], [11, 14], [ 1, 14], [ 1, 13], [ 1, 12],
[ 1, 11], [ 1, 10], [ 1, 9], [ 1, 8], [ 1, 7], [ 1, 6], [ 1, 5], [ 1, 4],
[ 1, 3], [ 1, 2], [ 4, 2], [ 5, 2], [ 6, 2], [ 7, 2], [ 8, 2], [ 8, 3],
[ 7, 3], [ 6, 3], [ 5, 3], [ 4, 3], [ 0, 4], [ 0, 5], [ 0, 6], [ 0, 7],
[ 0, 8], [12, 8], [12, 7], [12, 6], [12, 5], [12, 4]
],
"Orientation" : "Fore",
"Seed" : 272691529
}Settings changes
- New:
MaxPropNamePadding- limits expanded property alignment when property names differ greatly in length. (Doesn't apply to table formatting.) - New:
ColonBeforePropNamePadding- controls where property name padding goes relative to the colon. - Removed:
OmitTrailingWhitespace- Trailing whitespace is always removed now. - Removed:
MaxInlineLength- Stopped being useful onceMaxTotalLineLengthwas introduced a few versions ago. - Default changed:
MaxCompactArrayComplexity- now defaults to2instead of1. - Default changed:
NumberListAlignment- now defaults toDecimalinstead ofNormalize. There are many cases where changing numbers' representations can alter how software treats them.Decimalalways preserves exactly how numbers were written in their source documents, so it's a safer default. - Default changed:
TableCommaPlacement- now defaults toBeforePaddingExceptNumbersinstead ofAfterPadding. It looks nicer whenNumberListAlignment=Decimal.
Commandline App
Added the ability to read options from a config file. Use --config to name a specific file. Otherwise,
FracturedJsonCli looks for a default file named .fracturedjson.jsonc, .fracturedjson.json, or .fracturedjson,
walking up the directory hierarchy until one is found. It starts from the current directory if input is given
by STDIN, or the input file's directory if --file is used. Use --no-conifg if you don't want to use a default
file. Commandline switches override the file's values.
You can use Example-Config-File.jsonc as a template, if you want, and just uncomment the settings you care about.
Comments and trailing commas are allowed.
v4.1.0
4.1.0
Features
Added a new option for where commas are placed with table formatting. The old (and still default) behavior puts commas after the column padding. This causes all the commas for a column to line up, which sometimes looks silly, especially when it's just a single column of strings being formatted as a table.
Now you can set TableCommaPlacement to TableCommaPlacement.BeforePadding to make the commas cling tightly to the values to their left. Or, if you prefer, you can use TableCommaPlacement.BeforePaddingExceptNumbers to leave your number columns unaffected. (That option is only meaningful when NumberListAlignment is Left or Decimal.)
Also added was a new factory method, FracturedJsonOptions.Recommended() which, unlike the FracturedJsonOptions constructor, will always point to the new best defaults without regard for backward compatibility.
Added
- New setting
FracturedJsonOptions.TableCommaPlacement. - New method
FracturedJsonOptions.Recommended().
Build Environment
Updated the CLI and Tests projects to target .NET 8. The FracturedJson library itself is still .NET Standard 2.0 compliant.
4.0.0
Features
Replaced setting DontJustifyNumbers with a new enum, NumberListAlignment, to control how arrays or table columns of numbers are handled.
Normalizeis the default and it behaves like previous versions whenDontJustifyNumbers==false. With it, number lists or columns are rewritten with the same number of digits after the decimal place.Decimallines the numbers up according to their decimal points, preserving the number exactly as it appeared in the input document. For regular numbers this usually looks likeNormalize, except with spaces padding out the extra decimal places instead of zeros.Leftlines up the values on the left, preserving the exactly values from the input document.Rightlines up the values on the right, preserving the exactly values from the input document.
Added
New setting, NumberListAlignment.
Removed
Removed setting DontJustifyNumbers.
Version 3.0.0
3.0.0
Features
- Support for comments (sometimes called JSON-with-comments or .jsonc). Where possible, comments stay stuck to the elements that they're closest to in the input.
- Deep table formatting. In version 2, only the immediate children of table rows were lined up. Now, if space permits and the types are consistent, all descendents are aligned as table columns.
- New length limit option:
MaxTotalLineLength. - Option to preserve blank lines.
- Option to allow trailing commas.
Added
- New settings:
MaxTotalLineLength,MaxTableRowComplexity,MinCompactArrayRowItems,CommentPolicy,PreserveBlankLines,AllowTrailingCommas.
Removed
- Removed settings:
TableObjectMinimumSimilarity,TableArrayMinimumSimilarity,AlignExpandedPropertyNames,JsonSerializerOptions. - Support for East Asian Full-width characters is no longer built-in. I did this to eliminate coupling with any specific library. You can easily recreate the functionality by providing your own
StringLengthFunc. (See theEastAsianWideCharactersTeststest class for an example.)
Version 2.0.0
New features including tabular formatting. See CHANGELOG.md for details.
v1.0.1 FracturedJson .NET Library
- Fixed an off-by-one error with the MaxCompactArrayComplexity property.
V1.0.0 FracturedJson .NET library
Initial release