@rightkit/release 0.2.120 → 0.2.121
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/package.json +1 -1
- package/publication-gate.mjs +29 -2
- package/rightkit-versions.json +7 -5
package/package.json
CHANGED
package/publication-gate.mjs
CHANGED
|
@@ -45,9 +45,10 @@ export function checkPublicationGate({ kind, name, version, packagePath, evidenc
|
|
|
45
45
|
if (!SHA.test(String(evidence.commit ?? ""))) missing.push("evidence commit is not a full 40-character SHA");
|
|
46
46
|
else if (head && evidence.commit !== head) missing.push(`evidence commit ${evidence.commit} != current HEAD ${head}`);
|
|
47
47
|
const runs = Array.isArray(evidence.runs) ? evidence.runs : [];
|
|
48
|
-
// npm
|
|
48
|
+
// npm packages and crates may ship on macOS evidence first when Adrian decides so; the decision must be
|
|
49
49
|
// recorded in the evidence (hostPolicy "darwin-only" + a non-empty hostPolicyReason).
|
|
50
|
-
|
|
50
|
+
// Crates may ship Mac-first too (Adrian 2026-10-07): the Windows run follows; the reason is recorded.
|
|
51
|
+
const darwinOnly = (kind === "npm" || kind === "cargo") && evidence.hostPolicy === "darwin-only"
|
|
51
52
|
&& typeof evidence.hostPolicyReason === "string" && evidence.hostPolicyReason.trim() !== "";
|
|
52
53
|
for (const host of darwinOnly ? ["darwin"] : requiredHosts(kind)) {
|
|
53
54
|
const label = host === "darwin" ? "macOS" : "Windows";
|
|
@@ -81,7 +82,33 @@ export const NPM_KEYCHAIN_SERVICE = "npm-rightkit-publish";
|
|
|
81
82
|
// Add `--publish --tarball <file>` to publish that exact gated tarball: its sha256 must equal the
|
|
82
83
|
// evidence artifactSha256, the token is read from the macOS Keychain inside this process (never
|
|
83
84
|
// printed or passed on a command line), and the registry shasum is verified after publication.
|
|
85
|
+
/** `right-release publish npm --check-auth`: prove the Keychain token authenticates (whoami +
|
|
86
|
+
* @rightkit package access) without publishing. Prints only the username and counts. */
|
|
87
|
+
export function checkNpmAuth(deps = {}) {
|
|
88
|
+
const run = deps.spawnSync ?? spawnSync;
|
|
89
|
+
const token = deps.readToken ? deps.readToken() : readKeychainToken(run);
|
|
90
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rk-npm-auth-"));
|
|
91
|
+
const userconfig = path.join(dir, "npmrc");
|
|
92
|
+
const redact = (text) => String(text ?? "").split(token).join("<redacted>");
|
|
93
|
+
try {
|
|
94
|
+
fs.writeFileSync(userconfig, "//registry.npmjs.org/:_authToken=${RIGHTKIT_NPM_TOKEN}\n", { mode: 0o600 });
|
|
95
|
+
const env = { ...process.env, RIGHTKIT_NPM_TOKEN: token };
|
|
96
|
+
const base = ["--registry", "https://registry.npmjs.org/", "--userconfig", userconfig];
|
|
97
|
+
const who = run("npm", ["whoami", ...base], { encoding: "utf8", env, windowsHide: true });
|
|
98
|
+
if (who.status !== 0) throw new Error(`npm whoami failed with the Keychain token:\n${redact(`${who.stdout ?? ""}${who.stderr ?? ""}`).trim()}`);
|
|
99
|
+
const access = run("npm", ["access", "list", "packages", "@rightkit", "--json", ...base], { encoding: "utf8", env, windowsHide: true });
|
|
100
|
+
let packages = {};
|
|
101
|
+
try { packages = JSON.parse(access.stdout || "{}"); } catch { packages = {}; }
|
|
102
|
+
const writable = Object.values(packages).filter((level) => level === "read-write").length;
|
|
103
|
+
process.stdout.write(`[right-release] npm token OK: ${String(who.stdout).trim()}, read-write on ${writable} @rightkit packages\n`);
|
|
104
|
+
return { user: String(who.stdout).trim(), writable };
|
|
105
|
+
} finally {
|
|
106
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
84
110
|
export function runNpmPreflight(argv, workspaceRoot = process.cwd(), deps = {}) {
|
|
111
|
+
if (argv.includes("--check-auth")) { checkNpmAuth(deps); return; }
|
|
85
112
|
let pkg; let evidence; let tarball; const dryRun = argv.includes("--dry-run"); const publish = argv.includes("--publish");
|
|
86
113
|
for (let i = 0; i < argv.length; i += 1) {
|
|
87
114
|
if (argv[i] === "--package") pkg = argv[++i];
|
package/rightkit-versions.json
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@rightkit/pdf-ui": "0.1.1",
|
|
29
29
|
"@rightkit/platform-ui": "0.1.2",
|
|
30
30
|
"@rightkit/qa": "0.2.1",
|
|
31
|
-
"@rightkit/release": "0.2.
|
|
32
|
-
"@rightkit/settings-ui": "0.2.
|
|
31
|
+
"@rightkit/release": "0.2.121",
|
|
32
|
+
"@rightkit/settings-ui": "0.2.5",
|
|
33
33
|
"@rightkit/shell": "0.1.0",
|
|
34
34
|
"@rightkit/tauri": "0.1.1",
|
|
35
35
|
"@rightkit/theme": "0.2.0",
|
|
@@ -141,7 +141,8 @@
|
|
|
141
141
|
"0.2.116",
|
|
142
142
|
"0.2.117",
|
|
143
143
|
"0.2.118",
|
|
144
|
-
"0.2.119"
|
|
144
|
+
"0.2.119",
|
|
145
|
+
"0.2.120"
|
|
145
146
|
],
|
|
146
147
|
"@rightkit/qa": [
|
|
147
148
|
"0.1.0",
|
|
@@ -165,7 +166,8 @@
|
|
|
165
166
|
"0.1.0",
|
|
166
167
|
"0.2.0",
|
|
167
168
|
"0.2.2",
|
|
168
|
-
"0.2.3"
|
|
169
|
+
"0.2.3",
|
|
170
|
+
"0.2.4"
|
|
169
171
|
],
|
|
170
172
|
"@rightkit/onboarding": [
|
|
171
173
|
"0.1.0",
|
|
@@ -213,7 +215,7 @@
|
|
|
213
215
|
"rightkit-jobs": "0.2.1",
|
|
214
216
|
"rightkit-logs": "0.2.0",
|
|
215
217
|
"rightkit-media": "0.2.2",
|
|
216
|
-
"rightkit-models": "0.
|
|
218
|
+
"rightkit-models": "0.2.0",
|
|
217
219
|
"rightkit-pdf": "0.1.0",
|
|
218
220
|
"rightkit-playback": "0.1.0",
|
|
219
221
|
"rightkit-process": "0.2.1",
|