@abdullahsahmad/work-kit 0.1.3 → 0.1.4
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/cli/src/observer/data.ts +23 -9
- package/package.json +1 -1
package/cli/src/observer/data.ts
CHANGED
|
@@ -174,20 +174,34 @@ export function collectCompletedItems(mainRepoRoot: string): CompletedItemView[]
|
|
|
174
174
|
|
|
175
175
|
const items: CompletedItemView[] = [];
|
|
176
176
|
// Parse markdown table or list entries
|
|
177
|
-
//
|
|
177
|
+
// Format: | Date | Slug | PR | Status | Phases |
|
|
178
178
|
// or list format: - slug (#PR) - date - phases
|
|
179
179
|
const lines = content.split("\n");
|
|
180
180
|
for (const line of lines) {
|
|
181
|
-
// Try table
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
181
|
+
// Try 5-column table: | Date | Slug | PR | Status | Phases |
|
|
182
|
+
const table5Match = line.match(/^\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|/);
|
|
183
|
+
if (table5Match) {
|
|
184
|
+
const col1 = table5Match[1].trim();
|
|
185
|
+
if (col1 === "Date" || col1 === "---" || col1.startsWith("-")) continue; // skip header
|
|
186
|
+
items.push({
|
|
187
|
+
slug: table5Match[2].trim(),
|
|
188
|
+
pr: table5Match[3].trim() !== "n/a" ? table5Match[3].trim() : undefined,
|
|
189
|
+
completedAt: col1,
|
|
190
|
+
phases: table5Match[5].trim(),
|
|
191
|
+
});
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Try 4-column table: | slug | PR | date | phases |
|
|
196
|
+
const table4Match = line.match(/^\|\s*(.+?)\s*\|\s*(#?\d+)?\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|/);
|
|
197
|
+
if (table4Match) {
|
|
198
|
+
const slug = table4Match[1].trim();
|
|
199
|
+
if (slug === "Slug" || slug === "---" || slug.startsWith("-")) continue;
|
|
186
200
|
items.push({
|
|
187
201
|
slug,
|
|
188
|
-
pr:
|
|
189
|
-
completedAt:
|
|
190
|
-
phases:
|
|
202
|
+
pr: table4Match[2]?.trim() || undefined,
|
|
203
|
+
completedAt: table4Match[3].trim(),
|
|
204
|
+
phases: table4Match[4].trim(),
|
|
191
205
|
});
|
|
192
206
|
continue;
|
|
193
207
|
}
|