create-egregore 0.19.18 → 0.19.19
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// egregore-launcher-version: 0.19.
|
|
2
|
+
// egregore-launcher-version: 0.19.19
|
|
3
3
|
//
|
|
4
4
|
// egregore — launch and browse Egregore instances from your terminal.
|
|
5
5
|
// Installed by create-egregore. Reads ~/.egregore/instances.json.
|
|
@@ -33,7 +33,7 @@ const crypto = require("node:crypto");
|
|
|
33
33
|
const { spawnSync, spawn } = require("node:child_process");
|
|
34
34
|
const readline = require("node:readline");
|
|
35
35
|
|
|
36
|
-
const VERSION = "0.19.
|
|
36
|
+
const VERSION = "0.19.19";
|
|
37
37
|
const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
|
|
38
38
|
const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
|
|
39
39
|
const UPDATE_CACHE_FILE = path.join(os.homedir(), ".egregore", "update-check.json");
|
|
@@ -42,7 +42,6 @@ const UPDATE_REGISTRY_URL =
|
|
|
42
42
|
process.env.EGREGORE_UPDATE_REGISTRY_URL ||
|
|
43
43
|
`https://registry.npmjs.org/${PUBLIC_NPX_PACKAGE}/latest`;
|
|
44
44
|
const UPDATE_AVAILABLE_CACHE_TTL_MS = 6 * 60 * 60 * 1000;
|
|
45
|
-
const UPDATE_CURRENT_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
46
45
|
const UPDATE_FAILURE_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
47
46
|
const UPDATE_CHECK_TIMEOUT_MS = 1500;
|
|
48
47
|
const CONNECT_API_URL = (
|
|
@@ -1051,11 +1050,14 @@ function readUpdateCache() {
|
|
|
1051
1050
|
const age = Date.now() - new Date(cache.checked_at).getTime();
|
|
1052
1051
|
const cachedUpdate = cache.latest ? cliUpdateState(cache.latest) : null;
|
|
1053
1052
|
if (cache.latest && !cachedUpdate) return null;
|
|
1053
|
+
// A cached "current" result is never authoritative. Startup has already
|
|
1054
|
+
// rendered by the time this check runs, so revalidate it in the background
|
|
1055
|
+
// on every launch. Otherwise a release published seconds after a user opens
|
|
1056
|
+
// Egregore stays invisible until the cache TTL expires.
|
|
1057
|
+
if (cachedUpdate && !cachedUpdate.available) return null;
|
|
1054
1058
|
const ttl = !cache.latest
|
|
1055
1059
|
? UPDATE_FAILURE_CACHE_TTL_MS
|
|
1056
|
-
:
|
|
1057
|
-
? UPDATE_AVAILABLE_CACHE_TTL_MS
|
|
1058
|
-
: UPDATE_CURRENT_CACHE_TTL_MS;
|
|
1060
|
+
: UPDATE_AVAILABLE_CACHE_TTL_MS;
|
|
1059
1061
|
if (!Number.isFinite(age) || age < 0 || age > ttl) return null;
|
|
1060
1062
|
if (!cache.latest) return { current: VERSION, latest: null, available: false };
|
|
1061
1063
|
return cachedUpdate;
|
package/package.json
CHANGED