@swmansion/argent 0.14.1-next.2 → 0.14.1-next.21
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 +70 -21
- package/bin/argent-android-devtools-0.1.0.apk +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/simulator-server +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/dist/bundled-paths.d.ts +1 -0
- package/dist/bundled-paths.js +136 -5
- package/dist/bundled-paths.js.map +1 -1
- package/dist/cli-cmds.mjs +624 -156
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +9 -3
- package/dist/cli.js.map +1 -1
- package/dist/installer.mjs +3182 -1424
- package/dist/mcp-server.mjs +304 -95
- package/dist/tool-server.cjs +2669 -1225
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
- package/scripts/postinstall.cjs +54 -8
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/scripts/postinstall.cjs
CHANGED
|
@@ -8,20 +8,66 @@ const os = require("os");
|
|
|
8
8
|
const fs = require("fs");
|
|
9
9
|
const path = require("path");
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
|
|
11
|
+
// Kill the running tool-server so the freshly-installed binary takes effect on
|
|
12
|
+
// next use — but ONLY when the tracked server belongs to THIS package's bundle.
|
|
13
|
+
// A repo-local devDependency install of argent must not tear down a tool-server
|
|
14
|
+
// spawned by a *different* install (another project's local copy, or the global
|
|
15
|
+
// binary) that an unrelated editor session is actively using.
|
|
16
|
+
//
|
|
17
|
+
// State records are per-install files (tool-server-<hash>.json) plus the legacy
|
|
18
|
+
// single-slot tool-server.json written by older versions — scan them all rather
|
|
19
|
+
// than reproducing the launcher's hash.
|
|
20
|
+
const stateDir = path.join(os.homedir(), ".argent");
|
|
21
|
+
const ownBundlePath = path.resolve(__dirname, "..", "dist", "tool-server.cjs");
|
|
22
|
+
|
|
23
|
+
function sameBundle(recorded) {
|
|
24
|
+
if (!recorded) return false;
|
|
25
|
+
if (path.resolve(recorded) === ownBundlePath) return true;
|
|
26
|
+
// Tolerate symlinked install layouts (npm global prefix, pnpm store) where the
|
|
27
|
+
// recorded path and our __dirname resolve to the same real file.
|
|
28
|
+
try {
|
|
29
|
+
return fs.realpathSync(recorded) === fs.realpathSync(ownBundlePath);
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function shouldKill(recorded) {
|
|
36
|
+
if (!recorded) return false;
|
|
37
|
+
if (sameBundle(recorded)) return true;
|
|
38
|
+
// A recorded bundle whose file is GONE can never serve again: pnpm/yarn
|
|
39
|
+
// global layouts keep the package in a version-pinned dir, so an upgrade
|
|
40
|
+
// replaces the dir instead of rewriting it in place and sameBundle never
|
|
41
|
+
// matches. No live install's server can be running from a nonexistent
|
|
42
|
+
// path, so retiring it is safe for every other session.
|
|
43
|
+
try {
|
|
44
|
+
fs.accessSync(recorded);
|
|
45
|
+
return false;
|
|
46
|
+
} catch {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
13
51
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
52
|
+
for (const name of fs.readdirSync(stateDir)) {
|
|
53
|
+
if (!/^tool-server(-[0-9a-f]{12})?\.json$/.test(name)) continue;
|
|
54
|
+
const stateFile = path.join(stateDir, name);
|
|
16
55
|
try {
|
|
17
|
-
|
|
56
|
+
const state = JSON.parse(fs.readFileSync(stateFile, "utf8"));
|
|
57
|
+
if (state && state.pid && shouldKill(state.bundlePath)) {
|
|
58
|
+
try {
|
|
59
|
+
process.kill(state.pid, "SIGTERM");
|
|
60
|
+
} catch {
|
|
61
|
+
/* process already gone — nothing to kill */
|
|
62
|
+
}
|
|
63
|
+
fs.unlinkSync(stateFile);
|
|
64
|
+
}
|
|
18
65
|
} catch {
|
|
19
|
-
/*
|
|
66
|
+
/* unreadable record — leave it alone */
|
|
20
67
|
}
|
|
21
68
|
}
|
|
22
|
-
fs.unlinkSync(stateFile);
|
|
23
69
|
} catch {
|
|
24
|
-
/* no state
|
|
70
|
+
/* no state dir — nothing to clean up */
|
|
25
71
|
}
|
|
26
72
|
|
|
27
73
|
// node-pty (optional dep, used by `argent lens`'s agent PTY proxy) ships its
|