project-roadmap-tracking 0.1.0 → 0.2.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.
Files changed (58) hide show
  1. package/README.md +293 -24
  2. package/dist/commands/add.d.ts +2 -0
  3. package/dist/commands/add.js +39 -31
  4. package/dist/commands/complete.d.ts +2 -0
  5. package/dist/commands/complete.js +35 -12
  6. package/dist/commands/init.d.ts +1 -0
  7. package/dist/commands/init.js +63 -46
  8. package/dist/commands/list.d.ts +3 -0
  9. package/dist/commands/list.js +65 -62
  10. package/dist/commands/pass-test.d.ts +4 -1
  11. package/dist/commands/pass-test.js +36 -13
  12. package/dist/commands/show.d.ts +4 -1
  13. package/dist/commands/show.js +38 -59
  14. package/dist/commands/update.d.ts +3 -0
  15. package/dist/commands/update.js +77 -32
  16. package/dist/commands/validate.d.ts +4 -1
  17. package/dist/commands/validate.js +74 -32
  18. package/dist/errors/base.error.d.ts +21 -0
  19. package/dist/errors/base.error.js +35 -0
  20. package/dist/errors/circular-dependency.error.d.ts +8 -0
  21. package/dist/errors/circular-dependency.error.js +13 -0
  22. package/dist/errors/config-not-found.error.d.ts +7 -0
  23. package/dist/errors/config-not-found.error.js +12 -0
  24. package/dist/errors/index.d.ts +16 -0
  25. package/dist/errors/index.js +26 -0
  26. package/dist/errors/invalid-task.error.d.ts +7 -0
  27. package/dist/errors/invalid-task.error.js +12 -0
  28. package/dist/errors/roadmap-not-found.error.d.ts +7 -0
  29. package/dist/errors/roadmap-not-found.error.js +12 -0
  30. package/dist/errors/task-not-found.error.d.ts +7 -0
  31. package/dist/errors/task-not-found.error.js +12 -0
  32. package/dist/errors/validation.error.d.ts +16 -0
  33. package/dist/errors/validation.error.js +16 -0
  34. package/dist/repositories/config.repository.d.ts +76 -0
  35. package/dist/repositories/config.repository.js +282 -0
  36. package/dist/repositories/index.d.ts +2 -0
  37. package/dist/repositories/index.js +2 -0
  38. package/dist/repositories/roadmap.repository.d.ts +82 -0
  39. package/dist/repositories/roadmap.repository.js +201 -0
  40. package/dist/services/display.service.d.ts +182 -0
  41. package/dist/services/display.service.js +320 -0
  42. package/dist/services/error-handler.service.d.ts +114 -0
  43. package/dist/services/error-handler.service.js +169 -0
  44. package/dist/services/roadmap.service.d.ts +142 -0
  45. package/dist/services/roadmap.service.js +269 -0
  46. package/dist/services/task-dependency.service.d.ts +210 -0
  47. package/dist/services/task-dependency.service.js +371 -0
  48. package/dist/services/task-query.service.d.ts +123 -0
  49. package/dist/services/task-query.service.js +259 -0
  50. package/dist/services/task.service.d.ts +155 -0
  51. package/dist/services/task.service.js +233 -0
  52. package/dist/util/read-config.js +12 -2
  53. package/dist/util/read-roadmap.js +12 -2
  54. package/dist/util/types.d.ts +5 -0
  55. package/dist/util/update-task.js +2 -1
  56. package/dist/util/validate-task.js +6 -5
  57. package/oclif.manifest.json +128 -5
  58. package/package.json +28 -4
