@winding-labs/zest 0.3.0 → 2.0.0
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/README.md +3 -2
- package/bin/zest.js +18 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,10 +13,11 @@ In a terminal it runs as a short guided setup: pick your tools (the ones found o
|
|
|
13
13
|
|
|
14
14
|
It works on macOS, Linux and Windows (x64) and needs Node.js 18 or newer for the installer only. The CLI itself is a standalone binary in `~/.zest/bin/zest` (`%USERPROFILE%\.zest\bin\zest.exe` on Windows, added to your user PATH — open a new terminal afterwards), verified against SHA256 checksums shipped in the npm package.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Then it opens your browser with a sign-in code filled in: one Approve signs in every plugin it installed. Without a terminal it prints `zest login` instead, which does the same. Only sessions started after setup are collected.
|
|
17
17
|
|
|
18
18
|
- `zest status` — your Zest plugins per tool: sign-in, sync, last sync and errors; `--watch` keeps it live, `--json` prints it as JSON
|
|
19
|
-
- `zest
|
|
19
|
+
- `zest login` — sign in once, for the CLI and every installed plugin that is not signed in yet
|
|
20
|
+
- `zest update` — install the newest release
|
|
20
21
|
- `zest pause` / `zest resume` — stop or restart uploads
|
|
21
22
|
- `zest logout` — sign this device out, also on the Zest server; the web app, your plugins and other devices stay signed in
|
|
22
23
|
- `npx @winding-labs/zest --uninstall` — stop collecting, remove the hooks, shims and the binary and sign out; the Zest plugins stay installed (it offers to turn back on any plugin the CLI replaced)
|
package/bin/zest.js
CHANGED
|
@@ -34,11 +34,20 @@ import {
|
|
|
34
34
|
writeFileSync
|
|
35
35
|
} from "node:fs";
|
|
36
36
|
import { homedir } from "node:os";
|
|
37
|
-
import { dirname, join, resolve, sep, win32 } from "node:path";
|
|
37
|
+
import { dirname, join as join2, resolve, sep, win32 } from "node:path";
|
|
38
38
|
import { pipeline } from "node:stream/promises";
|
|
39
39
|
import { createGunzip } from "node:zlib";
|
|
40
|
+
|
|
41
|
+
// ../../packages/plugin-common/src/utils/processes.ts
|
|
42
|
+
import { join } from "node:path";
|
|
43
|
+
function windowsSystemBinary(...parts) {
|
|
44
|
+
return join(process.env.SystemRoot || "C:\\Windows", "System32", ...parts);
|
|
45
|
+
}
|
|
46
|
+
var windowsPowerShell = () => windowsSystemBinary("WindowsPowerShell", "v1.0", "powershell.exe");
|
|
47
|
+
|
|
48
|
+
// ../../packages/plugin-common/release/prefetch.ts
|
|
40
49
|
function getCacheBase(namespace) {
|
|
41
|
-
return
|
|
50
|
+
return join2(homedir(), ".zest", "bin", namespace);
|
|
42
51
|
}
|
|
43
52
|
var DOWNLOAD_TIMEOUT_MS = 5 * 60000;
|
|
44
53
|
function getPlatformKey() {
|
|
@@ -84,8 +93,8 @@ function extractZipToFile(zipPath, destPath) {
|
|
|
84
93
|
}
|
|
85
94
|
async function downloadAndVerify(url, expectedSha, destDir, binName, fetchFn = fetch, userAgent = "zest-daemon") {
|
|
86
95
|
mkdirSync(destDir, { recursive: true });
|
|
87
|
-
const tempDl =
|
|
88
|
-
const tempBin =
|
|
96
|
+
const tempDl = join2(destDir, `.download.${process.pid}`);
|
|
97
|
+
const tempBin = join2(destDir, `.bin.${process.pid}`);
|
|
89
98
|
try {
|
|
90
99
|
const controller = new AbortController;
|
|
91
100
|
const timer = setTimeout(() => controller.abort(), DOWNLOAD_TIMEOUT_MS);
|
|
@@ -116,7 +125,7 @@ async function downloadAndVerify(url, expectedSha, destDir, binName, fetchFn = f
|
|
|
116
125
|
rmSync(tempBin, { force: true });
|
|
117
126
|
throw new Error(`SHA256 mismatch: expected ${expectedSha}, got ${actual}`);
|
|
118
127
|
}
|
|
119
|
-
const finalPath =
|
|
128
|
+
const finalPath = join2(destDir, binName);
|
|
120
129
|
renameSync(tempBin, finalPath);
|
|
121
130
|
chmodSync(finalPath, 493);
|
|
122
131
|
} catch (err) {
|
|
@@ -135,8 +144,8 @@ function gc(cacheBase, pinnedVersion, prefetchedVersion, currentVersion, logFn)
|
|
|
135
144
|
continue;
|
|
136
145
|
if (keep.has(entry.name))
|
|
137
146
|
continue;
|
|
138
|
-
const versionDir =
|
|
139
|
-
if (existsSync(
|
|
147
|
+
const versionDir = join2(cacheBase, entry.name);
|
|
148
|
+
if (existsSync(join2(versionDir, ".download-lock")))
|
|
140
149
|
continue;
|
|
141
150
|
rmSync(versionDir, { recursive: true, force: true });
|
|
142
151
|
}
|
|
@@ -145,13 +154,6 @@ function gc(cacheBase, pinnedVersion, prefetchedVersion, currentVersion, logFn)
|
|
|
145
154
|
}
|
|
146
155
|
}
|
|
147
156
|
|
|
148
|
-
// ../../packages/plugin-common/src/utils/processes.ts
|
|
149
|
-
import { join as join2 } from "node:path";
|
|
150
|
-
function windowsSystemBinary(...parts) {
|
|
151
|
-
return join2(process.env.SystemRoot || "C:\\Windows", "System32", ...parts);
|
|
152
|
-
}
|
|
153
|
-
var windowsPowerShell = () => windowsSystemBinary("WindowsPowerShell", "v1.0", "powershell.exe");
|
|
154
|
-
|
|
155
157
|
// ../../packages/plugin-common/src/utils/spawn-hidden.ts
|
|
156
158
|
var HIDDEN_LAUNCHER_FILENAME = "launch-hidden.vbs";
|
|
157
159
|
var HIDDEN_LAUNCHER_VBS = [
|
|
@@ -198,8 +200,8 @@ var addToUserPath = (dir, first = false) => editUserPath(dir, true, first);
|
|
|
198
200
|
|
|
199
201
|
// src/bootstrap.ts
|
|
200
202
|
var REPO = "Winding-Labs/zest-cli";
|
|
201
|
-
var VERSION = "0.
|
|
202
|
-
var ASSETS = JSON.parse('{"darwin-arm64":{"file":"zest-darwin-arm64.gz","sha256":"
|
|
203
|
+
var VERSION = "2.0.0";
|
|
204
|
+
var ASSETS = JSON.parse('{"darwin-arm64":{"file":"zest-darwin-arm64.gz","sha256":"bcd4624180a179be0bcf3d430914045d9373c5168f7d4d252a37bf33d58bfe85"},"darwin-x64":{"file":"zest-darwin-x64.gz","sha256":"78b794050e19ab02edb441d1b9ba8df7c94cef52aacd6fc499fc88574a91b972"},"linux-arm64":{"file":"zest-linux-arm64.gz","sha256":"323746cf595fcee652c294a2ade2a1cf620090fd24b3757c8ecd787926d2b9e7"},"linux-x64":{"file":"zest-linux-x64.gz","sha256":"f323d11854f6f7b2b3dd49a60ede50b353a0f30916a28da0c2a117315da5e1d1"},"win-x64":{"file":"zest-win-x64.exe.zip","sha256":"a40757910d26b849f1b8c5247b3831258f7989f6fa47a9810b7bb65cec8fc78d"}}');
|
|
203
205
|
function linkOnPath(target) {
|
|
204
206
|
const dir = join3(homedir2(), ".local", "bin");
|
|
205
207
|
const link = join3(dir, "zest");
|