@intentius/chant-lexicon-helm 0.44.14 → 0.46.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2FH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0W9E"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2FH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB9E"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "0db05c4aafd206c5847a8914068bcdbc20de79eea85907be5d61ac9b098f67aa",
4
+ "manifest.json": "08be69a5f2086ed05c3f644d996e0ce9067d64ae786d815d2058ec40631082e4",
5
5
  "meta.json": "14243c5730a07c6a6edc35ddd351438547d58df5cf345f2233a355b0c7611ccc",
6
6
  "types/index.d.ts": "5377696ca8698cd2999e4680feb8e8e4b54a7b49fb603a87b2f27356114d1794",
7
7
  "rules/chart-metadata.ts": "8f3377e893d5e2828460b7fe5924fca098334245a9a2fdb90f6b67e490eaf091",
@@ -34,5 +34,5 @@
34
34
  "skills/chant-helm-patterns.md": "9e79e6a46391da46709d8aa57e2825a7cd9eb981cd923f02ad60836c49b2561e",
35
35
  "skills/chant-helm-security.md": "bfc367eabceed2e84f1cf94501b407df78aeed963cec104f24a321d0962063c9"
36
36
  },
37
- "composite": "6b1b6079175c83ebeca41d5939ae36e916ba9e9181476cf41084589a45d43e37"
37
+ "composite": "5e85ad5af932889cb581afbbc2a582f549037dea29d05bfb88f8de434b8bb4c7"
38
38
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helm",
3
- "version": "0.44.14",
3
+ "version": "0.46.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Helm",
6
6
  "intrinsics": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-helm",
3
- "version": "0.44.14",
3
+ "version": "0.46.0",
4
4
  "description": "Helm chart lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -81,7 +81,7 @@
81
81
  "@types/js-yaml": "^4.0.9"
82
82
  },
83
83
  "peerDependencies": {
84
- "@intentius/chant": "^0.44.14",
84
+ "@intentius/chant": "^0.46.0",
85
85
  "typescript": "^5.9.3"
86
86
  }
87
87
  }
@@ -106,347 +106,10 @@ export async function generateDocs(opts?: { verbose?: boolean }): Promise<void>
106
106
  overview,
107
107
  outputFormat,
108
108
  serviceFromType,
109
- // `lint-rules` below is helm's rules documentation; the generated `rules`
110
- // table duplicated it, and helm's own declared rules page was being
111
- // silently overwritten by that table (#1312).
109
+ // `lint-rules` under docs/pages/ is helm's rules documentation; the
110
+ // generated `rules` table duplicated it, and helm's own declared rules
111
+ // page was being silently overwritten by that table (#1312).
112
112
  suppressPages: ["pseudo-parameters"],
