Skip to content

Releases: j-brooke/FracturedJson

CLI v1.0.1

Choose a tag to compare

@j-brooke j-brooke released this 21 Feb 21:33

Set InvariantGlobalization=true. This should allow running even on OS builds without globalization support.

fracjson CLI v1.0.0

Choose a tag to compare

@j-brooke j-brooke released this 29 Jan 02:16

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

Choose a tag to compare

@j-brooke j-brooke released this 23 Dec 19:37

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 once MaxTotalLineLength was introduced a few versions ago.
  • Default changed: MaxCompactArrayComplexity - now defaults to 2 instead of 1.
  • Default changed: NumberListAlignment - now defaults to Decimal instead of Normalize. There are many cases where changing numbers' representations can alter how software treats them. Decimal always preserves exactly how numbers were written in their source documents, so it's a safer default.
  • Default changed: TableCommaPlacement - now defaults to BeforePaddingExceptNumbers instead of AfterPadding. It looks nicer when NumberListAlignment=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

Choose a tag to compare

@j-brooke j-brooke released this 04 Jun 13:34

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

Choose a tag to compare

@j-brooke j-brooke released this 31 Mar 15:56

Features

Replaced setting DontJustifyNumbers with a new enum, NumberListAlignment, to control how arrays or table columns of numbers are handled.

  • Normalize is the default and it behaves like previous versions when DontJustifyNumbers==false. With it, number lists or columns are rewritten with the same number of digits after the decimal place.
  • Decimal lines 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 like Normalize, except with spaces padding out the extra decimal places instead of zeros.
  • Left lines up the values on the left, preserving the exactly values from the input document.
  • Right lines 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

Choose a tag to compare

@j-brooke j-brooke released this 07 Oct 13:33

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 the EastAsianWideCharactersTests test class for an example.)

Version 2.0.0

Choose a tag to compare

@j-brooke j-brooke released this 11 Jul 19:40

New features including tabular formatting. See CHANGELOG.md for details.

v1.0.1 FracturedJson .NET Library

Choose a tag to compare

@j-brooke j-brooke released this 19 Oct 21:49
  • Fixed an off-by-one error with the MaxCompactArrayComplexity property.

V1.0.0 FracturedJson .NET library

Choose a tag to compare

@j-brooke j-brooke released this 18 Oct 00:46

Initial release