Skip to content

Commit

Permalink
upgrade npm deps
Browse files Browse the repository at this point in the history
  • Loading branch information
macalinao committed Jan 28, 2022
1 parent 4176134 commit 71e06be
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 409 deletions.
2 changes: 1 addition & 1 deletion .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "8.6.0-sdk",
"version": "8.7.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}
16 changes: 11 additions & 5 deletions .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ const moduleWrapper = tsserver => {
let hostInfo = `unknown`;

Object.assign(Session.prototype, {
onMessage(/** @type {string} */ message) {
const parsedMessage = JSON.parse(message)
onMessage(/** @type {string | object} */ message) {
const isStringMessage = typeof message === 'string';
const parsedMessage = isStringMessage ? JSON.parse(message) : message;

if (
parsedMessage != null &&
Expand All @@ -158,9 +159,14 @@ const moduleWrapper = tsserver => {
}
}

return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => {
return typeof value === `string` ? fromEditorPath(value) : value;
}));
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? fromEditorPath(value) : value;
});

return originalOnMessage.call(
this,
isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)
);
},

send(/** @type {any} */ msg) {
Expand Down
16 changes: 11 additions & 5 deletions .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ const moduleWrapper = tsserver => {
let hostInfo = `unknown`;

Object.assign(Session.prototype, {
onMessage(/** @type {string} */ message) {
const parsedMessage = JSON.parse(message)
onMessage(/** @type {string | object} */ message) {
const isStringMessage = typeof message === 'string';
const parsedMessage = isStringMessage ? JSON.parse(message) : message;

if (
parsedMessage != null &&
Expand All @@ -158,9 +159,14 @@ const moduleWrapper = tsserver => {
}
}

return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => {
return typeof value === `string` ? fromEditorPath(value) : value;
}));
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? fromEditorPath(value) : value;
});

return originalOnMessage.call(
this,
isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)
);
},

