Skip to content

Commit d4daafa

Browse files
update all deps (#141)
1 parent 8743619 commit d4daafa

File tree

7 files changed

+3836
-4733
lines changed

7 files changed

+3836
-4733
lines changed

eslint.config.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import js from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tsParser from '@typescript-eslint/parser';
4+
import importPlugin from 'eslint-plugin-import';
5+
import jsxA11y from 'eslint-plugin-jsx-a11y';
6+
import prettier from 'eslint-plugin-prettier';
7+
8+
export default [
9+
js.configs.recommended,
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
parser: tsParser,
14+
parserOptions: {
15+
project: ['./tsconfig.json', './test/tsconfig.json'],
16+
ecmaVersion: 'latest',
17+
sourceType: 'module',
18+
},
19+
globals: {
20+
Buffer: 'readonly',
21+
atob: 'readonly',
22+
globalThis: 'readonly',
23+
},
24+
},
25+
plugins: {
26+
'@typescript-eslint': tseslint,
27+
'import': importPlugin,
28+
'jsx-a11y': jsxA11y,
29+
'prettier': prettier,
30+
},
31+
rules: {
32+
'import/extensions': 0,
33+
'no-alert': 0,
34+
'@typescript-eslint/await-thenable': 0,
35+
'react/button-has-type': 0,
36+
'no-cond-assign': 0,
37+
'class-methods-use-this': 0,
38+
'no-underscore-dangle': 0,
39+
'no-useless-constructor': 0,
40+
'no-shadow': 0,
41+
'@typescript-eslint/no-shadow': 'warn',
42+
'no-empty-function': 0,
43+
'no-unused-vars': 'off',
44+
'@typescript-eslint/no-unused-vars': ['error', {
45+
'argsIgnorePattern': '^_',
46+
'varsIgnorePattern': '^_',
47+
'ignoreRestSiblings': true
48+
}],
49+
},
50+
settings: {
51+
'import/resolver': {
52+
typescript: {
53+
directory: ['./tsconfig.json', './test/tsconfig.json'],
54+
},
55+
},
56+
},
57+
},
58+
{
59+
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
60+
},
61+
];

jest.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const config: Config.InitialOptions = {
1515
branches: 99,
1616
}
1717
},
18-
globals: {
19-
'ts-jest': {
18+
transform: {
19+
'^.+\\.tsx?$': ['ts-jest', {
2020
tsconfig: './test/tsconfig.json',
2121
isolatedModules: true,
22-
},
22+
}],
2323
},
2424
};
2525

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@magic-sdk/admin",
33
"version": "2.8.0",
4-
"description": "Magic Authentication Admin Javascript SDK.",
4+
"description": "Magic Authentication Admin JavaScript SDK.",
55
"author": "Magic Labs <[email protected]>",
66
"license": "MIT",
77
"engines": {
@@ -33,35 +33,35 @@
3333
"prepare": "husky install"
3434
},
3535
"devDependencies": {
36-
"@ikscodes/eslint-config": "^8.4.1",
37-
"@istanbuljs/nyc-config-typescript": "^1.0.1",
38-
"@types/jest": "^27.4.1",
39-
"@types/node": "^13.1.2",
40-
"@types/node-fetch": "^2.5.4",
41-
"@typescript-eslint/eslint-plugin": "^6.21.0",
42-
"auto": "11.0.5",
43-
"boxen-cli": "^1.0.0",
44-
"esbuild": "^0.25.0",
45-
"eslint": "^8.56.0",
46-
"eslint-import-resolver-typescript": "^2.0.0",
47-
"eslint-plugin-import": "^2.29.1",
48-
"eslint-plugin-jsx-a11y": "^6.8.0",
49-
"eslint-plugin-prettier": "^5.1.3",
50-
"husky": "^8.0.3",
51-
"jest": "^27.5.1",
52-
"lint-staged": "^10.0.8",
36+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
37+
"@types/jest": "^30.0.0",
38+
"@types/node": "^24.3.1",
39+
"@types/node-fetch": "^2.6.13",
40+
"@typescript-eslint/eslint-plugin": "^8.43.0",
41+
"@typescript-eslint/parser": "^8.43.0",
42+
"auto": "11.3.0",
43+
"boxen-cli": "^4.0.0",
44+
"esbuild": "^0.25.9",
45+
"eslint": "^9.35.0",
46+
"eslint-import-resolver-typescript": "^4.4.4",
47+
"eslint-plugin-import": "^2.32.0",
48+
"eslint-plugin-jsx-a11y": "^6.10.2",
49+
"eslint-plugin-prettier": "^5.5.4",
50+
"husky": "^9.1.7",
51+
"jest": "^30.1.3",
52+
"lint-staged": "^16.1.6",
5353
"npm-run-all": "~4.1.5",
54-
"prettier": "^3.2.4",
55-
"rimraf": "~3.0.0",
56-
"ts-jest": "^27.1.3",
54+
"prettier": "^3.6.2",
55+
"rimraf": "~6.0.1",
56+
"ts-jest": "^29.4.1",
5757
"ts-node": "^10.2.0",
5858
"tslint": "~5.20.1",
59-
"typescript": "^5.3.3"
59+
"typescript": "^5.9.2"
6060
},
6161
"dependencies": {
62-
"ethereum-cryptography": "^1.0.1",
63-
"ethers": "^6.11.1",
64-
"node-fetch": "^2.6.7"
62+
"ethereum-cryptography": "^3.2.0",
63+
"ethers": "^6.15.0",
64+
"node-fetch": "^2.7.0"
6565
},
6666
"lint-staged": {
6767
"*.{ts,tsx}": "eslint --fix"

test/spec/modules/users/getMetadataByIssuer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ test('Fails GET if API key is missing', async () => {
9292
const expectedError = createApiKeyMissingError();
9393
expect(sdk.users.getMetadataByIssuer('did:ethr:0x1234')).rejects.toThrow(expectedError);
9494

95-
expect(getStub).not.toBeCalled();
95+
expect(getStub).not.toHaveBeenCalled();
9696
});
9797

9898
test('Successfully GETs to metadata endpoint via issuer and wallet type', async () => {

test/spec/modules/users/logoutByIssuer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ test('Fails POST if API key is missing', async () => {
2626

2727
await expect(sdk.users.logoutByIssuer('did:ethr:0x1234')).rejects.toThrow(expectedError);
2828

29-
expect(postStub).not.toBeCalled();
29+
expect(postStub).not.toHaveBeenCalled();
3030
});

test/spec/utils/rest/post.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fetch from 'node-fetch';
21
import { API_KEY } from '../../../lib/constants';
32
import { post } from '../../../../src/utils/rest';
43

@@ -9,9 +8,14 @@ const successRes = Promise.resolve({
98
}),
109
});
1110

11+
jest.mock('../../../../src/utils/fetch', () => ({
12+
fetch: jest.fn(),
13+
}));
14+
1215
test('Successfully POSTs to the given endpoint & stringifies body', async () => {
16+
const { fetch } = require('../../../../src/utils/fetch');
1317
const fetchStub = jest.fn().mockImplementation(() => successRes);
14-
(fetch as any) = fetchStub;
18+
fetch.mockImplementation(fetchStub);
1519

1620
await expect(post('https://example.com/hello/world', API_KEY, { public_address: '0x0123' })).resolves.toEqual({
1721
message: 'hello world',

0 commit comments

Comments
 (0)