Releases: jucardi/infuse
v1.0.13
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
v1.0.12
New Helpers:
includeAsString: Similar toinclude, 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 withtemplateis that 'invokecan 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
yamlnow properly allows an optional argument to indicate the indentation of the resulting YAML. Usage{{ yaml [obj] [int] }}where theintnumber 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
- Minor fix to the 'set' helper so it allows
map[interface{}]interface{}as well asmap[string]interface{}. - Added support for arm64 targets for all supported OS (Windows, MacOS, Linux)
- Added
stringsSubhelper 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
v1.0.9
v1.0.8
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
-
Introduced new handlers for String conversion:
stringxCamelToDash> Converts a camelCase string to a dash-separated stringstringxCamelToSnake> Converts a camelCase string to a snake_case stringstringxDashToCamel> Converts a dash-separated string to a camelCase stringstringxDashToPascal> Converts a dash-separated string to a PascalCase stringstringxPascalToDash> Converts a PascalCase string to a dash-separated stringstringxPascalToSnake> Converts a PascalCase string to a snake_case stringstringxSnakeToCamel> Converts a SnakeToCamel string to a camelCase stringstringxSnakeToPascal> 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
lowerforlowercase -
Added short alias
upperforuppercase
stringsJoin now allows any type of array
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
- 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
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