import { normalize } from 'node:path';
function isRootTarget(targetDir) {
    return targetDir.trim() === '' || normalize(targetDir) === '.';
}
export function buildDocsCommands(repoShape, targetDir, appName) {
    if (repoShape === 'monorepo') {
        return {
            install: 'pnpm install',
            dev: `pnpm --filter ${appName} dev`,
            build: `pnpm --filter ${appName} build`,
        };
    }
    if (isRootTarget(targetDir)) {
        return {
            install: 'pnpm install',
            dev: 'pnpm dev',
            build: 'pnpm build',
        };
    }
    return {
        install: `cd ${targetDir} && pnpm install`,
        dev: `cd ${targetDir} && pnpm dev`,
        build: `cd ${targetDir} && pnpm build`,
    };
}
