Skip to content

Commit

Permalink
fix: fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
aelf-lxy committed Dec 2, 2024
2 parents abd8482 + c5694b2 commit 576ce04
Show file tree
Hide file tree
Showing 62 changed files with 1,089 additions and 3,022 deletions.
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ package.json.lerna_backup

*.crt
*.pem
.eslintcache
.eslintcache
**/coverage
**/jest-report.xml
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://biomejs.dev/schemas/1.0.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"formatter": {
"enabled": true,
"ignore": ["./dist/*", "./es/**/*", "./lib/**/*", "_site/**/*"],
"indentStyle": "space",
"lineWidth": 100,
"indentSize": 2
"indentWidth": 2
},
"javascript": {
"formatter": {
Expand Down
27 changes: 19 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,31 @@
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"biome format --write",
"npm run prettier"
"pnpm prettier",
"pnpm eslint"
],
"*.{json,less,md}": "prettier --ignore-unknown --write"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/parser": "^7.24.0",
"@biomejs/biome": "^1.4.1",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@biomejs/biome": "^1.9.2",
"@changesets/changelog-git": "^0.2.0",
"@changesets/cli": "^2.27.1",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"@testing-library/react": "^14.1.2",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/react-hooks": "^8.0.1",
"@types/node": "^22.9.3",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@vitest/coverage-v8": "^1.1.0",
"@vitest/coverage-v8": "^2.1.5",
"@vitest/ui": "^2.1.5",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -67,15 +78,15 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^3.0.0",
"father": "^4.3.8",
"happy-dom": "^15.11.6",
"husky": "^8.0.3",
"jest-canvas-mock": "^2.5.2",
"jest-transform-stub": "^2.0.0",
"jsdom": "^23.0.1",
"lint-staged": "^15.2.0",
"node-fetch": "^3.3.2",
"prettier": "^3.1.1",
"rimraf": "^5.0.5",
"typescript": "^5.3.3",
"vitest": "^1.3.1"
"vite-tsconfig-paths": "^5.1.3",
"vitest": "^2.1.5"
},
"ci": {
"type": "aci",
Expand Down
6 changes: 0 additions & 6 deletions packages/base/coverage/coverage-summary.json

This file was deleted.

35 changes: 0 additions & 35 deletions packages/base/jest-report.xml

This file was deleted.

187 changes: 0 additions & 187 deletions packages/base/jest.config.ts

This file was deleted.

15 changes: 5 additions & 10 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"scripts": {
"dev": "father dev",
"build": "father build",
"test": "jest --config=jest.config.ts --detectOpenHandles",
"test:coverage": "jest --config=jest.config.ts --coverage --detectOpenHandles"
"test": "vitest",
"test:dev": "pnpm test -- --watch",
"test:coverage": "pnpm test -- --coverage",
"test:ui": "pnpm test:dev --ui"
},
"dependencies": {
"eventemitter3": "^5.0.1"
Expand All @@ -34,14 +36,7 @@
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@portkey/did-ui-react": "^2.15.9",
"@portkey/types": "^2.15.9",
"@types/jest": "^29.5.12",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^16.0.0",
"jsdom": "^23.0.1",
"typescript": "^5.3.3"
"@portkey/types": "^2.15.9"
},
"peerDependencies": {
"@portkey/did-ui-react": "^2.15.9"
Expand Down
18 changes: 8 additions & 10 deletions packages/base/src/__tests__/enhancedLocalStorageInWindow.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
const originalConsoleLog = console.log;
beforeEach(() => {
vi.spyOn(console, 'log');
(global as any).window = {};
});
afterEach(() => {
vi.unmock('console.log');
delete (global as any).window;
});

describe('localStorageMock in window', () => {
beforeEach(() => {
console.log = jest.fn();
(global as any).window = {};
});
afterEach(() => {
console.log = originalConsoleLog;
delete (global as any).window;
});

it('enhancedLocalStorage should be set to localStorage in browser environment', async () => {
await import('../enhancedLocalStorage');
expect(console.log).toHaveBeenCalledWith('enhancedLocalStorage in window');
Expand Down
4 changes: 4 additions & 0 deletions packages/base/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import baseViteConfig from '../tools/vite.config';
import { mergeConfig } from 'vitest/config';

export default mergeConfig(baseViteConfig, {});
2 changes: 2 additions & 0 deletions packages/base/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '../tools/__mocks__/setupGlobal';
import '../tools/__mocks__/setupLocal';
23 changes: 0 additions & 23 deletions packages/bridge/jest.setup.ts

This file was deleted.

Loading

0 comments on commit 576ce04

Please sign in to comment.