@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.
- package/CHANGELOG.md +55 -0
- package/README.md +25 -0
- package/coverage/coverage-final.json +5 -4
- package/coverage/index.html +11 -11
- package/coverage/lcov-report/index.html +11 -11
- package/coverage/lcov-report/src/cli.ts.html +10 -4
- package/coverage/lcov-report/src/commands/config.ts.html +2269 -0
- package/coverage/lcov-report/src/commands/index.html +24 -9
- package/coverage/lcov-report/src/commands/index.ts.html +7 -4
- package/coverage/lcov-report/src/commands/list.ts.html +103 -22
- package/coverage/lcov-report/src/commands/stats.ts.html +1 -1
- package/coverage/lcov-report/src/commands/todoist.ts.html +1 -1
- package/coverage/lcov-report/src/formatters/index.html +1 -1
- package/coverage/lcov-report/src/formatters/json.ts.html +1 -1
- package/coverage/lcov-report/src/formatters/pretty.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +7 -7
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/scanner.ts.html +87 -6
- package/coverage/lcov.info +817 -20
- package/coverage/src/cli.ts.html +10 -4
- package/coverage/src/commands/config.ts.html +2269 -0
- package/coverage/src/commands/index.html +24 -9
- package/coverage/src/commands/index.ts.html +7 -4
- package/coverage/src/commands/list.ts.html +103 -22
- package/coverage/src/commands/stats.ts.html +1 -1
- package/coverage/src/commands/todoist.ts.html +1 -1
- package/coverage/src/formatters/index.html +1 -1
- package/coverage/src/formatters/json.ts.html +1 -1
- package/coverage/src/formatters/pretty.ts.html +1 -1
- package/coverage/src/index.html +7 -7
- package/coverage/src/index.ts.html +1 -1
- package/coverage/src/scanner.ts.html +87 -6
- package/dist/cli.js +488 -12
- package/dist/index.d.ts +6 -1
- package/dist/index.js +483 -6
- package/package.json +7 -4
- package/src/cli.ts +2 -0
- package/src/commands/config.ts +731 -0
- package/src/commands/index.ts +1 -0
- package/src/commands/list.ts +16 -5
- package/src/scanner.ts +23 -1
package/src/commands/index.ts
CHANGED
package/src/commands/list.ts
CHANGED
|
@@ -86,11 +86,25 @@ export function createListCommand(): Command {
|
|
|
86
86
|
|
|
87
87
|
.action(async (options: ListCommandOptions) => {
|
|
88
88
|
try {
|
|
89
|
-
//
|
|
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
|
-
//
|
|
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) {
|