@farm.js/cli 0.1.0-beta.5 → 0.1.0-beta.50
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/farm.js +148 -9
- package/dist/{add-integration-CdVfiPjG.mjs → add-integration-7hf9WI7e.mjs} +147 -140
- package/dist/add-integration-7hf9WI7e.mjs.map +1 -0
- package/dist/{add-integration-Xc0p-k-m.js → add-integration-Bz7WjUfh.js} +149 -169
- package/dist/add-integration-Bz7WjUfh.js.map +1 -0
- package/dist/add-integration.js +1 -1
- package/dist/add-integration.mjs +1 -1
- package/dist/build.js +5 -3
- package/dist/build.js.map +1 -1
- package/dist/build.mjs +5 -3
- package/dist/build.mjs.map +1 -1
- package/dist/index.js +812 -107
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +796 -108
- package/dist/index.mjs.map +1 -1
- package/dist/rolldown-runtime-VH7oDXx4.js +28 -0
- package/dist/telemetry.js +347 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/telemetry.mjs +337 -0
- package/dist/telemetry.mjs.map +1 -0
- package/package.json +3 -2
- package/dist/add-integration-CdVfiPjG.mjs.map +0 -1
- package/dist/add-integration-Xc0p-k-m.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
Object.defineProperty(exports, "__toESM", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return __toESM;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.js");
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
6
|
+
let node_crypto = require("node:crypto");
|
|
7
|
+
let node_os = require("node:os");
|
|
8
|
+
node_os = require_rolldown_runtime.__toESM(node_os);
|
|
9
|
+
//#region src/telemetry.ts
|
|
10
|
+
const TELEMETRY_SCHEMA_VERSION = 1;
|
|
11
|
+
const DEFAULT_TELEMETRY_ENDPOINT = "https://farmjs.dev/api/telemetry/v1/events";
|
|
12
|
+
const TELEMETRY_NOTICE_URL = "https://farmjs.dev/docs/telemetry";
|
|
13
|
+
const REQUEST_TIMEOUT_MS = 750;
|
|
14
|
+
const FARM_COMMANDS = [
|
|
15
|
+
"dev",
|
|
16
|
+
"build",
|
|
17
|
+
"auth:migrate",
|
|
18
|
+
"upgrade",
|
|
19
|
+
"generate",
|
|
20
|
+
"doctor",
|
|
21
|
+
"explain",
|
|
22
|
+
"preview",
|
|
23
|
+
"migrate",
|
|
24
|
+
"cron:list",
|
|
25
|
+
"cron:run",
|
|
26
|
+
"add:integration",
|
|
27
|
+
"deploy"
|
|
28
|
+
];
|
|
29
|
+
const FARM_TEMPLATES = [
|
|
30
|
+
"basic",
|
|
31
|
+
"react-compiler",
|
|
32
|
+
"auth",
|
|
33
|
+
"better-auth",
|
|
34
|
+
"ai",
|
|
35
|
+
"auth0",
|
|
36
|
+
"authjs",
|
|
37
|
+
"autumn",
|
|
38
|
+
"clerk",
|
|
39
|
+
"jobs-inngest",
|
|
40
|
+
"jobs-trigger",
|
|
41
|
+
"polar",
|
|
42
|
+
"resend",
|
|
43
|
+
"stripe",
|
|
44
|
+
"supabase",
|
|
45
|
+
"unkey",
|
|
46
|
+
"workos"
|
|
47
|
+
];
|
|
48
|
+
const RENDERERS = [
|
|
49
|
+
"react",
|
|
50
|
+
"preact",
|
|
51
|
+
"solid",
|
|
52
|
+
"vue",
|
|
53
|
+
"svelte"
|
|
54
|
+
];
|
|
55
|
+
const PACKAGE_MANAGERS = [
|
|
56
|
+
"npm",
|
|
57
|
+
"pnpm",
|
|
58
|
+
"yarn",
|
|
59
|
+
"bun"
|
|
60
|
+
];
|
|
61
|
+
const DEPLOY_TARGETS = [
|
|
62
|
+
"vercel",
|
|
63
|
+
"cloudflare",
|
|
64
|
+
"netlify",
|
|
65
|
+
"node",
|
|
66
|
+
"custom"
|
|
67
|
+
];
|
|
68
|
+
function defaultConfig() {
|
|
69
|
+
return {
|
|
70
|
+
version: TELEMETRY_SCHEMA_VERSION,
|
|
71
|
+
enabled: true,
|
|
72
|
+
noticeShown: false
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function configDirectory() {
|
|
76
|
+
if (process.env.FARM_TELEMETRY_CONFIG_DIR) return node_path.default.resolve(process.env.FARM_TELEMETRY_CONFIG_DIR);
|
|
77
|
+
if (process.platform === "win32") return node_path.default.join(process.env.APPDATA || node_path.default.join(node_os.default.homedir(), "AppData", "Roaming"), "farmjs");
|
|
78
|
+
if (process.platform === "darwin") return node_path.default.join(node_os.default.homedir(), "Library", "Application Support", "farmjs");
|
|
79
|
+
return node_path.default.join(process.env.XDG_CONFIG_HOME || node_path.default.join(node_os.default.homedir(), ".config"), "farmjs");
|
|
80
|
+
}
|
|
81
|
+
function getFarmTelemetryConfigFile() {
|
|
82
|
+
return node_path.default.join(configDirectory(), "telemetry.json");
|
|
83
|
+
}
|
|
84
|
+
async function readConfig() {
|
|
85
|
+
try {
|
|
86
|
+
const parsed = JSON.parse(await (0, node_fs_promises.readFile)(getFarmTelemetryConfigFile(), "utf8"));
|
|
87
|
+
if (parsed.version !== TELEMETRY_SCHEMA_VERSION) return {
|
|
88
|
+
config: defaultConfig(),
|
|
89
|
+
stored: false
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
config: {
|
|
93
|
+
version: TELEMETRY_SCHEMA_VERSION,
|
|
94
|
+
enabled: parsed.enabled === true,
|
|
95
|
+
noticeShown: parsed.noticeShown === true,
|
|
96
|
+
anonymousId: isUuid(parsed.anonymousId) ? parsed.anonymousId : void 0
|
|
97
|
+
},
|
|
98
|
+
stored: true
|
|
99
|
+
};
|
|
100
|
+
} catch {
|
|
101
|
+
return {
|
|
102
|
+
config: defaultConfig(),
|
|
103
|
+
stored: false
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function writeConfig(config) {
|
|
108
|
+
const file = getFarmTelemetryConfigFile();
|
|
109
|
+
const directory = node_path.default.dirname(file);
|
|
110
|
+
const temporaryFile = `${file}.${process.pid}.${(0, node_crypto.randomUUID)()}.tmp`;
|
|
111
|
+
try {
|
|
112
|
+
await (0, node_fs_promises.mkdir)(directory, {
|
|
113
|
+
recursive: true,
|
|
114
|
+
mode: 448
|
|
115
|
+
});
|
|
116
|
+
await (0, node_fs_promises.writeFile)(temporaryFile, `${JSON.stringify(config, null, 2)}\n`, { mode: 384 });
|
|
117
|
+
await (0, node_fs_promises.rename)(temporaryFile, file);
|
|
118
|
+
await (0, node_fs_promises.chmod)(file, 384).catch(() => void 0);
|
|
119
|
+
} catch {
|
|
120
|
+
await (0, node_fs_promises.unlink)(temporaryFile).catch(() => void 0);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function isUuid(value) {
|
|
124
|
+
return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
125
|
+
}
|
|
126
|
+
function isTrue(value) {
|
|
127
|
+
return value !== void 0 && [
|
|
128
|
+
"1",
|
|
129
|
+
"true",
|
|
130
|
+
"yes",
|
|
131
|
+
"on"
|
|
132
|
+
].includes(value.toLowerCase());
|
|
133
|
+
}
|
|
134
|
+
function isFalse(value) {
|
|
135
|
+
return value !== void 0 && [
|
|
136
|
+
"0",
|
|
137
|
+
"false",
|
|
138
|
+
"no",
|
|
139
|
+
"off"
|
|
140
|
+
].includes(value.toLowerCase());
|
|
141
|
+
}
|
|
142
|
+
function environmentDecision() {
|
|
143
|
+
if (process.env.DO_NOT_TRACK !== void 0 && !isFalse(process.env.DO_NOT_TRACK)) return {
|
|
144
|
+
enabled: false,
|
|
145
|
+
reason: "DO_NOT_TRACK is set"
|
|
146
|
+
};
|
|
147
|
+
if (isTrue(process.env.FARM_TELEMETRY_DISABLED)) return {
|
|
148
|
+
enabled: false,
|
|
149
|
+
reason: "FARM_TELEMETRY_DISABLED is set"
|
|
150
|
+
};
|
|
151
|
+
if (isTrue(process.env.FARM_TELEMETRY)) return { enabled: true };
|
|
152
|
+
if (isFalse(process.env.FARM_TELEMETRY)) return {
|
|
153
|
+
enabled: false,
|
|
154
|
+
reason: "FARM_TELEMETRY disables collection"
|
|
155
|
+
};
|
|
156
|
+
return {};
|
|
157
|
+
}
|
|
158
|
+
function isContinuousIntegration() {
|
|
159
|
+
return isTrue(process.env.CI) || isTrue(process.env.GITHUB_ACTIONS) || isTrue(process.env.BUILDKITE) || isTrue(process.env.CIRCLECI);
|
|
160
|
+
}
|
|
161
|
+
function isInteractive() {
|
|
162
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
163
|
+
}
|
|
164
|
+
function getEndpoint() {
|
|
165
|
+
const candidate = process.env.FARM_TELEMETRY_ENDPOINT || DEFAULT_TELEMETRY_ENDPOINT;
|
|
166
|
+
try {
|
|
167
|
+
const url = new URL(candidate);
|
|
168
|
+
const isLocal = [
|
|
169
|
+
"localhost",
|
|
170
|
+
"127.0.0.1",
|
|
171
|
+
"::1"
|
|
172
|
+
].includes(url.hostname);
|
|
173
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && isLocal)) return DEFAULT_TELEMETRY_ENDPOINT;
|
|
174
|
+
return url.toString();
|
|
175
|
+
} catch {
|
|
176
|
+
return DEFAULT_TELEMETRY_ENDPOINT;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function resolveState() {
|
|
180
|
+
const { config, stored } = await readConfig();
|
|
181
|
+
const environment = environmentDecision();
|
|
182
|
+
const enabled = environment.enabled ?? config.enabled;
|
|
183
|
+
const source = environment.enabled !== void 0 ? "environment" : stored ? "configuration" : "default";
|
|
184
|
+
if (!enabled) return {
|
|
185
|
+
config,
|
|
186
|
+
enabled,
|
|
187
|
+
active: false,
|
|
188
|
+
source,
|
|
189
|
+
reason: environment.reason
|
|
190
|
+
};
|
|
191
|
+
if (environment.enabled === true) return {
|
|
192
|
+
config,
|
|
193
|
+
enabled,
|
|
194
|
+
active: true,
|
|
195
|
+
source
|
|
196
|
+
};
|
|
197
|
+
if (process.env.NODE_ENV === "test") return {
|
|
198
|
+
config,
|
|
199
|
+
enabled,
|
|
200
|
+
active: false,
|
|
201
|
+
source,
|
|
202
|
+
reason: "test environments are skipped"
|
|
203
|
+
};
|
|
204
|
+
if (isContinuousIntegration()) return {
|
|
205
|
+
config,
|
|
206
|
+
enabled,
|
|
207
|
+
active: false,
|
|
208
|
+
source,
|
|
209
|
+
reason: "CI environments are skipped"
|
|
210
|
+
};
|
|
211
|
+
if (!isInteractive()) return {
|
|
212
|
+
config,
|
|
213
|
+
enabled,
|
|
214
|
+
active: false,
|
|
215
|
+
source,
|
|
216
|
+
reason: "non-interactive commands are skipped"
|
|
217
|
+
};
|
|
218
|
+
return {
|
|
219
|
+
config,
|
|
220
|
+
enabled,
|
|
221
|
+
active: true,
|
|
222
|
+
source
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
async function getFarmTelemetryStatus() {
|
|
226
|
+
const state = await resolveState();
|
|
227
|
+
return {
|
|
228
|
+
enabled: state.enabled,
|
|
229
|
+
active: state.active,
|
|
230
|
+
source: state.source,
|
|
231
|
+
endpoint: getEndpoint(),
|
|
232
|
+
configFile: getFarmTelemetryConfigFile(),
|
|
233
|
+
anonymousId: state.config.anonymousId,
|
|
234
|
+
reason: state.reason
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
async function setFarmTelemetryEnabled(enabled) {
|
|
238
|
+
const { config: current } = await readConfig();
|
|
239
|
+
await writeConfig({
|
|
240
|
+
version: TELEMETRY_SCHEMA_VERSION,
|
|
241
|
+
enabled,
|
|
242
|
+
noticeShown: true,
|
|
243
|
+
anonymousId: enabled ? current.anonymousId || (0, node_crypto.randomUUID)() : void 0
|
|
244
|
+
});
|
|
245
|
+
return getFarmTelemetryStatus();
|
|
246
|
+
}
|
|
247
|
+
async function showFarmTelemetryNotice() {
|
|
248
|
+
if (!isInteractive() || isContinuousIntegration() || process.env.NODE_ENV === "test") return;
|
|
249
|
+
if (environmentDecision().enabled !== void 0) return;
|
|
250
|
+
const { config } = await readConfig();
|
|
251
|
+
if (config.noticeShown) return;
|
|
252
|
+
process.stderr.write(`Farm.js collects anonymous CLI telemetry by default. Run "farm telemetry disable" to opt out.\nLearn more: ${TELEMETRY_NOTICE_URL}\n`);
|
|
253
|
+
await writeConfig({
|
|
254
|
+
...config,
|
|
255
|
+
noticeShown: true
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
function resolveFarmTelemetryCommand(value) {
|
|
259
|
+
return FARM_COMMANDS.includes(value) ? value : void 0;
|
|
260
|
+
}
|
|
261
|
+
async function trackFarmCommand(input) {
|
|
262
|
+
const deployTarget = allowlisted(input.deployTarget, DEPLOY_TARGETS);
|
|
263
|
+
await track({
|
|
264
|
+
eventType: "command_invoked",
|
|
265
|
+
source: "cli",
|
|
266
|
+
packageName: "@farm.js/cli",
|
|
267
|
+
packageVersion: sanitizeVersion(input.packageVersion),
|
|
268
|
+
command: input.command,
|
|
269
|
+
...deployTarget ? { deployTarget } : {}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
async function trackFarmProjectCreated(input) {
|
|
273
|
+
const template = allowlisted(input.template, FARM_TEMPLATES);
|
|
274
|
+
const renderer = allowlisted(input.renderer, RENDERERS);
|
|
275
|
+
const packageManager = allowlisted(input.packageManager, PACKAGE_MANAGERS);
|
|
276
|
+
await track({
|
|
277
|
+
eventType: "project_created",
|
|
278
|
+
source: "create-app",
|
|
279
|
+
packageName: "@farm.js/create-app",
|
|
280
|
+
packageVersion: sanitizeVersion(input.packageVersion),
|
|
281
|
+
...template ? { template } : {},
|
|
282
|
+
...renderer ? { renderer } : {},
|
|
283
|
+
...packageManager ? { packageManager } : {},
|
|
284
|
+
...typeof input.typescript === "boolean" ? { typescript: input.typescript } : {},
|
|
285
|
+
...typeof input.installedDependencies === "boolean" ? { installedDependencies: input.installedDependencies } : {}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
async function track(event) {
|
|
289
|
+
try {
|
|
290
|
+
const state = await resolveState();
|
|
291
|
+
if (!state.active) return;
|
|
292
|
+
const anonymousId = state.config.anonymousId || (0, node_crypto.randomUUID)();
|
|
293
|
+
if (!state.config.anonymousId) await writeConfig({
|
|
294
|
+
...state.config,
|
|
295
|
+
anonymousId
|
|
296
|
+
});
|
|
297
|
+
await send({
|
|
298
|
+
schemaVersion: TELEMETRY_SCHEMA_VERSION,
|
|
299
|
+
eventId: (0, node_crypto.randomUUID)(),
|
|
300
|
+
anonymousId,
|
|
301
|
+
nodeMajor: Number.parseInt(process.versions.node.split(".")[0] || "0", 10),
|
|
302
|
+
platform: normalizePlatform(process.platform),
|
|
303
|
+
architecture: normalizeArchitecture(process.arch),
|
|
304
|
+
...event
|
|
305
|
+
});
|
|
306
|
+
} catch {}
|
|
307
|
+
}
|
|
308
|
+
async function send(payload) {
|
|
309
|
+
const controller = new AbortController();
|
|
310
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
311
|
+
timeout.unref?.();
|
|
312
|
+
try {
|
|
313
|
+
await fetch(getEndpoint(), {
|
|
314
|
+
method: "POST",
|
|
315
|
+
headers: { "content-type": "application/json" },
|
|
316
|
+
body: JSON.stringify(payload),
|
|
317
|
+
signal: controller.signal,
|
|
318
|
+
keepalive: true
|
|
319
|
+
});
|
|
320
|
+
} catch {} finally {
|
|
321
|
+
clearTimeout(timeout);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function sanitizeVersion(value) {
|
|
325
|
+
return /^[0-9A-Za-z.+_-]{1,64}$/.test(value) ? value : "unknown";
|
|
326
|
+
}
|
|
327
|
+
function allowlisted(value, values) {
|
|
328
|
+
return value && values.includes(value) ? value : void 0;
|
|
329
|
+
}
|
|
330
|
+
function normalizePlatform(value) {
|
|
331
|
+
if (value === "darwin" || value === "linux") return value;
|
|
332
|
+
if (value === "win32") return "windows";
|
|
333
|
+
return "other";
|
|
334
|
+
}
|
|
335
|
+
function normalizeArchitecture(value) {
|
|
336
|
+
return value === "arm64" || value === "x64" ? value : "other";
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
exports.getFarmTelemetryConfigFile = getFarmTelemetryConfigFile;
|
|
340
|
+
exports.getFarmTelemetryStatus = getFarmTelemetryStatus;
|
|
341
|
+
exports.resolveFarmTelemetryCommand = resolveFarmTelemetryCommand;
|
|
342
|
+
exports.setFarmTelemetryEnabled = setFarmTelemetryEnabled;
|
|
343
|
+
exports.showFarmTelemetryNotice = showFarmTelemetryNotice;
|
|
344
|
+
exports.trackFarmCommand = trackFarmCommand;
|
|
345
|
+
exports.trackFarmProjectCreated = trackFarmProjectCreated;
|
|
346
|
+
|
|
347
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","names":["path","os","readFile","randomUUID","mkdir","writeFile","rename","chmod","unlink"],"sources":["../src/telemetry.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { chmod, mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nconst TELEMETRY_SCHEMA_VERSION = 1 as const;\nconst DEFAULT_TELEMETRY_ENDPOINT = \"https://farmjs.dev/api/telemetry/v1/events\";\nconst TELEMETRY_NOTICE_URL = \"https://farmjs.dev/docs/telemetry\";\nconst REQUEST_TIMEOUT_MS = 750;\n\nconst FARM_COMMANDS = [\n \"dev\",\n \"build\",\n \"auth:migrate\",\n \"upgrade\",\n \"generate\",\n \"doctor\",\n \"explain\",\n \"preview\",\n \"migrate\",\n \"cron:list\",\n \"cron:run\",\n \"add:integration\",\n \"deploy\",\n] as const;\n\nconst FARM_TEMPLATES = [\n \"basic\",\n \"react-compiler\",\n \"auth\",\n \"better-auth\",\n \"ai\",\n \"auth0\",\n \"authjs\",\n \"autumn\",\n \"clerk\",\n \"jobs-inngest\",\n \"jobs-trigger\",\n \"polar\",\n \"resend\",\n \"stripe\",\n \"supabase\",\n \"unkey\",\n \"workos\",\n] as const;\n\nconst RENDERERS = [\"react\", \"preact\", \"solid\", \"vue\", \"svelte\"] as const;\nconst PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\", \"bun\"] as const;\nconst DEPLOY_TARGETS = [\"vercel\", \"cloudflare\", \"netlify\", \"node\", \"custom\"] as const;\n\nexport type FarmTelemetryCommand = (typeof FARM_COMMANDS)[number];\nexport type FarmTelemetryTemplate = (typeof FARM_TEMPLATES)[number];\nexport type FarmTelemetryRenderer = (typeof RENDERERS)[number];\nexport type FarmTelemetryPackageManager = (typeof PACKAGE_MANAGERS)[number];\nexport type FarmTelemetryDeployTarget = (typeof DEPLOY_TARGETS)[number];\n\ninterface FarmTelemetryConfig {\n version: 1;\n enabled: boolean;\n noticeShown: boolean;\n anonymousId?: string;\n}\n\ninterface FarmTelemetryConfigState {\n config: FarmTelemetryConfig;\n stored: boolean;\n}\n\ninterface FarmTelemetryEventBase {\n schemaVersion: typeof TELEMETRY_SCHEMA_VERSION;\n eventId: string;\n anonymousId: string;\n source: \"cli\" | \"create-app\";\n packageName: \"@farm.js/cli\" | \"@farm.js/create-app\";\n packageVersion: string;\n nodeMajor: number;\n platform: \"darwin\" | \"linux\" | \"windows\" | \"other\";\n architecture: \"arm64\" | \"x64\" | \"other\";\n}\n\nexport interface FarmCommandTelemetryInput {\n command: FarmTelemetryCommand;\n packageVersion: string;\n deployTarget?: string;\n}\n\nexport interface FarmProjectCreatedTelemetryInput {\n packageVersion: string;\n template?: string;\n renderer?: string;\n packageManager?: string;\n typescript?: boolean;\n installedDependencies?: boolean;\n}\n\nexport interface FarmTelemetryStatus {\n enabled: boolean;\n active: boolean;\n source: \"configuration\" | \"environment\" | \"default\";\n endpoint: string;\n configFile: string;\n anonymousId?: string;\n reason?: string;\n}\n\ntype FarmTelemetryEvent =\n | (FarmTelemetryEventBase & {\n eventType: \"command_invoked\";\n command: FarmTelemetryCommand;\n deployTarget?: FarmTelemetryDeployTarget;\n })\n | (FarmTelemetryEventBase & {\n eventType: \"project_created\";\n template?: FarmTelemetryTemplate;\n renderer?: FarmTelemetryRenderer;\n packageManager?: FarmTelemetryPackageManager;\n typescript?: boolean;\n installedDependencies?: boolean;\n });\n\ntype FarmTelemetryGeneratedFields = Pick<\n FarmTelemetryEventBase,\n \"schemaVersion\" | \"eventId\" | \"anonymousId\" | \"nodeMajor\" | \"platform\" | \"architecture\"\n>;\ntype FarmTelemetryEventInput<T = FarmTelemetryEvent> = T extends FarmTelemetryEvent\n ? Omit<T, keyof FarmTelemetryGeneratedFields>\n : never;\n\nfunction defaultConfig(): FarmTelemetryConfig {\n return {\n version: TELEMETRY_SCHEMA_VERSION,\n enabled: true,\n noticeShown: false,\n };\n}\n\nfunction configDirectory(): string {\n if (process.env.FARM_TELEMETRY_CONFIG_DIR) {\n return path.resolve(process.env.FARM_TELEMETRY_CONFIG_DIR);\n }\n if (process.platform === \"win32\") {\n return path.join(\n process.env.APPDATA || path.join(os.homedir(), \"AppData\", \"Roaming\"),\n \"farmjs\",\n );\n }\n if (process.platform === \"darwin\") {\n return path.join(os.homedir(), \"Library\", \"Application Support\", \"farmjs\");\n }\n return path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), \".config\"), \"farmjs\");\n}\n\nexport function getFarmTelemetryConfigFile(): string {\n return path.join(configDirectory(), \"telemetry.json\");\n}\n\nasync function readConfig(): Promise<FarmTelemetryConfigState> {\n try {\n const parsed = JSON.parse(\n await readFile(getFarmTelemetryConfigFile(), \"utf8\"),\n ) as Partial<FarmTelemetryConfig>;\n if (parsed.version !== TELEMETRY_SCHEMA_VERSION) {\n return { config: defaultConfig(), stored: false };\n }\n return {\n config: {\n version: TELEMETRY_SCHEMA_VERSION,\n enabled: parsed.enabled === true,\n noticeShown: parsed.noticeShown === true,\n anonymousId: isUuid(parsed.anonymousId) ? parsed.anonymousId : undefined,\n },\n stored: true,\n };\n } catch {\n return { config: defaultConfig(), stored: false };\n }\n}\n\nasync function writeConfig(config: FarmTelemetryConfig): Promise<void> {\n const file = getFarmTelemetryConfigFile();\n const directory = path.dirname(file);\n const temporaryFile = `${file}.${process.pid}.${randomUUID()}.tmp`;\n try {\n await mkdir(directory, { recursive: true, mode: 0o700 });\n await writeFile(temporaryFile, `${JSON.stringify(config, null, 2)}\\n`, { mode: 0o600 });\n await rename(temporaryFile, file);\n await chmod(file, 0o600).catch(() => undefined);\n } catch {\n await unlink(temporaryFile).catch(() => undefined);\n // Telemetry is best-effort and must never make a Farm command fail.\n }\n}\n\nfunction isUuid(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value)\n );\n}\n\nfunction isTrue(value: string | undefined): boolean {\n return value !== undefined && [\"1\", \"true\", \"yes\", \"on\"].includes(value.toLowerCase());\n}\n\nfunction isFalse(value: string | undefined): boolean {\n return value !== undefined && [\"0\", \"false\", \"no\", \"off\"].includes(value.toLowerCase());\n}\n\nfunction environmentDecision(): { enabled?: boolean; reason?: string } {\n if (process.env.DO_NOT_TRACK !== undefined && !isFalse(process.env.DO_NOT_TRACK)) {\n return { enabled: false, reason: \"DO_NOT_TRACK is set\" };\n }\n if (isTrue(process.env.FARM_TELEMETRY_DISABLED)) {\n return { enabled: false, reason: \"FARM_TELEMETRY_DISABLED is set\" };\n }\n if (isTrue(process.env.FARM_TELEMETRY)) return { enabled: true };\n if (isFalse(process.env.FARM_TELEMETRY)) {\n return { enabled: false, reason: \"FARM_TELEMETRY disables collection\" };\n }\n return {};\n}\n\nfunction isContinuousIntegration(): boolean {\n return (\n isTrue(process.env.CI) ||\n isTrue(process.env.GITHUB_ACTIONS) ||\n isTrue(process.env.BUILDKITE) ||\n isTrue(process.env.CIRCLECI)\n );\n}\n\nfunction isInteractive(): boolean {\n return process.stdin.isTTY === true && process.stdout.isTTY === true;\n}\n\nfunction getEndpoint(): string {\n const candidate = process.env.FARM_TELEMETRY_ENDPOINT || DEFAULT_TELEMETRY_ENDPOINT;\n try {\n const url = new URL(candidate);\n const isLocal = [\"localhost\", \"127.0.0.1\", \"::1\"].includes(url.hostname);\n if (url.protocol !== \"https:\" && !(url.protocol === \"http:\" && isLocal)) {\n return DEFAULT_TELEMETRY_ENDPOINT;\n }\n return url.toString();\n } catch {\n return DEFAULT_TELEMETRY_ENDPOINT;\n }\n}\n\nasync function resolveState(): Promise<{\n config: FarmTelemetryConfig;\n enabled: boolean;\n active: boolean;\n source: FarmTelemetryStatus[\"source\"];\n reason?: string;\n}> {\n const { config, stored } = await readConfig();\n const environment = environmentDecision();\n const enabled = environment.enabled ?? config.enabled;\n const source =\n environment.enabled !== undefined ? \"environment\" : stored ? \"configuration\" : \"default\";\n\n if (!enabled) return { config, enabled, active: false, source, reason: environment.reason };\n if (environment.enabled === true) return { config, enabled, active: true, source };\n if (process.env.NODE_ENV === \"test\") {\n return { config, enabled, active: false, source, reason: \"test environments are skipped\" };\n }\n if (isContinuousIntegration()) {\n return { config, enabled, active: false, source, reason: \"CI environments are skipped\" };\n }\n if (!isInteractive()) {\n return {\n config,\n enabled,\n active: false,\n source,\n reason: \"non-interactive commands are skipped\",\n };\n }\n return { config, enabled, active: true, source };\n}\n\nexport async function getFarmTelemetryStatus(): Promise<FarmTelemetryStatus> {\n const state = await resolveState();\n return {\n enabled: state.enabled,\n active: state.active,\n source: state.source,\n endpoint: getEndpoint(),\n configFile: getFarmTelemetryConfigFile(),\n anonymousId: state.config.anonymousId,\n reason: state.reason,\n };\n}\n\nexport async function setFarmTelemetryEnabled(enabled: boolean): Promise<FarmTelemetryStatus> {\n const { config: current } = await readConfig();\n await writeConfig({\n version: TELEMETRY_SCHEMA_VERSION,\n enabled,\n noticeShown: true,\n anonymousId: enabled ? current.anonymousId || randomUUID() : undefined,\n });\n return getFarmTelemetryStatus();\n}\n\nexport async function showFarmTelemetryNotice(): Promise<void> {\n if (!isInteractive() || isContinuousIntegration() || process.env.NODE_ENV === \"test\") return;\n if (environmentDecision().enabled !== undefined) return;\n const { config } = await readConfig();\n if (config.noticeShown) return;\n process.stderr.write(\n `Farm.js collects anonymous CLI telemetry by default. Run \"farm telemetry disable\" to opt out.\\nLearn more: ${TELEMETRY_NOTICE_URL}\\n`,\n );\n await writeConfig({ ...config, noticeShown: true });\n}\n\nexport function resolveFarmTelemetryCommand(value: string): FarmTelemetryCommand | undefined {\n return (FARM_COMMANDS as readonly string[]).includes(value)\n ? (value as FarmTelemetryCommand)\n : undefined;\n}\n\nexport async function trackFarmCommand(input: FarmCommandTelemetryInput): Promise<void> {\n const deployTarget = allowlisted(input.deployTarget, DEPLOY_TARGETS);\n await track({\n eventType: \"command_invoked\",\n source: \"cli\",\n packageName: \"@farm.js/cli\",\n packageVersion: sanitizeVersion(input.packageVersion),\n command: input.command,\n ...(deployTarget ? { deployTarget } : {}),\n });\n}\n\nexport async function trackFarmProjectCreated(\n input: FarmProjectCreatedTelemetryInput,\n): Promise<void> {\n const template = allowlisted(input.template, FARM_TEMPLATES);\n const renderer = allowlisted(input.renderer, RENDERERS);\n const packageManager = allowlisted(input.packageManager, PACKAGE_MANAGERS);\n await track({\n eventType: \"project_created\",\n source: \"create-app\",\n packageName: \"@farm.js/create-app\",\n packageVersion: sanitizeVersion(input.packageVersion),\n ...(template ? { template } : {}),\n ...(renderer ? { renderer } : {}),\n ...(packageManager ? { packageManager } : {}),\n ...(typeof input.typescript === \"boolean\" ? { typescript: input.typescript } : {}),\n ...(typeof input.installedDependencies === \"boolean\"\n ? { installedDependencies: input.installedDependencies }\n : {}),\n });\n}\n\nasync function track(event: FarmTelemetryEventInput): Promise<void> {\n try {\n const state = await resolveState();\n if (!state.active) return;\n const anonymousId = state.config.anonymousId || randomUUID();\n if (!state.config.anonymousId) {\n await writeConfig({ ...state.config, anonymousId });\n }\n const payload = {\n schemaVersion: TELEMETRY_SCHEMA_VERSION,\n eventId: randomUUID(),\n anonymousId,\n nodeMajor: Number.parseInt(process.versions.node.split(\".\")[0] || \"0\", 10),\n platform: normalizePlatform(process.platform),\n architecture: normalizeArchitecture(process.arch),\n ...event,\n } as FarmTelemetryEvent;\n await send(payload);\n } catch {\n // Telemetry is best-effort and must never make a Farm command fail.\n }\n}\n\nasync function send(payload: FarmTelemetryEvent): Promise<void> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);\n timeout.unref?.();\n try {\n await fetch(getEndpoint(), {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(payload),\n signal: controller.signal,\n keepalive: true,\n });\n } catch {\n // Network and endpoint failures are intentionally ignored.\n } finally {\n clearTimeout(timeout);\n }\n}\n\nfunction sanitizeVersion(value: string): string {\n return /^[0-9A-Za-z.+_-]{1,64}$/.test(value) ? value : \"unknown\";\n}\n\nfunction allowlisted<const T extends readonly string[]>(\n value: string | undefined,\n values: T,\n): T[number] | undefined {\n return value && (values as readonly string[]).includes(value) ? (value as T[number]) : undefined;\n}\n\nfunction normalizePlatform(value: NodeJS.Platform): FarmTelemetryEventBase[\"platform\"] {\n if (value === \"darwin\" || value === \"linux\") return value;\n if (value === \"win32\") return \"windows\";\n return \"other\";\n}\n\nfunction normalizeArchitecture(value: string): FarmTelemetryEventBase[\"architecture\"] {\n return value === \"arm64\" || value === \"x64\" ? value : \"other\";\n}\n"],"mappings":";;;;;;;;;AAKA,MAAM,2BAA2B;AACjC,MAAM,6BAA6B;AACnC,MAAM,uBAAuB;AAC7B,MAAM,qBAAqB;AAE3B,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,iBAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,YAAY;CAAC;CAAS;CAAU;CAAS;CAAO;AAAQ;AAC9D,MAAM,mBAAmB;CAAC;CAAO;CAAQ;CAAQ;AAAK;AACtD,MAAM,iBAAiB;CAAC;CAAU;CAAc;CAAW;CAAQ;AAAQ;AAgF3E,SAAS,gBAAqC;CAC5C,OAAO;EACL,SAAS;EACT,SAAS;EACT,aAAa;CACf;AACF;AAEA,SAAS,kBAA0B;CACjC,IAAI,QAAQ,IAAI,2BACd,OAAOA,U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