"use server";
import { existsSync } from "fs";
import { resolve } from "path";
function isMonorepoContext() {
  const monorepoMarker = resolve(process.cwd(), "../../packages/core/package.json");
  return existsSync(monorepoMarker);
}
function resolveCorePath(relativePath) {
  if (isMonorepoContext()) {
    return resolve(process.cwd(), "../../packages/core", relativePath);
  }
  return resolve(process.cwd(), "node_modules/@nextsparkjs/core", relativePath);
}
function getTestPaths() {
  const isMonorepo = isMonorepoContext();
  return {
    isMonorepo,
    coreSrc: isMonorepo ? "../../packages/core/src" : "@nextsparkjs/core",
    coreTests: isMonorepo ? "../../packages/core/tests" : "node_modules/@nextsparkjs/core/tests",
    cypressSupport: isMonorepo ? "../../packages/core/tests/cypress/support" : "@nextsparkjs/core/cypress-support",
    jestSetup: isMonorepo ? "../../packages/core/tests/jest/setup.ts" : "@nextsparkjs/core/jest-setup"
  };
}
export {
  getTestPaths,
  isMonorepoContext,
  resolveCorePath
};
