@intentius/chant-lexicon-helm 0.49.0 → 0.51.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +25 -13
- package/dist/op/builders.d.ts +47 -0
- package/dist/op/builders.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +8 -0
- package/src/op/builders.test.ts +70 -0
- package/src/op/builders.ts +66 -0
- package/src/plugin.ts +50 -12
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { helmSerializer } from "./serializer.js";
|
|
|
2
2
|
export { helmPlugin } from "./plugin.js";
|
|
3
3
|
export { helmCapabilityPlugin, HELM_VERB_FAMILIES } from "./components/capability-plugin.js";
|
|
4
4
|
export { helmUpgradeCapability, createHelmUpgradeCapability, type HelmUpgradeInput, type HelmUpgradeOutcome } from "./components/helm-upgrade.js";
|
|
5
|
+
export { helmInstall, helmInstallPinned } from "./op/builders.js";
|
|
5
6
|
export { Chart, Values, ValuesOverride, HelmTest, HelmNotes, HelmHook, HelmDependency, HelmMaintainer, HelmCRD } from "./resources.js";
|
|
6
7
|
export { HelmRender, getHelmRenderRecords, clearHelmRenderRecords } from "./render.js";
|
|
7
8
|
export type { HelmRenderProps, HelmRenderRecord } from "./render.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,KAAK,gB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AkB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAIlG,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "a702d052f26168d598597b235ec4cb6441cc1fb4ad68aefc24227e6076ecd762",
|
|
5
5
|
"meta.json": "14243c5730a07c6a6edc35ddd351438547d58df5cf345f2233a355b0c7611ccc",
|
|
6
6
|
"types/index.d.ts": "5377696ca8698cd2999e4680feb8e8e4b54a7b49fb603a87b2f27356114d1794",
|
|
7
7
|
"rules/chart-metadata.ts": "8f3377e893d5e2828460b7fe5924fca098334245a9a2fdb90f6b67e490eaf091",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"skills/chant-helm-patterns.md": "9e79e6a46391da46709d8aa57e2825a7cd9eb981cd923f02ad60836c49b2561e",
|
|
37
37
|
"skills/chant-helm-security.md": "bfc367eabceed2e84f1cf94501b407df78aeed963cec104f24a321d0962063c9"
|
|
38
38
|
},
|
|
39
|
-
"composite": "
|
|
39
|
+
"composite": "4d09c2f23e9a06fe6472abbea195d9f7db144e196f14361aeef277cad453aa4f"
|
|
40
40
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "helm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"chantVersion": ">=0.1.0",
|
|
5
5
|
"namespace": "Helm",
|
|
6
6
|
"intrinsics": [
|
|
@@ -22,42 +22,50 @@
|
|
|
22
22
|
{
|
|
23
23
|
"name": "include",
|
|
24
24
|
"description": "Include a named template: {{ include \"name\" . }}",
|
|
25
|
-
"isTag": false
|
|
25
|
+
"isTag": false,
|
|
26
|
+
"foldsAsCall": true
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
"name": "required",
|
|
29
30
|
"description": "Require a value: {{ required \"msg\" .Values.x }}",
|
|
30
|
-
"isTag": false
|
|
31
|
+
"isTag": false,
|
|
32
|
+
"foldsAsCall": true
|
|
31
33
|
},
|
|
32
34
|
{
|
|
33
35
|
"name": "helmDefault",
|
|
34
36
|
"description": "Default value: {{ default \"def\" .Values.x }}",
|
|
35
|
-
"isTag": false
|
|
37
|
+
"isTag": false,
|
|
38
|
+
"foldsAsCall": true
|
|
36
39
|
},
|
|
37
40
|
{
|
|
38
41
|
"name": "toYaml",
|
|
39
42
|
"description": "Convert to YAML: {{ toYaml .Values.x | nindent N }}",
|
|
40
|
-
"isTag": false
|
|
43
|
+
"isTag": false,
|
|
44
|
+
"foldsAsCall": true
|
|
41
45
|
},
|
|
42
46
|
{
|
|
43
47
|
"name": "quote",
|
|
44
48
|
"description": "Quote a value: {{ .Values.x | quote }}",
|
|
45
|
-
"isTag": false
|
|
49
|
+
"isTag": false,
|
|
50
|
+
"foldsAsCall": true
|
|
46
51
|
},
|
|
47
52
|
{
|
|
48
53
|
"name": "printf",
|
|
49
54
|
"description": "Format string: {{ printf \"%s\" .Values.x }}",
|
|
50
|
-
"isTag": false
|
|
55
|
+
"isTag": false,
|
|
56
|
+
"foldsAsCall": true
|
|
51
57
|
},
|
|
52
58
|
{
|
|
53
59
|
"name": "tpl",
|
|
54
60
|
"description": "Evaluate template: {{ tpl .Values.x . }}",
|
|
55
|
-
"isTag": false
|
|
61
|
+
"isTag": false,
|
|
62
|
+
"foldsAsCall": true
|
|
56
63
|
},
|
|
57
64
|
{
|
|
58
65
|
"name": "lookup",
|
|
59
66
|
"description": "Lookup resource: {{ lookup \"v1\" \"Secret\" \"ns\" \"name\" }}",
|
|
60
|
-
"isTag": false
|
|
67
|
+
"isTag": false,
|
|
68
|
+
"foldsAsCall": true
|
|
61
69
|
},
|
|
62
70
|
{
|
|
63
71
|
"name": "Capabilities",
|
|
@@ -72,22 +80,26 @@
|
|
|
72
80
|
{
|
|
73
81
|
"name": "filesGet",
|
|
74
82
|
"description": ".Files.Get: {{ .Files.Get \"path\" }}",
|
|
75
|
-
"isTag": false
|
|
83
|
+
"isTag": false,
|
|
84
|
+
"foldsAsCall": true
|
|
76
85
|
},
|
|
77
86
|
{
|
|
78
87
|
"name": "filesGlob",
|
|
79
88
|
"description": ".Files.Glob: {{ .Files.Glob \"pattern\" }}",
|
|
80
|
-
"isTag": false
|
|
89
|
+
"isTag": false,
|
|
90
|
+
"foldsAsCall": true
|
|
81
91
|
},
|
|
82
92
|
{
|
|
83
93
|
"name": "filesAsConfig",
|
|
84
94
|
"description": ".Files.Glob.AsConfig for ConfigMap data",
|
|
85
|
-
"isTag": false
|
|
95
|
+
"isTag": false,
|
|
96
|
+
"foldsAsCall": true
|
|
86
97
|
},
|
|
87
98
|
{
|
|
88
99
|
"name": "filesAsSecrets",
|
|
89
100
|
"description": ".Files.Glob.AsSecrets for Secret data",
|
|
90
|
-
"isTag": false
|
|
101
|
+
"isTag": false,
|
|
102
|
+
"foldsAsCall": true
|
|
91
103
|
},
|
|
92
104
|
{
|
|
93
105
|
"name": "ElseIf",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed step-builder wrappers for this lexicon's `helmInstall` activity
|
|
3
|
+
* (chant #1288 Stage 2 — "regenerate the step builders as fully typed
|
|
4
|
+
* wrappers"). Core cannot import a lexicon's `*Args` types (lexicons depend
|
|
5
|
+
* on core, not the other way around), so a fully typed `helmInstall` /
|
|
6
|
+
* `helmInstallPinned` has to live beside {@link HelmInstallArgs} — here,
|
|
7
|
+
* next to `./activities/helm.ts`. `opts`'s type in each wrapper below IS
|
|
8
|
+
* `HelmInstallArgs` itself (via `Omit`/`WithStepRefs`) — never a
|
|
9
|
+
* hand-restated mirror — so the option surface Stage 1's zod contracts
|
|
10
|
+
* deliberately skipped (`capabilityProfile`, `set`, `deleteMode`-adjacent
|
|
11
|
+
* cross-field options) is authoring-time typed for free.
|
|
12
|
+
*
|
|
13
|
+
* Every field also accepts a {@link StepOutputRef} in its place
|
|
14
|
+
* ({@link WithStepRefs}, chant #1950).
|
|
15
|
+
*
|
|
16
|
+
* `core`'s own `helmInstall`/`helmInstallPinned` (in `@intentius/chant/op`,
|
|
17
|
+
* re-exported from `@intentius/chant-lexicon-temporal`) are UNCHANGED and
|
|
18
|
+
* produce byte-identical `ActivityStep` output for the same inputs — these
|
|
19
|
+
* are purely additive. Deliberately not swapped into the temporal barrel
|
|
20
|
+
* (see `lexicons/k8s/src/op/builders.ts`'s module doc for why: it would make
|
|
21
|
+
* temporal depend on this package at runtime, undoing the product-agnostic
|
|
22
|
+
* split #809 did). An author who wants the typed surface imports it from
|
|
23
|
+
* here — `@intentius/chant-lexicon-helm` — which a project using
|
|
24
|
+
* `helmInstall` already depends on.
|
|
25
|
+
*/
|
|
26
|
+
import { type ActivityStep, type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
|
|
27
|
+
import type { HelmInstallArgs } from "./activities/helm.js";
|
|
28
|
+
/** Extra opts every wrapper below accepts alongside its activity's own fields. */
|
|
29
|
+
type StepOpts = {
|
|
30
|
+
profile?: ActivityStep["profile"];
|
|
31
|
+
id?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Deploy a helm release — the fully typed twin of core's `helmInstall`.
|
|
35
|
+
* `opts` is {@link HelmInstallArgs} itself, minus the positional `name`/
|
|
36
|
+
* `chart`. Defaults to the `longInfra` profile.
|
|
37
|
+
*/
|
|
38
|
+
export declare const helmInstall: (name: string, chart: string, opts?: WithStepRefs<Omit<HelmInstallArgs, "name" | "chart">> & StepOpts) => NamedActivityStep;
|
|
39
|
+
/**
|
|
40
|
+
* Deploy a recorded pinned render by its `sha256:` content digest (#1242) —
|
|
41
|
+
* the fully typed twin of core's `helmInstallPinned`. `opts` is
|
|
42
|
+
* {@link HelmInstallArgs} itself, minus the positional `name`/
|
|
43
|
+
* `contentDigest`. Defaults to the `longInfra` profile.
|
|
44
|
+
*/
|
|
45
|
+
export declare const helmInstallPinned: (name: string, contentDigest: string, opts?: WithStepRefs<Omit<HelmInstallArgs, "name" | "contentDigest">> & StepOpts) => NamedActivityStep;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,kFAAkF;AAClF,KAAK,QAAQ,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,OAAO,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,QAAQ,KACtE,iBAGF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,QAAQ,KAC9E,iBAGF,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAiB7F,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAiB7F,eAAO,MAAM,UAAU,EAAE,aAqcxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-helm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/js-yaml": "^4.0.9"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@intentius/chant": "^0.
|
|
89
|
+
"@intentius/chant": "^0.51.0",
|
|
90
90
|
"typescript": "^5.9.3",
|
|
91
91
|
"zod": "^4.3.6"
|
|
92
92
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,14 @@ export { helmPlugin } from "./plugin";
|
|
|
10
10
|
export { helmCapabilityPlugin, HELM_VERB_FAMILIES } from "./components/capability-plugin";
|
|
11
11
|
export { helmUpgradeCapability, createHelmUpgradeCapability, type HelmUpgradeInput, type HelmUpgradeOutcome } from "./components/helm-upgrade";
|
|
12
12
|
|
|
13
|
+
// Typed Op step-builder wrappers (chant #1288 Stage 2) — helmInstall/
|
|
14
|
+
// helmInstallPinned with authoring-time types derived from this lexicon's
|
|
15
|
+
// own HelmInstallArgs (see ./op/builders.ts's module doc for why these live
|
|
16
|
+
// here rather than in core or the temporal barrel). Opt-in:
|
|
17
|
+
// `@intentius/chant-lexicon-temporal`'s same-named exports are core's
|
|
18
|
+
// original untyped builders, unchanged, for cloud-agnostic authoring.
|
|
19
|
+
export { helmInstall, helmInstallPinned } from "./op/builders";
|
|
20
|
+
|
|
13
21
|
// Resources
|
|
14
22
|
export { Chart, Values, ValuesOverride, HelmTest, HelmNotes, HelmHook, HelmDependency, HelmMaintainer, HelmCRD } from "./resources";
|
|
15
23
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed step-builder wrappers (chant #1288 Stage 2) — see
|
|
3
|
+
* `lexicons/k8s/src/op/builders.test.ts`'s module doc for what's asserted
|
|
4
|
+
* and why (backward compat against core's original, step-output-ref
|
|
5
|
+
* composition, compile-time-only `@ts-expect-error` checks walked by
|
|
6
|
+
* `npm run typecheck`).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { describe, test, expect } from "vitest";
|
|
10
|
+
import {
|
|
11
|
+
helmInstall as helmInstallOld,
|
|
12
|
+
helmInstallPinned as helmInstallPinnedOld,
|
|
13
|
+
stepOutput,
|
|
14
|
+
type StepOutputRef,
|
|
15
|
+
} from "@intentius/chant/op";
|
|
16
|
+
import { helmInstall, helmInstallPinned } from "./builders";
|
|
17
|
+
|
|
18
|
+
describe("helm typed step builders (#1288 Stage 2)", () => {
|
|
19
|
+
test("helmInstall: identical ActivityStep to core's original for a minimal call", () => {
|
|
20
|
+
expect(helmInstall("api", "./chart")).toEqual(helmInstallOld("api", "./chart"));
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("helmInstall: identical ActivityStep with opts (namespace, values, set, capabilityProfile)", () => {
|
|
24
|
+
const opts = {
|
|
25
|
+
namespace: "prod",
|
|
26
|
+
values: "values.yaml",
|
|
27
|
+
set: { "image.tag": "v2" },
|
|
28
|
+
capabilityProfile: { kubeVersion: "1.29" },
|
|
29
|
+
profile: "fastIdempotent" as const,
|
|
30
|
+
};
|
|
31
|
+
expect(helmInstall("api", "./chart", opts)).toEqual(helmInstallOld("api", "./chart", opts));
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("helmInstallPinned: identical ActivityStep to core's original", () => {
|
|
35
|
+
const opts = { namespace: "prod" };
|
|
36
|
+
expect(helmInstallPinned("api", "sha256:abc", opts)).toEqual(helmInstallPinnedOld("api", "sha256:abc", opts));
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("helmInstall: accepts a StepOutputRef in a typed slot", () => {
|
|
40
|
+
const ref = stepOutput("render-step", "namespace");
|
|
41
|
+
const step = helmInstall("api", "./chart", { namespace: ref });
|
|
42
|
+
expect(step.args?.namespace).toBe(ref);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("helmInstall: .out is reachable when an id is given", () => {
|
|
46
|
+
const step = helmInstall("api", "./chart", { id: "deploy" });
|
|
47
|
+
const ref: StepOutputRef = step.out.releaseName;
|
|
48
|
+
expect(ref.step).toBe("deploy");
|
|
49
|
+
expect(ref.path).toBe("releaseName");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// ── Compile-time-only: authoring-time type errors (never executed) ──────────
|
|
54
|
+
function _typeChecksOnly(): void {
|
|
55
|
+
// @ts-expect-error — "nameSpace" is not a key of HelmInstallArgs (the exact
|
|
56
|
+
// typo class chant #1288 names: helmInstall("api", "./chart", { nameSpace:
|
|
57
|
+
// "prod" }) silently no-opped before this).
|
|
58
|
+
helmInstall("api", "./chart", { nameSpace: "prod" });
|
|
59
|
+
|
|
60
|
+
// @ts-expect-error — set's values must be strings, not numbers.
|
|
61
|
+
helmInstall("api", "./chart", { set: { replicas: 3 } });
|
|
62
|
+
|
|
63
|
+
// @ts-expect-error — overrideProfileAssertion must be boolean.
|
|
64
|
+
helmInstall("api", "./chart", { overrideProfileAssertion: "true" });
|
|
65
|
+
|
|
66
|
+
// @ts-expect-error — contentDigest must be a string (the `sha256:...`
|
|
67
|
+
// digest), not a number.
|
|
68
|
+
helmInstall("api", "./chart", { contentDigest: 5 });
|
|
69
|
+
}
|
|
70
|
+
void _typeChecksOnly;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed step-builder wrappers for this lexicon's `helmInstall` activity
|
|
3
|
+
* (chant #1288 Stage 2 — "regenerate the step builders as fully typed
|
|
4
|
+
* wrappers"). Core cannot import a lexicon's `*Args` types (lexicons depend
|
|
5
|
+
* on core, not the other way around), so a fully typed `helmInstall` /
|
|
6
|
+
* `helmInstallPinned` has to live beside {@link HelmInstallArgs} — here,
|
|
7
|
+
* next to `./activities/helm.ts`. `opts`'s type in each wrapper below IS
|
|
8
|
+
* `HelmInstallArgs` itself (via `Omit`/`WithStepRefs`) — never a
|
|
9
|
+
* hand-restated mirror — so the option surface Stage 1's zod contracts
|
|
10
|
+
* deliberately skipped (`capabilityProfile`, `set`, `deleteMode`-adjacent
|
|
11
|
+
* cross-field options) is authoring-time typed for free.
|
|
12
|
+
*
|
|
13
|
+
* Every field also accepts a {@link StepOutputRef} in its place
|
|
14
|
+
* ({@link WithStepRefs}, chant #1950).
|
|
15
|
+
*
|
|
16
|
+
* `core`'s own `helmInstall`/`helmInstallPinned` (in `@intentius/chant/op`,
|
|
17
|
+
* re-exported from `@intentius/chant-lexicon-temporal`) are UNCHANGED and
|
|
18
|
+
* produce byte-identical `ActivityStep` output for the same inputs — these
|
|
19
|
+
* are purely additive. Deliberately not swapped into the temporal barrel
|
|
20
|
+
* (see `lexicons/k8s/src/op/builders.ts`'s module doc for why: it would make
|
|
21
|
+
* temporal depend on this package at runtime, undoing the product-agnostic
|
|
22
|
+
* split #809 did). An author who wants the typed surface imports it from
|
|
23
|
+
* here — `@intentius/chant-lexicon-helm` — which a project using
|
|
24
|
+
* `helmInstall` already depends on.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
activity,
|
|
29
|
+
takeProfileAndId,
|
|
30
|
+
type ActivityStep,
|
|
31
|
+
type NamedActivityStep,
|
|
32
|
+
type WithStepRefs,
|
|
33
|
+
} from "@intentius/chant/op";
|
|
34
|
+
import type { HelmInstallArgs } from "./activities/helm";
|
|
35
|
+
|
|
36
|
+
/** Extra opts every wrapper below accepts alongside its activity's own fields. */
|
|
37
|
+
type StepOpts = { profile?: ActivityStep["profile"]; id?: string };
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Deploy a helm release — the fully typed twin of core's `helmInstall`.
|
|
41
|
+
* `opts` is {@link HelmInstallArgs} itself, minus the positional `name`/
|
|
42
|
+
* `chart`. Defaults to the `longInfra` profile.
|
|
43
|
+
*/
|
|
44
|
+
export const helmInstall = (
|
|
45
|
+
name: string,
|
|
46
|
+
chart: string,
|
|
47
|
+
opts?: WithStepRefs<Omit<HelmInstallArgs, "name" | "chart">> & StepOpts,
|
|
48
|
+
): NamedActivityStep => {
|
|
49
|
+
const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown> | undefined);
|
|
50
|
+
return activity("helmInstall", { name, chart, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Deploy a recorded pinned render by its `sha256:` content digest (#1242) —
|
|
55
|
+
* the fully typed twin of core's `helmInstallPinned`. `opts` is
|
|
56
|
+
* {@link HelmInstallArgs} itself, minus the positional `name`/
|
|
57
|
+
* `contentDigest`. Defaults to the `longInfra` profile.
|
|
58
|
+
*/
|
|
59
|
+
export const helmInstallPinned = (
|
|
60
|
+
name: string,
|
|
61
|
+
contentDigest: string,
|
|
62
|
+
opts?: WithStepRefs<Omit<HelmInstallArgs, "name" | "contentDigest">> & StepOpts,
|
|
63
|
+
): NamedActivityStep => {
|
|
64
|
+
const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown> | undefined);
|
|
65
|
+
return activity("helmInstall", { name, contentDigest, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
|
|
66
|
+
};
|
package/src/plugin.ts
CHANGED
|
@@ -62,25 +62,63 @@ export const helmPlugin: LexiconPlugin = {
|
|
|
62
62
|
completionProvider: helmCompletions,
|
|
63
63
|
hoverProvider: helmHover,
|
|
64
64
|
|
|
65
|
+
// chant #1174 — `foldsAsCall: true` opts an intrinsic's PLAIN-CALL form
|
|
66
|
+
// into `chant build --fold` (chant #1044's mechanism, previously unused by
|
|
67
|
+
// this lexicon: every helm intrinsic is a plain call — helm has no tagged
|
|
68
|
+
// templates at all — so before this PR NONE of them folded, and a single
|
|
69
|
+
// `include(...)`/`printf(...)` anywhere in a chart's resources forced the
|
|
70
|
+
// whole file back to the run path).
|
|
71
|
+
//
|
|
72
|
+
// Audited one at a time against `IntrinsicDef.foldsAsCall`'s criterion
|
|
73
|
+
// (../../../packages/core/src/lexicon.ts): "calling the intrinsic is a
|
|
74
|
+
// pure function of its arguments that builds a deterministic data
|
|
75
|
+
// envelope". Every function below (`include`/`required`/`helmDefault`/
|
|
76
|
+
// `toYaml`/`quote`/`printf`/`tpl`/`lookup`/`filesGet`/`filesGlob`/
|
|
77
|
+
// `filesAsConfig`/`filesAsSecrets`, ./intrinsics.ts) does exactly that: it
|
|
78
|
+
// builds a `HelmTpl` (or, for `lookup`, a string) by interpolating its
|
|
79
|
+
// arguments into a Go template expression string — no I/O, no mutation, no
|
|
80
|
+
// dependency on anything but the arguments. `lookup`'s own side effect
|
|
81
|
+
// (a live cluster read) happens when HELM renders the resulting template
|
|
82
|
+
// at deploy time, not when this JS function runs at `chant build` time, so
|
|
83
|
+
// it is just as pure here as the rest.
|
|
84
|
+
//
|
|
85
|
+
// Left OUT, each for a specific reason rather than an oversight:
|
|
86
|
+
// - `values`/`Release`/`ChartRef`/`Capabilities`/`Template` are proxy
|
|
87
|
+
// OBJECTS, never called (`values(...)` isn't valid source) — nothing
|
|
88
|
+
// to opt in.
|
|
89
|
+
// - `withOrder`/`argoWave` return a PLAIN record meant to be spread
|
|
90
|
+
// (`{...withOrder(1)}`), not a `HelmTpl`. `fold()`'s object-spread
|
|
91
|
+
// handling (`Object.assign(obj, src)`, ../fold/fold.ts) runs
|
|
92
|
+
// SYNCHRONOUSLY on the immediately-folded value, before the async
|
|
93
|
+
// revival that would turn a folded call into its real result — opting
|
|
94
|
+
// these in would spread the folded `{__intrinsic, args}` envelope's
|
|
95
|
+
// own keys into the object instead of the real record. A real
|
|
96
|
+
// soundness hazard, not a "not yet audited."
|
|
97
|
+
// - `If`/`ElseIf`/`Range`/`With` take an arbitrary `body`/`elseBody`
|
|
98
|
+
// that is often an arrow function (`Range(list, (item) => ({...}))`)
|
|
99
|
+
// or a nested Declarable — `fold()` already rejects a function used as
|
|
100
|
+
// a value on its own terms, so opting these in buys nothing measured
|
|
101
|
+
// on this corpus and is left for a future PR to size against real
|
|
102
|
+
// usage rather than widened on speculation.
|
|
65
103
|
intrinsics(): IntrinsicDef[] {
|
|
66
104
|
return [
|
|
67
105
|
{ name: "values", description: "Proxy accessor for {{ .Values.x }} references", isTag: false },
|
|
68
106
|
{ name: "Release", description: "Built-in Release object (Name, Namespace, etc.)", isTag: false },
|
|
69
107
|
{ name: "ChartRef", description: "Built-in Chart object (Name, Version, AppVersion)", isTag: false },
|
|
70
|
-
{ name: "include", description: 'Include a named template: {{ include "name" . }}', isTag: false },
|
|
71
|
-
{ name: "required", description: 'Require a value: {{ required "msg" .Values.x }}', isTag: false },
|
|
72
|
-
{ name: "helmDefault", description: 'Default value: {{ default "def" .Values.x }}', isTag: false },
|
|
73
|
-
{ name: "toYaml", description: "Convert to YAML: {{ toYaml .Values.x | nindent N }}", isTag: false },
|
|
74
|
-
{ name: "quote", description: "Quote a value: {{ .Values.x | quote }}", isTag: false },
|
|
75
|
-
{ name: "printf", description: 'Format string: {{ printf "%s" .Values.x }}', isTag: false },
|
|
76
|
-
{ name: "tpl", description: "Evaluate template: {{ tpl .Values.x . }}", isTag: false },
|
|
77
|
-
{ name: "lookup", description: 'Lookup resource: {{ lookup "v1" "Secret" "ns" "name" }}', isTag: false },
|
|
108
|
+
{ name: "include", description: 'Include a named template: {{ include "name" . }}', isTag: false, foldsAsCall: true },
|
|
109
|
+
{ name: "required", description: 'Require a value: {{ required "msg" .Values.x }}', isTag: false, foldsAsCall: true },
|
|
110
|
+
{ name: "helmDefault", description: 'Default value: {{ default "def" .Values.x }}', isTag: false, foldsAsCall: true },
|
|
111
|
+
{ name: "toYaml", description: "Convert to YAML: {{ toYaml .Values.x | nindent N }}", isTag: false, foldsAsCall: true },
|
|
112
|
+
{ name: "quote", description: "Quote a value: {{ .Values.x | quote }}", isTag: false, foldsAsCall: true },
|
|
113
|
+
{ name: "printf", description: 'Format string: {{ printf "%s" .Values.x }}', isTag: false, foldsAsCall: true },
|
|
114
|
+
{ name: "tpl", description: "Evaluate template: {{ tpl .Values.x . }}", isTag: false, foldsAsCall: true },
|
|
115
|
+
{ name: "lookup", description: 'Lookup resource: {{ lookup "v1" "Secret" "ns" "name" }}', isTag: false, foldsAsCall: true },
|
|
78
116
|
{ name: "Capabilities", description: "Built-in Capabilities object (KubeVersion, APIVersions, HelmVersion)", isTag: false },
|
|
79
117
|
{ name: "Template", description: "Built-in Template object (Name, BasePath)", isTag: false },
|
|
80
|
-
{ name: "filesGet", description: '.Files.Get: {{ .Files.Get "path" }}', isTag: false },
|
|
81
|
-
{ name: "filesGlob", description: '.Files.Glob: {{ .Files.Glob "pattern" }}', isTag: false },
|
|
82
|
-
{ name: "filesAsConfig", description: ".Files.Glob.AsConfig for ConfigMap data", isTag: false },
|
|
83
|
-
{ name: "filesAsSecrets", description: ".Files.Glob.AsSecrets for Secret data", isTag: false },
|
|
118
|
+
{ name: "filesGet", description: '.Files.Get: {{ .Files.Get "path" }}', isTag: false, foldsAsCall: true },
|
|
119
|
+
{ name: "filesGlob", description: '.Files.Glob: {{ .Files.Glob "pattern" }}', isTag: false, foldsAsCall: true },
|
|
120
|
+
{ name: "filesAsConfig", description: ".Files.Glob.AsConfig for ConfigMap data", isTag: false, foldsAsCall: true },
|
|
121
|
+
{ name: "filesAsSecrets", description: ".Files.Glob.AsSecrets for Secret data", isTag: false, foldsAsCall: true },
|
|
84
122
|
{ name: "ElseIf", description: "Else-if chaining: {{- else if .Values.x }}...{{- end }}", isTag: false },
|
|
85
123
|
{ name: "If", description: "Conditional: {{- if .Values.x }}...{{- end }}", isTag: false },
|
|
86
124
|
{ name: "Range", description: "Range loop: {{- range .Values.x }}...{{- end }}", isTag: false },
|