Update docs pipeline to solidity-docgen@0.6 (#3707)
(cherry picked from commit c52625018b)
This commit is contained in:
committed by
Francisco Giordano
parent
f0de978a9e
commit
50501a751e
@ -1,14 +1,12 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const path = require('path');
|
||||
const proc = require('child_process');
|
||||
const glob = require('glob');
|
||||
const startCase = require('lodash.startcase');
|
||||
|
||||
const baseDir = process.argv[2];
|
||||
|
||||
const files = proc.execFileSync(
|
||||
'find', [baseDir, '-type', 'f'], { encoding: 'utf8' },
|
||||
).split('\n').filter(s => s !== '');
|
||||
const files = glob.sync(baseDir + '/**/*.adoc').map(f => path.relative(baseDir, f));
|
||||
|
||||
console.log('.API');
|
||||
|
||||
|
||||
@ -154,10 +154,10 @@ function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Same as {_get}, with a custom error message when \`key\` is not in the map.
|
||||
* @dev Same as {get}, with a custom error message when \`key\` is not in the map.
|
||||
*
|
||||
* CAUTION: This function is deprecated because it requires allocating memory for the error
|
||||
* message unnecessarily. For custom revert reasons use {_tryGet}.
|
||||
* message unnecessarily. For custom revert reasons use {tryGet}.
|
||||
*/
|
||||
function get(
|
||||
Bytes32ToBytes32Map storage map,
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
const hre = require('hardhat');
|
||||
|
||||
const { getCompilersDir } = require('hardhat/internal/util/global-dir');
|
||||
const { CompilerDownloader } = require('hardhat/internal/solidity/compiler/downloader');
|
||||
const { Compiler } = require('hardhat/internal/solidity/compiler');
|
||||
|
||||
const [{ version }] = hre.config.solidity.compilers;
|
||||
|
||||
async function getSolc () {
|
||||
const downloader = new CompilerDownloader(await getCompilersDir(), { forceSolcJs: true });
|
||||
const { compilerPath } = await downloader.getDownloadedCompilerPath(version);
|
||||
const compiler = new Compiler(compilerPath);
|
||||
return compiler.getSolc();
|
||||
}
|
||||
|
||||
module.exports = Object.assign(getSolc(), { __esModule: true });
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
set -o errexit
|
||||
|
||||
OUTDIR=docs/modules/api/pages/
|
||||
OUTDIR="$(node -p 'require("./docs/config.js").outputDir')"
|
||||
|
||||
if [ ! -d node_modules ]; then
|
||||
npm ci
|
||||
@ -10,14 +10,6 @@ fi
|
||||
|
||||
rm -rf "$OUTDIR"
|
||||
|
||||
solidity-docgen \
|
||||
-t docs \
|
||||
-o "$OUTDIR" \
|
||||
-e contracts/mocks,contracts/examples \
|
||||
--output-structure readmes \
|
||||
--helpers ./docs/helpers.js \
|
||||
--solc-module ./scripts/prepare-docs-solc.js
|
||||
|
||||
rm -f "$OUTDIR"/token/*/presets.md
|
||||
hardhat docgen
|
||||
|
||||
node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc"
|
||||
|
||||
Reference in New Issue
Block a user