Skip to content

Commit a00e026

Browse files
feat(core): upgrade to next.js (#42)
Vite => Next.js Emotion => Tailwind
1 parent 7da3080 commit a00e026

File tree

131 files changed

+22700
-13135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+22700
-13135
lines changed

.github/workflows/gh-pages-deploy.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Playwright Tests
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
test:
6+
timeout-minutes: 60
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: lts/*
13+
- name: Install dependencies
14+
run: npm ci
15+
- name: Install Playwright Browsers
16+
run: npx playwright install --with-deps
17+
- name: Run Playwright tests
18+
run: npx playwright test
19+
- uses: actions/upload-artifact@v4
20+
if: ${{ !cancelled() }}
21+
with:
22+
name: playwright-report
23+
path: playwright-report/
24+
retention-days: 30

.github/workflows/pr-check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ jobs:
2222
node-version: 22.13.0
2323

2424
- name: Install dependencies
25-
run: yarn install
25+
run: npm install
2626

2727
- name: Run linter
28-
run: yarn lint
28+
run: npm run lint
2929

3030
- name: Run type check
31-
run: yarn typecheck
31+
run: npm run typecheck
3232

3333
- name: Run unit tests
34-
run: yarn test
34+
run: npm run test
3535

3636
- name: Run build
37-
run: yarn build
37+
run: npm run build

.gitignore

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1-
# Logs
2-
logs
3-
*.log
1+
# dependencies
2+
/node_modules
3+
4+
# testing
5+
/coverage
6+
7+
# next.js
8+
/.next/
9+
/out/
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
*.pem
17+
18+
# debug
419
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
pnpm-debug.log*
8-
lerna-debug.log*
9-
10-
node_modules
11-
dist
12-
dist-ssr
13-
*.local
14-
15-
# Editor directories and files
16-
.vscode/*
17-
!.vscode/extensions.json
20+
21+
# env files (can opt-in for committing if needed)
22+
.env*
23+
24+
# vercel
25+
.vercel
26+
27+
# typescript
28+
*.tsbuildinfo
29+
next-env.d.ts
30+
31+
#IDEs
1832
.idea
19-
.DS_Store
20-
*.suo
21-
*.ntvs*
22-
*.njsproj
23-
*.sln
24-
*.sw?
25-
26-
.pnp.*
27-
.yarn/*
28-
!.yarn/patches
29-
!.yarn/plugins
30-
!.yarn/releases
31-
!.yarn/sdks
32-
!.yarn/versions
33+
.vscode
3334

3435
# Playwright
3536
/test-results/
@@ -39,3 +40,5 @@ dist-ssr
3940

4041
# Jest
4142
/coverage
43+
44+

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarn commitlint --edit $1
1+
commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarn lint-staged --allow-empty
1+
lint-staged --allow-empty

.lintstagedrc.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export default {
22
'*.{js,jsx,ts,tsx}': [
3-
'yarn prettier --write',
4-
'yarn eslint --fix',
5-
'yarn test',
6-
() => 'yarn typecheck',
3+
'prettier --write',
4+
'eslint --fix',
5+
'jest --passWithNoTests',
6+
() => 'npm run typecheck',
77
],
8-
'*.{json,css,scss,md}': ['yarn prettier --write', 'yarn eslint --fix'],
8+
'*.{json,css,scss,md}': ['prettier --write', 'eslint --fix'],
99
};

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ git clone git@github.com:vault-developer/event-loop-explorer.git
4343
4444
cd event-loop-explorer
4545
46-
yarn install
46+
npm install
4747
48-
yarn dev
48+
npm run dev
4949
```
5050

5151
### Future Plans:

app/(main)/header/header.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { ThemeToggle } from './themeToggle';
2+
import { Repeat, Github } from 'lucide-react';
3+
import { Button } from '@/components/chadcdn/button';
4+
import Link from 'next/link';
5+
6+
export function Header() {
7+
return (
8+
<div className="flex px-4 py-2 lg:px-6 lg:py-4 items-center justify-between border-b">
9+
<div className="flex items-center gap-2">
10+
<Repeat />
11+
<h2>Event loop explorer</h2>
12+
</div>
13+
14+
<div className="flex items-center gap-2">
15+
<Button asChild variant="ghost" size="iconBig">
16+
<Link
17+
href="https://github.com/vault-developer/event-loop-explorer"
18+
target="_blank"
19+
>
20+
<Github className="size-6" />
21+
</Link>
22+
</Button>
23+
<ThemeToggle />
24+
</div>
25+
</div>
26+
);
27+
}

app/(main)/header/themeToggle.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { useTheme } from 'next-themes';
2+
import { Button } from '@/components/chadcdn/button';
3+
import { Moon, Sun } from 'lucide-react';
4+
5+
export function ThemeToggle() {
6+
const { setTheme, theme } = useTheme();
7+
const onToggle = () => setTheme(theme === 'light' ? 'dark' : 'light');
8+
9+
return (
10+
<Button variant="ghost" size="iconBig" onClick={onToggle}>
11+
<Sun
12+
className="absolute scale-100 dark:scale-0 rotate-0 dark:rotate-90 transition-all size-6"
13+
size={24}
14+
/>
15+
<Moon
16+
className="absolute scale-0 dark:scale-100 rotate-90 dark:rotate-0 transition-all size-6"
17+
size={24}
18+
/>
19+
<span className="sr-only">Toggle theme</span>
20+
</Button>
21+
);
22+
}

0 commit comments

Comments
 (0)