Skip to content

Commit 6a936fa

Browse files
committed
Merge remote-tracking branch 'origin/master' into devin/1744245477-implement-login-with-popup-v2
2 parents bfd8260 + 170fc9b commit 6a936fa

File tree

166 files changed

+4710
-8116
lines changed

Some content is hidden

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

166 files changed

+4710
-8116
lines changed

eslint.config.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export default [
1515
'**/dist',
1616
'**/jest.config.ts',
1717
'scripts/bin/scaffold/template/**/*',
18-
'.prettierrc.js',
18+
'**/.prettierrc.js',
19+
'**/README.md',
20+
'**/babel.config.js',
1921
],
2022
},
2123
{
@@ -41,6 +43,7 @@ export default [
4143
files: ['**/*.ts', '**/*.tsx'],
4244

4345
rules: {
46+
'no-undef': 0,
4447
'no-alert': 'off',
4548
'no-dupe-class-members': 'off',
4649
'no-underscore-dangle': 'off',
@@ -72,4 +75,13 @@ export default [
7275
},
7376
},
7477
},
78+
{
79+
files: ['**/*.spec.*'],
80+
81+
rules: {
82+
'@typescript-eslint/no-explicit-any': 'off',
83+
'@typescript-eslint/naming-convention': 'off',
84+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
85+
},
86+
},
7587
];

jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const config: Config.InitialOptions = {
77
collectCoverageFrom: ['./src/**/*.{ts,tsx,}'],
88
collectCoverage: true,
99
testTimeout: 30000, // 30s
10+
testEnvironment: 'jsdom',
1011
coverageThreshold: {
1112
global: {
1213
lines: 99,

lerna.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"version": "independent",
3-
"command": {
4-
}
3+
"command": {}
54
}

package.json

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,60 +14,57 @@
1414
"postinstall": "husky install"
1515
},
1616
"devDependencies": {
17+
"@babel/core": "^7.26.10",
1718
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
19+
"@babel/runtime": "^7.27.0",
1820
"@eslint/compat": "^1.2.2",
1921
"@eslint/eslintrc": "^3.1.0",
2022
"@eslint/js": "^9.14.0",
21-
"@ikscodes/browser-env": "~0.3.1",
2223
"@istanbuljs/nyc-config-typescript": "~0.1.3",
24+
"@peculiar/webcrypto": "^1.5.0",
2325
"@types/fs-extra": "^9.0.13",
2426
"@types/inquirer": "^8.1.1",
2527
"@types/is-ci": "^3.0.0",
26-
"@types/jest": "^27.0.0",
28+
"@types/jest": "^29.5.12",
2729
"@types/jsdom": "~12.2.4",
2830
"@types/lodash": "^4.14.172",
29-
"@types/react": "^18.0.26",
30-
"@types/react-native": "^0.70.5",
31+
"@types/react": "^19.1.0",
3132
"@types/rimraf": "^3.0.2",
3233
"@types/tsc-watch": "^4.2.0",
3334
"@types/whatwg-url": "^6.4.0",
34-
"@typescript-eslint/eslint-plugin": "^7.18.0",
35-
"@typescript-eslint/parser": "7.12.0",
35+
"@typescript-eslint/eslint-plugin": "^8.29.1",
36+
"@typescript-eslint/parser": "^8.29.1",
3637
"auto": "^11.1.2",
37-
"babel-jest": "^27.0.6",
38+
"babel-jest": "^29.7.0",
3839
"brotli-size": "^4.0.0",
3940
"chalk": "~4.1.2",
4041
"enquirer": "^2.3.6",
41-
"esbuild": "^0.14.13",
42-
"eslint": "9.14.0",
43-
"eslint-config-prettier": "^9.1.0",
44-
"eslint-import-resolver-typescript": "^3.6.3",
42+
"esbuild": "0.25.2",
43+
"eslint": "^9.24.0",
4544
"eslint-plugin-import": "^2.31.0",
4645
"eslint-plugin-jsx-a11y": "^6.10.2",
47-
"eslint-plugin-prettier": "^5.2.1",
48-
"eslint-plugin-react": "^7.37.2",
49-
"eslint-plugin-react-hooks": "^4.6.0",
46+
"eslint-plugin-prettier": "^5.2.6",
5047
"execa": "~5.1.1",
5148
"fs-extra": "^10.0.0",
5249
"globals": "^15.12.0",
5350
"gzip-size": "^6.0.0",
5451
"husky": "^7.0.1",
5552
"inquirer": "^8.1.2",
5653
"is-ci": "^3.0.0",
57-
"jest": "^27.0.6",
54+
"jest": "^29.7.0",
55+
"jest-environment-jsdom": "^29.7.0",
5856
"lerna": "8.0.2",
5957
"lint-staged": "^10.0.7",
58+
"localforage-driver-memory": "^1.0.5",
6059
"lodash": "^4.17.21",
6160
"meow": "9.0.0",
6261
"npm-run-all": "^4.1.5",
6362
"nyc": "13.1.0",
6463
"ora": "~5.4.1",
6564
"p-limit": "^3.1.0",
66-
"prettier": "^3.3.3",
65+
"prettier": "^3.5.3",
6766
"pretty-bytes": "^5.6.0",
68-
"react": "^16.13.1",
69-
"react-native": "^0.62.2",
70-
"regenerator-runtime": "0.13.9",
67+
"react": "^19.1.0",
7168
"replace-in-file": "^6.1.0",
7269
"rimraf": "~3.0.2",
7370
"ts-jest": "^29.3.0",
@@ -86,8 +83,7 @@
8683
]
8784
},
8885
"resolutions": {
89-
"@rollup/plugin-commonjs": "^17.0.0",
90-
"eslint": "9.14.0"
86+
"@rollup/plugin-commonjs": "^17.0.0"
9187
},
9288
"repository": "magiclabs/magic-js",
9389
"author": "Magic Labs <[email protected]>",
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// NOTE: This module is automatically included at the top of each test file.
2-
import browserEnv from '@ikscodes/browser-env';
32
import { mockConsole } from '../../../../scripts/utils/mock-console';
43

