timonel 2.14.0-beta.1 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +185 -0
- package/README.md +133 -9
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/lib/helmChartWriter.js +5 -3
- package/dist/lib/rutter.js +10 -8
- package/dist/lib/utils/envVarsLoader.d.ts +19 -0
- package/dist/lib/utils/envVarsLoader.js +57 -0
- package/dist/lib/utils/helmControlStructures.d.ts +4 -5
- package/dist/lib/utils/helmControlStructures.js +12 -0
- package/dist/lib/utils/helmYamlSerializer.d.ts +2 -0
- package/dist/lib/utils/helmYamlSerializer.js +491 -15
- package/dist/lib/utils/valuesRef.d.ts +102 -0
- package/dist/lib/utils/valuesRef.js +264 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,188 @@
|
|
|
1
|
+
# [3.0.0-beta.1](https://github.com/KenkoGeek/timonel/compare/v2.14.0-beta.1...v3.0.0-beta.1) (2025-12-01)
|
|
2
|
+
|
|
3
|
+
- feat!: rename ChartFactory to Rutter (maritime pilot concept) ([b0a7a33](https://github.com/KenkoGeek/timonel/commit/b0a7a3361e761a5b20ff2c203d55bdfab35323af))
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- address all security vulnerabilities from code review ([bf3165b](https://github.com/KenkoGeek/timonel/commit/bf3165b2198ea7b67e653df9a1b47ed25b1129b1))
|
|
8
|
+
- **aws:** update Karpenter API versions and add disruption/scheduling helpers ([#77](https://github.com/KenkoGeek/timonel/issues/77)) ([d03fb5f](https://github.com/KenkoGeek/timonel/commit/d03fb5f580810204905ad3ec95a0165f4e4339c1))
|
|
9
|
+
- change imports to use 'timonel' package instead of relative paths ([ac77265](https://github.com/KenkoGeek/timonel/commit/ac772651a85ed4f45426e4f603091939560f669a))
|
|
10
|
+
- **ci:** add comprehensive test suite with unit and integration tests ([#38](https://github.com/KenkoGeek/timonel/issues/38)) ([ad782c1](https://github.com/KenkoGeek/timonel/commit/ad782c1597469ffc98054a0b66f8091b6f2a1e0b))
|
|
11
|
+
- **ci:** add mandatory CI status verification to beta release ([6b4083c](https://github.com/KenkoGeek/timonel/commit/6b4083c478c41415b5767cb311a7006f817f0bb7))
|
|
12
|
+
- **ci:** and beside or ([401c06a](https://github.com/KenkoGeek/timonel/commit/401c06acf05d8fb60a34faf2991756d4b317b9e6))
|
|
13
|
+
- **ci:** change CodeQL build-mode to 'none' for JavaScript/TypeScript ([e47c97a](https://github.com/KenkoGeek/timonel/commit/e47c97acf6670007c5dbdbc90a197aa438095694))
|
|
14
|
+
- **ci:** clean up workflows and fix CodeQL configuration ([1dd7b62](https://github.com/KenkoGeek/timonel/commit/1dd7b6242e9ea5d3d98443965704d84bfca18a4a))
|
|
15
|
+
- **ci:** configure GitHub App token for semantic-release bypass - Use RELEASE_TOKEN from npm-prd environment for checkout and semantic-release ([ab4eea3](https://github.com/KenkoGeek/timonel/commit/ab4eea394d98227ed330091f0a3972eee903de9a))
|
|
16
|
+
- **ci:** correct CodeQL workflow configuration ([c6f9b53](https://github.com/KenkoGeek/timonel/commit/c6f9b53eb641a47c2c8723405c54f7119f0d0be8))
|
|
17
|
+
- **ci:** correct CodeQL workflow name in release.yaml ([09db750](https://github.com/KenkoGeek/timonel/commit/09db750692a26e9195f03ea459acbd1549a9087f))
|
|
18
|
+
- **ci:** correct job dependencies and summary references ([27a5d97](https://github.com/KenkoGeek/timonel/commit/27a5d9748a3a7d4fbe2b120830fd94c16f957336))
|
|
19
|
+
- **ci:** disable body-max-line-length for semantic-release compatibility - Set body-max-line-length to 0 (disabled) to allow long changelog entries - Fixes semantic-release commit validation failures - Maintains other commitlint rules for developer commits ([cf2e199](https://github.com/KenkoGeek/timonel/commit/cf2e19972b31f30a8d681d5f540b02b6c381e04b))
|
|
20
|
+
- **ci:** disable footer line length limit for semantic-release commits ([143d512](https://github.com/KenkoGeek/timonel/commit/143d512a8a41881c3cf84868a72b478598678c53))
|
|
21
|
+
- **ci:** disable footer-leading-blank for semantic-release compatibility - Set footer-leading-blank to 0 (disabled) to allow semantic-release footer format ([b14b45c](https://github.com/KenkoGeek/timonel/commit/b14b45c4435b9bfecb20fa4e270d36994a942241))
|
|
22
|
+
- **ci:** ensure real release on main branch ([fb898e6](https://github.com/KenkoGeek/timonel/commit/fb898e667d499bdc52166d6beb82c566f3c39eb1))
|
|
23
|
+
- **ci:** lint errors ([210d0e2](https://github.com/KenkoGeek/timonel/commit/210d0e242a80568cb3a2a99fe9544bbc466aedd8))
|
|
24
|
+
- **ci:** Q gate not needed ([7d809e0](https://github.com/KenkoGeek/timonel/commit/7d809e0cbb12f9d90d889537f8c8e2dff67d8343))
|
|
25
|
+
- **ci:** Q gate not needed ([a6e1faf](https://github.com/KenkoGeek/timonel/commit/a6e1fafbc4c9a82b8b119d91d72b50970b2cd852))
|
|
26
|
+
- **ci:** remove explicit pnpm version from CodeQL workflow ([8e947ee](https://github.com/KenkoGeek/timonel/commit/8e947eefd39ab050c6830fa21eb26141bf6ba4dc))
|
|
27
|
+
- **ci:** remove explicit pnpm version from workflows ([22ff6d7](https://github.com/KenkoGeek/timonel/commit/22ff6d7f031f4d82449430d038c0b03cf0c1d670))
|
|
28
|
+
- **ci:** remove npm-prd environment from beta release ([4cc4e77](https://github.com/KenkoGeek/timonel/commit/4cc4e77c066b1a39b0f6aa23d4b113cbeee0459e))
|
|
29
|
+
- **ci:** remove pnpm cache from setup-node to prevent executable error ([349a87b](https://github.com/KenkoGeek/timonel/commit/349a87b2407374b6fa1da6a36df393465a6a4fc3))
|
|
30
|
+
- **ci:** remove redundant publish workflow and configure release token ([4ac7597](https://github.com/KenkoGeek/timonel/commit/4ac75970bea9ca503af9d940b06f7ecb4ceb0bea))
|
|
31
|
+
- **ci:** reorder pnpm setup before Node.js in CodeQL workflow ([6b806c8](https://github.com/KenkoGeek/timonel/commit/6b806c85f68aefd4531a5a20093a7f277da06fde))
|
|
32
|
+
- **ci:** replace CodeQL with security check in release validation ([#15](https://github.com/KenkoGeek/timonel/issues/15)) ([6a3df07](https://github.com/KenkoGeek/timonel/commit/6a3df076d07bbf548a6acb86eea97a6e83441af8))
|
|
33
|
+
- **ci:** resolve pnpm version conflict in workflows ([4d041ed](https://github.com/KenkoGeek/timonel/commit/4d041ede0716975efc65ce18b1656e4358ca8441))
|
|
34
|
+
- **ci:** resolve release workflow issues ([#16](https://github.com/KenkoGeek/timonel/issues/16)) ([46a9581](https://github.com/KenkoGeek/timonel/commit/46a9581bc84c70bbb8b39cd4fbc0e3a15f4bfc13))
|
|
35
|
+
- **ci:** restore release.yml workflow from v2.7.3 ([7d14a52](https://github.com/KenkoGeek/timonel/commit/7d14a522a913532a8bc214c1bc1b67596b2811d9))
|
|
36
|
+
- **ci:** restore working release workflow from v2.7.3 ([e3540ac](https://github.com/KenkoGeek/timonel/commit/e3540acd65a84f1a06f8ded068c7431d39b35e51))
|
|
37
|
+
- **ci:** simple but effective release ([20b439d](https://github.com/KenkoGeek/timonel/commit/20b439dd5d21e4fc43de662bb3f6ea21248b7498))
|
|
38
|
+
- **ci:** simple but effective release, security.md updated ([45a0085](https://github.com/KenkoGeek/timonel/commit/45a00850f0653bcc41cca8b75050b5011551f7e4))
|
|
39
|
+
- **ci:** specify explicit semantic-release config file ([8b7e5dc](https://github.com/KenkoGeek/timonel/commit/8b7e5dca2a357dcd55e206a512ef9b0428d928ad))
|
|
40
|
+
- **ci:** use exact pnpm version 10.15.0 in workflows ([a91d38d](https://github.com/KenkoGeek/timonel/commit/a91d38d0690fb9e01235f5d44b6147ce0da4b286))
|
|
41
|
+
- **ci:** use working semantic-release config from v2.7.3 ([bc23629](https://github.com/KenkoGeek/timonel/commit/bc23629a2fb0c9f174cded6964beeb2b309db359))
|
|
42
|
+
- **cli:** consolidate path validation and improve error handling ([a46a5eb](https://github.com/KenkoGeek/timonel/commit/a46a5ebd6f27a23ac2d71b5d98dd371adfbec070))
|
|
43
|
+
- **cli:** enable TypeScript execution with enhanced security and strict mode validation ([8dd9e4c](https://github.com/KenkoGeek/timonel/commit/8dd9e4c8c2f555707aea2fc53c9e5161b82c0b4b))
|
|
44
|
+
- **cli:** handle flags after positional arguments ([#142](https://github.com/KenkoGeek/timonel/issues/142)) ([bea408f](https://github.com/KenkoGeek/timonel/commit/bea408fe88011185541acf9b102910321ff79642))
|
|
45
|
+
- **cli:** harden flag handling and path validation ([#130](https://github.com/KenkoGeek/timonel/issues/130)) ([569f445](https://github.com/KenkoGeek/timonel/commit/569f445735626db50d68c4be88c2e805d390286f))
|
|
46
|
+
- **cli:** improve version display and fallback handling ([#117](https://github.com/KenkoGeek/timonel/issues/117)) ([5d34db0](https://github.com/KenkoGeek/timonel/commit/5d34db0bfe092b640635e7edb0866359f6e8eb93))
|
|
47
|
+
- **cli:** new feature for cli ([14f3a4a](https://github.com/KenkoGeek/timonel/commit/14f3a4afc3454bf27427c36a423ee234940e25e3))
|
|
48
|
+
- **cli:** resolve ES modules \_\_dirname and scaffold import paths ([#80](https://github.com/KenkoGeek/timonel/issues/80)) ([8f1157f](https://github.com/KenkoGeek/timonel/commit/8f1157fa34d4b95c628961fc779661f747410859))
|
|
49
|
+
- **cli:** resolve incorrect syntax in conditional Helm templates, ensuring namespace and ingress conditions work correctly ([86a9215](https://github.com/KenkoGeek/timonel/commit/86a9215dc782c01731ce7bdfd9c010b0c9f96523))
|
|
50
|
+
- **cli:** resolve timonel module not found error in umbrella.ts ([c5e66fc](https://github.com/KenkoGeek/timonel/commit/c5e66fc815f8754f6592dc0bc407ce8515072f3d))
|
|
51
|
+
- **core:** addIngress already normalized with NGINX best practices ([1107e44](https://github.com/KenkoGeek/timonel/commit/1107e441ad9e4b04007f494891840ef94acafc28))
|
|
52
|
+
- **core:** correct StorageClass API structure for Kubernetes 1.32+ compatibility ([48ba6ca](https://github.com/KenkoGeek/timonel/commit/48ba6ca17ea104b894efc904786a41510fc6482e)), closes [#58](https://github.com/KenkoGeek/timonel/issues/58) [#58](https://github.com/KenkoGeek/timonel/issues/58)
|
|
53
|
+
- **core:** correct TypeScript errors and improve version handling ([9ade121](https://github.com/KenkoGeek/timonel/commit/9ade121516c1c04e7b0d939e46b82cd76366fea4))
|
|
54
|
+
- **core:** ensure Timonel header appears in all YAML files ([7d93d4e](https://github.com/KenkoGeek/timonel/commit/7d93d4ec9fbba703af9436c0b2e23acc3ef540ad))
|
|
55
|
+
- **core:** implement CLI-focused security validations and centralized input sanitization ([0568d38](https://github.com/KenkoGeek/timonel/commit/0568d38eac2ba69b5cdccdc5f735e635a092f8e9))
|
|
56
|
+
- **core:** resolve critical issues [#52](https://github.com/KenkoGeek/timonel/issues/52)-[#56](https://github.com/KenkoGeek/timonel/issues/56) and security vulnerabilities ([9c86e55](https://github.com/KenkoGeek/timonel/commit/9c86e5512716b686afa04e7b033652633cc340f7))
|
|
57
|
+
- **core:** resolve issue [#114](https://github.com/KenkoGeek/timonel/issues/114) - invalid Helm template generation ([b958d45](https://github.com/KenkoGeek/timonel/commit/b958d454b49e8ab61be0f9bcddcb96a831c5298d))
|
|
58
|
+
- **core:** resolve splitDocs removing Timonel headers from YAML ([7335025](https://github.com/KenkoGeek/timonel/commit/73350253d73f4adaa616b5290e35573b29702bf4))
|
|
59
|
+
- **core:** TypeScript interfaces for GCP Artifact Registry and Karpenter helpers ([#72](https://github.com/KenkoGeek/timonel/issues/72)) ([914e6fa](https://github.com/KenkoGeek/timonel/commit/914e6fa04d286533255a9987802c60deae3e878c))
|
|
60
|
+
- correct Helm template expression formatting for include and inline conditionals ([927d6a3](https://github.com/KenkoGeek/timonel/commit/927d6a353bd8b5fb8b2afa8cb6738a55fa36b3e9))
|
|
61
|
+
- **deps:** merge conflict solved [skip ci] ([8931abd](https://github.com/KenkoGeek/timonel/commit/8931abd5c800fe85fa7cda0a06d2ea183f54e185))
|
|
62
|
+
- **deps:** merge conflicts ([a0dd0bd](https://github.com/KenkoGeek/timonel/commit/a0dd0bdecf603fd43335721fc2e201f81bede2d1))
|
|
63
|
+
- **deps:** merge conflicts ([0f2d49f](https://github.com/KenkoGeek/timonel/commit/0f2d49ff6316f9e76c4eb18f39ae78599b19475b))
|
|
64
|
+
- **deps:** upgrade timonel version [skip ci] ([20cae6f](https://github.com/KenkoGeek/timonel/commit/20cae6fa57a61bc44a18d9c7af8e7ad8970d7af9))
|
|
65
|
+
- **docs:** apply prettier formatting to README.md ([bc9c00b](https://github.com/KenkoGeek/timonel/commit/bc9c00be41167296ef5852e26547975aea7c9cc7))
|
|
66
|
+
- **docs:** use published npm package imports in example instead of local src ([80e19f4](https://github.com/KenkoGeek/timonel/commit/80e19f40acf9d0073db15d6d576a9e0776dbdc62))
|
|
67
|
+
- **docs:** valuesRef and lib imported example ([72bc785](https://github.com/KenkoGeek/timonel/commit/72bc7858b615cbf5652cca81b45d9d2d799d913c))
|
|
68
|
+
- **examples:** update timonel dependency to ^1.0.0 ([b9e8e19](https://github.com/KenkoGeek/timonel/commit/b9e8e19bf7cf942c675b9116efa6de5b8c7ba36c))
|
|
69
|
+
- exclude examples from main lint script ([5ba6ea8](https://github.com/KenkoGeek/timonel/commit/5ba6ea8670459c53fd053e8938430ec8f180188b))
|
|
70
|
+
- exclude examples from security linting ([5761d41](https://github.com/KenkoGeek/timonel/commit/5761d410471137b1655d624162a9921818ce2597))
|
|
71
|
+
- format CHANGELOG.md with prettier ([b382ea0](https://github.com/KenkoGeek/timonel/commit/b382ea0d4dfacf1c3ffcd05648c762a9d4202938))
|
|
72
|
+
- **helm:** implement Helm-aware YAML serializer ([#112](https://github.com/KenkoGeek/timonel/issues/112)) ([fdf7cd9](https://github.com/KenkoGeek/timonel/commit/fdf7cd90c86dbeff2136e618b20a9f86e0f8b51d))
|
|
73
|
+
- **helm:** remove automatic numbering from template files ([#20](https://github.com/KenkoGeek/timonel/issues/20)) ([e21b1cf](https://github.com/KenkoGeek/timonel/commit/e21b1cf2bc62a73b3f2ab84514b6fa415452a725))
|
|
74
|
+
- **helm:** remove debug logs from helmChartWriter ([63870a7](https://github.com/KenkoGeek/timonel/commit/63870a715db0c05e03a9b496b619284a3e34c848))
|
|
75
|
+
- **helm:** trying to make it work ([3ce69d5](https://github.com/KenkoGeek/timonel/commit/3ce69d56969468260f159870abc5b3f089bad9ab))
|
|
76
|
+
- ignore node_modules MDs ([fda76c4](https://github.com/KenkoGeek/timonel/commit/fda76c497ad7197195287aa5b47e8ee000bcc03e))
|
|
77
|
+
- ignore node_modules MDs ([8804860](https://github.com/KenkoGeek/timonel/commit/88048609d155883b4c473ddc85ab276d368cf0a8))
|
|
78
|
+
- **network:** Ingress API with TLS validation and security defaults ([#88](https://github.com/KenkoGeek/timonel/issues/88)) ([348ee2d](https://github.com/KenkoGeek/timonel/commit/348ee2dcf27d8b44064245f89279d0cfe9aa4973))
|
|
79
|
+
- **release:** align required checks with ruleset configuration ([d912f3c](https://github.com/KenkoGeek/timonel/commit/d912f3c0229eb78f0fc927421007b8eb5347b8b9))
|
|
80
|
+
- **release:** update required checks in release workflow ([ba2712e](https://github.com/KenkoGeek/timonel/commit/ba2712e2cc95cb55588fcf583a84da365acd84a7))
|
|
81
|
+
- resolve ESLint sonarjs plugin compatibility for CI ([48c16e6](https://github.com/KenkoGeek/timonel/commit/48c16e641bbd0984df00268360a873e7bd5d58c9))
|
|
82
|
+
- resolve Helm chart YAML generation issues ([5e8c779](https://github.com/KenkoGeek/timonel/commit/5e8c7794fcbfb3bddef1f2136ba78103b28ab62b))
|
|
83
|
+
- resolve issue [#114](https://github.com/KenkoGeek/timonel/issues/114) - Helm template generation bug and enhance documentation ([#116](https://github.com/KenkoGeek/timonel/issues/116)) ([65d4f26](https://github.com/KenkoGeek/timonel/commit/65d4f26c1449135704e59eb8acf71268f4f660d0))
|
|
84
|
+
- resolve markdown linting issues ([8a817ef](https://github.com/KenkoGeek/timonel/commit/8a817ef2836fb8289f612ad171e4aaf010904f53))
|
|
85
|
+
- resolve prettier formatting issues and enhance CI checks ([648b35c](https://github.com/KenkoGeek/timonel/commit/648b35cbe55889b855bb56c652b6a4b8c3021bf1))
|
|
86
|
+
- resolve remaining eslint errors ([64f60e5](https://github.com/KenkoGeek/timonel/commit/64f60e5967676f2b651967e9c53b6c083a18d69b))
|
|
87
|
+
- resolve TypeScript module resolution error in CLI validation ([41ad96e](https://github.com/KenkoGeek/timonel/commit/41ad96e2e7dc2366f7fec189a0d9e551da3466ad))
|
|
88
|
+
- resolve TypeScript strict optional types errors ([2906889](https://github.com/KenkoGeek/timonel/commit/2906889e352d94eae8070a5f99734ca1f5d35767))
|
|
89
|
+
- resolve umbrella chart validation issues ([48206b6](https://github.com/KenkoGeek/timonel/commit/48206b660eb2998bb31f326e420ba2f4d3ceb89b))
|
|
90
|
+
- **umbrella:** remove unused \_subchartInstance variables ([ee07f96](https://github.com/KenkoGeek/timonel/commit/ee07f96c49a032289654f57a407e9bfba7ebc171))
|
|
91
|
+
- update examples versions and resolve security vulnerability ([68fad19](https://github.com/KenkoGeek/timonel/commit/68fad195baaac65085ca8634d1d7f62d8c1c1361))
|
|
92
|
+
- update pnpm-lock.yaml after removing cdk8s-plus-28 ([ff1b929](https://github.com/KenkoGeek/timonel/commit/ff1b9298e068df7e0fc715f21dc7d4150eccc2c3))
|
|
93
|
+
- update WordPress example imports to use timonel package ([19a36a6](https://github.com/KenkoGeek/timonel/commit/19a36a6e010abe2276268dbe64b27bb6144ae16e))
|
|
94
|
+
|
|
95
|
+
### Features
|
|
96
|
+
|
|
97
|
+
- add --set flag for dynamic value overrides ([36ae842](https://github.com/KenkoGeek/timonel/commit/36ae8422b4db34a2ded90eeede04d39a0ffe7b98))
|
|
98
|
+
- add AWS ALB Ingress helper ([f9c7009](https://github.com/KenkoGeek/timonel/commit/f9c70095796db9147d8bc9a6bf513ebe4ae7eb46))
|
|
99
|
+
- add AWS EBS CSI storage helpers ([dae2258](https://github.com/KenkoGeek/timonel/commit/dae2258b4beb1735430112f7f16b5ac7d0f17a83))
|
|
100
|
+
- add AWS EFS CSI storage helpers ([343e5f8](https://github.com/KenkoGeek/timonel/commit/343e5f831855bc40a081d982eebc3b051d27ac99))
|
|
101
|
+
- add AWS Secrets Manager and Parameter Store support ([c17cfe1](https://github.com/KenkoGeek/timonel/commit/c17cfe1f6b3d90619148f64e1db612946e305a32))
|
|
102
|
+
- add CHANGELOG and GitHub templates following npm best practices ([51448cc](https://github.com/KenkoGeek/timonel/commit/51448cc00c47eaa1f5a6f9627c88249f734d3377))
|
|
103
|
+
- add comprehensive AWS 2048 game example ([2f9ac11](https://github.com/KenkoGeek/timonel/commit/2f9ac1115fd7980ba581fc9b1ca0adbedab11aa4))
|
|
104
|
+
- add comprehensive IRSA ServiceAccount support ([eec3337](https://github.com/KenkoGeek/timonel/commit/eec333735fae2431aab9307f012ede01604462b2))
|
|
105
|
+
- add custom manifest naming support ([4d70c8e](https://github.com/KenkoGeek/timonel/commit/4d70c8e70a6bb6d4b0b61bc15bfd3b15a7e8a30b))
|
|
106
|
+
- add custom manifest naming support ([a631e06](https://github.com/KenkoGeek/timonel/commit/a631e065165c35f68e2ed39d97550fc9c52e5f38))
|
|
107
|
+
- add custom manifest naming to all examples ([f3d1880](https://github.com/KenkoGeek/timonel/commit/f3d188096b74242c10317592fc09ba463ff43631))
|
|
108
|
+
- add HorizontalPodAutoscaler support ([7b43d1b](https://github.com/KenkoGeek/timonel/commit/7b43d1b96f8b4dd50d64f4f3830de7c9b6f7c638))
|
|
109
|
+
- add manual release workflow with GitHub Actions ([e45aaad](https://github.com/KenkoGeek/timonel/commit/e45aaad56d965a1337cede8fbda30d3a442f56be))
|
|
110
|
+
- add NetworkPolicy helpers for Zero Trust network security ([#13](https://github.com/KenkoGeek/timonel/issues/13)) ([f80f23e](https://github.com/KenkoGeek/timonel/commit/f80f23e940f282715e2e0ef90f0a8224ddad0ea6))
|
|
111
|
+
- add PodDisruptionBudget support ([2b8b14c](https://github.com/KenkoGeek/timonel/commit/2b8b14c697ec7d45763b0b0cda3adbcea6c462a6))
|
|
112
|
+
- add umbrella charts support ([c37a366](https://github.com/KenkoGeek/timonel/commit/c37a3664e2ce5242ff4749ed72e7b0f0555a7f91))
|
|
113
|
+
- add version command to CLI ([4d11f20](https://github.com/KenkoGeek/timonel/commit/4d11f20b0a3f1e560f862f3afa8d5a66321db4b0))
|
|
114
|
+
- add VerticalPodAutoscaler support ([5f11343](https://github.com/KenkoGeek/timonel/commit/5f11343580e6ee3712098bfed7a71e3b4a3e7380))
|
|
115
|
+
- add WordPress with MySQL example chart ([4971b61](https://github.com/KenkoGeek/timonel/commit/4971b61e7821e7ecc4a8ab1a529326198243400c))
|
|
116
|
+
- **ci:** add automatic beta release workflow for main branch ([89fa5d2](https://github.com/KenkoGeek/timonel/commit/89fa5d2e5da4ef2d44a874371d485d25bdc4ba69))
|
|
117
|
+
- **ci:** add automatic CHANGELOG.md formatting to semantic-release ([babe71f](https://github.com/KenkoGeek/timonel/commit/babe71f93e8e0344ea0239082fa4a327246c7b48))
|
|
118
|
+
- **ci:** add beta releases on main with quality gates [skip ci] ([8b6b7da](https://github.com/KenkoGeek/timonel/commit/8b6b7da31901b954aa8eba1cd027c98a9a505109))
|
|
119
|
+
- **ci:** add required status checks validation to release workflow ([#14](https://github.com/KenkoGeek/timonel/issues/14)) ([5f4e89d](https://github.com/KenkoGeek/timonel/commit/5f4e89df8c72f8d487cd95ce12789510cba29ce6))
|
|
120
|
+
- **ci:** configure dual release strategy ([b114395](https://github.com/KenkoGeek/timonel/commit/b114395b820bfea5c1354e4b1229337db878af29))
|
|
121
|
+
- **ci:** implement automated semantic release with conventional commits ([81dc9d4](https://github.com/KenkoGeek/timonel/commit/81dc9d4d266d90a5e70cabb67eabfd42a5069e69))
|
|
122
|
+
- **ci:** implement automated semantic release with conventional commits ([3fb9abd](https://github.com/KenkoGeek/timonel/commit/3fb9abdd7fac413882737577a59eb5c5b13cddbf))
|
|
123
|
+
- **ci:** optimize GitHub workflows with enhanced performance and reliability ([7e1b409](https://github.com/KenkoGeek/timonel/commit/7e1b409776f3e63ac79493630e70eb04fb5f416d))
|
|
124
|
+
- **ci:** simplify to beta releases only ([e5aed20](https://github.com/KenkoGeek/timonel/commit/e5aed206d5247c7d11cba15c13d49904ef31c22e))
|
|
125
|
+
- **cli:** add Helm helpers (helmIf, helmWith) to templates and new release ([#201](https://github.com/KenkoGeek/timonel/issues/201)) ([e3f1cf8](https://github.com/KenkoGeek/timonel/commit/e3f1cf885d8f8fa4263013179144d51ac99afa0f))
|
|
126
|
+
- **core:** add Azure Application Gateway Ingress Controller (AGIC) support ([#19](https://github.com/KenkoGeek/timonel/issues/19)) ([2d3cbdd](https://github.com/KenkoGeek/timonel/commit/2d3cbddda3b4206f5d465632d45ecd1dd9cf60ae))
|
|
127
|
+
- **core:** add Azure Disk StorageClass helper for AKS ([#18](https://github.com/KenkoGeek/timonel/issues/18)) ([f88dac1](https://github.com/KenkoGeek/timonel/commit/f88dac1a79369227d85a0a7e90e2718192e4f9b4))
|
|
128
|
+
- **core:** add comprehensive Azure helpers for AKS integration with enhanced security ([eb460b4](https://github.com/KenkoGeek/timonel/commit/eb460b483597ab9c72fc98df00df2cee54a125ed))
|
|
129
|
+
- **core:** add GKE Workload Identity ServiceAccount, AWS ECR ServiceAccount helpers. implement modular architecture. add Role resource support for RBAC. with resource providers. add DaemonSet resource support. add StatefulSet resource support. add ClusterRole resource support for cluster-wide RBAC. add RoleBinding resource support for RBAC ([#33](https://github.com/KenkoGeek/timonel/issues/33)) ([6c6204e](https://github.com/KenkoGeek/timonel/commit/6c6204e1664912125a1cd22dc931cb4189ec066e))
|
|
130
|
+
- **core:** add Job and CronJob helpers for batch workloads ([#21](https://github.com/KenkoGeek/timonel/issues/21)) ([b14d886](https://github.com/KenkoGeek/timonel/commit/b14d88654ef114fc0010487ded11953ca186dcd7))
|
|
131
|
+
- **core:** add Karpenter integration with 5 methods, fix performance issues, and update security docs ([#31](https://github.com/KenkoGeek/timonel/issues/31)) ([9660467](https://github.com/KenkoGeek/timonel/commit/9660467512540e35cbeb55b0a212fd6ae0ac5c6b))
|
|
132
|
+
- **core:** add NetworkPolicy helpers for Zero Trust network security ([df3b344](https://github.com/KenkoGeek/timonel/commit/df3b344172f9b60402bc8172e343023194ed6b57))
|
|
133
|
+
- **core:** Add NetworkPolicy, ServiceAccount, CronJob, HPA, VPA, Ingress, and Karpenter resources ([8804102](https://github.com/KenkoGeek/timonel/commit/8804102d20ce430457db3674f11b41464a6ba360))
|
|
134
|
+
- **core:** add reusable pod template helpers with security profiles, workload optimization, sidecar patterns, and health checks ([9c7acfc](https://github.com/KenkoGeek/timonel/commit/9c7acfcc370da34457d6f6f1bb15ba15883bc8bd))
|
|
135
|
+
- **core:** add security helpers - sanitizeEnvVar, validateImageTag, generateSecretName ([#43](https://github.com/KenkoGeek/timonel/issues/43)) ([247bb57](https://github.com/KenkoGeek/timonel/commit/247bb57ea775014c2a3debef89ebda1551412d13))
|
|
136
|
+
- **core:** add Whatever tomorrow brings Ill be there ([51cb023](https://github.com/KenkoGeek/timonel/commit/51cb023d8dcded034a3b25774d7010f00bb94733))
|
|
137
|
+
- **core:** Add with open arms and open eyes, yeah ([a6e6a68](https://github.com/KenkoGeek/timonel/commit/a6e6a681d7ca66069312089276f3cf1d917ee9f2))
|
|
138
|
+
- **core:** enhance ChartProps for better flexibility ([49919c2](https://github.com/KenkoGeek/timonel/commit/49919c2cb6bd1361243e6eb5735dbf89972338b5))
|
|
139
|
+
- **core:** exporting createHelmExpression() from helmYamlSerializer ([#196](https://github.com/KenkoGeek/timonel/issues/196)) ([d99b5b6](https://github.com/KenkoGeek/timonel/commit/d99b5b6276cf074bb400d8ef3209e337264a74b1))
|
|
140
|
+
- **core:** refactor addConditionalManifest to manage helm templates ([cd38ca1](https://github.com/KenkoGeek/timonel/commit/cd38ca144fdfabc7e41220eea9783a5a189046da))
|
|
141
|
+
- **core:** restore v2.3.0 functionality with modern architecture ([4dfa2c9](https://github.com/KenkoGeek/timonel/commit/4dfa2c928f90fa3fc3d927484c6e6baabe106f3f)), closes [#34](https://github.com/KenkoGeek/timonel/issues/34) [#35](https://github.com/KenkoGeek/timonel/issues/35) [#36](https://github.com/KenkoGeek/timonel/issues/36)
|
|
142
|
+
- **docs:** update references and CLI [skip ci] ([7d236c8](https://github.com/KenkoGeek/timonel/commit/7d236c8aa142aa98b60fa9275deb3017fb5dda3e))
|
|
143
|
+
- **docs:** update references and CLI [skip ci] ([75238c6](https://github.com/KenkoGeek/timonel/commit/75238c6ecd15e3c900d255338efb12fc1205f845))
|
|
144
|
+
- enhance AWS 2048 example with production-ready AWS features ([5a6c3ea](https://github.com/KenkoGeek/timonel/commit/5a6c3eabc9df7ae9554e742c5e3855540a6fcd0e))
|
|
145
|
+
- enhance CLI with CI/CD support commands and flags ([ddb2cc7](https://github.com/KenkoGeek/timonel/commit/ddb2cc75bbd8e7fb2db1f9d6e09ce77b48db5f75))
|
|
146
|
+
- enhance validate command with helm lint and installation detection ([62d56a9](https://github.com/KenkoGeek/timonel/commit/62d56a9c2b86d94fbe9c01b2a4a399b72b9c4b84))
|
|
147
|
+
- **helm:** add comprehensive helm helpers with Helm template validation ([#123](https://github.com/KenkoGeek/timonel/issues/123)) ([29c4934](https://github.com/KenkoGeek/timonel/commit/29c4934e79a50b3b2f86d38eb15a5e613502ef3c))
|
|
148
|
+
- **helm:** adding new and typesafe helpers ([7b1e951](https://github.com/KenkoGeek/timonel/commit/7b1e951df5c0550889e56f0f2e18fb6bfb97ed79))
|
|
149
|
+
- **network:** enhance NGINX Ingress support with cert-manager integration and security enhanced ([#91](https://github.com/KenkoGeek/timonel/issues/91)) ([feec4d1](https://github.com/KenkoGeek/timonel/commit/feec4d1cea93f261b7e302aafbb2a700d6885812))
|
|
150
|
+
- rename example to examples and document in README ([490fbe8](https://github.com/KenkoGeek/timonel/commit/490fbe89d33e56612804b66399be6191cdfb038b))
|
|
151
|
+
- update examples package.json for v0.3.0 ([bcd4a2e](https://github.com/KenkoGeek/timonel/commit/bcd4a2e6ec85e29ca98f81597199353d3fcf8bc4))
|
|
152
|
+
- update TypeScript to Node16 module resolution ([ab3e347](https://github.com/KenkoGeek/timonel/commit/ab3e347e66fb71c772a09346803c699785db29a4))
|
|
153
|
+
|
|
154
|
+
### Performance Improvements
|
|
155
|
+
|
|
156
|
+
- **ci:** homogenize CI/CD workflows and optimize release pipeline ([#17](https://github.com/KenkoGeek/timonel/issues/17)) ([787e85c](https://github.com/KenkoGeek/timonel/commit/787e85cd91ff78ed90394b98d99cc6c558365a42))
|
|
157
|
+
|
|
158
|
+
### Reverts
|
|
159
|
+
|
|
160
|
+
- **ci:** restore original release workflow ([4660b1e](https://github.com/KenkoGeek/timonel/commit/4660b1e5298ad86b9b37b1b814b07ea0f090cdb8))
|
|
161
|
+
|
|
162
|
+
### BREAKING CHANGES
|
|
163
|
+
|
|
164
|
+
- **helm:** Template files no longer have automatic numbering prefixes
|
|
165
|
+
|
|
166
|
+
- refactor(helm): unify template naming strategy and add breaking change notice
|
|
167
|
+
|
|
168
|
+
* Simplify file naming logic with unified approach
|
|
169
|
+
* Use consistent naming strategy for single and multiple documents
|
|
170
|
+
* Add breaking change warning in README for numbered filename dependencies
|
|
171
|
+
* Improve code maintainability with cleaner implementation
|
|
172
|
+
|
|
173
|
+
Addresses PR review feedback for better consistency and user awareness.
|
|
174
|
+
|
|
175
|
+
- **ci:** ESLint configuration migrated to flat config format
|
|
176
|
+
- **ci:** ESLint configuration migrated to flat config format
|
|
177
|
+
- ChartFactory class renamed to Rutter
|
|
178
|
+
|
|
179
|
+
* Rename ChartFactory class to Rutter across all files
|
|
180
|
+
* Update examples to use new Rutter class
|
|
181
|
+
* Update README and documentation
|
|
182
|
+
* Rename ChartFactory.ts to Rutter.ts
|
|
183
|
+
* All tests pass, linting and security checks pass
|
|
184
|
+
* Bump version to 0.1.7
|
|
185
|
+
|
|
1
186
|
# [2.14.0-beta.1](https://github.com/KenkoGeek/timonel/compare/v2.13.0...v2.14.0-beta.1) (2025-11-28)
|
|
2
187
|
|
|
3
188
|
### Features
|
package/README.md
CHANGED
|
@@ -17,18 +17,18 @@ directory.
|
|
|
17
17
|
|
|
18
18
|
## ✨ Key Features
|
|
19
19
|
|
|
20
|
-
- **🔒 Type-safe API** with strict TypeScript and cdk8s constructs
|
|
20
|
+
- **🔒 Type-safe API** with strict TypeScript and cdk8s constructs.
|
|
21
21
|
- **🎯 Type-Safe Helm Helpers** with 9 composable template helpers (`helmIf`, `helmRange`,
|
|
22
22
|
`helmWith`, `helmInclude`, etc.)
|
|
23
|
-
- **🔧 Flexible resource creation** with built-in methods and `addManifest()` for custom resources
|
|
24
|
-
- **🌍 Multi-environment support** with automatic values files generation
|
|
25
|
-
- **☂️ Umbrella Charts** for managing multiple subcharts as a single unit
|
|
26
|
-
- **🛠️ Enhanced Helm Helpers** with environment, GitOps, observability, and validation helpers
|
|
23
|
+
- **🔧 Flexible resource creation** with built-in methods and `addManifest()` for custom resources.
|
|
24
|
+
- **🌍 Multi-environment support** with automatic values files generation.
|
|
25
|
+
- **☂️ Umbrella Charts** for managing multiple subcharts as a single unit.
|
|
26
|
+
- **🛠️ Enhanced Helm Helpers** with environment, GitOps, observability, and validation helpers.
|
|
27
27
|
- **☁️ Cloud integrations**:
|
|
28
|
-
- **AWS**: EBS/EFS StorageClass, ALB Ingress, IRSA ServiceAccount, ECR, and Karpenter
|
|
29
|
-
- **🛡️ Security-first approach** with NetworkPolicies and best practices
|
|
30
|
-
- **⚡ Minimal CLI** (`tl`) for scaffolding and chart generation
|
|
31
|
-
- **📦 Flexible subchart templates** supporting cdk8s and cdk8s-plus-33
|
|
28
|
+
- **AWS**: EBS/EFS StorageClass, ALB Ingress, IRSA ServiceAccount, ECR, and Karpenter.
|
|
29
|
+
- **🛡️ Security-first approach** with NetworkPolicies and best practices.
|
|
30
|
+
- **⚡ Minimal CLI** (`tl`) for scaffolding and chart generation.
|
|
31
|
+
- **📦 Flexible subchart templates** supporting cdk8s and cdk8s-plus-33.
|
|
32
32
|
|
|
33
33
|
## 🚀 Quick Start
|
|
34
34
|
|
|
@@ -161,6 +161,130 @@ Timonel provides 9 composable, type-safe helpers for Helm template generation: `
|
|
|
161
161
|
|
|
162
162
|
**Benefits:**
|
|
163
163
|
|
|
164
|
+
## 🔧 Dynamic Environment Variables
|
|
165
|
+
|
|
166
|
+
Timonel supports flexible environment variable configuration that can be defined in code or
|
|
167
|
+
loaded from external sources (e.g., Vault during CI/CD).
|
|
168
|
+
|
|
169
|
+
### Configuration Methods
|
|
170
|
+
|
|
171
|
+
**1. In-Code Defaults:**
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
const envVars = [
|
|
175
|
+
{ name: 'VERSION', type: 'value', defaultValue: '1.0.0' },
|
|
176
|
+
{ name: 'DATABASE_URL', type: 'secret', secretName: 'app-secrets' },
|
|
177
|
+
];
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**2. External JSON/YAML (CI/CD):**
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Load from Vault during CI
|
|
184
|
+
vault kv get -format=json secret/app/env | jq '.data.data' > env-config.json
|
|
185
|
+
pnpm run synth
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**3. Generated Templates:**
|
|
189
|
+
|
|
190
|
+
```yaml
|
|
191
|
+
# Value variables
|
|
192
|
+
- name: VERSION
|
|
193
|
+
value: { { .Values.global.env.VERSION | default "1.0.0" } }
|
|
194
|
+
|
|
195
|
+
# Secret variables
|
|
196
|
+
- name: DATABASE_URL
|
|
197
|
+
valueFrom:
|
|
198
|
+
secretKeyRef:
|
|
199
|
+
name: app-secrets
|
|
200
|
+
key: DATABASE_URL
|
|
201
|
+
optional: true
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
import { Rutter, helmInclude, createHelmExpression as helm } from 'timonel';
|
|
206
|
+
|
|
207
|
+
const chart = new Rutter({
|
|
208
|
+
meta: {
|
|
209
|
+
name: 'web-app',
|
|
210
|
+
version: '1.0.0',
|
|
211
|
+
description: 'Simple web application',
|
|
212
|
+
},
|
|
213
|
+
defaultValues: {
|
|
214
|
+
replicas: 3,
|
|
215
|
+
image: {
|
|
216
|
+
repository: 'nginx',
|
|
217
|
+
tag: 'latest',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Add Deployment with type-safe helpers
|
|
223
|
+
chart.addManifest(
|
|
224
|
+
{
|
|
225
|
+
apiVersion: 'apps/v1',
|
|
226
|
+
kind: 'Deployment',
|
|
227
|
+
metadata: {
|
|
228
|
+
name: helmInclude('chart.fullname', '.'),
|
|
229
|
+
labels: helmInclude('chart.labels', '.', { pipe: 'nindent 4' }),
|
|
230
|
+
},
|
|
231
|
+
spec: {
|
|
232
|
+
replicas: helm('{{ .Values.replicas }}'),
|
|
233
|
+
selector: {
|
|
234
|
+
matchLabels: helmInclude('chart.selectorLabels', '.', { pipe: 'nindent 6' }),
|
|
235
|
+
},
|
|
236
|
+
template: {
|
|
237
|
+
metadata: {
|
|
238
|
+
labels: helmInclude('chart.selectorLabels', '.', { pipe: 'nindent 8' }),
|
|
239
|
+
},
|
|
240
|
+
spec: {
|
|
241
|
+
containers: [
|
|
242
|
+
{
|
|
243
|
+
name: 'web',
|
|
244
|
+
image: helm('{{ .Values.image.repository }}:{{ .Values.image.tag }}'),
|
|
245
|
+
ports: [{ containerPort: 80, name: 'http' }],
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
'deployment',
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
// Generate the chart
|
|
256
|
+
chart.write('./dist');
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
import { UmbrellaChartTemplate } from 'timonel';
|
|
261
|
+
|
|
262
|
+
const umbrellaConfig = {
|
|
263
|
+
name: 'my-umbrella-app',
|
|
264
|
+
version: '1.0.0',
|
|
265
|
+
subcharts: [
|
|
266
|
+
{
|
|
267
|
+
name: 'frontend',
|
|
268
|
+
version: '1.0.0',
|
|
269
|
+
chart: frontendChartFunction,
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'backend',
|
|
273
|
+
version: '1.0.0',
|
|
274
|
+
chart: backendChartFunction,
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export const umbrella = new UmbrellaChartTemplate(umbrellaConfig);
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Timonel provides 9 composable, type-safe helpers for Helm template generation: `helmIf`,
|
|
283
|
+
`helmRange`, `helmWith`, `helmInclude`, `helmDefine`, `helmVar`, `helmBlock`, `helmComment`, and
|
|
284
|
+
`helmFragment`.
|
|
285
|
+
|
|
286
|
+
**Benefits:**
|
|
287
|
+
|
|
164
288
|
- ✅ 100% Type-Safe - catch errors at compile time
|
|
165
289
|
- ✅ No Raw Strings - eliminate manual template interpolation
|
|
166
290
|
- ✅ Composable - nest and combine helpers freely
|
package/dist/index.d.ts
CHANGED
|
@@ -12,5 +12,7 @@ export { DEFAULT_TERMINATION_GRACE_PERIOD, isValidDisruptionBudget, isValidKuber
|
|
|
12
12
|
export { AWS_HELPERS, createHelper, FILE_ACCESS_HELPERS, formatHelpers, generateHelpersTemplate, getDefaultHelpers, getHelpersByCategory, KUBERNETES_HELPERS, SPRIG_HELPERS, STANDARD_HELPERS, TEMPLATE_FUNCTION_HELPERS, type HelperDefinition, } from './lib/utils/helmHelpers.js';
|
|
13
13
|
export { createLogger, logger, LogLevel, TimonelLogger, type LogContext, type LoggerConfig, } from './lib/utils/logger.js';
|
|
14
14
|
export { UmbrellaRutter } from './lib/umbrellaRutter.js';
|
|
15
|
-
export { helmIf, helmRange, helmWith, helmInclude, helmDefine, helmVar, helmBlock, helmComment, helmFragment, createHelmExpression, isHelmConstruct, isHelmExpression, type HelmConstruct, type HelmExpression, type HelmContent, type HelmWhitespaceOptions, } from './lib/utils/helmControlStructures.js';
|
|
15
|
+
export { helmIf, helmIfSimple, helmRange, helmWith, helmInclude, helmDefine, helmVar, helmBlock, helmComment, helmFragment, createHelmExpression, isHelmConstruct, isHelmExpression, type HelmConstruct, type HelmExpression, type HelmContent, type HelmWhitespaceOptions, } from './lib/utils/helmControlStructures.js';
|
|
16
|
+
export { loadEnvVarsConfig, generateEnvVars, loadAndGenerateEnvVars, type EnvVarConfig, type LoadEnvVarsOptions, } from './lib/utils/envVarsLoader.js';
|
|
16
17
|
export { dumpHelmAwareYaml, validateHelmYaml, type HelmValidationError, type HelmValidationResult, } from './lib/utils/helmYamlSerializer.js';
|
|
18
|
+
export { valuesRef, isHelmValue, isHelmCondition, isHelmFieldConditional, isHelmRange, isHelmWith, serializeHelmValue, serializeHelmCondition, type HelmValue, type HelmCondition, type HelmFieldConditional, type HelmRange, type HelmWith, type HelmHelpers, } from './lib/utils/valuesRef.js';
|
package/dist/index.js
CHANGED
|
@@ -9,5 +9,7 @@ export { DEFAULT_TERMINATION_GRACE_PERIOD, isValidDisruptionBudget, isValidKuber
|
|
|
9
9
|
export { AWS_HELPERS, createHelper, FILE_ACCESS_HELPERS, formatHelpers, generateHelpersTemplate, getDefaultHelpers, getHelpersByCategory, KUBERNETES_HELPERS, SPRIG_HELPERS, STANDARD_HELPERS, TEMPLATE_FUNCTION_HELPERS, } from './lib/utils/helmHelpers.js';
|
|
10
10
|
export { createLogger, logger, LogLevel, TimonelLogger, } from './lib/utils/logger.js';
|
|
11
11
|
export { UmbrellaRutter } from './lib/umbrellaRutter.js';
|
|
12
|
-
export { helmIf, helmRange, helmWith, helmInclude, helmDefine, helmVar, helmBlock, helmComment, helmFragment, createHelmExpression, isHelmConstruct, isHelmExpression, } from './lib/utils/helmControlStructures.js';
|
|
12
|
+
export { helmIf, helmIfSimple, helmRange, helmWith, helmInclude, helmDefine, helmVar, helmBlock, helmComment, helmFragment, createHelmExpression, isHelmConstruct, isHelmExpression, } from './lib/utils/helmControlStructures.js';
|
|
13
|
+
export { loadEnvVarsConfig, generateEnvVars, loadAndGenerateEnvVars, } from './lib/utils/envVarsLoader.js';
|
|
13
14
|
export { dumpHelmAwareYaml, validateHelmYaml, } from './lib/utils/helmYamlSerializer.js';
|
|
15
|
+
export { valuesRef, isHelmValue, isHelmCondition, isHelmFieldConditional, isHelmRange, isHelmWith, serializeHelmValue, serializeHelmCondition, } from './lib/utils/valuesRef.js';
|
|
@@ -2,7 +2,7 @@ import * as fs from 'fs';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { SecurityUtils } from './security.js';
|
|
4
4
|
import { createLogger } from './utils/logger.js';
|
|
5
|
-
import { dumpHelmAwareYaml } from './utils/helmYamlSerializer.js';
|
|
5
|
+
import { dumpHelmAwareYaml, postProcessFieldConditionals } from './utils/helmYamlSerializer.js';
|
|
6
6
|
export class HelmChartWriter {
|
|
7
7
|
static write(opts) {
|
|
8
8
|
const { outDir, meta, defaultValues = {}, envValues = {}, assets, helpersTpl, notesTpl, valuesSchema, logger: customLogger, } = opts;
|
|
@@ -152,13 +152,15 @@ function writeSingleAssetFile(outDir, targetDir, directorySegments, fileBaseName
|
|
|
152
152
|
const filename = `${fileBaseName}.yaml`;
|
|
153
153
|
const absolutePath = path.join(chartSubdir, filename);
|
|
154
154
|
SecurityUtils.validatePath(absolutePath, outDir);
|
|
155
|
-
|
|
155
|
+
const processedYaml = postProcessFieldConditionals(yaml);
|
|
156
|
+
fs.writeFileSync(absolutePath, processedYaml.endsWith('\n') ? processedYaml : `${processedYaml}\n`);
|
|
156
157
|
}
|
|
157
158
|
function writeMultipleAssetFiles(outDir, targetDir, directorySegments, fileBaseName, yaml) {
|
|
158
159
|
const chartSubdir = path.join(outDir, targetDir, ...directorySegments);
|
|
159
160
|
SecurityUtils.validatePath(chartSubdir, outDir);
|
|
160
161
|
fs.mkdirSync(chartSubdir, { recursive: true });
|
|
161
|
-
const
|
|
162
|
+
const processedYaml = postProcessFieldConditionals(yaml);
|
|
163
|
+
const parts = splitDocs(processedYaml);
|
|
162
164
|
parts.forEach((doc, index) => {
|
|
163
165
|
const suffix = parts.length > 1 ? `-${index + 1}` : '';
|
|
164
166
|
const filename = `${fileBaseName}${suffix}.yaml`;
|
package/dist/lib/rutter.js
CHANGED
|
@@ -6,7 +6,7 @@ import { AWSResources } from './resources/cloud/aws/awsResources.js';
|
|
|
6
6
|
import { createLogger } from './utils/logger.js';
|
|
7
7
|
import { KarpenterResources } from './resources/cloud/aws/karpenterResources.js';
|
|
8
8
|
import { isHelmExpression, isHelmConstruct } from './utils/helmControlStructures.js';
|
|
9
|
-
import { dumpHelmAwareYaml } from './utils/helmYamlSerializer.js';
|
|
9
|
+
import { dumpHelmAwareYaml, preprocessHelmConstructs } from './utils/helmYamlSerializer.js';
|
|
10
10
|
import { generateHelpersTemplate } from './utils/helmHelpers.js';
|
|
11
11
|
export class Rutter {
|
|
12
12
|
constructor(props) {
|
|
@@ -77,11 +77,12 @@ export class Rutter {
|
|
|
77
77
|
throw new Error('addManifest() requires either a YAML string or an object');
|
|
78
78
|
}
|
|
79
79
|
this.validateManifestStructure(manifestObject);
|
|
80
|
+
const preprocessedManifest = preprocessHelmConstructs(manifestObject);
|
|
80
81
|
const apiObjectProps = {
|
|
81
|
-
apiVersion:
|
|
82
|
-
kind:
|
|
83
|
-
metadata:
|
|
84
|
-
...
|
|
82
|
+
apiVersion: preprocessedManifest.apiVersion,
|
|
83
|
+
kind: preprocessedManifest.kind,
|
|
84
|
+
metadata: preprocessedManifest.metadata,
|
|
85
|
+
...preprocessedManifest,
|
|
85
86
|
};
|
|
86
87
|
return new ApiObject(this.chart, id, apiObjectProps);
|
|
87
88
|
}
|
|
@@ -217,8 +218,9 @@ ${yamlContent.trim()}
|
|
|
217
218
|
operation: 'manifest_processing',
|
|
218
219
|
});
|
|
219
220
|
const enriched = manifestObjs.map((obj) => {
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
const preprocessed = preprocessHelmConstructs(obj);
|
|
222
|
+
if (preprocessed && typeof preprocessed === 'object') {
|
|
223
|
+
const o = preprocessed;
|
|
222
224
|
o.metadata = o.metadata ?? {};
|
|
223
225
|
o.metadata.labels = o.metadata.labels ?? {};
|
|
224
226
|
const labels = o.metadata.labels;
|
|
@@ -236,7 +238,7 @@ ${yamlContent.trim()}
|
|
|
236
238
|
}
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
|
-
return
|
|
241
|
+
return preprocessed;
|
|
240
242
|
});
|
|
241
243
|
const synthAssets = [];
|
|
242
244
|
if (this.props.singleManifestFile) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface EnvVarConfig {
|
|
2
|
+
name: string;
|
|
3
|
+
type: 'value' | 'secret';
|
|
4
|
+
scope?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
secretName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LoadEnvVarsOptions {
|
|
9
|
+
configPath?: string;
|
|
10
|
+
defaultScope?: string;
|
|
11
|
+
fallbackConfig?: EnvVarConfig[];
|
|
12
|
+
}
|
|
13
|
+
export declare function loadEnvVarsConfig(options?: LoadEnvVarsOptions): EnvVarConfig[];
|
|
14
|
+
export declare function generateEnvVars(config: EnvVarConfig[], options?: {
|
|
15
|
+
defaultScope?: string;
|
|
16
|
+
}): Array<Record<string, unknown>>;
|
|
17
|
+
export declare function loadAndGenerateEnvVars(options?: LoadEnvVarsOptions & {
|
|
18
|
+
defaultScope?: string;
|
|
19
|
+
}): Array<Record<string, unknown>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { createHelmExpression } from './helmControlStructures.js';
|
|
5
|
+
export function loadEnvVarsConfig(options = {}) {
|
|
6
|
+
const { configPath, fallbackConfig = [] } = options;
|
|
7
|
+
try {
|
|
8
|
+
if (configPath && existsSync(configPath)) {
|
|
9
|
+
const data = readFileSync(configPath, 'utf-8');
|
|
10
|
+
return configPath.endsWith('.yaml') || configPath.endsWith('.yml')
|
|
11
|
+
? parseYaml(data)
|
|
12
|
+
: JSON.parse(data);
|
|
13
|
+
}
|
|
14
|
+
const yamlPath = join(process.cwd(), 'env-config.yaml');
|
|
15
|
+
if (existsSync(yamlPath)) {
|
|
16
|
+
const data = readFileSync(yamlPath, 'utf-8');
|
|
17
|
+
return parseYaml(data);
|
|
18
|
+
}
|
|
19
|
+
const jsonPath = join(process.cwd(), 'env-config.json');
|
|
20
|
+
if (existsSync(jsonPath)) {
|
|
21
|
+
const data = readFileSync(jsonPath, 'utf-8');
|
|
22
|
+
return JSON.parse(data);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
}
|
|
27
|
+
return fallbackConfig;
|
|
28
|
+
}
|
|
29
|
+
export function generateEnvVars(config, options = {}) {
|
|
30
|
+
const { defaultScope = 'global.env' } = options;
|
|
31
|
+
return config.map((item) => {
|
|
32
|
+
const scope = item.scope || defaultScope;
|
|
33
|
+
if (item.type === 'value') {
|
|
34
|
+
return {
|
|
35
|
+
name: item.name,
|
|
36
|
+
value: createHelmExpression(`{{ .Values.${scope}.${item.name} | default "${item.defaultValue || ''}" }}`),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return {
|
|
41
|
+
name: item.name,
|
|
42
|
+
valueFrom: {
|
|
43
|
+
secretKeyRef: {
|
|
44
|
+
name: item.secretName || createHelmExpression('{{ .Values.secretName }}'),
|
|
45
|
+
key: item.name,
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function loadAndGenerateEnvVars(options = {}) {
|
|
54
|
+
const config = loadEnvVarsConfig(options);
|
|
55
|
+
const genOptions = options.defaultScope ? { defaultScope: options.defaultScope } : {};
|
|
56
|
+
return generateEnvVars(config, genOptions);
|
|
57
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export interface HelmConstruct {
|
|
2
2
|
__helmConstruct: true;
|
|
3
|
-
type: 'if' | 'range' | 'with' | 'include' | 'define' | 'var' | 'block' | 'comment' | 'fragment';
|
|
3
|
+
type: 'if' | 'range' | 'with' | 'include' | 'define' | 'var' | 'block' | 'comment' | 'fragment' | 'fieldConditional';
|
|
4
4
|
data: unknown;
|
|
5
|
-
options?:
|
|
6
|
-
trimLeft?: boolean;
|
|
7
|
-
trimRight?: boolean;
|
|
8
|
-
};
|
|
5
|
+
options?: HelmWhitespaceOptions;
|
|
9
6
|
}
|
|
10
7
|
export declare function helmFragment(...contents: HelmContent[]): HelmConstruct;
|
|
11
8
|
export interface HelmExpression {
|
|
@@ -29,6 +26,8 @@ export type HelmContent = string | number | boolean | null | undefined | HelmCon
|
|
|
29
26
|
export interface HelmWhitespaceOptions {
|
|
30
27
|
trimLeft?: boolean;
|
|
31
28
|
trimRight?: boolean;
|
|
29
|
+
inline?: boolean;
|
|
32
30
|
}
|
|
33
31
|
export declare function helmIf(condition: string, thenContent: HelmContent, elseContent?: HelmContent, options?: HelmWhitespaceOptions): HelmConstruct;
|
|
32
|
+
export declare function helmIfSimple(condition: string, thenContent: HelmContent, options?: HelmWhitespaceOptions): HelmConstruct;
|
|
34
33
|
export declare function isHelmConstruct(value: unknown): value is HelmConstruct;
|
|
@@ -104,6 +104,18 @@ export function helmIf(condition, thenContent, elseContent, options) {
|
|
|
104
104
|
...(options ? { options } : {}),
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
+
export function helmIfSimple(condition, thenContent, options) {
|
|
108
|
+
return {
|
|
109
|
+
__helmConstruct: true,
|
|
110
|
+
type: 'if',
|
|
111
|
+
data: {
|
|
112
|
+
condition,
|
|
113
|
+
then: thenContent,
|
|
114
|
+
else: undefined,
|
|
115
|
+
},
|
|
116
|
+
...(options ? { options } : {}),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
107
119
|
export function isHelmConstruct(value) {
|
|
108
120
|
return (typeof value === 'object' &&
|
|
109
121
|
value !== null &&
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export declare function preprocessHelmConstructs(obj: unknown): unknown;
|
|
1
2
|
export declare function dumpHelmAwareYaml(obj: unknown, options?: {
|
|
2
3
|
lineWidth?: number;
|
|
3
4
|
}): string;
|
|
5
|
+
export declare function postProcessFieldConditionals(yaml: string): string;
|
|
4
6
|
export declare function stringify(obj: unknown, options?: {
|
|
5
7
|
lineWidth?: number;
|
|
6
8
|
doubleQuotedAsJSON?: boolean;
|