@alejandrochaves/devflow-cli 0.3.1 → 0.5.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.
Files changed (43) hide show
  1. package/README.md +145 -4
  2. package/dist/commands/comments.d.ts +4 -0
  3. package/dist/commands/comments.d.ts.map +1 -0
  4. package/dist/commands/comments.js +173 -0
  5. package/dist/commands/comments.js.map +1 -0
  6. package/dist/commands/commit.d.ts.map +1 -1
  7. package/dist/commands/commit.js +37 -2
  8. package/dist/commands/commit.js.map +1 -1
  9. package/dist/commands/lint-config.d.ts +2 -0
  10. package/dist/commands/lint-config.d.ts.map +1 -0
  11. package/dist/commands/lint-config.js +91 -0
  12. package/dist/commands/lint-config.js.map +1 -0
  13. package/dist/commands/log.d.ts +2 -0
  14. package/dist/commands/log.d.ts.map +1 -0
  15. package/dist/commands/log.js +89 -0
  16. package/dist/commands/log.js.map +1 -0
  17. package/dist/commands/release.d.ts +4 -0
  18. package/dist/commands/release.d.ts.map +1 -0
  19. package/dist/commands/release.js +196 -0
  20. package/dist/commands/release.js.map +1 -0
  21. package/dist/commands/review.d.ts +2 -0
  22. package/dist/commands/review.d.ts.map +1 -0
  23. package/dist/commands/review.js +109 -0
  24. package/dist/commands/review.js.map +1 -0
  25. package/dist/commands/stash.d.ts +2 -0
  26. package/dist/commands/stash.d.ts.map +1 -0
  27. package/dist/commands/stash.js +139 -0
  28. package/dist/commands/stash.js.map +1 -0
  29. package/dist/commands/stats.d.ts +2 -0
  30. package/dist/commands/stats.d.ts.map +1 -0
  31. package/dist/commands/stats.js +98 -0
  32. package/dist/commands/stats.js.map +1 -0
  33. package/dist/commands/worktree.d.ts +2 -0
  34. package/dist/commands/worktree.d.ts.map +1 -0
  35. package/dist/commands/worktree.js +132 -0
  36. package/dist/commands/worktree.js.map +1 -0
  37. package/dist/index.js +60 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/plugins.d.ts +3 -0
  40. package/dist/plugins.d.ts.map +1 -0
  41. package/dist/plugins.js +69 -0
  42. package/dist/plugins.js.map +1 -0
  43. package/package.json +6 -2