5-
browserEnv();
6-
74
beforeEach(() => {
85
mockConsole();
96
});

packages/@magic-ext/aptos/test/spec/aptos-extension.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import browserEnv from '@ikscodes/browser-env';
21
import { BCS, TxnBuilderTypes } from 'aptos';
32
import { createMagicSDKWithExtension } from '../../../../@magic-sdk/provider/test/factories';
43
import { AptosExtension } from '../../src';
54
import { AptosPayloadMethod } from '../../src/type';
5+
import { TextEncoder, TextDecoder } from 'util';
66

77
const APTOS_NODE_URL = 'https://fullnode.testnet.aptoslabs.com';
88

@@ -31,8 +31,12 @@ const MESSAGE_PAYLOAD = {
3131
nonce: 'random-nonce',
3232
};
3333

34+
beforeAll(() => {
35+
Object.assign(global, { TextEncoder, TextDecoder });
36+
})
37+
3438
beforeEach(() => {
35-
browserEnv.restore();
39+
jest.resetAllMocks();
3640
});
3741

3842
test('Construct GetAccount request with `aptos_getAccount`', async () => {

packages/@magic-ext/aptos/test/spec/magic-aptos-wallet.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import browserEnv from '@ikscodes/browser-env';
21
import { BCS, TxnBuilderTypes } from 'aptos';
32
import { createMagicSDKWithExtension } from '../../../../@magic-sdk/provider/test/factories';
43
import { AptosExtension, MagicAptosWallet } from '../../src';
@@ -33,7 +32,7 @@ const MOCK_ACCOUTN_INFO = {
3332
};
3433

3534
beforeEach(() => {
36-
browserEnv.restore();
35+
jest.resetAllMocks();
3736
});
3837

3938
test('Call connect()', async () => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "../../../../tsconfig.settings.test.json",
2+
"extends": "../../../../tsconfig.settings.test.json"
33
}

packages/@magic-ext/gdkms/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"devDependencies": {
3232
"@magic-sdk/commons": "^25.0.5",
33-
"@magic-sdk/types": "^24.18.1",
34-
"@peculiar/webcrypto": "^1.4.3"
33+
"@magic-sdk/types": "^24.18.1"
3534
}
3635
}

packages/@magic-ext/gdkms/test/setup.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// NOTE: This module is automatically included at the top of each test file.
2-
import browserEnv from '@ikscodes/browser-env';
32
import { Crypto } from '@peculiar/webcrypto';
43
import { mockConsole } from '../../../../scripts/utils/mock-console';
54

6-
browserEnv();
75
(window as any).crypto = new Crypto();
86

97
beforeEach(() => {

0 commit comments

Comments
 (0)