@applica-software-guru/sdd 1.3.4 → 1.4.1
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/apply.js +1 -1
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/bug.d.ts.map +1 -1
- package/dist/commands/bug.js +3 -1
- package/dist/commands/bug.js.map +1 -1
- package/dist/commands/cr.d.ts.map +1 -1
- package/dist/commands/cr.js +5 -3
- package/dist/commands/cr.js.map +1 -1
- package/dist/commands/mark-drafts-enriched.d.ts +3 -0
- package/dist/commands/mark-drafts-enriched.d.ts.map +1 -0
- package/dist/commands/mark-drafts-enriched.js +28 -0
- package/dist/commands/mark-drafts-enriched.js.map +1 -0
- package/dist/commands/pull.d.ts +3 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +75 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/push.d.ts +3 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +33 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/remote.d.ts +3 -0
- package/dist/commands/remote.d.ts.map +1 -0
- package/dist/commands/remote.js +81 -0
- package/dist/commands/remote.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +3 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/format.js +4 -0
- package/dist/ui/format.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/apply.ts +1 -1
- package/src/commands/bug.ts +3 -1
- package/src/commands/cr.ts +5 -3
- package/src/commands/mark-drafts-enriched.ts +26 -0
- package/src/commands/pull.ts +73 -0
- package/src/commands/push.ts +33 -0
- package/src/commands/remote.ts +91 -0
- package/src/commands/status.ts +2 -0
- package/src/index.ts +8 -0
- package/src/ui/format.ts +4 -0
package/dist/commands/apply.js
CHANGED
|
@@ -18,7 +18,7 @@ function registerApply(program) {
|
|
|
18
18
|
console.log((0, format_js_1.heading)('SDD Apply'));
|
|
19
19
|
const prompt = await sdd.applyPrompt();
|
|
20
20
|
if (!prompt) {
|
|
21
|
-
console.log((0, format_js_1.info)('Nothing to apply — no open bugs, pending CRs, or pending files.'));
|
|
21
|
+
console.log((0, format_js_1.info)('Nothing to apply — no drafts, open bugs, pending CRs, or pending files.'));
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
// Show the prompt being sent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/commands/apply.ts"],"names":[],"mappings":";;;;;AAMA,sCA0CC;AA/CD,kDAA0B;AAC1B,8DAAgE;AAChE,+CAAgD;AAChD,mDAAmD;AAEnD,SAAgB,aAAa,CAAC,OAAgB;IAC5C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,oEAAoE,CAAC;SACjF,MAAM,CAAC,gBAAgB,EAAE,iDAAiD,CAAC;SAC3E,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAE7C,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;QAElC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/commands/apply.ts"],"names":[],"mappings":";;;;;AAMA,sCA0CC;AA/CD,kDAA0B;AAC1B,8DAAgE;AAChE,+CAAgD;AAChD,mDAAmD;AAEnD,SAAgB,aAAa,CAAC,OAAgB;IAC5C,OAAO;SACJ,OAAO,CAA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C;QAEzC,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC;YAC9B,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;YACnB,MAAM;YACN,KAAK;YACL,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bug.d.ts","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"bug.d.ts","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmElD"}
|
package/dist/commands/bug.js
CHANGED
|
@@ -9,6 +9,8 @@ const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
|
9
9
|
const format_js_1 = require("../ui/format.js");
|
|
10
10
|
function statusLabel(status) {
|
|
11
11
|
switch (status) {
|
|
12
|
+
case 'draft':
|
|
13
|
+
return chalk_1.default.magenta('draft');
|
|
12
14
|
case 'open':
|
|
13
15
|
return chalk_1.default.yellow('open');
|
|
14
16
|
case 'resolved':
|
|
@@ -32,7 +34,7 @@ function registerBug(program) {
|
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
for (const b of bugs) {
|
|
35
|
-
const icon = b.frontmatter.status === 'resolved' ? chalk_1.default.green(' ✓') : chalk_1.default.yellow(' ●');
|
|
37
|
+
const icon = b.frontmatter.status === 'resolved' ? chalk_1.default.green(' ✓') : b.frontmatter.status === 'draft' ? chalk_1.default.magenta(' ◇') : chalk_1.default.yellow(' ●');
|
|
36
38
|
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
39
|
}
|
|
38
40
|
console.log('');
|
package/dist/commands/bug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bug.js","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"bug.js","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":";;;;;AAkBA,kCAmEC;AApFD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAgD;AAEhD,SAAS,WAAW,CAAC,MAAc;IACjC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,eAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,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,G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,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cr.d.ts","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cr.d.ts","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmEjD"}
|
package/dist/commands/cr.js
CHANGED
|
@@ -10,7 +10,9 @@ const format_js_1 = require("../ui/format.js");
|
|
|
10
10
|
function statusLabel(status) {
|
|
11
11
|
switch (status) {
|
|
12
12
|
case 'draft':
|
|
13
|
-
return chalk_1.default.
|
|
13
|
+
return chalk_1.default.magenta('draft');
|
|
14
|
+
case 'pending':
|
|
15
|
+
return chalk_1.default.yellow('pending');
|
|
14
16
|
case 'applied':
|
|
15
17
|
return chalk_1.default.green('applied');
|
|
16
18
|
default:
|
|
@@ -32,7 +34,7 @@ function registerCR(program) {
|
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
for (const cr of crs) {
|
|
35
|
-
const icon = cr.frontmatter.status === 'applied' ? chalk_1.default.green(' ✓') : chalk_1.default.yellow(' ●');
|
|
37
|
+
const icon = cr.frontmatter.status === 'applied' ? chalk_1.default.green(' ✓') : cr.frontmatter.status === 'draft' ? chalk_1.default.magenta(' ◇') : chalk_1.default.yellow(' ●');
|
|
36
38
|
console.log(`${icon} ${chalk_1.default.white(cr.relativePath)} ${chalk_1.default.dim(`[${statusLabel(cr.frontmatter.status)}]`)} ${chalk_1.default.cyan(cr.frontmatter.title)}`);
|
|
37
39
|
}
|
|
38
40
|
console.log('');
|
|
@@ -64,7 +66,7 @@ function registerCR(program) {
|
|
|
64
66
|
const marked = await sdd.markCRApplied(files.length > 0 ? files : undefined);
|
|
65
67
|
console.log((0, format_js_1.heading)('Mark CR Applied'));
|
|
66
68
|
if (marked.length === 0) {
|
|
67
|
-
console.log((0, format_js_1.info)('No
|
|
69
|
+
console.log((0, format_js_1.info)('No pending change requests to mark.\n'));
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
72
|
for (const f of marked) {
|
package/dist/commands/cr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cr.js","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"cr.js","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":";;;;;AAkBA,gCAmEC;AApFD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAgD;AAEhD,SAAS,WAAW,CAAC,MAAc;IACjC,QAAQ,MAAM,E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AAM,yCAAyC,CAAC,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-drafts-enriched.d.ts","sourceRoot":"","sources":["../../src/commands/mark-drafts-enriched.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoBjE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.registerMarkDraftsEnriched = registerMarkDraftsEnriched;
|
|
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 registerMarkDraftsEnriched(program) {
|
|
11
|
+
program
|
|
12
|
+
.command('mark-drafts-enriched [files...]')
|
|
13
|
+
.description('Mark draft elements as enriched (docs → new, CRs → pending, bugs → open)')
|
|
14
|
+
.action(async (files) => {
|
|
15
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
16
|
+
const marked = await sdd.markDraftsEnriched(files.length > 0 ? files : undefined);
|
|
17
|
+
console.log((0, format_js_1.heading)('Mark Drafts Enriched'));
|
|
18
|
+
if (marked.length === 0) {
|
|
19
|
+
console.log((0, format_js_1.info)('No draft elements to mark.\n'));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
for (const f of marked) {
|
|
23
|
+
console.log((0, format_js_1.success)(f));
|
|
24
|
+
}
|
|
25
|
+
console.log(chalk_1.default.dim(`\n ${marked.length} element(s) marked as enriched.\n`));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=mark-drafts-enriched.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-drafts-enriched.js","sourceRoot":"","sources":["../../src/commands/mark-drafts-enriched.ts"],"names":[],"mappings":";;;;;AAKA,gEAoBC;AAxBD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAyD;AAEzD,SAAgB,0BAA0B,CAAC,OAAgB;IACzD,OAAO;SACJ,OAAO,CAAC,iCAAiC,CAAC;SAC1C,WAAW,CAAC,0EAA0E,CAAC;SACvF,MAAM,CAAC,KAAK,EAAE,KAAe,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAElF,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,sBAAsB,CAAC,CAAC,CAAC;QAE7C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,8BAA8B,CAAC,CAAC,CAAC;YAClD,OAAO;QACT,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,mCAAmC,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmEnD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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.registerPull = registerPull;
|
|
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 registerPull(program) {
|
|
11
|
+
program
|
|
12
|
+
.command('pull')
|
|
13
|
+
.description('Pull documents, CRs, and bugs from remote')
|
|
14
|
+
.option('--docs-only', 'Only pull documents')
|
|
15
|
+
.option('--crs-only', 'Only pull change requests')
|
|
16
|
+
.option('--bugs-only', 'Only pull bugs')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
19
|
+
const pullAll = !options.docsOnly && !options.crsOnly && !options.bugsOnly;
|
|
20
|
+
console.log((0, format_js_1.heading)('Pull from Remote'));
|
|
21
|
+
// Pull documents
|
|
22
|
+
if (pullAll || options.docsOnly) {
|
|
23
|
+
console.log(chalk_1.default.dim(' Pulling documents...'));
|
|
24
|
+
const result = await sdd.pull();
|
|
25
|
+
if (result.created.length > 0) {
|
|
26
|
+
for (const p of result.created) {
|
|
27
|
+
console.log(chalk_1.default.cyan(` + ${p}`));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (result.updated.length > 0) {
|
|
31
|
+
for (const p of result.updated) {
|
|
32
|
+
console.log(chalk_1.default.yellow(` ~ ${p}`));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (result.conflicts.length > 0) {
|
|
36
|
+
for (const c of result.conflicts) {
|
|
37
|
+
console.log((0, format_js_1.warning)(`${c.path} — ${c.reason} (local: v${c.localVersion}, remote: v${c.remoteVersion})`));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const total = result.created.length + result.updated.length;
|
|
41
|
+
if (total > 0) {
|
|
42
|
+
console.log((0, format_js_1.success)(`${result.created.length} created, ${result.updated.length} updated`));
|
|
43
|
+
}
|
|
44
|
+
else if (result.conflicts.length === 0) {
|
|
45
|
+
console.log((0, format_js_1.info)('Documents up to date.'));
|
|
46
|
+
}
|
|
47
|
+
console.log('');
|
|
48
|
+
}
|
|
49
|
+
// Pull CRs
|
|
50
|
+
if (pullAll || options.crsOnly) {
|
|
51
|
+
console.log(chalk_1.default.dim(' Pulling change requests...'));
|
|
52
|
+
const crResult = await sdd.pullCRs();
|
|
53
|
+
if (crResult.created > 0 || crResult.updated > 0) {
|
|
54
|
+
console.log((0, format_js_1.success)(`${crResult.created} created, ${crResult.updated} updated`));
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.log((0, format_js_1.info)('No pending change requests on remote.'));
|
|
58
|
+
}
|
|
59
|
+
console.log('');
|
|
60
|
+
}
|
|
61
|
+
// Pull bugs
|
|
62
|
+
if (pullAll || options.bugsOnly) {
|
|
63
|
+
console.log(chalk_1.default.dim(' Pulling bugs...'));
|
|
64
|
+
const bugResult = await sdd.pullBugs();
|
|
65
|
+
if (bugResult.created > 0 || bugResult.updated > 0) {
|
|
66
|
+
console.log((0, format_js_1.success)(`${bugResult.created} created, ${bugResult.updated} updated`));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
console.log((0, format_js_1.info)('No open bugs on remote.'));
|
|
70
|
+
}
|
|
71
|
+
console.log('');
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=pull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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,CA2BnD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.registerPush = registerPush;
|
|
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 registerPush(program) {
|
|
11
|
+
program
|
|
12
|
+
.command('push [files...]')
|
|
13
|
+
.description('Push pending documents to remote')
|
|
14
|
+
.option('--all', 'Push all files including synced')
|
|
15
|
+
.action(async (files, options) => {
|
|
16
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
17
|
+
console.log((0, format_js_1.heading)('Push to Remote'));
|
|
18
|
+
console.log(chalk_1.default.dim(' Pushing documents...'));
|
|
19
|
+
const paths = files.length > 0 ? files : undefined;
|
|
20
|
+
const result = await sdd.push(paths, { all: options.all });
|
|
21
|
+
if (result.pushed.length === 0) {
|
|
22
|
+
console.log((0, format_js_1.info)('No pending files to push.\n'));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
for (const p of result.pushed) {
|
|
26
|
+
console.log(chalk_1.default.green(` ✓ ${p}`));
|
|
27
|
+
}
|
|
28
|
+
console.log('');
|
|
29
|
+
console.log((0, format_js_1.success)(`${result.created} created, ${result.updated} updated on remote`));
|
|
30
|
+
console.log(chalk_1.default.dim(` ${result.pushed.length} file(s) pushed and marked as synced.\n`));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":";;;;;AAKA,oCA2BC;AA/BD,kDAA0B;A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C,CAAC;QACvF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,yCAAyC,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/commands/remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoFrD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
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.registerRemote = registerRemote;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const prompts_1 = require("@inquirer/prompts");
|
|
9
|
+
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
10
|
+
const format_js_1 = require("../ui/format.js");
|
|
11
|
+
function registerRemote(program) {
|
|
12
|
+
const remote = program
|
|
13
|
+
.command('remote')
|
|
14
|
+
.description('Manage remote sync with SDD Flow');
|
|
15
|
+
remote
|
|
16
|
+
.command('init')
|
|
17
|
+
.description('Configure remote API connection')
|
|
18
|
+
.option('--url <url>', 'SDD Flow API base URL')
|
|
19
|
+
.option('--api-key <key>', 'API key (prefer SDD_API_KEY env var)')
|
|
20
|
+
.action(async (options) => {
|
|
21
|
+
const root = process.cwd();
|
|
22
|
+
const config = await (0, sdd_core_1.readConfig)(root);
|
|
23
|
+
const url = options.url ??
|
|
24
|
+
(await (0, prompts_1.input)({
|
|
25
|
+
message: 'SDD Flow API URL',
|
|
26
|
+
default: config.remote?.url ?? 'https://sdd.applica.guru/api/v1',
|
|
27
|
+
}));
|
|
28
|
+
const apiKey = options.apiKey ??
|
|
29
|
+
(await (0, prompts_1.password)({
|
|
30
|
+
message: 'API key (leave empty to use SDD_API_KEY env var)',
|
|
31
|
+
}));
|
|
32
|
+
config.remote = {
|
|
33
|
+
url: url.replace(/\/+$/, ''),
|
|
34
|
+
};
|
|
35
|
+
if (apiKey) {
|
|
36
|
+
config.remote['api-key'] = apiKey;
|
|
37
|
+
}
|
|
38
|
+
await (0, sdd_core_1.writeConfig)(root, config);
|
|
39
|
+
console.log((0, format_js_1.success)('Remote configuration saved to .sdd/config.yaml'));
|
|
40
|
+
if (!apiKey && !process.env.SDD_API_KEY) {
|
|
41
|
+
console.log((0, format_js_1.warning)('No API key found. Set SDD_API_KEY environment variable or re-run with --api-key.'));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Test connection
|
|
45
|
+
console.log((0, format_js_1.info)('Testing connection...'));
|
|
46
|
+
try {
|
|
47
|
+
const sdd = new sdd_core_1.SDD({ root });
|
|
48
|
+
const status = await sdd.remoteStatus();
|
|
49
|
+
if (status.connected) {
|
|
50
|
+
console.log((0, format_js_1.success)(`Connected! Remote has ${status.remoteDocs} document(s).`));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
console.log((0, format_js_1.error)('Could not connect to remote. Check URL and API key.'));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.log((0, format_js_1.error)(`Connection failed: ${err.message}`));
|
|
58
|
+
}
|
|
59
|
+
console.log('');
|
|
60
|
+
});
|
|
61
|
+
remote
|
|
62
|
+
.command('status')
|
|
63
|
+
.description('Show remote sync status')
|
|
64
|
+
.action(async () => {
|
|
65
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
66
|
+
const status = await sdd.remoteStatus();
|
|
67
|
+
console.log((0, format_js_1.heading)('Remote Status'));
|
|
68
|
+
if (!status.configured) {
|
|
69
|
+
console.log((0, format_js_1.info)('Remote not configured. Run "sdd remote init" to set up.\n'));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
console.log(` ${chalk_1.default.dim('URL:')} ${chalk_1.default.white(status.url)}`);
|
|
73
|
+
console.log(` ${chalk_1.default.dim('Connection:')} ${status.connected ? chalk_1.default.green.bold('connected') : chalk_1.default.red.bold('disconnected')}`);
|
|
74
|
+
console.log(` ${chalk_1.default.dim('Local pending:')} ${chalk_1.default.yellow.bold(String(status.localPending))} file(s)`);
|
|
75
|
+
if (status.connected) {
|
|
76
|
+
console.log(` ${chalk_1.default.dim('Remote docs:')} ${chalk_1.default.cyan.bold(String(status.remoteDocs))} document(s)`);
|
|
77
|
+
}
|
|
78
|
+
console.log('');
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/commands/remote.ts"],"names":[],"mappings":";;;;;AAMA,wCAoFC;AAzFD,kDAA0B;AAC1B,+CAAoD;AACpD,8DAA+E;AAC/E,+CAAqF;AAErF,SAAgB,cAAc,CAAC,OAAgB;IAC7C,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kCAAkC,CAAC,CAAC;IAEnD,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,aAAa,EAAE,uBAAuB,CAAC;SAC9C,MAAM,CAAC,iBAAiB,EAAE,sCAAsC,CAAC;SACjE,MAAM,CAAC,KAAK,EAAE,OAA0C,EAAE,EAAE;QAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAC;QAEtC,MAAM,GAAG,GACP,OAAO,CAAC,GAAG;YACX,CAAC,MAAM,IAA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IAAI,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,CAAC;QAC1G,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,CAAC;QAC3G,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkCrD"}
|
package/dist/commands/status.js
CHANGED
|
@@ -20,6 +20,7 @@ function registerStatus(program) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const counts = {
|
|
23
|
+
draft: result.files.filter((f) => f.status === 'draft').length,
|
|
23
24
|
new: result.files.filter((f) => f.status === 'new').length,
|
|
24
25
|
changed: result.files.filter((f) => f.status === 'changed').length,
|
|
25
26
|
deleted: result.files.filter((f) => f.status === 'deleted').length,
|
|
@@ -29,6 +30,8 @@ function registerStatus(program) {
|
|
|
29
30
|
console.log((0, format_js_1.createStatusTable)(result.files));
|
|
30
31
|
console.log('');
|
|
31
32
|
const parts = [];
|
|
33
|
+
if (counts.draft)
|
|
34
|
+
parts.push(chalk_1.default.magenta.bold(`${counts.draft} draft`));
|
|
32
35
|
if (counts.new)
|
|
33
36
|
parts.push(chalk_1.default.cyan.bold(`${counts.new} new`));
|
|
34
37
|
if (counts.changed)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;;;;AAKA,wCAkCC;AAtCD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAmE;AAEnE,SAAgB,cAAc,CAAC,OAAgB;IAC7C,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,gCAAgC,CAAC;SAC7C,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;QAElC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,yBAAyB,CAAC,CAAC,CAAC;YAC7C,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG;YACb,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM;YAC9D,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,CA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CAAC,CAAC,CAAC;QAC5E,IAAI,MAAM,CAAC,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,10 @@ const apply_js_1 = require("./commands/apply.js");
|
|
|
15
15
|
const adapters_js_1 = require("./commands/adapters.js");
|
|
16
16
|
const ui_js_1 = require("./commands/ui.js");
|
|
17
17
|
const upgrade_js_1 = require("./commands/upgrade.js");
|
|
18
|
+
const remote_js_1 = require("./commands/remote.js");
|
|
19
|
+
const pull_js_1 = require("./commands/pull.js");
|
|
20
|
+
const push_js_1 = require("./commands/push.js");
|
|
21
|
+
const mark_drafts_enriched_js_1 = require("./commands/mark-drafts-enriched.js");
|
|
18
22
|
const packageRequire = (0, node_module_1.createRequire)(__filename);
|
|
19
23
|
const packageJson = packageRequire("../package.json");
|
|
20
24
|
const program = new commander_1.Command();
|
|
@@ -34,6 +38,10 @@ program
|
|
|
34
38
|
(0, adapters_js_1.registerAdapters)(program);
|
|
35
39
|
(0, ui_js_1.registerUI)(program);
|
|
36
40
|
(0, upgrade_js_1.registerUpgrade)(program);
|
|
41
|
+
(0, remote_js_1.registerRemote)(program);
|
|
42
|
+
(0, pull_js_1.registerPull)(program);
|
|
43
|
+
(0, push_js_1.registerPush)(program);
|
|
44
|
+
(0, mark_drafts_enriched_js_1.registerMarkDraftsEnriched)(program);
|
|
37
45
|
program.parseAsync().catch((err) => {
|
|
38
46
|
console.error(err.message);
|
|
39
47
|
process.exit(1);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names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AAO,CAAC,CAAC;AACvB,IAAA,8BAAgB,EAAC,OAAO,CAAC,CAAC;AAC1B,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;AACpB,IAAA,4BAAe,EAAC,OAAO,CAAC,CAAC;AACzB,IAAA,0BAAc,EAAC,OAAO,CAAC,CAAC;AACxB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,oDAA0B,EAAC,OAAO,CAAC,CAAC;AAEpC,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/dist/ui/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAejD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAelD;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7F,MAAM,CAgCR;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
package/dist/ui/format.js
CHANGED
|
@@ -15,6 +15,8 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
15
15
|
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
16
16
|
function statusIcon(status) {
|
|
17
17
|
switch (status) {
|
|
18
|
+
case 'draft':
|
|
19
|
+
return chalk_1.default.magenta('◇');
|
|
18
20
|
case 'synced':
|
|
19
21
|
return chalk_1.default.green('✓');
|
|
20
22
|
case 'new':
|
|
@@ -29,6 +31,8 @@ function statusIcon(status) {
|
|
|
29
31
|
}
|
|
30
32
|
function statusLabel(status) {
|
|
31
33
|
switch (status) {
|
|
34
|
+
case 'draft':
|
|
35
|
+
return chalk_1.default.magenta('draft');
|
|
32
36
|
case 'synced':
|
|
33
37
|
return chalk_1.default.green.bold('synced');
|
|
34
38
|
case 'new':
|
package/dist/ui/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":";;;;;AAGA,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":";;;;;AAGA,gCAeC;AAED,kCAeC;AAED,8CAkCC;AAED,0BAEC;AAED,0BAEC;AAED,0BAEC;AAED,sBAEC;AAED,oBAEC;AA3FD,kDAA0B;AAC1B,4DAA+B;AAE/B,SAAgB,UAAU,CAAC,MAAc;IACvC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,eAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,KAAK,QAAQ;YACX,OAAO,eA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O,IAAI,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,SAAgB,IAAI,CAAC,IAAY;IAC/B,OAAO,eAAK,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applica-software-guru/sdd",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
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
|
"build": "tsc"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@applica-software-guru/sdd-core": "^1.
|
|
15
|
+
"@applica-software-guru/sdd-core": "^1.4.0",
|
|
16
16
|
"@inquirer/prompts": "^7.0.0",
|
|
17
17
|
"chalk": "^4.1.2",
|
|
18
18
|
"cli-table3": "^0.6.5",
|
package/src/commands/apply.ts
CHANGED
|
@@ -16,7 +16,7 @@ export function registerApply(program: Command): void {
|
|
|
16
16
|
|
|
17
17
|
const prompt = await sdd.applyPrompt();
|
|
18
18
|
if (!prompt) {
|
|
19
|
-
console.log(info('Nothing to apply — no open bugs, pending CRs, or pending files.'));
|
|
19
|
+
console.log(info('Nothing to apply — no drafts, open bugs, pending CRs, or pending files.'));
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
package/src/commands/bug.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { heading, info } from '../ui/format.js';
|
|
|
5
5
|
|
|
6
6
|
function statusLabel(status: string): string {
|
|
7
7
|
switch (status) {
|
|
8
|
+
case 'draft':
|
|
9
|
+
return chalk.magenta('draft');
|
|
8
10
|
case 'open':
|
|
9
11
|
return chalk.yellow('open');
|
|
10
12
|
case 'resolved':
|
|
@@ -33,7 +35,7 @@ export function registerBug(program: Command): void {
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
for (const b of bugs) {
|
|
36
|
-
const icon = b.frontmatter.status === 'resolved' ? chalk.green(' ✓') : chalk.yellow(' ●');
|
|
38
|
+
const icon = b.frontmatter.status === 'resolved' ? chalk.green(' ✓') : b.frontmatter.status === 'draft' ? chalk.magenta(' ◇') : chalk.yellow(' ●');
|
|
37
39
|
console.log(`${icon} ${chalk.white(b.relativePath)} ${chalk.dim(`[${statusLabel(b.frontmatter.status)}]`)} ${chalk.cyan(b.frontmatter.title)}`);
|
|
38
40
|
}
|
|
39
41
|
console.log('');
|
package/src/commands/cr.ts
CHANGED
|
@@ -6,7 +6,9 @@ import { heading, info } from '../ui/format.js';
|
|
|
6
6
|
function statusLabel(status: string): string {
|
|
7
7
|
switch (status) {
|
|
8
8
|
case 'draft':
|
|
9
|
-
return chalk.
|
|
9
|
+
return chalk.magenta('draft');
|
|
10
|
+
case 'pending':
|
|
11
|
+
return chalk.yellow('pending');
|
|
10
12
|
case 'applied':
|
|
11
13
|
return chalk.green('applied');
|
|
12
14
|
default:
|
|
@@ -33,7 +35,7 @@ export function registerCR(program: Command): void {
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
for (const cr of crs) {
|
|
36
|
-
const icon = cr.frontmatter.status === 'applied' ? chalk.green(' ✓') : chalk.yellow(' ●');
|
|
38
|
+
const icon = cr.frontmatter.status === 'applied' ? chalk.green(' ✓') : cr.frontmatter.status === 'draft' ? chalk.magenta(' ◇') : chalk.yellow(' ●');
|
|
37
39
|
console.log(`${icon} ${chalk.white(cr.relativePath)} ${chalk.dim(`[${statusLabel(cr.frontmatter.status)}]`)} ${chalk.cyan(cr.frontmatter.title)}`);
|
|
38
40
|
}
|
|
39
41
|
console.log('');
|
|
@@ -72,7 +74,7 @@ export function registerCR(program: Command): void {
|
|
|
72
74
|
console.log(heading('Mark CR Applied'));
|
|
73
75
|
|
|
74
76
|
if (marked.length === 0) {
|
|
75
|
-
console.log(info('No
|
|
77
|
+
console.log(info('No pending change requests to mark.\n'));
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { SDD } from '@applica-software-guru/sdd-core';
|
|
4
|
+
import { heading, success, info } from '../ui/format.js';
|
|
5
|
+
|
|
6
|
+
export function registerMarkDraftsEnriched(program: Command): void {
|
|
7
|
+
program
|
|
8
|
+
.command('mark-drafts-enriched [files...]')
|
|
9
|
+
.description('Mark draft elements as enriched (docs → new, CRs → pending, bugs → open)')
|
|
10
|
+
.action(async (files: string[]) => {
|
|
11
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
12
|
+
const marked = await sdd.markDraftsEnriched(files.length > 0 ? files : undefined);
|
|
13
|
+
|
|
14
|
+
console.log(heading('Mark Drafts Enriched'));
|
|
15
|
+
|
|
16
|
+
if (marked.length === 0) {
|
|
17
|
+
console.log(info('No draft elements to mark.\n'));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
for (const f of marked) {
|
|
22
|
+
console.log(success(f));
|
|
23
|
+
}
|
|
24
|
+
console.log(chalk.dim(`\n ${marked.length} element(s) marked as enriched.\n`));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { SDD } from '@applica-software-guru/sdd-core';
|
|
4
|
+
import { heading, success, warning, info } from '../ui/format.js';
|
|
5
|
+
|
|
6
|
+
export function registerPull(program: Command): void {
|
|
7
|
+
program
|
|
8
|
+
.command('pull')
|
|
9
|
+
.description('Pull documents, CRs, and bugs from remote')
|
|
10
|
+
.option('--docs-only', 'Only pull documents')
|
|
11
|
+
.option('--crs-only', 'Only pull change requests')
|
|
12
|
+
.option('--bugs-only', 'Only pull bugs')
|
|
13
|
+
.action(async (options: { docsOnly?: boolean; crsOnly?: boolean; bugsOnly?: boolean }) => {
|
|
14
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
15
|
+
const pullAll = !options.docsOnly && !options.crsOnly && !options.bugsOnly;
|
|
16
|
+
|
|
17
|
+
console.log(heading('Pull from Remote'));
|
|
18
|
+
|
|
19
|
+
// Pull documents
|
|
20
|
+
if (pullAll || options.docsOnly) {
|
|
21
|
+
console.log(chalk.dim(' Pulling documents...'));
|
|
22
|
+
const result = await sdd.pull();
|
|
23
|
+
|
|
24
|
+
if (result.created.length > 0) {
|
|
25
|
+
for (const p of result.created) {
|
|
26
|
+
console.log(chalk.cyan(` + ${p}`));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (result.updated.length > 0) {
|
|
30
|
+
for (const p of result.updated) {
|
|
31
|
+
console.log(chalk.yellow(` ~ ${p}`));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (result.conflicts.length > 0) {
|
|
35
|
+
for (const c of result.conflicts) {
|
|
36
|
+
console.log(warning(`${c.path} — ${c.reason} (local: v${c.localVersion}, remote: v${c.remoteVersion})`));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const total = result.created.length + result.updated.length;
|
|
41
|
+
if (total > 0) {
|
|
42
|
+
console.log(success(`${result.created.length} created, ${result.updated.length} updated`));
|
|
43
|
+
} else if (result.conflicts.length === 0) {
|
|
44
|
+
console.log(info('Documents up to date.'));
|
|
45
|
+
}
|
|
46
|
+
console.log('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Pull CRs
|
|
50
|
+
if (pullAll || options.crsOnly) {
|
|
51
|
+
console.log(chalk.dim(' Pulling change requests...'));
|
|
52
|
+
const crResult = await sdd.pullCRs();
|
|
53
|
+
if (crResult.created > 0 || crResult.updated > 0) {
|
|
54
|
+
console.log(success(`${crResult.created} created, ${crResult.updated} updated`));
|
|
55
|
+
} else {
|
|
56
|
+
console.log(info('No pending change requests on remote.'));
|
|
57
|
+
}
|
|
58
|
+
console.log('');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Pull bugs
|
|
62
|
+
if (pullAll || options.bugsOnly) {
|
|
63
|
+
console.log(chalk.dim(' Pulling bugs...'));
|
|
64
|
+
const bugResult = await sdd.pullBugs();
|
|
65
|
+
if (bugResult.created > 0 || bugResult.updated > 0) {
|
|
66
|
+
console.log(success(`${bugResult.created} created, ${bugResult.updated} updated`));
|
|
67
|
+
} else {
|
|
68
|
+
console.log(info('No open bugs on remote.'));
|
|
69
|
+
}
|
|
70
|
+
console.log('');
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { SDD } from '@applica-software-guru/sdd-core';
|
|
4
|
+
import { heading, success, info } from '../ui/format.js';
|
|
5
|
+
|
|
6
|
+
export function registerPush(program: Command): void {
|
|
7
|
+
program
|
|
8
|
+
.command('push [files...]')
|
|
9
|
+
.description('Push pending documents to remote')
|
|
10
|
+
.option('--all', 'Push all files including synced')
|
|
11
|
+
.action(async (files: string[], options: { all?: boolean }) => {
|
|
12
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
13
|
+
|
|
14
|
+
console.log(heading('Push to Remote'));
|
|
15
|
+
console.log(chalk.dim(' Pushing documents...'));
|
|
16
|
+
|
|
17
|
+
const paths = files.length > 0 ? files : undefined;
|
|
18
|
+
const result = await sdd.push(paths, { all: options.all });
|
|
19
|
+
|
|
20
|
+
if (result.pushed.length === 0) {
|
|
21
|
+
console.log(info('No pending files to push.\n'));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
for (const p of result.pushed) {
|
|
26
|
+
console.log(chalk.green(` ✓ ${p}`));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log(success(`${result.created} created, ${result.updated} updated on remote`));
|
|
31
|
+
console.log(chalk.dim(` ${result.pushed.length} file(s) pushed and marked as synced.\n`));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { input, password } from '@inquirer/prompts';
|
|
4
|
+
import { SDD, readConfig, writeConfig } from '@applica-software-guru/sdd-core';
|
|
5
|
+
import { heading, success, info, warning, error as errorFmt } from '../ui/format.js';
|
|
6
|
+
|
|
7
|
+
export function registerRemote(program: Command): void {
|
|
8
|
+
const remote = program
|
|
9
|
+
.command('remote')
|
|
10
|
+
.description('Manage remote sync with SDD Flow');
|
|
11
|
+
|
|
12
|
+
remote
|
|
13
|
+
.command('init')
|
|
14
|
+
.description('Configure remote API connection')
|
|
15
|
+
.option('--url <url>', 'SDD Flow API base URL')
|
|
16
|
+
.option('--api-key <key>', 'API key (prefer SDD_API_KEY env var)')
|
|
17
|
+
.action(async (options: { url?: string; apiKey?: string }) => {
|
|
18
|
+
const root = process.cwd();
|
|
19
|
+
const config = await readConfig(root);
|
|
20
|
+
|
|
21
|
+
const url =
|
|
22
|
+
options.url ??
|
|
23
|
+
(await input({
|
|
24
|
+
message: 'SDD Flow API URL',
|
|
25
|
+
default: config.remote?.url ?? 'https://sdd.applica.guru/api/v1',
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const apiKey =
|
|
29
|
+
options.apiKey ??
|
|
30
|
+
(await password({
|
|
31
|
+
message: 'API key (leave empty to use SDD_API_KEY env var)',
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
config.remote = {
|
|
35
|
+
url: url.replace(/\/+$/, ''),
|
|
36
|
+
};
|
|
37
|
+
if (apiKey) {
|
|
38
|
+
config.remote['api-key'] = apiKey;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
await writeConfig(root, config);
|
|
42
|
+
console.log(success('Remote configuration saved to .sdd/config.yaml'));
|
|
43
|
+
|
|
44
|
+
if (!apiKey && !process.env.SDD_API_KEY) {
|
|
45
|
+
console.log(warning('No API key found. Set SDD_API_KEY environment variable or re-run with --api-key.'));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Test connection
|
|
50
|
+
console.log(info('Testing connection...'));
|
|
51
|
+
try {
|
|
52
|
+
const sdd = new SDD({ root });
|
|
53
|
+
const status = await sdd.remoteStatus();
|
|
54
|
+
if (status.connected) {
|
|
55
|
+
console.log(success(`Connected! Remote has ${status.remoteDocs} document(s).`));
|
|
56
|
+
} else {
|
|
57
|
+
console.log(errorFmt('Could not connect to remote. Check URL and API key.'));
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
console.log(errorFmt(`Connection failed: ${(err as Error).message}`));
|
|
61
|
+
}
|
|
62
|
+
console.log('');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
remote
|
|
66
|
+
.command('status')
|
|
67
|
+
.description('Show remote sync status')
|
|
68
|
+
.action(async () => {
|
|
69
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
70
|
+
const status = await sdd.remoteStatus();
|
|
71
|
+
|
|
72
|
+
console.log(heading('Remote Status'));
|
|
73
|
+
|
|
74
|
+
if (!status.configured) {
|
|
75
|
+
console.log(info('Remote not configured. Run "sdd remote init" to set up.\n'));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log(` ${chalk.dim('URL:')} ${chalk.white(status.url)}`);
|
|
80
|
+
console.log(
|
|
81
|
+
` ${chalk.dim('Connection:')} ${
|
|
82
|
+
status.connected ? chalk.green.bold('connected') : chalk.red.bold('disconnected')
|
|
83
|
+
}`,
|
|
84
|
+
);
|
|
85
|
+
console.log(` ${chalk.dim('Local pending:')} ${chalk.yellow.bold(String(status.localPending))} file(s)`);
|
|
86
|
+
if (status.connected) {
|
|
87
|
+
console.log(` ${chalk.dim('Remote docs:')} ${chalk.cyan.bold(String(status.remoteDocs))} document(s)`);
|
|
88
|
+
}
|
|
89
|
+
console.log('');
|
|
90
|
+
});
|
|
91
|
+
}
|
package/src/commands/status.ts
CHANGED
|
@@ -18,6 +18,7 @@ export function registerStatus(program: Command): void {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const counts = {
|
|
21
|
+
draft: result.files.filter((f) => f.status === 'draft').length,
|
|
21
22
|
new: result.files.filter((f) => f.status === 'new').length,
|
|
22
23
|
changed: result.files.filter((f) => f.status === 'changed').length,
|
|
23
24
|
deleted: result.files.filter((f) => f.status === 'deleted').length,
|
|
@@ -29,6 +30,7 @@ export function registerStatus(program: Command): void {
|
|
|
29
30
|
console.log('');
|
|
30
31
|
|
|
31
32
|
const parts: string[] = [];
|
|
33
|
+
if (counts.draft) parts.push(chalk.magenta.bold(`${counts.draft} draft`));
|
|
32
34
|
if (counts.new) parts.push(chalk.cyan.bold(`${counts.new} new`));
|
|
33
35
|
if (counts.changed) parts.push(chalk.yellow.bold(`${counts.changed} changed`));
|
|
34
36
|
if (counts.deleted) parts.push(chalk.red.bold(`${counts.deleted} deleted`));
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,10 @@ import { registerApply } from "./commands/apply.js";
|
|
|
13
13
|
import { registerAdapters } from "./commands/adapters.js";
|
|
14
14
|
import { registerUI } from "./commands/ui.js";
|
|
15
15
|
import { registerUpgrade } from "./commands/upgrade.js";
|
|
16
|
+
import { registerRemote } from "./commands/remote.js";
|
|
17
|
+
import { registerPull } from "./commands/pull.js";
|
|
18
|
+
import { registerPush } from "./commands/push.js";
|
|
19
|
+
import { registerMarkDraftsEnriched } from "./commands/mark-drafts-enriched.js";
|
|
16
20
|
|
|
17
21
|
const packageRequire = createRequire(__filename);
|
|
18
22
|
const packageJson = packageRequire("../package.json") as { version: string };
|
|
@@ -36,6 +40,10 @@ registerApply(program);
|
|
|
36
40
|
registerAdapters(program);
|
|
37
41
|
registerUI(program);
|
|
38
42
|
registerUpgrade(program);
|
|
43
|
+
registerRemote(program);
|
|
44
|
+
registerPull(program);
|
|
45
|
+
registerPush(program);
|
|
46
|
+
registerMarkDraftsEnriched(program);
|
|
39
47
|
|
|
40
48
|
program.parseAsync().catch((err) => {
|
|
41
49
|
console.error(err.message);
|
package/src/ui/format.ts
CHANGED
|
@@ -3,6 +3,8 @@ import Table from 'cli-table3';
|
|
|
3
3
|
|
|
4
4
|
export function statusIcon(status: string): string {
|
|
5
5
|
switch (status) {
|
|
6
|
+
case 'draft':
|
|
7
|
+
return chalk.magenta('◇');
|
|
6
8
|
case 'synced':
|
|
7
9
|
return chalk.green('✓');
|
|
8
10
|
case 'new':
|
|
@@ -18,6 +20,8 @@ export function statusIcon(status: string): string {
|
|
|
18
20
|
|
|
19
21
|
export function statusLabel(status: string): string {
|
|
20
22
|
switch (status) {
|
|
23
|
+
case 'draft':
|
|
24
|
+
return chalk.magenta('draft');
|
|
21
25
|
case 'synced':
|
|
22
26
|
return chalk.green.bold('synced');
|
|
23
27
|
case 'new':
|