Skip to content

Releases: jucardi/infuse

v1.0.13

02 Mar 23:58

Choose a tag to compare

Release Notes

This release focuses on documentation accuracy, dependency/security refresh, and significantly improved test coverage.

Highlights

  • README fully refreshed
    • Updated CLI usage/flags to match current behavior.
    • Added missing flags (--listHelpers, --ignoreErrors).
    • Documented file/directory usage and output behavior for directories.
    • Added complete helper inventory from code (common + Go-template specific).
    • Expanded helper examples, including advanced examples for: mapGet, mapSet, parse, invoke, indent.
  • Go/toolchain and dependency updates
    • Module Go version updated from 1.17 -> 1.25.
    • Dependency upgrades include:
      • github.com/sirupsen/logrus v1.8.1 -> v1.9.4
      • github.com/spf13/cobra v1.3.0 -> v1.10.2
      • github.com/spf13/pflag v1.0.5 -> v1.0.10
      • golang.org/x/sys -> v0.41.0
      • plus related indirect updates.
    • go mod tidy and go mod vendor applied.
    • govulncheck run with result: No vulnerabilities found.
  • Major test coverage improvement
    • Added comprehensive test suites across CLI/parser, templates, helpers, and utility packages.
    • Coverage improved from near-zero baseline to 90%.

Upgrade Notes

  • Go 1.25 is now required by go.mod.
  • Vendored dependencies were refreshed; expect large vendor/ diff in this release.

v1.0.12

15 Feb 08:17

Choose a tag to compare

v1.0.12

New Helpers:

  • includeAsString: Similar to include, allows to register a template, but reads the template contents from a string instead of a file. E.g: {{ includeAsString “templateName” .var_with_contents }}
  • invoke: Similar to {{ template [name] [data] }}, invokes a template by a given name with a data object. The difference with template is that 'invoke can be used with a string variable as the name instead of a hardcoded string.
  • parse: Attempts to parse the provided template contents using the provided data object and returns the parsed value. Usage {{ parse [obj] [template contents] }}.
  • parseXpath: Attempts to parse a value inside a data object as a template and returns the parsed value using the same entry object to parse the template. Usage {{ parse [obj] [xpath to value with template] }}
  • in: Indicates whether a value is contained in an array. Usage: {{ in [array] [value] }}

Minor Fixes:

  • The helper yaml now properly allows an optional argument to indicate the indentation of the resulting YAML. Usage {{ yaml [obj] [int] }} where the int number indicates the amount of spaces for indentation.
  • Map functions now allow XPATH to be provided with or without a . as a prefix

v1.0.11

15 Nov 04:17

Choose a tag to compare

  • Minor fix to the 'set' helper so it allows map[interface{}]interface{} as well as map[string]interface{}.
  • Added support for arm64 targets for all supported OS (Windows, MacOS, Linux)
  • Added stringsSub helper to obtain the substring of a string
  • Added new map helpers to allow XPATH notation to be used to get or set values

v1.0.10

30 Jun 00:01

Choose a tag to compare

v1.0.10

Added new helpers:

  • stringsCompare - Returns an integer comparing two strings lexicographically. See strings.Compare
  • stringsContains - Returns a boolean indicating whether the string s begins with prefix. See strings.Contains

v1.0.9

22 Jun 02:47

Choose a tag to compare

  • Fixed an issue where 'include' would not work with absolute paths

v1.0.8

21 Apr 15:06

Choose a tag to compare

New features:

  • Implemented support for directory templates. Now a directory can be specified as the source, and another directory as the destination. All files within the source directory will be treated as template files and will be parsed with the source data using the same filenames as the target. This is done recursively, so subdirectories can also be used. See https://github.com/jucardi/ms-sample for an example on directory templates.

Compatibility Updates

  • Initialized Go Modules
  • Added vendor directory for dependencies

New String conversion handlers

16 Oct 23:36

Choose a tag to compare

  • Introduced new handlers for String conversion:

    • stringxCamelToDash > Converts a camelCase string to a dash-separated string
    • stringxCamelToSnake > Converts a camelCase string to a snake_case string
    • stringxDashToCamel > Converts a dash-separated string to a camelCase string
    • stringxDashToPascal > Converts a dash-separated string to a PascalCase string
    • stringxPascalToDash > Converts a PascalCase string to a dash-separated string
    • stringxPascalToSnake > Converts a PascalCase string to a snake_case string
    • stringxSnakeToCamel > Converts a SnakeToCamel string to a camelCase string
    • stringxSnakeToPascal > Converts a SnakeToCamel string to a PascalCase string
  • Changed the behavior of title, it now properly converts a provided string to a title case, capitalizing the first letter of every word in a text, and ensuring the rest of the characters in the word are lowercase

  • Added short alias lower for lowercase

  • Added short alias upper for uppercase

stringsJoin now allows any type of array

29 May 23:49

Choose a tag to compare

Replaced the stringsJoin handler to be a custom function that will allow an array instead of only []string, and will attempt to convert all members to string, so the resulting string array will be passed to strings.Join

New helpers added

04 Feb 23:38

Choose a tag to compare

  • indent: Indents a given string using the provided indentation. Eg: {{ indent "somestring with line breaks" " " }}
  • loadJson: Unmarshals a JSON string into a map[string]interface{}. Eg: {{ $obj := loadJson "{\"someKey\": 1234}" }}
  • mathAdd: Adds all the provided numbers together and returns the result
  • mathMult: Multiplies all the provided numbers together and returns the result

Added `iterate` helper

14 Nov 20:02

Choose a tag to compare

Added iterate helper for Go Templates since there is no for loop.

Usage:

{{ range $val := iterate N }}

Where N is the length of the iteration