Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Refactor out sol-cov, sol-profiler and sol-trace into their separate …
Browse files Browse the repository at this point in the history
…packages
  • Loading branch information
LogvinovLeon committed Jan 8, 2019
1 parent 0ac36ce commit 2c974b5
Show file tree
Hide file tree
Showing 129 changed files with 1,130 additions and 624 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
- run: yarn wsrun test:circleci @0x/order-utils
- run: yarn wsrun test:circleci @0x/order-watcher
- run: yarn wsrun test:circleci @0x/sol-compiler
- run: yarn wsrun test:circleci @0x/sol-cov
- run: yarn wsrun test:circleci @0x/sol-trace-based-tools-common
- run: yarn wsrun test:circleci @0x/sol-doc
- run: yarn wsrun test:circleci @0x/subproviders
- run: yarn wsrun test:circleci @0x/web3-wrapper
Expand Down Expand Up @@ -169,9 +169,9 @@ jobs:
paths:
- ~/repo/packages/sol-compiler/coverage/lcov.info
- save_cache:
key: coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
key: coverage-sol-trace-based-tools-common-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/sol-cov/coverage/lcov.info
- ~/repo/packages/sol-trace-based-tools-common/coverage/lcov.info
- save_cache:
key: coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
paths:
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
- coverage-sol-trace-based-tools-common-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
Expand Down
5 changes: 4 additions & 1 deletion .github/autolabeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ instant: ['packages/instant']
abi-gen-templates: ['packages/abi-gen-templates']
abi-gen: ['packages/abi-gen']
website: ['packages/website']
sol-cov: ['packages/sol-cov']
sol-coverage: ['packages/sol-coverage']
sol-profiler: ['packages/sol-profiler']
sol-trace: ['packages/sol-trace']
sol-trace-based-tools-common: ['packages/sol-trace-based-tools-common']
utils: ['packages/utils']
tslint-config: ['packages/tslint-config']
asset-buyer: ['packages/asset-buyer']
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ contracts/interfaces/generated-artifacts/
contracts/tokens/generated-artifacts/
contracts/examples/generated-artifacts/
contracts/extensions/generated-artifacts/
packages/sol-cov/test/fixtures/artifacts/
packages/sol-trace-based-tools-common/test/fixtures/artifacts/
packages/metacoin/artifacts/

