Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Next.js 13.4 #26

Merged
merged 32 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5f5dc01
fix: remove useless nested anchor tags
Bartek532 Jul 1, 2023
ce13bc9
fix: config things
Bartek532 Jul 1, 2023
18ddc4e
fix: layout view
Bartek532 Jul 1, 2023
d1ed3ec
feat: include env variables validation
Bartek532 Jul 2, 2023
4beed9f
feat: move pages to app dir
Bartek532 Jul 2, 2023
c50f39b
feat: move fetching spotify track to server component
Bartek532 Jul 2, 2023
74d7872
fix: minor cleanups
Bartek532 Jul 2, 2023
924cb73
feat: optimize fonts
Bartek532 Jul 2, 2023
3ed644a
fix: more lint fixes
Bartek532 Jul 2, 2023
670a9b5
fix: minor fixes in about view
Bartek532 Jul 2, 2023
33ae4eb
fix: minor things in projects/posts
Bartek532 Jul 2, 2023
7ac6864
feat: adjust eslint config
Bartek532 Jul 3, 2023
88991d9
feat: move sending emails from contact form to server action
Bartek532 Jul 3, 2023
ef6fb5f
fix: renames
Bartek532 Jul 3, 2023
be69467
fix: mdx components
Bartek532 Jul 3, 2023
edcec9d
feat: migrate from supabase to vercel kv in tracking views
Bartek532 Jul 3, 2023
651dd8a
fix: move mailer integration to server action
Bartek532 Jul 3, 2023
3ee0a3b
feat: move seo things to app dir
Bartek532 Jul 4, 2023
bea4111
fix: remove deprecated pages dir
Bartek532 Jul 4, 2023
2fd2421
fix: remove vercel kv lib as it's bugged now
Bartek532 Jul 5, 2023
aa26fdb
fix: minor fixes
Bartek532 Jul 5, 2023
73928f3
feat: add google analytics tracking
Bartek532 Jul 5, 2023
484fcf3
feat: add some workflows
Bartek532 Jul 5, 2023
f24594c
fix: scripts fixes
Bartek532 Jul 5, 2023
4e32ca1
chore: update deps
Bartek532 Jul 5, 2023
ce871d1
fix: minor build fixes
Bartek532 Jul 5, 2023
2bb0219
fix: standarize envs
Bartek532 Jul 5, 2023
8a0b792
fix: minor deploy fixes
Bartek532 Jul 5, 2023
1fe8c45
fix: paths
Bartek532 Jul 5, 2023
1df994e
fix: analysis workflow
Bartek532 Jul 5, 2023
e3029d2
fix: scrolling issues on mdx
Bartek532 Jul 6, 2023
86030d4
fix: spotify track fetching
Bartek532 Jul 6, 2023
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
31 changes: 17 additions & 14 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@ SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
SPOTIFY_REFRESH_TOKEN=

GA_TRACKING_ID=

NEXT_PUBLIC_TWITTER_USERNAME=
NEXT_PUBLIC_LINKEDIN_USERNAME=
NEXT_PUBLIC_GITHUB_USERNAME=
SENDGRID_API_KEY=
EMAIL=

NEXT_PUBLIC_ALGOLIA_APP_ID=
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=
KV_REST_API_URL=
KV_REST_API_TOKEN=

ALGOLIA_APP_ID=
ALGOLIA_API_KEY=
ALGOLIA_UPDATE_API_KEY=

NEXT_PUBLIC_URL=

MAILER_LITE_API_KEY=
MAILER_LITE_GROUP_ID=

SENDGRID_API_KEY=
EMAIL=

NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_API_KEY=
NEXT_PUBLIC_TWITTER_USERNAME=
NEXT_PUBLIC_FACEBOOK_USERNAME=
NEXT_PUBLIC_LINKEDIN_USERNAME=
NEXT_PUBLIC_GITHUB_USERNAME=
NEXT_PUBLIC_EMAIL=

NEXT_PUBLIC_GA_TRACKING_ID=

NEXT_PUBLIC_ALGOLIA_APP_ID=
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=

NEXT_PUBLIC_HOST=localhost:3000
47 changes: 0 additions & 47 deletions .eslintrc.js

This file was deleted.

80 changes: 80 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "unused-imports"],
"extends": [
"next",
"next/core-web-vitals",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".ts"],
"moduleDirectory": ["node_modules", "./"]
},
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
// Separate import groups with newline by section
"import/order": [
"error",
{
"alphabetize": {
"caseInsensitive": true,
"order": "asc"
},
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"type",
"unknown"
],
"newlines-between": "always",
"warnOnUnassignedImports": true
}
],
"arrow-body-style": ["warn", "as-needed"],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "enum",
"format": ["UPPER_CASE"]
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"]
}
]
}
}
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: ["develop", main]
pull_request:
branches: ["develop"]
schedule:
- cron: "41 18 * * 2"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["javascript"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
28 changes: 28 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lighthouse

concurrency:
group: lighthouse-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on: [pull_request]

jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Wait for Vercel preview deployment
uses: patrickedqvist/[email protected]
id: waitForVercelPreviewDeployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 600
check_interval: 15

- name: Lighthouse
uses: foo-software/[email protected]
with:
urls: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }}
locale: en
prCommentEnabled: true
102 changes: 102 additions & 0 deletions .github/workflows/nextjs_bundle_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: "Next.js Bundle Analysis"

on:
pull_request:
push:
branches:
- develop
workflow_dispatch:

defaults:
run:
working-directory: ./

permissions:
contents: read
actions: read
pull-requests: write

jobs:
analyze:
runs-on: ubuntu-latest
env:
KV_REST_API_TOKEN: ${{ secrets.KV_REST_API_TOKEN }}
KV_REST_API_URL: ${{ secrets.KV_REST_API_URL }}
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: true

- name: Restore next build
uses: actions/cache@v3
id: restore-build-cache
env:
cache-name: cache-next-build
with:
path: .next/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Build next.js app
run: SKIP_ENV_VALIDATION=1 ./node_modules/.bin/next build

- name: Analyze bundle
run: npx -p nextjs-bundle-analysis report

- name: Upload bundle
uses: actions/upload-artifact@v3
with:
name: bundle
path: .next/analyze/__bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
if: success() && github.event.number
with:
workflow: nextjs_bundle_analysis.yml
branch: ${{ github.event.pull_request.base.ref }}
path: .next/analyze/base

- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare

- name: Get Comment Body
id: get-comment-body
if: success() && github.event.number
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$(cat .next/analyze/__bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT

- name: Find Comment
uses: peter-evans/find-comment@v2
if: success() && github.event.number
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: "<!-- __NEXTJS_BUNDLE -->"

- name: Create Comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}

- name: Update Comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
pnpm lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules
.next
yarn.lock
package-lock.json
pnpm-lock.yaml
public
dist
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 120,
"tabWidth": 2
"tabWidth": 2,
"useTabs": false,
"printWidth": 80
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
}
Loading