Skip to content

Commit d999342

Browse files
chore(typescript): change moduleResolution (#1605)
1 parent b09c9b8 commit d999342

File tree

45 files changed

+194
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+194
-178
lines changed

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ jobs:
119119
--ignore @requestnetwork/payment-processor \
120120
--ignore @requestnetwork/integration-test \
121121
--concurrency=2
122+
environment:
123+
# Lerna starts 2 Jest commands at the same time (see above --concurrency=2),
124+
# so we use 50% of our CPU cores on each
125+
JEST_MAX_WORKERS: '50%'
122126
- store_test_results:
123127
path: packages/advance-logic/reports/
124128
- store_test_results:

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ module.exports = {
1717
},
1818
],
1919
],
20+
...(process.env.JEST_MAX_WORKERS ? { maxWorkers: process.env.JEST_MAX_WORKERS } : {}),
2021
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"npm-package-json-lint": "5.1.0",
5353
"prettier": "2.8.8",
5454
"prettier-plugin-solidity": "1.0.0-beta.19",
55-
"typescript": "5.1.3"
55+
"typescript": "5.8.3"
5656
},
5757
"resolutions": {
5858
"elliptic": "^6.6.1",

packages/advanced-logic/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@
4242
"@requestnetwork/currency": "0.28.0",
4343
"@requestnetwork/types": "0.54.0",
4444
"@requestnetwork/utils": "0.54.0",
45-
"tslib": "2.5.0"
45+
"tslib": "2.8.1"
4646
},
4747
"devDependencies": {
4848
"@types/jest": "29.5.6",
4949
"@types/node": "18.11.9",
5050
"jest": "29.5.0",
5151
"jest-junit": "16.0.0",
52-
"ts-jest": "29.1.0",
52+
"ts-jest": "29.3.2",
5353
"ts-node": "10.9.1",
54-
"typescript": "5.1.3"
54+
"typescript": "5.8.3"
5555
},
5656
"gitHead": "6155223cfce769e48ccae480c510b35b4f54b4d0"
5757
}

packages/currency/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@requestnetwork/utils": "0.54.0",
4848
"multicoin-address-validator": "0.5.15",
4949
"node-dijkstra": "2.5.0",
50-
"tslib": "2.5.0"
50+
"tslib": "2.8.1"
5151
},
5252
"devDependencies": {
5353
"@types/jest": "29.5.6",
@@ -57,8 +57,8 @@
5757
"jest": "29.5.0",
5858
"jest-junit": "16.0.0",
5959
"source-map-support": "0.5.19",
60-
"ts-jest": "29.1.0",
60+
"ts-jest": "29.3.2",
6161
"ts-node": "10.9.1",
62-
"typescript": "5.1.3"
62+
"typescript": "5.8.3"
6363
}
6464
}

packages/data-access/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
"@requestnetwork/multi-format": "0.28.0",
4343
"@requestnetwork/types": "0.54.0",
4444
"@requestnetwork/utils": "0.54.0",
45-
"tslib": "2.5.0"
45+
"tslib": "2.8.1"
4646
},
4747
"devDependencies": {
4848
"@types/jest": "29.5.6",
4949
"@types/node": "18.11.9",
5050
"jest": "29.5.0",
5151
"jest-junit": "16.0.0",
5252
"source-map-support": "0.5.19",
53-
"ts-jest": "29.1.0",
53+
"ts-jest": "29.3.2",
5454
"ts-node": "10.9.1",
55-
"typescript": "5.1.3"
55+
"typescript": "5.8.3"
5656
},
5757
"gitHead": "6155223cfce769e48ccae480c510b35b4f54b4d0"
5858
}

packages/data-access/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ export { CombinedDataAccess } from './combined-data-access';
33
export { DataAccessWrite } from './data-write';
44
export { DataAccessRead } from './data-read';
55
export { PendingStore } from './pending-store';
6-
export { DataAccessBaseOptions } from './types';
6+
export type { DataAccessBaseOptions } from './types';
77
export { MockDataAccess } from './mock-data-access';
88
export { NoPersistDataWrite } from './no-persist-data-write';

