From d9ee539ee685da74f3332539022eeef25a2da725 Mon Sep 17 00:00:00 2001 From: punjitha <132387971+algotyrnt@users.noreply.github.com> Date: Tue, 17 Mar 2026 10:15:09 +0530 Subject: [PATCH 01/11] Replace js with ts --- eslint.config.mjs | 8 -------- eslint.config.ts | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) delete mode 100644 eslint.config.mjs create mode 100644 eslint.config.ts diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 7f95a91..0000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import prettier from 'eslint-plugin-prettier/recommended' - -export default [ - { - ignores: ['.next/', 'node_modules/'], - }, - prettier, -] diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..1ff86de --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,15 @@ +import type { Linter } from 'eslint' +import nextCoreWebVitals from 'eslint-config-next/core-web-vitals' +import nextTypescript from 'eslint-config-next/typescript' +import prettier from 'eslint-plugin-prettier/recommended' + +const config: Linter.Config[] = [ + ...nextCoreWebVitals, + ...nextTypescript, + { + ignores: ['.next/', 'node_modules/'], + }, + prettier, +] + +export default config From f256f10514c4c645fcf85479f1d4242d5dbdc117 Mon Sep 17 00:00:00 2001 From: punjitha <132387971+algotyrnt@users.noreply.github.com> Date: Tue, 17 Mar 2026 10:15:21 +0530 Subject: [PATCH 02/11] Disable JavaScript support in TypeScript configuration --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 23efadf..c7a16ca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "dom.iterable", "esnext" ], - "allowJs": true, + "allowJs": false, "skipLibCheck": true, "strict": true, "noEmit": true, From fbcd8be0564bd5ce9ddb84c3406dbd81373c46c5 Mon Sep 17 00:00:00 2001 From: punjitha <132387971+algotyrnt@users.noreply.github.com> Date: Tue, 17 Mar 2026 10:15:38 +0530 Subject: [PATCH 03/11] Add jiti as a dependency in package.json and package-lock.json --- package-lock.json | 11 +++++++++++ package.json | 1 + 2 files changed, 12 insertions(+) diff --git a/package-lock.json b/package-lock.json index 7b35b98..6bc107c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "eslint-config-next": "^16.1.6", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.4", + "jiti": "^2.6.1", "prettier": "^3.7.4", "typescript": "^5" } @@ -4811,6 +4812,16 @@ "node": ">= 0.4" } }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/package.json b/package.json index cfd37c6..61d030d 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "eslint-config-next": "^16.1.6", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.4", + "jiti": "^2.6.1", "prettier": "^3.7.4", "typescript": "^5" } From 6b4601336c68c18be62bf1ee20fbacc8a8991492 Mon Sep 17 00:00:00 2001 From: punjitha <132387971+algotyrnt@users.noreply.github.com> Date: Tue, 17 Mar 2026 10:16:04 +0530 Subject: [PATCH 04/11] Refactor components for improved formatting --- src/app/error.tsx | 23 ++++- src/components/ThemeRegistry/EmotionCache.tsx | 92 ++++++++--------- .../ThemeRegistry/ThemeRegistry.tsx | 22 +++-- src/components/ThemeRegistry/theme.ts | 98 +++++++++---------- src/components/layout/header.tsx | 2 +- src/components/sections/Projects.tsx | 37 +++++-- src/components/sections/Work.tsx | 7 +- src/components/ui/FadeIn.tsx | 34 +++---- src/components/ui/Stagger.tsx | 64 ++++++------ src/lib/config.ts | 9 +- 10 files changed, 218 insertions(+), 170 deletions(-) diff --git a/src/app/error.tsx b/src/app/error.tsx index 3c86b0c..e0ddc4b 100644 --- a/src/app/error.tsx +++ b/src/app/error.tsx @@ -18,10 +18,25 @@ export default function Error({ }, [error]) return ( - - Something went wrong! - An unexpected error occurred while loading this page. - + + + Something went wrong! + + + An unexpected error occurred while loading this page. + + ) } diff --git a/src/components/ThemeRegistry/EmotionCache.tsx b/src/components/ThemeRegistry/EmotionCache.tsx index 0aabb20..a555bc4 100644 --- a/src/components/ThemeRegistry/EmotionCache.tsx +++ b/src/components/ThemeRegistry/EmotionCache.tsx @@ -1,55 +1,55 @@ -'use client'; +'use client' // Adapted from https://mui.com/material-ui/guides/nextjs/ -import * as React from 'react'; -import { CacheProvider } from '@emotion/react'; -import createCache, { type Options as CacheOptions } from '@emotion/cache'; -import { useServerInsertedHTML } from 'next/navigation'; +import * as React from 'react' +import { CacheProvider } from '@emotion/react' +import createCache, { type Options as CacheOptions } from '@emotion/cache' +import { useServerInsertedHTML } from 'next/navigation' export default function NextAppDirEmotionCacheProvider({ - options, - children, + options, + children, }: { - options: CacheOptions; - children: React.ReactNode; + options: CacheOptions + children: React.ReactNode }) { - const [{ cache, flush }] = React.useState(() => { - const cache = createCache(options); - cache.compat = true; - const prevInsert = cache.insert; - let inserted: string[] = []; - cache.insert = (...args) => { - const serialized = args[1]; - if (cache.inserted[serialized.name] === undefined) { - inserted.push(serialized.name); - } - return prevInsert(...args); - }; - const flush = () => { - const prevInserted = inserted; - inserted = []; - return prevInserted; - }; - return { cache, flush }; - }); + const [{ cache, flush }] = React.useState(() => { + const cache = createCache(options) + cache.compat = true + const prevInsert = cache.insert + let inserted: string[] = [] + cache.insert = (...args) => { + const serialized = args[1] + if (cache.inserted[serialized.name] === undefined) { + inserted.push(serialized.name) + } + return prevInsert(...args) + } + const flush = () => { + const prevInserted = inserted + inserted = [] + return prevInserted + } + return { cache, flush } + }) - useServerInsertedHTML(() => { - const names = flush(); - if (names.length === 0) { - return null; - } - let styles = ''; - for (const name of names) { - styles += cache.inserted[name]; - } - return ( -