Skip to content

Commit

Permalink
Merge pull request #1 from PezhmanGhavami/feature
Browse files Browse the repository at this point in the history
Migrate to Next.js 14
  • Loading branch information
PezhmanGhavami authored Jul 15, 2024
2 parents 08eaa0e + 597af4e commit 8243d2e
Show file tree
Hide file tree
Showing 39 changed files with 9,254 additions and 8,190 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BASE_URL="http://localhost"
36 changes: 36 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"prettier"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"root": true,
"rules": {
"func-style": ["error", "expression", { "allowArrowFunctions": true }],
"prefer-arrow-callback": ["error", { "allowNamedFunctions": true }]
}
}
19 changes: 16 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3

- name: Setting env variables
run: |
touch .env
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env
echo SECRET_COOKIE_PASSWORD=${{ secrets.SECRET_COOKIE_PASSWORD }} >> .env
echo BASE_URL=${{ secrets.BASE_URL }} >> .env
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build
- name: Installing dependencies
run: npm ci
- name: Installing sharp
run: npm i sharp
- name: Building a production version
run: npm run build
- name: Restarting the server
run: pm2 restart clothing-shop -s
50 changes: 32 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
# Logs
logs
*.log
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
# local env files
.env*.local
.env

# Editor directories and files
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
19 changes: 19 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ "$branch" = "main" ]; then
echo "Commits to main branch are not allowed 😜"
exit 1
fi

if [ "$branch" = "stage" ]; then
echo "Commits to stage branch are not allowed 😜"
exit 1
fi

echo 'Linting and formatting staged files ⏳'
echo 'please be patient, this may take a while... ⏱️'

npx lint-staged -v
49 changes: 31 additions & 18 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# Logs
logs
*.log
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
# local env files
.env*.local

# Editor directories and files
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
8 changes: 4 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"printWidth": 60,
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"printWidth": 80,
"endOfLine": "auto",
"trailingComma": "all",
"bracketSpacing": true
"plugins": ["prettier-plugin-tailwindcss"]
}
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

File renamed without changes.
39 changes: 39 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import "./globals.css";
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });

export const generateMetadata = async () => {
return {
metadataBase: new URL(process.env.BASE_URL as string),
title: {
default: "Pezhman Ghavami - Front-End Developer",
template: "%s :: Pezhman Ghavami - Front-End Developer",
},
description: "Pezhman Ghavami's Portfolio website",
manifest: "/site.webmanifest",
icons: {
icon: [
"/favicon.ico",
{ url: "/favicon-32x32.png", sizes: "32x32", type: "image/png" },
{ url: "/favicon-16x16.png", sizes: "16x16", type: "image/png" },
],
apple: {
url: "/apple-touch-icon.png",
sizes: "180x180",
},
},
};
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html className="scroll-smooth" lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
Loading

0 comments on commit 8243d2e

Please sign in to comment.