@polterware/polterbase 0.2.2 → 0.2.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/dist/index.js +61 -41
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { render } from "ink";
|
|
|
6
6
|
|
|
7
7
|
// src/app.tsx
|
|
8
8
|
import { Box as Box13, Text as Text12, useApp } from "ink";
|
|
9
|
-
import pc2 from "picocolors";
|
|
10
9
|
|
|
11
10
|
// src/hooks/useNavigation.ts
|
|
12
11
|
import { useState, useCallback } from "react";
|
|
@@ -39,22 +38,34 @@ import { createRequire } from "module";
|
|
|
39
38
|
import pc from "picocolors";
|
|
40
39
|
var require2 = createRequire(import.meta.url);
|
|
41
40
|
var packageJson = require2("../package.json");
|
|
41
|
+
var SUPABASE_HEX = "#3ECF8E";
|
|
42
|
+
var SUPABASE_FG = "\x1B[38;2;62;207;142m";
|
|
43
|
+
var SUPABASE_BG = "\x1B[48;2;62;207;142m";
|
|
44
|
+
var RESET_FG = "\x1B[39m";
|
|
45
|
+
var RESET_BG = "\x1B[49m";
|
|
46
|
+
var wrapAnsi = (open, close) => (input) => pc.isColorSupported ? `${open}${input}${close}` : input;
|
|
47
|
+
var supabase = wrapAnsi(SUPABASE_FG, RESET_FG);
|
|
48
|
+
var supabaseBg = wrapAnsi(SUPABASE_BG, RESET_BG);
|
|
42
49
|
var VERSION = packageJson.version;
|
|
50
|
+
var inkColors = {
|
|
51
|
+
accent: SUPABASE_HEX,
|
|
52
|
+
accentContrast: "#081116"
|
|
53
|
+
};
|
|
43
54
|
var colors = {
|
|
44
|
-
primary:
|
|
45
|
-
primaryBold: (s) => pc.bold(
|
|
46
|
-
accent:
|
|
47
|
-
accentBold: (s) => pc.bold(
|
|
48
|
-
success:
|
|
49
|
-
successBold: (s) => pc.bold(
|
|
55
|
+
primary: supabase,
|
|
56
|
+
primaryBold: (s) => pc.bold(supabase(s)),
|
|
57
|
+
accent: supabase,
|
|
58
|
+
accentBold: (s) => pc.bold(supabase(s)),
|
|
59
|
+
success: supabase,
|
|
60
|
+
successBold: (s) => pc.bold(supabase(s)),
|
|
50
61
|
error: pc.red,
|
|
51
62
|
errorBold: (s) => pc.bold(pc.red(s)),
|
|
52
|
-
warning:
|
|
53
|
-
warningBold: (s) => pc.bold(
|
|
63
|
+
warning: supabase,
|
|
64
|
+
warningBold: (s) => pc.bold(supabase(s)),
|
|
54
65
|
dim: pc.dim,
|
|
55
66
|
bold: pc.bold,
|
|
56
67
|
white: pc.white,
|
|
57
|
-
highlight: (s) =>
|
|
68
|
+
highlight: (s) => supabaseBg(pc.black(pc.bold(s)))
|
|
58
69
|
};
|
|
59
70
|
var ghost = {
|
|
60
71
|
art: [
|
|
@@ -73,16 +84,24 @@ var ghost = {
|
|
|
73
84
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
74
85
|
function GhostBanner() {
|
|
75
86
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", alignItems: "flex-start", gap: 2, marginBottom: 1, children: [
|
|
76
|
-
/* @__PURE__ */ jsx(Box, { flexDirection: "column", children: ghost.art.map((line, i) => /* @__PURE__ */ jsx(Text, { color:
|
|
87
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", children: ghost.art.map((line, i) => /* @__PURE__ */ jsx(Text, { color: inkColors.accent, children: line }, i)) }),
|
|
77
88
|
/* @__PURE__ */ jsxs(
|
|
78
89
|
Box,
|
|
79
90
|
{
|
|
80
91
|
flexDirection: "column",
|
|
81
92
|
borderStyle: "single",
|
|
82
|
-
borderColor:
|
|
93
|
+
borderColor: inkColors.accent,
|
|
83
94
|
paddingX: 1,
|
|
84
95
|
children: [
|
|
85
|
-
/* @__PURE__ */ jsx(
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Text,
|
|
98
|
+
{
|
|
99
|
+
backgroundColor: inkColors.accent,
|
|
100
|
+
color: inkColors.accentContrast,
|
|
101
|
+
bold: true,
|
|
102
|
+
children: " POLTERBASE "
|
|
103
|
+
}
|
|
104
|
+
),
|
|
86
105
|
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
87
106
|
"Version: ",
|
|
88
107
|
VERSION
|
|
@@ -308,11 +327,11 @@ function SelectList({
|
|
|
308
327
|
const renderSelectableRow = (item, globalIdx) => {
|
|
309
328
|
const isSelected = globalIdx === selectedItemIndex;
|
|
310
329
|
return /* @__PURE__ */ jsxs2(Box2, { gap: 1, children: [
|
|
311
|
-
/* @__PURE__ */ jsx2(Text2, { color: isSelected ?
|
|
330
|
+
/* @__PURE__ */ jsx2(Text2, { color: isSelected ? inkColors.accent : void 0, children: isSelected ? "\u276F" : " " }),
|
|
312
331
|
/* @__PURE__ */ jsx2(Box2, { width: labelWidth, children: /* @__PURE__ */ jsxs2(
|
|
313
332
|
Text2,
|
|
314
333
|
{
|
|
315
|
-
color: isSelected ?
|
|
334
|
+
color: isSelected ? inkColors.accent : isPinnedRow(item) ? "white" : void 0,
|
|
316
335
|
bold: isSelected || isPinnedRow(item),
|
|
317
336
|
children: [
|
|
318
337
|
item.icon ? `${item.icon} ` : "",
|
|
@@ -328,7 +347,7 @@ function SelectList({
|
|
|
328
347
|
showScrollUp && /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: " \u2191 more" }),
|
|
329
348
|
boxedSections ? boxedLayout.map((section) => {
|
|
330
349
|
if (section.type === "heading") {
|
|
331
|
-
return /* @__PURE__ */ jsx2(Box2, { children: /* @__PURE__ */ jsx2(Text2, { color:
|
|
350
|
+
return /* @__PURE__ */ jsx2(Box2, { children: /* @__PURE__ */ jsx2(Text2, { color: inkColors.accent, bold: true, children: section.label }) }, section.key);
|
|
332
351
|
}
|
|
333
352
|
const hasSelectedRow = section.rows.some(
|
|
334
353
|
(row) => row.globalIndex === selectedItemIndex
|
|
@@ -341,10 +360,11 @@ function SelectList({
|
|
|
341
360
|
{
|
|
342
361
|
flexDirection: "column",
|
|
343
362
|
borderStyle: "round",
|
|
344
|
-
borderColor:
|
|
363
|
+
borderColor: inkColors.accent,
|
|
364
|
+
borderDimColor: !hasSelectedRow && !isPinnedSection,
|
|
345
365
|
paddingX: 1,
|
|
346
366
|
children: [
|
|
347
|
-
section.title && /* @__PURE__ */ jsx2(Text2, { color:
|
|
367
|
+
section.title && /* @__PURE__ */ jsx2(Text2, { color: inkColors.accent, bold: true, children: section.title }),
|
|
348
368
|
/* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: section.rows.map(
|
|
349
369
|
(row) => renderSelectableRow(row.item, row.globalIndex)
|
|
350
370
|
) })
|
|
@@ -360,7 +380,7 @@ function SelectList({
|
|
|
360
380
|
Box2,
|
|
361
381
|
{
|
|
362
382
|
marginTop: i === 0 ? 0 : 1,
|
|
363
|
-
children: /* @__PURE__ */ jsx2(Text2, { color:
|
|
383
|
+
children: /* @__PURE__ */ jsx2(Text2, { color: inkColors.accent, bold: true, children: item.label })
|
|
364
384
|
},
|
|
365
385
|
item.id ?? `${item.value}-${globalIdx}`
|
|
366
386
|
);
|
|
@@ -780,7 +800,7 @@ function MainMenu({
|
|
|
780
800
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
781
801
|
/* @__PURE__ */ jsx4(GhostBanner, {}),
|
|
782
802
|
/* @__PURE__ */ jsx4(Box4, { marginBottom: 1, children: /* @__PURE__ */ jsx4(Text4, { bold: true, children: "Choose a command, then press Enter to continue." }) }),
|
|
783
|
-
pinFeedback && /* @__PURE__ */ jsx4(Box4, { marginBottom: 1, children: /* @__PURE__ */ jsxs4(Text4, { color:
|
|
803
|
+
pinFeedback && /* @__PURE__ */ jsx4(Box4, { marginBottom: 1, children: /* @__PURE__ */ jsxs4(Text4, { color: inkColors.accent, children: [
|
|
784
804
|
"\u2713 ",
|
|
785
805
|
pinFeedback
|
|
786
806
|
] }) }),
|
|
@@ -833,11 +853,11 @@ function TextPrompt({
|
|
|
833
853
|
};
|
|
834
854
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
835
855
|
/* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
|
|
836
|
-
/* @__PURE__ */ jsx5(Text5, { color:
|
|
856
|
+
/* @__PURE__ */ jsx5(Text5, { color: inkColors.accent, bold: true, children: "?" }),
|
|
837
857
|
/* @__PURE__ */ jsx5(Text5, { children: label })
|
|
838
858
|
] }),
|
|
839
859
|
/* @__PURE__ */ jsxs5(Box5, { gap: 1, marginLeft: 2, children: [
|
|
840
|
-
/* @__PURE__ */ jsx5(Text5, { color:
|
|
860
|
+
/* @__PURE__ */ jsx5(Text5, { color: inkColors.accent, children: "\u276F" }),
|
|
841
861
|
/* @__PURE__ */ jsx5(
|
|
842
862
|
TextInputComponent,
|
|
843
863
|
{
|
|
@@ -1031,7 +1051,7 @@ function CommandArgs({
|
|
|
1031
1051
|
if (phase === "custom") {
|
|
1032
1052
|
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
1033
1053
|
/* @__PURE__ */ jsxs6(Box6, { marginBottom: 1, gap: 1, children: [
|
|
1034
|
-
/* @__PURE__ */ jsx6(Text6, { color:
|
|
1054
|
+
/* @__PURE__ */ jsx6(Text6, { color: inkColors.accent, bold: true, children: "Command" }),
|
|
1035
1055
|
/* @__PURE__ */ jsx6(Text6, { children: command })
|
|
1036
1056
|
] }),
|
|
1037
1057
|
/* @__PURE__ */ jsx6(
|
|
@@ -1065,10 +1085,10 @@ function CommandArgs({
|
|
|
1065
1085
|
);
|
|
1066
1086
|
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
1067
1087
|
/* @__PURE__ */ jsxs6(Box6, { marginBottom: 1, gap: 1, children: [
|
|
1068
|
-
/* @__PURE__ */ jsx6(Text6, { color:
|
|
1088
|
+
/* @__PURE__ */ jsx6(Text6, { color: inkColors.accent, bold: true, children: "Command" }),
|
|
1069
1089
|
/* @__PURE__ */ jsx6(Text6, { children: command })
|
|
1070
1090
|
] }),
|
|
1071
|
-
pinFeedback && /* @__PURE__ */ jsx6(Box6, { marginBottom: 1, children: /* @__PURE__ */ jsxs6(Text6, { color:
|
|
1091
|
+
pinFeedback && /* @__PURE__ */ jsx6(Box6, { marginBottom: 1, children: /* @__PURE__ */ jsxs6(Text6, { color: inkColors.accent, children: [
|
|
1072
1092
|
"\u2713 ",
|
|
1073
1093
|
pinFeedback
|
|
1074
1094
|
] }) }),
|
|
@@ -1197,18 +1217,18 @@ function FlagToggle({
|
|
|
1197
1217
|
});
|
|
1198
1218
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
1199
1219
|
/* @__PURE__ */ jsxs8(Box8, { marginBottom: 1, children: [
|
|
1200
|
-
/* @__PURE__ */ jsx8(Text7, { bold: true, color:
|
|
1220
|
+
/* @__PURE__ */ jsx8(Text7, { bold: true, color: inkColors.accent, children: "\u2691 Global Flags" }),
|
|
1201
1221
|
/* @__PURE__ */ jsx8(Text7, { dimColor: true, children: " (Space to toggle, Enter to confirm)" })
|
|
1202
1222
|
] }),
|
|
1203
1223
|
flags.map((flag, i) => {
|
|
1204
1224
|
const isActive = cursor === i;
|
|
1205
1225
|
const isChecked = selected.has(flag.value);
|
|
1206
1226
|
return /* @__PURE__ */ jsxs8(Box8, { gap: 1, children: [
|
|
1207
|
-
/* @__PURE__ */ jsx8(Text7, { color: isActive ?
|
|
1227
|
+
/* @__PURE__ */ jsx8(Text7, { color: isActive ? inkColors.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
1208
1228
|
/* @__PURE__ */ jsx8(
|
|
1209
1229
|
Text7,
|
|
1210
1230
|
{
|
|
1211
|
-
color: isChecked
|
|
1231
|
+
color: isChecked || isActive ? inkColors.accent : void 0,
|
|
1212
1232
|
bold: isChecked,
|
|
1213
1233
|
children: isChecked ? "\u25C9" : "\u25CB"
|
|
1214
1234
|
}
|
|
@@ -1216,7 +1236,7 @@ function FlagToggle({
|
|
|
1216
1236
|
/* @__PURE__ */ jsx8(
|
|
1217
1237
|
Text7,
|
|
1218
1238
|
{
|
|
1219
|
-
color: isActive ?
|
|
1239
|
+
color: isActive ? inkColors.accent : void 0,
|
|
1220
1240
|
bold: isActive,
|
|
1221
1241
|
children: flag.label
|
|
1222
1242
|
}
|
|
@@ -1277,7 +1297,7 @@ import InkSpinner from "ink-spinner";
|
|
|
1277
1297
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1278
1298
|
function Spinner({
|
|
1279
1299
|
label = "Running...",
|
|
1280
|
-
color =
|
|
1300
|
+
color = inkColors.accent
|
|
1281
1301
|
}) {
|
|
1282
1302
|
return /* @__PURE__ */ jsxs10(Text8, { children: [
|
|
1283
1303
|
/* @__PURE__ */ jsx10(Text8, { color, children: /* @__PURE__ */ jsx10(InkSpinner, { type: "dots" }) }),
|
|
@@ -1304,7 +1324,7 @@ function ConfirmPrompt({
|
|
|
1304
1324
|
}
|
|
1305
1325
|
});
|
|
1306
1326
|
return /* @__PURE__ */ jsxs11(Box10, { gap: 1, children: [
|
|
1307
|
-
/* @__PURE__ */ jsx11(Text9, { color:
|
|
1327
|
+
/* @__PURE__ */ jsx11(Text9, { color: inkColors.accent, bold: true, children: "?" }),
|
|
1308
1328
|
/* @__PURE__ */ jsx11(Text9, { children: message }),
|
|
1309
1329
|
/* @__PURE__ */ jsx11(Text9, { dimColor: true, children: defaultValue ? "(Y/n)" : "(y/N)" })
|
|
1310
1330
|
] });
|
|
@@ -1463,7 +1483,7 @@ function CommandExecution({
|
|
|
1463
1483
|
return /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", children: [
|
|
1464
1484
|
/* @__PURE__ */ jsx13(Divider, {}),
|
|
1465
1485
|
/* @__PURE__ */ jsxs13(Box12, { marginY: 1, gap: 1, children: [
|
|
1466
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1486
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, bold: true, children: "\u25B6" }),
|
|
1467
1487
|
/* @__PURE__ */ jsx13(Text11, { dimColor: true, children: "Running:" }),
|
|
1468
1488
|
/* @__PURE__ */ jsx13(Text11, { children: cmdDisplay })
|
|
1469
1489
|
] }),
|
|
@@ -1475,8 +1495,8 @@ function CommandExecution({
|
|
|
1475
1495
|
return /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", children: [
|
|
1476
1496
|
/* @__PURE__ */ jsx13(Divider, {}),
|
|
1477
1497
|
/* @__PURE__ */ jsxs13(Box12, { marginY: 1, gap: 1, children: [
|
|
1478
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1479
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1498
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, bold: true, children: "\u2713" }),
|
|
1499
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
|
|
1480
1500
|
] }),
|
|
1481
1501
|
/* @__PURE__ */ jsx13(
|
|
1482
1502
|
ConfirmPrompt,
|
|
@@ -1498,10 +1518,10 @@ function CommandExecution({
|
|
|
1498
1518
|
return /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", children: [
|
|
1499
1519
|
/* @__PURE__ */ jsx13(Divider, {}),
|
|
1500
1520
|
/* @__PURE__ */ jsxs13(Box12, { marginY: 1, gap: 1, children: [
|
|
1501
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1502
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1521
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, bold: true, children: "\u2713" }),
|
|
1522
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
|
|
1503
1523
|
] }),
|
|
1504
|
-
pinMessage && /* @__PURE__ */ jsx13(Box12, { marginBottom: 1, children: /* @__PURE__ */ jsx13(Text11, { color:
|
|
1524
|
+
pinMessage && /* @__PURE__ */ jsx13(Box12, { marginBottom: 1, children: /* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, children: pinMessage }) }),
|
|
1505
1525
|
/* @__PURE__ */ jsx13(
|
|
1506
1526
|
SelectList,
|
|
1507
1527
|
{
|
|
@@ -1549,10 +1569,10 @@ function CommandExecution({
|
|
|
1549
1569
|
/* @__PURE__ */ jsx13(Text11, { color: "red", children: result.spawnError })
|
|
1550
1570
|
] }),
|
|
1551
1571
|
(result.spawnError.includes("ENOENT") || result.spawnError.includes("not found")) && /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: [
|
|
1552
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1572
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, bold: true, children: "\u{1F4A1} Supabase CLI not found in PATH" }),
|
|
1553
1573
|
/* @__PURE__ */ jsxs13(Box12, { gap: 1, children: [
|
|
1554
1574
|
/* @__PURE__ */ jsx13(Text11, { dimColor: true, children: "Install it:" }),
|
|
1555
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1575
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, children: "https://supabase.com/docs/guides/cli" })
|
|
1556
1576
|
] })
|
|
1557
1577
|
] })
|
|
1558
1578
|
] }) : /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", marginY: 1, children: [
|
|
@@ -1569,7 +1589,7 @@ function CommandExecution({
|
|
|
1569
1589
|
] }),
|
|
1570
1590
|
!hasDebug && /* @__PURE__ */ jsxs13(Box12, { marginLeft: 2, marginTop: 1, gap: 1, children: [
|
|
1571
1591
|
/* @__PURE__ */ jsx13(Text11, { dimColor: true, children: "\u{1F4A1} Tip: retry with" }),
|
|
1572
|
-
/* @__PURE__ */ jsx13(Text11, { color:
|
|
1592
|
+
/* @__PURE__ */ jsx13(Text11, { color: inkColors.accent, children: "--debug" }),
|
|
1573
1593
|
/* @__PURE__ */ jsx13(Text11, { dimColor: true, children: "to see detailed logs" })
|
|
1574
1594
|
] })
|
|
1575
1595
|
] }),
|
|
@@ -1621,7 +1641,7 @@ function App() {
|
|
|
1621
1641
|
const { exit } = useApp();
|
|
1622
1642
|
const handleExit = () => {
|
|
1623
1643
|
process.stdout.write(
|
|
1624
|
-
"\n" +
|
|
1644
|
+
"\n" + colors.dim("Thank you for using ") + colors.primaryBold("Polterbase") + colors.dim("!") + "\n\n"
|
|
1625
1645
|
);
|
|
1626
1646
|
exit();
|
|
1627
1647
|
};
|