aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-cov')
-rw-r--r--packages/sol-cov/CHANGELOG.json84
-rw-r--r--packages/sol-cov/CHANGELOG.md38
-rw-r--r--packages/sol-cov/README.md12
-rw-r--r--packages/sol-cov/package.json54
-rw-r--r--packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts9
-rw-r--r--packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts7
-rw-r--r--packages/sol-cov/src/index.ts23
-rw-r--r--packages/sol-cov/src/monorepo_scripts/postpublish.ts8
-rw-r--r--packages/sol-cov/src/monorepo_scripts/stage_docs.ts8
-rw-r--r--packages/sol-cov/src/revert_trace.ts2
-rw-r--r--packages/sol-cov/src/trace.ts2
-rw-r--r--packages/sol-cov/src/trace_collection_subprovider.ts9
-rw-r--r--packages/sol-cov/src/trace_collector.ts2
-rw-r--r--packages/sol-cov/src/utils.ts2
-rw-r--r--packages/sol-cov/tsconfig.json3
-rw-r--r--packages/sol-cov/tslint.json2
-rw-r--r--packages/sol-cov/typedoc-tsconfig.json7
17 files changed, 201 insertions, 71 deletions
diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json
index 5f6b1685b..cbee0233b 100644
--- a/packages/sol-cov/CHANGELOG.json
+++ b/packages/sol-cov/CHANGELOG.json
@@ -1,5 +1,89 @@
[
{
+ "version": "2.1.8",
+ "changes": [
+ {
+ "note": "Make @types/solidity-parser-antlr a 'dependency' so it's available to users of the library",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
+ "version": "2.1.7",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1538693146
+ },
+ {
+ "timestamp": 1538157789,
+ "version": "2.1.6",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1537907159,
+ "version": "2.1.5",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1537875740,
+ "version": "2.1.4",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1537541580,
+ "version": "2.1.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1536142250,
+ "version": "2.1.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1535377027,
+ "version": "2.1.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "version": "2.1.0",
+ "changes": [
+ {
+ "note":
+ "Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback`",
+ "pr": 924
+ }
+ ],
+ "timestamp": 1535133899
+ },
+ {
"version": "2.0.0",
"changes": [
{
diff --git a/packages/sol-cov/CHANGELOG.md b/packages/sol-cov/CHANGELOG.md
index d7bdb9614..11ed486e2 100644
--- a/packages/sol-cov/CHANGELOG.md
+++ b/packages/sol-cov/CHANGELOG.md
@@ -5,7 +5,43 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
-## v2.0.0 - _August 13, 2018_
+## v2.1.8 - _October 18, 2018_
+
+ * Make @types/solidity-parser-antlr a 'dependency' so it's available to users of the library (#1105)
+
+## v2.1.7 - _October 4, 2018_
+
+ * Dependencies updated
+
+## v2.1.6 - _September 28, 2018_
+
+ * Dependencies updated
+
+## v2.1.5 - _September 25, 2018_
+
+ * Dependencies updated
+
+## v2.1.4 - _September 25, 2018_
+
+ * Dependencies updated
+
+## v2.1.3 - _September 21, 2018_
+
+ * Dependencies updated
+
+## v2.1.2 - _September 5, 2018_
+
+ * Dependencies updated
+
+## v2.1.1 - _August 27, 2018_
+
+ * Dependencies updated
+
+## v2.1.0 - _August 24, 2018_
+
+ * Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback` (#924)
+
+## v2.0.0 - _August 14, 2018_
* Fix a bug when eth_call coverage was not computed because of silent schema validation failures (#938)
* Make `TruffleArtifactAdapter` read the `truffle.js` config for `solc` settings (#938)
diff --git a/packages/sol-cov/README.md b/packages/sol-cov/README.md
index 0a63ac06e..31d73dc63 100644
--- a/packages/sol-cov/README.md
+++ b/packages/sol-cov/README.md
@@ -1,4 +1,4 @@
-## @0xproject/sol-cov
+## @0x/sol-cov
A Solidity code coverage tool.
@@ -7,19 +7,19 @@ A Solidity code coverage tool.
## Installation
```bash
-yarn add @0xproject/sol-cov
+yarn add @0x/sol-cov
```
**Import**
```javascript
-import { CoverageSubprovider } from '@0xproject/sol-cov';
+import { CoverageSubprovider } from '@0x/sol-cov';
```
or
```javascript
-var CoverageSubprovider = require('@0xproject/sol-cov').CoverageSubprovider;
+var CoverageSubprovider = require('@0x/sol-cov').CoverageSubprovider;
```
## Contributing
@@ -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=@0xproject/sol-cov yarn build
+PKG=@0x/sol-cov yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/sol-cov yarn watch
+PKG=@0x/sol-cov yarn watch
```
### Clean
diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json
index bc24fd1dc..09119321d 100644
--- a/packages/sol-cov/package.json
+++ b/packages/sol-cov/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/sol-cov",
- "version": "2.0.0",
+ "name": "@0x/sol-cov",
+ "version": "2.1.8",
"engines": {
"node": ">=6.12"
},
@@ -8,36 +8,28 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "watch_without_deps": "yarn pre_build && tsc -w",
- "build": "yarn pre_build && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
+ "build": "yarn pre_build && tsc -b",
+ "build:ci": "yarn build",
"pre_build": "run-s copy_test_fixtures",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "run-s compile_test run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"test:circleci": "yarn test:coverage",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
- "clean": "shx rm -rf lib scripts test/fixtures/artifacts src/artifacts",
+ "clean": "shx rm -rf lib test/fixtures/artifacts src/artifacts generated_docs",
"copy_test_fixtures": "copyfiles 'test/fixtures/**/*' ./lib",
"compile_test": "sol-compiler compile",
- "manual:postpublish": "yarn build; node ./scripts/postpublish.js",
- "docs:stage": "node scripts/stage_docs.js",
- "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
- "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
+ "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {
"assets": [],
- "docPublishConfigs": {
- "extraFileIncludes": [
- "../subproviders/src/types.ts",
- "../types/src/index.ts",
- "../ethereum-types/src/index.ts"
- ],
- "s3BucketPath": "s3://doc-jsons/sol-cov/",
- "s3StagingBucketPath": "s3://staging-doc-jsons/sol-cov/"
- }
+ "docOmitExports": [
+ "ProfilerSubprovider",
+ "RevertTraceSubprovider"
+ ]
}
},
"repository": {
@@ -50,14 +42,14 @@
},
"homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md",
"dependencies": {
- "@0xproject/dev-utils": "^1.0.4",
- "@0xproject/sol-compiler": "^1.0.5",
- "@0xproject/subproviders": "^1.0.5",
- "@0xproject/typescript-typings": "^1.0.4",
- "@0xproject/utils": "^1.0.5",
- "@0xproject/web3-wrapper": "^1.2.0",
- "@types/solidity-parser-antlr": "^0.2.1",
- "ethereum-types": "^1.0.4",
+ "@0x/dev-utils": "^1.0.13",
+ "@0x/sol-compiler": "^1.1.8",
+ "@0x/subproviders": "^2.1.0",
+ "@0x/typescript-typings": "^3.0.3",
+ "@0x/utils": "^2.0.3",
+ "@0x/web3-wrapper": "^3.1.0",
+ "@types/solidity-parser-antlr": "^0.2.0",
+ "ethereum-types": "^1.1.1",
"ethereumjs-util": "^5.1.1",
"glob": "^7.1.2",
"istanbul": "^0.4.5",
@@ -69,15 +61,13 @@
"solidity-parser-antlr": "^0.2.12"
},
"devDependencies": {
- "@0xproject/monorepo-scripts": "^1.0.5",
- "@0xproject/tslint-config": "^1.0.5",
+ "@0x/tslint-config": "^1.0.9",
"@types/istanbul": "^0.4.30",
"@types/loglevel": "^1.5.3",
"@types/mkdirp": "^0.5.1",
"@types/mocha": "^2.2.42",
- "@types/node": "^8.0.53",
+ "@types/node": "*",
"@types/rimraf": "^2.0.2",
- "@types/solidity-parser-antlr": "^0.2.1",
"chai": "^4.0.1",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
@@ -88,7 +78,7 @@
"shx": "^0.2.2",
"sinon": "^4.0.0",
"tslint": "5.11.0",
- "typedoc": "0xProject/typedoc",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"publishConfig": {
diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts
index 8e03bf7fd..57391abbe 100644
--- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts
+++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts
@@ -1,5 +1,5 @@
-import { CompilerOptions, ContractArtifact } from '@0xproject/sol-compiler';
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
+import { CompilerOptions, ContractArtifact } from 'ethereum-types';
import * as fs from 'fs';
import * as glob from 'glob';
import * as _ from 'lodash';
@@ -14,6 +14,11 @@ const CONFIG_FILE = 'compiler.json';
export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
private readonly _artifactsPath: string;
private readonly _sourcesPath: string;
+ /**
+ * Instantiates a SolCompilerArtifactAdapter
+ * @param artifactsPath Path to your artifacts directory
+ * @param sourcesPath Path to your contract sources directory
+ */
constructor(artifactsPath?: string, sourcesPath?: string) {
super();
const config: CompilerOptions = fs.existsSync(CONFIG_FILE)
diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
index 2706435cc..f064911d3 100644
--- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
+++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
@@ -1,4 +1,4 @@
-import { Compiler, CompilerOptions } from '@0xproject/sol-compiler';
+import { Compiler, CompilerOptions } from '@0x/sol-compiler';
import * as fs from 'fs';
import * as glob from 'glob';
import * as path from 'path';
@@ -18,6 +18,11 @@ interface TruffleConfig {
export class TruffleArtifactAdapter extends AbstractArtifactAdapter {
private readonly _solcVersion: string;
private readonly _projectRoot: string;
+ /**
+ * Instantiates a TruffleArtifactAdapter
+ * @param projectRoot Path to the truffle project's root directory
+ * @param solcVersion Solidity version with which to compile all the contracts
+ */
constructor(projectRoot: string, solcVersion: string) {
super();
this._solcVersion = solcVersion;
diff --git a/packages/sol-cov/src/index.ts b/packages/sol-cov/src/index.ts
index 003a27374..348e0fc9b 100644
--- a/packages/sol-cov/src/index.ts
+++ b/packages/sol-cov/src/index.ts
@@ -1,8 +1,25 @@
export { CoverageSubprovider } from './coverage_subprovider';
-// HACK: ProfilerSubprovider is a hacky way to do profiling using coverage tools. Not production ready
-export { ProfilerSubprovider } from './profiler_subprovider';
-export { RevertTraceSubprovider } from './revert_trace_subprovider';
export { SolCompilerArtifactAdapter } from './artifact_adapters/sol_compiler_artifact_adapter';
export { TruffleArtifactAdapter } from './artifact_adapters/truffle_artifact_adapter';
export { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter';
+
+// HACK: ProfilerSubprovider is a hacky way to do profiling using coverage tools. Not production ready
+export { ProfilerSubprovider } from './profiler_subprovider';
+export { RevertTraceSubprovider } from './revert_trace_subprovider';
+
export { ContractData } from './types';
+export {
+ JSONRPCRequestPayload,
+ Provider,
+ JSONRPCErrorCallback,
+ JSONRPCResponsePayload,
+ JSONRPCResponseError,
+} from 'ethereum-types';
+
+export {
+ JSONRPCRequestPayloadWithMethod,
+ NextCallback,
+ ErrorCallback,
+ OnNextCompleted,
+ Callback,
+} from '@0x/subproviders';
diff --git a/packages/sol-cov/src/monorepo_scripts/postpublish.ts b/packages/sol-cov/src/monorepo_scripts/postpublish.ts
deleted file mode 100644
index dcb99d0f7..000000000
--- a/packages/sol-cov/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-cov/src/monorepo_scripts/stage_docs.ts b/packages/sol-cov/src/monorepo_scripts/stage_docs.ts
deleted file mode 100644
index e732ac8eb..000000000
--- a/packages/sol-cov/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-cov/src/revert_trace.ts b/packages/sol-cov/src/revert_trace.ts
index a78d1afa8..d60c6e7d9 100644
--- a/packages/sol-cov/src/revert_trace.ts
+++ b/packages/sol-cov/src/revert_trace.ts
@@ -1,4 +1,4 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts
index 635019fc0..b38dbdce0 100644
--- a/packages/sol-cov/src/trace.ts
+++ b/packages/sol-cov/src/trace.ts
@@ -1,4 +1,4 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/sol-cov/src/trace_collection_subprovider.ts b/packages/sol-cov/src/trace_collection_subprovider.ts
index b6486e6f7..25e38768d 100644
--- a/packages/sol-cov/src/trace_collection_subprovider.ts
+++ b/packages/sol-cov/src/trace_collection_subprovider.ts
@@ -1,6 +1,6 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders';
-import { CallDataRPC, marshaller, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0x/subproviders';
+import { CallDataRPC, marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { JSONRPCRequestPayload, Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';
@@ -63,7 +63,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
* turn to handle a JSON RPC request.
* @param payload JSON RPC payload
* @param next Callback to call if this subprovider decides not to handle the request
- * @param end Callback to call if subprovider handled the request and wants to pass back the request.
+ * @param _end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:prefer-function-over-method async-suffix
public async handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, _end: ErrorCallback): Promise<void> {
@@ -109,6 +109,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
* Set's the subprovider's engine to the ProviderEngine it is added to.
* This is only called within the ProviderEngine source code, do not call
* directly.
+ * @param engine The ProviderEngine this subprovider is added to
*/
public setEngine(engine: Provider): void {
super.setEngine(engine);
diff --git a/packages/sol-cov/src/trace_collector.ts b/packages/sol-cov/src/trace_collector.ts
index 3e2ae3516..44cffc238 100644
--- a/packages/sol-cov/src/trace_collector.ts
+++ b/packages/sol-cov/src/trace_collector.ts
@@ -1,4 +1,4 @@
-import { promisify } from '@0xproject/utils';
+import { promisify } from '@0x/utils';
import { stripHexPrefix } from 'ethereumjs-util';
import * as fs from 'fs';
import { Collector } from 'istanbul';
diff --git a/packages/sol-cov/src/utils.ts b/packages/sol-cov/src/utils.ts
index b696bd463..d8bc65e73 100644
--- a/packages/sol-cov/src/utils.ts
+++ b/packages/sol-cov/src/utils.ts
@@ -1,4 +1,4 @@
-import { addressUtils, BigNumber } from '@0xproject/utils';
+import { addressUtils, BigNumber } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import { addHexPrefix } from 'ethereumjs-util';
import * as _ from 'lodash';
diff --git a/packages/sol-cov/tsconfig.json b/packages/sol-cov/tsconfig.json
index e35816553..2ee711adc 100644
--- a/packages/sol-cov/tsconfig.json
+++ b/packages/sol-cov/tsconfig.json
@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
- "outDir": "lib"
+ "outDir": "lib",
+ "rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}
diff --git a/packages/sol-cov/tslint.json b/packages/sol-cov/tslint.json
index 015dce851..631f46bca 100644
--- a/packages/sol-cov/tslint.json
+++ b/packages/sol-cov/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"completed-docs": false
}
diff --git a/packages/sol-cov/typedoc-tsconfig.json b/packages/sol-cov/typedoc-tsconfig.json
new file mode 100644
index 000000000..c9b0af1ae
--- /dev/null
+++ b/packages/sol-cov/typedoc-tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "extends": "../../typedoc-tsconfig",
+ "compilerOptions": {
+ "outDir": "lib"
+ },
+ "include": ["./src/**/*", "./test/**/*"]
+}