@applica-software-guru/sdd 0.2.0 → 1.0.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/commands/bug.d.ts +3 -0
- package/dist/commands/bug.d.ts.map +1 -0
- package/dist/commands/bug.js +76 -0
- package/dist/commands/bug.js.map +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/bug.ts +84 -0
- package/src/index.ts +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug.d.ts","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmElD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerBug = registerBug;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
9
|
+
const format_js_1 = require("../ui/format.js");
|
|
10
|
+
function statusLabel(status) {
|
|
11
|
+
switch (status) {
|
|
12
|
+
case 'open':
|
|
13
|
+
return chalk_1.default.yellow('open');
|
|
14
|
+
case 'resolved':
|
|
15
|
+
return chalk_1.default.green('resolved');
|
|
16
|
+
default:
|
|
17
|
+
return chalk_1.default.gray(status);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function registerBug(program) {
|
|
21
|
+
const bug = program
|
|
22
|
+
.command('bug')
|
|
23
|
+
.description('Manage bugs');
|
|
24
|
+
bug.command('list')
|
|
25
|
+
.description('List all bugs with their status')
|
|
26
|
+
.action(async () => {
|
|
27
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
28
|
+
const bugs = await sdd.bugs();
|
|
29
|
+
console.log((0, format_js_1.heading)('Bugs'));
|
|
30
|
+
if (bugs.length === 0) {
|
|
31
|
+
console.log((0, format_js_1.info)('No bugs found.\n'));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
for (const b of bugs) {
|
|
35
|
+
const icon = b.frontmatter.status === 'resolved' ? chalk_1.default.green(' ✓') : chalk_1.default.yellow(' ●');
|
|
36
|
+
console.log(`${icon} ${chalk_1.default.white(b.relativePath)} ${chalk_1.default.dim(`[${statusLabel(b.frontmatter.status)}]`)} ${chalk_1.default.cyan(b.frontmatter.title)}`);
|
|
37
|
+
}
|
|
38
|
+
console.log('');
|
|
39
|
+
});
|
|
40
|
+
bug.command('open')
|
|
41
|
+
.description('Show open bugs for the agent to process')
|
|
42
|
+
.action(async () => {
|
|
43
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
44
|
+
const open = await sdd.openBugs();
|
|
45
|
+
if (open.length === 0) {
|
|
46
|
+
console.log((0, format_js_1.heading)('Bugs'));
|
|
47
|
+
console.log((0, format_js_1.info)('No open bugs.\n'));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
console.log((0, format_js_1.heading)(`Open Bugs (${open.length})`));
|
|
51
|
+
for (const b of open) {
|
|
52
|
+
console.log(chalk_1.default.cyan.bold(` --- ${b.relativePath} ---`));
|
|
53
|
+
console.log(chalk_1.default.cyan(` Title: ${b.frontmatter.title}`));
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(b.body.trim().split('\n').map((line) => ` ${line}`).join('\n'));
|
|
56
|
+
console.log('');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
program
|
|
60
|
+
.command('mark-bug-resolved [files...]')
|
|
61
|
+
.description('Mark bugs as resolved')
|
|
62
|
+
.action(async (files) => {
|
|
63
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
64
|
+
const marked = await sdd.markBugResolved(files.length > 0 ? files : undefined);
|
|
65
|
+
console.log((0, format_js_1.heading)('Mark Bug Resolved'));
|
|
66
|
+
if (marked.length === 0) {
|
|
67
|
+
console.log((0, format_js_1.info)('No open bugs to mark.\n'));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
for (const f of marked) {
|
|
71
|
+
console.log(chalk_1.default.green(` ✓ ${f}`));
|
|
72
|
+
}
|
|
73
|
+
console.log(chalk_1.default.dim(`\n ${marked.length} bug(s) marked as resolved.\n`));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=bug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug.js","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":";;;;;AAgBA,kCAmEC;AAlFD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAgD;AAEhD,SAAS,WAAW,CAAC,MAAc;IACjC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,KAAK,UAAU;YACb,OAAO,eAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACjC;YACE,OAAO,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,SAAgB,WAAW,CAAC,OAAgB;IAC1C,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,aAAa,CAAC,CAAC;IAE9B,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;SAChB,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QA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,CAAC;QAE/E,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,mBAAmB,CAAC,CAAC,CAAC;QAE1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,yBAAyB,CAAC,CAAC,CAAC;YAC7C,OAAO;QACT,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,+BAA+B,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,11 +9,12 @@ const sync_js_1 = require("./commands/sync.js");
|
|
|
9
9
|
const validate_js_1 = require("./commands/validate.js");
|
|
10
10
|
const mark_synced_js_1 = require("./commands/mark-synced.js");
|
|
11
11
|
const cr_js_1 = require("./commands/cr.js");
|
|
12
|
+
const bug_js_1 = require("./commands/bug.js");
|
|
12
13
|
const program = new commander_1.Command();
|
|
13
14
|
program
|
|
14
15
|
.name('sdd')
|
|
15
16
|
.description('Story Driven Development — manage apps through structured documentation')
|
|
16
|
-
.version('0.
|
|
17
|
+
.version('1.0.0');
|
|
17
18
|
(0, init_js_1.registerInit)(program);
|
|
18
19
|
(0, status_js_1.registerStatus)(program);
|
|
19
20
|
(0, diff_js_1.registerDiff)(program);
|
|
@@ -21,6 +22,7 @@ program
|
|
|
21
22
|
(0, validate_js_1.registerValidate)(program);
|
|
22
23
|
(0, mark_synced_js_1.registerMarkSynced)(program);
|
|
23
24
|
(0, cr_js_1.registerCR)(program);
|
|
25
|
+
(0, bug_js_1.registerBug)(program);
|
|
24
26
|
program.parseAsync().catch((err) => {
|
|
25
27
|
console.error(err.message);
|
|
26
28
|
process.exit(1);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,gDAAkD;AAClD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,wDAA0D;AAC1D,8DAA+D;AAC/D,4CAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,gDAAkD;AAClD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,wDAA0D;AAC1D,8DAA+D;AAC/D,4CAA8C;AAC9C,8CAAgD;AAEhD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,0BAAc,EAAC,OAAO,CAAC,CAAC;AACxB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,8BAAgB,EAAC,OAAO,CAAC,CAAC;AAC1B,IAAA,mCAAkB,EAAC,OAAO,CAAC,CAAC;AAC5B,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;AACpB,IAAA,oBAAW,EAAC,OAAO,CAAC,CAAC;AAErB,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applica-software-guru/sdd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "CLI for Story Driven Development",
|
|
5
5
|
"author": "Bruno Fortunato <bruno.fortunato@applica.guru>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@inquirer/prompts": "^7.0.0",
|
|
15
|
-
"@applica-software-guru/sdd-core": "^0.
|
|
15
|
+
"@applica-software-guru/sdd-core": "^1.0.0",
|
|
16
16
|
"chalk": "^4.1.2",
|
|
17
17
|
"cli-table3": "^0.6.5",
|
|
18
18
|
"clipboardy": "^2.3.0",
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { SDD } from '@applica-software-guru/sdd-core';
|
|
4
|
+
import { heading, info } from '../ui/format.js';
|
|
5
|
+
|
|
6
|
+
function statusLabel(status: string): string {
|
|
7
|
+
switch (status) {
|
|
8
|
+
case 'open':
|
|
9
|
+
return chalk.yellow('open');
|
|
10
|
+
case 'resolved':
|
|
11
|
+
return chalk.green('resolved');
|
|
12
|
+
default:
|
|
13
|
+
return chalk.gray(status);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function registerBug(program: Command): void {
|
|
18
|
+
const bug = program
|
|
19
|
+
.command('bug')
|
|
20
|
+
.description('Manage bugs');
|
|
21
|
+
|
|
22
|
+
bug.command('list')
|
|
23
|
+
.description('List all bugs with their status')
|
|
24
|
+
.action(async () => {
|
|
25
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
26
|
+
const bugs = await sdd.bugs();
|
|
27
|
+
|
|
28
|
+
console.log(heading('Bugs'));
|
|
29
|
+
|
|
30
|
+
if (bugs.length === 0) {
|
|
31
|
+
console.log(info('No bugs found.\n'));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
for (const b of bugs) {
|
|
36
|
+
const icon = b.frontmatter.status === 'resolved' ? chalk.green(' ✓') : chalk.yellow(' ●');
|
|
37
|
+
console.log(`${icon} ${chalk.white(b.relativePath)} ${chalk.dim(`[${statusLabel(b.frontmatter.status)}]`)} ${chalk.cyan(b.frontmatter.title)}`);
|
|
38
|
+
}
|
|
39
|
+
console.log('');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
bug.command('open')
|
|
43
|
+
.description('Show open bugs for the agent to process')
|
|
44
|
+
.action(async () => {
|
|
45
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
46
|
+
const open = await sdd.openBugs();
|
|
47
|
+
|
|
48
|
+
if (open.length === 0) {
|
|
49
|
+
console.log(heading('Bugs'));
|
|
50
|
+
console.log(info('No open bugs.\n'));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log(heading(`Open Bugs (${open.length})`));
|
|
55
|
+
|
|
56
|
+
for (const b of open) {
|
|
57
|
+
console.log(chalk.cyan.bold(` --- ${b.relativePath} ---`));
|
|
58
|
+
console.log(chalk.cyan(` Title: ${b.frontmatter.title}`));
|
|
59
|
+
console.log('');
|
|
60
|
+
console.log(b.body.trim().split('\n').map((line: string) => ` ${line}`).join('\n'));
|
|
61
|
+
console.log('');
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
program
|
|
66
|
+
.command('mark-bug-resolved [files...]')
|
|
67
|
+
.description('Mark bugs as resolved')
|
|
68
|
+
.action(async (files: string[]) => {
|
|
69
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
70
|
+
const marked = await sdd.markBugResolved(files.length > 0 ? files : undefined);
|
|
71
|
+
|
|
72
|
+
console.log(heading('Mark Bug Resolved'));
|
|
73
|
+
|
|
74
|
+
if (marked.length === 0) {
|
|
75
|
+
console.log(info('No open bugs to mark.\n'));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
for (const f of marked) {
|
|
80
|
+
console.log(chalk.green(` ✓ ${f}`));
|
|
81
|
+
}
|
|
82
|
+
console.log(chalk.dim(`\n ${marked.length} bug(s) marked as resolved.\n`));
|
|
83
|
+
});
|
|
84
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -7,13 +7,14 @@ import { registerSync } from './commands/sync.js';
|
|
|
7
7
|
import { registerValidate } from './commands/validate.js';
|
|
8
8
|
import { registerMarkSynced } from './commands/mark-synced.js';
|
|
9
9
|
import { registerCR } from './commands/cr.js';
|
|
10
|
+
import { registerBug } from './commands/bug.js';
|
|
10
11
|
|
|
11
12
|
const program = new Command();
|
|
12
13
|
|
|
13
14
|
program
|
|
14
15
|
.name('sdd')
|
|
15
16
|
.description('Story Driven Development — manage apps through structured documentation')
|
|
16
|
-
.version('0.
|
|
17
|
+
.version('1.0.0');
|
|
17
18
|
|
|
18
19
|
registerInit(program);
|
|
19
20
|
registerStatus(program);
|
|
@@ -22,6 +23,7 @@ registerSync(program);
|
|
|
22
23
|
registerValidate(program);
|
|
23
24
|
registerMarkSynced(program);
|
|
24
25
|
registerCR(program);
|
|
26
|
+
registerBug(program);
|
|
25
27
|
|
|
26
28
|
program.parseAsync().catch((err) => {
|
|
27
29
|
console.error(err.message);
|