@rightkit/release 0.2.69 → 0.2.71

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.
Files changed (55) hide show
  1. package/build-release.mjs +19 -14
  2. package/cache-command.mjs +7 -4
  3. package/cli/right-release.mjs +0 -0
  4. package/native-cargo-layout.mjs +239 -0
  5. package/native-release-finalization.mjs +259 -0
  6. package/package.json +11 -11
  7. package/preflight.mjs +6 -3
  8. package/registry-parity.mjs +2 -2
  9. package/release-invocation.mjs +10 -2
  10. package/release-state.mjs +5 -2
  11. package/release.mjs +220 -12
  12. package/rightkit-versions.json +4 -2
  13. package/addon-command.test.mjs +0 -54
  14. package/addon-contract.test.mjs +0 -48
  15. package/asr-artifact-adoption.test.mjs +0 -122
  16. package/build-invocation-contract.test.mjs +0 -124
  17. package/build-release.test.mjs +0 -242
  18. package/cache-command.test.mjs +0 -118
  19. package/cache-policy.test.mjs +0 -346
  20. package/cargo-guard.test.mjs +0 -195
  21. package/cargo-target.test.mjs +0 -82
  22. package/create-mac-updater.test.mjs +0 -14
  23. package/github-release.test.mjs +0 -103
  24. package/heavy-command.test.mjs +0 -221
  25. package/legal-contract.test.mjs +0 -151
  26. package/mirror-root-artifact.test.mjs +0 -58
  27. package/model-promote.test.mjs +0 -284
  28. package/notary-auth.test.mjs +0 -31
  29. package/nsis-payload.test.mjs +0 -139
  30. package/nsis-upgrade-contract.test.mjs +0 -57
  31. package/pipeline-normalization-contract.test.mjs +0 -140
  32. package/preflight.test.mjs +0 -123
  33. package/progress-control.test.mjs +0 -56
  34. package/prune-r2.test.mjs +0 -12
  35. package/publish-cargo.test.mjs +0 -43
  36. package/publish-swift.test.mjs +0 -44
  37. package/publish-update.test.mjs +0 -207
  38. package/qa-contract.test.mjs +0 -47
  39. package/registry-parity.test.mjs +0 -30
  40. package/release-cli-contract.test.mjs +0 -119
  41. package/release-invocation.test.mjs +0 -22
  42. package/release-state.test.mjs +0 -395
  43. package/release-token.test.mjs +0 -21
  44. package/release.test.mjs +0 -533
  45. package/right-suite-contract.test.mjs +0 -1011
  46. package/rightapps-register.test.mjs +0 -28
  47. package/runtime-artifact-manifest.test.mjs +0 -128
  48. package/sign-updater.test.mjs +0 -12
  49. package/source-gate.test.mjs +0 -25
  50. package/standalone-clone-evidence.json +0 -32
  51. package/standalone-clone-verify.test.mjs +0 -76
  52. package/suite-doctor.test.mjs +0 -19
  53. package/target-bridge.test.mjs +0 -269
  54. package/tauri-bundle-marker.test.mjs +0 -81
  55. package/upload-large.test.mjs +0 -70
