Skip to content

Commit 8d13748

Browse files
committed
Initial commit from Create Next App
0 parents  commit 8d13748

23 files changed

+9224
-0
lines changed

.github/workflows/ci-stable.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI - Stable
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [20, 22]
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
22+
- name: Install dependencies (stable)
23+
run: |
24+
npm install next@latest react@latest react-dom@latest --legacy-peer-deps
25+
npm install
26+
27+
- name: Run tests
28+
run: npm test
29+
30+
- name: Build
31+
run: npm run build

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
43+
/src/generated/prisma
44+
data

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
This is a sample project that shows how to test async React Server Components in Next.js using
2+
3+
- this gist: https://gist.github.com/sroebert/a04ca6e0232a4a60bc50d7f164f101f6
4+
- Vitest
5+
- [React Testing Library](https://github.com/testing-library/react-testing-library#readme)
6+
7+
Hopefully there will be official support for this in the future.
8+
9+
## The component
10+
11+
The component that is being tested is a [Greeting](./src/app/greeting.tsx) component that displays "Good morning" if the current time is before 12pm, and "Good afternoon" if the current time is after 12pm.
12+
13+
## Running the tests
14+
15+
```bash
16+
npm run test
17+
```

eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;

next.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
};
6+
7+
export default nextConfig;

0 commit comments

Comments
 (0)