@@ -1,7 +1,8 @@
1
+ import { TaskNotFoundError } from '../errors/index.js';
1
2
  export async function updateTaskInRoadmap(roadmap, taskId, updates) {
2
3
  const taskIndex = roadmap.tasks.findIndex((task) => task.id === taskId);
3
4
  if (taskIndex === -1) {
4
- throw new Error(`Task with ID ${taskId} not found`);
5
+ throw new TaskNotFoundError(taskId);
5
6
  }
6
7
  const updatedTask = {
7
8
  ...roadmap.tasks[taskIndex],
@@ -1,17 +1,18 @@
1
+ import { InvalidTaskError } from '../errors/index.js';
1
2
  export function validateTask(task, { skipID } = {}) {
2
3
  if (!skipID && !/^(B|F|I|P|R)-[0-9]{3}$/.test(task.id)) {
3
- throw new Error(`task ID ${task.id} is not valid. Must match format: [B|F|I|P|R]-[000-999]`);
4
+ throw new InvalidTaskError(`task ID ${task.id} is not valid. Must match format: [B|F|I|P|R]-[000-999]`, task.id, 'id');
4
5
  }
5
6
  if (!['bug', 'feature', 'improvement', 'planning', 'research'].includes(task.type)) {
6
- throw new Error(`task ${skipID ? '' : `ID ${task.id}`} has invalid type: ${task.type}`);
7
+ throw new InvalidTaskError(`task ${skipID ? '' : `ID ${task.id}`} has invalid type: ${task.type}`, skipID ? undefined : task.id, 'type');
7
8
  }
8
9
  if (!['high', 'low', 'medium'].includes(task.priority)) {
9
- throw new Error(`task ${skipID ? '' : `ID ${task.id}`} has invalid priority: ${task.priority}`);
10
+ throw new InvalidTaskError(`task ${skipID ? '' : `ID ${task.id}`} has invalid priority: ${task.priority}`, skipID ? undefined : task.id, 'priority');
10
11
  }
11
12
  if (!['completed', 'in-progress', 'not-started'].includes(task.status)) {
12
- throw new Error(`task ${skipID ? '' : `ID ${task.id}`} has invalid status: ${task.status}`);
13
+ throw new InvalidTaskError(`task ${skipID ? '' : `ID ${task.id}`} has invalid status: ${task.status}`, skipID ? undefined : task.id, 'status');
13
14
  }
14
15
  if (!task.details) {
15
- throw new Error(`task ${skipID ? '' : `ID ${task.id}`} must have details`);
16
+ throw new InvalidTaskError(`task ${skipID ? '' : `ID ${task.id}`} must have details`, skipID ? undefined : task.id, 'details');
16
17
  }
17
18
  }
@@ -23,6 +23,12 @@
23
23
  "multiple": false,
24
24
  "type": "option"
25
25
  },
26
+ "no-repo": {
27
+ "description": "use legacy direct file I/O instead of repository pattern",
28
+ "name": "no-repo",
29
+ "allowNo": false,
30
+ "type": "boolean"
31
+ },
26
32
  "priority": {
27
33
  "char": "p",
28
34
  "description": "priority of the task to add",
@@ -77,6 +83,13 @@
77
83
  "research"
78
84
  ],
79
85
  "type": "option"
86
+ },
87
+ "verbose": {
88
+ "char": "v",
89
+ "description": "show detailed error information including stack traces",
90
+ "name": "verbose",
91
+ "allowNo": false,
92
+ "type": "boolean"
80
93
  }
81
94
  },
82
95
  "hasDynamicHelp": false,
@@ -108,12 +121,25 @@
108
121
  "<%= config.bin %> <%= command.id %> F-001 --tests"
109
122
  ],
110
123
  "flags": {
124
+ "no-repo": {
125
+ "description": "use legacy direct file I/O instead of repository pattern",
126
+ "name": "no-repo",
127
+ "allowNo": false,
128
+ "type": "boolean"
129
+ },
111
130
  "tests": {
112
131
  "char": "t",
113
132
  "description": "mark task as passes-tests",
114
133
  "name": "tests",
115
134
  "allowNo": false,
116
135
  "type": "boolean"
136
+ },
137
+ "verbose": {
138
+ "char": "v",
139
+ "description": "show detailed error information including stack traces",
140
+ "name": "verbose",
141
+ "allowNo": false,
142
+ "type": "boolean"
117
143
  }
118
144
  },
119
145
  "hasDynamicHelp": false,
@@ -167,6 +193,13 @@
167
193
  "multiple": false,
168
194
  "type": "option"
169
195
  },
196
+ "verbose": {
197
+ "char": "v",
198
+ "description": "show detailed error information including stack traces",
199
+ "name": "verbose",
200
+ "allowNo": false,
201
+ "type": "boolean"
202
+ },
170
203
  "withSampleTasks": {
171
204
  "description": "include sample tasks in the initialized roadmap",
172
205
  "name": "withSampleTasks",
@@ -204,6 +237,12 @@
204
237
  "allowNo": false,
205
238
  "type": "boolean"
206
239
  },
