sodabase 0.1.8 → 0.1.9
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/dist/api/client.js +19 -3
- package/dist/api/fakeClient.js +8 -2
- package/dist/api/types.js +4 -4
- package/dist/ui.js +147 -60
- package/package.json +2 -2
package/dist/api/client.js
CHANGED
|
@@ -186,6 +186,16 @@ export class SodabaseClient {
|
|
|
186
186
|
await sleepAbortable(2000, signal);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
+
async listConnections() {
|
|
190
|
+
const rows = await this.get("/connections");
|
|
191
|
+
return Array.isArray(rows)
|
|
192
|
+
? rows.map((c) => ({
|
|
193
|
+
connectionId: c.connection_id,
|
|
194
|
+
status: c.status,
|
|
195
|
+
...(c.org_slug ? { orgSlug: c.org_slug } : {}),
|
|
196
|
+
}))
|
|
197
|
+
: [];
|
|
198
|
+
}
|
|
189
199
|
async listProjects(connectionId) {
|
|
190
200
|
const rows = await this.get(`/connections/${encodeURIComponent(connectionId)}/projects`);
|
|
191
201
|
return rows.map((p) => ({
|
|
@@ -215,12 +225,18 @@ export class SodabaseClient {
|
|
|
215
225
|
return rows.map((p) => ({
|
|
216
226
|
ref: p.ref,
|
|
217
227
|
name: p.name,
|
|
218
|
-
|
|
219
|
-
|
|
228
|
+
// The watched-scoped counts the web app shows — all from the new fields or, on an older API, all from the raw
|
|
229
|
+
// all-tables ones (never mixed, so the breakdown always adds up to the total).
|
|
230
|
+
...(p.issue_count !== undefined && p.broken_rule_count !== undefined && p.data_quality_count !== undefined
|
|
231
|
+
? { issueCount: p.issue_count, dataQualityIssues: p.data_quality_count, brokenRules: p.broken_rule_count }
|
|
232
|
+
: {
|
|
233
|
+
issueCount: (p.open_issues ?? 0) + (p.data_quality_issues ?? 0),
|
|
234
|
+
dataQualityIssues: p.data_quality_issues ?? 0,
|
|
235
|
+
brokenRules: p.broken_rules ?? 0,
|
|
236
|
+
}),
|
|
220
237
|
watched: p.watched ?? 0,
|
|
221
238
|
monitors: p.monitors ?? 0,
|
|
222
239
|
rules: p.rules ?? 0,
|
|
223
|
-
brokenRules: p.broken_rules ?? 0,
|
|
224
240
|
status: p.status ?? "ready",
|
|
225
241
|
}));
|
|
226
242
|
}
|
package/dist/api/fakeClient.js
CHANGED
|
@@ -73,6 +73,12 @@ export class FakeClient {
|
|
|
73
73
|
throw new Error("connect aborted");
|
|
74
74
|
return { connectionId: "conn_demo" };
|
|
75
75
|
}
|
|
76
|
+
async listConnections() {
|
|
77
|
+
// A healthy existing connection, so --demo exercises the reuse path (onboarding skips the fake authorize
|
|
78
|
+
// and lists projects straight away).
|
|
79
|
+
await this.tick(250);
|
|
80
|
+
return [{ connectionId: "conn_demo", status: "connected", orgSlug: "demo-org" }];
|
|
81
|
+
}
|
|
76
82
|
async listProjects(_connectionId) {
|
|
77
83
|
await this.tick(500);
|
|
78
84
|
return [
|
|
@@ -89,8 +95,8 @@ export class FakeClient {
|
|
|
89
95
|
async dashboardProjects() {
|
|
90
96
|
await this.tick(300);
|
|
91
97
|
return [
|
|
92
|
-
{ ref: "supabase-demo", name: "Supabase Demo",
|
|
93
|
-
{ ref: "analytics", name: "Analytics",
|
|
98
|
+
{ ref: "supabase-demo", name: "Supabase Demo", issueCount: 18, dataQualityIssues: 13, watched: 7, monitors: 28, rules: 15, brokenRules: 1, status: "ready" },
|
|
99
|
+
{ ref: "analytics", name: "Analytics", issueCount: 0, dataQualityIssues: 0, watched: 4, monitors: 18, rules: 10, brokenRules: 0, status: "ready" },
|
|
94
100
|
];
|
|
95
101
|
}
|
|
96
102
|
async jobStatus(jobId) {
|
package/dist/api/types.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Wire types for the Sodabase /api/v1 API, as the v2 CLI consumes them.
|
|
2
2
|
// Verified against the real route definitions on main. The CLI is a GoTrue client:
|
|
3
3
|
// every /api/v1 call needs Authorization: Bearer <GoTrue JWT, aud="authenticated">.
|
|
4
|
-
/**
|
|
5
|
-
export const anomalyCount = (p) => Math.max(0, p.
|
|
6
|
-
/** The single "issues" number the CLI shows
|
|
7
|
-
export const totalIssues = (p) => p.
|
|
4
|
+
/** issueCount split: anomalies are the issues that are neither broken rules nor data-quality findings. */
|
|
5
|
+
export const anomalyCount = (p) => Math.max(0, p.issueCount - p.brokenRules - p.dataQualityIssues);
|
|
6
|
+
/** The single "issues" number the CLI shows — the same as the web app's sidebar and dashboard. */
|
|
7
|
+
export const totalIssues = (p) => p.issueCount;
|
|
8
8
|
export class ApiError extends Error {
|
|
9
9
|
status;
|
|
10
10
|
code;
|
package/dist/ui.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Box, Text, useApp, useInput } from "ink";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import React, { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
5
|
-
import { totalIssues } from "./api/types.js";
|
|
5
|
+
import { ApiError, anomalyCount, totalIssues } from "./api/types.js";
|
|
6
6
|
import { saveCreds } from "./config/tokenStore.js";
|
|
7
7
|
// ── utils ─────────────────────────────────────────────────────────────────────
|
|
8
8
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -378,88 +378,173 @@ function isWatchable(p) {
|
|
|
378
378
|
return !p.status || p.status === "ACTIVE_HEALTHY";
|
|
379
379
|
}
|
|
380
380
|
const issuesLabel = (n) => `${n} ${n === 1 ? "issue" : "issues"}`;
|
|
381
|
+
const EMPTY_ORG_MSG = "This Supabase organization has no projects. Create one in Supabase, then run setup again.";
|
|
381
382
|
export function Connect({ onDone }) {
|
|
382
383
|
useFooter(_jsx(Text, { dimColor: true, children: "\u2191\u2193 move \u00B7 enter select \u00B7 green = watching \u00B7 yellow = offline \u00B7 esc to go back" }), []);
|
|
383
384
|
const bodyRows = useBodyRows();
|
|
384
385
|
const { services, interactive } = useWizard();
|
|
385
386
|
const spin = useSpinner();
|
|
386
|
-
const [
|
|
387
|
+
const [rows, setRows] = useState(null);
|
|
388
|
+
const [multiOrg, setMultiOrg] = useState(false);
|
|
389
|
+
// reused: rows came from EXISTING connection(s) (no browser) — enables the "connect a different org" row.
|
|
390
|
+
// authorizing: a fresh OAuth authorize is in flight (its browser message + abortable poll).
|
|
391
|
+
const [reused, setReused] = useState(false);
|
|
392
|
+
const [authorizing, setAuthorizing] = useState(false);
|
|
387
393
|
const [alreadyConnected, setAlreadyConnected] = useState(false);
|
|
388
|
-
const [projects, setProjects] = useState(null);
|
|
389
394
|
const [cursor, setCursor] = useState(0);
|
|
390
395
|
const [chosen, setChosen] = useState(null);
|
|
391
396
|
const [error, setError] = useState(null);
|
|
397
|
+
// Abort controller for whichever load is in flight (the initial reuse-or-authorize, or a later "connect a
|
|
398
|
+
// different org"). Each async run captures its OWN signal, so leaving the screen (cleanup aborts it) can't set
|
|
399
|
+
// state, and a replacement run can't be revived by a stale one.
|
|
400
|
+
const abortRef = useRef(null);
|
|
401
|
+
function finishRow(row) {
|
|
402
|
+
const project = row?.project;
|
|
403
|
+
// Don't send an offline (paused/transitional) project into onboarding — the DB is unreachable, so it would
|
|
404
|
+
// fail deep in the job. Surface it here, up front and recoverable, instead.
|
|
405
|
+
if (project && !isWatchable(project)) {
|
|
406
|
+
setError(`"${project.name}" is paused in Supabase — resume it there, then run setup again.`);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const ref = project?.ref ?? "";
|
|
410
|
+
setChosen(ref);
|
|
411
|
+
// alreadyWatching routes the hub: an already-watched project skips provisioning and goes straight to
|
|
412
|
+
// adjusting its tables; a new one is provisioned first. Set it explicitly so a later pick of a NEW project
|
|
413
|
+
// resets a flag left over from a previous "manage" round.
|
|
414
|
+
onDone({ connectionId: row?.connectionId ?? "", projectRef: ref, alreadyWatching: !!project?.watching });
|
|
415
|
+
}
|
|
416
|
+
// Present the gathered rows: the picker, or (single fresh project / non-interactive) auto-advance. A lone
|
|
417
|
+
// already-watched project shows the picker — there's nothing new to onboard — so reuse of a single watched
|
|
418
|
+
// project never silently advances.
|
|
419
|
+
function present(rws, multi, fromReuse) {
|
|
420
|
+
setRows(rws);
|
|
421
|
+
setMultiOrg(multi);
|
|
422
|
+
setReused(fromReuse);
|
|
423
|
+
setCursor(0);
|
|
424
|
+
if (!interactive || (rws.length === 1 && !rws[0]?.project.watching))
|
|
425
|
+
finishRow(rws[0]);
|
|
426
|
+
}
|
|
427
|
+
// Open the Supabase OAuth authorize (browser), then show the new org's projects. Used when no existing
|
|
428
|
+
// connection is reusable, and when the user picks "connect a different org".
|
|
429
|
+
async function authorize() {
|
|
430
|
+
abortRef.current?.abort();
|
|
431
|
+
const controller = new AbortController();
|
|
432
|
+
abortRef.current = controller;
|
|
433
|
+
const { signal } = controller;
|
|
434
|
+
setError(null);
|
|
435
|
+
setRows(null);
|
|
436
|
+
setChosen(null);
|
|
437
|
+
setReused(false);
|
|
438
|
+
setAuthorizing(true);
|
|
439
|
+
try {
|
|
440
|
+
// connect() opens the browser, polls the hosted handback, and self-completes with our own Bearer.
|
|
441
|
+
const { connectionId: cid, alreadyConnected: ac } = await services.connect(signal);
|
|
442
|
+
if (signal.aborted)
|
|
443
|
+
return;
|
|
444
|
+
setAlreadyConnected(!!ac);
|
|
445
|
+
const projs = await services.listProjects(cid);
|
|
446
|
+
if (signal.aborted)
|
|
447
|
+
return;
|
|
448
|
+
if (projs.length === 0) {
|
|
449
|
+
setError(EMPTY_ORG_MSG);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
present(projs.map((p) => ({ project: p, connectionId: cid })), false, false);
|
|
453
|
+
}
|
|
454
|
+
catch (e) {
|
|
455
|
+
if (!signal.aborted)
|
|
456
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
457
|
+
}
|
|
458
|
+
finally {
|
|
459
|
+
if (!signal.aborted)
|
|
460
|
+
setAuthorizing(false);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
392
463
|
useEffect(() => {
|
|
393
|
-
let on = true;
|
|
394
|
-
// Abort the authorize poll when we leave this screen (escape back to the hub) so an abandoned
|
|
395
|
-
// connect doesn't keep polling for up to 5 minutes — and a re-entry can't start a second,
|
|
396
|
-
// competing poll loop against the same handback.
|
|
397
464
|
const controller = new AbortController();
|
|
465
|
+
abortRef.current = controller;
|
|
466
|
+
const { signal } = controller;
|
|
467
|
+
// Reuse EVERY healthy existing connection first (no browser): gather the projects of all connections whose
|
|
468
|
+
// list we can fetch into one picker. Only if none have any projects do we open the authorize flow.
|
|
398
469
|
(async () => {
|
|
470
|
+
let conns;
|
|
399
471
|
try {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
if (
|
|
404
|
-
return;
|
|
405
|
-
setConnectionId(cid);
|
|
406
|
-
setAlreadyConnected(!!ac);
|
|
407
|
-
const projs = await services.listProjects(cid);
|
|
408
|
-
if (!on)
|
|
472
|
+
conns = await services.listConnections();
|
|
473
|
+
}
|
|
474
|
+
catch (e) {
|
|
475
|
+
if (signal.aborted)
|
|
409
476
|
return;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
if (projs.length === 0) {
|
|
414
|
-
setError("This Supabase organization has no projects. Create one in Supabase, then run setup again.");
|
|
477
|
+
// A Sodabase-auth failure (expired session) won't be fixed by the Supabase browser flow — surface it.
|
|
478
|
+
if (e instanceof ApiError && e.status === 401) {
|
|
479
|
+
setError("Your Sodabase session has expired. Run `sodabase --login`, then try again.");
|
|
415
480
|
return;
|
|
416
481
|
}
|
|
417
|
-
|
|
418
|
-
|
|
482
|
+
// Anything else (offline / 5xx): fall through to authorize, which surfaces its own errors.
|
|
483
|
+
await authorize();
|
|
484
|
+
return;
|
|
419
485
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
486
|
+
if (signal.aborted)
|
|
487
|
+
return;
|
|
488
|
+
const collected = [];
|
|
489
|
+
const orgs = new Set();
|
|
490
|
+
for (const c of conns) {
|
|
491
|
+
try {
|
|
492
|
+
const projs = await services.listProjects(c.connectionId);
|
|
493
|
+
if (signal.aborted)
|
|
494
|
+
return;
|
|
495
|
+
for (const p of projs)
|
|
496
|
+
collected.push({ project: p, connectionId: c.connectionId, org: c.orgSlug });
|
|
497
|
+
// Count distinct ORGS (so two connections to the same org don't trigger per-row org labels); fall back
|
|
498
|
+
// to the connection id when a slug is missing so each still counts as its own.
|
|
499
|
+
if (projs.length > 0)
|
|
500
|
+
orgs.add(c.orgSlug ?? c.connectionId);
|
|
501
|
+
}
|
|
502
|
+
catch {
|
|
503
|
+
/* stale/unhealthy connection — skip it (an empty org simply contributes no rows) */
|
|
504
|
+
}
|
|
423
505
|
}
|
|
506
|
+
if (signal.aborted)
|
|
507
|
+
return;
|
|
508
|
+
if (collected.length > 0)
|
|
509
|
+
present(collected, orgs.size > 1, true);
|
|
510
|
+
else
|
|
511
|
+
await authorize(); // no reusable connection has projects → authorize a new org
|
|
424
512
|
})();
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
};
|
|
513
|
+
// Abort whichever controller is CURRENT — authorize() swaps in its own for the 5-minute connect() poll, so
|
|
514
|
+
// aborting the captured mount controller here would leave that poll running (and setting state) after unmount.
|
|
515
|
+
return () => abortRef.current?.abort();
|
|
429
516
|
}, []);
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
// fail deep in the job. Surface it here, up front and recoverable, instead. Also covers the single-project
|
|
433
|
-
// auto-select path, which skips the picker (and its tag) entirely.
|
|
434
|
-
if (project && !isWatchable(project)) {
|
|
435
|
-
setError(`"${project.name}" is paused in Supabase — resume it there, then run setup again.`);
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const ref = project?.ref ?? "";
|
|
439
|
-
setChosen(ref);
|
|
440
|
-
// alreadyWatching routes the hub: an already-watched project skips provisioning and goes straight to
|
|
441
|
-
// adjusting its tables; a new one is provisioned first. Set it explicitly (not just when true) so a
|
|
442
|
-
// later pick of a NEW project resets the flag left over from a previous "manage" round.
|
|
443
|
-
onDone({ connectionId: connId, projectRef: ref, alreadyWatching: !!project?.watching });
|
|
444
|
-
}
|
|
517
|
+
// The synthetic "connect a different Supabase org" row sits after the projects when reusing a connection.
|
|
518
|
+
const extraRow = reused;
|
|
445
519
|
useGatedInput((_i, key) => {
|
|
446
|
-
if (!
|
|
520
|
+
if (!rows || chosen || authorizing)
|
|
447
521
|
return;
|
|
522
|
+
const max = rows.length - 1 + (extraRow ? 1 : 0);
|
|
448
523
|
if (key.upArrow)
|
|
449
524
|
setCursor((c) => Math.max(0, c - 1));
|
|
450
525
|
else if (key.downArrow)
|
|
451
|
-
setCursor((c) => Math.min(
|
|
452
|
-
else if (key.return
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
526
|
+
setCursor((c) => Math.min(max, c + 1));
|
|
527
|
+
else if (key.return) {
|
|
528
|
+
if (extraRow && cursor === rows.length)
|
|
529
|
+
void authorize(); // picked "connect a different org"
|
|
530
|
+
else
|
|
531
|
+
finishRow(rows[cursor]);
|
|
532
|
+
}
|
|
533
|
+
}, { isActive: interactive && !!rows && !chosen && !authorizing });
|
|
534
|
+
// Show the picker whenever there are rows and nothing auto-advanced (chosen stays null). This covers a lone
|
|
535
|
+
// already-watched project on EITHER path — present() deliberately doesn't auto-advance it, so without this it
|
|
536
|
+
// would render the "done" confirmation yet never call onDone.
|
|
537
|
+
const picking = interactive && !!rows && !chosen;
|
|
538
|
+
const heading = authorizing ? "Authorize your database" : rows ? "Pick a project" : "Connect a project";
|
|
539
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 2, marginTop: 1, alignItems: "center", children: [_jsx(Eyebrow, { children: heading }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: error ? (_jsx(Text, { color: "red", children: error })) : authorizing && !rows ? (_jsxs(_Fragment, { children: [_jsxs(Text, { children: [_jsx(Text, { color: "green", children: spin }), " Opening your browser to authorize\u2026"] }), _jsx(Box, { width: 62, children: _jsx(Text, { dimColor: true, children: "Read-only \u2014 no connection string to paste. Approve on Supabase, then return here." }) })] })) : !rows ? (_jsxs(Text, { children: [_jsx(Text, { color: "green", children: spin }), " Checking your Supabase connections\u2026"] })) : picking ? ((() => {
|
|
540
|
+
const clamped = Math.min(cursor, rows.length - 1);
|
|
541
|
+
const win = windowList(rows, clamped, Math.max(3, bodyRows - (extraRow ? 7 : 6)));
|
|
542
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: "Pick a project to watch:" }), win.moreUp > 0 && _jsx(Text, { dimColor: true, children: ` ↑ ${win.moreUp} more` }), win.slice.map((row, idx) => {
|
|
459
543
|
const i = win.start + idx;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
544
|
+
const p = row.project;
|
|
545
|
+
return (_jsxs(Text, { color: i === cursor ? "green" : undefined, children: [i === cursor ? "❯ " : " ", p.name, " ", _jsxs(Text, { dimColor: true, children: ["(", p.ref, ")"] }), multiOrg && _jsxs(Text, { dimColor: true, children: [" \u00B7 ", row.org ?? "other org"] }), projectTags(p).map((t) => (_jsxs(Text, { color: t.color, children: [" ", "\u00B7 ", t.label] }, t.label)))] }, `${row.connectionId}:${p.ref}`));
|
|
546
|
+
}), win.moreDown > 0 && _jsx(Text, { dimColor: true, children: ` ↓ ${win.moreDown} more` }), extraRow && (_jsxs(Text, { color: cursor === rows.length ? "green" : undefined, dimColor: cursor !== rows.length, children: [cursor === rows.length ? "❯ " : " ", "+ Connect a different Supabase org"] }))] }));
|
|
547
|
+
})()) : (_jsxs(_Fragment, { children: [alreadyConnected && (_jsxs(Text, { dimColor: true, children: [_jsx(Text, { color: "green", children: "\u2713" }), " Already connected \u2014 continuing on your existing connection."] })), _jsxs(Text, { children: [_jsx(Text, { color: "green", children: "\u2714" }), " Connected \u00B7 project ", _jsx(Text, { bold: true, children: chosen ?? rows[0]?.project.ref ?? "—" }), _jsx(Text, { color: "green", children: " 🔒 read-only, audited" })] })] })) })] }));
|
|
463
548
|
}
|
|
464
549
|
// ── Phase: the server-side onboarding job (two-panel) ─────────────────────────────
|
|
465
550
|
// Human labels for the backend onboarding job's step names (machine keys). Unknown names fall back to the raw
|
|
@@ -957,15 +1042,17 @@ export function Home({ ctx, onDone }) {
|
|
|
957
1042
|
const list = projects ?? [];
|
|
958
1043
|
const watching = list.length > 0;
|
|
959
1044
|
const tables = list.reduce((a, p) => a + p.watched, 0);
|
|
960
|
-
|
|
1045
|
+
// The same issue total as the web app: anomalies + broken rules + data-quality findings, on watched tables.
|
|
1046
|
+
const issues = list.reduce((a, p) => a + totalIssues(p), 0);
|
|
961
1047
|
const brokenRules = list.reduce((a, p) => a + p.brokenRules, 0);
|
|
962
|
-
const
|
|
1048
|
+
const dataQuality = list.reduce((a, p) => a + p.dataQualityIssues, 0);
|
|
1049
|
+
const anomalies = list.reduce((a, p) => a + anomalyCount(p), 0);
|
|
963
1050
|
const monitors = list.reduce((a, p) => a + p.monitors, 0);
|
|
964
1051
|
const rules = list.reduce((a, p) => a + p.rules, 0);
|
|
965
1052
|
useFooter(_jsx(Text, { dimColor: true, children: "\u2191\u2193 move \u00B7 enter select \u00B7 esc to quit" }), []);
|
|
966
1053
|
return (_jsxs(Box, { flexDirection: "column", paddingX: 2, marginTop: 1, alignItems: "center", children: [_jsx(Eyebrow, { children: watching ? "Sodabase is watching" : "Welcome to Sodabase" }), identity && (_jsx(Box, { marginTop: 1, children: identity.email ? (_jsxs(Text, { dimColor: true, children: ["Signed in as ", _jsx(Text, { color: WHITE, children: identity.email }), " \u00B7 workspace", " ", _jsx(Text, { color: WHITE, children: identity.workspaceName })] })) : (
|
|
967
1054
|
// No email on the JWT — a role isn't an identity, so just name the workspace.
|
|
968
|
-
_jsxs(Text, { dimColor: true, children: ["Workspace ", _jsx(Text, { color: WHITE, children: identity.workspaceName })] })) })), _jsx(Box, { marginTop: 1, flexDirection: "column", children: projects === null ? (_jsx(Text, { dimColor: true, children: "loading your trust report\u2026" })) : watching ? (_jsxs(_Fragment, { children: [_jsxs(StatRow, { label: "Tables watched", children: [_jsx(Text, { color: "green", bold: true, children: tables }), " ", "across ", plural(list.length, "project")] }), _jsxs(StatRow, { label: "Issues", children: [_jsx(Text, { color: issues > 0 ? "yellow" : "green", bold: true, children: issues }), " ", issues > 0 ? (_jsxs(Text, { dimColor: true, children: ["\u00B7 ", anomalyLabel(anomalies), "
|
|
1055
|
+
_jsxs(Text, { dimColor: true, children: ["Workspace ", _jsx(Text, { color: WHITE, children: identity.workspaceName })] })) })), _jsx(Box, { marginTop: 1, flexDirection: "column", children: projects === null ? (_jsx(Text, { dimColor: true, children: "loading your trust report\u2026" })) : watching ? (_jsxs(_Fragment, { children: [_jsxs(StatRow, { label: "Tables watched", children: [_jsx(Text, { color: "green", bold: true, children: tables }), " ", "across ", plural(list.length, "project")] }), _jsxs(StatRow, { label: "Issues", children: [_jsx(Text, { color: issues > 0 ? "yellow" : "green", bold: true, children: issues }), " ", issues > 0 ? (_jsxs(Text, { dimColor: true, children: ["\u00B7 ", anomalyLabel(anomalies), ", ", plural(brokenRules, "broken rule"), " &", " ", plural(dataQuality, "data-quality issue")] })) : (_jsx(Text, { dimColor: true, children: "\u00B7 all clear" }))] }), _jsxs(StatRow, { label: "Coverage", children: [_jsx(Text, { bold: true, children: plural(monitors, "monitor") }), _jsx(Text, { dimColor: true, children: " & " }), _jsx(Text, { bold: true, children: plural(rules, "rule") })] }), ctx.installed && ctx.installed.length > 0 && (_jsxs(StatRow, { label: "MCP", children: [_jsx(Text, { color: "green", children: "\u2714" }), " installed for ", ctx.installed.join(", ")] }))] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { children: "You're not watching any projects yet." }), _jsx(Text, { dimColor: true, children: "Pick one below \u2014 Sodabase sets up read-only monitoring, no code changes." })] })) }), interactive && projects !== null && (_jsx(_Fragment, { children: _jsx(Box, { marginTop: 1, flexDirection: "column", children: HOME_MENU.map((m, i) => {
|
|
969
1056
|
const here = i === cursor;
|
|
970
1057
|
return (_jsxs(Text, { color: here ? "green" : undefined, children: [here ? "❯ " : " ", m.label, " ", _jsxs(Text, { dimColor: true, children: ["\u00B7 ", m.hint] })] }, m.id));
|
|
971
1058
|
}) }) }))] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sodabase",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Sodabase onboarding wizard — interactive CLI (npx sodabase).",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://sodabase.io",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"bin": {
|
|
29
|
-
"sodabase": "
|
|
29
|
+
"sodabase": "dist/cli.js"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|