From 7190764e63716c8d2098a772b61ed44a200fa54e Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Thu, 18 Jul 2024 21:54:03 +0200 Subject: [PATCH 1/2] fix: attempt to fix ci memory leak --- .eslintignore | 16 ---------------- apps/site/.eslintignore | 15 +++++++++++++++ apps/site/next.config.mjs | 2 +- apps/site/util/getHighlighter.ts | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 apps/site/.eslintignore diff --git a/.eslintignore b/.eslintignore index f8dbaece5a6f9..3c3629e647f5d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,17 +1 @@ node_modules - -# Next.js & Vercel Directories -.next -.turbo -.swc -build - -# We don't want to lint/prettify the Coverage Results -coverage -junit.xml - -# We shouldn't lint statically generated Storybook files -storybook-static - -# This file naturally might break conventional rules -global.d.ts diff --git a/apps/site/.eslintignore b/apps/site/.eslintignore new file mode 100644 index 0000000000000..20fdf101f8aa4 --- /dev/null +++ b/apps/site/.eslintignore @@ -0,0 +1,15 @@ +# Next.js & Vercel Directories +.next +.turbo +.swc +build + +# We don't want to lint/prettify the Coverage Results +coverage +junit.xml + +# We shouldn't lint statically generated Storybook files +storybook-static + +# This file naturally might break conventional rules +global.d.ts diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index 187e9a111c735..9fd5295768103 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -112,7 +112,7 @@ const nextConfig = { 'shiki', ], // Removes the warning regarding the WebPack Build Worker - webpackBuildWorker: false, + webpackBuildWorker: true, // Enables Next.js's Instrumentation Hook instrumentationHook: true, }, diff --git a/apps/site/util/getHighlighter.ts b/apps/site/util/getHighlighter.ts index ac13b83db8993..9669598bf7b66 100644 --- a/apps/site/util/getHighlighter.ts +++ b/apps/site/util/getHighlighter.ts @@ -1,4 +1,4 @@ -import { getHighlighterCore } from '@shikijs/core'; +import { getSingletonHighlighterCore } from '@shikijs/core'; import type { HighlighterCore } from '@shikijs/core'; import { getWasmInstance } from '@shikijs/core/wasm-inlined'; @@ -6,7 +6,7 @@ import { LANGUAGES, DEFAULT_THEME } from '@/shiki.config.mjs'; // This creates a memoized minimal Shikiji Syntax Highlighter export const getShiki = () => - getHighlighterCore({ + getSingletonHighlighterCore({ themes: [DEFAULT_THEME], langs: LANGUAGES, loadWasm: getWasmInstance, From f8c9bf34e1f4284b5af67d7e4b80f71bba94d073 Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Thu, 18 Jul 2024 22:02:54 +0200 Subject: [PATCH 2/2] chore: fixed eslint rules --- .eslintignore | 4 ++++ apps/site/.eslintignore | 3 +++ apps/site/tsconfig.json | 13 ++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.eslintignore b/.eslintignore index 3c3629e647f5d..ab22ce98c29c5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,5 @@ +# Node.js node_modules + +# Next.js & Vercel Directories +.turbo diff --git a/apps/site/.eslintignore b/apps/site/.eslintignore index 20fdf101f8aa4..11fbaa70596e8 100644 --- a/apps/site/.eslintignore +++ b/apps/site/.eslintignore @@ -1,3 +1,6 @@ +# Node.js +node_modules + # Next.js & Vercel Directories .next .turbo diff --git a/apps/site/tsconfig.json b/apps/site/tsconfig.json index ed0b2335836f9..613b2c5576e99 100644 --- a/apps/site/tsconfig.json +++ b/apps/site/tsconfig.json @@ -14,8 +14,14 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, - "paths": { "@/*": ["./*"] }, - "plugins": [{ "name": "next" }], + "paths": { + "@/*": ["./*"] + }, + "plugins": [ + { + "name": "next" + } + ], "baseUrl": "." }, "mdx": { @@ -28,7 +34,8 @@ "**/*.tsx", ".next/types/**/*.ts", ".storybook/**/*.ts", - ".storybook/**/*.tsx" + ".storybook/**/*.tsx", + "build/types/**/*.ts" ], "exclude": ["node_modules", ".next"] }