Skip to content

Commit fc90605

Browse files
authored
Fix dist package for typescript (#173)
* Use tsconfig.declarationMap, sourceMap * Update version to 0.1.6
1 parent ac8a53e commit fc90605

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,21 @@ OR `yarn test:clean` if contracts have been typings need to be updated
4747

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

50+
```
51+
npm install @setprotocol/set-protocol-v2
52+
```
53+
5054
The distribution also comes with fixtures for mocking and testing SetProtocol's interactions with
5155
other protocols including Uniswap, Balancer, Compound (and many more.) To use these you'll need to install the peer dependencies listed in `package.json`.
5256

53-
```
54-
npm install @setprotocol/set-protocol-v2
57+
#### Example Usage
58+
59+
```ts
60+
import { PerpV2Fixture } from "@setprotocol/set-protocol-v2/dist/utils/fixtures/PerpV2Fixture";
61+
import { getPerpV2Fixture } from "@setprotocol/set-protocol-v2/dist/utils/test";
62+
63+
let perpSetup: PerpV2Fixture;
64+
perpSetup = getPerpV2Fixture(...);
5565
```
5666

5767
[22]: https://www.npmjs.com/package/hardhat

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@setprotocol/set-protocol-v2",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "",
55
"main": "dist",
66
"types": "dist/types",
@@ -17,7 +17,7 @@
1717
"scripts": {
1818
"build": "yarn clean && yarn compile && yarn build:typechain",
1919
"build:npm": "yarn clean && yarn compile:npm && yarn build:typechain",
20-
"build:typechain": "yarn typechain && yarn transpile-dist",
20+
"build:typechain": "yarn typechain && yarn transpile-dist && cp -rf typechain dist",
2121
"chain": "npx hardhat node",
2222
"clean": "rm -rf coverage.json .coverage_cache .coverage_contracts cache coverage typechain artifacts dist",
2323
"compile": "npx hardhat compile",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"outDir": "dist",
99
"resolveJsonModule": true,
1010
"declaration": true,
11-
"declarationDir": "./dist/types",
11+
"declarationMap": true,
12+
"sourceMap": true,
1213
"baseUrl": ".",
1314
"moduleResolution": "node",
1415
"paths": {

0 commit comments

Comments
 (0)