# generated contract wrappers
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ lib
/packages/sra-spec/public/
package.json
scripts/postpublish_utils.js
packages/sol-cov/test/fixtures/artifacts
packages/sol-coverage/test/fixtures/artifacts
5 changes: 4 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ packages/metacoin/ @LogvinovLeon
packages/monorepo-scripts/ @fabioberger
packages/order-utils/ @fabioberger @LogvinovLeon
packages/sol-compiler/ @LogvinovLeon
packages/sol-cov/ @LogvinovLeon
packages/sol-coverage/ @LogvinovLeon
packages/sol-profiler/ @LogvinovLeon
packages/sol-trace/ @LogvinovLeon
packages/sol-trace-based-tools-common/ @LogvinovLeon
packages/sol-resolver/ @LogvinovLeon
packages/subproviders/ @fabioberger @dekz
packages/verdaccio/ @albrow
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@0x/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0x/web3-wrapper.svg)](https://www.npmjs.com/package/@0x/web3-wrapper) | An Ethereum JSON RPC client |
| [`@0x/sol-compiler`](/packages/sol-compiler) | [![npm](https://img.shields.io/npm/v/@0x/sol-compiler.svg)](https://www.npmjs.com/package/@0x/sol-compiler) | A wrapper around solc-js that adds smart re-compilation, ability to compile an entire project, Solidity version specific compilation, standard input description support and much more. |
| [`@0x/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0x/sol-cov.svg)](https://www.npmjs.com/package/@0x/sol-cov) | A solidity test coverage tool |
| [`@0x/sol-coverage`](/packages/sol-coverage) | [![npm](https://img.shields.io/npm/v/@0x/sol-coverage.svg)](https://www.npmjs.com/package/@0x/sol-coverage) | A solidity test coverage tool |
| [`@0x/sol-profiler`](/packages/sol-profiler) | [![npm](https://img.shields.io/npm/v/@0x/sol-profiler.svg)](https://www.npmjs.com/package/@0x/sol-profiler) | A solidity gas cost profiler |
| [`@0x/sol-trace`](/packages/sol-trace) | [![npm](https://img.shields.io/npm/v/@0x/sol-trace.svg)](https://www.npmjs.com/package/@0x/sol-trace) | A solidity stack trace tool |
| [`@0x/sol-resolver`](/packages/sol-resolver) | [![npm](https://img.shields.io/npm/v/@0x/sol-resolver.svg)](https://www.npmjs.com/package/@0x/sol-resolver) | Import resolver for smart contracts dependencies |
| [`@0x/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0x/subproviders.svg)](https://www.npmjs.com/package/@0x/subproviders) | Web3 provider middlewares (e.g. LedgerSubprovider) |
| [`@0x/sol-doc`](/packages/sol-doc) | [![npm](https://img.shields.io/npm/v/@0x/sol-doc.svg)](https://www.npmjs.com/package/@0x/sol-doc) | Solidity documentation generator |
Expand Down
2 changes: 1 addition & 1 deletion contracts/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST_PROVIDER=geth yarn test

## Code coverage

In order to see the Solidity code coverage output generated by `@0x/sol-cov`, run:
In order to see the Solidity code coverage output generated by `@0x/sol-coverage`, run:

```
yarn test:coverage
Expand Down
1 change: 0 additions & 1 deletion contracts/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@0x/contracts-test-utils": "^1.0.2",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
1 change: 0 additions & 1 deletion contracts/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@0x/contracts-test-utils": "^1.0.2",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
1 change: 0 additions & 1 deletion contracts/libs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@0x/contracts-test-utils": "^1.0.2",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
1 change: 0 additions & 1 deletion contracts/multisig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@0x/contracts-test-utils": "^1.0.2",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
1 change: 0 additions & 1 deletion contracts/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"@0x/abi-gen": "^1.0.19",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
4 changes: 3 additions & 1 deletion contracts/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"@0x/dev-utils": "^1.0.21",
"@0x/order-utils": "^3.0.7",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/sol-coverage": "^1.0.0",
"@0x/sol-profiler": "^1.0.0",
"@0x/sol-trace": "^1.0.0",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@0x/types": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-utils/src/coverage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { devConstants } from '@0x/dev-utils';
import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-coverage';
import * as _ from 'lodash';

let coverageSubprovider: CoverageSubprovider;
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-utils/src/profiler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { devConstants } from '@0x/dev-utils';
import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-profiler';
import * as _ from 'lodash';

let profilerSubprovider: ProfilerSubprovider;
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-utils/src/revert_trace.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { devConstants } from '@0x/dev-utils';
import { RevertTraceSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import { RevertTraceSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-trace';
import * as _ from 'lodash';

let revertTraceSubprovider: RevertTraceSubprovider;
Expand Down
1 change: 0 additions & 1 deletion contracts/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@0x/contracts-test-utils": "^1.0.2",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
1 change: 0 additions & 1 deletion contracts/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@0x/contracts-test-utils": "^1.0.2",
"@0x/dev-utils": "^1.0.21",
"@0x/sol-compiler": "^1.1.16",
"@0x/sol-cov": "^2.1.16",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@types/bn.js": "^4.11.0",
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"config": {
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic",
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-cov ethereum-types asset-buyer migrations"
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations"
},
"bundlewatch": {
"files": [
Expand All @@ -62,6 +62,9 @@
"repoBranchBase": "development"
}
},
"resolutions": {
"graceful-fs": "4.1.15"
},
"devDependencies": {
"@0x-lerna-fork/lerna": "3.0.0-beta.26",
"@0xproject/npm-cli-login": "^0.0.11",
Expand Down
3 changes: 2 additions & 1 deletion packages/metacoin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@0x/abi-gen": "^1.0.19",
"@0x/abi-gen-templates": "^1.0.1",
"@0x/base-contract": "^3.0.10",
"@0x/sol-cov": "^2.1.16",
"@0x/sol-coverage": "^1.0.0",
"@0x/sol-profiler": "^1.0.0",
"@0x/subproviders": "^2.1.8",
"@0x/tslint-config": "^2.0.0",
"@0x/types": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/metacoin/test/utils/coverage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { devConstants } from '@0x/dev-utils';
import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-coverage';
import * as _ from 'lodash';

import { config } from './config';
Expand Down
2 changes: 1 addition & 1 deletion packages/metacoin/test/utils/profiler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { devConstants } from '@0x/dev-utils';
import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-profiler';
import * as _ from 'lodash';

import { config } from './config';
Expand Down
6 changes: 0 additions & 6 deletions packages/sol-cov/tslint.json

This file was deleted.

File renamed without changes.
12 changes: 12 additions & 0 deletions packages/sol-coverage/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"version": "1.0.0",
"changes": [
{
"note":
"Initial release as a separate package. For historic entries check @0x/sol-trace-based-tools-common",
"pr": 1492
}
]
}
]
14 changes: 7 additions & 7 deletions packages/sol-cov/README.md → packages/sol-coverage/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
## @0x/sol-cov
## @0x/sol-coverage

A Solidity code coverage tool.

### Read the [Documentation](https://0xproject.com/docs/sol-cov).
### Read the [Documentation](https://0xproject.com/docs/sol-coverage).

## Installation

```bash
yarn add @0x/sol-cov
yarn add @0x/sol-coverage
```

**Import**

```javascript
import { CoverageSubprovider } from '@0x/sol-cov';
import { CoverageSubprovider } from '@0x/sol-coverage';
```

or

```javascript
var CoverageSubprovider = require('@0x/sol-cov').CoverageSubprovider;
var CoverageSubprovider = require('@0x/sol-coverage').CoverageSubprovider;
```

## Contributing
Expand Down Expand Up @@ -47,13 +47,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:

```bash
PKG=@0x/sol-cov yarn build
PKG=@0x/sol-coverage yarn build
```

Or continuously rebuild on change:

```bash
PKG=@0x/sol-cov yarn watch
PKG=@0x/sol-coverage yarn watch
```

### Clean
Expand Down
52 changes: 52 additions & 0 deletions packages/sol-coverage/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@0x/sol-coverage",
"version": "1.0.0",
"engines": {
"node": ">=6.12"
},
"description": "Generate coverage reports for Solidity code",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build": "tsc -b",
"build:ci": "yarn build",
"lint": "tslint --format stylish --project .",
"clean": "shx rm -rf lib src/artifacts generated_docs",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {
"assets": []
}
},
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/0xProject/0x-monorepo/issues"
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-coverage/README.md",
"dependencies": {
"@0x/subproviders": "^2.1.8",
"@0x/sol-trace-based-tools-common": "^2.1.16",
"@0x/typescript-typings": "^3.0.6",
"ethereum-types": "^1.1.4",
"lodash": "^4.17.5"
},
"devDependencies": {
"@0x/tslint-config": "^2.0.0",
"@types/node": "*",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"tslint": "5.11.0",
"typedoc": "0.13.0",
"typescript": "3.0.1"
},
"publishConfig": {
"access": "public"
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import * as _ from 'lodash';

import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter';
import { collectCoverageEntries } from './collect_coverage_entries';
import { SingleFileSubtraceHandler, TraceCollector } from './trace_collector';
import { TraceInfoSubprovider } from './trace_info_subprovider';
import {
AbstractArtifactAdapter,
BranchCoverage,
collectCoverageEntries,
ContractData,
Coverage,
FunctionCoverage,
FunctionDescription,
SingleFileSubtraceHandler,
SourceRange,
StatementCoverage,
StatementDescription,
Subtrace,
TraceCollector,
TraceInfo,
} from './types';
import { utils } from './utils';
TraceInfoSubprovider,
utils,
} from '@0x/sol-trace-based-tools-common';
import * as _ from 'lodash';

/**
* This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions packages/sol-coverage/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export { CoverageSubprovider } from './coverage_subprovider';
export {
SolCompilerArtifactAdapter,
TruffleArtifactAdapter,
AbstractArtifactAdapter,
ContractData,
} from '@0x/sol-trace-based-tools-common';

export {
JSONRPCRequestPayload,
Provider,
JSONRPCErrorCallback,
JSONRPCResponsePayload,
JSONRPCResponseError,
} from 'ethereum-types';

export {
JSONRPCRequestPayloadWithMethod,
NextCallback,
ErrorCallback,
OnNextCompleted,
Callback,
} from '@0x/subproviders';
Loading

0 comments on commit 2c974b5

Please sign in to comment.