send(/** @type {any} */ msg) {
Expand Down
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "4.5.4-sdk",
"version": "4.5.5-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}
38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,32 @@
"access": "public"
},
"devDependencies": {
"@project-serum/anchor": "^0.19.1-beta.1",
"@project-serum/anchor": "^0.20.1",
"@rushstack/eslint-patch": "^1.1.0",
"@saberhq/anchor-contrib": "^1.12.9",
"@saberhq/chai-solana": "^1.12.9",
"@saberhq/eslint-config": "^1.12.9",
"@saberhq/solana-contrib": "^1.12.9",
"@saberhq/token-utils": "^1.12.9",
"@saberhq/tsconfig": "^1.12.9",
"@saberhq/anchor-contrib": "^1.12.36",
"@saberhq/chai-solana": "^1.12.36",
"@saberhq/eslint-config": "^1.12.36",
"@saberhq/solana-contrib": "^1.12.36",
"@saberhq/token-utils": "^1.12.36",
"@saberhq/tsconfig": "^1.12.36",
"@solana/spl-token": "^0.1.8",
"@solana/web3.js": "^1.31.0",
"@solana/web3.js": "^1.32.0",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/jest": "^27.4.0",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.5",
"@types/mocha": "^9.1.0",
"@types/node": "^17.0.13",
"bn.js": "^5.2.0",
"chai": "^4.3.4",
"eslint": "^8.6.0",
"chai": "^4.3.6",
"eslint": "^8.7.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-import": "^2.25.4",
"husky": "^7.0.4",
"jsbi": "^4.1.0",
"lint-staged": "^12.1.4",
"mocha": "^9.1.3",
"lint-staged": "^12.3.2",
"mocha": "^9.2.0",
"prettier": "^2.5.1",
"ts-node": "^10.4.0",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
},
"lint-staged": {
"*.{ts,tsx}": "eslint --cache --fix",
Expand All @@ -72,14 +71,17 @@
"tslib": "^2.3.1"
},
"peerDependencies": {
"@project-serum/anchor": "^0.19",
"@project-serum/anchor": "^0.19 || ^0.20",
"@saberhq/anchor-contrib": "^1.10",
"@saberhq/solana-contrib": "^1.10",
"@saberhq/token-utils": "^1.10",
"@solana/web3.js": "^1.29.2",
"bn.js": "^5.2.0",
"jsbi": "*"
},
"resolutions": {
"chai": "^4.3.6"
},
"packageManager": "yarn@3.1.1",
"files": [
"dist/",
Expand Down
7 changes: 4 additions & 3 deletions tests/merkle-distributor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe("merkle-distributor", () => {
try {
await tx.confirm();
} catch (e) {
const err = e as Error;
const err = (e as { errors: Error[] }).errors[0] as Error;
expect(err.message).to.include(
`0x${MerkleDistributorErrors.InvalidProof.code.toString(16)}`
);
Expand Down Expand Up @@ -204,7 +204,8 @@ describe("merkle-distributor", () => {
try {
await claim2.confirm();
} catch (e) {
const err = e as SendTransactionError;
const err = (e as { errors: Error[] })
.errors[0] as SendTransactionError;
expect(err.logs?.join(" ")).to.have.string(
`Allocate: account Address { address: ${claimKey.toString()}, base: None } already in use`
);
Expand Down Expand Up @@ -237,7 +238,7 @@ describe("merkle-distributor", () => {
try {
await tx.confirm();
} catch (e) {
const err = e as Error;
const err = (e as { errors: Error[] }).errors[0] as Error;
expect(err.message).to.include(
`0x${MerkleDistributorErrors.InvalidProof.code.toString(16)}`
);
Expand Down
4 changes: 3 additions & 1 deletion tests/parse-balance-map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,12 @@ describe("parse BalanceMap", () => {
badTx.addSigners(claimantKP);

const [claimKey] = await findClaimStatusKey(index, distributorW.key);

try {
await badTx.confirm();
} catch (e) {
const err = e as SendTransactionError;
const err = (e as { errors: Error[] })
.errors[0] as SendTransactionError;
expect(err.logs?.join(" ")).to.have.string(
`Allocate: account Address { address: ${claimKey.toString()}, base: None } already in use`
);
Expand Down
10 changes: 5 additions & 5 deletions tests/testutils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Provider, setProvider } from "@project-serum/anchor";
import { Provider as AnchorProvider, setProvider } from "@project-serum/anchor";
import { expectTX } from "@saberhq/chai-solana";
import type { Provider } from "@saberhq/solana-contrib";
import { SolanaProvider, TransactionEnvelope } from "@saberhq/solana-contrib";
import type { u64 } from "@saberhq/token-utils";
import { createMint, SPLToken, TOKEN_PROGRAM_ID } from "@saberhq/token-utils";
Expand All @@ -12,14 +13,13 @@ import type { PendingDistributor } from "../src/types";
export const DEFAULT_TOKEN_DECIMALS = 6;

export const makeSDK = (): MerkleDistributorSDK => {
const anchorProvider = Provider.env();
const anchorProvider = AnchorProvider.env();
// if the program isn't loaded, load the default
// Configure the client to use the provider.
setProvider(anchorProvider);

const provider = SolanaProvider.load({
const provider = SolanaProvider.init({
connection: anchorProvider.connection,
sendConnection: anchorProvider.connection,
wallet: anchorProvider.wallet,
opts: anchorProvider.opts,
});
Expand All @@ -28,7 +28,7 @@ export const makeSDK = (): MerkleDistributorSDK => {
};

export const createKeypairWithSOL = async (
provider: SolanaProvider
provider: Provider
): Promise<Keypair> => {
const kp = Keypair.generate();
await provider.connection.requestAirdrop(kp.publicKey, LAMPORTS_PER_SOL);
Expand Down
Loading

0 comments on commit 71e06be

Please sign in to comment.