import { __name } from './chunk-6AXVLTU5.js';
import { existsSync } from '@stryke/path/exists';
import { joinPaths } from '@stryke/path/join-paths';
import { resolvePackage } from '@stryke/path/resolve';

async function resolvePath(context, file) {
  let path = file;
  if (existsSync(path)) {
    return path;
  }
  path = joinPaths(context.workspaceConfig.workspaceRoot, file);
  if (existsSync(path)) {
    return path;
  }
  path = joinPaths(context.workspaceConfig.workspaceRoot, context.options.projectRoot, file);
  if (existsSync(path)) {
    return path;
  }
  path = joinPaths(context.options.projectRoot, file);
  if (existsSync(path)) {
    return path;
  }
  return resolvePackage(file, {
    paths: [
      context.workspaceConfig.workspaceRoot,
      joinPaths(context.workspaceConfig.workspaceRoot, context.options.projectRoot)
    ]
  });
}
__name(resolvePath, "resolvePath");

export { resolvePath };
//# sourceMappingURL=chunk-RHQLIAXR.js.map
//# sourceMappingURL=chunk-RHQLIAXR.js.map