@basictech/cli 0.0.30 → 0.0.31
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 +188 -213
- package/dist/lib/schema.d.ts +1 -0
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/schema.js +9 -0
- package/dist/lib/schema.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
2
|
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
4
|
var __esm = (fn, res) => function __init() {
|
|
10
5
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
6
|
};
|
|
@@ -13,22 +8,6 @@ var __export = (target, all) => {
|
|
|
13
8
|
for (var name in all)
|
|
14
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
10
|
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
32
11
|
|
|
33
12
|
// dist/lib/constants.js
|
|
34
13
|
var CONSTANTS, COMMANDS, MESSAGES;
|
|
@@ -70,15 +49,18 @@ var init_constants = __esm({
|
|
|
70
49
|
});
|
|
71
50
|
|
|
72
51
|
// dist/lib/version.js
|
|
52
|
+
import { readFileSync } from "fs";
|
|
53
|
+
import { join, dirname } from "path";
|
|
54
|
+
import { fileURLToPath } from "url";
|
|
73
55
|
function getVersion() {
|
|
74
56
|
if (cachedVersion) {
|
|
75
57
|
return cachedVersion;
|
|
76
58
|
}
|
|
77
59
|
try {
|
|
78
|
-
const __filename =
|
|
79
|
-
const __dirname =
|
|
80
|
-
const packageJsonPath =
|
|
81
|
-
const packageJson = JSON.parse(
|
|
60
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
61
|
+
const __dirname = dirname(__filename);
|
|
62
|
+
const packageJsonPath = join(__dirname, "../../package.json");
|
|
63
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
82
64
|
cachedVersion = packageJson.version;
|
|
83
65
|
return cachedVersion;
|
|
84
66
|
} catch (error) {
|
|
@@ -88,14 +70,10 @@ function getVersion() {
|
|
|
88
70
|
return fallbackVersion;
|
|
89
71
|
}
|
|
90
72
|
}
|
|
91
|
-
var
|
|
73
|
+
var cachedVersion;
|
|
92
74
|
var init_version = __esm({
|
|
93
75
|
"dist/lib/version.js"() {
|
|
94
76
|
"use strict";
|
|
95
|
-
import_fs = require("fs");
|
|
96
|
-
import_path = require("path");
|
|
97
|
-
import_url = require("url");
|
|
98
|
-
import_meta = {};
|
|
99
77
|
cachedVersion = null;
|
|
100
78
|
}
|
|
101
79
|
});
|
|
@@ -183,6 +161,10 @@ var init_errors = __esm({
|
|
|
183
161
|
});
|
|
184
162
|
|
|
185
163
|
// dist/lib/platform.js
|
|
164
|
+
import { exec } from "child_process";
|
|
165
|
+
import { promisify } from "util";
|
|
166
|
+
import * as os from "os";
|
|
167
|
+
import * as path from "path";
|
|
186
168
|
function getConfigPath() {
|
|
187
169
|
const home = os.homedir();
|
|
188
170
|
return path.join(home, CONSTANTS.CLI_DIR, CONSTANTS.TOKEN_FILE);
|
|
@@ -275,26 +257,22 @@ function findSimilarCommands(input) {
|
|
|
275
257
|
function generateSlug(name) {
|
|
276
258
|
return name.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
277
259
|
}
|
|
278
|
-
var
|
|
260
|
+
var execAsync;
|
|
279
261
|
var init_platform = __esm({
|
|
280
262
|
"dist/lib/platform.js"() {
|
|
281
263
|
"use strict";
|
|
282
|
-
import_child_process = require("child_process");
|
|
283
|
-
import_util = require("util");
|
|
284
|
-
os = __toESM(require("os"), 1);
|
|
285
|
-
path = __toESM(require("path"), 1);
|
|
286
264
|
init_constants();
|
|
287
|
-
execAsync =
|
|
265
|
+
execAsync = promisify(exec);
|
|
288
266
|
}
|
|
289
267
|
});
|
|
290
268
|
|
|
291
269
|
// dist/lib/auth.js
|
|
292
|
-
|
|
270
|
+
import { createServer } from "http";
|
|
271
|
+
import { promises as fs } from "fs";
|
|
272
|
+
var AuthService;
|
|
293
273
|
var init_auth = __esm({
|
|
294
274
|
"dist/lib/auth.js"() {
|
|
295
275
|
"use strict";
|
|
296
|
-
import_http = require("http");
|
|
297
|
-
import_fs2 = require("fs");
|
|
298
276
|
init_constants();
|
|
299
277
|
init_platform();
|
|
300
278
|
init_errors();
|
|
@@ -324,7 +302,7 @@ var init_auth = __esm({
|
|
|
324
302
|
async getToken() {
|
|
325
303
|
try {
|
|
326
304
|
const tokenPath = getConfigPath();
|
|
327
|
-
const tokenData = await
|
|
305
|
+
const tokenData = await fs.readFile(tokenPath, "utf8");
|
|
328
306
|
const token = JSON.parse(tokenData);
|
|
329
307
|
if (token.expires_at && Date.now() > token.expires_at) {
|
|
330
308
|
const refreshedToken = await this.refreshToken(token);
|
|
@@ -356,7 +334,7 @@ var init_auth = __esm({
|
|
|
356
334
|
}
|
|
357
335
|
async startOAuthFlow() {
|
|
358
336
|
return new Promise((resolve, reject) => {
|
|
359
|
-
const server =
|
|
337
|
+
const server = createServer((req, res) => {
|
|
360
338
|
if (req.url?.startsWith("/callback")) {
|
|
361
339
|
const url = new URL(req.url, CONSTANTS.OAUTH_REDIRECT);
|
|
362
340
|
const code = url.searchParams.get("code");
|
|
@@ -451,13 +429,13 @@ var init_auth = __esm({
|
|
|
451
429
|
async saveToken(token) {
|
|
452
430
|
const tokenPath = getConfigPath();
|
|
453
431
|
const configDir = getConfigDir();
|
|
454
|
-
await
|
|
455
|
-
await
|
|
432
|
+
await fs.mkdir(configDir, { recursive: true });
|
|
433
|
+
await fs.writeFile(tokenPath, JSON.stringify(token, null, 2), { mode: 384 });
|
|
456
434
|
}
|
|
457
435
|
async deleteToken() {
|
|
458
436
|
const tokenPath = getConfigPath();
|
|
459
437
|
try {
|
|
460
|
-
await
|
|
438
|
+
await fs.unlink(tokenPath);
|
|
461
439
|
} catch (error) {
|
|
462
440
|
if (error.code !== "ENOENT") {
|
|
463
441
|
throw error;
|
|
@@ -806,6 +784,7 @@ var update_exports = {};
|
|
|
806
784
|
__export(update_exports, {
|
|
807
785
|
UpdateCommand: () => UpdateCommand
|
|
808
786
|
});
|
|
787
|
+
import { spawn } from "child_process";
|
|
809
788
|
async function UpdateCommand() {
|
|
810
789
|
try {
|
|
811
790
|
if (!await isOnline()) {
|
|
@@ -834,7 +813,7 @@ async function UpdateCommand() {
|
|
|
834
813
|
}
|
|
835
814
|
async function updatePackage() {
|
|
836
815
|
return new Promise((resolve, reject) => {
|
|
837
|
-
const updateProcess =
|
|
816
|
+
const updateProcess = spawn("npm", ["update", "-g", "@basictech/cli"], {
|
|
838
817
|
stdio: "pipe",
|
|
839
818
|
shell: true
|
|
840
819
|
});
|
|
@@ -872,11 +851,9 @@ async function updatePackage() {
|
|
|
872
851
|
});
|
|
873
852
|
});
|
|
874
853
|
}
|
|
875
|
-
var import_child_process2;
|
|
876
854
|
var init_update = __esm({
|
|
877
855
|
"dist/commands/update.js"() {
|
|
878
856
|
"use strict";
|
|
879
|
-
import_child_process2 = require("child_process");
|
|
880
857
|
init_version();
|
|
881
858
|
init_api();
|
|
882
859
|
init_platform();
|
|
@@ -901,16 +878,19 @@ var init_debug = __esm({
|
|
|
901
878
|
});
|
|
902
879
|
|
|
903
880
|
// dist/components/Table.js
|
|
881
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
882
|
+
import { useState, useEffect } from "react";
|
|
883
|
+
import { Box, Text, useInput } from "ink";
|
|
904
884
|
function Table({ columns, rows, onSelect, onCopy, onOpen, onNew, onExit, helpText }) {
|
|
905
|
-
const [selectedIndex, setSelectedIndex] =
|
|
906
|
-
const [notification, setNotification] =
|
|
885
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
886
|
+
const [notification, setNotification] = useState("");
|
|
907
887
|
const defaultHelpText = {
|
|
908
888
|
copyAction: "'c' to copy project ID",
|
|
909
889
|
openAction: "'o' to open in browser",
|
|
910
890
|
newAction: void 0
|
|
911
891
|
};
|
|
912
892
|
const currentHelpText = helpText || defaultHelpText;
|
|
913
|
-
|
|
893
|
+
useInput((input, key) => {
|
|
914
894
|
if (key.upArrow && rows.length > 0) {
|
|
915
895
|
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
916
896
|
} else if (key.downArrow && rows.length > 0) {
|
|
@@ -934,57 +914,53 @@ function Table({ columns, rows, onSelect, onCopy, onOpen, onNew, onExit, helpTex
|
|
|
934
914
|
}
|
|
935
915
|
}
|
|
936
916
|
});
|
|
937
|
-
|
|
917
|
+
useEffect(() => {
|
|
938
918
|
if (selectedIndex >= rows.length) {
|
|
939
919
|
setSelectedIndex(Math.max(0, rows.length - 1));
|
|
940
920
|
}
|
|
941
921
|
}, [rows.length, selectedIndex]);
|
|
942
|
-
const renderHeader = () => (
|
|
922
|
+
const renderHeader = () => _jsx(Box, { borderStyle: "single", borderBottom: true, paddingX: 1, children: _jsx(Box, { children: columns.map((column, index) => _jsx(Box, { width: column.width, marginRight: index < columns.length - 1 ? 1 : 0, children: _jsx(Text, { bold: true, children: column.title }) }, column.key)) }) });
|
|
943
923
|
const renderRow = (row, index) => {
|
|
944
924
|
const isSelected = index === selectedIndex;
|
|
945
|
-
return (
|
|
925
|
+
return _jsx(Box, { children: _jsx(Box, { paddingX: 1, children: columns.map((column, colIndex) => _jsx(Box, { width: column.width, marginRight: colIndex < columns.length - 1 ? 1 : 0, children: _jsx(Text, { color: isSelected ? "black" : void 0, backgroundColor: isSelected ? "magenta" : void 0, children: (row[column.key] || "").substring(0, column.width - 1) }) }, column.key)) }) }, index);
|
|
946
926
|
};
|
|
947
927
|
const renderHelp = () => {
|
|
948
928
|
const mainActionsText = [
|
|
949
929
|
currentHelpText.copyAction,
|
|
950
930
|
currentHelpText.openAction
|
|
951
931
|
].filter(Boolean).join(" \u2022 ");
|
|
952
|
-
return (
|
|
932
|
+
return _jsxs(Box, { marginTop: 2, children: [notification && _jsx(Box, { marginBottom: 2, children: _jsx(Text, { color: "blue", children: notification }) }), _jsxs(Box, { flexDirection: "column", children: [currentHelpText.newAction && _jsx(Text, { color: "gray", children: currentHelpText.newAction }), _jsx(Text, { color: "gray", children: mainActionsText }), _jsx(Text, { color: "gray", children: "\u2191/\u2193 to navigate \u2022 esc to quit" })] })] });
|
|
953
933
|
};
|
|
954
934
|
if (rows.length === 0) {
|
|
955
935
|
const itemType = helpText?.copyAction.includes("team") ? "teams" : "projects";
|
|
956
|
-
return (
|
|
936
|
+
return _jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: ["No ", itemType, " found."] }), _jsxs(Box, { marginTop: 2, flexDirection: "column", children: [currentHelpText.newAction && _jsx(Text, { color: "gray", children: currentHelpText.newAction }), _jsx(Text, { color: "gray", children: "Press esc to quit" })] })] });
|
|
957
937
|
}
|
|
958
|
-
return (
|
|
938
|
+
return _jsxs(Box, { flexDirection: "column", children: [renderHeader(), _jsx(Box, { flexDirection: "column", children: rows.map((row, index) => renderRow(row, index)) }), renderHelp()] });
|
|
959
939
|
}
|
|
960
|
-
var import_jsx_runtime, import_react, import_ink;
|
|
961
940
|
var init_Table = __esm({
|
|
962
941
|
"dist/components/Table.js"() {
|
|
963
942
|
"use strict";
|
|
964
|
-
import_jsx_runtime = require("react/jsx-runtime");
|
|
965
|
-
import_react = require("react");
|
|
966
|
-
import_ink = require("ink");
|
|
967
943
|
}
|
|
968
944
|
});
|
|
969
945
|
|
|
970
946
|
// dist/components/Spinner.js
|
|
971
|
-
|
|
947
|
+
import { jsx as _jsx2, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
948
|
+
import React from "react";
|
|
949
|
+
import { Text as Text2 } from "ink";
|
|
950
|
+
var spinnerFrames, Spinner;
|
|
972
951
|
var init_Spinner = __esm({
|
|
973
952
|
"dist/components/Spinner.js"() {
|
|
974
953
|
"use strict";
|
|
975
|
-
import_jsx_runtime2 = require("react/jsx-runtime");
|
|
976
|
-
import_react2 = __toESM(require("react"), 1);
|
|
977
|
-
import_ink2 = require("ink");
|
|
978
954
|
spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
979
955
|
Spinner = ({ text = "Loading..." }) => {
|
|
980
|
-
const [frame, setFrame] =
|
|
981
|
-
|
|
956
|
+
const [frame, setFrame] = React.useState(0);
|
|
957
|
+
React.useEffect(() => {
|
|
982
958
|
const timer = setInterval(() => {
|
|
983
959
|
setFrame((prev) => (prev + 1) % spinnerFrames.length);
|
|
984
960
|
}, 80);
|
|
985
961
|
return () => clearInterval(timer);
|
|
986
962
|
}, []);
|
|
987
|
-
return (
|
|
963
|
+
return _jsxs2(Text2, { children: [_jsx2(Text2, { color: "cyan", children: spinnerFrames[frame] }), " ", text] });
|
|
988
964
|
};
|
|
989
965
|
}
|
|
990
966
|
});
|
|
@@ -994,13 +970,16 @@ var projects_exports = {};
|
|
|
994
970
|
__export(projects_exports, {
|
|
995
971
|
ProjectsCommand: () => ProjectsCommand
|
|
996
972
|
});
|
|
973
|
+
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
974
|
+
import React2 from "react";
|
|
975
|
+
import { render, Text as Text3 } from "ink";
|
|
997
976
|
function ProjectsApp() {
|
|
998
|
-
const [state, setState] =
|
|
977
|
+
const [state, setState] = React2.useState({
|
|
999
978
|
loading: true,
|
|
1000
979
|
projects: [],
|
|
1001
980
|
error: null
|
|
1002
981
|
});
|
|
1003
|
-
|
|
982
|
+
React2.useEffect(() => {
|
|
1004
983
|
async function loadProjects() {
|
|
1005
984
|
try {
|
|
1006
985
|
if (!await isOnline()) {
|
|
@@ -1046,10 +1025,10 @@ function ProjectsApp() {
|
|
|
1046
1025
|
process.exit(0);
|
|
1047
1026
|
};
|
|
1048
1027
|
if (state.loading) {
|
|
1049
|
-
return (
|
|
1028
|
+
return _jsx3(Spinner, { text: "Loading projects..." });
|
|
1050
1029
|
}
|
|
1051
1030
|
if (state.error) {
|
|
1052
|
-
return (
|
|
1031
|
+
return _jsx3(Text3, { color: "red", children: state.error });
|
|
1053
1032
|
}
|
|
1054
1033
|
const columns = [
|
|
1055
1034
|
{ title: "ID", width: 38, key: "id" },
|
|
@@ -1061,18 +1040,14 @@ function ProjectsApp() {
|
|
|
1061
1040
|
name: project.name,
|
|
1062
1041
|
team_name: project.team_name
|
|
1063
1042
|
}));
|
|
1064
|
-
return (
|
|
1043
|
+
return _jsx3(Table, { columns, rows, onCopy: handleCopy, onOpen: handleOpen, onExit: handleExit });
|
|
1065
1044
|
}
|
|
1066
1045
|
async function ProjectsCommand() {
|
|
1067
|
-
|
|
1046
|
+
render(_jsx3(ProjectsApp, {}));
|
|
1068
1047
|
}
|
|
1069
|
-
var import_jsx_runtime3, import_react3, import_ink3;
|
|
1070
1048
|
var init_projects = __esm({
|
|
1071
1049
|
"dist/commands/projects.js"() {
|
|
1072
1050
|
"use strict";
|
|
1073
|
-
import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1074
|
-
import_react3 = __toESM(require("react"), 1);
|
|
1075
|
-
import_ink3 = require("ink");
|
|
1076
1051
|
init_Table();
|
|
1077
1052
|
init_Spinner();
|
|
1078
1053
|
init_api();
|
|
@@ -1083,8 +1058,11 @@ var init_projects = __esm({
|
|
|
1083
1058
|
});
|
|
1084
1059
|
|
|
1085
1060
|
// dist/components/TeamForm.js
|
|
1061
|
+
import { jsx as _jsx4, jsxs as _jsxs3 } from "react/jsx-runtime";
|
|
1062
|
+
import { useState as useState2, useEffect as useEffect2 } from "react";
|
|
1063
|
+
import { Box as Box2, Text as Text4, useInput as useInput2 } from "ink";
|
|
1086
1064
|
function TeamForm({ title, onSubmit, onCancel }) {
|
|
1087
|
-
const [state, setState] = (
|
|
1065
|
+
const [state, setState] = useState2({
|
|
1088
1066
|
teamName: "",
|
|
1089
1067
|
teamSlug: "",
|
|
1090
1068
|
currentField: "name",
|
|
@@ -1092,7 +1070,7 @@ function TeamForm({ title, onSubmit, onCancel }) {
|
|
|
1092
1070
|
slugAvailable: null,
|
|
1093
1071
|
error: null
|
|
1094
1072
|
});
|
|
1095
|
-
(
|
|
1073
|
+
useEffect2(() => {
|
|
1096
1074
|
if (state.teamName.trim()) {
|
|
1097
1075
|
const newSlug = generateSlug(state.teamName);
|
|
1098
1076
|
setState((prev) => ({
|
|
@@ -1110,7 +1088,7 @@ function TeamForm({ title, onSubmit, onCancel }) {
|
|
|
1110
1088
|
}));
|
|
1111
1089
|
}
|
|
1112
1090
|
}, [state.teamName]);
|
|
1113
|
-
(
|
|
1091
|
+
useEffect2(() => {
|
|
1114
1092
|
if (state.teamSlug.trim() && (state.currentField === "name" || state.currentField === "slug")) {
|
|
1115
1093
|
const checkAvailability = async () => {
|
|
1116
1094
|
setState((prev) => ({ ...prev, isCheckingSlug: true, error: null }));
|
|
@@ -1136,7 +1114,7 @@ function TeamForm({ title, onSubmit, onCancel }) {
|
|
|
1136
1114
|
return () => clearTimeout(timeoutId);
|
|
1137
1115
|
}
|
|
1138
1116
|
}, [state.teamSlug, state.currentField]);
|
|
1139
|
-
(
|
|
1117
|
+
useInput2((input, key) => {
|
|
1140
1118
|
if (state.currentField === "submitting") {
|
|
1141
1119
|
return;
|
|
1142
1120
|
}
|
|
@@ -1254,15 +1232,11 @@ function TeamForm({ title, onSubmit, onCancel }) {
|
|
|
1254
1232
|
}
|
|
1255
1233
|
return "esc to cancel";
|
|
1256
1234
|
};
|
|
1257
|
-
return (
|
|
1235
|
+
return _jsxs3(Box2, { flexDirection: "column", padding: 1, children: [_jsx4(Box2, { marginBottom: 2, children: _jsx4(Text4, { bold: true, color: "blue", children: title }) }), _jsxs3(Box2, { flexDirection: "column", marginBottom: 1, children: [_jsx4(Box2, { children: _jsxs3(Text4, { color: state.currentField === "name" ? "blue" : "gray", children: [state.currentField === "name" ? ">" : "\u2713", " Team Name:"] }) }), _jsx4(Box2, { marginLeft: 2, children: _jsxs3(Text4, { children: [state.teamName, state.currentField === "name" && _jsx4(Text4, { backgroundColor: "white", color: "black", children: "\u2588" })] }) })] }), state.teamSlug && _jsxs3(Box2, { flexDirection: "column", marginBottom: 1, children: [_jsx4(Box2, { children: _jsxs3(Text4, { color: state.currentField === "slug" ? "blue" : "gray", children: [state.currentField === "slug" ? ">" : "\u2713", " Team Slug", state.currentField === "name" ? " (auto-generated)" : "", ":"] }) }), _jsx4(Box2, { marginLeft: 2, children: _jsxs3(Text4, { children: [state.teamSlug, state.currentField === "slug" && _jsx4(Text4, { backgroundColor: "white", color: "black", children: "\u2588" })] }) }), getSlugStatus() && _jsx4(Box2, { marginLeft: 2, children: _jsx4(Text4, { color: getSlugStatusColor(), children: getSlugStatusText() }) })] }), state.error && _jsx4(Box2, { marginLeft: 2, marginBottom: 1, children: _jsxs3(Text4, { color: "red", children: ["Error: ", state.error] }) }), _jsx4(Box2, { marginTop: 2, children: _jsx4(Text4, { color: "gray", children: getHelpText() }) })] });
|
|
1258
1236
|
}
|
|
1259
|
-
var import_jsx_runtime4, import_react4, import_ink4;
|
|
1260
1237
|
var init_TeamForm = __esm({
|
|
1261
1238
|
"dist/components/TeamForm.js"() {
|
|
1262
1239
|
"use strict";
|
|
1263
|
-
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1264
|
-
import_react4 = require("react");
|
|
1265
|
-
import_ink4 = require("ink");
|
|
1266
1240
|
init_api();
|
|
1267
1241
|
init_platform();
|
|
1268
1242
|
}
|
|
@@ -1273,13 +1247,16 @@ var teams_exports = {};
|
|
|
1273
1247
|
__export(teams_exports, {
|
|
1274
1248
|
TeamsCommand: () => TeamsCommand
|
|
1275
1249
|
});
|
|
1250
|
+
import { jsx as _jsx5, jsxs as _jsxs4 } from "react/jsx-runtime";
|
|
1251
|
+
import React3 from "react";
|
|
1252
|
+
import { render as render2, Box as Box3, Text as Text5 } from "ink";
|
|
1276
1253
|
function TeamsApp() {
|
|
1277
|
-
const [state, setState] =
|
|
1254
|
+
const [state, setState] = React3.useState({
|
|
1278
1255
|
loading: true,
|
|
1279
1256
|
teams: [],
|
|
1280
1257
|
error: null
|
|
1281
1258
|
});
|
|
1282
|
-
|
|
1259
|
+
React3.useEffect(() => {
|
|
1283
1260
|
async function loadTeams() {
|
|
1284
1261
|
try {
|
|
1285
1262
|
if (!await isOnline()) {
|
|
@@ -1325,13 +1302,13 @@ function TeamsApp() {
|
|
|
1325
1302
|
process.exit(0);
|
|
1326
1303
|
};
|
|
1327
1304
|
const handleNew = () => {
|
|
1328
|
-
(
|
|
1305
|
+
render2(_jsx5(NewTeamApp, {}));
|
|
1329
1306
|
};
|
|
1330
1307
|
if (state.loading) {
|
|
1331
|
-
return (
|
|
1308
|
+
return _jsx5(Spinner, { text: "Loading teams..." });
|
|
1332
1309
|
}
|
|
1333
1310
|
if (state.error) {
|
|
1334
|
-
return (
|
|
1311
|
+
return _jsx5(Text5, { color: "red", children: state.error });
|
|
1335
1312
|
}
|
|
1336
1313
|
const columns = [
|
|
1337
1314
|
{ title: "ID", width: 38, key: "id" },
|
|
@@ -1344,14 +1321,14 @@ function TeamsApp() {
|
|
|
1344
1321
|
role_name: team.role_name || "Member",
|
|
1345
1322
|
slug: team.slug
|
|
1346
1323
|
}));
|
|
1347
|
-
return (
|
|
1324
|
+
return _jsx5(Table, { columns, rows, onCopy: handleCopy, onOpen: handleOpen, onExit: handleExit, onNew: handleNew, helpText: {
|
|
1348
1325
|
copyAction: "'c' to copy team ID",
|
|
1349
1326
|
openAction: "'o' to open in browser",
|
|
1350
1327
|
newAction: "'n' to create a new team"
|
|
1351
1328
|
} });
|
|
1352
1329
|
}
|
|
1353
1330
|
function NewTeamApp() {
|
|
1354
|
-
const [state, setState] =
|
|
1331
|
+
const [state, setState] = React3.useState({
|
|
1355
1332
|
loading: false,
|
|
1356
1333
|
error: null,
|
|
1357
1334
|
success: false,
|
|
@@ -1392,30 +1369,26 @@ function NewTeamApp() {
|
|
|
1392
1369
|
}
|
|
1393
1370
|
};
|
|
1394
1371
|
if (state.loading) {
|
|
1395
|
-
return (
|
|
1372
|
+
return _jsx5(Spinner, { text: "Creating team..." });
|
|
1396
1373
|
}
|
|
1397
1374
|
if (state.success) {
|
|
1398
|
-
return (
|
|
1375
|
+
return _jsxs4(Box3, { flexDirection: "column", children: [_jsxs4(Text5, { color: "green", children: ['\u2705 Team "', state.teamName, '" created successfully!'] }), _jsxs4(Text5, { children: ["Team slug: ", state.teamSlug] })] });
|
|
1399
1376
|
}
|
|
1400
1377
|
if (state.error) {
|
|
1401
|
-
return (
|
|
1378
|
+
return _jsx5(Text5, { color: "red", children: state.error });
|
|
1402
1379
|
}
|
|
1403
|
-
return (
|
|
1380
|
+
return _jsx5(TeamForm, { title: "Create New Team", onSubmit: handleSubmit, onCancel: () => process.exit(0) });
|
|
1404
1381
|
}
|
|
1405
1382
|
async function TeamsCommand(action) {
|
|
1406
1383
|
if (action === "new") {
|
|
1407
|
-
(
|
|
1384
|
+
render2(_jsx5(NewTeamApp, {}));
|
|
1408
1385
|
} else {
|
|
1409
|
-
(
|
|
1386
|
+
render2(_jsx5(TeamsApp, {}));
|
|
1410
1387
|
}
|
|
1411
1388
|
}
|
|
1412
|
-
var import_jsx_runtime5, import_react5, import_ink5;
|
|
1413
1389
|
var init_teams = __esm({
|
|
1414
1390
|
"dist/commands/teams.js"() {
|
|
1415
1391
|
"use strict";
|
|
1416
|
-
import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1417
|
-
import_react5 = __toESM(require("react"), 1);
|
|
1418
|
-
import_ink5 = require("ink");
|
|
1419
1392
|
init_Table();
|
|
1420
1393
|
init_Spinner();
|
|
1421
1394
|
init_TeamForm();
|
|
@@ -1430,9 +1403,13 @@ var init_teams = __esm({
|
|
|
1430
1403
|
var schema_exports = {};
|
|
1431
1404
|
__export(schema_exports, {
|
|
1432
1405
|
compareVersions: () => compareVersions,
|
|
1406
|
+
parseSchemaFile: () => parseSchemaFile,
|
|
1433
1407
|
readSchemaFromConfig: () => readSchemaFromConfig,
|
|
1434
1408
|
saveSchemaToConfig: () => saveSchemaToConfig
|
|
1435
1409
|
});
|
|
1410
|
+
import * as fs2 from "fs/promises";
|
|
1411
|
+
import * as path2 from "path";
|
|
1412
|
+
import { parse } from "@babel/parser";
|
|
1436
1413
|
async function readSchemaFromConfig(targetDir = process.cwd()) {
|
|
1437
1414
|
const possibleFiles = [
|
|
1438
1415
|
"basic.config.ts",
|
|
@@ -1469,7 +1446,7 @@ async function readSchemaFromConfig(targetDir = process.cwd()) {
|
|
|
1469
1446
|
}
|
|
1470
1447
|
function extractSchemaFromCode(content) {
|
|
1471
1448
|
try {
|
|
1472
|
-
const ast =
|
|
1449
|
+
const ast = parse(content, {
|
|
1473
1450
|
sourceType: "module",
|
|
1474
1451
|
plugins: ["typescript", "jsx"]
|
|
1475
1452
|
});
|
|
@@ -1605,13 +1582,16 @@ function compareVersions(local, remote) {
|
|
|
1605
1582
|
remoteVersion
|
|
1606
1583
|
};
|
|
1607
1584
|
}
|
|
1608
|
-
|
|
1585
|
+
async function parseSchemaFile(filePath) {
|
|
1586
|
+
const content = await fs2.readFile(filePath, "utf8");
|
|
1587
|
+
const ast = parse(content, {
|
|
1588
|
+
sourceType: "module",
|
|
1589
|
+
plugins: ["typescript"]
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1609
1592
|
var init_schema = __esm({
|
|
1610
1593
|
"dist/lib/schema.js"() {
|
|
1611
1594
|
"use strict";
|
|
1612
|
-
fs2 = __toESM(require("fs/promises"), 1);
|
|
1613
|
-
path2 = __toESM(require("path"), 1);
|
|
1614
|
-
import_parser = require("@babel/parser");
|
|
1615
1595
|
}
|
|
1616
1596
|
});
|
|
1617
1597
|
|
|
@@ -1620,12 +1600,15 @@ var status_exports = {};
|
|
|
1620
1600
|
__export(status_exports, {
|
|
1621
1601
|
StatusCommand: () => StatusCommand
|
|
1622
1602
|
});
|
|
1603
|
+
import { jsx as _jsx6, jsxs as _jsxs5 } from "react/jsx-runtime";
|
|
1604
|
+
import React4 from "react";
|
|
1605
|
+
import { render as render3, Box as Box4, Text as Text6 } from "ink";
|
|
1623
1606
|
function StatusApp() {
|
|
1624
|
-
const [state, setState] =
|
|
1607
|
+
const [state, setState] = React4.useState({
|
|
1625
1608
|
loading: true,
|
|
1626
1609
|
error: null
|
|
1627
1610
|
});
|
|
1628
|
-
|
|
1611
|
+
React4.useEffect(() => {
|
|
1629
1612
|
async function checkStatus() {
|
|
1630
1613
|
try {
|
|
1631
1614
|
if (!await isOnline()) {
|
|
@@ -1715,15 +1698,15 @@ function StatusApp() {
|
|
|
1715
1698
|
checkStatus();
|
|
1716
1699
|
}, []);
|
|
1717
1700
|
if (state.loading) {
|
|
1718
|
-
return (
|
|
1701
|
+
return _jsx6(Spinner, { text: "Checking status..." });
|
|
1719
1702
|
}
|
|
1720
1703
|
if (state.error) {
|
|
1721
|
-
return (
|
|
1704
|
+
return _jsx6(Box4, { flexDirection: "column", children: _jsxs5(Text6, { color: "red", children: ["Error: ", state.error] }) });
|
|
1722
1705
|
}
|
|
1723
1706
|
if (state.result) {
|
|
1724
|
-
return (
|
|
1707
|
+
return _jsx6(StatusDisplay, { result: state.result });
|
|
1725
1708
|
}
|
|
1726
|
-
return (
|
|
1709
|
+
return _jsx6(Text6, { children: "Unknown status" });
|
|
1727
1710
|
}
|
|
1728
1711
|
async function analyzeStatus(localConfig, remoteSchema, comparison) {
|
|
1729
1712
|
const apiClient = ApiClient.getInstance();
|
|
@@ -1969,20 +1952,16 @@ function StatusDisplay({ result }) {
|
|
|
1969
1952
|
}
|
|
1970
1953
|
};
|
|
1971
1954
|
const statusMessages = result.message.filter((msg) => !msg.startsWith("Project ID:") && !msg.startsWith("Remote schema version:"));
|
|
1972
|
-
return (
|
|
1955
|
+
return _jsxs5(Box4, { flexDirection: "column", children: [result.projectId && _jsxs5(Box4, { flexDirection: "column", marginBottom: 1, children: [_jsxs5(Text6, { color: "cyan", children: ["Project ID: ", result.projectId] }), _jsxs5(Box4, { children: [_jsxs5(Text6, { color: "gray", children: ["Local version: ", result.localVersion] }), result.remoteVersion > 0 && _jsxs5(Text6, { color: "gray", children: [" \u2022 Remote version: ", result.remoteVersion] })] })] }), _jsxs5(Box4, { flexDirection: "column", marginBottom: 1, children: [_jsx6(Box4, { marginBottom: 1, children: _jsxs5(Text6, { color: getStatusColor(), children: [getStatusIcon(), " ", getStatusDescription()] }) }), statusMessages.length > 0 && _jsx6(Box4, { flexDirection: "column", children: statusMessages.map((line, index) => _jsx6(Text6, { children: line }, index)) })] }), result.validationErrors && result.validationErrors.length > 0 && _jsxs5(Box4, { flexDirection: "column", marginBottom: 1, children: [_jsx6(Text6, { color: "red", children: "Validation errors:" }), result.validationErrors.map((error, index) => _jsxs5(Text6, { color: "red", children: ["\u2022 ", error.message, " at ", error.instancePath || "root"] }, index))] }), result.suggestions.length > 0 && _jsxs5(Box4, { flexDirection: "column", marginTop: 1, children: [_jsx6(Text6, { color: "blue", children: "Next steps:" }), result.suggestions.map((suggestion, index) => _jsxs5(Text6, { color: "gray", children: ["\u2022 ", suggestion] }, index))] })] });
|
|
1973
1956
|
}
|
|
1974
1957
|
async function StatusCommand() {
|
|
1975
|
-
const { waitUntilExit } = (
|
|
1958
|
+
const { waitUntilExit } = render3(_jsx6(StatusApp, {}));
|
|
1976
1959
|
await waitUntilExit();
|
|
1977
1960
|
process.exit(0);
|
|
1978
1961
|
}
|
|
1979
|
-
var import_jsx_runtime6, import_react6, import_ink6;
|
|
1980
1962
|
var init_status = __esm({
|
|
1981
1963
|
"dist/commands/status.js"() {
|
|
1982
1964
|
"use strict";
|
|
1983
|
-
import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1984
|
-
import_react6 = __toESM(require("react"), 1);
|
|
1985
|
-
import_ink6 = require("ink");
|
|
1986
1965
|
init_Spinner();
|
|
1987
1966
|
init_api();
|
|
1988
1967
|
init_auth();
|
|
@@ -1997,13 +1976,16 @@ var pull_exports = {};
|
|
|
1997
1976
|
__export(pull_exports, {
|
|
1998
1977
|
PullCommand: () => PullCommand
|
|
1999
1978
|
});
|
|
1979
|
+
import { jsx as _jsx7, jsxs as _jsxs6, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1980
|
+
import React5 from "react";
|
|
1981
|
+
import { render as render4, Box as Box5, Text as Text7, useInput as useInput3 } from "ink";
|
|
2000
1982
|
function PullApp() {
|
|
2001
|
-
const [state, setState] =
|
|
1983
|
+
const [state, setState] = React5.useState({
|
|
2002
1984
|
phase: "checking",
|
|
2003
1985
|
error: null
|
|
2004
1986
|
});
|
|
2005
|
-
const [selectedOption, setSelectedOption] =
|
|
2006
|
-
|
|
1987
|
+
const [selectedOption, setSelectedOption] = React5.useState("yes");
|
|
1988
|
+
React5.useEffect(() => {
|
|
2007
1989
|
async function checkPullStatus() {
|
|
2008
1990
|
try {
|
|
2009
1991
|
if (!await isOnline()) {
|
|
@@ -2077,7 +2059,7 @@ function PullApp() {
|
|
|
2077
2059
|
}
|
|
2078
2060
|
checkPullStatus();
|
|
2079
2061
|
}, []);
|
|
2080
|
-
(
|
|
2062
|
+
useInput3((input, key) => {
|
|
2081
2063
|
if (state.phase === "confirming") {
|
|
2082
2064
|
if (key.upArrow || key.downArrow) {
|
|
2083
2065
|
setSelectedOption((prev) => prev === "yes" ? "no" : "yes");
|
|
@@ -2126,27 +2108,27 @@ function PullApp() {
|
|
|
2126
2108
|
}
|
|
2127
2109
|
};
|
|
2128
2110
|
if (state.phase === "checking") {
|
|
2129
|
-
return (
|
|
2111
|
+
return _jsx7(Spinner, { text: "Checking pull status..." });
|
|
2130
2112
|
}
|
|
2131
2113
|
if (state.phase === "pulling") {
|
|
2132
|
-
return (
|
|
2114
|
+
return _jsx7(Spinner, { text: "Pulling latest schema..." });
|
|
2133
2115
|
}
|
|
2134
2116
|
if (state.phase === "error") {
|
|
2135
2117
|
setTimeout(() => process.exit(1), 0);
|
|
2136
|
-
return (
|
|
2118
|
+
return _jsxs6(Box5, { flexDirection: "column", children: [_jsxs6(Text7, { color: "red", children: ["Error: ", state.error] }), _jsxs6(Box5, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [_jsx7(Text7, { color: "blue", children: "Next steps:" }), state.error?.includes("offline") || state.error?.includes("network") ? _jsxs6(_Fragment, { children: [_jsx7(Text7, { color: "gray", children: "\u2022 Check your internet connection" }), _jsx7(Text7, { color: "gray", children: "\u2022 Try again in a moment" })] }) : state.error?.includes("logged") || state.error?.includes("auth") ? _jsxs6(_Fragment, { children: [_jsx7(Text7, { color: "gray", children: "\u2022 Run 'basic login' to authenticate" }), _jsx7(Text7, { color: "gray", children: "\u2022 Ensure you have a valid account" })] }) : state.error?.includes("schema") || state.error?.includes("project") ? _jsxs6(_Fragment, { children: [_jsx7(Text7, { color: "gray", children: "\u2022 Check if the project ID is correct" }), _jsx7(Text7, { color: "gray", children: "\u2022 Ensure you have access to this project" }), _jsx7(Text7, { color: "gray", children: "\u2022 Run 'basic status' for more details" })] }) : _jsxs6(_Fragment, { children: [_jsx7(Text7, { color: "gray", children: "\u2022 Try running the command again" }), _jsx7(Text7, { color: "gray", children: "\u2022 Run 'basic status' to check your project state" }), _jsx7(Text7, { color: "gray", children: "\u2022 Check the Basic documentation if the issue persists" })] })] })] });
|
|
2137
2119
|
}
|
|
2138
2120
|
if (state.phase === "success" && state.pullResult) {
|
|
2139
2121
|
setTimeout(() => process.exit(0), 0);
|
|
2140
|
-
return (
|
|
2122
|
+
return _jsx7(PullSuccessDisplay, { result: state.pullResult });
|
|
2141
2123
|
}
|
|
2142
2124
|
if (state.phase === "confirming" && state.statusResult) {
|
|
2143
|
-
return (
|
|
2125
|
+
return _jsx7(PullConfirmationDialog, { statusResult: state.statusResult, selectedOption });
|
|
2144
2126
|
}
|
|
2145
2127
|
if (state.phase === "no-action" && state.statusResult) {
|
|
2146
2128
|
setTimeout(() => process.exit(0), 0);
|
|
2147
|
-
return (
|
|
2129
|
+
return _jsx7(PullStatusDisplay, { result: state.statusResult });
|
|
2148
2130
|
}
|
|
2149
|
-
return (
|
|
2131
|
+
return _jsx7(Text7, { children: "Unknown state" });
|
|
2150
2132
|
}
|
|
2151
2133
|
async function analyzePullAction(localConfig, remoteSchema, comparison, apiClient) {
|
|
2152
2134
|
const { projectId } = localConfig;
|
|
@@ -2271,7 +2253,7 @@ function PullConfirmationDialog({ statusResult, selectedOption }) {
|
|
|
2271
2253
|
return "blue";
|
|
2272
2254
|
}
|
|
2273
2255
|
};
|
|
2274
|
-
return (
|
|
2256
|
+
return _jsxs6(Box5, { flexDirection: "column", children: [_jsxs6(Box5, { flexDirection: "column", marginBottom: 1, children: [_jsxs6(Text7, { color: "cyan", children: ["Project ID: ", statusResult.projectId] }), _jsxs6(Box5, { children: [_jsxs6(Text7, { color: "gray", children: ["Local version: ", statusResult.localVersion] }), statusResult.remoteVersion > 0 && _jsxs6(Text7, { color: "gray", children: [" \u2022 Remote version: ", statusResult.remoteVersion] })] })] }), _jsx7(Box5, { marginBottom: 1, children: _jsxs6(Text7, { color: getStatusColor(), children: [getStatusIcon(), " ", getStatusText()] }) }), _jsx7(Box5, { flexDirection: "column", marginBottom: 2, children: statusResult.message.map((line, index) => _jsx7(Text7, { children: line }, index)) }), _jsxs6(Box5, { flexDirection: "column", children: [_jsx7(Box5, { children: _jsxs6(Text7, { color: selectedOption === "yes" ? "green" : "gray", children: [selectedOption === "yes" ? "\u276F" : " ", " Yes, pull changes"] }) }), _jsx7(Box5, { children: _jsxs6(Text7, { color: selectedOption === "no" ? "green" : "gray", children: [selectedOption === "no" ? "\u276F" : " ", " No, cancel"] }) })] }), _jsx7(Box5, { marginTop: 1, children: _jsx7(Text7, { color: "gray", children: "Use \u2191\u2193 to navigate, Enter to confirm, Esc to cancel" }) })] });
|
|
2275
2257
|
}
|
|
2276
2258
|
function PullStatusDisplay({ result }) {
|
|
2277
2259
|
const getStatusColor = () => {
|
|
@@ -2344,21 +2326,17 @@ function PullStatusDisplay({ result }) {
|
|
|
2344
2326
|
return [];
|
|
2345
2327
|
}
|
|
2346
2328
|
};
|
|
2347
|
-
return (
|
|
2329
|
+
return _jsxs6(Box5, { flexDirection: "column", children: [result.projectId && _jsxs6(Box5, { flexDirection: "column", marginBottom: 1, children: [_jsxs6(Text7, { color: "cyan", children: ["Project ID: ", result.projectId] }), _jsxs6(Box5, { children: [_jsxs6(Text7, { color: "gray", children: ["Local version: ", result.localVersion] }), result.remoteVersion > 0 && _jsxs6(Text7, { color: "gray", children: [" \u2022 Remote version: ", result.remoteVersion] })] })] }), _jsx7(Box5, { marginBottom: 1, children: _jsxs6(Text7, { color: getStatusColor(), children: [getStatusIcon(), " ", getStatusDescription()] }) }), _jsx7(Box5, { flexDirection: "column", marginBottom: 1, children: result.message.map((line, index) => _jsx7(Text7, { children: line }, index)) }), getNextSteps().length > 0 && _jsxs6(Box5, { flexDirection: "column", marginBottom: 1, children: [_jsx7(Text7, { color: "blue", children: "Next steps:" }), getNextSteps().map((step, index) => _jsxs6(Text7, { color: "gray", children: ["\u2022 ", step] }, index))] })] });
|
|
2348
2330
|
}
|
|
2349
2331
|
function PullSuccessDisplay({ result }) {
|
|
2350
|
-
return (
|
|
2332
|
+
return _jsxs6(Box5, { flexDirection: "column", children: [_jsx7(Box5, { marginBottom: 1, children: _jsx7(Text7, { color: "green", children: "\u2705 Schema updated successfully!" }) }), _jsxs6(Box5, { flexDirection: "column", marginBottom: 1, children: [_jsxs6(Text7, { children: ["Updated: ", result.filePath.split("/").pop()] }), _jsxs6(Text7, { children: ["Version: ", result.oldVersion, " \u2192 ", result.newVersion] }), _jsxs6(Text7, { children: ["Project: ", result.projectId] })] }), _jsxs6(Box5, { flexDirection: "column", marginTop: 1, children: [_jsx7(Text7, { color: "blue", children: "Next steps:" }), _jsx7(Text7, { color: "gray", children: "\u2022 Review the updated schema changes" }), _jsx7(Text7, { color: "gray", children: "\u2022 Continue working on your project" }), _jsx7(Text7, { color: "gray", children: "\u2022 Run 'basic status' to check your project state" })] })] });
|
|
2351
2333
|
}
|
|
2352
2334
|
async function PullCommand() {
|
|
2353
|
-
(
|
|
2335
|
+
render4(_jsx7(PullApp, {}));
|
|
2354
2336
|
}
|
|
2355
|
-
var import_jsx_runtime7, import_react7, import_ink7;
|
|
2356
2337
|
var init_pull = __esm({
|
|
2357
2338
|
"dist/commands/pull.js"() {
|
|
2358
2339
|
"use strict";
|
|
2359
|
-
import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2360
|
-
import_react7 = __toESM(require("react"), 1);
|
|
2361
|
-
import_ink7 = require("ink");
|
|
2362
2340
|
init_Spinner();
|
|
2363
2341
|
init_api();
|
|
2364
2342
|
init_auth();
|
|
@@ -2373,13 +2351,16 @@ var push_exports = {};
|
|
|
2373
2351
|
__export(push_exports, {
|
|
2374
2352
|
PushCommand: () => PushCommand
|
|
2375
2353
|
});
|
|
2354
|
+
import { jsx as _jsx8, jsxs as _jsxs7, Fragment as _Fragment2 } from "react/jsx-runtime";
|
|
2355
|
+
import React6 from "react";
|
|
2356
|
+
import { render as render5, Box as Box6, Text as Text8, useInput as useInput4 } from "ink";
|
|
2376
2357
|
function PushApp() {
|
|
2377
|
-
const [state, setState] =
|
|
2358
|
+
const [state, setState] = React6.useState({
|
|
2378
2359
|
phase: "checking",
|
|
2379
2360
|
error: null
|
|
2380
2361
|
});
|
|
2381
|
-
const [selectedOption, setSelectedOption] =
|
|
2382
|
-
|
|
2362
|
+
const [selectedOption, setSelectedOption] = React6.useState("yes");
|
|
2363
|
+
React6.useEffect(() => {
|
|
2383
2364
|
async function checkPushStatus() {
|
|
2384
2365
|
try {
|
|
2385
2366
|
if (!await isOnline()) {
|
|
@@ -2453,7 +2434,7 @@ function PushApp() {
|
|
|
2453
2434
|
}
|
|
2454
2435
|
checkPushStatus();
|
|
2455
2436
|
}, []);
|
|
2456
|
-
(
|
|
2437
|
+
useInput4((input, key) => {
|
|
2457
2438
|
if (state.phase === "confirming") {
|
|
2458
2439
|
if (key.upArrow || key.downArrow) {
|
|
2459
2440
|
setSelectedOption((prev) => prev === "yes" ? "no" : "yes");
|
|
@@ -2498,27 +2479,27 @@ function PushApp() {
|
|
|
2498
2479
|
}
|
|
2499
2480
|
};
|
|
2500
2481
|
if (state.phase === "checking") {
|
|
2501
|
-
return (
|
|
2482
|
+
return _jsx8(Spinner, { text: "Checking push status..." });
|
|
2502
2483
|
}
|
|
2503
2484
|
if (state.phase === "pushing") {
|
|
2504
|
-
return (
|
|
2485
|
+
return _jsx8(Spinner, { text: "Pushing schema to remote..." });
|
|
2505
2486
|
}
|
|
2506
2487
|
if (state.phase === "error") {
|
|
2507
2488
|
setTimeout(() => process.exit(1), 0);
|
|
2508
|
-
return (
|
|
2489
|
+
return _jsxs7(Box6, { flexDirection: "column", children: [_jsxs7(Text8, { color: "red", children: ["Error: ", state.error] }), _jsxs7(Box6, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [_jsx8(Text8, { color: "blue", children: "Next steps:" }), state.error?.includes("offline") || state.error?.includes("network") ? _jsxs7(_Fragment2, { children: [_jsx8(Text8, { color: "gray", children: "\u2022 Check your internet connection" }), _jsx8(Text8, { color: "gray", children: "\u2022 Try again in a moment" })] }) : state.error?.includes("logged") || state.error?.includes("auth") ? _jsxs7(_Fragment2, { children: [_jsx8(Text8, { color: "gray", children: "\u2022 Run 'basic login' to authenticate" }), _jsx8(Text8, { color: "gray", children: "\u2022 Ensure you have a valid account" })] }) : state.error?.includes("schema") || state.error?.includes("project") ? _jsxs7(_Fragment2, { children: [_jsx8(Text8, { color: "gray", children: "\u2022 Check if the project ID is correct" }), _jsx8(Text8, { color: "gray", children: "\u2022 Ensure you have access to this project" }), _jsx8(Text8, { color: "gray", children: "\u2022 Run 'basic status' for more details" })] }) : _jsxs7(_Fragment2, { children: [_jsx8(Text8, { color: "gray", children: "\u2022 Try running the command again" }), _jsx8(Text8, { color: "gray", children: "\u2022 Run 'basic status' to check your project state" }), _jsx8(Text8, { color: "gray", children: "\u2022 Check the Basic documentation if the issue persists" })] })] })] });
|
|
2509
2490
|
}
|
|
2510
2491
|
if (state.phase === "success" && state.pushResult) {
|
|
2511
2492
|
setTimeout(() => process.exit(0), 0);
|
|
2512
|
-
return (
|
|
2493
|
+
return _jsx8(PushSuccessDisplay, { result: state.pushResult });
|
|
2513
2494
|
}
|
|
2514
2495
|
if (state.phase === "confirming" && state.statusResult) {
|
|
2515
|
-
return (
|
|
2496
|
+
return _jsx8(PushConfirmationDialog, { statusResult: state.statusResult, selectedOption });
|
|
2516
2497
|
}
|
|
2517
2498
|
if (state.phase === "no-action" && state.statusResult) {
|
|
2518
2499
|
setTimeout(() => process.exit(0), 0);
|
|
2519
|
-
return (
|
|
2500
|
+
return _jsx8(PushStatusDisplay, { result: state.statusResult });
|
|
2520
2501
|
}
|
|
2521
|
-
return (
|
|
2502
|
+
return _jsx8(Text8, { children: "Unknown state" });
|
|
2522
2503
|
}
|
|
2523
2504
|
async function analyzePushAction(localConfig, remoteSchema, comparison, apiClient) {
|
|
2524
2505
|
const { projectId } = localConfig;
|
|
@@ -2677,7 +2658,7 @@ function PushConfirmationDialog({ statusResult, selectedOption }) {
|
|
|
2677
2658
|
return "blue";
|
|
2678
2659
|
}
|
|
2679
2660
|
};
|
|
2680
|
-
return (
|
|
2661
|
+
return _jsxs7(Box6, { flexDirection: "column", children: [_jsxs7(Box6, { flexDirection: "column", marginBottom: 1, children: [_jsxs7(Text8, { color: "cyan", children: ["Project ID: ", statusResult.projectId] }), _jsxs7(Box6, { children: [_jsxs7(Text8, { color: "gray", children: ["Local version: ", statusResult.localVersion] }), statusResult.remoteVersion > 0 && _jsxs7(Text8, { color: "gray", children: [" \u2022 Remote version: ", statusResult.remoteVersion] })] })] }), _jsx8(Box6, { marginBottom: 1, children: _jsxs7(Text8, { color: getStatusColor(), children: [getStatusIcon(), " ", getStatusText()] }) }), _jsx8(Box6, { flexDirection: "column", marginBottom: 2, children: statusResult.message.map((line, index) => _jsx8(Text8, { children: line }, index)) }), _jsxs7(Box6, { flexDirection: "column", children: [_jsx8(Box6, { children: _jsxs7(Text8, { color: selectedOption === "yes" ? "green" : "gray", children: [selectedOption === "yes" ? "\u276F" : " ", " Yes, push changes"] }) }), _jsx8(Box6, { children: _jsxs7(Text8, { color: selectedOption === "no" ? "green" : "gray", children: [selectedOption === "no" ? "\u276F" : " ", " No, cancel"] }) })] }), _jsx8(Box6, { marginTop: 1, children: _jsx8(Text8, { color: "gray", children: "Use \u2191\u2193 to navigate, Enter to confirm, Esc to cancel" }) })] });
|
|
2681
2662
|
}
|
|
2682
2663
|
function PushStatusDisplay({ result }) {
|
|
2683
2664
|
const getStatusColor = () => {
|
|
@@ -2750,21 +2731,17 @@ function PushStatusDisplay({ result }) {
|
|
|
2750
2731
|
return [];
|
|
2751
2732
|
}
|
|
2752
2733
|
};
|
|
2753
|
-
return (
|
|
2734
|
+
return _jsxs7(Box6, { flexDirection: "column", children: [result.projectId && _jsxs7(Box6, { flexDirection: "column", marginBottom: 1, children: [_jsxs7(Text8, { color: "cyan", children: ["Project ID: ", result.projectId] }), _jsxs7(Box6, { children: [_jsxs7(Text8, { color: "gray", children: ["Local version: ", result.localVersion] }), result.remoteVersion > 0 && _jsxs7(Text8, { color: "gray", children: [" \u2022 Remote version: ", result.remoteVersion] })] })] }), _jsx8(Box6, { marginBottom: 1, children: _jsxs7(Text8, { color: getStatusColor(), children: [getStatusIcon(), " ", getStatusDescription()] }) }), _jsx8(Box6, { flexDirection: "column", marginBottom: 1, children: result.message.map((line, index) => _jsx8(Text8, { children: line }, index)) }), result.validationErrors && result.validationErrors.length > 0 && _jsx8(Box6, { flexDirection: "column", marginBottom: 1, children: result.validationErrors.map((error, index) => _jsxs7(Text8, { color: "red", children: ["\u2022 ", error.message, " at ", error.instancePath || "root"] }, index)) }), getNextSteps().length > 0 && _jsxs7(Box6, { flexDirection: "column", marginBottom: 1, children: [_jsx8(Text8, { color: "blue", children: "Next steps:" }), getNextSteps().map((step, index) => _jsxs7(Text8, { color: "gray", children: ["\u2022 ", step] }, index))] })] });
|
|
2754
2735
|
}
|
|
2755
2736
|
function PushSuccessDisplay({ result }) {
|
|
2756
|
-
return (
|
|
2737
|
+
return _jsxs7(Box6, { flexDirection: "column", children: [_jsx8(Box6, { marginBottom: 1, children: _jsx8(Text8, { color: "green", children: "\u2705 Schema pushed successfully!" }) }), _jsxs7(Box6, { flexDirection: "column", marginBottom: 1, children: [_jsxs7(Text8, { children: ["Source: ", result.filePath.split("/").pop()] }), _jsxs7(Text8, { children: ["Version: ", result.oldVersion, " \u2192 ", result.newVersion] }), _jsxs7(Text8, { children: ["Project: ", result.projectId] })] }), _jsxs7(Box6, { flexDirection: "column", marginTop: 1, children: [_jsx8(Text8, { color: "blue", children: "Next steps:" }), _jsx8(Text8, { color: "gray", children: "\u2022 Your schema changes are now live" }), _jsx8(Text8, { color: "gray", children: "\u2022 Continue working on your project" }), _jsx8(Text8, { color: "gray", children: "\u2022 Run 'basic status' to check your project state" })] })] });
|
|
2757
2738
|
}
|
|
2758
2739
|
async function PushCommand() {
|
|
2759
|
-
(
|
|
2740
|
+
render5(_jsx8(PushApp, {}));
|
|
2760
2741
|
}
|
|
2761
|
-
var import_jsx_runtime8, import_react8, import_ink8;
|
|
2762
2742
|
var init_push = __esm({
|
|
2763
2743
|
"dist/commands/push.js"() {
|
|
2764
2744
|
"use strict";
|
|
2765
|
-
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2766
|
-
import_react8 = __toESM(require("react"), 1);
|
|
2767
|
-
import_ink8 = require("ink");
|
|
2768
2745
|
init_Spinner();
|
|
2769
2746
|
init_api();
|
|
2770
2747
|
init_auth();
|
|
@@ -2783,6 +2760,8 @@ __export(config_templates_exports, {
|
|
|
2783
2760
|
generateConfigContent: () => generateConfigContent2,
|
|
2784
2761
|
readExistingConfig: () => readExistingConfig
|
|
2785
2762
|
});
|
|
2763
|
+
import * as fs3 from "fs/promises";
|
|
2764
|
+
import * as path3 from "path";
|
|
2786
2765
|
function generateConfigContent2(template, projectId, projectName) {
|
|
2787
2766
|
const baseConfig = {
|
|
2788
2767
|
project_id: projectId,
|
|
@@ -2871,12 +2850,10 @@ async function readExistingConfig(targetDir = process.cwd()) {
|
|
|
2871
2850
|
throw new Error(`Failed to read existing config: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
2872
2851
|
}
|
|
2873
2852
|
}
|
|
2874
|
-
var
|
|
2853
|
+
var CONFIG_TEMPLATES;
|
|
2875
2854
|
var init_config_templates = __esm({
|
|
2876
2855
|
"dist/lib/config-templates.js"() {
|
|
2877
2856
|
"use strict";
|
|
2878
|
-
fs3 = __toESM(require("fs/promises"), 1);
|
|
2879
|
-
path3 = __toESM(require("path"), 1);
|
|
2880
2857
|
CONFIG_TEMPLATES = {
|
|
2881
2858
|
typescript: {
|
|
2882
2859
|
name: "TypeScript",
|
|
@@ -2901,8 +2878,11 @@ var init_config_templates = __esm({
|
|
|
2901
2878
|
});
|
|
2902
2879
|
|
|
2903
2880
|
// dist/components/InitForm.js
|
|
2881
|
+
import { jsx as _jsx9, jsxs as _jsxs8, Fragment as _Fragment3 } from "react/jsx-runtime";
|
|
2882
|
+
import { useState as useState3, useEffect as useEffect3 } from "react";
|
|
2883
|
+
import { Box as Box7, Text as Text9, useInput as useInput5 } from "ink";
|
|
2904
2884
|
function InitForm({ onSuccess, onCancel, initialData }) {
|
|
2905
|
-
const [state, setState] = (
|
|
2885
|
+
const [state, setState] = useState3({
|
|
2906
2886
|
step: initialData?.source ? initialData.source === "new" ? "project-details" : "existing-selection" : "source",
|
|
2907
2887
|
source: initialData?.source || null,
|
|
2908
2888
|
projectName: initialData?.projectName || "",
|
|
@@ -2915,9 +2895,9 @@ function InitForm({ onSuccess, onCancel, initialData }) {
|
|
|
2915
2895
|
isLoading: false,
|
|
2916
2896
|
error: null
|
|
2917
2897
|
});
|
|
2918
|
-
const [selectedOptionIndex, setSelectedOptionIndex] = (0
|
|
2919
|
-
const [showTeamForm, setShowTeamForm] = (
|
|
2920
|
-
(
|
|
2898
|
+
const [selectedOptionIndex, setSelectedOptionIndex] = useState3(0);
|
|
2899
|
+
const [showTeamForm, setShowTeamForm] = useState3(false);
|
|
2900
|
+
useEffect3(() => {
|
|
2921
2901
|
async function loadData() {
|
|
2922
2902
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
2923
2903
|
try {
|
|
@@ -2943,13 +2923,13 @@ function InitForm({ onSuccess, onCancel, initialData }) {
|
|
|
2943
2923
|
}
|
|
2944
2924
|
loadData();
|
|
2945
2925
|
}, []);
|
|
2946
|
-
(
|
|
2926
|
+
useEffect3(() => {
|
|
2947
2927
|
if (state.projectName.trim()) {
|
|
2948
2928
|
const newSlug = generateSlug(state.projectName);
|
|
2949
2929
|
setState((prev) => ({ ...prev, projectSlug: newSlug }));
|
|
2950
2930
|
}
|
|
2951
2931
|
}, [state.projectName]);
|
|
2952
|
-
(
|
|
2932
|
+
useInput5((input, key) => {
|
|
2953
2933
|
if (showTeamForm) {
|
|
2954
2934
|
return;
|
|
2955
2935
|
}
|
|
@@ -3178,38 +3158,38 @@ function InitForm({ onSuccess, onCancel, initialData }) {
|
|
|
3178
3158
|
}
|
|
3179
3159
|
};
|
|
3180
3160
|
if (showTeamForm) {
|
|
3181
|
-
return (
|
|
3161
|
+
return _jsx9(TeamForm, { title: "Create New Team", onSubmit: handleTeamCreated, onCancel: () => setShowTeamForm(false) });
|
|
3182
3162
|
}
|
|
3183
3163
|
if (state.isLoading) {
|
|
3184
|
-
return (
|
|
3164
|
+
return _jsx9(Spinner, { text: "Loading..." });
|
|
3185
3165
|
}
|
|
3186
3166
|
if (state.error) {
|
|
3187
|
-
return (
|
|
3167
|
+
return _jsxs8(Box7, { flexDirection: "column", children: [_jsxs8(Text9, { color: "red", children: ["Error: ", state.error] }), _jsx9(Text9, { color: "gray", children: "Press Esc to go back" })] });
|
|
3188
3168
|
}
|
|
3189
|
-
return (
|
|
3169
|
+
return _jsx9(Box7, { flexDirection: "column", padding: 1, children: renderCurrentStep() });
|
|
3190
3170
|
function renderCurrentStep() {
|
|
3191
3171
|
const stepNumber = getStepNumber();
|
|
3192
3172
|
const totalSteps = getTotalSteps();
|
|
3193
3173
|
switch (state.step) {
|
|
3194
3174
|
case "source":
|
|
3195
|
-
return (
|
|
3175
|
+
return _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { bold: true, color: "blue", children: ["Project Setup (", stepNumber, "/", totalSteps, ")"] }), _jsx9(Box7, { marginTop: 1, marginBottom: 2, children: _jsx9(Text9, { children: "How would you like to proceed?" }) }), renderOptions(), _jsx9(Box7, { marginTop: 2, children: _jsx9(Text9, { color: "gray", children: "\u2191/\u2193 select \u2022 enter to continue \u2022 esc to cancel" }) })] });
|
|
3196
3176
|
case "project-details":
|
|
3197
|
-
return (
|
|
3177
|
+
return _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { bold: true, color: "blue", children: ["Create New Project (", stepNumber, "/", totalSteps, ")"] }), _jsx9(Box7, { marginTop: 1, marginBottom: 1, children: _jsxs8(Text9, { color: "blue", children: [">", " Project Name:"] }) }), _jsx9(Box7, { marginLeft: 2, marginBottom: 1, children: _jsxs8(Text9, { children: [state.projectName, _jsx9(Text9, { backgroundColor: "white", color: "black", children: "\u2588" })] }) }), state.projectSlug && _jsxs8(Box7, { marginBottom: 1, children: [_jsx9(Box7, { children: _jsx9(Text9, { color: "gray", children: "\u2713 Project Slug (auto-generated):" }) }), _jsx9(Box7, { marginLeft: 2, children: _jsx9(Text9, { children: state.projectSlug }) })] }), _jsx9(Box7, { marginTop: 2, children: _jsx9(Text9, { color: "gray", children: state.projectName.trim() ? "Enter to continue \u2022 esc to go back" : "Type project name \u2022 esc to go back" }) })] });
|
|
3198
3178
|
case "team-selection":
|
|
3199
|
-
return (
|
|
3179
|
+
return _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { bold: true, color: "blue", children: ["Create New Project (", stepNumber, "/", totalSteps, ")"] }), _jsxs8(Box7, { marginTop: 1, children: [_jsxs8(Text9, { color: "gray", children: ["\u2713 Project Name: ", state.projectName] }), _jsxs8(Text9, { color: "gray", children: ["\u2713 Project Slug: ", state.projectSlug] })] }), _jsx9(Box7, { marginTop: 1, marginBottom: 2, children: _jsx9(Text9, { children: "Select Team:" }) }), renderOptions(), _jsx9(Box7, { marginTop: 2, children: _jsx9(Text9, { color: "gray", children: "\u2191/\u2193 select \u2022 enter to continue \u2022 esc to go back" }) })] });
|
|
3200
3180
|
case "existing-selection":
|
|
3201
|
-
return (
|
|
3181
|
+
return _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { bold: true, color: "blue", children: ["Import Existing Project (", stepNumber, "/", totalSteps, ")"] }), _jsx9(Box7, { marginTop: 1, marginBottom: 2, children: _jsx9(Text9, { children: "Select Project:" }) }), renderOptions(), _jsx9(Box7, { marginTop: 2, children: _jsx9(Text9, { color: "gray", children: "\u2191/\u2193 select \u2022 enter to continue \u2022 esc to go back" }) })] });
|
|
3202
3182
|
case "config-template":
|
|
3203
|
-
return (
|
|
3183
|
+
return _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { bold: true, color: "blue", children: ["Configuration Setup (", stepNumber, "/", totalSteps, ")"] }), _jsx9(Box7, { marginTop: 1, marginBottom: 2, children: _jsx9(Text9, { children: "Choose config template:" }) }), renderOptions(), _jsx9(Box7, { marginTop: 2, children: _jsx9(Text9, { color: "gray", children: "\u2191/\u2193 select \u2022 enter to continue \u2022 esc to go back" }) })] });
|
|
3204
3184
|
case "confirmation":
|
|
3205
|
-
return (
|
|
3185
|
+
return _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { bold: true, color: "blue", children: ["Ready to ", state.source === "new" ? "Create" : "Import", " (", stepNumber, "/", totalSteps, ")"] }), _jsxs8(Box7, { marginTop: 1, marginBottom: 2, flexDirection: "column", children: [state.source === "new" ? _jsxs8(_Fragment3, { children: [_jsxs8(Text9, { children: ["\u2713 Project: ", state.projectName] }), _jsxs8(Text9, { children: ["\u2713 Team: ", getSelectedTeamName()] })] }) : _jsxs8(Text9, { children: ["\u2713 Project: ", getSelectedProjectName()] }), _jsxs8(Text9, { children: ["\u2713 Config: ", getSelectedTemplateName()] }), state.configTemplate !== "none" && _jsxs8(Text9, { children: ["\u2713 Location: ./", CONFIG_TEMPLATES[state.configTemplate].filename] })] }), renderOptions(), _jsx9(Box7, { marginTop: 2, children: _jsx9(Text9, { color: "gray", children: "\u2191/\u2193 select \u2022 enter to confirm \u2022 esc to go back" }) })] });
|
|
3206
3186
|
default:
|
|
3207
|
-
return (
|
|
3187
|
+
return _jsx9(Text9, { children: "Unknown step" });
|
|
3208
3188
|
}
|
|
3209
3189
|
}
|
|
3210
3190
|
function renderOptions() {
|
|
3211
3191
|
const options = getOptionsForCurrentStep();
|
|
3212
|
-
return (
|
|
3192
|
+
return _jsx9(Box7, { flexDirection: "column", children: options.map((option, index) => _jsx9(Box7, { marginLeft: 2, children: _jsxs8(Text9, { color: index === selectedOptionIndex ? "blue" : "white", children: [index === selectedOptionIndex ? "\u25CF" : "\u25CB", " ", option.label] }) }, option.value)) });
|
|
3213
3193
|
}
|
|
3214
3194
|
function getStepNumber() {
|
|
3215
3195
|
const stepOrder = ["source", "project-details", "team-selection", "existing-selection", "config-template", "confirmation"];
|
|
@@ -3230,13 +3210,9 @@ function InitForm({ onSuccess, onCancel, initialData }) {
|
|
|
3230
3210
|
return state.configTemplate ? CONFIG_TEMPLATES[state.configTemplate].name : "None";
|
|
3231
3211
|
}
|
|
3232
3212
|
}
|
|
3233
|
-
var import_jsx_runtime9, import_react9, import_ink9;
|
|
3234
3213
|
var init_InitForm = __esm({
|
|
3235
3214
|
"dist/components/InitForm.js"() {
|
|
3236
3215
|
"use strict";
|
|
3237
|
-
import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3238
|
-
import_react9 = require("react");
|
|
3239
|
-
import_ink9 = require("ink");
|
|
3240
3216
|
init_api();
|
|
3241
3217
|
init_platform();
|
|
3242
3218
|
init_config_templates();
|
|
@@ -3250,14 +3226,17 @@ var init_exports = {};
|
|
|
3250
3226
|
__export(init_exports, {
|
|
3251
3227
|
InitCommand: () => InitCommand
|
|
3252
3228
|
});
|
|
3229
|
+
import { jsx as _jsx10, jsxs as _jsxs9 } from "react/jsx-runtime";
|
|
3230
|
+
import React7 from "react";
|
|
3231
|
+
import { render as render6, Box as Box8, Text as Text10 } from "ink";
|
|
3253
3232
|
function InitApp({ options }) {
|
|
3254
|
-
const [state, setState] =
|
|
3233
|
+
const [state, setState] = React7.useState({
|
|
3255
3234
|
loading: true,
|
|
3256
3235
|
error: null,
|
|
3257
3236
|
success: false
|
|
3258
3237
|
});
|
|
3259
|
-
const [initialData, setInitialData] =
|
|
3260
|
-
|
|
3238
|
+
const [initialData, setInitialData] = React7.useState(null);
|
|
3239
|
+
React7.useEffect(() => {
|
|
3261
3240
|
async function initialize() {
|
|
3262
3241
|
try {
|
|
3263
3242
|
if (!await isOnline()) {
|
|
@@ -3308,15 +3287,15 @@ To reinitialize, please remove the existing config file first.`,
|
|
|
3308
3287
|
process.exit(0);
|
|
3309
3288
|
};
|
|
3310
3289
|
if (state.loading) {
|
|
3311
|
-
return (
|
|
3290
|
+
return _jsx10(Spinner, { text: "Initializing..." });
|
|
3312
3291
|
}
|
|
3313
3292
|
if (state.error) {
|
|
3314
|
-
return (
|
|
3293
|
+
return _jsxs9(Box8, { flexDirection: "column", children: [_jsxs9(Text10, { color: "red", children: ["Error: ", state.error] }), _jsx10(Text10, { color: "gray", children: "Please resolve the issue and try again." })] });
|
|
3315
3294
|
}
|
|
3316
3295
|
if (state.success && state.result) {
|
|
3317
|
-
return (
|
|
3296
|
+
return _jsxs9(Box8, { flexDirection: "column", children: [_jsx10(Text10, { color: "green", children: "\u2705 Project setup complete!" }), _jsx10(Text10, {}), _jsxs9(Text10, { children: ["Project: ", state.result.projectName] }), _jsxs9(Text10, { children: ["Project ID: ", state.result.projectId] }), state.result.configPath && _jsxs9(Text10, { children: ["Config file: ", state.result.configPath] }), _jsx10(Text10, {}), _jsx10(Text10, { color: "gray", children: "Visit https://docs.basic.tech for next steps." })] });
|
|
3318
3297
|
}
|
|
3319
|
-
return (
|
|
3298
|
+
return _jsx10(InitForm, { onSuccess: handleSuccess, onCancel: handleCancel, initialData: initialData || void 0 });
|
|
3320
3299
|
}
|
|
3321
3300
|
function parseCliOptions(options) {
|
|
3322
3301
|
const result = {};
|
|
@@ -3340,15 +3319,11 @@ function parseCliOptions(options) {
|
|
|
3340
3319
|
return result;
|
|
3341
3320
|
}
|
|
3342
3321
|
async function InitCommand(args = {}) {
|
|
3343
|
-
(
|
|
3322
|
+
render6(_jsx10(InitApp, { options: args }));
|
|
3344
3323
|
}
|
|
3345
|
-
var import_jsx_runtime10, import_react10, import_ink10;
|
|
3346
3324
|
var init_init = __esm({
|
|
3347
3325
|
"dist/commands/init.js"() {
|
|
3348
3326
|
"use strict";
|
|
3349
|
-
import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3350
|
-
import_react10 = __toESM(require("react"), 1);
|
|
3351
|
-
import_ink10 = require("ink");
|
|
3352
3327
|
init_InitForm();
|
|
3353
3328
|
init_Spinner();
|
|
3354
3329
|
init_auth();
|
|
@@ -3359,11 +3334,11 @@ var init_init = __esm({
|
|
|
3359
3334
|
});
|
|
3360
3335
|
|
|
3361
3336
|
// dist/index.js
|
|
3362
|
-
var import_commander = require("commander");
|
|
3363
3337
|
init_constants();
|
|
3364
3338
|
init_version();
|
|
3365
3339
|
init_errors();
|
|
3366
3340
|
init_platform();
|
|
3341
|
+
import { program } from "commander";
|
|
3367
3342
|
process.on("uncaughtException", (error) => {
|
|
3368
3343
|
console.error("Fatal error:", error.message);
|
|
3369
3344
|
process.exit(1);
|
|
@@ -3372,8 +3347,8 @@ process.on("SIGINT", () => {
|
|
|
3372
3347
|
console.log("\nOperation cancelled");
|
|
3373
3348
|
process.exit(0);
|
|
3374
3349
|
});
|
|
3375
|
-
|
|
3376
|
-
|
|
3350
|
+
program.name("basic").description("Basic CLI for creating & managing your projects").version(getVersion());
|
|
3351
|
+
program.command("login").description("Login to your Basic account").action(async () => {
|
|
3377
3352
|
try {
|
|
3378
3353
|
const { LoginCommand: LoginCommand2 } = await Promise.resolve().then(() => (init_login(), login_exports));
|
|
3379
3354
|
await LoginCommand2();
|
|
@@ -3384,7 +3359,7 @@ import_commander.program.command("login").description("Login to your Basic accou
|
|
|
3384
3359
|
process.exit(1);
|
|
3385
3360
|
}
|
|
3386
3361
|
});
|
|
3387
|
-
|
|
3362
|
+
program.command("logout").description("Logout from your Basic account").action(async () => {
|
|
3388
3363
|
try {
|
|
3389
3364
|
const { LogoutCommand: LogoutCommand2 } = await Promise.resolve().then(() => (init_logout(), logout_exports));
|
|
3390
3365
|
await LogoutCommand2();
|
|
@@ -3395,7 +3370,7 @@ import_commander.program.command("logout").description("Logout from your Basic a
|
|
|
3395
3370
|
process.exit(1);
|
|
3396
3371
|
}
|
|
3397
3372
|
});
|
|
3398
|
-
|
|
3373
|
+
program.command("account").description("Show account information").action(async () => {
|
|
3399
3374
|
try {
|
|
3400
3375
|
const { AccountCommand: AccountCommand2 } = await Promise.resolve().then(() => (init_account(), account_exports));
|
|
3401
3376
|
await AccountCommand2();
|
|
@@ -3406,7 +3381,7 @@ import_commander.program.command("account").description("Show account informatio
|
|
|
3406
3381
|
process.exit(1);
|
|
3407
3382
|
}
|
|
3408
3383
|
});
|
|
3409
|
-
|
|
3384
|
+
program.command("version").description("Show CLI version").action(async () => {
|
|
3410
3385
|
try {
|
|
3411
3386
|
const { VersionCommand: VersionCommand2 } = await Promise.resolve().then(() => (init_version2(), version_exports));
|
|
3412
3387
|
await VersionCommand2();
|
|
@@ -3417,7 +3392,7 @@ import_commander.program.command("version").description("Show CLI version").acti
|
|
|
3417
3392
|
process.exit(1);
|
|
3418
3393
|
}
|
|
3419
3394
|
});
|
|
3420
|
-
|
|
3395
|
+
program.command("update").description("Update CLI to the latest version").action(async () => {
|
|
3421
3396
|
try {
|
|
3422
3397
|
const { UpdateCommand: UpdateCommand2 } = await Promise.resolve().then(() => (init_update(), update_exports));
|
|
3423
3398
|
await UpdateCommand2();
|
|
@@ -3428,10 +3403,10 @@ import_commander.program.command("update").description("Update CLI to the latest
|
|
|
3428
3403
|
process.exit(1);
|
|
3429
3404
|
}
|
|
3430
3405
|
});
|
|
3431
|
-
|
|
3432
|
-
|
|
3406
|
+
program.command("help").description("Show help information").action(() => {
|
|
3407
|
+
program.help();
|
|
3433
3408
|
});
|
|
3434
|
-
|
|
3409
|
+
program.command("debug").description("Show Basic config directory location").action(async () => {
|
|
3435
3410
|
try {
|
|
3436
3411
|
const { DebugCommand: DebugCommand2 } = await Promise.resolve().then(() => (init_debug(), debug_exports));
|
|
3437
3412
|
await DebugCommand2();
|
|
@@ -3442,7 +3417,7 @@ import_commander.program.command("debug").description("Show Basic config directo
|
|
|
3442
3417
|
process.exit(1);
|
|
3443
3418
|
}
|
|
3444
3419
|
});
|
|
3445
|
-
|
|
3420
|
+
program.command("projects").description("List and browse your projects").action(async () => {
|
|
3446
3421
|
try {
|
|
3447
3422
|
const { ProjectsCommand: ProjectsCommand2 } = await Promise.resolve().then(() => (init_projects(), projects_exports));
|
|
3448
3423
|
await ProjectsCommand2();
|
|
@@ -3452,7 +3427,7 @@ import_commander.program.command("projects").description("List and browse your p
|
|
|
3452
3427
|
process.exit(1);
|
|
3453
3428
|
}
|
|
3454
3429
|
});
|
|
3455
|
-
|
|
3430
|
+
program.command("teams").argument("[action]", "Teams action (new)", "list").description("List teams or create a new team").action(async (action) => {
|
|
3456
3431
|
try {
|
|
3457
3432
|
const { TeamsCommand: TeamsCommand2 } = await Promise.resolve().then(() => (init_teams(), teams_exports));
|
|
3458
3433
|
await TeamsCommand2(action);
|
|
@@ -3462,7 +3437,7 @@ import_commander.program.command("teams").argument("[action]", "Teams action (ne
|
|
|
3462
3437
|
process.exit(1);
|
|
3463
3438
|
}
|
|
3464
3439
|
});
|
|
3465
|
-
|
|
3440
|
+
program.command("status").description("Show project status").action(async () => {
|
|
3466
3441
|
try {
|
|
3467
3442
|
const { StatusCommand: StatusCommand2 } = await Promise.resolve().then(() => (init_status(), status_exports));
|
|
3468
3443
|
await StatusCommand2();
|
|
@@ -3472,7 +3447,7 @@ import_commander.program.command("status").description("Show project status").ac
|
|
|
3472
3447
|
process.exit(1);
|
|
3473
3448
|
}
|
|
3474
3449
|
});
|
|
3475
|
-
|
|
3450
|
+
program.command("pull").description("Pull schema from remote").action(async () => {
|
|
3476
3451
|
try {
|
|
3477
3452
|
const { PullCommand: PullCommand2 } = await Promise.resolve().then(() => (init_pull(), pull_exports));
|
|
3478
3453
|
await PullCommand2();
|
|
@@ -3482,7 +3457,7 @@ import_commander.program.command("pull").description("Pull schema from remote").
|
|
|
3482
3457
|
process.exit(1);
|
|
3483
3458
|
}
|
|
3484
3459
|
});
|
|
3485
|
-
|
|
3460
|
+
program.command("push").description("Push schema to remote").action(async () => {
|
|
3486
3461
|
try {
|
|
3487
3462
|
const { PushCommand: PushCommand2 } = await Promise.resolve().then(() => (init_push(), push_exports));
|
|
3488
3463
|
await PushCommand2();
|
|
@@ -3492,7 +3467,7 @@ import_commander.program.command("push").description("Push schema to remote").ac
|
|
|
3492
3467
|
process.exit(1);
|
|
3493
3468
|
}
|
|
3494
3469
|
});
|
|
3495
|
-
|
|
3470
|
+
program.command("init").description("Create a new project or import an existing project").option("--new", "Create a new project (skip project type selection)").option("--existing", "Import an existing project").option("--name <name>", "Project name for new projects").option("--project <id>", "Project ID for existing projects").option("--ts", "Use TypeScript configuration template").option("--js", "Use JavaScript configuration template").action(async (options) => {
|
|
3496
3471
|
try {
|
|
3497
3472
|
const { InitCommand: InitCommand2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
3498
3473
|
await InitCommand2(options);
|
|
@@ -3502,7 +3477,7 @@ import_commander.program.command("init").description("Create a new project or im
|
|
|
3502
3477
|
process.exit(1);
|
|
3503
3478
|
}
|
|
3504
3479
|
});
|
|
3505
|
-
|
|
3480
|
+
program.on("command:*", (operands) => {
|
|
3506
3481
|
const unknownCommand = operands[0];
|
|
3507
3482
|
const suggestions = findSimilarCommands(unknownCommand);
|
|
3508
3483
|
console.error(`Unknown command: ${unknownCommand}
|
|
@@ -3521,4 +3496,4 @@ if (process.argv.length <= 2) {
|
|
|
3521
3496
|
console.log(MESSAGES.WELCOME);
|
|
3522
3497
|
process.exit(0);
|
|
3523
3498
|
}
|
|
3524
|
-
|
|
3499
|
+
program.parse();
|
package/dist/lib/schema.d.ts
CHANGED
package/dist/lib/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MA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AmBA;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQpE"}
|
package/dist/lib/schema.js
CHANGED
|
@@ -217,4 +217,13 @@ export function compareVersions(local, remote) {
|
|
|
217
217
|
remoteVersion
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
+
export async function parseSchemaFile(filePath) {
|
|
221
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
222
|
+
const ast = parse(content, {
|
|
223
|
+
sourceType: 'module',
|
|
224
|
+
plugins: ['typescript'],
|
|
225
|
+
});
|
|
226
|
+
// Extract schema from AST
|
|
227
|
+
// ... existing code ...
|
|
228
|
+
}
|
|
220
229
|
//# sourceMappingURL=schema.js.map
|
package/dist/lib/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAStC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,YAAoB,OAAO,CAAC,GAAG,EAAE;IAC1E,MAAM,aAAa,GAAG;QACpB,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB;KACpB,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEhD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC1B,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAEpD,IAAI,MAAc,CAAC;YAEnB,IAAI,QAAQ,CAAC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,CAAC;IACnB,CAAC;SAAM,IAAI,YAAY,GAAG,aAAa,EAAE,CAAC;QACxC,MAAM,GAAG,OAAO,CAAC;IACnB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,QAAQ,CAAC;IACpB,CAAC;IAED,OAAO;QACL,MAAM;QACN,YAAY;QACZ,aAAa;KACd,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpD,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE;QACzB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC,CAAC;IACH,0BAA0B;IAC1B,wBAAwB;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basictech/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Basic CLI for creating & managing your projects",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc && node -e \"const fs = require('fs'); const path = require('path'); function fixImports(dir) { const files = fs.readdirSync(dir); files.forEach(file => { const filePath = path.join(dir, file); const stat = fs.statSync(filePath); if (stat.isDirectory()) { fixImports(filePath); } else if (file.endsWith('.js')) { let content = fs.readFileSync(filePath, 'utf8'); content = content.replace(/from\\s+['\\\"]\\.\\.?\\/([^'\\\"]*)['\\\"];/g, (match, p1) => { if (p1.includes('.')) return match; return match.replace(p1, p1 + '.js'); }); fs.writeFileSync(filePath, content); } }); } fixImports('dist');\" && npm run bundle",
|
|
12
|
-
"bundle": "esbuild dist/index.js --bundle --platform=node --outfile=dist/index.js --packages=external --format=
|
|
12
|
+
"bundle": "esbuild dist/index.js --bundle --platform=node --outfile=dist/index.js --packages=external --format=esm --allow-overwrite",
|
|
13
13
|
"dev": "tsx src/index.ts",
|
|
14
14
|
"dev:watch": "tsx watch src/index.ts",
|
|
15
15
|
"test": "vitest run --exclude='tests/components/**'",
|