lingo.dev 0.111.2 → 0.111.3
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/build/cli.cjs +52 -31
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +52 -31
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.mjs
CHANGED
|
@@ -7463,42 +7463,63 @@ function withExponentialBackoff(fn, maxAttempts = 3, baseDelay = 1e3) {
|
|
|
7463
7463
|
|
|
7464
7464
|
// src/cli/utils/observability.ts
|
|
7465
7465
|
import pkg from "node-machine-id";
|
|
7466
|
+
import https from "https";
|
|
7466
7467
|
var { machineIdSync } = pkg;
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
flushAt: 1,
|
|
7474
|
-
flushInterval: 0
|
|
7475
|
-
}
|
|
7476
|
-
);
|
|
7477
|
-
return posthog;
|
|
7478
|
-
}
|
|
7479
|
-
async function trackEvent(distinctId, event, properties) {
|
|
7480
|
-
if (process.env.DO_NOT_TRACK) {
|
|
7468
|
+
var POSTHOG_API_KEY = "phc_eR0iSoQufBxNY36k0f0T15UvHJdTfHlh8rJcxsfhfXk";
|
|
7469
|
+
var POSTHOG_HOST = "eu.i.posthog.com";
|
|
7470
|
+
var POSTHOG_PATH = "/i/v0/e/";
|
|
7471
|
+
var REQUEST_TIMEOUT_MS = 1e3;
|
|
7472
|
+
function trackEvent(distinctId, event, properties) {
|
|
7473
|
+
if (process.env.DO_NOT_TRACK === "1") {
|
|
7481
7474
|
return;
|
|
7482
7475
|
}
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7476
|
+
setImmediate(() => {
|
|
7477
|
+
try {
|
|
7478
|
+
const actualId = distinctId || `device-${machineIdSync()}`;
|
|
7479
|
+
const eventData = {
|
|
7480
|
+
api_key: POSTHOG_API_KEY,
|
|
7481
|
+
event,
|
|
7482
|
+
distinct_id: actualId,
|
|
7483
|
+
properties: {
|
|
7484
|
+
...properties,
|
|
7485
|
+
$lib: "lingo.dev-cli",
|
|
7486
|
+
$lib_version: process.env.npm_package_version || "unknown"
|
|
7487
|
+
},
|
|
7488
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7489
|
+
};
|
|
7490
|
+
const payload = JSON.stringify(eventData);
|
|
7491
|
+
const options = {
|
|
7492
|
+
hostname: POSTHOG_HOST,
|
|
7493
|
+
path: POSTHOG_PATH,
|
|
7494
|
+
method: "POST",
|
|
7495
|
+
headers: {
|
|
7496
|
+
"Content-Type": "application/json",
|
|
7497
|
+
"Content-Length": Buffer.byteLength(payload).toString()
|
|
7498
|
+
},
|
|
7499
|
+
timeout: REQUEST_TIMEOUT_MS
|
|
7500
|
+
};
|
|
7501
|
+
const req = https.request(options);
|
|
7502
|
+
req.on("timeout", () => {
|
|
7503
|
+
req.destroy();
|
|
7504
|
+
});
|
|
7505
|
+
req.on("error", (error) => {
|
|
7506
|
+
if (process.env.DEBUG === "true") {
|
|
7507
|
+
console.error("[Tracking] Error ignored:", error.message);
|
|
7494
7508
|
}
|
|
7509
|
+
});
|
|
7510
|
+
req.write(payload);
|
|
7511
|
+
req.end();
|
|
7512
|
+
setTimeout(() => {
|
|
7513
|
+
if (!req.destroyed) {
|
|
7514
|
+
req.destroy();
|
|
7515
|
+
}
|
|
7516
|
+
}, REQUEST_TIMEOUT_MS);
|
|
7517
|
+
} catch (error) {
|
|
7518
|
+
if (process.env.DEBUG === "true") {
|
|
7519
|
+
console.error("[Tracking] Failed to send event:", error);
|
|
7495
7520
|
}
|
|
7496
|
-
});
|
|
7497
|
-
} catch (error) {
|
|
7498
|
-
if (process.env.DEBUG) {
|
|
7499
|
-
console.error(error);
|
|
7500
7521
|
}
|
|
7501
|
-
}
|
|
7522
|
+
});
|
|
7502
7523
|
}
|
|
7503
7524
|
|
|
7504
7525
|
// src/cli/utils/delta.ts
|
|
@@ -10842,7 +10863,7 @@ async function renderHero2() {
|
|
|
10842
10863
|
// package.json
|
|
10843
10864
|
var package_default = {
|
|
10844
10865
|
name: "lingo.dev",
|
|
10845
|
-
version: "0.111.
|
|
10866
|
+
version: "0.111.3",
|
|
10846
10867
|
description: "Lingo.dev CLI",
|
|
10847
10868
|
private: false,
|
|
10848
10869
|
publishConfig: {
|