bemadralphy 2.0.4 → 2.0.5
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/beads/adapter.js +42 -15
- package/dist/beads/adapter.js.map +1 -1
- package/dist/cli.js +0 -0
- package/package.json +1 -1
package/dist/beads/adapter.js
CHANGED
|
@@ -5,32 +5,59 @@ export async function storiesToBeads(storyPaths) {
|
|
|
5
5
|
for (const storyPath of storyPaths) {
|
|
6
6
|
const contents = await readFile(storyPath, 'utf-8');
|
|
7
7
|
const lines = contents.split(/\r?\n/);
|
|
8
|
-
let
|
|
8
|
+
let currentTask = null;
|
|
9
|
+
const flushTask = () => {
|
|
10
|
+
if (currentTask) {
|
|
11
|
+
tasks.push({
|
|
12
|
+
storyId: currentTask.storyId,
|
|
13
|
+
title: currentTask.title,
|
|
14
|
+
description: currentTask.descriptionLines.length > 0
|
|
15
|
+
? currentTask.descriptionLines.join('\n').trim()
|
|
16
|
+
: 'No implementation steps provided.',
|
|
17
|
+
dependencies: currentTask.dependencies,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
9
21
|
for (const line of lines) {
|
|
22
|
+
// New story header (### Story X.Y: Title)
|
|
10
23
|
if (line.startsWith('### ')) {
|
|
11
|
-
|
|
24
|
+
flushTask();
|
|
25
|
+
currentTask = {
|
|
12
26
|
storyId: `story-${counter++}`,
|
|
13
27
|
title: line.replace(/^###\s+/, ''),
|
|
14
|
-
|
|
15
|
-
dependencies:
|
|
16
|
-
}
|
|
17
|
-
|
|
28
|
+
descriptionLines: [],
|
|
29
|
+
dependencies: [],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// New epic header (## Epic X) - flush but don't create task for the epic itself
|
|
33
|
+
else if (line.startsWith('## ')) {
|
|
34
|
+
flushTask();
|
|
35
|
+
currentTask = null;
|
|
18
36
|
}
|
|
37
|
+
// Dependency line
|
|
19
38
|
else if (line.trim().toLowerCase().startsWith('- depends on:')) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
if (currentTask) {
|
|
40
|
+
const value = line.split(':', 2)[1]?.trim() ?? '';
|
|
41
|
+
if (value) {
|
|
42
|
+
const parsed = value
|
|
43
|
+
.split(',')
|
|
44
|
+
.map((entry) => entry.trim())
|
|
45
|
+
.filter(Boolean);
|
|
46
|
+
for (const dependency of parsed) {
|
|
47
|
+
if (!currentTask.dependencies.includes(dependency)) {
|
|
48
|
+
currentTask.dependencies.push(dependency);
|
|
49
|
+
}
|
|
29
50
|
}
|
|
30
51
|
}
|
|
31
52
|
}
|
|
32
53
|
}
|
|
54
|
+
// Any other content under a story - capture it as description
|
|
55
|
+
else if (currentTask && line.trim()) {
|
|
56
|
+
currentTask.descriptionLines.push(line);
|
|
57
|
+
}
|
|
33
58
|
}
|
|
59
|
+
// Don't forget the last task
|
|
60
|
+
flushTask();
|
|
34
61
|
}
|
|
35
62
|
return tasks;
|
|
36
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/beads/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAS5C,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,UAAoB;IACvD,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/beads/adapter.ts"],"names":[],"mapp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