Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint and Type Check

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Run lint and type check
run: npm run check
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Nova

[![Release](https://img.shields.io/github/v/release/algotyrnt/nova?display_name=tag)](https://github.com/algotyrnt/nova/releases)
[![CodeQL](https://github.com/algotyrnt/nova/actions/workflows/codeql.yml/badge.svg)](https://github.com/algotyrnt/nova/actions/workflows/codeql.yml)
[![Lint and Type Check](https://github.com/algotyrnt/nova/actions/workflows/check.yml/badge.svg)](https://github.com/algotyrnt/nova/actions/workflows/check.yml)
[![License: MIT](https://img.shields.io/github/license/algotyrnt/nova)](https://github.com/algotyrnt/nova/blob/main/LICENSE)

A minimal, fast, and fully customizable personal portfolio site built with `Next.js` (App Router), `TypeScript`, `MUI`, and `Framer Motion`.
It can render your pinned GitHub repositories and latest Medium posts at build/runtime with ISR.

Live site: [algotyrnt.com](https://algotyrnt.com)


## Features

- App Router + React Server Components
Expand Down Expand Up @@ -154,7 +158,3 @@ Set the same environment variables from `.env.example` in the Vercel project set
npm run build
npm run start
```

## License

MIT
8 changes: 0 additions & 8 deletions eslint.config.mjs

This file was deleted.

15 changes: 15 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -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
15 changes: 13 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nova",
"version": "2.0.7",
"version": "2.1.0",
"private": true,
"license": "MIT",
"author": {
Expand All @@ -16,7 +16,9 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint ."
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"check": "npm run lint && npm run typecheck"
},
"dependencies": {
"@emotion/react": "^11.14.0",
Expand All @@ -40,6 +42,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"
}
Expand Down
23 changes: 19 additions & 4 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,25 @@ export default function Error({
}, [error])

return (
<Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', py: 10, gap: 2 }}>
<Typography variant="h2" sx={{ fontSize: '1.5rem', fontWeight: 500 }}>Something went wrong!</Typography>
<Typography color="text.secondary">An unexpected error occurred while loading this page.</Typography>
<Button variant="outlined" sx={{ mt: 2 }} onClick={reset}>Try again</Button>
<Box
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
py: 10,
gap: 2,
}}
>
<Typography variant="h2" sx={{ fontSize: '1.5rem', fontWeight: 500 }}>
Something went wrong!
</Typography>
<Typography color="text.secondary">
An unexpected error occurred while loading this page.
</Typography>
<Button variant="outlined" sx={{ mt: 2 }} onClick={reset}>
Try again
</Button>
</Box>
)
}
92 changes: 46 additions & 46 deletions src/components/ThemeRegistry/EmotionCache.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<style
key={cache.key}
data-emotion={`${cache.key} ${names.join(' ')}`}
dangerouslySetInnerHTML={{ __html: styles }}
/>
);
});
useServerInsertedHTML(() => {
const names = flush()
if (names.length === 0) {
return null
}
let styles = ''
for (const name of names) {
styles += cache.inserted[name]
}
return (
<style
key={cache.key}
data-emotion={`${cache.key} ${names.join(' ')}`}
dangerouslySetInnerHTML={{ __html: styles }}
/>
)
})

return <CacheProvider value={cache}>{children}</CacheProvider>;
return <CacheProvider value={cache}>{children}</CacheProvider>
}
22 changes: 13 additions & 9 deletions src/components/ThemeRegistry/ThemeRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import CssBaseline from '@mui/material/CssBaseline'
import NextAppDirEmotionCacheProvider from './EmotionCache'
import theme from './theme'

export default function ThemeRegistry({ children }: { children: React.ReactNode }) {
return (
<NextAppDirEmotionCacheProvider options={{ key: 'mui' }}>
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
</ThemeProvider>
</NextAppDirEmotionCacheProvider>
)
export default function ThemeRegistry({
children,
}: {
children: React.ReactNode
}) {
return (
<NextAppDirEmotionCacheProvider options={{ key: 'mui' }}>
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
</ThemeProvider>
</NextAppDirEmotionCacheProvider>
)
}
Loading
Loading