diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-24 01:12:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-24 01:12:39 +0800 |
commit | 6e27324a341801e1a2d8d6989d749dfe021ae39b (patch) | |
tree | 32b2e1d93958905f7e4d0529e4fbead4206275ab /packages/sol-compiler/src | |
parent | b013cf2e145825a9e250c61bc77825384b2af69e (diff) | |
parent | 8eb4b6f91791313dc02865a9dd3324cce646d537 (diff) | |
download | dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.tar dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.tar.gz dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.tar.bz2 dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.tar.lz dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.tar.xz dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.tar.zst dexon-sol-tools-6e27324a341801e1a2d8d6989d749dfe021ae39b.zip |
Merge pull request #924 from 0xProject/wrap-typedoc
Improved Docs & Removed monorepo-scripts from packages
Diffstat (limited to 'packages/sol-compiler/src')
-rw-r--r-- | packages/sol-compiler/src/compiler.ts | 3 | ||||
-rw-r--r-- | packages/sol-compiler/src/index.ts | 9 | ||||
-rw-r--r-- | packages/sol-compiler/src/monorepo_scripts/postpublish.ts | 8 | ||||
-rw-r--r-- | packages/sol-compiler/src/monorepo_scripts/stage_docs.ts | 8 | ||||
-rw-r--r-- | packages/sol-compiler/src/utils/compiler.ts | 2 | ||||
-rw-r--r-- | packages/sol-compiler/src/utils/types.ts | 46 |
6 files changed, 10 insertions, 66 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 2e7120361..7c76f3e52 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -10,6 +10,7 @@ import { } from '@0xproject/sol-resolver'; import { fetchAsync, logUtils } from '@0xproject/utils'; import chalk from 'chalk'; +import { CompilerOptions, ContractArtifact, ContractVersionData } from 'ethereum-types'; import * as ethUtil from 'ethereumjs-util'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -29,7 +30,6 @@ import { } from './utils/compiler'; import { constants } from './utils/constants'; import { fsWrapper } from './utils/fs_wrapper'; -import { CompilerOptions, ContractArtifact, ContractVersionData } from './utils/types'; import { utils } from './utils/utils'; type TYPE_ALL_FILES_IDENTIFIER = '*'; @@ -112,6 +112,7 @@ export class Compiler { } /** * Instantiates a new instance of the Compiler class. + * @param opts Optional compiler options * @return An instance of the Compiler class. */ constructor(opts?: CompilerOptions) { diff --git a/packages/sol-compiler/src/index.ts b/packages/sol-compiler/src/index.ts index 15c166992..f8c2b577a 100644 --- a/packages/sol-compiler/src/index.ts +++ b/packages/sol-compiler/src/index.ts @@ -1,3 +1,8 @@ export { Compiler } from './compiler'; -export { CompilerOptions } from './utils/types'; -export { ContractArtifact, ContractNetworks } from './utils/types'; +export { + CompilerOptions, + CompilerSettings, + OutputField, + CompilerSettingsMetadata, + OptimizerSettings, +} from 'ethereum-types'; diff --git a/packages/sol-compiler/src/monorepo_scripts/postpublish.ts b/packages/sol-compiler/src/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/sol-compiler/src/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -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.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/sol-compiler/src/monorepo_scripts/stage_docs.ts b/packages/sol-compiler/src/monorepo_scripts/stage_docs.ts deleted file mode 100644 index e732ac8eb..000000000 --- a/packages/sol-compiler/src/monorepo_scripts/stage_docs.ts +++ /dev/null @@ -1,8 +0,0 @@ -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); diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts index 968fcc5b2..c918ed1f3 100644 --- a/packages/sol-compiler/src/utils/compiler.ts +++ b/packages/sol-compiler/src/utils/compiler.ts @@ -1,10 +1,10 @@ import { ContractSource } from '@0xproject/sol-resolver'; import { logUtils } from '@0xproject/utils'; +import { ContractArtifact } from 'ethereum-types'; import * as _ from 'lodash'; import * as path from 'path'; import { fsWrapper } from './fs_wrapper'; -import { ContractArtifact } from './types'; /** * Gets contract data on network or returns if an artifact does not exist. diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts index 4321a2235..b211cfcbc 100644 --- a/packages/sol-compiler/src/utils/types.ts +++ b/packages/sol-compiler/src/utils/types.ts @@ -1,5 +1,3 @@ -import * as solc from 'solc'; - export enum AbiType { Function = 'function', Constructor = 'constructor', @@ -7,54 +5,10 @@ export enum AbiType { Fallback = 'fallback', } -export interface ContractArtifact extends ContractVersionData { - schemaVersion: string; - contractName: string; - networks: ContractNetworks; -} - -export interface ContractVersionData { - compiler: { - name: 'solc'; - version: string; - settings: solc.CompilerSettings; - }; - sources: { - [sourceName: string]: { - id: number; - }; - }; - sourceCodes: { - [sourceName: string]: string; - }; - sourceTreeHashHex: string; - compilerOutput: solc.StandardContractOutput; -} - -export interface ContractNetworks { - [networkId: number]: ContractNetworkData; -} - -export interface ContractNetworkData { - address: string; - links: { - [linkName: string]: string; - }; - constructorArgs: string; -} - export interface SolcErrors { [key: string]: boolean; } -export interface CompilerOptions { - contractsDir?: string; - artifactsDir?: string; - compilerSettings?: solc.CompilerSettings; - contracts?: string[] | '*'; - solcVersion?: string; -} - export interface ContractSourceData { [contractName: string]: ContractSpecificSourceData; } |