@rippling/cli 1.0.4 → 1.0.6
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/bin/darwin-amd64/rippling +0 -0
- package/bin/darwin-arm64/rippling +0 -0
- package/bin/linux-amd64/rippling +0 -0
- package/bin/linux-arm64/rippling +0 -0
- package/bin/rippling.js +13 -8
- package/host.json +12 -11
- package/lib/install.js +28 -3
- package/lib/install.test.js +65 -1
- package/package.json +1 -1
- package/skills.tar.gz +0 -0
|
Binary file
|
|
Binary file
|
package/bin/linux-amd64/rippling
CHANGED
|
Binary file
|
package/bin/linux-arm64/rippling
CHANGED
|
Binary file
|
package/bin/rippling.js
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
const { spawn } = require("child_process");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const {
|
|
8
|
+
hostBinaryPath,
|
|
9
|
+
hostCacheDir,
|
|
10
|
+
packageDistribution,
|
|
11
|
+
} = require("../lib/install");
|
|
9
12
|
|
|
10
|
-
function currentVersion() {
|
|
11
|
-
const
|
|
12
|
-
const stamp = path.join(home, "host", "current-version");
|
|
13
|
+
function currentVersion(distribution) {
|
|
14
|
+
const stamp = path.join(hostCacheDir(distribution), "current-version");
|
|
13
15
|
if (fs.existsSync(stamp)) {
|
|
14
16
|
return fs.readFileSync(stamp, "utf8").trim();
|
|
15
17
|
}
|
|
@@ -17,16 +19,19 @@ function currentVersion() {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
function main() {
|
|
20
|
-
const
|
|
22
|
+
const distribution = packageDistribution(path.join(__dirname, ".."));
|
|
23
|
+
const ver = currentVersion(distribution);
|
|
21
24
|
if (!ver) {
|
|
22
25
|
console.error(
|
|
23
26
|
"Rippling host binary not installed. Re-run: npm i -g @rippling/cli",
|
|
24
27
|
);
|
|
25
28
|
process.exit(1);
|
|
26
29
|
}
|
|
27
|
-
const bin = hostBinaryPath(ver);
|
|
30
|
+
const bin = hostBinaryPath(ver, distribution);
|
|
28
31
|
if (!fs.existsSync(bin)) {
|
|
29
|
-
console.error(
|
|
32
|
+
console.error(
|
|
33
|
+
`Cached host binary missing at ${bin}. Re-run: npm i -g @rippling/cli`,
|
|
34
|
+
);
|
|
30
35
|
process.exit(1);
|
|
31
36
|
}
|
|
32
37
|
const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
|
package/host.json
CHANGED
|
@@ -2,45 +2,46 @@
|
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"transport": "github-npm",
|
|
4
4
|
"package": "@rippling/cli",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.6",
|
|
6
|
+
"distribution": "public",
|
|
6
7
|
"artifacts": [
|
|
7
8
|
{
|
|
8
9
|
"arch": "arm64",
|
|
9
10
|
"os": "darwin",
|
|
10
11
|
"path": "bin/darwin-arm64/rippling",
|
|
11
|
-
"sha256": "
|
|
12
|
-
"signature": "
|
|
12
|
+
"sha256": "218a790990b1736a2fc37c47b2a23a34501ccce574ff885b6646dde551f76866",
|
|
13
|
+
"signature": "lGgNFTBFUWN1IKz1V5P0OPN5/MAb38oiibhyTQjo0OBQ4TrQdZ0ceTVLFGeDAuPKJ/e8RMB+QGL7ZVRQyEGBDA==",
|
|
13
14
|
"signature_key_id": "rippling-cli-public-beta-2026-10"
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
17
|
"arch": "amd64",
|
|
17
18
|
"os": "darwin",
|
|
18
19
|
"path": "bin/darwin-amd64/rippling",
|
|
19
|
-
"sha256": "
|
|
20
|
-
"signature": "
|
|
20
|
+
"sha256": "1a88920187f918489f07dc8818108337fab37330dd9e0da63beb4455a1ed7400",
|
|
21
|
+
"signature": "j3A0lrGWjMjg1N8aVv2uOsXFXI9xmQAlClD3AtUxvrMsLdKqPNBgJoGsOPM1kJiIcK/IVC433/2eYAhCPY2fDg==",
|
|
21
22
|
"signature_key_id": "rippling-cli-public-beta-2026-10"
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
"arch": "arm64",
|
|
25
26
|
"os": "linux",
|
|
26
27
|
"path": "bin/linux-arm64/rippling",
|
|
27
|
-
"sha256": "
|
|
28
|
-
"signature": "
|
|
28
|
+
"sha256": "1a098416ccfaf17c87e775b9e97958c97d90359296d4837b3b33369b0e348e7b",
|
|
29
|
+
"signature": "XmZiYkL5KhynigZXjjeOGejLDy/B+MZ+4Ewe9WnWYjmxpFcHWeOCXk4gjv9R/FNR59Flcgran+MDZkHL1HQjCA==",
|
|
29
30
|
"signature_key_id": "rippling-cli-public-beta-2026-10"
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
"arch": "amd64",
|
|
33
34
|
"os": "linux",
|
|
34
35
|
"path": "bin/linux-amd64/rippling",
|
|
35
|
-
"sha256": "
|
|
36
|
-
"signature": "
|
|
36
|
+
"sha256": "91e61a9e3b56b2d42489f3dd1bea52448b3d2c356ef72c6493c0934beb151892",
|
|
37
|
+
"signature": "Mqv8bh2iOAIDuC3LXhzIdGAJvK7HUZrlgLxCkLm4zQymeUjCy98BcTVz6XMbSq6xxkpsYANNg47h5BGn8cRmDA==",
|
|
37
38
|
"signature_key_id": "rippling-cli-public-beta-2026-10"
|
|
38
39
|
}
|
|
39
40
|
],
|
|
40
41
|
"skills": {
|
|
41
42
|
"path": "skills.tar.gz",
|
|
42
|
-
"sha256": "
|
|
43
|
-
"signature": "
|
|
43
|
+
"sha256": "4de999fb2178569c2e2be66767f8908a74adde5026a519c8305a9d0b090dfaa7",
|
|
44
|
+
"signature": "fgYODL57ZLWEY2eUJSl5iVXa/8fsaVjoAAK2p/D9hGzVJPRq8bRvXN1oB6is29TXkJT2ZeFP9i0UM74apEI2CA==",
|
|
44
45
|
"signature_key_id": "rippling-cli-public-beta-2026-10"
|
|
45
46
|
}
|
|
46
47
|
}
|
package/lib/install.js
CHANGED
|
@@ -12,9 +12,28 @@ function ripplingHome() {
|
|
|
12
12
|
return path.join(os.homedir(), ".rippling");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
function hostCacheDir(distribution) {
|
|
16
|
+
if (distribution !== "public" && distribution !== "private") {
|
|
17
|
+
throw new Error("Invalid CLI distribution");
|
|
18
|
+
}
|
|
19
|
+
return path.join(
|
|
20
|
+
ripplingHome(),
|
|
21
|
+
distribution === "public" ? "host-public" : "host",
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function packageDistribution(root) {
|
|
26
|
+
const manifest = JSON.parse(
|
|
27
|
+
fs.readFileSync(path.join(root, "host.json"), "utf8"),
|
|
28
|
+
);
|
|
29
|
+
const distribution = manifest.distribution || "private";
|
|
30
|
+
hostCacheDir(distribution);
|
|
31
|
+
return distribution;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function hostBinaryPath(version, distribution) {
|
|
16
35
|
const name = process.platform === "win32" ? "rippling.exe" : "rippling";
|
|
17
|
-
return path.join(
|
|
36
|
+
return path.join(hostCacheDir(distribution), version, name);
|
|
18
37
|
}
|
|
19
38
|
|
|
20
39
|
function parseArgs(argv) {
|
|
@@ -44,7 +63,11 @@ function packagePlatformDir(platform, arch) {
|
|
|
44
63
|
return `${goos}-${goarch === "amd64" ? "amd64" : goarch}`;
|
|
45
64
|
}
|
|
46
65
|
|
|
47
|
-
function packageHostBinary(
|
|
66
|
+
function packageHostBinary(
|
|
67
|
+
root,
|
|
68
|
+
platform = process.platform,
|
|
69
|
+
arch = process.arch,
|
|
70
|
+
) {
|
|
48
71
|
const binaryName = platform === "win32" ? "rippling.exe" : "rippling";
|
|
49
72
|
return path.join(root, "bin", packagePlatformDir(platform, arch), binaryName);
|
|
50
73
|
}
|
|
@@ -89,6 +112,8 @@ async function install(options = {}) {
|
|
|
89
112
|
module.exports = {
|
|
90
113
|
install,
|
|
91
114
|
hostBinaryPath,
|
|
115
|
+
hostCacheDir,
|
|
116
|
+
packageDistribution,
|
|
92
117
|
hostInstallArgs,
|
|
93
118
|
packageHostBinary,
|
|
94
119
|
packagePlatformDir,
|
package/lib/install.test.js
CHANGED
|
@@ -5,6 +5,7 @@ const assert = require("node:assert/strict");
|
|
|
5
5
|
const fs = require("node:fs");
|
|
6
6
|
const os = require("node:os");
|
|
7
7
|
const path = require("node:path");
|
|
8
|
+
const { spawnSync } = require("node:child_process");
|
|
8
9
|
const {
|
|
9
10
|
hostInstallArgs,
|
|
10
11
|
install,
|
|
@@ -48,7 +49,15 @@ describe("hostInstallArgs", () => {
|
|
|
48
49
|
it("builds the shared Go installer command", () => {
|
|
49
50
|
assert.deepEqual(
|
|
50
51
|
hostInstallArgs("/pkg", { version: "1.2.3", skipSkills: true }),
|
|
51
|
-
[
|
|
52
|
+
[
|
|
53
|
+
"host",
|
|
54
|
+
"install",
|
|
55
|
+
"--package-root",
|
|
56
|
+
"/pkg",
|
|
57
|
+
"--version",
|
|
58
|
+
"1.2.3",
|
|
59
|
+
"--skip-skills",
|
|
60
|
+
],
|
|
52
61
|
);
|
|
53
62
|
});
|
|
54
63
|
});
|
|
@@ -89,3 +98,58 @@ describe("install", () => {
|
|
|
89
98
|
}
|
|
90
99
|
});
|
|
91
100
|
});
|
|
101
|
+
|
|
102
|
+
describe("launcher", () => {
|
|
103
|
+
it(
|
|
104
|
+
"selects its distribution when public and private caches coexist",
|
|
105
|
+
{ skip: process.platform === "win32" },
|
|
106
|
+
() => {
|
|
107
|
+
const root = fs.mkdtempSync(
|
|
108
|
+
path.join(os.tmpdir(), "rippling-launcher-test-"),
|
|
109
|
+
);
|
|
110
|
+
try {
|
|
111
|
+
const packageRoot = path.join(root, "package");
|
|
112
|
+
for (const file of [
|
|
113
|
+
"bin/rippling.js",
|
|
114
|
+
"lib/install.js",
|
|
115
|
+
"lib/platform.js",
|
|
116
|
+
]) {
|
|
117
|
+
const destination = path.join(packageRoot, file);
|
|
118
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
119
|
+
fs.copyFileSync(path.join(__dirname, "..", file), destination);
|
|
120
|
+
}
|
|
121
|
+
for (const [distribution, cache] of [
|
|
122
|
+
["private", "host"],
|
|
123
|
+
["public", "host-public"],
|
|
124
|
+
]) {
|
|
125
|
+
const cacheRoot = path.join(root, cache);
|
|
126
|
+
fs.mkdirSync(path.join(cacheRoot, "1.0.0"), { recursive: true });
|
|
127
|
+
fs.writeFileSync(path.join(cacheRoot, "current-version"), "1.0.0\n");
|
|
128
|
+
fs.writeFileSync(
|
|
129
|
+
path.join(cacheRoot, "1.0.0", "rippling"),
|
|
130
|
+
`#!/bin/sh\necho ${distribution}\n`,
|
|
131
|
+
{ mode: 0o755 },
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
for (const distribution of ["private", "public"]) {
|
|
135
|
+
fs.writeFileSync(
|
|
136
|
+
path.join(packageRoot, "host.json"),
|
|
137
|
+
JSON.stringify({ distribution }),
|
|
138
|
+
);
|
|
139
|
+
const got = spawnSync(
|
|
140
|
+
process.execPath,
|
|
141
|
+
[path.join(packageRoot, "bin/rippling.js")],
|
|
142
|
+
{
|
|
143
|
+
env: { ...process.env, RIPPLING_HOME: root },
|
|
144
|
+
encoding: "utf8",
|
|
145
|
+
},
|
|
146
|
+
);
|
|
147
|
+
assert.equal(got.status, 0, got.stderr);
|
|
148
|
+
assert.equal(got.stdout.trim(), distribution);
|
|
149
|
+
}
|
|
150
|
+
} finally {
|
|
151
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
);
|
|
155
|
+
});
|
package/package.json
CHANGED
package/skills.tar.gz
CHANGED
|
Binary file
|