import path from 'node:path';
import { fileURLToPath } from 'node:url';

/**
 * Path constants used across the docs test suite.
 *
 * Layout reminder:
 *   <repo>/
 *     docs/                        ← content tree (CONTENT_ROOT)
 *       en/, de/, fr/, de-CH/
 *     services/
 *       docs/                      ← this service (DOCS_ROOT)
 *         tests/
 *           lib/
 *             paths.ts             ← this file
 *
 * Resolved once at module-load time. No filesystem checks here — that lives in
 * `walk.ts`. Keeping this file pure makes the helpers easy to unit-test and
 * stops circular imports between modules that only want the path.
 */

const HERE = path.dirname(fileURLToPath(import.meta.url));

/** `services/docs/tests/`. */
const TESTS_ROOT = path.resolve(HERE, '..');

/** `services/docs/`. */
const DOCS_ROOT = path.resolve(TESTS_ROOT, '..');

/** Repo root — three levels up from `services/docs/`. */
export const REPO_ROOT = path.resolve(DOCS_ROOT, '..', '..');

/** `docs/` — the content tree the docs site reads from. */
export const CONTENT_ROOT = path.join(REPO_ROOT, 'docs');
