aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-cov')
-rw-r--r--packages/sol-cov/package.json21
-rw-r--r--packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts5
-rw-r--r--packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts5
-rw-r--r--packages/sol-cov/src/index.ts21
-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/trace_collection_subprovider.ts3
7 files changed, 34 insertions, 37 deletions
diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json
index bc24fd1dc..f63f6fb93 100644
--- a/packages/sol-cov/package.json
+++ b/packages/sol-cov/package.json
@@ -9,7 +9,7 @@
"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",
"pre_build": "run-s copy_test_fixtures",
"lint": "tslint --project .",
"test": "run-s compile_test run_mocha",
@@ -18,26 +18,16 @@
"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",
"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 --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/"
- }
+ "shouldPublishDocs": true,
+ "omitExports": ["ProfilerSubprovider", "RevertTraceSubprovider"]
}
},
"repository": {
@@ -69,7 +59,6 @@
"solidity-parser-antlr": "^0.2.12"
},
"devDependencies": {
- "@0xproject/monorepo-scripts": "^1.0.5",
"@0xproject/tslint-config": "^1.0.5",
"@types/istanbul": "^0.4.30",
"@types/loglevel": "^1.5.3",
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..0601c5729 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
@@ -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..b4d1aa7ba 100644
--- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
+++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
@@ -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..dd102a13b 100644
--- a/packages/sol-cov/src/index.ts
+++ b/packages/sol-cov/src/index.ts
@@ -1,8 +1,21 @@
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';
-export { ContractData } from './types';
+
+// 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,
+ TraceInfo,
+ Subtrace,
+ SourceRange,
+ Coverage,
+ TraceInfoNewContract,
+ TraceInfoExistingContract,
+ SingleFileSourceRange,
+} from './types';
+export { StructLog, JSONRPCRequestPayload, Provider } from 'ethereum-types';
+export { ErrorCallback, NextCallback } from '@0xproject/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/trace_collection_subprovider.ts b/packages/sol-cov/src/trace_collection_subprovider.ts
index b6486e6f7..a69bccb07 100644
--- a/packages/sol-cov/src/trace_collection_subprovider.ts
+++ b/packages/sol-cov/src/trace_collection_subprovider.ts
@@ -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);