diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-12 01:11:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-12 01:11:27 +0800 |
commit | 6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (patch) | |
tree | 8d374bf8f4f70a40d75c8bf4b35fe9a169250909 /packages/sol-compiler | |
parent | f42f608f3f97a5244f09f17ae5ee184c0f775de3 (diff) | |
parent | ad8e12eeaebd40fdafac7cbef96121d4454909df (diff) | |
download | dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.gz dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.bz2 dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.lz dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.xz dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.zst dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.zip |
Merge pull request #579 from 0xProject/breakUp0xjs
Split 0x.js into: contract-wrappers & order-watcher
Diffstat (limited to 'packages/sol-compiler')
-rw-r--r-- | packages/sol-compiler/package.json | 3 | ||||
-rw-r--r-- | packages/sol-compiler/src/utils/compiler.ts | 2 | ||||
-rw-r--r-- | packages/sol-compiler/src/utils/fs_wrapper.ts | 3 | ||||
-rw-r--r-- | packages/sol-compiler/test/compiler_test.ts | 3 |
4 files changed, 7 insertions, 4 deletions
diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 745760cd0..19d390c32 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -11,7 +11,6 @@ "run_mocha": "mocha lib/test/*_test.js --bail --exit", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", - "compile": "npm run build; node lib/src/cli.js compile", "clean": "shx rm -rf lib scripts", "migrate": "npm run build; node lib/src/cli.js migrate", "lint": "tslint --project .", @@ -50,6 +49,7 @@ "@0xproject/dev-utils": "^0.4.1", "@0xproject/monorepo-scripts": "^0.1.19", "@0xproject/tslint-config": "^0.4.17", + "@types/mkdirp": "^0.5.2", "@types/require-from-string": "^1.2.0", "@types/semver": "^5.5.0", "chai": "^4.0.1", @@ -79,6 +79,7 @@ "ethereumjs-util": "^5.1.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", + "mkdirp": "^0.5.1", "require-from-string": "^2.0.1", "semver": "^5.5.0", "solc": "^0.4.23", diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts index c571b2581..3731385e2 100644 --- a/packages/sol-compiler/src/utils/compiler.ts +++ b/packages/sol-compiler/src/utils/compiler.ts @@ -40,7 +40,7 @@ export async function getContractArtifactIfExistsAsync( export async function createDirIfDoesNotExistAsync(dirPath: string): Promise<void> { if (!fsWrapper.doesPathExistSync(dirPath)) { logUtils.log(`Creating directory at ${dirPath}...`); - await fsWrapper.mkdirAsync(dirPath); + await fsWrapper.mkdirpAsync(dirPath); } } diff --git a/packages/sol-compiler/src/utils/fs_wrapper.ts b/packages/sol-compiler/src/utils/fs_wrapper.ts index e02c83f27..cc7b06175 100644 --- a/packages/sol-compiler/src/utils/fs_wrapper.ts +++ b/packages/sol-compiler/src/utils/fs_wrapper.ts @@ -1,11 +1,12 @@ import { promisify } from '@0xproject/utils'; import * as fs from 'fs'; +import * as mkdirp from 'mkdirp'; export const fsWrapper = { readdirAsync: promisify<string[]>(fs.readdir), readFileAsync: promisify<string>(fs.readFile), writeFileAsync: promisify<undefined>(fs.writeFile), - mkdirAsync: promisify<undefined>(fs.mkdir), + mkdirpAsync: promisify<undefined>(mkdirp), doesPathExistSync: fs.existsSync, rmdirSync: fs.rmdirSync, removeFileAsync: promisify<undefined>(fs.unlink), diff --git a/packages/sol-compiler/test/compiler_test.ts b/packages/sol-compiler/test/compiler_test.ts index 7ccaeef07..79bb3b873 100644 --- a/packages/sol-compiler/test/compiler_test.ts +++ b/packages/sol-compiler/test/compiler_test.ts @@ -1,9 +1,10 @@ +import { DoneCallback } from '@0xproject/types'; import * as chai from 'chai'; import 'mocha'; import { Compiler } from '../src/compiler'; import { fsWrapper } from '../src/utils/fs_wrapper'; -import { CompilerOptions, ContractArtifact, ContractNetworkData, DoneCallback } from '../src/utils/types'; +import { CompilerOptions, ContractArtifact, ContractNetworkData } from '../src/utils/types'; import { exchange_binary } from './fixtures/exchange_bin'; import { constants } from './util/constants'; |