240
+ "no-repo": {
241
+ "description": "use legacy direct file I/O instead of repository pattern",
242
+ "name": "no-repo",
243
+ "allowNo": false,
244
+ "type": "boolean"
245
+ },
207
246
  "priority": {
208
247
  "char": "p",
209
248
  "description": "filter tasks by priority (high, medium, low)",
@@ -245,6 +284,13 @@
245
284
  "not-started"
246
285
  ],
247
286
  "type": "option"
287
+ },
288
+ "verbose": {
289
+ "char": "v",
290
+ "description": "show detailed error information including stack traces",
291
+ "name": "verbose",
292
+ "allowNo": false,
293
+ "type": "boolean"
248
294
  }
249
295
  },
250
296
  "hasDynamicHelp": false,
@@ -255,6 +301,14 @@
255
301
  "pluginType": "core",
256
302
  "strict": true,
257
303
  "enableJsonFlag": false,
304
+ "priorityMap": {
305
+ "h": "high",
306
+ "high": "high",
307
+ "l": "low",
308
+ "low": "low",
309
+ "m": "medium",
310
+ "medium": "medium"
311
+ },
258
312
  "isESM": true,
259
313
  "relativePath": [
260
314
  "dist",
@@ -275,7 +329,21 @@
275
329
  "examples": [
276
330
  "<%= config.bin %> <%= command.id %> F-001"
277
331
  ],
278
- "flags": {},
332
+ "flags": {
333
+ "no-repo": {
334
+ "description": "use legacy direct file I/O instead of repository pattern",
335
+ "name": "no-repo",
336
+ "allowNo": false,
337
+ "type": "boolean"
338
+ },
339
+ "verbose": {
340
+ "char": "v",
341
+ "description": "show detailed error information including stack traces",
342
+ "name": "verbose",
343
+ "allowNo": false,
344
+ "type": "boolean"
345
+ }
346
+ },
279
347
  "hasDynamicHelp": false,
280
348
  "hiddenAliases": [],
281
349
  "id": "pass-test",
@@ -304,7 +372,21 @@
304
372
  "examples": [
305
373
  "<%= config.bin %> <%= command.id %> F-001"
306
374
  ],
307
- "flags": {},
375
+ "flags": {
376
+ "no-repo": {
377
+ "description": "use legacy direct file I/O instead of repository pattern",
378
+ "name": "no-repo",
379
+ "allowNo": false,
380
+ "type": "boolean"
381
+ },
382
+ "verbose": {
383
+ "char": "v",
384
+ "description": "show detailed error information including stack traces",
385
+ "name": "verbose",
386
+ "allowNo": false,
387
+ "type": "boolean"
388
+ }
389
+ },
308
390
  "hasDynamicHelp": false,
309
391
  "hiddenAliases": [],
310
392
  "id": "show",
@@ -349,6 +431,12 @@
349
431
  "multiple": false,
350
432
  "type": "option"
351
433
  },
434
+ "no-repo": {
435
+ "description": "use legacy direct file I/O instead of repository pattern",
436
+ "name": "no-repo",
437
+ "allowNo": false,
438
+ "type": "boolean"
439
+ },
352
440
  "notes": {
353
441
  "char": "n",
354
442
  "description": "append notes to the task",
@@ -381,6 +469,27 @@
381
469
  "false"
382
470
  ],
383
471
  "type": "option"
472
+ },
473
+ "type": {
474
+ "description": "update the task type (reassigns task ID and cascades to all references)",
475
+ "name": "type",
476
+ "hasDynamicHelp": false,
477
+ "multiple": false,
478
+ "options": [
479
+ "bug",
480
+ "feature",
481
+ "improvement",
482
+ "planning",
483
+ "research"
484
+ ],
485
+ "type": "option"
486
+ },
487
+ "verbose": {
488
+ "char": "v",
489
+ "description": "show detailed error information including stack traces",
490
+ "name": "verbose",
491
+ "allowNo": false,
492
+ "type": "boolean"
384
493
  }
385
494
  },
386
495
  "hasDynamicHelp": false,
