Lawrence Forman b7b457b076
Generate (complete) solidity docs (#2391)
* `@0x/sol-doc`: New doc generator.

* `@0x/sol-compiler`: Be more tolerant of AST-only compilation targets.

* `@0x/contracts-exchange`: Add more devdoc comments.
`@0x/contracts-exchange-libs`: Add more devdoc comments.

* `@0x/sol-doc`: Update package script.

* `@0x/sol-doc`: Remove unused files and update package scripts to be easier to configure.

* Add more devdocs to contracts.

* `@0x/sol-doc`: Remove doc artifacts.

* `@0x/sol-doc`: Add `.gitignore` and `.npmignore`.

* `@0x/contracts-exchange`: Fix compilation errors.

* Fix more broken contracts.

* `@0x/contracts-erc20-bridge-sampler`: Fix failing tests.

* `@0x/contracts-asset-proxy`: Remove accidentally introduced hackathion file (lol).

* `@0x/sol-doc`: Prevent some inherited contracts from being included in docs unintentionally.

* `@0x/sol-doc`: Rename test file.

* `@0x/contracts-exchange`: Update `orderEpoch` devdoc.

* `@0x/sol-doc`: Tweak event and function docs.

* Update CODEOWNERS.

* `@0x/sol-doc` Tweak function md generation.

* `@0x/sol-doc`: add `transformDocs()` tests.

* `@0x/sol-doc`: add `extract_docs` tests.

* `@0x/sol-doc` Fix linter errors.

* `@0x/contracts-erc20-bridge-sampler`: Fix broken `ERC20BridgeSampler.sol` compile.

* `@0x/sol-doc` Fix mismatched `dev-utils` dep version.

* `@0x/sol-doc`: Add `gen_md` tests.

* `@0x/sol-doc`: Remove `fs.promises` calls.

* `@0x/sol-doc`: Fix linter errors.

* `@0x/sol-doc`: Export all relevant types and functions.

Co-authored-by: Lawrence Forman <me@merklejerk.com>
2020-01-03 22:59:18 -05:00
..
2018-05-11 18:50:50 +02:00
2019-11-17 18:03:13 -05:00
2018-05-10 17:56:57 +02:00
2019-08-08 11:51:22 +10:00
2019-12-16 16:05:03 -08:00
2019-12-16 16:05:16 -08:00
2019-09-19 19:43:08 -07:00

@0x/sol-compiler

Sol-compiler is a wrapper around solc-js that adds:

  • Smart re-compilation: Only recompiles when smart contracts have changed
  • Ability to compile an entire project instead of only individual .sol files
  • Compilation using the Solidity version specified at the top of each individual .sol file
  • Proper parsing of Solidity version ranges
  • Support for the standard input description for what information you'd like added to the resulting artifacts file (i.e 100% configurable artifacts content).

Read the Documentation.

Installation

CLI Installation

yarn global add @0x/sol-compiler

API Installation

yarn add @0x/sol-compiler

If your project is in TypeScript, add the following to your tsconfig.json:

"compilerOptions": {
    "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}

Import

import { Compiler } from '@0x/sol-compiler';

or

var Compiler = require('@0x/sol-compiler').Compiler;

Contributing

We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.

Please read our contribution guidelines before getting started.

Install dependencies

If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:

yarn config set workspaces-experimental true

Then install dependencies

yarn install

Build

To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:

PKG=@0x/sol-compiler yarn build

Or continuously rebuild on change:

PKG=@0x/sol-compiler yarn watch

Clean

yarn clean

Lint

yarn lint

Run Tests

yarn test