Skip to content

Commit fd6d286

Browse files
setup: separate site/ and app/ (velocitylabs-org#7)
1 parent 9ea1858 commit fd6d286

37 files changed

+10292
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store
File renamed without changes.

site/.env.local.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Provide your Sentry DSN to allow Sentry to capture errors in your application.
2+
NEXT_PUBLIC_SENTRY_DSN=''

site/.eslintrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": ["next/core-web-vitals", "prettier"],
3+
"plugins": ["tsdoc"],
4+
"rules": {
5+
"tsdoc/syntax": "warn"
6+
}
7+
}

site/.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
37+
38+
# Sentry Config File
39+
.sentryclirc
40+
41+
# SWC Plugins directory
42+
.swc/

site/.husky/pre-commit

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd "$(dirname -- "$0")/.."
5+
6+
npm run format
7+
npm run lint

site/.prettierignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.next
3+
LICENSE
4+
docs
5+
package-lock.json
6+
*.md
7+
.env*

site/.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"plugins": ["prettier-plugin-tailwindcss"],
3+
"semi": false,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"printWidth": 100,
7+
"tabWidth": 2,
8+
"useTabs": false
9+
}

site/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

site/jest.config.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { Config } from 'jest'
2+
import nextJest from 'next/jest.js'
3+
4+
const createJestConfig = nextJest({
5+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
6+
dir: './',
7+
})
8+
9+
// Add any custom config to be passed to Jest
10+
const config: Config = {
11+
coverageProvider: 'v8',
12+
testEnvironment: 'jsdom',
13+
// Add more setup options before each test is run
14+
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
15+
}
16+
17+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
18+
export default createJestConfig(config)

site/next.config.mjs

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { withSentryConfig } from '@sentry/nextjs'
2+
/** @type {import('next').NextConfig} */
3+
const nextConfig = {
4+
images: {
5+
domains: [],
6+
remotePatterns: [
7+
{
8+
protocol: 'https',
9+
hostname: '**', // for testing purposes allow all domains. TODO restrict to specific domains.
10+
},
11+
],
12+
},
13+
}
14+
15+
export default withSentryConfig(
16+
nextConfig,
17+
{
18+
// For all available options, see:
19+
// https://github.com/getsentry/sentry-webpack-plugin#options
20+
21+
// Suppresses source map uploading logs during build
22+
silent: true,
23+
org: 'noah-joeris', // TODO: replace with actual organization
24+
project: 'javascript-nextjs', // TODO: replace with actual project name
25+
},
26+
{
27+
// For all available options, see:
28+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
29+
30+
// Upload a larger set of source maps for prettier stack traces (increases build time)
31+
widenClientFileUpload: true,
32+
33+
// Transpiles SDK to be compatible with IE11 (increases bundle size)
34+
transpileClientSDK: true,
35+
36+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
37+
// This can increase your server load as well as your hosting bill.
38+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
39+
// side errors will fail.
40+
tunnelRoute: '/monitoring',
41+
42+
// Hides source maps from generated client bundles
43+
hideSourceMaps: true,
44+
45+
// Automatically tree-shake Sentry logger statements to reduce bundle size
46+
disableLogger: true,
47+
48+
// Enables automatic instrumentation of Vercel Cron Monitors.
49+
// See the following for more information:
50+
// https://docs.sentry.io/product/crons/
51+
// https://vercel.com/docs/cron-jobs
52+
automaticVercelMonitors: true,
53+
},
54+
)

site/package.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "site",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"test": "jest",
11+
"test:watch": "jest --watch",
12+
"format": "prettier --write .",
13+
"format-check": "prettier --check .",
14+
"prepare": "cd .. && husky install site/.husky"
15+
},
16+
"dependencies": {
17+
"@sentry/nextjs": "^7.114.0",
18+
"clsx": "^2.1.1",
19+
"framer-motion": "^11.1.9",
20+
"next": "14.2.3",
21+
"react": "^18",
22+
"react-dom": "^18",
23+
"tailwind-merge": "^2.3.0"
24+
},
25+
"devDependencies": {
26+
"@testing-library/jest-dom": "^6.4.5",
27+
"@testing-library/react": "^15.0.6",
28+
"@types/node": "^20",
29+
"@types/react": "^18",
30+
"@types/react-dom": "^18",
31+
"daisyui": "^4.10.2",
32+
"eslint": "^8",
33+
"eslint-config-next": "14.2.3",
34+
"eslint-config-prettier": "^9.1.0",
35+
"eslint-plugin-tsdoc": "^0.2.17",
36+
"husky": "^8.0.0",
37+
"jest": "^29.7.0",
38+
"jest-environment-jsdom": "^29.7.0",
39+
"postcss": "^8",
40+
"prettier": "^3.2.5",
41+
"prettier-plugin-tailwindcss": "^0.5.14",
42+
"sentry-testkit": "^5.0.9",
43+
"tailwindcss": "^3.4.1",
44+
"ts-node": "^10.9.2",
45+
"typescript": "^5"
46+
}
47+
}

0 commit comments

Comments
 (0)