Skip to content

Commit

Permalink
Update npm packages build and publish npm packages (#285)
Browse files Browse the repository at this point in the history
- improved npm packages build scripts
- updated viem dependencies to locked version to be the same across the
sdk
- added new re-exports
- publish sdk npm packages
- added missing exports in the sdk common package
  • Loading branch information
piotrwitek authored May 24, 2024
1 parent 2c8cfab commit 9d643bc
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"dependencies": {
"bignumber.js": "^9.1.2",
"kysely": "^0.27.3",
"viem": "^2.9.19",
"viem": "2.9.19",
"zod": "^3.22.4"
}
}
1 change: 0 additions & 1 deletion packages/serverless-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"lint:fix": "eslint . --fix"
},
"dependencies": {
"viem": "^2.9.19",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
38 changes: 25 additions & 13 deletions pnpm-lock.yaml

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

10 changes: 7 additions & 3 deletions sdk/sdk-client/bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "@summer_fi/summerfi-sdk-client",
"version": "0.2.0",
"name": "summerfi-sdk-client",
"version": "0.2.6",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"packageManager": "yarn@1.22.21",
"scripts": {},
"dependencies": {
"abitype": "^1.0.2",
"bignumber.js": "^9.1.2",
"@trpc/client": "11.0.0-next-beta.264",
"@trpc/server": "11.0.0-next-beta.264",
"superjson": "^1.13.3",
"viem": "^2.7.9"
"viem": "2.9.19",
"zod": "^3.22.4"
}
}
2 changes: 1 addition & 1 deletion sdk/sdk-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": "tsc -b -v tsconfig.build.json",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"bundle:npm": "esbuild src/index.ts --platform=neutral --target=es2020 --conditions= --main-fields=main --bundle --sourcemap --outfile=bundle/dist/index.js --external:crypto --external:tls --external:https --external:net --external:http --external:stream --external:zlib --external:assert --keep-names && tsc --emitDeclarationOnly --outDir bundle/dist -p tsconfig.build.json",
"bundle:npm": "rm -rf bundle/dist bundle/tsconfig.build.tsbuildinfo && esbuild src/index.ts --platform=neutral --target=es2020 --conditions= --main-fields=main --bundle --sourcemap --outfile=bundle/dist/index.js --keep-names --external:crypto --external:tls --external:https --external:net --external:http --external:stream --external:zlib --external:assert --external:superjson --external:zod --external:bignumber.js --external:\"@trpc/client\" --external:abitype --external:viem && tsc --emitDeclarationOnly --outDir bundle/dist -p tsconfig.build.json",
"publish:npm": "pnpm bundle:npm && cd bundle && npm publish && cd .."
},
"dependencies": {
Expand Down
4 changes: 4 additions & 0 deletions sdk/sdk-client/src/protocol-plugins-reexport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

export {
MakerLendingPoolId,
type IMakerLendingPoolId,
MakerPosition,
MakerPositionId,
isMakerLendingPoolId,
} from '@summerfi/protocol-plugins/plugins/maker'
export {
SparkLendingPoolId,
type ISparkLendingPoolId,
SparkPosition,
SparkPositionId,
isSparkLendingPoolId,
} from '@summerfi/protocol-plugins/plugins/spark'
export {
AaveV3LendingPoolId,
type IAaveV3LendingPoolId,
AaveV3Position,
AaveV3PositionId,
isAaveV3LendingPoolId,
} from '@summerfi/protocol-plugins/plugins/aave-v3'
export {
MorphoLendingPoolId,
type IMorphoLendingPoolId,
MorphoPosition,
MorphoPositionId,
isMorphoLendingPoolId,
Expand Down
7 changes: 4 additions & 3 deletions sdk/sdk-common/bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@summer_fi/summerfi-sdk-common",
"version": "0.1.4",
"name": "summerfi-sdk-common",
"version": "0.2.5",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"packageManager": "yarn@1.22.21",
"scripts": {},
"dependencies": {
"bignumber.js": "^9.1.2",
"superjson": "^1.13.3",
"viem": "^2.2.0"
"zod": "^3.22.4"
},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion sdk/sdk-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"check-circular": "madge --circular --extensions ts ./src",
"bundle:npm": "esbuild src/index.ts --platform=neutral --target=es2020 --conditions= --main-fields=main --bundle --sourcemap --outfile=bundle/dist/index.js --keep-names && tsc --emitDeclarationOnly --outDir bundle/dist -p tsconfig.build.json",
"bundle:npm": "rm -rf bundle/dist bundle/tsconfig.build.tsbuildinfo && esbuild src/index.ts --platform=neutral --target=es2020 --conditions= --main-fields=main --bundle --sourcemap --outfile=bundle/dist/index.js --keep-names --external:superjson --external:zod --external:bignumber.js && tsc --emitDeclarationOnly --outDir bundle/dist -p tsconfig.build.json",
"publish:npm": "pnpm bundle:npm && cd bundle && npm publish && cd .."
},
"dependencies": {
Expand Down
4 changes: 1 addition & 3 deletions sdk/sdk-common/src/common/aliases/HexData.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { Hex } from 'viem'

export type HexData = Hex
export type HexData = `0x${string}`
7 changes: 4 additions & 3 deletions sdk/sdk-common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export * from './common'
export * from './exchange'
export * from './oracle'
export * from './orders'
export * from './protocols'
export * from './simulation'
export * from './user'
export * from './services'
export * from './simulation'
export * from './swap'
export * from './tokens'
export * from './oracle'
export * from './user'
3 changes: 2 additions & 1 deletion sdk/sdk-common/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// include tests and use module paths in tests but build without tests
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src"
"rootDir": "src",
"baseUrl": "."
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit 9d643bc

Please sign in to comment.