Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(permit2-sdk): separate cjs and esm builds, remove tsdx #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading