UNPKG

@solarity/hardhat-markup

Version:

Customizable markdown documentation for smart contracts

23 lines 1.05 kB
import { HardhatPluginError } from "@nomicfoundation/hardhat-errors"; import { PLUGIN_ID } from "../../../constants.js"; import { Generator } from "../../../generator/Generator.js"; const markupAction = async ({ outdir, noCompile, markupVerbose }, hre) => { hre.config.markup.outdir = outdir === undefined ? hre.config.markup.outdir : outdir; hre.config.markup.noCompile = !noCompile ? hre.config.markup.noCompile : noCompile; hre.config.markup.verbose = !markupVerbose ? hre.config.markup.verbose : markupVerbose; if (!hre.config.markup.noCompile) { await hre.tasks.getTask("compile").run({ quiet: true, defaultBuildProfile: "production", }); } try { const contracts = await new Generator(hre).generate(); console.log(`\nGenerated markups for ${contracts.length} contracts`); } catch (e) { throw new HardhatPluginError(PLUGIN_ID, `Failed to generate markups: ${e.message}`, e); } }; export default markupAction; //# sourceMappingURL=task-action.js.map