zdev 0.1.1 → 0.1.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 +21 -2
- package/package.json +1 -1
- package/src/commands/start.ts +18 -1
- package/src/index.ts +8 -2
package/dist/index.js
CHANGED
|
@@ -2490,7 +2490,21 @@ async function start(featureName, projectPath = ".", options = {}) {
|
|
|
2490
2490
|
const worktreeName = `${repoName}-${featureName}`;
|
|
2491
2491
|
const worktreePath = getWorktreePath(worktreeName);
|
|
2492
2492
|
const branchName = `feature/${featureName}`;
|
|
2493
|
-
|
|
2493
|
+
let baseBranch = options.baseBranch;
|
|
2494
|
+
if (!baseBranch) {
|
|
2495
|
+
const candidates = ["origin/main", "origin/master", "main", "master"];
|
|
2496
|
+
for (const candidate of candidates) {
|
|
2497
|
+
const check = run("git", ["rev-parse", "--verify", candidate], { cwd: fullPath });
|
|
2498
|
+
if (check.success) {
|
|
2499
|
+
baseBranch = candidate;
|
|
2500
|
+
break;
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
if (!baseBranch) {
|
|
2504
|
+
console.error(`❌ Could not detect base branch. Use --base-branch to specify.`);
|
|
2505
|
+
process.exit(1);
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2494
2508
|
console.log(`\uD83D\uDC02 Starting feature: ${featureName}`);
|
|
2495
2509
|
console.log(` Project: ${repoName}`);
|
|
2496
2510
|
console.log(` Branch: ${branchName}`);
|
|
@@ -3053,8 +3067,13 @@ Commands:`);
|
|
|
3053
3067
|
}
|
|
3054
3068
|
|
|
3055
3069
|
// src/index.ts
|
|
3070
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
3071
|
+
import { fileURLToPath } from "url";
|
|
3072
|
+
import { dirname, join as join4 } from "path";
|
|
3073
|
+
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
3074
|
+
var pkg = JSON.parse(readFileSync5(join4(__dirname2, "..", "package.json"), "utf-8"));
|
|
3056
3075
|
var program2 = new Command;
|
|
3057
|
-
program2.name("zdev").description(
|
|
3076
|
+
program2.name("zdev").description(`\uD83D\uDC02 zdev v${pkg.version} - Multi-agent worktree development environment`).version(pkg.version);
|
|
3058
3077
|
program2.command("create <name>").description("Create a new TanStack Start project").option("--convex", "Add Convex backend integration").option("--flat", "Flat structure (no monorepo)").action(async (name, options) => {
|
|
3059
3078
|
await create(name, {
|
|
3060
3079
|
convex: options.convex,
|
package/package.json
CHANGED
package/src/commands/start.ts
CHANGED
|
@@ -72,7 +72,24 @@ export async function start(
|
|
|
72
72
|
const worktreeName = `${repoName}-${featureName}`;
|
|
73
73
|
const worktreePath = getWorktreePath(worktreeName);
|
|
74
74
|
const branchName = `feature/${featureName}`;
|
|
75
|
-
|
|
75
|
+
|
|
76
|
+
// Auto-detect base branch if not specified
|
|
77
|
+
let baseBranch = options.baseBranch;
|
|
78
|
+
if (!baseBranch) {
|
|
79
|
+
// Try common base branches in order
|
|
80
|
+
const candidates = ["origin/main", "origin/master", "main", "master"];
|
|
81
|
+
for (const candidate of candidates) {
|
|
82
|
+
const check = run("git", ["rev-parse", "--verify", candidate], { cwd: fullPath });
|
|
83
|
+
if (check.success) {
|
|
84
|
+
baseBranch = candidate;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!baseBranch) {
|
|
89
|
+
console.error(`❌ Could not detect base branch. Use --base-branch to specify.`);
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
76
93
|
|
|
77
94
|
console.log(`🐂 Starting feature: ${featureName}`);
|
|
78
95
|
console.log(` Project: ${repoName}`);
|
package/src/index.ts
CHANGED
|
@@ -8,13 +8,19 @@ import { list } from "./commands/list.js";
|
|
|
8
8
|
import { clean } from "./commands/clean.js";
|
|
9
9
|
import { seedExport, seedImport } from "./commands/seed.js";
|
|
10
10
|
import { configCmd } from "./commands/config.js";
|
|
11
|
+
import { readFileSync } from "fs";
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
13
|
+
import { dirname, join } from "path";
|
|
14
|
+
|
|
15
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
11
17
|
|
|
12
18
|
const program = new Command();
|
|
13
19
|
|
|
14
20
|
program
|
|
15
21
|
.name("zdev")
|
|
16
|
-
.description(
|
|
17
|
-
.version(
|
|
22
|
+
.description(`🐂 zdev v${pkg.version} - Multi-agent worktree development environment`)
|
|
23
|
+
.version(pkg.version);
|
|
18
24
|
|
|
19
25
|
// zdev create
|
|
20
26
|
program
|