Skip to content

Commit

Permalink
Switch to native bigint for calculations, begin migration to ESM (#774)
Browse files Browse the repository at this point in the history
* Switch to native bigint for calculations

* fix size-limit
  • Loading branch information
macalinao committed Apr 12, 2024
1 parent 96b61a3 commit 8dd5756
Show file tree
Hide file tree
Showing 39 changed files with 2,163 additions and 1,488 deletions.
2 changes: 1 addition & 1 deletion .yarn/sdks/eslint/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "8.54.0-sdk",
"version": "8.57.0-sdk",
"main": "./lib/api.js",
"type": "commonjs",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion .yarn/sdks/prettier/package.json
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "3.1.0-sdk",
"version": "3.2.5-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
Expand Down
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "5.3.2-sdk",
"version": "5.4.5-sdk",
"main": "./lib/typescript.js",
"type": "commonjs",
"bin": {
Expand Down
48 changes: 24 additions & 24 deletions package.json
Expand Up @@ -12,47 +12,47 @@
"*.{md,js,jsx,json,yml,yaml,css,md}": "prettier --write"
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.23.3",
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@babel/preset-typescript": "^7.24.1",
"@coral-xyz/anchor": "^0.29.0",
"@jest/types": "^29.6.3",
"@rushstack/eslint-patch": "^1.6.0",
"@saberhq/eslint-config": "^3.2.1",
"@saberhq/eslint-config-react": "^3.2.1",
"@saberhq/tsconfig": "^3.2.1",
"@rushstack/eslint-patch": "^1.10.2",
"@saberhq/eslint-config": "^3.3.1",
"@saberhq/eslint-config-react": "^3.3.1",
"@saberhq/tsconfig": "^3.3.1",
"@saberhq/use-solana": "workspace:*",
"@size-limit/file": "^11.0.0",
"@size-limit/webpack": "^11.0.0",
"@size-limit/webpack-why": "^11.0.0",
"@size-limit/file": "^11.1.2",
"@size-limit/webpack": "^11.1.2",
"@size-limit/webpack-why": "^11.1.2",
"@solana/web3.js": "^1.91.1",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.9.6",
"@types/bn.js": "^5.1.5",
"@types/eslint": "^8.44.8",
"@types/jest": "^29.5.10",
"@types/node": "^18.18.14",
"@types/react": "^18.2.39",
"@types/eslint": "^8.56.9",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"@types/react": "^18.2.77",
"@types/source-map-support": "^0.5.10",
"@types/w3c-web-usb": "^1.0.10",
"@typescript-eslint/utils": "^6.13.1",
"@typescript-eslint/utils": "^7.6.0",
"@yarnpkg/doctor": "^4.0.1",
"bn.js": "^5.2.1",
"buffer": "^6.0.3",
"eslint": "^8.54.0",
"husky": "^8.0.3",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-runtime": "^29.7.0",
"jsbi": "^4.3.0",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"react": "^18.2.0",
"size-limit": "^11.0.0",
"size-limit": "^11.1.2",
"source-map-support": "^0.5.21",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typedoc": "^0.25.4",
"typescript": "^5.3.2"
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
},
"scripts": {
"build": "yarn workspaces foreach --all --exclude @saberhq/saber-common -ptv run build",
Expand Down
4 changes: 2 additions & 2 deletions packages/anchor-contrib/package.json
Expand Up @@ -28,12 +28,12 @@
},
"devDependencies": {
"@coral-xyz/anchor": "^0.29.0",
"@saberhq/tsconfig": "^3.2.1",
"@saberhq/tsconfig": "^3.3.1",
"@solana/web3.js": "^1.91.1",
"@types/lodash.camelcase": "^4.3.9",
"@types/lodash.mapvalues": "^4.6.9",
"bn.js": "^5.2.1",
"typescript": "^5.3.2"
"typescript": "^5.4.5"
},
"dependencies": {
"@saberhq/solana-contrib": "workspace:^",
Expand Down
9 changes: 5 additions & 4 deletions packages/chai-solana/package.json
Expand Up @@ -7,6 +7,7 @@
"bugs": "https://github.com/saber-hq/saber-common/issues",
"author": "Saber Team <team@saber.so>",
"license": "Apache-2.0",
"type": "module",
"scripts": {
"build": "tsc && tsc --project tsconfig.cjs.json",
"clean": "rm -fr dist/",
Expand All @@ -28,10 +29,10 @@
"@saberhq/anchor-contrib": "workspace:^",
"@saberhq/solana-contrib": "workspace:^",
"@saberhq/token-utils": "workspace:^",
"@types/chai": "^4.3.11",
"@types/chai": "^4.3.14",
"@types/chai-as-promised": "^7.1.8",
"@types/promise-retry": "^1.1.6",
"chai": "=4.3.4",
"chai": "^5.1.0",
"chai-as-promised": "^7.1.1",
"chai-bn": "^0.3.1",
"colors": "^1.4.0",
Expand All @@ -49,10 +50,10 @@
},
"devDependencies": {
"@coral-xyz/anchor": "^0.29.0",
"@saberhq/tsconfig": "^3.2.1",
"@saberhq/tsconfig": "^3.3.1",
"@solana/web3.js": "^1.91.1",
"bn.js": "^5.2.1",
"jsbi": "^4.3.0",
"typescript": "^5.3.2"
"typescript": "^5.4.5"
}
}
8 changes: 6 additions & 2 deletions packages/chai-solana/src/index.ts
Expand Up @@ -9,7 +9,7 @@ import type { Address } from "@coral-xyz/anchor";
import { BN } from "@coral-xyz/anchor";
import { TokenAmount } from "@saberhq/token-utils";
import { PublicKey } from "@solana/web3.js";
import chaiAsPromised from "chai-as-promised";
import { default as chaiAsPromised } from "chai-as-promised";
import { default as chaiBN } from "chai-bn";

export * from "./debugAccountOwners.js";
Expand All @@ -18,7 +18,11 @@ export * from "./printInstructionLogs.js";
export * from "./utils.js";

export const chaiSolana: Chai.ChaiPlugin = (chai) => {
chai.use(chaiBN(BN) as Chai.ChaiPlugin);
chai.use(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
chaiBN(BN) as Chai.ChaiPlugin,
);
chai.use(chaiAsPromised);
chai.config.includeStack = true;

Expand Down
4 changes: 2 additions & 2 deletions packages/option-utils/package.json
Expand Up @@ -36,7 +36,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.2.1",
"typescript": "^5.3.2"
"@saberhq/tsconfig": "^3.3.1",
"typescript": "^5.4.5"
}
}
12 changes: 6 additions & 6 deletions packages/solana-contrib/package.json
Expand Up @@ -27,22 +27,22 @@
],
"dependencies": {
"@saberhq/option-utils": "workspace:^",
"@solana/buffer-layout": "^4.0.0",
"@solana/buffer-layout": "^4.0.1",
"@types/promise-retry": "^1.1.6",
"@types/retry": "^0.12.5",
"promise-retry": "^2.0.1",
"retry": "^0.13.1",
"tiny-invariant": "^1.3.1",
"tiny-invariant": "^1.3.3",
"tslib": "^2.6.2"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.2.1",
"@saberhq/tsconfig": "^3.3.1",
"@solana/web3.js": "^1.91.1",
"@types/bn.js": "^5.1.5",
"@types/jest": "^29.5.10",
"@types/node": "^18.18.14",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"bn.js": "^5.2.1",
"typescript": "^5.3.2"
"typescript": "^5.4.5"
},
"peerDependencies": {
"@solana/web3.js": "^1.42",
Expand Down
3 changes: 1 addition & 2 deletions packages/solana-contrib/tsconfig.cjs.json
@@ -1,8 +1,7 @@
{
"extends": "@saberhq/tsconfig/tsconfig.cjs.json",
"compilerOptions": {
"outDir": "dist/cjs/",
"lib": ["ES2021.Promise", "ES2019"]
"outDir": "dist/cjs/"
},
"include": ["src/"]
}
3 changes: 1 addition & 2 deletions packages/solana-contrib/tsconfig.json
Expand Up @@ -2,8 +2,7 @@
"extends": "@saberhq/tsconfig/tsconfig.mono.json",
"compilerOptions": {
"rootDir": "src/",
"outDir": "dist/esm/",
"lib": ["ES2021.Promise", "ES2019"]
"outDir": "dist/esm/"
},
"include": ["src/"]
}
13 changes: 7 additions & 6 deletions packages/stableswap-sdk/package.json
Expand Up @@ -11,6 +11,7 @@
"solana",
"saber"
],
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand All @@ -27,15 +28,15 @@
"node": ">=12.x"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.2.1",
"@saberhq/tsconfig": "^3.3.1",
"@solana/web3.js": "^1.91.1",
"@types/bn.js": "^5.1.5",
"@types/lodash": "^4.14.202",
"@types/node": "^18.18.14",
"@types/lodash": "^4.17.0",
"@types/node": "^20.12.7",
"bn.js": "^5.2.1",
"jsbi": "^4.3.0",
"lodash": "^4.17.21",
"typescript": "^5.3.2"
"typescript": "^5.4.5"
},
"peerDependencies": {
"@solana/web3.js": "^1.42",
Expand All @@ -45,8 +46,8 @@
"dependencies": {
"@saberhq/solana-contrib": "workspace:^",
"@saberhq/token-utils": "workspace:^",
"@solana/buffer-layout": "^4.0.0",
"tiny-invariant": "^1.3.1",
"@solana/buffer-layout": "^4.0.1",
"tiny-invariant": "^1.3.3",
"tslib": "^2.6.2"
},
"files": [
Expand Down

0 comments on commit 8dd5756

Please sign in to comment.