Skip to content

Commit

Permalink
Merge pull request #773 from tszhong0411/dev
Browse files Browse the repository at this point in the history
feat: update
  • Loading branch information
tszhong0411 committed May 23, 2024
2 parents 029fb1f + fc1b30f commit 5e45a3c
Show file tree
Hide file tree
Showing 231 changed files with 8,611 additions and 6,643 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-maps-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tszhong0411/tsconfig": patch
---

update config
5 changes: 5 additions & 0 deletions .changeset/four-lamps-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tszhong0411/eslint-config": patch
---

update config
5 changes: 5 additions & 0 deletions .changeset/gold-crabs-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tszhong0411/ui": patch
---

import react style
5 changes: 5 additions & 0 deletions .changeset/sixty-nails-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tszhong0411/utils": patch
---

update utils
5 changes: 5 additions & 0 deletions .changeset/slow-stingrays-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tszhong0411/ui': patch
---

refactor classname
5 changes: 5 additions & 0 deletions .changeset/wicked-ears-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tszhong0411/prettier-config": patch
---

update config
37 changes: 37 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"dictionaries": ["libraries", "project-words"],
"dictionaryDefinitions": [
{
"name": "libraries",
"path": "./.cspell/libraries.txt",
"description": "A list of libraries"
},
{
"name": "project-words",
"path": "./.cspell/project-words.txt",
"description": "A list of project specific words"
}
],
"files": [
"**/*.{js,cjs,mjs,ts,jsx,tsx,md,mdx,html,json,css,toml,yaml,yml,css}"
],
"ignorePaths": [
"*lock.{yaml,json}",
"CHANGELOG.md",
"*.mp4",
"volumes",
"*.txt"
],
"import": [
"@cspell/dict-typescript/cspell-ext.json",
"@cspell/dict-companies/cspell-ext.json",
"@cspell/dict-fullstack/cspell-ext.json",
"@cspell/dict-markdown/cspell-ext.json",
"@cspell/dict-npm/cspell-ext.json",
"@cspell/dict-node/cspell-ext.json"
],
"language": "en-US",
"useGitignore": true,
"version": "0.2"
}
19 changes: 19 additions & 0 deletions .cspell/libraries.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
autosize
cmdk
cobe
jiti
knip
lightningcss
normy
paralleldrive
rehype
shiki
shikijs
sonarjs
sonner
tinycolor2
tiptap
tsup
tszhong0411
vfile
zustand
57 changes: 57 additions & 0 deletions .cspell/project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
aceternity
airpods
anishde
bentogrids
calcom
callees
cleanmymac
cleanshot
corepack
customizer
delba
frontmatter
fuma
fumadocs
goodnotes
googleusercontent
gstatic
honghong
honghongme
jahir
joshwcomeau
karabiner
keka
leerob
lightroom
linktree
macbook
maximeheckel
motrix
mounty
nextdotjs
nextra
nikolovlazar
nodedotjs
nosniff
orbstack
photoshop
pixelsnap
planetscale
preinstall
prosemirror
raycast
rmiz
sameorigin
samuelkraft
scrollspy
shadcn
simulately
tableplus
techstack
theodorusclarence
umami
unzoom
visualstudiocode
vocs
wakatime
zenorocha
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ WAKATIME_API_KEY=
# Authentication
# @see https://next-auth.js.org/getting-started/example
# ---------------------------------------------------------------------------------------------------------

NEXTAUTH_SECRET=
NEXTAUTH_URL="http://localhost:3000/api/auth"

# Google OAuth
GOOGLE_CLIENT_ID=
Expand Down Expand Up @@ -88,4 +86,4 @@ AUTHOR_EMAIL=
# NEXT_PUBLIC_FLAG_SPOTIFY=true
# NEXT_PUBLIC_FLAG_ANALYTICS=true
# NEXT_PUBLIC_FLAG_GUESTBOOK_NOTIFICATION=true
# NEXT_PUPLIC_FLAG_LIKE_BUTTON=true
# NEXT_PUBLIC_FLAG_LIKE_BUTTON=true
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
ignorePatterns: ['apps/**', 'packages/**'],
extends: ['@tszhong0411/eslint-config', 'plugin:turbo/recommended'],
parserOptions: {
project: true
}
}
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
run: pnpm install

