harsta
Version:
Harsta is a contract development tool based on Hardhat, designed to streamline the development, testing, and referencing of contracts, addresses, ABIs, and contract instances.
9 lines (7 loc) • 550 B
text/typescript
import path from 'pathe'
import { resolveImport } from 'resolve-import-path'
export const userRoot = process.env.userRoot || process.cwd().replace(/\\/g, '/')
export const clientJsonPath = resolveImport('@harsta/client/package.json', false, { basedir: userRoot })
export const clientRoot = process.env.clientRoot || (clientJsonPath ? path.dirname(clientJsonPath) : undefined)
export const packRoot = process.env.packRoot || path.dirname(resolveImport('harsta/package.json', true)!)
export const generatedRoot = path.resolve(packRoot, './generated')