@@ -1,81 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import test from "node:test";
3
- import { BUNDLE_MARKERS, patchTauriBundleType, patchTauriBundleTypeForNsis, readTauriBundleMarkers } from "./tauri-bundle-marker.mjs";
4
-
5
- /** A stand-in binary: filler, one marker, filler. */
6
- function fakeBinary(code = BUNDLE_MARKERS.unknown, { copies = 1 } = {}) {
7
- const parts = [Buffer.alloc(64, 0x41)];
8
- for (let index = 0; index < copies; index += 1) {
9
- parts.push(Buffer.from(`__TAURI_BUNDLE_TYPE_VAR_${code}`, "ascii"), Buffer.alloc(32, 0x42));
10
- }
11
- return Buffer.concat(parts);
12
- }
13
-
14
- function memoryFs(initial) {
15
- const store = new Map([["binary.exe", Buffer.from(initial)]]);
16
- return {
17
- store,
18
- read: (file) => {
19
- const key = file.endsWith("binary.exe") ? "binary.exe" : file;
20
- const value = store.get(key);
21
- if (!value) throw Object.assign(new Error("ENOENT"), { code: "ENOENT" });
22
- return Buffer.from(value);
23
- },
24
- write: (file, bytes) => {
25
- store.set(file.endsWith("binary.exe") ? "binary.exe" : file, Buffer.from(bytes));
26
- },
27
- };
28
- }
29
-
30
- test("rewrites the single unknown marker to the NSIS marker and nothing else", () => {
31
- const fs = memoryFs(fakeBinary());
32
- const before = fs.read("binary.exe");
33
- const receipt = patchTauriBundleTypeForNsis("binary.exe", { read: fs.read, write: fs.write });
34
- const after = fs.read("binary.exe");
35
-
36
- assert.equal(receipt.alreadyPatched, false);
37
- assert.equal(receipt.bundle, "nsis");
38
- assert.equal(receipt.changedBytes, 3, "only the 3-character bundle code may change");
39
- assert.equal(after.length, before.length, "patching must not resize the binary");
40
- assert.equal(after.includes(Buffer.from("__TAURI_BUNDLE_TYPE_VAR_NSS")), true);
41
- assert.equal(after.includes(Buffer.from("__TAURI_BUNDLE_TYPE_VAR_UNK")), false);
42
- assert.notEqual(receipt.beforeSha256, receipt.afterSha256);
43
- });
44
-
45
- test("is idempotent: an already-patched binary is reported, not rewritten", () => {
46
- const fs = memoryFs(fakeBinary(BUNDLE_MARKERS.nsis));
47
- const receipt = patchTauriBundleTypeForNsis("binary.exe", { read: fs.read, write: fs.write });
48
- assert.equal(receipt.alreadyPatched, true);
49
- assert.equal(receipt.changedBytes, 0);
50
- assert.equal(receipt.beforeSha256, receipt.afterSha256, "an already-patched binary keeps its signed bytes");
51
- });
52
-
53
- test("fails closed when the binary carries more than one unknown marker", () => {
54
- const fs = memoryFs(fakeBinary(BUNDLE_MARKERS.unknown, { copies: 2 }));
55
- assert.throws(
56
- () => patchTauriBundleTypeForNsis("binary.exe", { read: fs.read, write: fs.write }),
57
- /found 2/,
58
- );
59
- });
60
-
61
- test("fails closed when no marker of any kind is present", () => {
62
- const fs = memoryFs(Buffer.alloc(128, 0x41));
63
- assert.throws(
64
- () => patchTauriBundleTypeForNsis("binary.exe", { read: fs.read, write: fs.write }),
65
- /refusing to guess the bundle identity/,
66
- );
67
- });
68
-
69
- test("rejects an unsupported bundle kind before touching the file", () => {
70
- const fs = memoryFs(fakeBinary());
71
- assert.throws(() => patchTauriBundleType("binary.exe", { bundle: "zip", read: fs.read, write: fs.write }), /unsupported Tauri bundle kind/);
72
- assert.equal(fs.read("binary.exe").includes(Buffer.from("__TAURI_BUNDLE_TYPE_VAR_UNK")), true);
73
- });
74
-
75
- test("readTauriBundleMarkers reports offsets without writing", () => {
76
- const fs = memoryFs(fakeBinary(BUNDLE_MARKERS.nsis));
77
- const report = readTauriBundleMarkers("binary.exe", { read: fs.read });
78
- assert.deepEqual(report.markers.nsis, [64]);
79
- assert.equal(report.markers.unknown, undefined);
80
- assert.match(report.sha256, /^[0-9a-f]{64}$/);
81
- });
@@ -1,70 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { mkdtempSync, writeFileSync } from "node:fs";
3
- import os from "node:os";
4
- import path from "node:path";
5
- import { spawnSync } from "node:child_process";
6
- import { fileURLToPath } from "node:url";
7
- import test from "node:test";
8
-
9
- const uploader = fileURLToPath(new URL("./upload-large.mjs", import.meta.url));
10
-
11
- function fixtureFile() {
12
- const dir = mkdtempSync(path.join(os.tmpdir(), "right-upload-test-"));
13
- const file = path.join(dir, "Artifact.exe");
14
- writeFileSync(file, "artifact");
15
- return file;
16
- }
17
-
18
- function run(bucket) {
19
- return spawnSync(process.execPath, [uploader, fixtureFile(), "fixture/updates/windows/current/Artifact.exe", bucket], {
20
- encoding: "utf8",
21
- env: { ...process.env, RIGHT_RELEASE_UPLOAD_DRY_RUN: "1" },
22
- });
23
- }
24
-
25
- test("uploads public artifacts through wrangler remote R2 downloads bucket", () => {
26
- const result = run("public");
27
- assert.equal(result.status, 0, result.stderr);
28
- assert.match(result.stdout, /wrangler r2 object put rightapps-downloads\/fixture\/updates\/windows\/current\/Artifact\.exe/);
29
- assert.match(result.stdout, /--remote/);
30
- assert.doesNotMatch(result.stdout, /workers\.dev|multipart|heardright-models/i);
31
- });
32
-
33
- test("uploads private artifacts through wrangler remote R2 updates bucket", () => {
34
- const result = run("private");
35
- assert.equal(result.status, 0, result.stderr);
36
- assert.match(result.stdout, /wrangler r2 object put rightapps-updates\/fixture\/updates\/windows\/current\/Artifact\.exe/);
37
- assert.match(result.stdout, /--remote/);
38
- });
39
-
40
- test("refuses unknown bucket aliases", () => {
41
- const result = run("random");
42
- assert.notEqual(result.status, 0);
43
- assert.match(result.stderr, /expected public\|private/);
44
- });
45
-
46
- test("resolves a real package runner for wrangler on this machine", () => {
47
- const result = run("public");
48
- assert.equal(result.status, 0, result.stderr);
49
- assert.match(result.stdout, /^runner: pnpm dlx$/m);
50
- });
51
-
52
- test("fails loudly when no package runner exists instead of skipping the upload", () => {
53
- const result = spawnSync(
54
- process.execPath,
55
- [uploader, fixtureFile(), "fixture/installers/windows/current/Artifact.exe", "public"],
56
- {
57
- encoding: "utf8",
58
- env: {
59
- ...process.env,
60
- RIGHT_RELEASE_UPLOAD_DRY_RUN: "1",
61
- RIGHT_RELEASE_WRANGLER_RUNNER: "",
62
- PATH: path.join(os.tmpdir(), "right-upload-empty-path"),
63
- Path: path.join(os.tmpdir(), "right-upload-empty-path"),
64
- PATHEXT: process.env.PATHEXT ?? "",
65
- },
66
- },
67
- );
68
- assert.notEqual(result.status, 0, "a box with no runner must not report a successful upload");
69
- assert.match(result.stderr, /no package runner found/);
70
- });