- name: Build packages
run: pnpm build --filter=./packages/*
run: pnpm build:packages

- name: Create dotenv file
run: echo "DATABASE_URL=postgres://postgres:@localhost:5432" >> .env.local

- name: Check
run: pnpm check
23 changes: 23 additions & 0 deletions .knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"ignoreBinaries": ["only-allow"],
"workspaces": {
".": {
"project": ["**/*.{js,ts,tsx}"]
},
"apps/web": {
"entry": ["./src/**/*.{js,ts,tsx}"],
"ignoreDependencies": ["sharp"]
},
"packages/eslint-config": {
"eslint": {
"config": "index.js"
}
},
"packages/prettier-config": {
"prettier": {
"config": "index.js"
}
}
}
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Misc
.changeset/*.md
**/db/migrations/**/*
pnpm-lock.yaml
pnpm-workspace.yaml
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"unifiedjs.vscode-mdx"
"unifiedjs.vscode-mdx",
"streetsidesoftware.code-spell-checker"
]
}
23 changes: 0 additions & 23 deletions .vscode/project.code-snippets
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
{
"Custom Icon Component": {
"scope": "typescriptreact",
"prefix": "icon",
"body": [
"import * as React from 'react'",
"",
"export const Icon$1 = (props: React.SVGAttributes<SVGElement>) => {",
" return (",
" <svg",
" xmlns='http://www.w3.org/2000/svg'",
" width='24'",
" height='24'",
" viewBox='0 0 24 24'",
" fill='currentColor'",
" {...props}",
" >",
" $2",
" </svg>",
" )",
"}",
""
]
},
"Stateless Functional Component": {
"scope": "typescriptreact",
"prefix": "sfc",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"cSpell.enableFiletypes": ["mdx"],

"cSpell.enabled": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The following flags can be set in the `.env.local` file to enable specific featu
- `NEXT_PUBLIC_FLAG_SPOTIFY`: Spotify integration (Now Playing).
- `NEXT_PUBLIC_FLAG_ANALYTICS`: Umami analytics.
- `NEXT_PUBLIC_FLAG_GUESTBOOK_NOTIFICATION`: Discord notification for guestbook.
- `NEXT_PUPLIC_FLAG_LIKE_BUTTON`: Like button for blog posts.
- `NEXT_PUBLIC_FLAG_LIKE_BUTTON`: Like button for blog posts.

## Conventional Commits

Expand Down
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ Welcome to the monorepo of my personal blog! This repository houses the code for
- 💄 Prettier - code formatting
- 〰️ Drizzle - ORM
- 👷🏻‍♂️ t3-env - validate environment variables before building
- 🤖 Auto refresh - fast refresh when updating MDX

## 🔨 Requirements

- Node, recommended `20.x`
- Node, recommended `20.x` with [corepack](https://nodejs.org/api/corepack.html) enabled
- pnpm, recommended `9.x`
- PostgreSQL, recommended `14.x` (using [docker compose](./docker-compose.yml))
- [Visual Studio Code](https://code.visualstudio.com/) with [recommended extensions](.vscode/extensions.json)
Expand All @@ -68,6 +69,37 @@ Please refer to the [contributing guidelines](./CONTRIBUTING.md) for detailed in

This project has been possible thanks to the wonderful open-source community. Special thanks to [Timothy](https://www.timlrx.com/) for the [Tailwind nextjs starter blog template](https://github.com/timlrx/tailwind-nextjs-starter-blog).

This project also uses / adapts the following open-source projects
Without them, this project would not have been possible:

- Comment System - from [fuma-comment](https://github.com/fuma-nama/fuma-comment)
- Rehype Plugins - from [fuma-docs](https://github.com/fuma-nama/fumadocs)
- MDX Rendering - from [next-mdx-remote](https://github.com/hashicorp/next-mdx-remote)
- Auto Refresh - from [next-remote-refresh](https://github.com/souporserious/next-remote-refresh)
- UI - from [shadcn/ui](https://github.com/shadcn-ui/ui)

Referenced the following projects for inspiration:

- [fumadocs](https://fumadocs.vercel.app/) ❤️
- [leerob.io](https://leerob.io/)
- [nextra](https://nextra.site/)
- [theodorusclarence.com](https://theodorusclarence.com/)
- [ped.ro](https://ped.ro/)
- [delba.dev](https://delba.dev/)
- [joshwcomeau.com](https://www.joshwcomeau.com/)
- [blog.maximeheckel.com](https://blog.maximeheckel.com/)
- [zenorocha.com](https://zenorocha.com/)
- [jahir.dev](https://jahir.dev/)
- [anishde.dev](https://anishde.dev/)
- [nikolovlazar.com](https://nikolovlazar.com/)
- [samuelkraft.com](https://samuelkraft.com/)
- [bentogrids](https://bentogrids.com/)
- [ui.aceternity.com](https://ui.aceternity.com/)
- [hover.dev](https://www.hover.dev/)
- [vocs.dev](https://vocs.dev/)

and more but I can't remember them all 🥹

## ✍🏻 Author

- [@tszhong0411](https://github.com/tszhong0411)
Expand Down
9 changes: 9 additions & 0 deletions apps/web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['next/core-web-vitals', '@tszhong0411/eslint-config'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname
}
}
9 changes: 0 additions & 9 deletions apps/web/.eslintrc.json

This file was deleted.

13 changes: 3 additions & 10 deletions apps/web/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import * as dotenv from 'dotenv'
import { type Config } from 'drizzle-kit'

dotenv.config({
path: '../../.env.local'
})

if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL is required')
}
import { env } from './src/env'

export default {
dialect: 'postgresql',
schema: './src/db/schema.ts',
dbCredentials: {
url: process.env.DATABASE_URL
url: env.DATABASE_URL
},
out: './src/db/migration'
out: './src/db/migrations'
} satisfies Config

0 comments on commit 5e45a3c

Please sign in to comment.