@@ -401,11 +510,25 @@
401
510
  "validate": {
402
511
  "aliases": [],
403
512
  "args": {},
404
- "description": "describe the command here",
513
+ "description": "Validate roadmap structure, task data, and check for circular dependencies",
405
514
  "examples": [
406
515
  "<%= config.bin %> <%= command.id %>"
407
516
  ],
408
- "flags": {},
517
+ "flags": {
518
+ "no-repo": {
519
+ "description": "use legacy direct file I/O instead of repository pattern",
520
+ "name": "no-repo",
521
+ "allowNo": false,
522
+ "type": "boolean"
523
+ },
524
+ "verbose": {
525
+ "char": "v",
526
+ "description": "show detailed error information including stack traces",
527
+ "name": "verbose",
528
+ "allowNo": false,
529
+ "type": "boolean"
530
+ }
531
+ },
409
532
  "hasDynamicHelp": false,
410
533
  "hiddenAliases": [],
411
534
  "id": "validate",
@@ -422,5 +545,5 @@
422
545
  ]
423
546
  }
424
547
  },
425
- "version": "0.1.0"
548
+ "version": "0.2.1"
426
549
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "project-roadmap-tracking",
3
3
  "description": "CLI based project task tracking",
4
- "version": "0.1.0",
4
+ "version": "0.2.1",
5
5
  "author": "ZacharyEggert",
6
6
  "bin": {
7
7
  "prt": "./bin/run.js"
@@ -10,7 +10,9 @@
10
10
  "dependencies": {
11
11
  "@oclif/core": "^4",
12
12
  "@oclif/plugin-help": "^6",
13
- "@oclif/plugin-plugins": "^5"
13
+ "@oclif/plugin-plugins": "^5",
14
+ "ajv": "^8.12.0",
15
+ "chokidar": "^5.0.0"
14
16
  },
15
17
  "devDependencies": {
16
18
  "@eslint/compat": "^1",
@@ -19,14 +21,17 @@
19
21
  "@types/chai": "^4",
20
22
  "@types/mocha": "^10",
21
23
  "@types/node": "^18",
24
+ "c8": "^10.1.3",
22
25
  "chai": "^4",
23
26
  "eslint": "^9",
24
27
  "eslint-config-oclif": "^6",
25
28
  "eslint-config-prettier": "^10",
26
29
  "mocha": "^10",
27
30
  "oclif": "^4",
31
+ "prettier": "^3.8.1",
28
32
  "shx": "^0.3.3",
29
33
  "ts-node": "^10",
34
+ "tsx": "^4.21.0",
30
35
  "typescript": "^5"
31
36
  },
32
37
  "engines": {
@@ -39,7 +44,15 @@
39
44
  ],
40
45
  "homepage": "https://github.com/ZacharyEggert/project-roadmap-tracking",
41
46
  "keywords": [
42
- "oclif"
47
+ "oclif",
48
+ "cli",
49
+ "project",
50
+ "roadmap",
51
+ "tracking",
52
+ "tasks",
53
+ "productivity",
54
+ "management",
55
+ "prt"
43
56
  ],
44
57
  "license": "MIT",
45
58
  "main": "dist/index.js",
@@ -63,11 +76,22 @@
63
76
  "scripts": {
64
77
  "build": "shx rm -rf dist && tsc",
65
78
  "lint": "eslint",
79
+ "lint:fix": "eslint --fix",
80
+ "format": "prettier 'src/**/*.{ts,tsx}' 'test/**/*.{ts,tsx}' --write",
66
81
  "postpack": "shx rm -f oclif.manifest.json",
67
82
  "posttest": "yarn lint",
68
83
  "prepack": "oclif manifest && oclif readme",
69
- "test": "mocha --forbid-only \"test/**/*.test.ts\"",
84
+ "test": "c8 mocha --loader=tsx/esm --forbid-only 'test/**/*.test.ts'",
85
+ "test:coverage": "c8 report",
86
+ "test:coverage:summary": "c8 report --reporter=text",
70
87
  "version": "oclif readme && git add README.md"
71
88
  },
89
+ "c8": {
90
+ "reporter": [
91
+ "lcov",
92
+ "html"
93
+ ],
94
+ "reports-dir": "./coverage"
95
+ },
72
96
  "types": "dist/index.d.ts"
73
97
  }