@rightkit/release 0.2.69 → 0.2.70

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 (45) hide show
  1. package/package.json +4 -2
  2. package/rightkit-versions.json +3 -2
  3. package/addon-command.test.mjs +0 -54
  4. package/addon-contract.test.mjs +0 -48
  5. package/asr-artifact-adoption.test.mjs +0 -122
  6. package/build-invocation-contract.test.mjs +0 -124
  7. package/build-release.test.mjs +0 -242
  8. package/cache-command.test.mjs +0 -118
  9. package/cache-policy.test.mjs +0 -346
  10. package/cargo-guard.test.mjs +0 -195
  11. package/cargo-target.test.mjs +0 -82
  12. package/create-mac-updater.test.mjs +0 -14
  13. package/github-release.test.mjs +0 -103
  14. package/heavy-command.test.mjs +0 -221
  15. package/legal-contract.test.mjs +0 -151
  16. package/mirror-root-artifact.test.mjs +0 -58
  17. package/model-promote.test.mjs +0 -284
  18. package/notary-auth.test.mjs +0 -31
  19. package/nsis-payload.test.mjs +0 -139
  20. package/nsis-upgrade-contract.test.mjs +0 -57
  21. package/pipeline-normalization-contract.test.mjs +0 -140
  22. package/preflight.test.mjs +0 -123
  23. package/progress-control.test.mjs +0 -56
  24. package/prune-r2.test.mjs +0 -12
  25. package/publish-cargo.test.mjs +0 -43
  26. package/publish-swift.test.mjs +0 -44
  27. package/publish-update.test.mjs +0 -207
  28. package/qa-contract.test.mjs +0 -47
  29. package/registry-parity.test.mjs +0 -30
  30. package/release-cli-contract.test.mjs +0 -119
  31. package/release-invocation.test.mjs +0 -22
  32. package/release-state.test.mjs +0 -395
  33. package/release-token.test.mjs +0 -21
  34. package/release.test.mjs +0 -533
  35. package/right-suite-contract.test.mjs +0 -1011
  36. package/rightapps-register.test.mjs +0 -28
  37. package/runtime-artifact-manifest.test.mjs +0 -128
  38. package/sign-updater.test.mjs +0 -12
  39. package/source-gate.test.mjs +0 -25
  40. package/standalone-clone-evidence.json +0 -32
  41. package/standalone-clone-verify.test.mjs +0 -76
  42. package/suite-doctor.test.mjs +0 -19
  43. package/target-bridge.test.mjs +0 -269
  44. package/tauri-bundle-marker.test.mjs +0 -81
  45. 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
- });