Skip to content

Commit

Permalink
Fix dist package for typescript (#173)
Browse files Browse the repository at this point in the history
* Use tsconfig.declarationMap, sourceMap
* Update version to 0.1.6
  • Loading branch information
cgewecke authored Dec 14, 2021
1 parent ac8a53e commit fc90605
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,21 @@ OR `yarn test:clean` if contracts have been typings need to be updated

We publish our contracts as well as [hardhat][22] and [typechain][23] compilation artifacts to npm.

```
npm install @setprotocol/set-protocol-v2
```

The distribution also comes with fixtures for mocking and testing SetProtocol's interactions with
other protocols including Uniswap, Balancer, Compound (and many more.) To use these you'll need to install the peer dependencies listed in `package.json`.

```
npm install @setprotocol/set-protocol-v2
#### Example Usage

```ts
import { PerpV2Fixture } from "@setprotocol/set-protocol-v2/dist/utils/fixtures/PerpV2Fixture";
import { getPerpV2Fixture } from "@setprotocol/set-protocol-v2/dist/utils/test";

let perpSetup: PerpV2Fixture;
perpSetup = getPerpV2Fixture(...);
```

[22]: https://www.npmjs.com/package/hardhat
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@setprotocol/set-protocol-v2",
"version": "0.1.5",
"version": "0.1.6",
"description": "",
"main": "dist",
"types": "dist/types",
Expand All @@ -17,7 +17,7 @@
"scripts": {
"build": "yarn clean && yarn compile && yarn build:typechain",
"build:npm": "yarn clean && yarn compile:npm && yarn build:typechain",
"build:typechain": "yarn typechain && yarn transpile-dist",
"build:typechain": "yarn typechain && yarn transpile-dist && cp -rf typechain dist",
"chain": "npx hardhat node",
"clean": "rm -rf coverage.json .coverage_cache .coverage_contracts cache coverage typechain artifacts dist",
"compile": "npx hardhat compile",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"outDir": "dist",
"resolveJsonModule": true,
"declaration": true,
"declarationDir": "./dist/types",
"declarationMap": true,
"sourceMap": true,
"baseUrl": ".",
"moduleResolution": "node",
"paths": {
Expand Down

0 comments on commit fc90605

Please sign in to comment.