Skip to content

Commit

Permalink
feat(permit2-sdk): separate cjs and esm builds, remove tsdx
Browse files Browse the repository at this point in the history
  • Loading branch information
just-toby committed Dec 16, 2024
1 parent c4941d1 commit 4781fa9
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 34 deletions.
26 changes: 17 additions & 9 deletions sdks/permit2-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@
"ethereum"
],
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"main": "./dist/cjs/src/index.js",
"module": "./dist/esm/src/index.js",
"types": "./dist/types/src/index.d.ts",
"exports": {
".": {
"types": "./dist/types/src/index.d.ts",
"import": "./dist/esm/src/index.js",
"require": "./dist/cjs/src/index.js"
}
},
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"build": "tsdx build",
"interop": "yarn node writeInterop.js",
"lint": "prettier --check src/",
"release": "semantic-release",
"start": "tsdx watch",
"test": "tsdx test --testPathIgnorePatterns=/permit2/"
"build": "yarn clean && yarn build:cjs && yarn build:esm && yarn build:types",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"build:types": "tsc -p tsconfig.types.json",
"clean": "rm -rf ./dist"
},
"dependencies": {
"ethers": "^5.7.0",
Expand All @@ -27,7 +35,7 @@
"devDependencies": {
"@types/jest": "^24.0.25",
"prettier": "^2.4.1",
"tsdx": "^0.14.1"
"typescript": "^4.3.3"
},
"prettier": {
"printWidth": 120,
Expand Down
18 changes: 18 additions & 0 deletions sdks/permit2-sdk/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"include": ["src", "abis"],
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"target": "es6",
"module": "esnext",
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"skipLibCheck": true,
"isolatedModules": true
}
}
9 changes: 9 additions & 0 deletions sdks/permit2-sdk/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist/cjs",
"target": "es2015"
},
"include": ["src/**/*", "abis/**/*"]
}
9 changes: 9 additions & 0 deletions sdks/permit2-sdk/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "esnext",
"outDir": "dist/esm",
"target": "es2015"
},
"include": ["src/**/*", "abis/**/*"]
}
24 changes: 0 additions & 24 deletions sdks/permit2-sdk/tsconfig.json

This file was deleted.

9 changes: 9 additions & 0 deletions sdks/permit2-sdk/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "dist/types"
},
"include": ["src", "abis"]
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4505,7 +4505,7 @@ __metadata:
ethers: ^5.7.0
prettier: ^2.4.1
tiny-invariant: ^1.1.0
tsdx: ^0.14.1
typescript: ^4.3.3
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 4781fa9

Please sign in to comment.