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.
31 lines (27 loc) • 1.02 kB
text/typescript
import path from 'pathe'
import { resolveImport } from 'resolve-import-path'
import fs from 'fs-extra'
export const vitestBinRoot = (() => {
const packagePath = resolveImport('vitest/package.json')
const root = path.dirname(packagePath)
const json = fs.readJsonSync(packagePath)
return path.join(root, json.bin.vitest)
})()
export const hardhatBinRoot = (() => {
const packagePath = resolveImport('hardhat/package.json')
const root = path.dirname(packagePath)
const json = fs.readJsonSync(packagePath)
return path.join(root, json.bin.hardhat)
})()
export const tscBinRoot = (() => {
const packagePath = resolveImport('typescript/package.json')
const root = path.dirname(packagePath)
const json = fs.readJsonSync(packagePath)
return path.join(root, json.bin.tsc)
})()
export const tsupBinRoot = (() => {
const packagePath = resolveImport('tsup/package.json')
const root = path.dirname(packagePath)
const json = fs.readJsonSync(packagePath)
return path.join(root, json.bin.tsup)
})()