@backlog-md/core 0.2.1 → 0.3.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/core/Core.d.ts +130 -1
- package/dist/core/Core.d.ts.map +1 -1
- package/dist/core/Core.js +541 -35
- package/dist/core/Core.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/markdown/index.d.ts +56 -1
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +174 -0
- package/dist/markdown/index.js.map +1 -1
- package/dist/types/index.d.ts +52 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/milestones.d.ts +65 -0
- package/dist/utils/milestones.d.ts.map +1 -0
- package/dist/utils/milestones.js +191 -0
- package/dist/utils/milestones.js.map +1 -0
- package/package.json +1 -1
package/dist/core/Core.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* by accepting adapter implementations for I/O operations.
|
|
6
6
|
*/
|
|
7
7
|
import type { FileSystemAdapter } from "@principal-ai/repository-abstraction";
|
|
8
|
-
import type { Task, BacklogConfig, TaskListFilter, PaginationOptions, PaginatedResult, PaginatedTasksByStatus, PaginatedTasksBySource, TaskIndexEntry, SourcePaginationOptions } from "../types";
|
|
8
|
+
import type { Task, BacklogConfig, TaskListFilter, PaginationOptions, PaginatedResult, PaginatedTasksByStatus, PaginatedTasksBySource, TaskIndexEntry, SourcePaginationOptions, MilestoneSummary, TaskCreateInput, TaskUpdateInput } from "../types";
|
|
9
|
+
import type { Milestone } from "../types";
|
|
9
10
|
/**
|
|
10
11
|
* Options for initializing a new Backlog.md project
|
|
11
12
|
*/
|
|
@@ -31,6 +32,24 @@ export interface CoreOptions {
|
|
|
31
32
|
fs: FileSystemAdapter;
|
|
32
33
|
};
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Input for creating a new milestone
|
|
37
|
+
*/
|
|
38
|
+
export interface MilestoneCreateInput {
|
|
39
|
+
/** Milestone title (required) */
|
|
40
|
+
title: string;
|
|
41
|
+
/** Optional description */
|
|
42
|
+
description?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Input for updating an existing milestone
|
|
46
|
+
*/
|
|
47
|
+
export interface MilestoneUpdateInput {
|
|
48
|
+
/** New title (optional) */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** New description (optional) */
|
|
51
|
+
description?: string;
|
|
52
|
+
}
|
|
34
53
|
/**
|
|
35
54
|
* Core class for Backlog.md operations
|
|
36
55
|
*
|
|
@@ -169,6 +188,65 @@ export declare class Core {
|
|
|
169
188
|
* The Map preserves the order of statuses from config.
|
|
170
189
|
*/
|
|
171
190
|
getTasksByStatus(): Map<string, Task[]>;
|
|
191
|
+
/**
|
|
192
|
+
* Get tasks grouped by milestone
|
|
193
|
+
*
|
|
194
|
+
* Returns a MilestoneSummary with:
|
|
195
|
+
* - milestones: List of milestone IDs in display order
|
|
196
|
+
* - buckets: Array of MilestoneBucket with tasks, progress, status counts
|
|
197
|
+
*
|
|
198
|
+
* The first bucket is always "Tasks without milestone".
|
|
199
|
+
* Each bucket includes progress percentage based on done status.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const summary = core.getTasksByMilestone();
|
|
204
|
+
* for (const bucket of summary.buckets) {
|
|
205
|
+
* console.log(`${bucket.label}: ${bucket.progress}% complete`);
|
|
206
|
+
* console.log(` ${bucket.doneCount}/${bucket.total} tasks done`);
|
|
207
|
+
* }
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
getTasksByMilestone(): MilestoneSummary;
|
|
211
|
+
/**
|
|
212
|
+
* Get the milestones directory path
|
|
213
|
+
*/
|
|
214
|
+
private getMilestonesDir;
|
|
215
|
+
/**
|
|
216
|
+
* List all milestones from the milestones directory
|
|
217
|
+
*
|
|
218
|
+
* @returns Array of Milestone objects sorted by ID
|
|
219
|
+
*/
|
|
220
|
+
listMilestones(): Promise<Milestone[]>;
|
|
221
|
+
/**
|
|
222
|
+
* Load a single milestone by ID
|
|
223
|
+
*
|
|
224
|
+
* @param id - Milestone ID (e.g., "m-0")
|
|
225
|
+
* @returns Milestone or null if not found
|
|
226
|
+
*/
|
|
227
|
+
loadMilestone(id: string): Promise<Milestone | null>;
|
|
228
|
+
/**
|
|
229
|
+
* Create a new milestone
|
|
230
|
+
*
|
|
231
|
+
* @param input - Milestone creation input
|
|
232
|
+
* @returns Created milestone
|
|
233
|
+
*/
|
|
234
|
+
createMilestone(input: MilestoneCreateInput): Promise<Milestone>;
|
|
235
|
+
/**
|
|
236
|
+
* Update an existing milestone
|
|
237
|
+
*
|
|
238
|
+
* @param id - Milestone ID to update
|
|
239
|
+
* @param input - Fields to update
|
|
240
|
+
* @returns Updated milestone or null if not found
|
|
241
|
+
*/
|
|
242
|
+
updateMilestone(id: string, input: MilestoneUpdateInput): Promise<Milestone | null>;
|
|
243
|
+
/**
|
|
244
|
+
* Delete a milestone
|
|
245
|
+
*
|
|
246
|
+
* @param id - Milestone ID to delete
|
|
247
|
+
* @returns true if deleted, false if not found
|
|
248
|
+
*/
|
|
249
|
+
deleteMilestone(id: string): Promise<boolean>;
|
|
172
250
|
/**
|
|
173
251
|
* Get a single task by ID
|
|
174
252
|
*
|
|
@@ -208,5 +286,56 @@ export declare class Core {
|
|
|
208
286
|
private ensureInitialized;
|
|
209
287
|
private applyFilters;
|
|
210
288
|
private loadTasksFromDirectory;
|
|
289
|
+
/**
|
|
290
|
+
* Add a task ID to a milestone's tasks array
|
|
291
|
+
*
|
|
292
|
+
* @param taskId - Task ID to add
|
|
293
|
+
* @param milestoneId - Milestone ID to update
|
|
294
|
+
*/
|
|
295
|
+
private addTaskToMilestone;
|
|
296
|
+
/**
|
|
297
|
+
* Remove a task ID from a milestone's tasks array
|
|
298
|
+
*
|
|
299
|
+
* @param taskId - Task ID to remove
|
|
300
|
+
* @param milestoneId - Milestone ID to update
|
|
301
|
+
*/
|
|
302
|
+
private removeTaskFromMilestone;
|
|
303
|
+
/**
|
|
304
|
+
* Write a milestone to disk
|
|
305
|
+
*/
|
|
306
|
+
private writeMilestoneFile;
|
|
307
|
+
/**
|
|
308
|
+
* Get the tasks directory path
|
|
309
|
+
*/
|
|
310
|
+
private getTasksDir;
|
|
311
|
+
/**
|
|
312
|
+
* Create a new task
|
|
313
|
+
*
|
|
314
|
+
* @param input - Task creation input
|
|
315
|
+
* @returns Created task
|
|
316
|
+
*/
|
|
317
|
+
createTask(input: TaskCreateInput): Promise<Task>;
|
|
318
|
+
/**
|
|
319
|
+
* Update an existing task
|
|
320
|
+
*
|
|
321
|
+
* @param id - Task ID to update
|
|
322
|
+
* @param input - Fields to update
|
|
323
|
+
* @returns Updated task or null if not found
|
|
324
|
+
*/
|
|
325
|
+
updateTask(id: string, input: TaskUpdateInput): Promise<Task | null>;
|
|
326
|
+
/**
|
|
327
|
+
* Delete a task
|
|
328
|
+
*
|
|
329
|
+
* @param id - Task ID to delete
|
|
330
|
+
* @returns true if deleted, false if not found
|
|
331
|
+
*/
|
|
332
|
+
deleteTask(id: string): Promise<boolean>;
|
|
333
|
+
/**
|
|
334
|
+
* Load specific tasks by their IDs (for lazy loading milestone tasks)
|
|
335
|
+
*
|
|
336
|
+
* @param ids - Array of task IDs to load
|
|
337
|
+
* @returns Array of loaded tasks (missing tasks excluded)
|
|
338
|
+
*/
|
|
339
|
+
loadTasksByIds(ids: string[]): Promise<Task[]>;
|
|
211
340
|
}
|
|
212
341
|
//# sourceMappingURL=Core.d.ts.map
|
package/dist/core/Core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Core.d.ts","sourceRoot":"","sources":["../../src/core/Core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EACV,IAAI,EACJ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,uBAAuB,
|
|
1
|
+
{"version":3,"file":"Core.d.ts","sourceRoot":"","sources":["../../src/core/Core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EACV,IAAI,EACJ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,UAAU,CAAC;AAkBlB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IAEpB,iDAAiD;IACjD,QAAQ,EAAE;QACR,oCAAoC;QACpC,EAAE,EAAE,iBAAiB,CAAC;KACvB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,2B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