diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-23 00:11:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-23 00:11:23 +0800 |
commit | 289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5 (patch) | |
tree | b2f8385600b43589f608c32b699c5f215b4276d5 /packages/deployer/src | |
parent | 8478dc8d6d05efcdeac6653872f35149f3c9589c (diff) | |
parent | 81f6487865faad641108a566f3f717311ee43a0b (diff) | |
download | dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.tar dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.tar.gz dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.tar.bz2 dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.tar.lz dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.tar.xz dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.tar.zst dexon-sol-tools-289359bf0d1a4b5dd6d80a7e723bd92c46ffc1c5.zip |
Merge pull request #465 from 0xProject/addExtraDocs
Add Additional Package Doc Pages
Diffstat (limited to 'packages/deployer/src')
-rw-r--r-- | packages/deployer/src/compiler.ts | 6 | ||||
-rw-r--r-- | packages/deployer/src/deployer.ts | 16 | ||||
-rw-r--r-- | packages/deployer/src/monorepo_scripts/stage_docs.ts | 8 |
3 files changed, 26 insertions, 4 deletions
diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 83977709b..e840ed572 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -28,6 +28,10 @@ const SOLIDITY_FILE_EXTENSION_REGEX = /(.*\.sol)/; const IMPORT_REGEX = /(import\s)/; const DEPENDENCY_PATH_REGEX = /"([^"]+)"/; // Source: https://github.com/BlockChainCompany/soljitsu/blob/master/lib/shared.js +/** + * The Compiler facilitates compiling Solidity smart contracts and saves the results + * to artifact files. + */ export class Compiler { private _contractsDir: string; private _networkId: number; @@ -148,7 +152,7 @@ export class Compiler { this._specifiedContracts = opts.specifiedContracts; } /** - * Compiles all Solidity files found in contractsDir and writes JSON artifacts to artifactsDir. + * Compiles all Solidity files found in `contractsDir` and writes JSON artifacts to `artifactsDir`. */ public async compileAllAsync(): Promise<void> { await this._createArtifactsDirIfDoesNotExistAsync(); diff --git a/packages/deployer/src/deployer.ts b/packages/deployer/src/deployer.ts index 6c247d328..68518a931 100644 --- a/packages/deployer/src/deployer.ts +++ b/packages/deployer/src/deployer.ts @@ -19,12 +19,21 @@ import { utils } from './utils/utils'; // Gas added to gas estimate to make sure there is sufficient gas for deployment. const EXTRA_GAS = 200000; +/** + * The Deployer facilitates deploying Solidity smart contracts to the blockchain. + * It can be used to build custom migration scripts. + */ export class Deployer { public web3Wrapper: Web3Wrapper; private _artifactsDir: string; private _networkId: number; private _defaults: Partial<TxData>; + /** + * Instantiate a new instance of the Deployer class. + * @param opts Deployer options, including either an RPC url or Provider instance. + * @returns A Deployer instance + */ constructor(opts: DeployerOptions) { this._artifactsDir = opts.artifactsDir; this._networkId = opts.networkId; @@ -42,8 +51,8 @@ export class Deployer { this.web3Wrapper = new Web3Wrapper(web3Provider, this._defaults); } /** - * Loads contract artifact and deploys contract with given arguments. - * @param contractName Name of the contract to deploy. Must match name of an artifact in artifacts directory. + * Loads a contract's corresponding artifacts and deploys it with the supplied constructor arguments. + * @param contractName Name of the contract to deploy. Must match name of an artifact in supplied artifacts directory. * @param args Array of contract constructor arguments. * @return Deployed contract instance. */ @@ -80,7 +89,8 @@ export class Deployer { return contractInstance; } /** - * Loads contract artifact, deploys with given arguments, and saves updated data to artifact. + * Loads a contract's artifact, deploys it with supplied constructor arguments, and saves the updated data + * back to the artifact file. * @param contractName Name of the contract to deploy. Must match name of an artifact in artifacts directory. * @param args Array of contract constructor arguments. * @return Deployed contract instance. diff --git a/packages/deployer/src/monorepo_scripts/stage_docs.ts b/packages/deployer/src/monorepo_scripts/stage_docs.ts new file mode 100644 index 000000000..e732ac8eb --- /dev/null +++ b/packages/deployer/src/monorepo_scripts/stage_docs.ts @@ -0,0 +1,8 @@ +import { postpublishUtils } from '@0xproject/monorepo-scripts'; + +import * as packageJSON from '../package.json'; +import * as tsConfigJSON from '../tsconfig.json'; + +const cwd = `${__dirname}/..`; +// tslint:disable-next-line:no-floating-promises +postpublishUtils.publishDocsToStagingAsync(packageJSON, tsConfigJSON, cwd); |