@intentius/chant 0.124.101 → 0.124.102
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/ci-evidence-claims.d.ts +12 -0
- package/dist/ci-evidence-claims.js +12 -0
- package/dist/cli/handlers/release-init.js +50 -18
- package/dist/cli/handlers/release.d.ts +1 -1
- package/dist/cli/handlers/release.js +12 -9
- package/dist/cli/release-commands/cut.js +4 -3
- package/dist/cli/release-commands/init.js +4 -1
- package/dist/cli/release-commands/workflow.js +4 -2
- package/dist/cloud-lister/index.d.ts +4 -1
- package/dist/cloud-lister/index.js +2 -1
- package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
- package/dist/cloud-lister/kubernetes-components.js +642 -0
- package/dist/cloud-lister/kubernetes.d.ts +18 -0
- package/dist/cloud-lister/kubernetes.js +26 -1
- package/dist/cloud-lister/mask.d.ts +5 -1
- package/dist/cloud-lister/mask.js +14 -5
- package/dist/config-import.d.ts +1 -1
- package/dist/config-import.js +6 -2
- package/dist/config-sandbox.d.ts +1 -1
- package/dist/config-sandbox.js +3 -3
- package/dist/config.d.ts +75 -1
- package/dist/config.js +27 -2
- package/dist/deep-observation.js +9 -3
- package/dist/floor-table.data.js +12 -6
- package/dist/lexicon.d.ts +4 -2
- package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
- package/dist/lifecycle/__fixtures__/package-files.js +72 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +5 -0
- package/dist/lifecycle/publish-credentials.d.ts +1 -1
- package/dist/lifecycle/publish-credentials.js +5 -0
- package/dist/lifecycle/publish-declaration.d.ts +123 -0
- package/dist/lifecycle/publish-declaration.js +140 -0
- package/dist/lifecycle/publish-helm.d.ts +83 -0
- package/dist/lifecycle/publish-helm.js +452 -0
- package/dist/lifecycle/publish-maven.d.ts +79 -0
- package/dist/lifecycle/publish-maven.js +364 -0
- package/dist/lifecycle/publish-mcp-registry.js +1 -2
- package/dist/lifecycle/publish-npm.d.ts +27 -1
- package/dist/lifecycle/publish-npm.js +51 -1
- package/dist/lifecycle/publish-nuget.d.ts +93 -0
- package/dist/lifecycle/publish-nuget.js +377 -0
- package/dist/lifecycle/publish-oci.d.ts +57 -1
- package/dist/lifecycle/publish-oci.js +1 -1
- package/dist/lifecycle/publish-package-files.d.ts +16 -0
- package/dist/lifecycle/publish-package-files.js +39 -0
- package/dist/lifecycle/publish-pypi.d.ts +2 -0
- package/dist/lifecycle/publish-pypi.js +1 -1
- package/dist/lifecycle/publish-rubygems.d.ts +84 -0
- package/dist/lifecycle/publish-rubygems.js +366 -0
- package/dist/lifecycle/publish-targets.d.ts +10 -0
- package/dist/lifecycle/publish-targets.js +22 -0
- package/dist/lifecycle/publish-train-names.d.ts +4 -1
- package/dist/lifecycle/publish-train-names.js +5 -0
- package/dist/lifecycle/release-artifacts.d.ts +80 -2
- package/dist/lifecycle/release-artifacts.js +242 -5
- package/dist/lifecycle/release-cut.d.ts +6 -1
- package/dist/lifecycle/release-cut.js +15 -0
- package/dist/lifecycle/release-doctor.js +208 -6
- package/dist/lifecycle/release-init-registries.d.ts +48 -0
- package/dist/lifecycle/release-init-registries.js +97 -0
- package/dist/lifecycle/release-init.d.ts +22 -2
- package/dist/lifecycle/release-init.js +132 -7
- package/dist/lifecycle/release-next.js +1 -2
- package/dist/lifecycle/release-publish.d.ts +1 -1
- package/dist/lifecycle/release-publish.js +1 -1
- package/dist/lifecycle/release-tag.js +1 -2
- package/dist/op/local-executor.d.ts +1 -1
- package/dist/op/local-executor.js +2 -2
- package/dist/op/op-waves-evidence.js +9 -2
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/sensitive-key.d.ts +12 -0
- package/dist/sensitive-key.js +52 -0
- package/dist/tool-pins.d.ts +2 -0
- package/dist/tool-pins.js +12 -0
- package/dist/ts-loader.d.ts +8 -0
- package/dist/ts-loader.js +19 -0
- package/dist/wave-runtime.mjs +325 -325
- package/dist/workspace/lexicon-outputs.d.ts +1 -1
- package/dist/workspace/lexicon-outputs.js +1 -1
- package/dist/workspace/release-steps/index.js +4 -0
- package/dist/workspace/release-steps/nfpm.d.ts +13 -0
- package/dist/workspace/release-steps/nfpm.js +29 -0
- package/dist/workspace/release-steps/nuget.d.ts +14 -0
- package/dist/workspace/release-steps/nuget.js +16 -0
- package/dist/workspace/release-steps/targets.d.ts +2 -2
- package/dist/workspace/release-steps/targets.js +3 -3
- package/dist/workspace/release-train-workflow.d.ts +7 -0
- package/dist/workspace/release-train-workflow.js +46 -10
- package/dist/workspace/release-workflow.d.ts +28 -3
- package/dist/workspace/release-workflow.js +38 -15
- package/dist/workspace/train-cut.d.ts +2 -2
- package/dist/workspace/train-cut.js +27 -5
- package/dist/workspace/train-prepare.d.ts +6 -3
- package/dist/workspace/train-prepare.js +54 -8
- package/dist/workspace/train-publish.js +2 -3
- package/dist/workspace/train-shell.d.ts +5 -0
- package/dist/workspace/train-shell.js +17 -0
- package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
- package/dist/workspace/trust/check-evidence-report.js +3 -7
- package/package.json +1 -1
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
* - the workspace packages it depends on, directly or not, that this run
|
|
15
15
|
* does not publish are built once each, dependencies first, so a package
|
|
16
16
|
* that builds against another's output finds it. The members this run
|
|
17
|
-
* publishes build when npm packs them, in the train's layer order.
|
|
17
|
+
* publishes build when npm packs them, in the train's layer order. A
|
|
18
|
+
* member cut here whose package an earlier run of the publish already
|
|
19
|
+
* revealed is not packed again, so it builds here like any other
|
|
20
|
+
* dependency (#5222): a resumed publish finds what it left built. The
|
|
18
21
|
* command is `release.train.buildDependencies`, else the package's
|
|
19
22
|
* `prepack` script, else its `build` script.
|
|
20
23
|
*
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
* target; its dependencies are its `dependencies`, `peerDependencies` and
|
|
24
27
|
* `optionalDependencies` that name another such package.
|
|
25
28
|
*/
|
|
26
|
-
import { execFileSync
|
|
29
|
+
import { execFileSync } from "node:child_process";
|
|
27
30
|
import { existsSync, readdirSync, readFileSync, realpathSync } from "node:fs";
|
|
28
31
|
// @ts-ignore — picomatch has no types declaration
|
|
29
32
|
import picomatch from "picomatch";
|
|
@@ -31,8 +34,10 @@ import { resolve } from "node:path";
|
|
|
31
34
|
import { readDeclaration } from "./declaration.js";
|
|
32
35
|
import { findTrain, readReleaseTrains } from "./release-train.js";
|
|
33
36
|
import { TrainCutError, trainConfigAt } from "./train-cut.js";
|
|
37
|
+
import { runToStderr } from "./train-shell.js";
|
|
34
38
|
import { locateWorkspace } from "./which-chant.js";
|
|
35
|
-
|
|
39
|
+
// A build's stdout goes to stderr: under --json, stdout is the prepare's JSON document alone.
|
|
40
|
+
const defaultRun = (command, cwd) => runToStderr(command, { cwd });
|
|
36
41
|
/** Stamp and build what the train's members cut from this commit need before `train publish` (#5154). */
|
|
37
42
|
export async function prepareTrain(q) {
|
|
38
43
|
const located = locateWorkspace(q.cwd);
|
|
@@ -60,13 +65,20 @@ export async function prepareTrain(q) {
|
|
|
60
65
|
// Every workspace package the members name, by name.
|
|
61
66
|
const packages = new Map();
|
|
62
67
|
const ownedBy = new Map();
|
|
68
|
+
// Per member, each package it owns and the npm targets that pack it (none for a package only release.version names).
|
|
69
|
+
const packedBy = new Map();
|
|
70
|
+
const declsOf = new Map();
|
|
63
71
|
for (const m of members) {
|
|
64
72
|
const dir = resolve(root, m.dir);
|
|
65
73
|
if (!existsSync(dir))
|
|
66
74
|
continue;
|
|
67
75
|
const release = (await loadChantConfig(dir)).config.release;
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
declsOf.set(m.name, (release?.publish ?? []));
|
|
77
|
+
const dirs = [
|
|
78
|
+
...(release?.version?.packages ?? []).map((p) => ({ p, decl: null })),
|
|
79
|
+
...(release?.publish ?? []).flatMap((t) => (t.type === "npm" ? (t.packages ?? []).map((p) => ({ p, decl: t })) : [])),
|
|
80
|
+
];
|
|
81
|
+
for (const { p, decl } of dirs) {
|
|
70
82
|
const file = resolve(dir, p, "package.json");
|
|
71
83
|
if (!existsSync(file))
|
|
72
84
|
continue;
|
|
@@ -81,7 +93,11 @@ export async function prepareTrain(q) {
|
|
|
81
93
|
if (typeof pkg.name !== "string")
|
|
82
94
|
continue;
|
|
83
95
|
packages.set(pkg.name, { dir: abs, name: pkg.name, needs: Object.keys({ ...pkg.dependencies, ...pkg.peerDependencies, ...pkg.optionalDependencies }), scripts: pkg.scripts ?? {} });
|
|
84
|
-
|
|
96
|
+
if (!(ownedBy.get(m.name) ?? []).includes(pkg.name))
|
|
97
|
+
ownedBy.set(m.name, [...(ownedBy.get(m.name) ?? []), pkg.name]);
|
|
98
|
+
const by = packedBy.get(m.name) ?? new Map();
|
|
99
|
+
by.set(pkg.name, [...(by.get(pkg.name) ?? []), ...(decl ? [decl] : [])]);
|
|
100
|
+
packedBy.set(m.name, by);
|
|
85
101
|
}
|
|
86
102
|
}
|
|
87
103
|
// The repository's other workspace packages (npm, yarn and pnpm workspaces), which a member's package may build against.
|
|
@@ -123,7 +139,7 @@ export async function prepareTrain(q) {
|
|
|
123
139
|
// Build, once each and dependencies first, the packages the published ones need and this run does not publish.
|
|
124
140
|
const built = [];
|
|
125
141
|
if (config.buildDependencies !== false) {
|
|
126
|
-
const published =
|
|
142
|
+
const published = await packedThisRun(here, members, root, ownedBy, packedBy, declsOf);
|
|
127
143
|
const order = [];
|
|
128
144
|
const seen = new Set();
|
|
129
145
|
const visit = (name) => {
|
|
@@ -144,7 +160,7 @@ export async function prepareTrain(q) {
|
|
|
144
160
|
continue;
|
|
145
161
|
const shown = p.dir.startsWith(`${realpathSync(located.top ?? root)}/`) ? p.dir.slice(realpathSync(located.top ?? root).length + 1) : p.dir;
|
|
146
162
|
say(`build ${name} (${shown}), which ${[...published].filter((x) => dependsOn(packages, x, name)).join(", ")} builds against: ${command}`);
|
|
147
|
-
const code = (q.run ?? defaultRun)(command, p.dir);
|
|
163
|
+
const code = await (q.run ?? defaultRun)(command, p.dir);
|
|
148
164
|
if (code !== 0)
|
|
149
165
|
throw new TrainCutError("train-build-failed", `building ${name} in ${shown} failed (exit ${code}): ${command}`, "Fix the build and run the prepare again in a clean checkout of the train's commit.");
|
|
150
166
|
built.push({ dir: shown, command });
|
|
@@ -152,6 +168,36 @@ export async function prepareTrain(q) {
|
|
|
152
168
|
}
|
|
153
169
|
return { train, stamped, built };
|
|
154
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* The packages the publish packs in this run: those of each member cut here,
|
|
173
|
+
* less the ones an earlier run already revealed (#5222). A package is
|
|
174
|
+
* revealed when every npm target that packs it is; a package no npm target
|
|
175
|
+
* packs, when every target of its member is.
|
|
176
|
+
*/
|
|
177
|
+
async function packedThisRun(here, members, root, ownedBy, packedBy, declsOf) {
|
|
178
|
+
const { publishProgress, readPublishRecords } = await import("../lifecycle/publish-record.js");
|
|
179
|
+
const { publishTargetKey } = await import("../lifecycle/publish-targets.js");
|
|
180
|
+
const out = new Set();
|
|
181
|
+
for (const t of here) {
|
|
182
|
+
const m = members.find((x) => x.name === t.member);
|
|
183
|
+
const owned = ownedBy.get(t.member) ?? [];
|
|
184
|
+
if (!m) {
|
|
185
|
+
owned.forEach((n) => out.add(n));
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
const progress = publishProgress(await readPublishRecords(t.releaseDigest, { cwd: resolve(root, m.dir) }).catch(() => []));
|
|
189
|
+
const revealed = (d) => progress.revealed.has(publishTargetKey(d));
|
|
190
|
+
const decls = declsOf.get(t.member) ?? [];
|
|
191
|
+
const memberRevealed = decls.length > 0 && decls.every(revealed);
|
|
192
|
+
for (const name of owned) {
|
|
193
|
+
const by = packedBy.get(t.member)?.get(name) ?? [];
|
|
194
|
+
const done = by.length > 0 ? by.every(revealed) : memberRevealed;
|
|
195
|
+
if (!done)
|
|
196
|
+
out.add(name);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
155
201
|
/**
|
|
156
202
|
* The package directories the repository's root declares as workspaces:
|
|
157
203
|
* `workspaces` in its package.json (an array, or `{ packages }` as yarn
|
|
@@ -59,9 +59,8 @@ import { PublishTargetError, revealOrder } from "../lifecycle/release-publish.js
|
|
|
59
59
|
import { readDeclaration } from "./declaration.js";
|
|
60
60
|
import { findTrain, readReleaseTrains } from "./release-train.js";
|
|
61
61
|
import { locateWorkspace } from "./which-chant.js";
|
|
62
|
-
import { NEXT_RELEASE } from "../release-floors.js";
|
|
63
62
|
/** The first chant whose `chant workspace train publish` orders and resumes members of every target kind (#5165): the oci, forge, homebrew, index, marketplace, pypi, cargo, mcp-registry and tauri-updater targets name what they publish and need, say whether a pinned release is published, and wait until a reveal is served before the next layer; a member's `release.dependsOn` names members a manifest doesn't show. */
|
|
64
|
-
export const TRAIN_PUBLISH_TARGETS_FLOOR =
|
|
63
|
+
export const TRAIN_PUBLISH_TARGETS_FLOOR = "0.124.101";
|
|
65
64
|
/** A train publish that stopped, with what it left staged and revealed (`<member>: <target>`), so a run of the same command resumes. */
|
|
66
65
|
export class TrainPublishRunError extends PublishTargetError {
|
|
67
66
|
constructor(code, message, fix, member, step, staged, revealed) {
|
|
@@ -500,7 +499,7 @@ export async function runTrainPublish(ctx, words) {
|
|
|
500
499
|
cwd,
|
|
501
500
|
env,
|
|
502
501
|
...(ref !== undefined ? { train: ref } : {}),
|
|
503
|
-
yes: args.yes === true,
|
|
502
|
+
yes: args.yes === true && args.dryRun !== true,
|
|
504
503
|
allowUnsigned: args.allowUnsigned === true,
|
|
505
504
|
requireProvenance: args.requireProvenance === true,
|
|
506
505
|
say: (line) => (json ? undefined : console.error(line)),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell lines a train command runs for its user: `release.train.check`
|
|
3
|
+
* in `train cut`, and the builds of `train prepare`. Their stdout goes to
|
|
4
|
+
* this process's stderr, as `release.verify`'s does, so stdout carries only
|
|
5
|
+
* what the command prints itself, and under `--json` that is one JSON
|
|
6
|
+
* document a step can parse.
|
|
7
|
+
*/
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
/** Runs `line` with `sh -c` and returns its exit code; its stdout and stderr both reach this process's stderr. */
|
|
10
|
+
export function runToStderr(line, o) {
|
|
11
|
+
return new Promise((done) => {
|
|
12
|
+
const child = spawn("sh", ["-c", line], { cwd: o.cwd, env: o.env ?? process.env, stdio: ["ignore", "pipe", "inherit"] });
|
|
13
|
+
child.stdout.on("data", (chunk) => process.stderr.write(chunk));
|
|
14
|
+
child.on("error", () => done(1));
|
|
15
|
+
child.on("close", (code) => done(code ?? 1));
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
* Kept apart from ./check-evidence.ts so `pr-post` reads the note file
|
|
17
17
|
* without loading the signer.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
import { CHECK_EVIDENCE_KEY_ENV, RUNNER_IDENTITY_ENV } from "../../ci-evidence-claims.js";
|
|
20
|
+
/** The runner key and runner identity variables live in ../../ci-evidence-claims.ts (#5219). */
|
|
21
|
+
export { CHECK_EVIDENCE_KEY_ENV, RUNNER_IDENTITY_ENV };
|
|
21
22
|
/** The variable a developer's or an agent's local evidence key is read from, as PEM (#4868). A check hook never sees it. */
|
|
22
23
|
export declare const LOCAL_EVIDENCE_KEY_ENV = "CHANT_LOCAL_EVIDENCE_KEY";
|
|
23
|
-
/**
|
|
24
|
-
* The variable a generated job sets to `oidc` when it signs keyless from
|
|
25
|
-
* its OIDC identity (#4869) instead of with a runner key.
|
|
26
|
-
*/
|
|
27
|
-
export declare const RUNNER_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
28
24
|
/** The GitLab `id_tokens` variable a keyless signing job's token comes in (#4869), with the signing audience. */
|
|
29
25
|
export declare const SIGNING_ID_TOKEN_VAR = "CHANT_ID_TOKEN_SIGSTORE";
|
|
30
26
|
/** The file the signing step writes beside the plan report, which `pr-post` reads. */
|
|
@@ -18,15 +18,11 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { existsSync, readFileSync } from "node:fs";
|
|
20
20
|
import { join } from "node:path";
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
import { CHECK_EVIDENCE_KEY_ENV, RUNNER_IDENTITY_ENV } from "../../ci-evidence-claims.js";
|
|
22
|
+
/** The runner key and runner identity variables live in ../../ci-evidence-claims.ts (#5219). */
|
|
23
|
+
export { CHECK_EVIDENCE_KEY_ENV, RUNNER_IDENTITY_ENV };
|
|
23
24
|
/** The variable a developer's or an agent's local evidence key is read from, as PEM (#4868). A check hook never sees it. */
|
|
24
25
|
export const LOCAL_EVIDENCE_KEY_ENV = "CHANT_LOCAL_EVIDENCE_KEY";
|
|
25
|
-
/**
|
|
26
|
-
* The variable a generated job sets to `oidc` when it signs keyless from
|
|
27
|
-
* its OIDC identity (#4869) instead of with a runner key.
|
|
28
|
-
*/
|
|
29
|
-
export const RUNNER_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
30
26
|
/** The GitLab `id_tokens` variable a keyless signing job's token comes in (#4869), with the signing audience. */
|
|
31
27
|
export const SIGNING_ID_TOKEN_VAR = "CHANT_ID_TOKEN_SIGSTORE";
|
|
32
28
|
/** The file the signing step writes beside the plan report, which `pr-post` reads. */
|
package/package.json
CHANGED