@rightkit/release 0.2.38 → 0.2.40
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/build-invocation-contract.test.mjs +33 -5
- package/build-release.mjs +79 -47
- package/build-release.test.mjs +44 -0
- package/cache-command.mjs +73 -0
- package/cache-command.test.mjs +73 -0
- package/cache-policy.mjs +423 -0
- package/cache-policy.test.mjs +263 -0
- package/cargo-contract.mjs +8 -1
- package/cli/right-release.mjs +6 -0
- package/package.json +1 -1
- package/release-invocation.mjs +21 -7
- package/release-state.mjs +26 -2
- package/release-state.test.mjs +50 -0
- package/release.mjs +27 -1
- package/right-suite-contract.test.mjs +78 -11
- package/rightkit-versions.json +1 -1
|
@@ -32,6 +32,33 @@ const apps = [
|
|
|
32
32
|
{ key: "coderight", root: "coderight/apps/coderight-tauri", tauri: "src-tauri/tauri.conf.json", releaseFiles: ["scripts/mac-dmg.mjs"] },
|
|
33
33
|
];
|
|
34
34
|
|
|
35
|
+
function assertReleasePackageScripts(scripts, label) {
|
|
36
|
+
for (const platform of ["mac", "win"]) {
|
|
37
|
+
assert.equal(scripts[`release:build:${platform}`], `right-release build --platform ${platform}`, `${label} must use the tier-neutral ${platform} build entry point`);
|
|
38
|
+
for (const tier of ["patch", "update"]) {
|
|
39
|
+
assert.equal(scripts[`release:upload:${tier}:${platform}`], `right-release upload --platform ${platform} --tier ${tier}`, `${label} must select ${tier} only during ${platform} upload`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const genericTauri = scripts.tauri;
|
|
44
|
+
if (typeof genericTauri === "string") {
|
|
45
|
+
assert.doesNotMatch(
|
|
46
|
+
genericTauri.trim(),
|
|
47
|
+
/^(?:(?:pnpm|npm)\s+(?:(?:exec|dlx)\s+)?|npx\s+)?(?:(?:\.\/)?node_modules\/\.bin\/)?(?:@tauri-apps\/cli\s+)?tauri(?:\s|$)/,
|
|
48
|
+
`${label} generic \"tauri\" package script bypasses the RightKit release entry points; use an explicitly named dev, debug, unsigned, or local command instead`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function assertMacPackageEntry(packageCommand, scripts, label) {
|
|
54
|
+
assert.equal(packageCommand.cmd, "pnpm", `${label} must use the shared pnpm package entry point`);
|
|
55
|
+
assert.deepEqual(packageCommand.args, ["run", "rightkit:package:mac"], `${label} R2 release must use the dedicated signed and notarized macOS package entry point`);
|
|
56
|
+
const implementation = scripts["rightkit:package:mac"];
|
|
57
|
+
assert.equal(typeof implementation, "string", `${label} must define rightkit:package:mac`);
|
|
58
|
+
assert.doesNotMatch(implementation, /\bright-release\b/, `${label} rightkit:package:mac must package directly instead of recursing into the release build`);
|
|
59
|
+
assert.doesNotMatch(implementation, /\bpnpm(?:\s+run)?\s+rightkit:package:mac\b/, `${label} rightkit:package:mac must not recurse into itself`);
|
|
60
|
+
}
|
|
61
|
+
|
|
35
62
|
function resolveCargoVersionContract(versionManifest, canonicalVersions) {
|
|
36
63
|
const consumer = new Map(Object.entries(versionManifest.cargo ?? {}));
|
|
37
64
|
const staged = new Map(Object.entries(versionManifest.stagedCargo ?? {}));
|
|
@@ -314,10 +341,58 @@ test("Cargo version contract rejects staged versions that mismatch canonical man
|
|
|
314
341
|
);
|
|
315
342
|
});
|
|
316
343
|
|
|
344
|
+
test("release package scripts use tier-neutral builds and tiered uploads", () => {
|
|
345
|
+
const scripts = {
|
|
346
|
+
"release:build:mac": "right-release build --platform mac",
|
|
347
|
+
"release:build:win": "right-release build --platform win",
|
|
348
|
+
"release:upload:patch:mac": "right-release upload --platform mac --tier patch",
|
|
349
|
+
"release:upload:patch:win": "right-release upload --platform win --tier patch",
|
|
350
|
+
"release:upload:update:mac": "right-release upload --platform mac --tier update",
|
|
351
|
+
"release:upload:update:win": "right-release upload --platform win --tier update",
|
|
352
|
+
};
|
|
353
|
+
assert.doesNotThrow(() => assertReleasePackageScripts(scripts, "fixture"));
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
test("release package scripts reject a generic direct Tauri alias but allow named local commands", () => {
|
|
357
|
+
const scripts = {
|
|
358
|
+
"release:build:mac": "right-release build --platform mac",
|
|
359
|
+
"release:build:win": "right-release build --platform win",
|
|
360
|
+
"release:upload:patch:mac": "right-release upload --platform mac --tier patch",
|
|
361
|
+
"release:upload:patch:win": "right-release upload --platform win --tier patch",
|
|
362
|
+
"release:upload:update:mac": "right-release upload --platform mac --tier update",
|
|
363
|
+
"release:upload:update:win": "right-release upload --platform win --tier update",
|
|
364
|
+
"tauri:dev": "tauri dev",
|
|
365
|
+
"mac:build:debug": "tauri build --debug",
|
|
366
|
+
"build:win:unsigned": "tauri build --bundles nsis --no-sign",
|
|
367
|
+
"cargo:check": "cargo check --locked",
|
|
368
|
+
};
|
|
369
|
+
assert.doesNotThrow(() => assertReleasePackageScripts(scripts, "fixture"));
|
|
370
|
+
for (const genericTauri of ["tauri", "pnpm exec tauri", "pnpm dlx tauri", "./node_modules/.bin/tauri"]) {
|
|
371
|
+
assert.throws(
|
|
372
|
+
() => assertReleasePackageScripts({ ...scripts, tauri: genericTauri }, "fixture"),
|
|
373
|
+
/generic \"tauri\" package script bypasses/i,
|
|
374
|
+
genericTauri,
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
test("mac release config uses a dedicated non-recursive package entry point", () => {
|
|
380
|
+
const command = { cmd: "pnpm", args: ["run", "rightkit:package:mac"] };
|
|
381
|
+
assert.doesNotThrow(() => assertMacPackageEntry(command, { "rightkit:package:mac": "node scripts/mac-dmg.mjs --notarize" }, "fixture"));
|
|
382
|
+
assert.throws(
|
|
383
|
+
() => assertMacPackageEntry(command, { "rightkit:package:mac": "right-release build --platform mac" }, "fixture"),
|
|
384
|
+
/instead of recursing into the release build/i,
|
|
385
|
+
);
|
|
386
|
+
assert.throws(
|
|
387
|
+
() => assertMacPackageEntry(command, { "rightkit:package:mac": "pnpm run rightkit:package:mac" }, "fixture"),
|
|
388
|
+
/must not recurse into itself/i,
|
|
389
|
+
);
|
|
390
|
+
});
|
|
391
|
+
|
|
317
392
|
test("RightKit exposes one current version manifest", () => {
|
|
318
393
|
assert.equal(existsSync(versionsPath), true, "rightkit-versions.json must be the single current-version source");
|
|
319
394
|
assert.match(versions.packageManager, /^pnpm@\d+\.\d+\.\d+$/);
|
|
320
|
-
assert.equal(versions.npm["@rightkit/release"], "0.2.
|
|
395
|
+
assert.equal(versions.npm["@rightkit/release"], "0.2.40");
|
|
321
396
|
assert.equal(versions.npm["@rightkit/legal"], "0.2.0");
|
|
322
397
|
assert.equal(versions.npm["@rightkit/license"], "0.1.5");
|
|
323
398
|
assert.equal(versions.npm["@rightkit/logs"], "0.1.3");
|
|
@@ -399,14 +474,7 @@ for (const app of apps) {
|
|
|
399
474
|
assert.equal(pkg.scripts["release:doctor"], "right-release doctor");
|
|
400
475
|
assert.equal(pkg.scripts["release:mac"], undefined, "tierless release entry points are forbidden");
|
|
401
476
|
assert.equal(pkg.scripts["release:win"], undefined, "tierless release entry points are forbidden");
|
|
402
|
-
|
|
403
|
-
assert.equal(pkg.scripts["release:patch:win"], "right-release --platform win --tier patch");
|
|
404
|
-
assert.equal(pkg.scripts["release:update:mac"], "right-release --platform mac --tier update");
|
|
405
|
-
assert.equal(pkg.scripts["release:update:win"], "right-release --platform win --tier update");
|
|
406
|
-
assert.equal(pkg.scripts["publish:patch:mac"], "right-release publish --platform mac --tier patch");
|
|
407
|
-
assert.equal(pkg.scripts["publish:patch:win"], "right-release publish --platform win --tier patch");
|
|
408
|
-
assert.equal(pkg.scripts["publish:update:mac"], "right-release publish --platform mac --tier update");
|
|
409
|
-
assert.equal(pkg.scripts["publish:update:win"], "right-release publish --platform win --tier update");
|
|
477
|
+
assertReleasePackageScripts(pkg.scripts, app.key);
|
|
410
478
|
assert.equal(pkg.scripts["deps:check"], "right-release deps --check");
|
|
411
479
|
assert.equal(pkg.scripts["deps:update"], "right-release deps --update");
|
|
412
480
|
assert.ok(!Object.entries(pkg.scripts).some(([name, command]) => /^(?:release|publish):/i.test(name) && /unsigned|--no-sign/i.test(command)), `${app.key} release/publish commands must not expose an unsigned macOS DMG mode`);
|
|
@@ -431,8 +499,7 @@ for (const app of apps) {
|
|
|
431
499
|
assert.match(updater.key, /\/updates\/(mac|windows)\/current\//, `${app.key} ${platform} updaters must replace the stable current R2 object`);
|
|
432
500
|
}
|
|
433
501
|
}
|
|
434
|
-
|
|
435
|
-
assert.deepEqual(config.targets.mac.package.args, ["run", "mac:dmg:notarized"], `${app.key} R2 release must use the signed and notarized macOS package entry point`);
|
|
502
|
+
assertMacPackageEntry(config.targets.mac.package, pkg.scripts, app.key);
|
|
436
503
|
for (const installer of config.targets.mac.installer.artifacts) {
|
|
437
504
|
assert.equal(path.dirname(installer.file), ".", `${app.key} macOS installer must be copied to the app package root before upload`);
|
|
438
505
|
}
|
package/rightkit-versions.json
CHANGED