packages/data-format/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,16 @@
4040
"test:watch": "yarn test --watch"
4141
},
4242
"dependencies": {
43-
"ajv": "6.12.4",
43+
"ajv": "8.17.1",
44+
"ajv-formats": "3.0.1",
4445
"ethers": "5.7.2",
45-
"tslib": "2.5.0"
46+
"tslib": "2.8.1"
4647
},
4748
"devDependencies": {
4849
"@types/node": "18.11.9",
4950
"jest-junit": "16.0.0",
5051
"ts-node": "10.9.1",
51-
"typescript": "5.1.3"
52+
"typescript": "5.8.3"
5253
},
5354
"gitHead": "6155223cfce769e48ccae480c510b35b4f54b4d0"
5455
}

packages/data-format/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import * as AJV from 'ajv';
1+
import { Ajv } from 'ajv';
2+
import addFormats from 'ajv-formats';
23
import * as jsonSchema from 'ajv/lib/refs/json-schema-draft-06.json';
34
import * as schemaAddress from './format/address.json';
45
import { formats } from './format';
@@ -9,7 +10,8 @@ import { formats } from './format';
910
* @return object.valid == true if the json is valid, object.valid == false and object.errors otherwise.
1011
*/
1112
export function validate(data: any): any {
12-
const validationTool = new AJV().addMetaSchema(jsonSchema).addSchema(schemaAddress);
13+
const validationTool = new Ajv().addMetaSchema(jsonSchema).addSchema(schemaAddress);
14+
addFormats(validationTool);
1315

1416
// Check the meta information
1517
if (!data.meta) {

packages/data-format/test/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('Request Network Data Validator', () => {
3030
// 'result.valid should be false'
3131
expect(result.valid).toBe(false);
3232
// 'result.errors is wrong'
33-
expect(result.errors[0].message).toBe('should be string');
33+
expect(result.errors[0].message).toBe('must be string');
3434
});
3535

3636
it('should not validate an invalid invoice 0.0.3 format', () => {
@@ -39,7 +39,7 @@ describe('Request Network Data Validator', () => {
3939
// 'result.valid should be false'
4040
expect(result.valid).toBe(false);
4141
// 'result.errors is wrong'
42-
expect(result.errors[0].message).toBe('should be string');
42+
expect(result.errors[0].message).toBe('must be string');
4343
});
4444

4545
it('should not validate a json without meta', () => {
@@ -66,7 +66,7 @@ describe('Request Network Data Validator', () => {
6666
// 'result.valid should be false'
6767
expect(result.valid).toBe(false);
6868
// 'result.errors is wrong'
69-
expect(result.errors[0].message).toBe('should match format "date-time"');
69+
expect(result.errors[0].message).toBe('must match format "date-time"');
7070
});
7171

7272
it('should not validate a json with required parameter missing', () => {
@@ -75,7 +75,7 @@ describe('Request Network Data Validator', () => {
7575
// 'result.valid should be false'
7676
expect(result.valid).toBe(false);
7777
// 'result.errors is wrong'
78-
expect(result.errors[0].message).toBe(`should have required property \'name\'`);
78+
expect(result.errors[0].message).toBe(`must have required property \'name\'`);
7979
});
8080

8181
it('should not validate a json with meta.format missing', () => {

packages/epk-cipher/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@requestnetwork/multi-format": "0.28.0",
4646
"@requestnetwork/types": "0.54.0",
4747
"@requestnetwork/utils": "0.54.0",
48-
"tslib": "2.5.0"
48+
"tslib": "2.8.1"
4949
},
5050
"devDependencies": {
5151
"@types/jest": "29.5.6",
@@ -58,10 +58,10 @@
5858
"source-map-support": "0.5.19",
5959
"stream-browserify": "3.0.0",
6060
"terser-webpack-plugin": "4.2.3",
61-
"ts-jest": "29.1.0",
61+
"ts-jest": "29.3.2",
6262
"ts-loader": "8.4.0",
6363
"ts-node": "10.9.1",
64-
"typescript": "5.1.3",
64+
"typescript": "5.8.3",
6565
"webpack": "5.94.0",
6666
"webpack-bundle-analyzer": "4.2.0",
6767
"webpack-cli": "3.3.12"

packages/epk-decryption/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@requestnetwork/multi-format": "0.28.0",
4545
"@requestnetwork/types": "0.54.0",
4646
"@requestnetwork/utils": "0.54.0",
47-
"tslib": "2.5.0"
47+
"tslib": "2.8.1"
4848
},
4949
"devDependencies": {
5050
"@types/jest": "29.5.6",
@@ -57,10 +57,10 @@
5757
"source-map-support": "0.5.19",
5858
"stream-browserify": "3.0.0",
5959
"terser-webpack-plugin": "4.2.3",
60-
"ts-jest": "29.1.0",
60+
"ts-jest": "29.3.2",
6161
"ts-loader": "8.4.0",
6262
"ts-node": "10.9.1",
63-
"typescript": "5.1.3",
63+
"typescript": "5.8.3",
6464
"webpack": "5.94.0",
6565
"webpack-bundle-analyzer": "4.2.0",
6666
"webpack-cli": "3.3.12"

packages/epk-signature/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dependencies": {
4444
"@requestnetwork/types": "0.54.0",
4545
"@requestnetwork/utils": "0.54.0",
46-
"tslib": "2.5.0"
46+
"tslib": "2.8.1"
4747
},
4848
"devDependencies": {
4949
"@types/jest": "29.5.6",
@@ -56,10 +56,10 @@
5656
"source-map-support": "0.5.19",
5757
"stream-browserify": "3.0.0",
5858
"terser-webpack-plugin": "4.2.3",
59-
"ts-jest": "29.1.0",
59+
"ts-jest": "29.3.2",
6060
"ts-loader": "8.4.0",
6161
"ts-node": "10.9.1",
62-
"typescript": "5.1.3",
62+
"typescript": "5.8.3",
6363
"webpack": "5.94.0",
6464
"webpack-bundle-analyzer": "4.2.0",
6565
"webpack-cli": "3.3.12"

packages/ethereum-storage/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"form-data": "3.0.0",
4949
"qs": "6.11.2",
5050
"shelljs": "0.8.5",
51-
"tslib": "2.5.0",
51+
"tslib": "2.8.1",
5252
"yargs": "17.6.2"
5353
},
5454
"devDependencies": {
@@ -59,9 +59,9 @@
5959
"msw": "2.0.6",
6060
"solium": "1.2.5",
6161
"source-map-support": "0.5.19",
62-
"ts-jest": "29.1.0",
62+
"ts-jest": "29.3.2",
6363
"ts-node": "10.9.1",
64-
"typescript": "5.1.3",
64+
"typescript": "5.8.3",
6565
"web3-providers-http": "1.3.6"
6666
},
6767
"gitHead": "6155223cfce769e48ccae480c510b35b4f54b4d0"

packages/integration-test/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
"jest": "29.5.0",
7272
"jest-junit": "16.0.0",
7373
"npm-run-all": "4.1.5",
74-
"ts-jest": "29.1.0",
74+
"ts-jest": "29.3.2",
7575
"ts-node": "10.9.1",
76-
"tslib": "2.5.0",
77-
"typescript": "5.1.3"
76+
"tslib": "2.8.1",
77+
"typescript": "5.8.3"
7878
}
7979
}

packages/lit-protocol-cipher/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"@types/node": "18.11.9",
5858
"jest": "29.5.0",
5959
"jest-junit": "16.0.0",
60-
"ts-jest": "29.1.0",
60+
"ts-jest": "29.3.2",
6161
"ts-node": "10.9.1",
62-
"typescript": "5.1.3"
62+
"typescript": "5.8.3"
6363
}
6464
}

packages/multi-format/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
},
4242
"dependencies": {
4343
"@requestnetwork/types": "0.54.0",
44-
"tslib": "2.5.0"
44+
"tslib": "2.8.1"
4545
},
4646
"devDependencies": {
4747
"@types/jest": "29.5.6",
4848
"jest": "29.5.0",
4949
"jest-junit": "16.0.0",
5050
"source-map-support": "0.5.19",
51-
"ts-jest": "29.1.0",
51+
"ts-jest": "29.3.2",
5252
"ts-node": "10.9.1",
53-
"typescript": "5.1.3"
53+
"typescript": "5.8.3"
5454
}
5555
}

packages/payment-detection/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
"graphql-request": "6.1.0",
5151
"graphql-tag": "2.12.6",
5252
"satoshi-bitcoin": "1.0.4",
53-
"tslib": "2.5.0"
53+
"tslib": "2.8.1"
5454
},
5555
"devDependencies": {
5656
"@babel/helper-get-function-arity": "7.16.7",
5757
"@graphql-codegen/cli": "4.0.1",
5858
"@graphql-codegen/typescript": "4.0.1",
5959
"@graphql-codegen/typescript-document-nodes": "4.0.1",
60-
"@graphql-codegen/typescript-graphql-request": "6.0.1",
60+
"@graphql-codegen/typescript-graphql-request": "6.2.0",
6161
"@graphql-codegen/typescript-operations": "4.0.1",
6262
"@graphql-codegen/typescript-resolvers": "4.0.1",
6363
"@jridgewell/gen-mapping": "0.3.2",
@@ -66,8 +66,8 @@
6666
"jest": "29.5.0",
6767
"jest-junit": "16.0.0",
6868
"source-map-support": "0.5.19",
69-
"ts-jest": "29.1.0",
69+
"ts-jest": "29.3.2",
7070
"ts-node": "10.9.1",
71-
"typescript": "5.1.3"
71+
"typescript": "5.8.3"
7272
}
7373
}

packages/payment-detection/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ import * as PaymentReferenceCalculator from './payment-reference-calculator';
88
import * as BtcPaymentNetwork from './btc';
99
import { DeclarativePaymentDetector } from './declarative';
1010
import * as Erc20PaymentNetwork from './erc20';
11+
import { ERC20TransferableReceivablePaymentDetector } from './erc20';
1112
import { AnyToERC20PaymentDetector, AnyToEthFeeProxyPaymentDetector } from './any';
1213
import { EthFeeProxyPaymentDetector, EthInputDataPaymentDetector } from './eth';
1314
import { getTheGraphClient, getTheGraphEvmClient, getTheGraphNearClient } from './thegraph';
1415
import {
1516
calculateEscrowState,
17+
flattenRequestByPnId,
1618
formatAddress,
1719
getPaymentNetworkExtension,
1820
getPaymentReference,
1921
getPaymentReferencesForMetaPnRequest,
20-
flattenRequestByPnId,
2122
hashReference,
2223
padAmountForChainlink,
2324
parseLogArgs,
@@ -29,14 +30,13 @@ import { SuperFluidPaymentDetector } from './erc777/superfluid-detector';
2930
import { EscrowERC20InfoRetriever } from './erc20/escrow-info-retriever';
3031
import { SuperFluidInfoRetriever } from './erc777/superfluid-retriever';
3132
import { PaymentNetworkOptions } from './types';
32-
import { ERC20TransferableReceivablePaymentDetector } from './erc20';
3333
import { MetaDetector } from './meta-payment-detector';
3434

3535
export type { TheGraphClient } from './thegraph';
3636

37+
export type { PaymentNetworkOptions };
3738
export {
3839
PaymentNetworkFactory,
39-
PaymentNetworkOptions,
4040
PaymentReferenceCalculator,
4141
BtcPaymentNetwork,
4242
DeclarativePaymentDetector,

packages/payment-detection/src/thegraph/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { NearChains } from '@requestnetwork/currency';
44
import { GraphQLClient } from 'graphql-request';
55
import { Block_Height, getSdk, Maybe } from './generated/graphql';
66
import { getSdk as getNearSdk } from './generated/graphql-near';
7-
import { RequestConfig } from 'graphql-request/src/types';
87

98
const THE_GRAPH_STUDIO_URL =
109
'https://api.studio.thegraph.com/query/67444/request-payments-$NETWORK/version/latest';
@@ -77,6 +76,8 @@ export type TheGraphQueryOptions = {
7776
blockFilter?: Maybe<Block_Height>;
7877
};
7978

79+
type RequestConfig = (typeof GraphQLClient.prototype)['requestConfig'];
80+
8081
export type TheGraphClientOptions = RequestConfig & {
8182
/** constraint to select indexers that have at least parsed this block */
8283
minIndexedBlock?: number | undefined;

packages/payment-detection/src/thegraph/superfluid.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { GraphQLClient } from 'graphql-request';
22
import { getSdk } from './generated/graphql-superfluid';
3-
import { RequestConfig } from 'graphql-request/src/types';
43

54
const BASE_URL = `https://subgraph-endpoints.superfluid.dev`;
65
const NETWORK_TO_URL: Record<string, string> = {
@@ -16,6 +15,8 @@ const NETWORK_TO_URL: Record<string, string> = {
1615
xdai: 'xdai-mainnet',
1716
};
1817

18+
type RequestConfig = (typeof GraphQLClient.prototype)['requestConfig'];
19+
1920
// NB: the GraphQL client is automatically generated based on files present in ./queries,
2021
// using graphql-codegen.
2122
// To generate types, run `yarn codegen`, then open the generated files so that the code editor picks up the changes.

0 commit comments

Comments
 (0)