chore: upgrade medium-risk dependencies
- lint-staged: 16.2.7 → 17.0.5 - jsdom: 25.0.0 → 29.1.1 - @vitejs/plugin-react: 4.3.4 → 6.0.2 - vitest: 2.0.0 → 4.1.7 - @vitest/coverage-v8: upgraded to match vitest - @webext-core/messaging: 2.3.0 → 3.0.1 - eslint: 9.39.2 → 10.4.0 - @eslint/js: added as new dependency - @types/marked: removed (marked now provides its own types) Fixes: - Fix ref update during render in useQrCode.ts - Fix ref update during render in useStorageCleaner.ts - Add error cause in jwt.ts decode function - Add type assertion for mock functions in htmlToMarkdown.test.ts
This commit is contained in:
Generated
+1453
-1647
File diff suppressed because it is too large
Load Diff
+8
-7
@@ -26,11 +26,12 @@
|
|||||||
"@dnd-kit/utilities": "^3.2.2",
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@emotion/styled": "^11.14.1",
|
"@emotion/styled": "^11.14.1",
|
||||||
|
"@eslint/js": "^10.0.1",
|
||||||
"@mui/icons-material": "^7.3.8",
|
"@mui/icons-material": "^7.3.8",
|
||||||
"@mui/material": "^7.3.8",
|
"@mui/material": "^7.3.8",
|
||||||
"@testing-library/dom": "^10.4.1",
|
"@testing-library/dom": "^10.4.1",
|
||||||
"@types/marked": "^5.0.2",
|
"@vitest/coverage-v8": "^4.1.7",
|
||||||
"@webext-core/messaging": "^2.3.0",
|
"@webext-core/messaging": "^3.0.1",
|
||||||
"dayjs": "^1.11.20",
|
"dayjs": "^1.11.20",
|
||||||
"i18next": "^26.2.0",
|
"i18next": "^26.2.0",
|
||||||
"i18next-browser-languagedetector": "^8.2.1",
|
"i18next-browser-languagedetector": "^8.2.1",
|
||||||
@@ -51,20 +52,20 @@
|
|||||||
"@types/webextension-polyfill": "^0.12.5",
|
"@types/webextension-polyfill": "^0.12.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
||||||
"@typescript-eslint/parser": "^8.59.4",
|
"@typescript-eslint/parser": "^8.59.4",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^6.0.2",
|
||||||
"@wxt-dev/module-react": "^1.2.2",
|
"@wxt-dev/module-react": "^1.2.2",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "^10.4.0",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"globals": "^17.6.0",
|
"globals": "^17.6.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jsdom": "^25.0.0",
|
"jsdom": "^29.1.1",
|
||||||
"lint-staged": "^16.2.7",
|
"lint-staged": "^17.0.5",
|
||||||
"prettier": "^3.8.3",
|
"prettier": "^3.8.3",
|
||||||
"terser": "^5.47.1",
|
"terser": "^5.47.1",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.59.4",
|
"typescript-eslint": "^8.59.4",
|
||||||
"vitest": "^2.0.0",
|
"vitest": "^4.1.7",
|
||||||
"wxt": "^0.20.26"
|
"wxt": "^0.20.26"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ export function useQrCode(): QrCodeContextValue {
|
|||||||
|
|
||||||
// 使用 useRef 存储 generateQrCode 的最新引用,避免无限循环
|
// 使用 useRef 存储 generateQrCode 的最新引用,避免无限循环
|
||||||
const generateQrCodeRef = useRef(generateQrCode);
|
const generateQrCodeRef = useRef(generateQrCode);
|
||||||
|
useEffect(() => {
|
||||||
generateQrCodeRef.current = generateQrCode;
|
generateQrCodeRef.current = generateQrCode;
|
||||||
|
});
|
||||||
|
|
||||||
// 防抖处理输入文本(200ms)
|
// 防抖处理输入文本(200ms)
|
||||||
const debouncedTextToEncode = useDebounce(generatorState.textToEncode, 200);
|
const debouncedTextToEncode = useDebounce(generatorState.textToEncode, 200);
|
||||||
|
|||||||
@@ -144,7 +144,9 @@ export function useStorageCleaner({
|
|||||||
}, [t]);
|
}, [t]);
|
||||||
|
|
||||||
const loadInfoRef = useRef(loadInfo);
|
const loadInfoRef = useRef(loadInfo);
|
||||||
|
useEffect(() => {
|
||||||
loadInfoRef.current = loadInfo;
|
loadInfoRef.current = loadInfo;
|
||||||
|
});
|
||||||
|
|
||||||
const debouncedLoadInfo = useCallback(() => {
|
const debouncedLoadInfo = useCallback(() => {
|
||||||
if (debounceTimerRef.current) {
|
if (debounceTimerRef.current) {
|
||||||
|
|||||||
@@ -230,8 +230,8 @@ describe('downloadMarkdownFile', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
vi.spyOn(document, 'createElement').mockReturnValue(mockLink as any);
|
vi.spyOn(document, 'createElement').mockReturnValue(mockLink as any);
|
||||||
vi.spyOn(document.body, 'appendChild').mockImplementation(appendChildSpy);
|
vi.spyOn(document.body, 'appendChild').mockImplementation(appendChildSpy as any);
|
||||||
vi.spyOn(document.body, 'removeChild').mockImplementation(removeChildSpy);
|
vi.spyOn(document.body, 'removeChild').mockImplementation(removeChildSpy as any);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ export function decodeBase64Url(str: string): string {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
i18n.t('jwt:errors.failedToDecode') + (e instanceof Error ? e.message : String(e)),
|
i18n.t('jwt:errors.failedToDecode') + (e instanceof Error ? e.message : String(e)),
|
||||||
|
{ cause: e },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user