113
- // Hand-written pages under docs/src/content/docs/ that no sidebar entry
114
- // pointed at.
115
- sidebarExtra: [
116
- { label: "Helm Concepts", slug: "helm-concepts" },
117
- { label: "Lint Rules", slug: "lint-rules" },
118
- { label: "Examples", slug: "examples" },
119
- ],
120
- extraPages: [
121
- {
122
- slug: "getting-started",
123
- title: "Getting Started",
124
- description: "Create your first typed Helm chart in 5 minutes",
125
- content: `## What is the Helm lexicon?
126
-
127
- The Helm lexicon extends chant to produce **real, parameterized Helm charts** from typed TypeScript. Unlike static manifest generators (like cdk8s's Helm output), the Helm lexicon generates:
128
-
129
- - \`{{ .Values.x }}\` template directives
130
- - \`values.yaml\` with typed defaults
131
- - \`values.schema.json\` for validation
132
- - Conditional resources via \`{{- if }}\`
133
- - Standard \`_helpers.tpl\`
134
- - Helm hooks and tests
135
-
136
- ## Install
137
-
138
- \`\`\`bash
139
- npm install --save-dev @intentius/chant @intentius/chant-lexicon-helm @intentius/chant-lexicon-k8s
140
- \`\`\`
141
-
142
- ## Your first chart
143
-
144
- \`\`\`bash
145
- chant init --lexicon helm
146
- \`\`\`
147
-
148
- This creates a scaffold with a Chart, Values, Deployment, and Service. Run \`chant build\` to produce a complete Helm chart directory.
149
-
150
- ## Key imports
151
-
152
- \`\`\`typescript
153
- // Resources
154
- import { Chart, Values, HelmNotes } from "@intentius/chant-lexicon-helm";
155
-
156
- // Intrinsics (produce Go template expressions)
157
- import { values, Release, include, printf, toYaml, If } from "@intentius/chant-lexicon-helm";
158
-
159
- // K8s resources
160
- import { Deployment, Service, Ingress } from "@intentius/chant-lexicon-k8s";
161
- \`\`\`
162
- `,
163
- },
164
- {
165
- slug: "intrinsics-guide",
166
- title: "Intrinsics Reference",
167
- description: "All Helm template intrinsics and how they map to Go template expressions",
168
- content: `## Values proxy
169
-
170
- \`\`\`typescript
171
- import { values } from "@intentius/chant-lexicon-helm";
172
-
173
- values.replicaCount // {{ .Values.replicaCount }}
174
- values.image.repository // {{ .Values.image.repository }}
175
- values.x.pipe("upper") // {{ .Values.x | upper }}
176
- \`\`\`
177
-
178
- ## Built-in objects
179
-
180
- \`\`\`typescript
181
- import { Release, ChartRef } from "@intentius/chant-lexicon-helm";
182
-
183
- Release.Name // {{ .Release.Name }}
184
- Release.Namespace // {{ .Release.Namespace }}
185
- Release.IsUpgrade // {{ .Release.IsUpgrade }}
186
- ChartRef.Name // {{ .Chart.Name }}
187
- ChartRef.Version // {{ .Chart.Version }}
188
- \`\`\`
189
-
190
- ## Template functions
191
-
192
- | Function | Output |
193
- |----------|--------|
194
- | \`include("name")\` | \`{{ include "name" . }}\` |
195
- | \`required("msg", values.x)\` | \`{{ required "msg" .Values.x }}\` |
196
- | \`helmDefault("val", values.x)\` | \`{{ default "val" .Values.x }}\` |
197
- | \`toYaml(values.x)\` | \`{{ toYaml .Values.x }}\` |
198
- | \`toYaml(values.x, 12)\` | \`{{ toYaml .Values.x \\| nindent 12 }}\` |
199
- | \`quote(values.x)\` | \`{{ .Values.x \\| quote }}\` |
200
- | \`printf("%s:%s", a, b)\` | \`{{ printf "%s:%s" a b }}\` |
201
- | \`tpl(values.x)\` | \`{{ tpl .Values.x . }}\` |
202
- | \`lookup("v1", "Secret", "ns", "name")\` | \`{{ lookup "v1" "Secret" "ns" "name" }}\` |
203
-
204
- ## Control flow
205
-
206
- \`\`\`typescript
207
- import { If, Range, With, values } from "@intentius/chant-lexicon-helm";
208
-
209
- // Conditional resource
210
- export const ingress = If(values.ingress.enabled, new Ingress({ ... }));
211
-
212
- // Conditional value
213
- const image = If(values.image.tag, printf("%s:%s", values.image.repo, values.image.tag));
214
- \`\`\`
215
-
216
- ## Resource ordering
217
-
218
- | Function | Output |
219
- |----------|--------|
220
- | \`withOrder(5)\` | \`helm.sh/hook: pre-install,pre-upgrade\` + \`helm.sh/hook-weight: "5"\` |
221
- | \`argoWave(2)\` | \`argocd.argoproj.io/sync-wave: "2"\` |
222
-
223
- \`\`\`typescript
224
- import { withOrder, argoWave } from "@intentius/chant-lexicon-helm";
225
-
226
- const job = new Job({
227
- metadata: { annotations: { ...withOrder(-5) } },
228
- // ...
229
- });
230
- \`\`\`
231
- `,
232
- },
233
- {
234
- slug: "composites",
235
- title: "Composites",
236
- description: "Pre-built Helm chart patterns",
237
- content: `When a composite call like these is assigned directly to a top-level \`export const\` — or destructured into a top-level export, e.g. \`export const { chart, values, deployment } = HelmWebApp({...})\` — it's one of the patterns [folding](/chant/concepts/typescript-as-data/#folded-vs-run) can reduce with no module execution (chant #1023). It still runs like any other call if it isn't a top-level export, or if its result is only reached through a nested value inside another resource's properties.
238
-
239
- ## Available composites
240
-
241
- | Composite | Description | Resources |
242
- |-----------|-------------|-----------|
243
- | \`HelmWebApp\` | Web application | Deployment, Service, Ingress?, HPA?, ServiceAccount? |
244
- | \`HelmStatefulService\` | Stateful workload | StatefulSet, headless Service, PVC |
245
- | \`HelmCronJob\` | Scheduled job | CronJob |
246
- | \`HelmMicroservice\` | Full microservice | Deployment, Service, Ingress?, HPA?, PDB?, ServiceAccount, ConfigMap? |
247
- | \`HelmLibrary\` | Library chart | Chart.yaml (type: library), _helpers.tpl |
248
- | \`HelmCRDLifecycle\` | Managed CRD lifecycle | Job (hook), ConfigMap, ServiceAccount, ClusterRole, ClusterRoleBinding |
249
- | \`HelmDaemonSet\` | Node-level workload | DaemonSet, ServiceAccount? |
250
- | \`HelmWorker\` | Background processor | Deployment (no Service), ServiceAccount, HPA?, PDB? |
251
- | \`HelmExternalSecret\` | Secret management | ExternalSecret CR (external-secrets.io) |
252
- | \`HelmBatchJob\` | One-shot batch job | Job, ServiceAccount?, Role?, RoleBinding? |
253
- | \`HelmMonitoredService\` | Service with monitoring | Deployment, Service, ServiceAccount?, ServiceMonitor, PrometheusRule? |
254
- | \`HelmSecureIngress\` | TLS ingress + cert-manager | Ingress, Certificate? |
255
- | \`HelmNamespaceEnv\` | Namespace environment | Namespace, ResourceQuota?, LimitRange?, NetworkPolicy? |
256
-
257
- ## Example
258
-
259
- \`\`\`typescript
260
- import { HelmWebApp } from "@intentius/chant-lexicon-helm";
261
-
262
- const result = HelmWebApp({
263
- name: "my-app",
264
- imageRepository: "myregistry/app",
265
- port: 3000,
266
- replicas: 3,
267
- ingress: true,
268
- autoscaling: true,
269
- });
270
-
271
- // result.chart, result.values, result.deployment, result.service, result.ingress, result.hpa
272
- \`\`\`
273
- `,
274
- },
275
- {
276
- slug: "security",
277
- title: "Security",
278
- description: "Security best practices and checks for Helm charts",
279
- content: `## Secret management
280
-
281
- Avoid inline secrets in Kubernetes Secret manifests. Use ExternalSecret or SealedSecret instead:
282
-
283
- \`\`\`typescript
284
- import { HelmExternalSecret } from "@intentius/chant-lexicon-helm";
285
-
286
- const { externalSecret, values } = HelmExternalSecret({
287
- name: "app-secrets",
288
- secretStoreName: "vault",
289
- data: {
290
- DB_PASSWORD: "secret/data/db-password",
291
- API_KEY: "secret/data/api-key",
292
- },
293
- });
294
- \`\`\`
295
-
296
- WHM407 warns when a \`kind: Secret\` template contains inline data values without an ExternalSecret or SealedSecret in the chart.
297
-
298
- ## Security context best practices
299
-
300
- Always set security context on pods and containers:
301
-
302
- \`\`\`typescript
303
- spec: {
304
- securityContext: {
305
- runAsNonRoot: true,
306
- runAsUser: 1000,
307
- },
308
- containers: [{
309
- securityContext: {
310
- readOnlyRootFilesystem: true,
311
- allowPrivilegeEscalation: false,
312
- },
313
- }],
314
- }
315
- \`\`\`
316
-
317
- ### Related checks
318
-
319
- | Check | Severity | Description |
320
- |-------|----------|-------------|
321
- | WHM401 | warning | Image uses :latest tag or no tag |
322
- | WHM402 | warning | runAsNonRoot not set |
323
- | WHM403 | info | readOnlyRootFilesystem not set |
324
- | WHM404 | error | privileged: true detected |
325
- | WHM405 | warning | Resource spec missing cpu/memory |
326
- | WHM406 | info | CRD lifecycle limitation |
327
- | WHM407 | warning | Secret with inline data |
328
-
329
- ## Image pinning
330
-
331
- Always pin container images to specific tags or digests:
332
-
333
- \`\`\`typescript
334
- // Bad — triggers WHM401
335
- image: "nginx:latest"
336
- image: "nginx"
337
-
338
- // Good
339
- image: printf("%s:%s", values.image.repository, values.image.tag)
340
- \`\`\`
341
-
342
- Set a specific default tag in your values:
343
-
344
- \`\`\`typescript
345
- const valuesSchema = new Values({
346
- image: {
347
- repository: "nginx",
348
- tag: "1.25.0", // Pinned version
349
- pullPolicy: "IfNotPresent",
350
- },
351
- });
352
- \`\`\`
353
- `,
354
- },
355
- {
356
- slug: "best-practices",
357
- title: "Best Practices",
358
- description: "Common patterns and recommendations for Helm charts with chant",
359
- content: `## CRD lifecycle
360
-
361
- Helm installs CRDs from the \`crds/\` directory but **never upgrades or deletes them**. For managed CRD lifecycle, use the \`HelmCRDLifecycle\` composite:
362
-
363
- \`\`\`typescript
364
- import { HelmCRDLifecycle } from "@intentius/chant-lexicon-helm";
365
-
366
- const lifecycle = HelmCRDLifecycle({
367
- name: "my-operator",
368
- crdContent: crdYaml,
369
- kubectlImage: "bitnami/kubectl",
370
- kubectlTag: "1.28",
371
- });
372
- \`\`\`
373
-
374
- This creates a Job-based hook that runs \`kubectl apply\` for CRDs during pre-install/pre-upgrade, with proper RBAC.
375
-
376
- ## Resource ordering
377
-
378
- Use \`withOrder()\` for Helm hook ordering and \`argoWave()\` for Argo CD sync waves:
379
-
380
- \`\`\`typescript
381
- import { withOrder, argoWave } from "@intentius/chant-lexicon-helm";
382
-
383
- // Helm hook ordering (lower weight = runs first)
384
- metadata: { annotations: { ...withOrder(-5) } }
385
-
386
- // Argo CD sync waves
387
- metadata: { annotations: { ...argoWave(1) } }
388
- \`\`\`
389
-
390
- ## Multi-environment values
391
-
392
- Structure your chant project with base values and environment overlays:
393
-
394
- \`\`\`
395
- src/
396
- chart.ts ← Base chart with shared values
397
- values-dev.yaml ← Override for dev
398
- values-staging.yaml ← Override for staging
399
- values-prod.yaml ← Override for production
400
- \`\`\`
401
-
402
- Use \`helm install -f values-prod.yaml\` to merge environment-specific values.
403
-
404
- ## List merge workaround
405
-
406
- Helm's strategic merge patch does not merge lists — it replaces them. Use map-of-maps instead:
407
-
408
- \`\`\`typescript
409
- // Instead of a list (hard to override per-environment)
410
- hosts: [{ host: "app.example.com" }]
411
-
412
- // Use a map-of-maps pattern
413
- hosts:
414
- primary:
415
- host: "app.example.com"
416
- paths: [{ path: "/", pathType: "Prefix" }]
417
- \`\`\`
418
-
419
- ## Unused values
420
-
421
- WHM501 detects values keys that are defined but never referenced in templates. This helps keep \`values.yaml\` clean and avoids confusion.
422
-
423
- ## Deprecated API versions
424
-
425
- WHM502 detects deprecated Kubernetes API versions (like \`extensions/v1beta1\` for Ingress) and suggests current replacements.
426
- `,
427
- },
428
- {
429
- slug: "skills",
430
- title: "AI Skills",
431
- description: "AI agent skills bundled with the Helm lexicon",
432
- content: `## What are skills?
433
-
434
- Skills are structured markdown documents bundled with a lexicon. When an AI agent works in a chant project, it discovers and loads relevant skills automatically — giving it operational knowledge about the Helm chart workflow.
435
-
436
- ## Bundled skill: chant-helm
437
-
438
- The \`chant-helm\` skill teaches AI agents how to:
439
-
440
- - Scaffold new Helm chart projects with \`chant init --lexicon helm\`
441
- - Use Helm intrinsics (values proxy, include, printf, toYaml, If/Range/With)
442
- - Build and validate charts with chant + helm CLI
443
- - Debug common issues (unbalanced braces, hardcoded images, missing metadata)
444
- - Use composites for common patterns (WebApp, Microservice, StatefulService)
445
-
446
- When you scaffold a new project with \`chant init --lexicon helm\`, the skill is installed to \`skills/chant-helm/SKILL.md\` for automatic discovery by Claude Code.
447
- `,
448
- },
449
- ],
450
113
  };
451
114
 
452
115
  const result = docsPipeline(config);