kcl icon indicating copy to clipboard operation
kcl copied to clipboard

[Enhancement][Track] The KCL system packages need to be reorganized and enhanced

Open Peefy opened this issue 1 year ago • 0 comments

Enhancement

The KCL system package need to be reorganized and enhanced.

We need to sort out the system library according to the high-frequency scenarios used by KCL and make a unified improvement to the system library, such as building common plug-in functions into the system library. After the upgrade, we can tell the user that the KCL provides common 100+ built-in functions and supports plug-in extensions.

  • [x] str functions. e.g., removeprefix, removesuffix #477
  • [x] yaml decode/encode more than one documents (the YAML stream format). #852
  • [x] json.validate & yaml.validate functions to validate the config format. #856
  • [x] file read and write functions (Further discussion is needed on whether IO, especially writing files, poses security risks. We can use the -D parameter to dynamically input the required text) #1049
  • [x] more crypto functions e.g., filehash, uuid https://github.com/kcl-lang/kcl/pull/1090
  • [ ] builtin template package (Different technologies and tools have different template implementation methods, and further discussion is needed on which KCL to use, such as Terraform using tftpl and Helm using go template)
  • [x] strategy merge functions (Use KCL to impl) https://github.com/kcl-lang/modules/tree/main/strategic_merge_patch
  • [x] more collection functions for list and dict (Use KCL to impl) https://github.com/kcl-lang/modules/tree/main/collectionutil

Reference

  • https://developer.hashicorp.com/terraform/language/functions/templatefile

Peefy avatar Nov 28 '22 12:11 Peefy