From 622478237902aa3a17ba69ff5d55da0e95a128ae Mon Sep 17 00:00:00 2001 From: sftbob <111048941+sftbob@users.noreply.github.com> Date: Thu, 4 Jun 2026 02:04:03 +0800 Subject: [PATCH 1/6] Fix ESLint error: wrap setTimeout callback in arrow function to resolve no-implied-eval warning - Line 157-159: Wrap callback in arrow function for setTimeout to fix @typescript-eslint/no-implied-eval error - Line 206: Add missing dependencies to useEffect (ADSENSE_GOOGLE_ID, lang, props?.allLinkPages, props?.allNavPages) --- components/ExternalPlugins.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js index ceb48e892a2..56f64a4a47b 100644 --- a/components/ExternalPlugins.js +++ b/components/ExternalPlugins.js @@ -154,7 +154,9 @@ const ExternalPlugin = props => { const taskId = window.requestIdleCallback(callback) return () => window.cancelIdleCallback(taskId) } - const timeoutId = window.setTimeout(callback, 0) + const timeoutId = window.setTimeout(() => { + callback() + }, 0) return () => window.clearTimeout(timeoutId) } @@ -203,7 +205,7 @@ const ExternalPlugin = props => { lang: lang }) }, 500) - }, [router]) + }, [router, ADSENSE_GOOGLE_ID, lang, props?.allLinkPages, props?.allNavPages]) useEffect(() => { if (!isBrowser || !GLOBAL_JS || GLOBAL_JS.trim() === '') { @@ -343,11 +345,11 @@ const ExternalPlugin = props => { async dangerouslySetInnerHTML={{ __html: ` - daovoice('init', { - app_id: "${COMMENT_DAO_VOICE_ID}" - }); - daovoice('update'); - ` + daovoice('init', { + app_id: "${COMMENT_DAO_VOICE_ID}" + }); + daovoice('update'); + ` }} /> @@ -426,7 +428,7 @@ const ExternalPlugin = props => { async dangerouslySetInnerHTML={{ __html: ` - document.write(unescape("%3Cspan style='display:none' id='cnzz_stat_icon_${ANALYTICS_CNZZ_ID}'%3E%3C/span%3E%3Cscript src='https://s9.cnzz.com/z_stat.php%3Fid%3D${ANALYTICS_CNZZ_ID}' type='text/javascript'%3E%3C/script%3E")); + document.write(unescape("%3Cspan style='display:none' id='cnzz_stat_icon_${ANALYTICS_CNZZ_ID}'%3E%3C/span%3E%3Cscript src='https://s9.cnzz.com/z_stat.php%3Fid%3D${ANALYTICS_CNZZ_ID}' ty[...] ` }} /> From d86c03016cd7e9fabc021059909de68e9894a4fb Mon Sep 17 00:00:00 2001 From: sftbob <111048941+sftbob@users.noreply.github.com> Date: Thu, 4 Jun 2026 16:31:06 +0800 Subject: [PATCH 2/6] fix: add .babelrc configuration for Jest babel-jest transformer --- .babelrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000000..1ff94f7ed28 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["next/babel"] +} From b15e475b90945cfec0e42b6c66e73b147237d4ee Mon Sep 17 00:00:00 2001 From: sftbob <111048941+sftbob@users.noreply.github.com> Date: Thu, 4 Jun 2026 16:34:36 +0800 Subject: [PATCH 3/6] fix: improve Babel configuration for Jest ES6 module transformation --- jest.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 678d722b862..4775e25818c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -44,7 +44,11 @@ const customJestConfig = { // Transform files transform: { - '^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }] + '^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { + presets: ['next/babel'], + babelrc: false, + configFile: false + }] }, // Transform ignore patterns From 0b1f61092e35866538548d8a86501b7ec3ac376c Mon Sep 17 00:00:00 2001 From: sftbob <111048941+sftbob@users.noreply.github.com> Date: Thu, 4 Jun 2026 16:39:09 +0800 Subject: [PATCH 4/6] fix: remove nested CSS rules that conflict with styled-jsx --- themes/endspace/style.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/themes/endspace/style.js b/themes/endspace/style.js index eb89a594d8e..c15784b3e2b 100644 --- a/themes/endspace/style.js +++ b/themes/endspace/style.js @@ -100,12 +100,12 @@ export const Style = () => { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; overflow-x: hidden; /* Custom Tech Cursor - Sharp Spearhead with Heavy Shadow */ - cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M2 2 L12 28 L16 18 L26 14 L2 2 Z' fill='%2318181b' stroke='%23ffffff' stroke-width='1.5' style='filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.3));'/%3E%3C/svg%3E") 2 2, auto; + cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M2 2 L12 28 L16 18 L26 14 L2 2 Z' fill='%2318181b' stroke='%2318181b' stroke-width='0.5'/%3E%3C/svg%3E") 2 2, auto; } #theme-endspace a, #theme-endspace button, #theme-endspace [role="button"], #theme-endspace .cursor-pointer { /* Pointer Cursor - Target Reticle Style */ - cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M2 2 L12 28 L16 18 L26 14 L2 2 Z' fill='%2362F0F5' stroke='%23000000' stroke-width='1.5' style='filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.3));'/%3E%3Ccircle cx='24' cy='24' r='4' fill='none' stroke='%2362F0F5' stroke-width='2'/%3E%3C/svg%3E") 2 2, pointer; + cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='8' fill='none' stroke='%2362F0F5' stroke-width='1'/%3E%3Cline x1='16' y1='8' x2='16' y2='4' stroke='%2362F0F5' stroke-width='1'/%3E%3Cline x1='16' y1='24' x2='16' y2='28' stroke='%2362F0F5' stroke-width='1'/%3E%3Cline x1='8' y1='16' x2='4' y2='16' stroke='%2362F0F5' stroke-width='1'/%3E%3Cline x1='24' y1='16' x2='28' y2='16' stroke='%2362F0F5' stroke-width='1'/%3E%3C/svg%3E") 16 16, auto; } /* Technical Grid Background */ @@ -747,9 +747,7 @@ export const Style = () => { 4px 0 8px rgba(0, 0, 0, 0.3), 8px 0 16px rgba(0, 0, 0, 0.2); } - /* ============================================ - NieR: Automata Style Navigation Transition - ============================================ */ + /* ============================================ NieR: Automata Style Navigation Transition ============================================ */ @@ -798,11 +796,7 @@ export const Style = () => { transition: color 0.3s ease; z-index: 2; } - - /* Removed specific active override to keep consistent grey background */ - - /* Also update the base hover/active shared rule to use this darker grey */ - + .dark .nier-nav-item::before { background: #f4f4f5; /* Light bg in dark mode */ } From 1e8e5fb3afd31c297541f4af2bf0aee19118529f Mon Sep 17 00:00:00 2001 From: t Date: Thu, 4 Jun 2026 18:51:04 +0800 Subject: [PATCH 5/6] fix: restore SWC build by removing Babel config --- .babelrc | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .babelrc diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 1ff94f7ed28..00000000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["next/babel"] -} From a8d027c933ab69466b75e0b9c85ea4d10b366edd Mon Sep 17 00:00:00 2001 From: t Date: Thu, 4 Jun 2026 19:42:43 +0800 Subject: [PATCH 6/6] fix: mock Notion utils in convertInnerUrl tests --- __tests__/lib/db/notion/convertInnerUrl.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/__tests__/lib/db/notion/convertInnerUrl.test.js b/__tests__/lib/db/notion/convertInnerUrl.test.js index 46e591de4c9..b6e0a308ae3 100644 --- a/__tests__/lib/db/notion/convertInnerUrl.test.js +++ b/__tests__/lib/db/notion/convertInnerUrl.test.js @@ -1,5 +1,13 @@ import { convertInnerUrl } from '@/lib/db/notion/convertInnerUrl' +jest.mock('notion-utils', () => ({ + idToUuid: id => + id.replace( + /^(.{8})(.{4})(.{4})(.{4})(.{12})$/, + '$1-$2-$3-$4-$5' + ) +})) + describe('convertInnerUrl', () => { beforeEach(() => { document.body.innerHTML = ''