Skip to content

Releases: c2pc/config-migrate

v1.0.7

Choose a tag to compare

@c2pc c2pc released this 05 Mar 04:00

Replacer: UUID placeholder

You can now use a ___uuid___ placeholder in config values. It is replaced with a new UUID each time the replacer runs, which is handy for generating unique IDs, tokens, or instance identifiers in configs.

Deprecated keys and migration helpers

Migration logic is extended with “deprecated”-style keys so you can reshape config without losing old data:

  • _deprecated — copy a value from an old path into a key (e.g. move host into server.host).
  • _deprecated_expand — expand an old array into a list of objects using a template.
  • _deprecated_collapse — take an array of objects and collapse one field into a simple array.
  • _deprecated_concat — glue several fields (after the above steps) into one string with a template like {0}:{1}.
  • _deprecated_replace — force a key to take the new value and ignore the merged old one.

Order of steps is: merge → deprecated → expand → collapse → concat → replace, so you can combine them in one migration (e.g. rename/move with _deprecated, then glue with _deprecated_concat).

INI config support

INI files are now supported as a config format. The driver uses gopkg.in/ini.v1; all values are kept as strings. Use the ini:// scheme (e.g. ini:///path/to/config.ini) the same way you use json:// or yaml://. Migrations for INI should be INI files as well.

v1.0.6

Choose a tag to compare

@c2pc c2pc released this 05 Mar 04:00
Fixed comment error

v1.0.5

Choose a tag to compare

@c2pc c2pc released this 11 Apr 09:10
  • Fixed bugs

Full Changelog: v1.0.5...v1.0.5

v1.0.4

Choose a tag to compare

@c2pc c2pc released this 06 Apr 18:03
  • Fixed errors in commits
  • Update copyright in LICENSE

Full Changelog: v1.0.4...v1.0.4

v1.0.3

Choose a tag to compare

@c2pc c2pc released this 05 Apr 13:47
  • Fixed bugs
  • Made the comments readable
  • Added \n between comments
  • Renamed config package to driver
  • Renamed CommentSuffix

Full Changelog: v1.0.3...v1.0.3

v1.0.2

Choose a tag to compare

@c2pc c2pc released this 05 Apr 01:10
248d028

✨ What's new

  • Refactored mergeMaps function to improve performance
  • Removed use of reflect.TypeOf, replacing it with faster type assertions
  • Reduced the number of unnecessary replace() calls
  • Improved array and map merging logic

🧪 Testing

  • All unit tests passed ✅
  • Benchmarks showed ~30-40% performance gains on large nested structures

📚 Related

  • Closes #3

Full Changelog: v1.0.2...v1.0.2

v1.0.1

Choose a tag to compare

@c2pc c2pc released this 04 Apr 21:55
b32760c
  • Added comments to config files #1
  • Fixed bugs
  • Added documentation

Full Changelog: v1.0.1...v1.0.1

v1.0.0

Choose a tag to compare

@c2pc c2pc released this 25 Mar 20:59
  • YAML and JSON config migrations
  • IP, ProjectName, Random replacers
  • Add example code
  • Fix bugs

Full Changelog: https://github.com/c2pc/config-migrate/commits/v1.0.0