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.projectRoot, file);
  if (existsSync(path)) {
    return path;
  }
  path = joinPaths(context.projectRoot, file);
  if (existsSync(path)) {
    return path;
  }
  return resolvePackage(file, {
    paths: [
      context.workspaceConfig.workspaceRoot,
      joinPaths(context.workspaceConfig.workspaceRoot, context.projectRoot)
    ]
  });
}
__name(resolvePath, "resolvePath");

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