@rightkit/release 0.2.25 → 0.2.27
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/cargo-contract.mjs +6 -4
- package/legal-contract.mjs +2 -5
- package/legal-contract.test.mjs +1 -3
- package/package.json +1 -1
- package/release.mjs +20 -8
- package/right-suite-contract.test.mjs +21 -7
- package/rightkit-versions.json +10 -3
package/cargo-contract.mjs
CHANGED
|
@@ -34,10 +34,12 @@ export function assertPublishedRightKitCargoDependencies(dependencies, published
|
|
|
34
34
|
let checked = 0;
|
|
35
35
|
for (const dependency of dependencies.filter(({ name }) => name.startsWith("rightkit-"))) {
|
|
36
36
|
checked += 1;
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const configured = published.get(dependency.name);
|
|
38
|
+
if (!configured) throw new Error(`${label} ${dependency.name} is not a published RightKit crate`);
|
|
39
|
+
const allowed = configured instanceof Set ? configured : new Set(Array.isArray(configured) ? configured : [configured]);
|
|
40
|
+
const exactVersions = new Set([...allowed].map((version) => `=${version}`));
|
|
41
|
+
if (!CRATES_IO_SOURCES.has(dependency.source) || dependency.path || dependency.registry || !exactVersions.has(dependency.req)) {
|
|
42
|
+
throw new Error(`${label} ${dependency.name} must use an exact supported crates.io version (${[...exactVersions].join(" or ")})`);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
return checked;
|
package/legal-contract.mjs
CHANGED
|
@@ -60,15 +60,12 @@ export function assertLegalReleaseContract(root, legal, appName, platform) {
|
|
|
60
60
|
const manifest = readJson(manifestPath, appName, "legal manifest");
|
|
61
61
|
const snapshotRoot = realpathSync(path.dirname(manifestPath));
|
|
62
62
|
|
|
63
|
-
if (manifest.schema !==
|
|
64
|
-
fail(appName, "manifest must use Right Suite legal schema
|
|
63
|
+
if (manifest.schema !== 2 || manifest.suite !== "right-suite-desktop") {
|
|
64
|
+
fail(appName, "manifest must use Right Suite legal schema 2");
|
|
65
65
|
}
|
|
66
66
|
if (!APP_KEY.test(manifest.appKey ?? "") || (appName && manifest.appKey !== appName)) {
|
|
67
67
|
fail(appName, `manifest appKey must match release app (${manifest.appKey ?? "missing"})`);
|
|
68
68
|
}
|
|
69
|
-
if (manifest.freeWorkerMaximum !== 9 || manifest.paidWorkerMinimum !== 10) {
|
|
70
|
-
fail(appName, "manifest Worker threshold must be free through 9 and paid from 10");
|
|
71
|
-
}
|
|
72
69
|
if (typeof manifest.acceptanceVersion !== "string" || !manifest.acceptanceVersion.trim()) {
|
|
73
70
|
fail(appName, "manifest acceptanceVersion is required");
|
|
74
71
|
}
|
package/legal-contract.test.mjs
CHANGED
|
@@ -26,15 +26,13 @@ function fixture() {
|
|
|
26
26
|
];
|
|
27
27
|
for (const [, file, content] of definitions) writeFileSync(path.join(legalDir, file), content);
|
|
28
28
|
const manifest = {
|
|
29
|
-
schema:
|
|
29
|
+
schema: 2,
|
|
30
30
|
suite: "right-suite-desktop",
|
|
31
31
|
appKey: "fixture",
|
|
32
32
|
productName: "Fixture",
|
|
33
33
|
licensor: "Damned Ventures LLC",
|
|
34
34
|
effectiveDate: "2026-07-16",
|
|
35
35
|
acceptanceVersion: "fixture-2026-07-16-v1",
|
|
36
|
-
freeWorkerMaximum: 9,
|
|
37
|
-
paidWorkerMinimum: 10,
|
|
38
36
|
documents: definitions.map(([role, file, content]) => ({
|
|
39
37
|
id: `fixture-${role}`,
|
|
40
38
|
role,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rightkit/release",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "Portable Right Suite release CLI/SDK: signed installers, updater artifacts, patch/update routing, hardening, R2 publish, and RightApps registration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/release.mjs
CHANGED
|
@@ -14,9 +14,10 @@ const UPLOAD_LARGE = path.resolve(TOOL_ROOT, "upload-large.mjs");
|
|
|
14
14
|
const SIGN_WINDOWS = path.resolve(TOOL_ROOT, "sign-windows.mjs");
|
|
15
15
|
const SIGN_UPDATER = path.resolve(TOOL_ROOT, "sign-updater.mjs");
|
|
16
16
|
const RIGHTKIT_VERSIONS = JSON.parse(readFileSync(path.resolve(TOOL_ROOT, "rightkit-versions.json"), "utf8"));
|
|
17
|
-
const VERSION = RIGHTKIT_VERSIONS.npm["@rightkit/release"];
|
|
17
|
+
const VERSION = RIGHTKIT_VERSIONS.stagedNpm?.["@rightkit/release"] ?? RIGHTKIT_VERSIONS.npm["@rightkit/release"];
|
|
18
18
|
const TIERS = new Set(["patch", "update"]);
|
|
19
|
-
const
|
|
19
|
+
const RIGHTKIT_ALLOWED = buildAllowedVersions(RIGHTKIT_VERSIONS.npm, RIGHTKIT_VERSIONS.stagedNpm);
|
|
20
|
+
const RIGHTKIT_CARGO_ALLOWED = buildAllowedVersions(RIGHTKIT_VERSIONS.cargo, RIGHTKIT_VERSIONS.stagedCargo);
|
|
20
21
|
const FORBIDDEN_RIGHTKIT_SPEC = /^(?:git|file|link|workspace):|github|github\.com/i;
|
|
21
22
|
|
|
22
23
|
const args = process.argv.slice(2);
|
|
@@ -65,7 +66,7 @@ if (config.schema !== 1) fail(`unsupported config schema: ${config.schema ?? "<m
|
|
|
65
66
|
const root = path.dirname(configPath);
|
|
66
67
|
const workdir = path.resolve(root, config.workdir ?? ".");
|
|
67
68
|
await validateRightKitPackageContract(root, config.app);
|
|
68
|
-
validateRightKitCargoContract(root,
|
|
69
|
+
validateRightKitCargoContract(root, RIGHTKIT_CARGO_ALLOWED, config.app ?? path.basename(root));
|
|
69
70
|
const target = config.targets?.[opts.platform];
|
|
70
71
|
if (!target) fail(`${config.app ?? "app"} has no ${opts.platform} release target`);
|
|
71
72
|
const legalContract = config.legal
|
|
@@ -237,16 +238,27 @@ async function validateRightKitPackageContract(root, appName) {
|
|
|
237
238
|
if (FORBIDDEN_RIGHTKIT_SPEC.test(String(specifier))) {
|
|
238
239
|
fail(`${appName ?? pkg.name ?? "app"} ${name} must come from the published npm package, not ${specifier}`);
|
|
239
240
|
}
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
fail(`${appName ?? pkg.name ?? "app"} ${name} must be ${
|
|
241
|
+
const allowed = RIGHTKIT_ALLOWED.get(name);
|
|
242
|
+
if (allowed && !allowed.has(specifier)) {
|
|
243
|
+
fail(`${appName ?? pkg.name ?? "app"} ${name} must be one of ${[...allowed].join(", ")}, got ${specifier}`);
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
const releaseAllowed = RIGHTKIT_ALLOWED.get("@rightkit/release");
|
|
247
|
+
if (!releaseAllowed?.has(pkg.devDependencies?.["@rightkit/release"])) {
|
|
248
|
+
fail(`${appName ?? pkg.name ?? "app"} must depend on a supported @rightkit/release version in devDependencies`);
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
251
|
|
|
252
|
+
function buildAllowedVersions(published = {}, staged = {}) {
|
|
253
|
+
const allowed = new Map();
|
|
254
|
+
for (const [name, version] of [...Object.entries(published), ...Object.entries(staged)]) {
|
|
255
|
+
const versions = allowed.get(name) ?? new Set();
|
|
256
|
+
versions.add(version);
|
|
257
|
+
allowed.set(name, versions);
|
|
258
|
+
}
|
|
259
|
+
return allowed;
|
|
260
|
+
}
|
|
261
|
+
|
|
250
262
|
async function commandEnv(command, root) {
|
|
251
263
|
const env = { ...(command.env ?? {}) };
|
|
252
264
|
for (const [name, rel] of Object.entries(command.envFiles ?? {})) {
|
|
@@ -317,16 +317,28 @@ test("Cargo version contract rejects staged versions that mismatch canonical man
|
|
|
317
317
|
test("RightKit exposes one current version manifest", () => {
|
|
318
318
|
assert.equal(existsSync(versionsPath), true, "rightkit-versions.json must be the single current-version source");
|
|
319
319
|
assert.match(versions.packageManager, /^pnpm@\d+\.\d+\.\d+$/);
|
|
320
|
-
assert.equal(versions.npm["@rightkit/release"], "0.2.
|
|
321
|
-
assert.equal(versions.npm["@rightkit/legal"], "0.
|
|
320
|
+
assert.equal(versions.npm["@rightkit/release"], "0.2.26");
|
|
321
|
+
assert.equal(versions.npm["@rightkit/legal"], "0.2.0");
|
|
322
322
|
assert.equal(versions.npm["@rightkit/license"], "0.1.5");
|
|
323
323
|
assert.equal(versions.npm["@rightkit/logs"], "0.1.3");
|
|
324
324
|
assert.equal(versions.npm["@rightkit/tauri"], "0.1.0");
|
|
325
325
|
assert.equal(versions.npm["@rightkit/updates"], "0.2.3");
|
|
326
|
+
assert.deepEqual(versions.stagedNpm, {
|
|
327
|
+
"@rightkit/license": "0.1.6",
|
|
328
|
+
"@rightkit/release": "0.2.27",
|
|
329
|
+
});
|
|
330
|
+
const licensePackage = JSON.parse(readFileSync(
|
|
331
|
+
path.join(workspace, "tools/rightkit/packages/license/package.json"),
|
|
332
|
+
"utf8",
|
|
333
|
+
));
|
|
334
|
+
assert.equal(licensePackage.version, versions.stagedNpm["@rightkit/license"]);
|
|
326
335
|
assert.equal(versions.cargo["rightkit-license"], "0.1.2");
|
|
327
336
|
assert.equal(versions.cargo["rightkit-logs"], "0.1.0");
|
|
328
337
|
assert.equal(versions.cargo["rightkit-tauri"], "0.1.0");
|
|
329
|
-
assert.deepEqual(versions.stagedCargo, {
|
|
338
|
+
assert.deepEqual(versions.stagedCargo, {
|
|
339
|
+
"rightkit-license": "0.1.3",
|
|
340
|
+
"rightkit-tauri": "0.1.1",
|
|
341
|
+
});
|
|
330
342
|
getCurrentCargoVersionContract();
|
|
331
343
|
});
|
|
332
344
|
|
|
@@ -355,10 +367,11 @@ for (const app of apps) {
|
|
|
355
367
|
const rightKitDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
356
368
|
for (const [name, specifier] of Object.entries(rightKitDeps).filter(([name]) => name.startsWith("@rightkit/"))) {
|
|
357
369
|
assert.doesNotMatch(specifier, /^(?:git|file|link|workspace):|github/i, `${app.key} ${name} must come from the published npm package`);
|
|
358
|
-
|
|
370
|
+
const allowed = new Set([versions.npm[name], versions.stagedNpm?.[name]].filter(Boolean));
|
|
371
|
+
if (allowed.size) assert.ok(allowed.has(specifier), `${app.key} ${name} must match a published rollout version`);
|
|
359
372
|
}
|
|
360
373
|
assert.equal(pkg.packageManager, versions.packageManager);
|
|
361
|
-
assert.
|
|
374
|
+
assert.ok(new Set([versions.npm["@rightkit/release"], versions.stagedNpm?.["@rightkit/release"]]).has(pkg.devDependencies?.["@rightkit/release"]));
|
|
362
375
|
assert.equal(
|
|
363
376
|
pkg.dependencies?.["@rightkit/updates"],
|
|
364
377
|
versions.npm["@rightkit/updates"],
|
|
@@ -418,8 +431,9 @@ for (const app of apps) {
|
|
|
418
431
|
]);
|
|
419
432
|
assert.equal(tauri.bundle.createUpdaterArtifacts, true);
|
|
420
433
|
|
|
421
|
-
const { consumer } = getCurrentCargoVersionContract();
|
|
422
|
-
|
|
434
|
+
const { consumer, canonical } = getCurrentCargoVersionContract();
|
|
435
|
+
const rollout = new Map([...consumer].map(([name, version]) => [name, new Set([version, canonical.get(name)].filter(Boolean))]));
|
|
436
|
+
validateRightKitCargoContract(root, rollout, app.key);
|
|
423
437
|
|
|
424
438
|
for (const localCopy of [
|
|
425
439
|
"src-tauri/vendor/rightkit-license",
|
package/rightkit-versions.json
CHANGED
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageManager": "pnpm@11.12.0",
|
|
4
4
|
"npm": {
|
|
5
|
-
"@rightkit/legal": "0.
|
|
5
|
+
"@rightkit/legal": "0.2.0",
|
|
6
6
|
"@rightkit/license": "0.1.5",
|
|
7
7
|
"@rightkit/logs": "0.1.3",
|
|
8
8
|
"@rightkit/platform-ui": "0.1.0",
|
|
9
9
|
"@rightkit/qa": "0.1.0",
|
|
10
|
-
"@rightkit/release": "0.2.
|
|
10
|
+
"@rightkit/release": "0.2.26",
|
|
11
11
|
"@rightkit/tauri": "0.1.0",
|
|
12
12
|
"@rightkit/updates": "0.2.3"
|
|
13
13
|
},
|
|
14
|
+
"stagedNpm": {
|
|
15
|
+
"@rightkit/license": "0.1.6",
|
|
16
|
+
"@rightkit/release": "0.2.27"
|
|
17
|
+
},
|
|
14
18
|
"cargo": {
|
|
15
19
|
"rightkit-license": "0.1.2",
|
|
16
20
|
"rightkit-logs": "0.1.0",
|
|
17
21
|
"rightkit-process": "0.1.0",
|
|
18
22
|
"rightkit-tauri": "0.1.0"
|
|
19
23
|
},
|
|
20
|
-
"stagedCargo": {
|
|
24
|
+
"stagedCargo": {
|
|
25
|
+
"rightkit-license": "0.1.3",
|
|
26
|
+
"rightkit-tauri": "0.1.1"
|
|
27
|
+
},
|
|
21
28
|
"swift": {
|
|
22
29
|
"rightkit-swift": {
|
|
23
30
|
"url": "https://github.com/bogusyogi/rightkit-swift.git",
|