lingo.dev 0.110.5 → 0.111.1
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 +72 -36
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +37 -1
- package/build/cli.mjs.map +1 -1
- package/package.json +5 -5
package/build/cli.mjs
CHANGED
|
@@ -7620,6 +7620,39 @@ function createDeltaProcessor(fileKey) {
|
|
|
7620
7620
|
};
|
|
7621
7621
|
}
|
|
7622
7622
|
|
|
7623
|
+
// src/cli/utils/exit-gracefully.ts
|
|
7624
|
+
var STEP_WAIT_INTERVAL = 250;
|
|
7625
|
+
var MAX_WAIT_INTERVAL = 2e3;
|
|
7626
|
+
function exitGracefully(elapsedMs = 0) {
|
|
7627
|
+
const hasPendingOperations = checkForPendingOperations();
|
|
7628
|
+
if (hasPendingOperations && elapsedMs < MAX_WAIT_INTERVAL) {
|
|
7629
|
+
setTimeout(
|
|
7630
|
+
() => exitGracefully(elapsedMs + STEP_WAIT_INTERVAL),
|
|
7631
|
+
STEP_WAIT_INTERVAL
|
|
7632
|
+
);
|
|
7633
|
+
} else {
|
|
7634
|
+
process.exit(0);
|
|
7635
|
+
}
|
|
7636
|
+
}
|
|
7637
|
+
function checkForPendingOperations() {
|
|
7638
|
+
const activeHandles = process._getActiveHandles?.() || [];
|
|
7639
|
+
const activeRequests = process._getActiveRequests?.() || [];
|
|
7640
|
+
const nonStandardHandles = activeHandles.filter((handle) => {
|
|
7641
|
+
if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
|
|
7642
|
+
return false;
|
|
7643
|
+
}
|
|
7644
|
+
if (handle && typeof handle === "object" && "hasRef" in handle && !handle.hasRef()) {
|
|
7645
|
+
return false;
|
|
7646
|
+
}
|
|
7647
|
+
return true;
|
|
7648
|
+
});
|
|
7649
|
+
const hasFileWatchers = nonStandardHandles.some(
|
|
7650
|
+
(handle) => handle && typeof handle === "object" && "close" in handle
|
|
7651
|
+
);
|
|
7652
|
+
const hasPendingPromises = activeRequests.length > 0;
|
|
7653
|
+
return nonStandardHandles.length > 0 || hasFileWatchers || hasPendingPromises;
|
|
7654
|
+
}
|
|
7655
|
+
|
|
7623
7656
|
// src/cli/cmd/i18n.ts
|
|
7624
7657
|
var i18n_default = new Command12().command("i18n").description("Run Localization engine").helpOption("-h, --help", "Show help").option(
|
|
7625
7658
|
"--locale <locale>",
|
|
@@ -8010,6 +8043,7 @@ var i18n_default = new Command12().command("i18n").description("Run Localization
|
|
|
8010
8043
|
flags
|
|
8011
8044
|
});
|
|
8012
8045
|
}
|
|
8046
|
+
exitGracefully();
|
|
8013
8047
|
} catch (error) {
|
|
8014
8048
|
ora.fail(error.message);
|
|
8015
8049
|
trackEvent(authId || "unknown", "cmd.i18n.error", {
|
|
@@ -9482,6 +9516,7 @@ var run_default = new Command16().command("run").description("Run Lingo.dev loca
|
|
|
9482
9516
|
config: ctx.config,
|
|
9483
9517
|
flags: ctx.flags
|
|
9484
9518
|
});
|
|
9519
|
+
exitGracefully();
|
|
9485
9520
|
} catch (error) {
|
|
9486
9521
|
trackEvent(authId || "unknown", "cmd.run.error", {});
|
|
9487
9522
|
process.exit(1);
|
|
@@ -10656,6 +10691,7 @@ var status_default = new Command18().command("status").description("Show the sta
|
|
|
10656
10691
|
totalWordsToTranslate,
|
|
10657
10692
|
authenticated: !!authId
|
|
10658
10693
|
});
|
|
10694
|
+
exitGracefully();
|
|
10659
10695
|
} catch (error) {
|
|
10660
10696
|
ora.fail(error.message);
|
|
10661
10697
|
trackEvent(authId || "status", "cmd.status.error", {
|
|
@@ -10800,7 +10836,7 @@ async function renderHero2() {
|
|
|
10800
10836
|
// package.json
|
|
10801
10837
|
var package_default = {
|
|
10802
10838
|
name: "lingo.dev",
|
|
10803
|
-
version: "0.
|
|
10839
|
+
version: "0.111.1",
|
|
10804
10840
|
description: "Lingo.dev CLI",
|
|
10805
10841
|
private: false,
|
|
10806
10842
|
publishConfig: {
|