@md2do/cli 0.3.1 → 0.5.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +25 -0
  3. package/coverage/coverage-final.json +5 -4
  4. package/coverage/index.html +11 -11
  5. package/coverage/lcov-report/index.html +11 -11
  6. package/coverage/lcov-report/src/cli.ts.html +10 -4
  7. package/coverage/lcov-report/src/commands/config.ts.html +2269 -0
  8. package/coverage/lcov-report/src/commands/index.html +24 -9
  9. package/coverage/lcov-report/src/commands/index.ts.html +7 -4
  10. package/coverage/lcov-report/src/commands/list.ts.html +103 -22
  11. package/coverage/lcov-report/src/commands/stats.ts.html +1 -1
  12. package/coverage/lcov-report/src/commands/todoist.ts.html +1 -1
  13. package/coverage/lcov-report/src/formatters/index.html +1 -1
  14. package/coverage/lcov-report/src/formatters/json.ts.html +1 -1
  15. package/coverage/lcov-report/src/formatters/pretty.ts.html +1 -1
  16. package/coverage/lcov-report/src/index.html +7 -7
  17. package/coverage/lcov-report/src/index.ts.html +1 -1
  18. package/coverage/lcov-report/src/scanner.ts.html +87 -6
  19. package/coverage/lcov.info +817 -20
  20. package/coverage/src/cli.ts.html +10 -4
  21. package/coverage/src/commands/config.ts.html +2269 -0
  22. package/coverage/src/commands/index.html +24 -9
  23. package/coverage/src/commands/index.ts.html +7 -4
  24. package/coverage/src/commands/list.ts.html +103 -22
  25. package/coverage/src/commands/stats.ts.html +1 -1
  26. package/coverage/src/commands/todoist.ts.html +1 -1
  27. package/coverage/src/formatters/index.html +1 -1
  28. package/coverage/src/formatters/json.ts.html +1 -1
  29. package/coverage/src/formatters/pretty.ts.html +1 -1
  30. package/coverage/src/index.html +7 -7
  31. package/coverage/src/index.ts.html +1 -1
  32. package/coverage/src/scanner.ts.html +87 -6
  33. package/dist/cli.js +488 -12
  34. package/dist/index.d.ts +6 -1
  35. package/dist/index.js +483 -6
  36. package/package.json +7 -4
  37. package/src/cli.ts +2 -0
  38. package/src/commands/config.ts +731 -0
  39. package/src/commands/index.ts +1 -0
  40. package/src/commands/list.ts +16 -5
  41. package/src/scanner.ts +23 -1
@@ -2,3 +2,4 @@
2
2
  export { createListCommand } from './list.js';
3
3
  export { createStatsCommand } from './stats.js';
4
4
  export { createTodoistCommand } from './todoist.js';
5
+ export { createConfigCommand } from './config.js';
@@ -86,11 +86,25 @@ export function createListCommand(): Command {
86
86
 
87
87
  .action(async (options: ListCommandOptions) => {
88
88
  try {
89
- // Scan markdown files
89
+ // Load config first to get workday settings
90
+ const config = await loadConfig({
91
+ cwd: options.path || process.cwd(),
92
+ });
93
+
94
+ // Scan markdown files with workday config
90
95
  const scanResult = await scanMarkdownFiles({
91
96
  root: options.path || process.cwd(),
92
97
  ...(options.pattern !== undefined && { pattern: options.pattern }),
93
98
  ...(options.exclude !== undefined && { exclude: options.exclude }),
99
+ ...(config.workday?.startTime && {
100
+ workdayStartTime: config.workday.startTime,
101
+ }),
102
+ ...(config.workday?.endTime && {
103
+ workdayEndTime: config.workday.endTime,
104
+ }),
105
+ ...(config.workday?.defaultDueTime && {
106
+ defaultDueTime: config.workday.defaultDueTime,
107
+ }),
94
108
  });
95
109
 
96
110
  let tasks = scanResult.tasks;
@@ -212,11 +226,8 @@ export function createListCommand(): Command {
212
226
 
213
227
  console.log(output);
214
228
 
215
- // Load config and apply warning filters (unless --no-warnings overrides)
229
+ // Apply warning filters (unless --no-warnings overrides)
216
230
  if (options.warnings !== false) {
217
- const config = await loadConfig({
218
- cwd: options.path || process.cwd(),
219
- });
220
231
  const warningConfig = config.warnings ?? DEFAULT_CONFIG.warnings;
221
232
 
222
233
  // Apply config-based filtering
package/src/scanner.ts CHANGED
@@ -22,6 +22,21 @@ export interface ScanOptions {
22
22
  * Whether to follow symbolic links (defaults to false)
23
23
  */
24
24
  followSymlinks?: boolean;
25
+
26
+ /**
27
+ * Workday start time for default due times (e.g., "08:00")
28
+ */
29
+ workdayStartTime?: string;
30
+
31
+ /**
32
+ * Workday end time for default due times (e.g., "17:00")
33
+ */
34
+ workdayEndTime?: string;
35
+
36
+ /**
37
+ * Default due time to use when no time is specified ("start" or "end")
38
+ */
39
+ defaultDueTime?: 'start' | 'end';
25
40
  }
26
41
 
27
42
  export interface ScanResult {
@@ -56,6 +71,9 @@ export async function scanMarkdownFiles(
56
71
  '**/.next/**',
57
72
  ],
58
73
  followSymlinks = false,
74
+ workdayStartTime,
75
+ workdayEndTime,
76
+ defaultDueTime,
59
77
  } = options;
60
78
 
61
79
  // Find all markdown files
@@ -77,7 +95,11 @@ export async function scanMarkdownFiles(
77
95
  const fullPath = `${root}/${file}`;
78
96
  const content = await readFile(fullPath, 'utf-8');
79
97
 
80
- const result = scanner.scanFile(file, content);
98
+ const result = scanner.scanFile(file, content, {
99
+ ...(workdayStartTime && { workdayStartTime }),
100
+ ...(workdayEndTime && { workdayEndTime }),
101
+ ...(defaultDueTime && { defaultDueTime }),
102
+ });
81
103
  allTasks.push(...result.tasks);
82
104
  allWarnings.push(...result.warnings);
83
105
  } catch (error) {