@rightkit/release 0.2.24 → 0.2.26
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/legal-contract.mjs +2 -5
- package/legal-contract.test.mjs +1 -3
- package/package.json +1 -1
- package/right-suite-contract.test.mjs +3 -3
- package/rightkit-versions.json +3 -3
- package/upload-large.mjs +38 -1
- package/upload-large.test.mjs +41 -0
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.26",
|
|
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": {
|
|
@@ -317,8 +317,8 @@ 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");
|
|
@@ -326,7 +326,7 @@ test("RightKit exposes one current version manifest", () => {
|
|
|
326
326
|
assert.equal(versions.cargo["rightkit-license"], "0.1.2");
|
|
327
327
|
assert.equal(versions.cargo["rightkit-logs"], "0.1.0");
|
|
328
328
|
assert.equal(versions.cargo["rightkit-tauri"], "0.1.0");
|
|
329
|
-
assert.deepEqual(versions.stagedCargo, {});
|
|
329
|
+
assert.deepEqual(versions.stagedCargo, { "rightkit-license": "0.1.3" });
|
|
330
330
|
getCurrentCargoVersionContract();
|
|
331
331
|
});
|
|
332
332
|
|
package/rightkit-versions.json
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
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
|
},
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"rightkit-process": "0.1.0",
|
|
18
18
|
"rightkit-tauri": "0.1.0"
|
|
19
19
|
},
|
|
20
|
-
"stagedCargo": {},
|
|
20
|
+
"stagedCargo": { "rightkit-license": "0.1.3" },
|
|
21
21
|
"swift": {
|
|
22
22
|
"rightkit-swift": {
|
|
23
23
|
"url": "https://github.com/bogusyogi/rightkit-swift.git",
|
package/upload-large.mjs
CHANGED
|
@@ -8,6 +8,12 @@ const BUCKETS = new Map([
|
|
|
8
8
|
["public", "rightapps-downloads"],
|
|
9
9
|
["private", "rightapps-updates"],
|
|
10
10
|
]);
|
|
11
|
+
// Wrangler always runs remotely through a package runner; which one exists is machine-specific
|
|
12
|
+
// (a node install without npm/npx is normal when pnpm is the pinned package manager).
|
|
13
|
+
const RUNNERS = [
|
|
14
|
+
{ cmd: "npx", prefix: [] },
|
|
15
|
+
{ cmd: "pnpm", prefix: ["dlx"] },
|
|
16
|
+
];
|
|
11
17
|
|
|
12
18
|
const [, , localFile, r2Key, bucketAlias = "public"] = process.argv;
|
|
13
19
|
if (!localFile || !r2Key) {
|
|
@@ -36,11 +42,24 @@ const env = cleanCloudflareEnv(process.env);
|
|
|
36
42
|
console.log(`Uploading ${path.basename(localFile)} (${(fileSize / 1024 / 1024).toFixed(1)} MB) -> ${object}`);
|
|
37
43
|
console.log(`wrangler r2 object put ${object} --file ${path.resolve(localFile)} --remote`);
|
|
38
44
|
|
|
45
|
+
// Resolve the package runner before the dry-run exit: a release box without one cannot upload,
|
|
46
|
+
// and that must fail here rather than after a signed build has already been produced.
|
|
47
|
+
const runner = resolveRunner(env);
|
|
48
|
+
if (!runner) {
|
|
49
|
+
console.error(
|
|
50
|
+
"upload-large: no package runner found. Tried: " +
|
|
51
|
+
`${RUNNERS.map((entry) => [entry.cmd, ...entry.prefix].join(" ")).join(", ")}. ` +
|
|
52
|
+
"Install one, or set RIGHT_RELEASE_WRANGLER_RUNNER (e.g. \"pnpm dlx\").",
|
|
53
|
+
);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
console.log(`runner: ${[runner.cmd, ...runner.prefix].join(" ")}`);
|
|
57
|
+
|
|
39
58
|
if (process.env.RIGHT_RELEASE_UPLOAD_DRY_RUN === "1") {
|
|
40
59
|
process.exit(0);
|
|
41
60
|
}
|
|
42
61
|
|
|
43
|
-
const result = spawnSync(
|
|
62
|
+
const result = spawnSync(runner.cmd, [...runner.prefix, ...wranglerArgs], {
|
|
44
63
|
env,
|
|
45
64
|
stdio: "inherit",
|
|
46
65
|
shell: process.platform === "win32",
|
|
@@ -53,6 +72,24 @@ if (result.error) {
|
|
|
53
72
|
}
|
|
54
73
|
process.exit(result.status ?? 1);
|
|
55
74
|
|
|
75
|
+
function resolveRunner(env) {
|
|
76
|
+
const override = process.env.RIGHT_RELEASE_WRANGLER_RUNNER?.trim();
|
|
77
|
+
if (override) {
|
|
78
|
+
const [cmd, ...prefix] = override.split(/\s+/);
|
|
79
|
+
return { cmd, prefix };
|
|
80
|
+
}
|
|
81
|
+
for (const candidate of RUNNERS) {
|
|
82
|
+
const probe = spawnSync(candidate.cmd, ["--version"], {
|
|
83
|
+
env,
|
|
84
|
+
stdio: "ignore",
|
|
85
|
+
shell: process.platform === "win32",
|
|
86
|
+
windowsHide: true,
|
|
87
|
+
});
|
|
88
|
+
if (!probe.error && probe.status === 0) return candidate;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
56
93
|
function cleanCloudflareEnv(source) {
|
|
57
94
|
const env = { ...source, CLOUDFLARE_ACCOUNT_ID: source.CLOUDFLARE_ACCOUNT_ID || ACCOUNT_ID };
|
|
58
95
|
delete env.CLOUDFLARE_API_KEY;
|
package/upload-large.test.mjs
CHANGED
|
@@ -42,3 +42,44 @@ test("refuses unknown bucket aliases", () => {
|
|
|
42
42
|
assert.notEqual(result.status, 0);
|
|
43
43
|
assert.match(result.stderr, /expected public\|private/);
|
|
44
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
|
+
// A node install carrying neither npm nor npx is normal where pnpm is the pinned package
|
|
50
|
+
// manager; the uploader must find a runner that actually exists rather than assume npx.
|
|
51
|
+
assert.match(result.stdout, /^runner: (npx|pnpm dlx)$/m);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("fails loudly when no package runner exists instead of skipping the upload", () => {
|
|
55
|
+
const result = spawnSync(
|
|
56
|
+
process.execPath,
|
|
57
|
+
[uploader, fixtureFile(), "fixture/installers/windows/current/Artifact.exe", "public"],
|
|
58
|
+
{
|
|
59
|
+
encoding: "utf8",
|
|
60
|
+
env: {
|
|
61
|
+
...process.env,
|
|
62
|
+
RIGHT_RELEASE_UPLOAD_DRY_RUN: "1",
|
|
63
|
+
RIGHT_RELEASE_WRANGLER_RUNNER: "",
|
|
64
|
+
PATH: path.join(os.tmpdir(), "right-upload-empty-path"),
|
|
65
|
+
Path: path.join(os.tmpdir(), "right-upload-empty-path"),
|
|
66
|
+
PATHEXT: process.env.PATHEXT ?? "",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
assert.notEqual(result.status, 0, "a box with no runner must not report a successful upload");
|
|
71
|
+
assert.match(result.stderr, /no package runner found/);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("honours an explicit runner override", () => {
|
|
75
|
+
const result = spawnSync(
|
|
76
|
+
process.execPath,
|
|
77
|
+
[uploader, fixtureFile(), "fixture/installers/windows/current/Artifact.exe", "public"],
|
|
78
|
+
{
|
|
79
|
+
encoding: "utf8",
|
|
80
|
+
env: { ...process.env, RIGHT_RELEASE_UPLOAD_DRY_RUN: "1", RIGHT_RELEASE_WRANGLER_RUNNER: "pnpm dlx" },
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
assert.equal(result.status, 0, result.stderr);
|
|
84
|
+
assert.match(result.stdout, /^runner: pnpm dlx$/m);
|
|
85
|
+
});
|