Skip to content

Commit bb5c9f8

Browse files
committed
feat(uniswapx): add esm build
1 parent ff2be9a commit bb5c9f8

9 files changed

+55
-19
lines changed

sdks/uniswapx-sdk/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"parser": "@typescript-eslint/parser",
33
"parserOptions": {
4-
"project": "./tsconfig.json"
4+
"project": "./tsconfig.base.json"
55
},
66
"env": {
77
"es6": true
@@ -60,4 +60,4 @@
6060
"always-multiline"
6161
]
6262
}
63-
}
63+
}

sdks/uniswapx-sdk/integration/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
"chai": "^4.3.6",
2525
"hardhat": "^2.22.15",
2626
"husky": "^8.0.3",
27-
"ts-node": "^10.9.1",
28-
"tsdx": "^0.14.1"
27+
"ts-node": "^10.9.1"
2928
},
3029
"dependencies": {
3130
"@ethersproject/bytes": "^5.7.0",

sdks/uniswapx-sdk/jest.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22
module.exports = {
33
preset: 'ts-jest',
44
testEnvironment: 'node',
5-
};
5+
globals: {
6+
'ts-jest': {
7+
tsconfig: 'tsconfig.base.json'
8+
}
9+
}
10+
};

sdks/uniswapx-sdk/package.json

+17-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
"ethereum"
88
],
99
"license": "MIT",
10-
"main": "dist/src/index.js",
11-
"typings": "dist/src/index.d.ts",
12-
"module": "dist/uniswapx-sdk.esm.js",
10+
"main": "./dist/cjs/src/index.js",
11+
"typings": "./dist/types/src/index.d.ts",
12+
"module": "./dist/esm/src/index.js",
1313
"files": [
1414
"dist"
1515
],
1616
"engines": {
1717
"node": ">=10"
1818
},
1919
"scripts": {
20-
"build": "yarn run typechain && tsc -p tsconfig.json",
20+
"clean": "rm -rf dist",
21+
"build": "yarn clean && yarn run typechain && yarn build:cjs && yarn build:esm && yarn build:types",
22+
"build:cjs": "tsc -p tsconfig.cjs.json",
23+
"build:esm": "tsc -p tsconfig.esm.json",
24+
"build:types": "tsc -p tsconfig.types.json",
2125
"lint": "eslint src --ext .ts",
2226
"lint:fix": "eslint src --ext .ts --fix",
2327
"prettier": "prettier \"src/**/*.ts\" --list-different",
@@ -96,5 +100,13 @@
96100
}
97101
]
98102
]
99-
}
103+
},
104+
"exports": {
105+
".": {
106+
"types": "./dist/types/src/index.d.ts",
107+
"import": "./dist/esm/src/index.js",
108+
"require": "./dist/cjs/src/index.js"
109+
}
110+
},
111+
"sideEffects": false
100112
}

sdks/uniswapx-sdk/tsconfig.json sdks/uniswapx-sdk/tsconfig.base.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
2-
"include": [
3-
"src"
4-
],
2+
"include": ["src", "abis"],
53
"compilerOptions": {
6-
"outDir": "dist",
4+
"rootDir": ".",
5+
"baseUrl": ".",
76
"target": "es6",
8-
"module": "commonjs",
97
"importHelpers": true,
108
"declaration": true,
119
"sourceMap": true,
@@ -23,6 +21,7 @@
2321
"moduleResolution": "node",
2422
"resolveJsonModule": true,
2523
"esModuleInterop": true,
26-
"skipLibCheck": true
27-
},
28-
}
24+
"skipLibCheck": true,
25+
"isolatedModules": true
26+
}
27+
}

sdks/uniswapx-sdk/tsconfig.cjs.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"outDir": "dist/cjs"
6+
}
7+
}

sdks/uniswapx-sdk/tsconfig.esm.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"outDir": "dist/esm"
6+
}
7+
}

sdks/uniswapx-sdk/tsconfig.types.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"emitDeclarationOnly": true,
6+
"outDir": "dist/types"
7+
}
8+
}

yarn.lock

-1
Original file line numberDiff line numberDiff line change
@@ -17616,7 +17616,6 @@ __metadata:
1761617616
hardhat: ^2.22.15
1761717617
husky: ^8.0.3
1761817618
ts-node: ^10.9.1
17619-
tsdx: ^0.14.1
1762017619
typechain: ^8.1.0
1762117620
languageName: unknown
1762217621
linkType: soft

0 commit comments

Comments
 (0)