@intentius/chant 0.41.13 → 0.41.15
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/op/builders.d.ts +18 -6
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/meta/publish-metadata.test.ts +55 -0
- package/src/op/activity-registry.test.ts +10 -3
- package/src/op/builders.ts +18 -6
- package/src/yaml.test.ts +48 -0
- package/src/yaml.ts +16 -2
package/dist/op/builders.d.ts
CHANGED
|
@@ -58,16 +58,28 @@ export declare const shell: (cmd: string, opts?: {
|
|
|
58
58
|
/** Run `chant teardown` in the given project directory. Uses `longInfra` profile. */
|
|
59
59
|
export declare const teardown: (path: string) => ActivityStep;
|
|
60
60
|
/**
|
|
61
|
-
* Create a local k3d cluster (vanilla Kubernetes in Docker)
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
61
|
+
* Create a local k3d cluster (vanilla Kubernetes in Docker). Idempotent: skips
|
|
62
|
+
* creation if a cluster of the same name already exists. Defaults to the
|
|
63
|
+
* `longInfra` profile (creating a cluster may pull the k3s image); override via
|
|
64
|
+
* `opts.profile`.
|
|
65
|
+
*
|
|
66
|
+
* The implementation lives in the k3d lexicon (chant #1410) — the project's
|
|
67
|
+
* `chant.config.ts` must list `"k3d"` in `lexicons` for the activity to load.
|
|
68
|
+
* Unlike the upstream CLI, the activity leaves the caller's default kubeconfig
|
|
69
|
+
* and current context alone by default (chant #1411); pass
|
|
70
|
+
* `updateDefaultKubeconfig: true` / `switchCurrentContext: true` to opt back
|
|
71
|
+
* in. It resolves `{ context, kubeconfigPath? }` for reaching the cluster.
|
|
65
72
|
*
|
|
66
73
|
* `opts` accepts `servers`, `agents`, `image`, `ports` (e.g.
|
|
67
|
-
* `["8080:80@loadbalancer"]`), `registryCreate`, `configFile`,
|
|
74
|
+
* `["8080:80@loadbalancer"]`), `registryCreate`, `configFile`, `timeout`,
|
|
75
|
+
* `updateDefaultKubeconfig`, and `switchCurrentContext`.
|
|
68
76
|
*/
|
|
69
77
|
export declare const k3dUp: (name: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
70
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Delete a local k3d cluster. Defaults to the `fastIdempotent` profile
|
|
80
|
+
* (override via `opts.profile`). Implementation lives in the k3d lexicon
|
|
81
|
+
* (chant #1410) — requires `"k3d"` in the project's `lexicons`.
|
|
82
|
+
*/
|
|
71
83
|
export declare const k3dDown: (name: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
72
84
|
/**
|
|
73
85
|
* Boot a local Floci AWS emulator in Docker and point subsequent steps at it —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIjG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAEpE;AAED,mEAAmE;AACnE,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5B,eAAe,CAEjB;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CACtB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,GAChC,YAAY,CAOd;AAED,oFAAoF;AACpF,wBAAgB,IAAI,CAClB,UAAU,EAAE,MAAM,EAClB,I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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA2G/D;AAMD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASlE;AAiFD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CA8Eb;AA0GD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA2G/D;AAMD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASlE;AAiFD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CA8Eb;AA0GD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CAqGb;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAelD"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, test, expect } from "vitest";
|
|
2
|
+
import { readFileSync, readdirSync, existsSync } from "fs";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Every publishable package carries the identity block npm provenance
|
|
8
|
+
* validates at publish time.
|
|
9
|
+
*
|
|
10
|
+
* The k3d lexicon's first publish failed with E422: sigstore provenance
|
|
11
|
+
* checks `repository.url` against the repo the workflow ran from, and the
|
|
12
|
+
* newborn package.json had no `repository` at all — an error that surfaces
|
|
13
|
+
* only on the publish runner, after a release is already tagged, which is
|
|
14
|
+
* the most expensive place to learn a field is missing (chant-v0.41.14
|
|
15
|
+
* shipped 13 of 14 packages). The peer-deps guard next door exists for the
|
|
16
|
+
* same reason: a newborn package copies whichever fields its author
|
|
17
|
+
* remembered, and the registry's requirements are not in anyone's head.
|
|
18
|
+
*
|
|
19
|
+
* So: what provenance actually validates (repository.url), plus the fields
|
|
20
|
+
* whose absence makes a published page anonymous (license, description),
|
|
21
|
+
* checked per package, in CI, before any tag exists.
|
|
22
|
+
*/
|
|
23
|
+
const repoRoot = fileURLToPath(new URL("../../../../", import.meta.url));
|
|
24
|
+
const REPO_URL = "https://github.com/INTENTIUS/chant.git";
|
|
25
|
+
|
|
26
|
+
/** Every workspace package that publishes (publishConfig or not private). */
|
|
27
|
+
function publishablePackages(): Array<{ dir: string; pkg: Record<string, any> }> {
|
|
28
|
+
const out: Array<{ dir: string; pkg: Record<string, any> }> = [];
|
|
29
|
+
for (const parent of ["packages", "lexicons"]) {
|
|
30
|
+
const parentDir = join(repoRoot, parent);
|
|
31
|
+
if (!existsSync(parentDir)) continue;
|
|
32
|
+
for (const name of readdirSync(parentDir)) {
|
|
33
|
+
const p = join(parentDir, name, "package.json");
|
|
34
|
+
if (!existsSync(p)) continue;
|
|
35
|
+
const pkg = JSON.parse(readFileSync(p, "utf-8"));
|
|
36
|
+
if (pkg.private) continue;
|
|
37
|
+
out.push({ dir: join(parent, name), pkg });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
describe("publishable packages carry the identity provenance validates", () => {
|
|
44
|
+
test.each(publishablePackages().map((e) => [e.dir, e] as const))(
|
|
45
|
+
"%s has repository/license/description",
|
|
46
|
+
(_dir, entry) => {
|
|
47
|
+
const { dir, pkg } = entry;
|
|
48
|
+
expect(pkg.repository?.url, `${dir}: repository.url is what sigstore provenance checks`).toBe(REPO_URL);
|
|
49
|
+
expect(pkg.repository?.directory, `${dir}: repository.directory should name the package's home`).toBe(dir);
|
|
50
|
+
expect(pkg.license, `${dir}: license`).toBe("Apache-2.0");
|
|
51
|
+
expect(typeof pkg.description, `${dir}: description`).toBe("string");
|
|
52
|
+
expect((pkg.description ?? "").length, `${dir}: description is not empty`).toBeGreaterThan(0);
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
});
|
|
@@ -67,7 +67,7 @@ describe("loadActivities — multi-lexicon (#706)", () => {
|
|
|
67
67
|
expect(a.has("waitForStack")).toBe(true); // temporal base
|
|
68
68
|
expect(a.has("shellCmd")).toBe(true); // temporal base
|
|
69
69
|
expect(a.has("kubectlApply")).toBe(false); // relocated to k8s (#809)
|
|
70
|
-
expect(a.has("k3dUp")).toBe(false); // relocated to k8s (#809)
|
|
70
|
+
expect(a.has("k3dUp")).toBe(false); // relocated to k8s (#809), then k3d (#1410)
|
|
71
71
|
expect(a.has("gcpApply")).toBe(false); // relocated to gcp
|
|
72
72
|
expect(a.has("flociUp")).toBe(false); // relocated to aws
|
|
73
73
|
expect(a.has("azGroupEnsure")).toBe(false); // relocated to azure
|
|
@@ -79,12 +79,19 @@ describe("loadActivities — multi-lexicon (#706)", () => {
|
|
|
79
79
|
expect(a.has("waitForStack")).toBe(true); // base still loaded alongside
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
test("k8s lexicon contributes kubectl /
|
|
82
|
+
test("k8s lexicon contributes kubectl / argo activities (#809)", async () => {
|
|
83
83
|
const a = await loadActivities(["k8s"]);
|
|
84
84
|
expect(a.has("kubectlApply")).toBe(true);
|
|
85
|
+
expect(a.has("k3dUp")).toBe(false); // moved on to the k3d lexicon (#1410)
|
|
86
|
+
expect(a.has("k3dDown")).toBe(false); // moved on to the k3d lexicon (#1410)
|
|
87
|
+
expect(a.has("waitForArgoSync")).toBe(true);
|
|
88
|
+
expect(a.has("waitForStack")).toBe(true); // base still loaded alongside
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test("k3d lexicon contributes the local-cluster lifecycle (#1410)", async () => {
|
|
92
|
+
const a = await loadActivities(["k3d"]);
|
|
85
93
|
expect(a.has("k3dUp")).toBe(true);
|
|
86
94
|
expect(a.has("k3dDown")).toBe(true);
|
|
87
|
-
expect(a.has("waitForArgoSync")).toBe(true);
|
|
88
95
|
expect(a.has("waitForStack")).toBe(true); // base still loaded alongside
|
|
89
96
|
});
|
|
90
97
|
|
package/src/op/builders.ts
CHANGED
|
@@ -138,20 +138,32 @@ export const teardown = (path: string): ActivityStep =>
|
|
|
138
138
|
activity("chantTeardown", { path }, "longInfra");
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
* Create a local k3d cluster (vanilla Kubernetes in Docker)
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
141
|
+
* Create a local k3d cluster (vanilla Kubernetes in Docker). Idempotent: skips
|
|
142
|
+
* creation if a cluster of the same name already exists. Defaults to the
|
|
143
|
+
* `longInfra` profile (creating a cluster may pull the k3s image); override via
|
|
144
|
+
* `opts.profile`.
|
|
145
|
+
*
|
|
146
|
+
* The implementation lives in the k3d lexicon (chant #1410) — the project's
|
|
147
|
+
* `chant.config.ts` must list `"k3d"` in `lexicons` for the activity to load.
|
|
148
|
+
* Unlike the upstream CLI, the activity leaves the caller's default kubeconfig
|
|
149
|
+
* and current context alone by default (chant #1411); pass
|
|
150
|
+
* `updateDefaultKubeconfig: true` / `switchCurrentContext: true` to opt back
|
|
151
|
+
* in. It resolves `{ context, kubeconfigPath? }` for reaching the cluster.
|
|
145
152
|
*
|
|
146
153
|
* `opts` accepts `servers`, `agents`, `image`, `ports` (e.g.
|
|
147
|
-
* `["8080:80@loadbalancer"]`), `registryCreate`, `configFile`,
|
|
154
|
+
* `["8080:80@loadbalancer"]`), `registryCreate`, `configFile`, `timeout`,
|
|
155
|
+
* `updateDefaultKubeconfig`, and `switchCurrentContext`.
|
|
148
156
|
*/
|
|
149
157
|
export const k3dUp = (name: string, opts?: Record<string, unknown>): ActivityStep => {
|
|
150
158
|
const { args, profile } = takeProfile(opts);
|
|
151
159
|
return activity("k3dUp", { name, ...args }, profile ?? "longInfra");
|
|
152
160
|
};
|
|
153
161
|
|
|
154
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Delete a local k3d cluster. Defaults to the `fastIdempotent` profile
|
|
164
|
+
* (override via `opts.profile`). Implementation lives in the k3d lexicon
|
|
165
|
+
* (chant #1410) — requires `"k3d"` in the project's `lexicons`.
|
|
166
|
+
*/
|
|
155
167
|
export const k3dDown = (name: string, opts?: Record<string, unknown>): ActivityStep => {
|
|
156
168
|
const { args, profile } = takeProfile(opts);
|
|
157
169
|
return activity("k3dDown", { name, ...args }, profile ?? "fastIdempotent");
|
package/src/yaml.test.ts
CHANGED
|
@@ -243,6 +243,54 @@ describe("parseYAML block scalars (#910)", () => {
|
|
|
243
243
|
test("folded > folds line breaks to spaces, blank line to one newline", () => {
|
|
244
244
|
expect(parseYAML("msg: >\n a\n b\n\n c\n")).toEqual({ msg: "a b\nc\n" });
|
|
245
245
|
});
|
|
246
|
+
|
|
247
|
+
// #1482 — a block scalar as the sequence ITEM itself (`- |`), not as an
|
|
248
|
+
// item key's value. The header parsed as the literal string "|" and the
|
|
249
|
+
// body lines leaked upward: inside a container list, every key after
|
|
250
|
+
// `args:` — securityContext, even the following `containers:` — was
|
|
251
|
+
// hoisted to the document root, so the post-synth security checks read a
|
|
252
|
+
// manifest that had quietly lost the app containers.
|
|
253
|
+
test("literal | as a sequence item (#1482)", () => {
|
|
254
|
+
expect(parseYAML("args:\n - |\n set -eu\n echo done\n")).toEqual({
|
|
255
|
+
args: ["set -eu\necho done\n"],
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test("the #1482 shape: keys after a block-scalar arg stay on the item, and later keys stay nested", () => {
|
|
260
|
+
const doc = [
|
|
261
|
+
"spec:",
|
|
262
|
+
" initContainers:",
|
|
263
|
+
" - name: wait",
|
|
264
|
+
" args:",
|
|
265
|
+
" - |",
|
|
266
|
+
" line one",
|
|
267
|
+
" line two",
|
|
268
|
+
" securityContext:",
|
|
269
|
+
" runAsNonRoot: true",
|
|
270
|
+
" containers:",
|
|
271
|
+
" - name: app",
|
|
272
|
+
" image: x:1",
|
|
273
|
+
"",
|
|
274
|
+
].join("\n");
|
|
275
|
+
expect(parseYAML(doc)).toEqual({
|
|
276
|
+
spec: {
|
|
277
|
+
initContainers: [
|
|
278
|
+
{
|
|
279
|
+
name: "wait",
|
|
280
|
+
args: ["line one\nline two\n"],
|
|
281
|
+
securityContext: { runAsNonRoot: true },
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
containers: [{ name: "app", image: "x:1" }],
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
test("folded >- as a sequence item strips the trailing newline", () => {
|
|
290
|
+
expect(parseYAML("cmds:\n - >-\n a\n b\n - plain\n")).toEqual({
|
|
291
|
+
cmds: ["a b", "plain"],
|
|
292
|
+
});
|
|
293
|
+
});
|
|
246
294
|
});
|
|
247
295
|
|
|
248
296
|
// #1311 — a sequence item's sibling keys survive a nested block, whichever key
|
package/src/yaml.ts
CHANGED
|
@@ -510,8 +510,22 @@ export function parseYAMLArray(
|
|
|
510
510
|
result.push(obj);
|
|
511
511
|
i = j;
|
|
512
512
|
} else {
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
const header = blockScalarHeader(itemValue);
|
|
514
|
+
if (header) {
|
|
515
|
+
// A block scalar as the item itself (`- |`). Without this branch the
|
|
516
|
+
// header parsed as the literal string "|" and the body lines leaked
|
|
517
|
+
// into whatever came next — inside a container list that hoisted the
|
|
518
|
+
// sibling keys after `args:` (securityContext, even the following
|
|
519
|
+
// `containers:` key) to the document root, so post-synth checks read
|
|
520
|
+
// a manifest that had lost them (#1482). The body is indented past
|
|
521
|
+
// the dash's column.
|
|
522
|
+
const block = parseBlockScalar(lines, i + 1, indent, header);
|
|
523
|
+
result.push(block.value);
|
|
524
|
+
i = block.endIndex;
|
|
525
|
+
} else {
|
|
526
|
+
result.push(parseScalar(itemValue));
|
|
527
|
+
i++;
|
|
528
|
+
}
|
|
515
529
|
}
|
|
516
530
|
} else {
|
|
517
531
|
break;
|