Skip to content

Commit

Permalink
Merge pull request #82 from kaiachain/feat/support-esm-sdk
Browse files Browse the repository at this point in the history
feat: support esm for web3js-ext and ethers-ext
  • Loading branch information
Sotatek-TanHoang authored Jan 21, 2025
2 parents 363a287 + 1d48173 commit 75ae4f0
Show file tree
Hide file tree
Showing 10 changed files with 625 additions and 72 deletions.
4 changes: 4 additions & 0 deletions ethers-ext/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json.schemastore.org/mocharc.json",
"require": "tsx"
}
24 changes: 15 additions & 9 deletions ethers-ext/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 19 additions & 14 deletions ethers-ext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kaiachain/ethers-ext",
"version": "1.1.1",
"version": "1.1.0",
"license": "MIT",
"description": "ethers.js extension for kaia blockchain",
"keywords": [
Expand All @@ -19,20 +19,24 @@
"type": "git",
"url": "https://github.com/kaiachain/kaia-sdk"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"types": "dist/esm/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js"
},
"./v5": {
"types": "./dist/v5/index.d.ts",
"default": "./dist/v5/index.js"
"types": "./dist/esm/v5/index.d.ts",
"import": "./dist/esm/v5/index.js",
"default": "./dist/cjs/v5/index.js"
},
"./v6": {
"types": "./dist/v6/index.d.ts",
"default": "./dist/v6/index.js"
"types": "./dist/esm/v6/index.d.ts",
"import": "./dist/esm/v6/index.js",
"default": "./dist/cjs/v6/index.js"
}
},
"files": [
Expand All @@ -41,13 +45,13 @@
],
"scripts": {
"build": "npm run build:esm && npm run build:bundle",
"build:esm": "tsc",
"build:esm": "tsc && tsc -p tsconfig.cjs.json",
"build:bundle": "webpack --mode production",
"watch": "tsc -w",
"lint": "npm run lint:check",
"lint:check": "eslint example src test --cache --quiet",
"lint:fix": "eslint example src test --cache --fix",
"test": "mocha --timeout 50000 -r ts-node/register \"test/**/*.ts\"",
"test": "mocha --timeout 50000 \"test/**/*.ts\"",
"prepublishOnly": "npm run build"
},
"devDependencies": {
Expand All @@ -66,6 +70,7 @@
"mocha": "^10.2.0",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"tsx": "^4.19.2",
"typedoc": "^0.25.4",
"typescript": "^5.0.4",
"webpack": "^5.89.0",
Expand All @@ -91,9 +96,9 @@
"@ethersproject/transactions": "^5.7.0",
"@ethersproject/wallet": "^5.7.0",
"@ethersproject/web": "^5.7.1",
"@kaiachain/web3rpc": "^1.2.0",
"@kaiachain/js-ext-core": "^1.2.0",
"ethers6": "npm:ethers@^6.12.1",
"@kaiachain/js-ext-core": "^1.1.1",
"@kaiachain/web3rpc": "^1.0.0",
"lodash": "^4.17.21"
}
}
}
8 changes: 8 additions & 0 deletions ethers-ext/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "nodenext",
"outDir": "./dist/cjs"
}
}
29 changes: 18 additions & 11 deletions ethers-ext/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"compilerOptions": {
"target": "ES2017",
"module": "nodenext",
"moduleResolution": "nodenext",
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "bundler",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"rootDirs": ["./src", "./test"],
"outDir": "./dist/esm",
"strict": true,
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"rootDirs": [
"./src"
],
},
"exclude": ["dist", "example", "node_modules"],
"include": ["./src"]
}
"exclude": [
"dist",
"example",
"node_modules"
],
"include": [
"./src"
]
}
4 changes: 4 additions & 0 deletions web3js-ext/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json.schemastore.org/mocharc.json",
"require": "tsx"
}
Loading

0 comments on commit 75ae4f0

Please sign in to comment.