lacy 1.8.9 → 1.8.11
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/index.mjs +47 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -116,6 +116,48 @@ const ALL_RC_FILES = [
|
|
|
116
116
|
join(homedir(), ".config", "fish", "conf.d", "lacy.fish"),
|
|
117
117
|
];
|
|
118
118
|
|
|
119
|
+
// ============================================================================
|
|
120
|
+
// Analytics — lightweight, anonymous install tracking via Umami
|
|
121
|
+
// No PII collected. Respects DO_NOT_TRACK. See: https://umami.is
|
|
122
|
+
// ============================================================================
|
|
123
|
+
|
|
124
|
+
const UMAMI_URL = process.env.LACY_UMAMI_URL || "https://analytics.lacy.sh";
|
|
125
|
+
const UMAMI_WEBSITE_ID = process.env.LACY_UMAMI_WEBSITE_ID || "577521d7-3db7-4a77-a45c-3c97f21b5322";
|
|
126
|
+
|
|
127
|
+
function trackEvent(eventName, method = "npx") {
|
|
128
|
+
if (process.env.DO_NOT_TRACK === "1" || process.env.LACY_NO_TELEMETRY === "1") return;
|
|
129
|
+
|
|
130
|
+
const version = getVersion();
|
|
131
|
+
fetch(`${UMAMI_URL}/api/send`, {
|
|
132
|
+
method: "POST",
|
|
133
|
+
signal: AbortSignal.timeout(5000),
|
|
134
|
+
headers: {
|
|
135
|
+
"Content-Type": "application/json",
|
|
136
|
+
"User-Agent": `lacy-install/${version}`,
|
|
137
|
+
},
|
|
138
|
+
body: JSON.stringify({
|
|
139
|
+
type: "event",
|
|
140
|
+
payload: {
|
|
141
|
+
hostname: "lacy.sh",
|
|
142
|
+
language: "",
|
|
143
|
+
referrer: "",
|
|
144
|
+
screen: "",
|
|
145
|
+
title: "Install",
|
|
146
|
+
url: `/install/${method}`,
|
|
147
|
+
website: UMAMI_WEBSITE_ID,
|
|
148
|
+
name: eventName,
|
|
149
|
+
data: {
|
|
150
|
+
method,
|
|
151
|
+
os: process.platform,
|
|
152
|
+
arch: process.arch,
|
|
153
|
+
shell: detectShell(),
|
|
154
|
+
version,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
}),
|
|
158
|
+
}).catch(() => {});
|
|
159
|
+
}
|
|
160
|
+
|
|
119
161
|
const TOOLS = [
|
|
120
162
|
{ value: "lash", label: "lash", hint: "AI coding agent — lash.lacy.sh (recommended)" },
|
|
121
163
|
{ value: "claude", label: "claude", hint: "Claude Code CLI" },
|
|
@@ -289,6 +331,8 @@ async function doUninstall({ askConfirm = true } = {}) {
|
|
|
289
331
|
|
|
290
332
|
removeSpinner.stop("Installation removed");
|
|
291
333
|
|
|
334
|
+
trackEvent("uninstall", "npx");
|
|
335
|
+
|
|
292
336
|
p.log.success("Lacy Shell uninstalled");
|
|
293
337
|
|
|
294
338
|
await restartShell("Restart shell now?");
|
|
@@ -630,6 +674,8 @@ auto_detection:
|
|
|
630
674
|
// Re-read version after install (repo was just cloned/updated)
|
|
631
675
|
const installedVersion = getVersion();
|
|
632
676
|
|
|
677
|
+
trackEvent("install", "npx");
|
|
678
|
+
|
|
633
679
|
// Success message
|
|
634
680
|
p.log.success(pc.green(`Installation complete!`) + pc.dim(` v${installedVersion}`));
|
|
635
681
|
|
|
@@ -917,6 +963,7 @@ ${pc.dim("https://github.com/lacymorrow/lacy")}
|
|
|
917
963
|
execSync("git pull origin main", { cwd: updateDir, stdio: "pipe" });
|
|
918
964
|
const updatedVersion = getVersion();
|
|
919
965
|
updateSpinner.stop(`Lacy updated to v${updatedVersion}`);
|
|
966
|
+
trackEvent("update", "npx");
|
|
920
967
|
p.log.success("Update complete!");
|
|
921
968
|
await restartShell();
|
|
922
969
|
p.outro("Restart your terminal to apply changes.");
|