yaver-cli 1.99.24 → 1.99.27
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/package.json +1 -1
- package/src/postinstall.js +30 -0
package/package.json
CHANGED
package/src/postinstall.js
CHANGED
|
@@ -18,6 +18,11 @@ const CODING_RUNNER_BOOTSTRAP = [
|
|
|
18
18
|
{ command: "opencode", pkg: "opencode-ai", label: "OpenCode" },
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
+
const MOBILE_TOOL_BOOTSTRAP = [
|
|
22
|
+
{ command: "expo", pkg: "expo", label: "Expo CLI" },
|
|
23
|
+
{ command: "eas", pkg: "eas-cli", label: "EAS CLI" },
|
|
24
|
+
];
|
|
25
|
+
|
|
21
26
|
function envEnabled(name) {
|
|
22
27
|
const raw = String(process.env[name] || "").trim().toLowerCase();
|
|
23
28
|
return raw === "1" || raw === "true" || raw === "yes";
|
|
@@ -64,6 +69,27 @@ function installMissingCodingRunners() {
|
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
function installMissingMobileTools() {
|
|
73
|
+
const missing = MOBILE_TOOL_BOOTSTRAP.filter((entry) => !commandExists(entry.command));
|
|
74
|
+
if (missing.length === 0) {
|
|
75
|
+
log("Expo and EAS CLIs already exist on PATH.");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const npmCmd = (process.env.npm_execpath || "npm").trim() || "npm";
|
|
80
|
+
const packages = missing.map((entry) => entry.pkg);
|
|
81
|
+
const labels = missing.map((entry) => entry.label).join(", ");
|
|
82
|
+
try {
|
|
83
|
+
execSync(
|
|
84
|
+
`"${npmCmd}" install -g --no-fund --no-audit ${packages.join(" ")}`,
|
|
85
|
+
{ stdio: "inherit" },
|
|
86
|
+
);
|
|
87
|
+
log(`Installed missing mobile tools: ${labels}.`);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
log(`Skipping mobile tool bootstrap: ${error.message}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
67
93
|
// Make sure `yaver` resolves on PATH for the next shell session. npm's
|
|
68
94
|
// global prefix (e.g. ~/.npm-global/bin) is not on PATH by default on
|
|
69
95
|
// most Linux distros — so `npm install -g yaver-cli` succeeds but
|
|
@@ -150,6 +176,10 @@ async function main() {
|
|
|
150
176
|
log(`Skipping mobile bootstrap: ${error.message}`);
|
|
151
177
|
}
|
|
152
178
|
|
|
179
|
+
if (!envEnabled("YAVER_SKIP_POSTINSTALL_MOBILE_TOOLS")) {
|
|
180
|
+
installMissingMobileTools();
|
|
181
|
+
}
|
|
182
|
+
|
|
153
183
|
if (!envEnabled("YAVER_SKIP_POSTINSTALL_RUNNERS")) {
|
|
154
184
|
installMissingCodingRunners();
|
|
155
185
|
}
|