@@ -0,0 +1,98 @@
1
+ import { execSync } from "child_process";
2
+ import { bold, dim, cyan } from "../colors.js";
3
+ function getCommitStats(limit = 100) {
4
+ try {
5
+ const result = execSync(`git log --pretty=format:"%s|%an" -${limit}`, { encoding: "utf-8" }).trim();
6
+ if (!result)
7
+ return [];
8
+ return result.split("\n").map((line) => {
9
+ const [subject, author] = line.split("|");
10
+ const match = subject.match(/^(\w+)(?:\[.*?\])?(?:!)?\((.+?)\):/);
11
+ return {
12
+ type: match ? match[1] : "other",
13
+ scope: match ? match[2] : "none",
14
+ author: author || "unknown",
15
+ };
16
+ });
17
+ }
18
+ catch {
19
+ return [];
20
+ }
21
+ }
22
+ function topN(counts, n) {
23
+ return Object.entries(counts)
24
+ .sort((a, b) => b[1] - a[1])
25
+ .slice(0, n);
26
+ }
27
+ function bar(value, max, width = 20) {
28
+ const filled = Math.round((value / max) * width);
29
+ return "█".repeat(filled) + dim("░".repeat(width - filled));
30
+ }
31
+ export function statsCommand() {
32
+ const stats = getCommitStats(200);
33
+ if (stats.length === 0) {
34
+ console.log("No commits found.");
35
+ return;
36
+ }
37
+ console.log(`\n${dim("───")} ${bold("Stats")} ${dim(`(last ${stats.length} commits)`)} ${dim("───")}\n`);
38
+ // Commit types
39
+ const typeCounts = {};
40
+ for (const s of stats) {
41
+ typeCounts[s.type] = (typeCounts[s.type] || 0) + 1;
42
+ }
43
+ const topTypes = topN(typeCounts, 8);
44
+ const maxType = topTypes[0]?.[1] || 1;
45
+ console.log(bold(" Commit Types"));
46
+ for (const [type, count] of topTypes) {
47
+ const pct = Math.round((count / stats.length) * 100);
48
+ console.log(` ${type.padEnd(12)} ${bar(count, maxType)} ${cyan(String(count))} ${dim(`(${pct}%)`)}`);
49
+ }
50
+ // Scopes
51
+ console.log("");
52
+ const scopeCounts = {};
53
+ for (const s of stats) {
54
+ if (s.scope !== "none") {
55
+ scopeCounts[s.scope] = (scopeCounts[s.scope] || 0) + 1;
56
+ }
57
+ }
58
+ const topScopes = topN(scopeCounts, 8);
59
+ const maxScope = topScopes[0]?.[1] || 1;
60
+ if (topScopes.length > 0) {
61
+ console.log(bold(" Top Scopes"));
62
+ for (const [scope, count] of topScopes) {
63
+ console.log(` ${scope.padEnd(12)} ${bar(count, maxScope)} ${cyan(String(count))}`);
64
+ }
65
+ }
66
+ // Contributors
67
+ console.log("");
68
+ const authorCounts = {};
69
+ for (const s of stats) {
70
+ authorCounts[s.author] = (authorCounts[s.author] || 0) + 1;
71
+ }
72
+ const topAuthors = topN(authorCounts, 5);
73
+ const maxAuthor = topAuthors[0]?.[1] || 1;
74
+ console.log(bold(" Contributors"));
75
+ for (const [author, count] of topAuthors) {
76
+ const pct = Math.round((count / stats.length) * 100);
77
+ console.log(` ${author.padEnd(16)} ${bar(count, maxAuthor)} ${cyan(String(count))} ${dim(`(${pct}%)`)}`);
78
+ }
79
+ // Activity
80
+ console.log("");
81
+ try {
82
+ const firstCommit = execSync("git log --reverse --format=%ar | head -1", {
83
+ encoding: "utf-8",
84
+ shell: "/bin/bash",
85
+ }).trim();
86
+ const totalCommits = execSync("git rev-list --count HEAD", { encoding: "utf-8" }).trim();
87
+ const branches = execSync("git branch | wc -l", { encoding: "utf-8", shell: "/bin/bash" }).trim();
88
+ console.log(bold(" Summary"));
89
+ console.log(` ${dim("Total commits:")} ${cyan(totalCommits)}`);
90
+ console.log(` ${dim("Local branches:")} ${cyan(branches.trim())}`);
91
+ console.log(` ${dim("First commit:")} ${dim(firstCommit)}`);
92
+ }
93
+ catch {
94
+ // ignore
95
+ }
96
+ console.log("");
97
+ }
98
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/commands/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,GAA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,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAElG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function worktreeCommand(): Promise<void>;
2
+ //# sourceMappingURL=worktree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/commands/worktree.ts"],"names":[],"mappings":"AAuCA,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAuGrD"}
@@ -0,0 +1,132 @@
1
+ import { select, input, confirm } from "@inquirer/prompts";
2
+ import { execSync } from "child_process";
3
+ import { bold, dim, green, cyan, yellow, red } from "../colors.js";
4
+ function listWorktrees() {
5
+ try {
6
+ const result = execSync("git worktree list --porcelain", { encoding: "utf-8" }).trim();
7
+ if (!result)
8
+ return [];
9
+ const trees = [];
10
+ let current = {};
11
+ for (const line of result.split("\n")) {
12
+ if (line.startsWith("worktree ")) {
13
+ if (current.path)
14
+ trees.push(current);
15
+ current = { path: line.substring(9), bare: false };
16
+ }
17
+ else if (line.startsWith("branch ")) {
18
+ current.branch = line.substring(7).replace("refs/heads/", "");
19
+ }
20
+ else if (line === "bare") {
21
+ current.bare = true;
22
+ }
23
+ }
24
+ if (current.path)
25
+ trees.push(current);
26
+ return trees;
27
+ }
28
+ catch {
29
+ return [];
30
+ }
31
+ }
32
+ function getRepoRoot() {
33
+ return execSync("git rev-parse --show-toplevel", { encoding: "utf-8" }).trim();
34
+ }
35
+ export async function worktreeCommand() {
36
+ try {
37
+ const trees = listWorktrees();
38
+ console.log(`\n${dim("───")} ${bold("Worktrees")} ${dim("───")}\n`);
39
+ if (trees.length > 0) {
40
+ for (const tree of trees) {
41
+ const isCurrent = tree.path === getRepoRoot();
42
+ const marker = isCurrent ? cyan("● ") : " ";
43
+ console.log(`${marker}${tree.branch || dim("(bare)")} ${dim(`→ ${tree.path}`)}`);
44
+ }
45
+ console.log("");
46
+ }
47
+ const action = await select({
48
+ message: "Action:",
49
+ choices: [
50
+ { value: "add", name: "Add a new worktree" },
51
+ ...(trees.length > 1
52
+ ? [{ value: "remove", name: "Remove a worktree" }]
53
+ : []),
54
+ { value: "done", name: "Done" },
55
+ ],
56
+ });
57
+ if (action === "add") {
58
+ const branch = await input({
59
+ message: "Branch name for new worktree:",
60
+ validate: (val) => val.trim().length > 0 || "Branch name is required",
61
+ });
62
+ const root = getRepoRoot();
63
+ const defaultPath = `${root}-${branch.trim().replace(/\//g, "-")}`;
64
+ const path = await input({
65
+ message: "Worktree path:",
66
+ default: defaultPath,
67
+ });
68
+ // Check if branch exists
69
+ let branchExists = false;
70
+ try {
71
+ execSync(`git rev-parse --verify ${branch.trim()}`, { stdio: "ignore" });
72
+ branchExists = true;
73
+ }
74
+ catch {
75
+ // Branch doesn't exist
76
+ }
77
+ const createFlag = branchExists ? "" : "-b ";
78
+ try {
79
+ execSync(`git worktree add ${JSON.stringify(path.trim())} ${createFlag}${branch.trim()}`, {
80
+ stdio: "inherit",
81
+ });
82
+ console.log(green(`✓ Created worktree at ${path.trim()}`));
83
+ console.log(dim(` cd ${path.trim()}`));
84
+ }
85
+ catch {
86
+ console.log(red("✗ Failed to create worktree"));
87
+ }
88
+ }
89
+ else if (action === "remove") {
90
+ const removable = trees.filter((t) => t.path !== getRepoRoot() && !t.bare);
91
+ if (removable.length === 0) {
92
+ console.log("No removable worktrees.");
93
+ return;
94
+ }
95
+ const selected = await select({
96
+ message: "Select worktree to remove:",
97
+ choices: removable.map((t) => ({
98
+ value: t.path,
99
+ name: `${t.branch} ${dim(`→ ${t.path}`)}`,
100
+ })),
101
+ });
102
+ const confirmed = await confirm({
103
+ message: `Remove worktree at ${selected}?`,
104
+ default: false,
105
+ });
106
+ if (confirmed) {
107
+ try {
108
+ execSync(`git worktree remove ${JSON.stringify(selected)}`, { stdio: "inherit" });
109
+ console.log(green("✓ Worktree removed"));
110
+ }
111
+ catch {
112
+ const force = await confirm({
113
+ message: "Worktree has changes. Force remove?",
114
+ default: false,
115
+ });
116
+ if (force) {
117
+ execSync(`git worktree remove --force ${JSON.stringify(selected)}`, { stdio: "inherit" });
118
+ console.log(yellow("✓ Force removed worktree"));
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ catch (error) {
125
+ if (error.name === "ExitPromptError") {
126
+ console.log("\nCancelled.");
127
+ process.exit(0);
128
+ }
129
+ process.exit(1);
130
+ }
131
+ }
132
+ //# sourceMappingURL=worktree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/commands/worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQnE,SAAS,aAAa;IACpB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,+BAA+B,EAAE,EAAE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,QAAQ,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;wBAC1F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;oBAClD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAAe,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,15 @@ import { undoCommand } from "./commands/undo.js";
14
14
  import { mergeCommand } from "./commands/merge.js";
15
15
  import { fixupCommand } from "./commands/fixup.js";
16
16
  import { testPlanCommand } from "./commands/test-plan.js";
17
+ import { releaseCommand } from "./commands/release.js";
18
+ import { reviewCommand } from "./commands/review.js";
19
+ import { stashCommand } from "./commands/stash.js";
20
+ import { worktreeCommand } from "./commands/worktree.js";
21
+ import { logCommand } from "./commands/log.js";
22
+ import { statsCommand } from "./commands/stats.js";
23
+ import { lintConfigCommand } from "./commands/lint-config.js";
24
+ import { commentsCommand } from "./commands/comments.js";
25
+ import { loadPlugins } from "./plugins.js";
17
26
  import { checkForUpdates } from "./update-notifier.js";
18
27
  const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
19
28
  // Check for updates (non-blocking, cached)
@@ -66,6 +75,37 @@ program
66
75
  .description("Merge the current branch PR with squash/merge/rebase")
67
76
  .option("--dry-run", "Preview without executing git commands")
68
77
  .action((opts) => mergeCommand(opts));
78
+ program
79
+ .command("release")
80
+ .alias("rel")
81
+ .description("Create a release with version bump, changelog, tag, and GitHub release")
82
+ .action(releaseCommand);
83
+ program
84
+ .command("review")
85
+ .alias("rv")
86
+ .description("List and interact with open pull requests")
87
+ .action(reviewCommand);
88
+ program
89
+ .command("comments")
90
+ .alias("cm")
91
+ .description("Show PR reviews and inline comments with diff context")
92
+ .option("--number <number>", "PR number (defaults to current branch PR)")
93
+ .action((opts) => commentsCommand(opts));
94
+ program
95
+ .command("stash")
96
+ .alias("st")
97
+ .description("Save, pop, apply, or drop named stashes")
98
+ .action(stashCommand);
99
+ program
100
+ .command("worktree")
101
+ .alias("wt")
102
+ .description("Manage git worktrees for parallel branch work")
103
+ .action(worktreeCommand);
104
+ program
105
+ .command("log")
106
+ .alias("l")
107
+ .description("Interactive commit log with cherry-pick, revert, and fixup actions")
108
+ .action(logCommand);
69
109
  // --- Info commands ---
70
110
  program
71
111
  .command("status")
@@ -87,6 +127,15 @@ program
87
127
  .description("Delete local branches that have been merged or whose remote is gone")
88
128
  .option("--dry-run", "Preview without deleting branches")
89
129
  .action((opts) => cleanupCommand(opts));
130
+ program
131
+ .command("stats")
132
+ .description("Show commit type distribution, top scopes, and contributor stats")
133
+ .action(statsCommand);
134
+ program
135
+ .command("lint-config")
136
+ .alias("lint")
137
+ .description("Validate .devflow.json for errors and warnings (CI-friendly)")
138
+ .action(lintConfigCommand);
90
139
  // --- Setup commands ---
91
140
  program
92
141
  .command("init")
@@ -108,13 +157,15 @@ program
108
157
  console.log(generateZshCompletions());
109
158
  }
110
159
  });
160
+ // Load plugins before parsing
161
+ await loadPlugins(program);
111
162
  program.parse();
112
163
  function generateBashCompletions() {
113
164
  return `# devflow bash completions
114
165
  # Add to ~/.bashrc: eval "$(devflow completions --shell bash)"
115
166
  _devflow_completions() {
116
167
  local cur="\${COMP_WORDS[COMP_CWORD]}"
117
- local commands="branch commit pr amend undo fixup merge status test-plan changelog cleanup init doctor completions"
168
+ local commands="branch commit pr amend undo fixup merge release review comments stash worktree log status test-plan changelog cleanup stats lint-config init doctor completions"
118
169
 
119
170
  if [ "\${COMP_CWORD}" -eq 1 ]; then
120
171
  COMPREPLY=($(compgen -W "\${commands}" -- "\${cur}"))
@@ -137,10 +188,18 @@ _devflow() {
137
188
  'undo:Undo the last commit (alias: u)'
138
189
  'fixup:Create a fixup commit (alias: f)'
139
190
  'merge:Merge the current PR (alias: m)'
191
+ 'release:Create a release (alias: rel)'
192
+ 'review:List and interact with PRs (alias: rv)'
193
+ 'comments:Show PR reviews and inline comments (alias: cm)'
194
+ 'stash:Manage named stashes (alias: st)'
195
+ 'worktree:Manage git worktrees (alias: wt)'
196
+ 'log:Interactive commit log (alias: l)'
140
197
  'status:Show branch and PR info (alias: s)'
141
198
  'test-plan:View or edit test plan (alias: tp)'
142
199
  'changelog:Generate changelog from commits'
143
200
  'cleanup:Delete merged local branches'
201
+ 'stats:Show commit and contributor stats'
202
+ 'lint-config:Validate .devflow.json (alias: lint)'
144
203
  'init:Initialize devflow config'
145
204
  'doctor:Check devflow dependencies'
146
205
  'completions:Output shell completion script'
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EA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S,uBAAuB;IAC9B,OAAO;;;;;;;;;;;;yCAYgC,CAAC;AAC1C,CAAC;AAED,SAAS,sBAAsB;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAiDgB,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function loadPlugins(program: Command, cwd?: string): Promise<void>;
3
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmDpC,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB9F"}
@@ -0,0 +1,69 @@
1
+ import { existsSync, readFileSync } from "fs";
2
+ import { resolve } from "path";
3
+ import { yellow } from "./colors.js";
4
+ const PLUGIN_PREFIX = "devflow-plugin-";
5
+ function findPlugins(cwd) {
6
+ const plugins = [];
7
+ // Check package.json for devflow plugins in dependencies
8
+ const pkgPath = resolve(cwd, "package.json");
9
+ if (existsSync(pkgPath)) {
10
+ try {
11
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
12
+ const allDeps = {
13
+ ...pkg.dependencies,
14
+ ...pkg.devDependencies,
15
+ };
16
+ for (const dep of Object.keys(allDeps || {})) {
17
+ if (dep.startsWith(PLUGIN_PREFIX) || dep.startsWith("@") && dep.includes(`/${PLUGIN_PREFIX}`)) {
18
+ plugins.push(dep);
19
+ }
20
+ }
21
+ }
22
+ catch {
23
+ // ignore
24
+ }
25
+ }
26
+ // Check .devflow.json for explicit plugin list
27
+ const configPath = resolve(cwd, ".devflow.json");
28
+ if (existsSync(configPath)) {
29
+ try {
30
+ const config = JSON.parse(readFileSync(configPath, "utf-8"));
31
+ if (Array.isArray(config.plugins)) {
32
+ for (const plugin of config.plugins) {
33
+ if (!plugins.includes(plugin)) {
34
+ plugins.push(plugin);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ catch {
40
+ // ignore
41
+ }
42
+ }
43
+ return plugins;
44
+ }
45
+ export async function loadPlugins(program, cwd = process.cwd()) {
46
+ const plugins = findPlugins(cwd);
47
+ for (const pluginName of plugins) {
48
+ try {
49
+ // Try to resolve the plugin from node_modules
50
+ const pluginPath = resolve(cwd, "node_modules", pluginName);
51
+ if (!existsSync(pluginPath))
52
+ continue;
53
+ const pkgJson = resolve(pluginPath, "package.json");
54
+ if (!existsSync(pkgJson))
55
+ continue;
56
+ const pkg = JSON.parse(readFileSync(pkgJson, "utf-8"));
57
+ const mainFile = pkg.main || pkg.exports?.["."] || "index.js";
58
+ const entryPoint = resolve(pluginPath, mainFile);
59
+ const mod = await import(entryPoint);
60
+ if (typeof mod.register === "function") {
61
+ mod.register(program);
62
+ }
63
+ }
64
+ catch (err) {
65
+ console.error(yellow(`⚠ Failed to load plugin: ${pluginName}`));
66
+ }
67
+ }
68
+ }
69
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAe,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAQ,MAAM,MAAM,CAAC;AAErC,OAAO,EAAO,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAMxC,SAAS,WAAW,CAAC,GAAW;IAC9B,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,yDAAyD;IACzD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC7C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,K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AAO,CAAC,GAAG,EAAE;IAC7E,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAEjC,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,8CAA8C;YAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;YAC5D,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;gBAAE,SAAS;YAEtC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YACpD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBAAE,SAAS;YAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YACvD,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC;YAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAEjD,MAAM,GAAG,GAAiB,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;YACnD,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;gBACvC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,4BAA4B,UAAU,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alejandrochaves/devflow-cli",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "Interactive CLI for branch creation, conventional commits, and PR management",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,10 @@
12
12
  "test": "vitest run",
13
13
  "test:watch": "vitest",
14
14
  "publish:public": "npm publish --access=public",
15
- "prepublishOnly": "npm run build"
15
+ "prepublishOnly": "npm run build",
16
+ "docs:dev": "vitepress dev docs",
17
+ "docs:build": "vitepress build docs",
18
+ "docs:preview": "vitepress preview docs"
16
19
  },
17
20
  "keywords": [
18
21
  "cli",
@@ -44,6 +47,7 @@
44
47
  "devDependencies": {
45
48
  "@types/node": "^22.0.0",
46
49
  "typescript": "~5.9.2",
50
+ "vitepress": "^1.6.4",
47
51
  "vitest": "^4.0.18"
48
52
  }
49
53
  }