taskplane 0.1.13 → 0.1.14
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/bin/taskplane.mjs +35 -33
- package/package.json +1 -1
package/bin/taskplane.mjs
CHANGED
|
@@ -291,16 +291,17 @@ async function autoCommitTaskFiles(projectRoot, tasksRoot) {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
function
|
|
294
|
+
function discoverTaskAreaMetadata(projectRoot) {
|
|
295
295
|
const runnerPath = path.join(projectRoot, ".pi", "task-runner.yaml");
|
|
296
|
-
if (!fs.existsSync(runnerPath)) return [];
|
|
296
|
+
if (!fs.existsSync(runnerPath)) return { paths: [], contexts: [] };
|
|
297
297
|
|
|
298
298
|
const raw = readYaml(runnerPath);
|
|
299
|
-
if (!raw) return [];
|
|
299
|
+
if (!raw) return { paths: [], contexts: [] };
|
|
300
300
|
|
|
301
301
|
const lines = raw.split(/\r?\n/);
|
|
302
302
|
let inTaskAreas = false;
|
|
303
303
|
const paths = new Set();
|
|
304
|
+
const contexts = new Set();
|
|
304
305
|
|
|
305
306
|
for (const line of lines) {
|
|
306
307
|
const trimmed = line.trim();
|
|
@@ -317,13 +318,22 @@ function discoverTaskAreaPaths(projectRoot) {
|
|
|
317
318
|
break;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
paths.add(
|
|
321
|
+
const pathMatch = line.match(/^\s{4}path:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
|
|
322
|
+
if (pathMatch?.[1]) {
|
|
323
|
+
paths.add(pathMatch[1].trim());
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const contextMatch = line.match(/^\s{4}context:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
|
|
327
|
+
if (contextMatch?.[1]) {
|
|
328
|
+
contexts.add(contextMatch[1].trim());
|
|
323
329
|
}
|
|
324
330
|
}
|
|
325
331
|
|
|
326
|
-
return [...paths];
|
|
332
|
+
return { paths: [...paths], contexts: [...contexts] };
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function discoverTaskAreaPaths(projectRoot) {
|
|
336
|
+
return discoverTaskAreaMetadata(projectRoot).paths;
|
|
327
337
|
}
|
|
328
338
|
|
|
329
339
|
function pruneEmptyDir(dirPath) {
|
|
@@ -825,33 +835,25 @@ function cmdDoctor() {
|
|
|
825
835
|
}
|
|
826
836
|
|
|
827
837
|
// Check task areas from config
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
if (exists) {
|
|
840
|
-
console.log(` ${OK} task area path: ${areaPath}`);
|
|
841
|
-
} else {
|
|
842
|
-
console.log(` ${FAIL} task area path: ${areaPath} ${c.dim}(directory not found)${c.reset}`);
|
|
843
|
-
console.log(` ${c.dim}→ Run: mkdir -p ${areaPath}${c.reset}`);
|
|
844
|
-
issues++;
|
|
845
|
-
}
|
|
838
|
+
const { paths: taskAreaPaths, contexts: taskAreaContexts } = discoverTaskAreaMetadata(projectRoot);
|
|
839
|
+
if (taskAreaPaths.length > 0) {
|
|
840
|
+
console.log();
|
|
841
|
+
for (const areaPath of taskAreaPaths) {
|
|
842
|
+
const exists = fs.existsSync(path.join(projectRoot, areaPath));
|
|
843
|
+
if (exists) {
|
|
844
|
+
console.log(` ${OK} task area path: ${areaPath}`);
|
|
845
|
+
} else {
|
|
846
|
+
console.log(` ${FAIL} task area path: ${areaPath} ${c.dim}(directory not found)${c.reset}`);
|
|
847
|
+
console.log(` ${c.dim}→ Run: mkdir -p ${areaPath}${c.reset}`);
|
|
848
|
+
issues++;
|
|
846
849
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}
|
|
850
|
+
}
|
|
851
|
+
for (const ctxPath of taskAreaContexts) {
|
|
852
|
+
const exists = fs.existsSync(path.join(projectRoot, ctxPath));
|
|
853
|
+
if (exists) {
|
|
854
|
+
console.log(` ${OK} CONTEXT.md: ${ctxPath}`);
|
|
855
|
+
} else {
|
|
856
|
+
console.log(` ${WARN} CONTEXT.md: ${ctxPath} ${c.dim}(not found)${c.reset}`);
|
|
855
857
|
}
|
|
856
858
|
}
|
|
857
859
|
}
|