diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-08-24 01:58:33 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-08-24 01:58:33 +0800 |
commit | 57c104119c409c053eb977553c92341c3ca83afd (patch) | |
tree | 7f1129fd01001604e7412e33ccef202c1ff90612 /packages/sol-compiler/src | |
parent | cd5c73550b969fe0a87524143ce617749935427a (diff) | |
parent | 6e27324a341801e1a2d8d6989d749dfe021ae39b (diff) | |
download | dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.gz dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.bz2 dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.lz dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.xz dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.zst dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.zip |
Merge branch 'development' into feature/forwarder-helper/init
* development: (187 commits)
Remove trailing slash
Fix linter
Stop nesting interfaces and add necessary type exports
Remove duplicate type and remove nested interface
Add support for rending the Tuple type
Add missing keyu
Remove excessive timestamp
Improve doc commebnt
Remove docs catch-all endpoint
Fix comments
Look for all TS mapped types
Add catch and exit with non-zero
Remove superfluous dep
Fix CHANGELOG entry
Fix double assignment
Upgrade Typedoc to 0.12.0, which works with TS 3.x
Fix prettier issues
Enable dry run of release publishing and handle git tags existing
update yarn.lock
Missing/superfluous type exports from connect
...
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; } |