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', () => {

0 commit comments

Comments
 (0)