Batch fixes before release (#1011)

* fix: improve projectRoot

* fix: improve task-master lang command

* feat: add documentation to the readme so more people can access it

* fix: expand command subtask dependency validation

* fix: update command more reliable with perplexity and other models

* chore: fix CI

* chore: implement requested changes

* chore: fix CI
This commit is contained in:
Ralph Khreish
2025-07-19 00:57:47 +03:00
parent 858d4a1c54
commit 444aa5ae19
17 changed files with 148 additions and 83 deletions

View File

@@ -17,6 +17,7 @@ import {
LEGACY_CONFIG_FILE,
COMPLEXITY_REPORT_FILE
} from './constants/paths.js';
import { findProjectRoot } from './utils/path-utils.js';
/**
* TaskMaster class manages all the paths for the application.
@@ -159,22 +160,6 @@ export class TaskMaster {
* @returns {TaskMaster} An initialized TaskMaster instance.
*/
export function initTaskMaster(overrides = {}) {
const findProjectRoot = (startDir = process.cwd()) => {
const projectMarkers = [TASKMASTER_DIR, LEGACY_CONFIG_FILE];
let currentDir = path.resolve(startDir);
const rootDir = path.parse(currentDir).root;
while (currentDir !== rootDir) {
for (const marker of projectMarkers) {
const markerPath = path.join(currentDir, marker);
if (fs.existsSync(markerPath)) {
return currentDir;
}
}
currentDir = path.dirname(currentDir);
}
return null;
};
const resolvePath = (
pathType,
override,
@@ -264,13 +249,8 @@ export function initTaskMaster(overrides = {}) {
paths.projectRoot = resolvedOverride;
} else {
const foundRoot = findProjectRoot();
if (!foundRoot) {
throw new Error(
'Unable to find project root. No project markers found. Run "init" command first.'
);
}
paths.projectRoot = foundRoot;
// findProjectRoot now always returns a value (fallback to cwd)
paths.projectRoot = findProjectRoot();
}
// TaskMaster Directory