Skip to content

Commit

Permalink
chore: esm build (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk authored Aug 1, 2024
1 parent 2fddd2f commit be04d36
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
"version": "0.0.6",
"description": "Sdk for creating atomic swaps through 1inch",
"author": "@1inch",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/types/src/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"node": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
}
},
"files": [
"dist",
"LICENSE",
Expand All @@ -16,7 +23,10 @@
"url": "ssh://[email protected]:1inch/atomic-swap-sdk.git"
},
"scripts": {
"build": "tsc",
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
"build:esm": "tsc --project tsconfig.esm.json",
"build:cjs": "tsc --project tsconfig.cjs.json",
"build:types": "tsc --project tsconfig.types.json",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint:ci": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --ignore-path .eslintignore --fix",
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export {
AmountMode,
LimitOrderContract,
calcTakingAmount,
calcMakingAmount
calcMakingAmount,
PrivateKeyProviderConnector,
Web3ProviderConnector,
BlockchainProviderConnector,
HttpProviderConnector,
WsProviderConnector
} from '@1inch/fusion-sdk'
export * from './cross-chain-order'
export * from './escrow-factory'
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"module": "CommonJS",
"declaration": false,
"composite": false,
"resolveJsonModule": true,
"importHelpers": true,
}
}
11 changes: 11 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "./dist/esm",
"module": "ESNext",
"declaration": false,
"composite": false,
"resolveJsonModule": true,
"importHelpers": true
},
}
15 changes: 15 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/types",
"declaration": true,
"emitDeclarationOnly": true,
"composite": true
},
"exclude": [
"node_modules",
"test",
"dist",
"**/*spec.ts"
]
}

0 comments on commit be04d36

Please sign in to comment.