Skip to content

Commit

Permalink
Update Dependencies, Fix Errors, And Reformat (#6)
Browse files Browse the repository at this point in the history
* chore: upgrade dependencies and upgraded eslint config

* chore: fix build error

* chore: remove redundant code

* chore: reformat & remove redundant eslint configs
  • Loading branch information
Soulike authored May 4, 2024
1 parent 47beb97 commit f914f6c
Show file tree
Hide file tree
Showing 198 changed files with 5,275 additions and 5,525 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.eslint.json', './**/tsconfig.json'],
tsconfigRootDir: __dirname,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
plugins: ['@typescript-eslint', 'simple-import-sort'],
root: true,
};
30 changes: 0 additions & 30 deletions .eslintrc.json

This file was deleted.

30 changes: 15 additions & 15 deletions .github/workflows/admin-docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Build and Push Admin Docker Image

on:
push:
branches:
- 'main'
paths:
- 'apps/admin/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- 'Dockerfile'
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'apps/admin/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- 'Dockerfile'
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
with:
docker-file-path: ./Dockerfile
docker-build-target: admin
build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
with:
docker-file-path: ./Dockerfile
docker-build-target: admin
30 changes: 15 additions & 15 deletions .github/workflows/blog-docker-build-and-push copy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Build and Push Blog Docker Image

on:
push:
branches:
- 'main'
paths:
- 'apps/blog/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- 'Dockerfile'
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'apps/blog/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- 'Dockerfile'
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
with:
docker-file-path: ./Dockerfile
docker-build-target: blog
build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
with:
docker-file-path: ./Dockerfile
docker-build-target: blog
26 changes: 13 additions & 13 deletions .github/workflows/nginx-docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Build and Push NGINX Docker Image

on:
push:
branches:
- 'main'
paths:
- 'nginx/configurations/**'
- 'nginx/Dockerfile'
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'nginx/configurations/**'
- 'nginx/Dockerfile'
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
with:
docker-file-path: ./nginx/Dockerfile
docker-build-target: website-nginx
build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
with:
docker-file-path: ./nginx/Dockerfile
docker-build-target: website-nginx
4 changes: 1 addition & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
pnpm --no -- commitlint --edit ${1}
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
pnpm lint-staged
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# website

The monorepo of my personal website.
3 changes: 3 additions & 0 deletions apps/admin/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['../../.eslintrc.cjs', 'next/core-web-vitals'],
};
47 changes: 24 additions & 23 deletions apps/admin/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,33 @@ import {PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD} from 'next/constants.j

/** @type {import('next').NextConfig} */
const nextConfigProduction = {
reactStrictMode: true,
distDir: 'build'
reactStrictMode: true,
distDir: 'build',
transpilePackages: ['@ant-design/icons'], // Fix SyntaxError: Cannot use import statement outside a module
};

export default async (phase, {defaultConfig}) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
/** @type {import('next').NextConfig} */
const nextConfigDev = {
...nextConfigProduction,
rewrites: async () => [
{
source: '/server/:path*',
destination: 'https://admin.soulike.tech/server/:path*'
}
]
};
return nextConfigDev;
} else if (phase === PHASE_PRODUCTION_BUILD) {
if (env.ANALYZE_BUNDLE) {
const {default: bundleAnalyzer} = await import('@next/bundle-analyzer');
const withBundleAnalyzer = bundleAnalyzer({
enabled: true
});
return withBundleAnalyzer(nextConfigProduction);
}
if (phase === PHASE_DEVELOPMENT_SERVER) {
/** @type {import('next').NextConfig} */
const nextConfigDev = {
...nextConfigProduction,
rewrites: async () => [
{
source: '/server/:path*',
destination: 'https://admin.soulike.tech/server/:path*',
},
],
};
return nextConfigDev;
} else if (phase === PHASE_PRODUCTION_BUILD) {
if (env.ANALYZE_BUNDLE) {
const {default: bundleAnalyzer} = await import('@next/bundle-analyzer');
const withBundleAnalyzer = bundleAnalyzer({
enabled: true,
});
return withBundleAnalyzer(nextConfigProduction);
}
}

return nextConfigProduction;
return nextConfigProduction;
};
85 changes: 40 additions & 45 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
{
"name": "admin",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build:analysis": "ANALYZE_BUNDLE=true next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "^13.5.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sharp": "^0.33.3",
"@ant-design/icons": "^5.3.6",
"@website/classes": "workspace:^",
"@website/hooks": "workspace:^",
"@website/react-components": "workspace:^",
"@website/request": "workspace:^",
"antd": "^5.16.1"
},
"devDependencies": {
"sass": "^1.74.1",
"@types/node": "^20.10.3",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@next/bundle-analyzer": "^13.5.6",
"typescript": "^5.3.2"
},
"eslintConfig": {
"extends": [
"../../.eslintrc.json",
"next/core-web-vitals"
]
},
"browserslist": [
"> 0.5%",
"not dead",
"last 10 Chrome versions",
"last 10 Edge versions",
"last 10 Firefox versions",
"last 5 Safari versions"
]
}
"name": "admin",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build:analysis": "ANALYZE_BUNDLE=true next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@ant-design/icons": "^5.3.6",
"@website/classes": "workspace:^",
"@website/hooks": "workspace:^",
"@website/react-components": "workspace:^",
"@website/request": "workspace:^",
"antd": "^5.17.0",
"next": "^14.2.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sharp": "^0.33.3"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.2.3",
"@types/node": "^20.12.8",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"eslint-config-next": "^14.2.3",
"sass": "^1.76.0",
"typescript": "^5.4.5"
},
"browserslist": [
"> 0.5%",
"not dead",
"last 10 Chrome versions",
"last 10 Edge versions",
"last 10 Firefox versions",
"last 5 Safari versions"
]
}
46 changes: 23 additions & 23 deletions apps/admin/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"short_name": "Admin",
"name": "Soulike's admin App",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "avatar.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "avatar.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"short_name": "Admin",
"name": "Soulike's admin App",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "avatar.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "avatar.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Loading

0 comments on commit f914f6c

Please sign in to comment.