@arvoretech/hub 0.10.0 → 0.12.0
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/config/index.d.ts +1 -0
- package/dist/config/index.js +7 -0
- package/dist/index.js +65 -5
- package/package.json +1 -1
package/dist/config/index.d.ts
CHANGED
|
@@ -169,6 +169,7 @@ declare const repo: {
|
|
|
169
169
|
nestjs: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
|
170
170
|
nextjs: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
|
171
171
|
react: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
|
172
|
+
reactNative: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
|
172
173
|
elixir: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
|
173
174
|
go: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
|
174
175
|
python: (name: string, url: string, overrides?: RepoOverrides) => Repo;
|
package/dist/config/index.js
CHANGED
|
@@ -40,6 +40,13 @@ var repo = {
|
|
|
40
40
|
test: "pnpm test",
|
|
41
41
|
lint: "pnpm lint"
|
|
42
42
|
}),
|
|
43
|
+
reactNative: createRepo("react-native", {
|
|
44
|
+
install: "pnpm install",
|
|
45
|
+
dev: "pnpm start",
|
|
46
|
+
build: "pnpm build",
|
|
47
|
+
test: "pnpm test",
|
|
48
|
+
lint: "pnpm lint"
|
|
49
|
+
}),
|
|
43
50
|
elixir: createRepo("elixir", {
|
|
44
51
|
install: "mix deps.get",
|
|
45
52
|
dev: "mix phx.server",
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-VMN4KGAK.js";
|
|
10
10
|
|
|
11
11
|
// src/index.ts
|
|
12
|
-
import { Command as
|
|
12
|
+
import { Command as Command20 } from "commander";
|
|
13
13
|
|
|
14
14
|
// src/commands/init.ts
|
|
15
15
|
import { Command as Command2 } from "commander";
|
|
@@ -432,7 +432,7 @@ function inferTech(name) {
|
|
|
432
432
|
const lower = name.toLowerCase();
|
|
433
433
|
if (lower.includes("api") || lower.includes("backend")) return "nestjs";
|
|
434
434
|
if (lower.includes("frontend") || lower.includes("web") || lower.includes("next")) return "nextjs";
|
|
435
|
-
if (lower.includes("mobile") || lower.includes("app")) return "react";
|
|
435
|
+
if (lower.includes("mobile") || lower.includes("app")) return "react-native";
|
|
436
436
|
return void 0;
|
|
437
437
|
}
|
|
438
438
|
function ReposStep({ repos: initialRepos, onSubmit }) {
|
|
@@ -1254,6 +1254,7 @@ var REPO_HELPER_MAP = {
|
|
|
1254
1254
|
nestjs: "repo.nestjs",
|
|
1255
1255
|
nextjs: "repo.nextjs",
|
|
1256
1256
|
react: "repo.react",
|
|
1257
|
+
"react-native": "repo.reactNative",
|
|
1257
1258
|
elixir: "repo.elixir",
|
|
1258
1259
|
go: "repo.go",
|
|
1259
1260
|
python: "repo.python"
|
|
@@ -3997,6 +3998,7 @@ function detectTech(repoDir) {
|
|
|
3997
3998
|
if (existsSync14(join18(repoDir, "go.mod"))) return "go";
|
|
3998
3999
|
if (existsSync14(join18(repoDir, "Gemfile"))) return "rails";
|
|
3999
4000
|
if (existsSync14(join18(repoDir, "manage.py"))) return "django";
|
|
4001
|
+
if (existsSync14(join18(repoDir, "app.json")) || existsSync14(join18(repoDir, "app.config.js")) || existsSync14(join18(repoDir, "app.config.ts"))) return "react-native";
|
|
4000
4002
|
if (existsSync14(join18(repoDir, "package.json"))) return "react";
|
|
4001
4003
|
return void 0;
|
|
4002
4004
|
}
|
|
@@ -4337,14 +4339,71 @@ Run ${chalk17.bold("hub generate")} to update editor configs.
|
|
|
4337
4339
|
}
|
|
4338
4340
|
});
|
|
4339
4341
|
|
|
4342
|
+
// src/commands/clone.ts
|
|
4343
|
+
import { Command as Command19 } from "commander";
|
|
4344
|
+
import { existsSync as existsSync15 } from "fs";
|
|
4345
|
+
import { join as join19 } from "path";
|
|
4346
|
+
import { execSync as execSync14 } from "child_process";
|
|
4347
|
+
import chalk18 from "chalk";
|
|
4348
|
+
function run2(cmd, cwd) {
|
|
4349
|
+
execSync14(cmd, { stdio: "inherit", cwd });
|
|
4350
|
+
}
|
|
4351
|
+
function runSilent2(cmd, cwd) {
|
|
4352
|
+
return execSync14(cmd, { encoding: "utf-8", cwd, stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
4353
|
+
}
|
|
4354
|
+
function canSsh2() {
|
|
4355
|
+
try {
|
|
4356
|
+
const out = runSilent2("ssh -T git@github.com 2>&1 || true");
|
|
4357
|
+
return out.includes("successfully authenticated");
|
|
4358
|
+
} catch {
|
|
4359
|
+
return false;
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
function hasGh2() {
|
|
4363
|
+
try {
|
|
4364
|
+
runSilent2("gh auth status");
|
|
4365
|
+
return true;
|
|
4366
|
+
} catch {
|
|
4367
|
+
return false;
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
var cloneCommand = new Command19("clone").description("Clone all repositories without running full setup").option("--ssh", "Force SSH clone (default if SSH is available)").option("--https", "Force HTTPS clone via gh CLI").action(async (opts) => {
|
|
4371
|
+
const hubDir = process.cwd();
|
|
4372
|
+
const config = await loadHubConfig(hubDir);
|
|
4373
|
+
const useGh = opts.https || !opts.ssh && !canSsh2() && hasGh2();
|
|
4374
|
+
console.log(chalk18.blue("\n\u2501\u2501\u2501 Cloning repositories \u2501\u2501\u2501\n"));
|
|
4375
|
+
let cloned = 0;
|
|
4376
|
+
let skipped = 0;
|
|
4377
|
+
for (const repo of config.repos) {
|
|
4378
|
+
const fullPath = join19(hubDir, repo.path);
|
|
4379
|
+
console.log(chalk18.yellow(`\u25B8 ${repo.name}`));
|
|
4380
|
+
if (existsSync15(fullPath)) {
|
|
4381
|
+
console.log(chalk18.green(" Already exists, skipping"));
|
|
4382
|
+
skipped++;
|
|
4383
|
+
continue;
|
|
4384
|
+
}
|
|
4385
|
+
if (useGh) {
|
|
4386
|
+
const slug = repo.url.replace("git@github.com:", "").replace(".git", "");
|
|
4387
|
+
run2(`gh repo clone ${slug} ${fullPath}`);
|
|
4388
|
+
} else {
|
|
4389
|
+
run2(`git clone ${repo.url} ${fullPath}`);
|
|
4390
|
+
}
|
|
4391
|
+
console.log(chalk18.green(" Cloned"));
|
|
4392
|
+
cloned++;
|
|
4393
|
+
}
|
|
4394
|
+
console.log(chalk18.blue("\n\u2501\u2501\u2501 Done \u2501\u2501\u2501\n"));
|
|
4395
|
+
console.log(` ${chalk18.green(`${cloned} cloned`)}, ${chalk18.dim(`${skipped} already existed`)}`);
|
|
4396
|
+
console.log();
|
|
4397
|
+
});
|
|
4398
|
+
|
|
4340
4399
|
// src/index.ts
|
|
4341
4400
|
import { readFileSync as readFileSync2 } from "fs";
|
|
4342
4401
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
4343
|
-
import { dirname as dirname2, join as
|
|
4402
|
+
import { dirname as dirname2, join as join20 } from "path";
|
|
4344
4403
|
var __filename = fileURLToPath2(import.meta.url);
|
|
4345
4404
|
var __dirname = dirname2(__filename);
|
|
4346
|
-
var pkg = JSON.parse(readFileSync2(
|
|
4347
|
-
var program = new
|
|
4405
|
+
var pkg = JSON.parse(readFileSync2(join20(__dirname, "..", "package.json"), "utf-8"));
|
|
4406
|
+
var program = new Command20();
|
|
4348
4407
|
program.name("hub").description(
|
|
4349
4408
|
"Give your AI coding assistant the full picture. Multi-repo context, agent orchestration, and end-to-end workflows."
|
|
4350
4409
|
).version(pkg.version).enablePositionalOptions();
|
|
@@ -4369,4 +4428,5 @@ program.addCommand(memoryCommand);
|
|
|
4369
4428
|
program.addCommand(updateCommand);
|
|
4370
4429
|
program.addCommand(directoryCommand);
|
|
4371
4430
|
program.addCommand(scanCommand);
|
|
4431
|
+
program.addCommand(cloneCommand);
|
|
4372
4432
|
program.parse();
|