adhdev 0.1.16 → 0.1.18
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 +23 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -177,8 +177,8 @@ async function detectIDEs() {
|
|
|
177
177
|
if ((0, import_fs.existsSync)(bundledCli)) resolvedCli = bundledCli;
|
|
178
178
|
}
|
|
179
179
|
if (!resolvedCli && appPath && os2 === "win32") {
|
|
180
|
-
const { dirname } = await import("path");
|
|
181
|
-
const appDir =
|
|
180
|
+
const { dirname: dirname2 } = await import("path");
|
|
181
|
+
const appDir = dirname2(appPath);
|
|
182
182
|
const candidates = [
|
|
183
183
|
`${appDir}\\bin\\${def.cli}.cmd`,
|
|
184
184
|
`${appDir}\\bin\\${def.cli}`,
|
|
@@ -519,7 +519,6 @@ async function runWizard(options = {}) {
|
|
|
519
519
|
message: "What would you like to do?",
|
|
520
520
|
choices: [
|
|
521
521
|
{ name: "\u{1F504} Reconfigure (run setup again)", value: "reconfigure" },
|
|
522
|
-
{ name: "\u2795 Add more extensions", value: "add-extensions" },
|
|
523
522
|
{ name: "\u{1F527} Install/Update CLI (adhdev command)", value: "install-cli" },
|
|
524
523
|
{ name: "\u{1F510} Re-login", value: "relogin" },
|
|
525
524
|
{ name: "\u274C Exit", value: "exit" }
|
|
@@ -527,10 +526,6 @@ async function runWizard(options = {}) {
|
|
|
527
526
|
}
|
|
528
527
|
]);
|
|
529
528
|
if (action === "exit") return;
|
|
530
|
-
if (action === "add-extensions") {
|
|
531
|
-
await addExtensionsFlow();
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
529
|
if (action === "relogin") {
|
|
535
530
|
await loginFlow();
|
|
536
531
|
return;
|
|
@@ -873,42 +868,6 @@ async function injectTokenToIDE(ide, connectionToken) {
|
|
|
873
868
|
console.log(import_chalk.default.gray(` You can set it manually: adhdev.connectionToken = ${connectionToken}`));
|
|
874
869
|
}
|
|
875
870
|
}
|
|
876
|
-
async function addExtensionsFlow() {
|
|
877
|
-
const config = loadConfig();
|
|
878
|
-
const ides = await detectIDEs();
|
|
879
|
-
const selectedIDE = ides.find((i) => i.id === config.selectedIde);
|
|
880
|
-
if (!selectedIDE || !selectedIDE.installed) {
|
|
881
|
-
console.log(import_chalk.default.yellow("\u26A0 Previously selected IDE not found."));
|
|
882
|
-
return;
|
|
883
|
-
}
|
|
884
|
-
const aiExtensions = getAIExtensions();
|
|
885
|
-
const notInstalled = aiExtensions.filter((e) => !config.installedExtensions.includes(e.id));
|
|
886
|
-
if (notInstalled.length === 0) {
|
|
887
|
-
console.log(import_chalk.default.green("\u2713 All extensions already installed!"));
|
|
888
|
-
return;
|
|
889
|
-
}
|
|
890
|
-
const { selectedExtIds } = await import_inquirer.default.prompt([
|
|
891
|
-
{
|
|
892
|
-
type: "checkbox",
|
|
893
|
-
name: "selectedExtIds",
|
|
894
|
-
message: "Select extensions to install:",
|
|
895
|
-
choices: notInstalled.map((ext) => ({
|
|
896
|
-
name: `${ext.icon} ${ext.displayName}`,
|
|
897
|
-
value: ext.id
|
|
898
|
-
}))
|
|
899
|
-
}
|
|
900
|
-
]);
|
|
901
|
-
if (selectedExtIds.length === 0) return;
|
|
902
|
-
const extensions = notInstalled.filter((e) => selectedExtIds.includes(e.id));
|
|
903
|
-
await installExtensions(selectedIDE, extensions, (current, total, ext, result) => {
|
|
904
|
-
const status = result.success ? import_chalk.default.green("installed \u2713") : import_chalk.default.red("failed \u2717");
|
|
905
|
-
console.log(` [${current}/${total}] ${ext.icon} ${ext.displayName} \u2014 ${status}`);
|
|
906
|
-
});
|
|
907
|
-
updateConfig({
|
|
908
|
-
installedExtensions: [...config.installedExtensions, ...selectedExtIds]
|
|
909
|
-
});
|
|
910
|
-
console.log(import_chalk.default.green("\n\u2713 Extensions added!"));
|
|
911
|
-
}
|
|
912
871
|
async function installCliOnly() {
|
|
913
872
|
const { execSync: execSyncLocal } = await import("child_process");
|
|
914
873
|
let currentVersion = null;
|
|
@@ -1342,12 +1301,28 @@ async function launchLinux(ide, port, workspace, newWindow) {
|
|
|
1342
1301
|
}
|
|
1343
1302
|
|
|
1344
1303
|
// src/index.ts
|
|
1345
|
-
var
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
1348
|
-
|
|
1304
|
+
var import_fs3 = require("fs");
|
|
1305
|
+
var import_path2 = require("path");
|
|
1306
|
+
var pkgVersion = "unknown";
|
|
1307
|
+
try {
|
|
1308
|
+
const possiblePaths = [
|
|
1309
|
+
(0, import_path2.join)(__dirname, "..", "package.json"),
|
|
1310
|
+
(0, import_path2.join)(__dirname, "package.json")
|
|
1311
|
+
];
|
|
1312
|
+
for (const p of possiblePaths) {
|
|
1313
|
+
try {
|
|
1314
|
+
const data = JSON.parse((0, import_fs3.readFileSync)(p, "utf-8"));
|
|
1315
|
+
if (data.version) {
|
|
1316
|
+
pkgVersion = data.version;
|
|
1317
|
+
break;
|
|
1318
|
+
}
|
|
1319
|
+
} catch {
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
} catch {
|
|
1323
|
+
}
|
|
1349
1324
|
var program = new import_commander.Command();
|
|
1350
|
-
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version(
|
|
1325
|
+
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version(pkgVersion);
|
|
1351
1326
|
program.command("setup").description("Run the interactive setup wizard").option("-f, --force", "Force re-run setup even if already configured").action(async (options) => {
|
|
1352
1327
|
await runWizard({ force: options.force });
|
|
1353
1328
|
});
|