unoverse 0.1.162 → 0.1.163
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/lib/publish.mjs +18 -1
- package/lib/session.mjs +5 -0
- package/package.json +1 -1
package/lib/publish.mjs
CHANGED
|
@@ -81,9 +81,26 @@ export async function publish(args) {
|
|
|
81
81
|
die(`no project "${project}" in ${designRoot}. Found: ${projects.join(", ") || "none"}`);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// ── which universe: --to overrides, unoverse.yaml remembers,
|
|
84
|
+
// ── which universe: --to overrides, unoverse.yaml remembers, the login answers,
|
|
85
|
+
// and only a machine that knows nothing asks ─────────────────────────────
|
|
85
86
|
const config = await readConfig(ws.root);
|
|
86
87
|
let universe = opt("to") ?? config.universe;
|
|
88
|
+
if (!universe) {
|
|
89
|
+
// THE LOGIN ALREADY NAMED THE UNIVERSE. `unoverse login` takes an address and
|
|
90
|
+
// keeps a session for it, so a machine signed in to exactly one universe has
|
|
91
|
+
// already answered this question — asking it again reads as the CLI forgetting
|
|
92
|
+
// what it was just told (observed live 2026-08-21). One session: use it, say so,
|
|
93
|
+
// and remember it in unoverse.yaml like a typed answer. Several sessions: the
|
|
94
|
+
// choice is real, so the question remains.
|
|
95
|
+
const { sessionOrigins } = await import("./session.mjs");
|
|
96
|
+
const origins = sessionOrigins();
|
|
97
|
+
if (origins.length === 1) {
|
|
98
|
+
universe = origins[0];
|
|
99
|
+
await writeConfig(ws.root, { universe });
|
|
100
|
+
console.log(`
|
|
101
|
+
${c.dim}→ ${universe} (your signed-in universe; saved to unoverse.yaml)${c.off}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
87
104
|
if (!universe) {
|
|
88
105
|
if (!process.stdin.isTTY) die("no universe. Pass --to https://your-universe.example, or commit it in unoverse.yaml");
|
|
89
106
|
const typed = await ask(`\n Where does this workspace deploy to? ${c.dim}(e.g. universe.example.com)${c.off} `);
|
package/lib/session.mjs
CHANGED
|
@@ -38,6 +38,11 @@ export function getSession(origin) {
|
|
|
38
38
|
return load()[origin] ?? null;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/** Every universe origin this machine holds a session for. */
|
|
42
|
+
export function sessionOrigins() {
|
|
43
|
+
return Object.keys(load());
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
export function saveSession(origin, session) {
|
|
42
47
|
const all = load();
|
|
43
48
|
all[origin] = session;
|
package/package.json
CHANGED