Skip to content

Commit

Permalink
Merge pull request #3 from RenanSui/development
Browse files Browse the repository at this point in the history
Add Scripts, Workflows and Unlighthouse
  • Loading branch information
RenanSui authored Sep 17, 2024
2 parents 29de9ab + bad52e4 commit 467c241
Show file tree
Hide file tree
Showing 151 changed files with 5,502 additions and 7,109 deletions.
26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# Since the ".env" file is gitignored, you can use the ".env.example" file to
# build a new ".env" file when you clone the repo. Keep this file up-to-date
# when you add new variables to `.env`.

# This file will be committed to version control, so make sure not to have any
# secrets in it. If you are cloning this repo, create a copy of this file named
# ".env" and populate it with your secrets.

# When adding additional environment variables, the schema in "/src/env.mjs"
# should be updated accordingly.

# App
# Use the production URL when deploying to production
NEXT_PUBLIC_APP_URL="http://localhost:3000"

# Supabase configuration
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_JWT_SECRET=
NEXT_DATABASE_PASSWORD=

# next-auth configuration
NEXTAUTH_URL=
NEXTAUTH_SECRET=

# Google configuration
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
Expand Down
22 changes: 0 additions & 22 deletions .env.local.example

This file was deleted.

77 changes: 77 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/** @type {import("eslint").Linter.Config} */
const config = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
},
plugins: ['@typescript-eslint', 'tailwindcss', 'jsx-a11y'],
extends: [
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended-type-checked',
'prettier',
'plugin:prettier/recommended',
'plugin:tailwindcss/recommended',
],
rules: {
'prettier/prettier': [
'error',
{
printWidth: 120,
tabWidth: 2,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'always',
semi: false,
endOfLine: 'auto',
},
],
'jsx-a11y/alt-text': [
'warn',
{
elements: ['img'],
img: ['Image'],
},
],
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-proptypes': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'react/no-unknown-property': 'error',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/consistent-type-imports': [
'warn',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
attributes: false,
},
},
],
},
settings: {
tailwindcss: {
callees: ['cn', 'cva'],
config: './tailwind.config.ts',
classRegex: '^(class(Name)?|tw)$',
},
next: {
rootDir: ['./'],
},
},
}
module.exports = config
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Code check

on:
pull_request:
branches: ["*"]
push:
branches: ["main"]

jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3.0.0
name: Install pnpm
id: pnpm-install
with:
version: 8.6.1
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- run: cp .env.example .env.local

- run: pnpm lint
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env files
*.env

# local env files
.env*.local
.env*

# vercel
.vercel
Expand All @@ -38,4 +35,7 @@ yarn-error.log*
next-env.d.ts

# supabase
/supabase/**/*.sql
/supabase/**/*.sql

# unlighthouse
.unlighthouse
11 changes: 3 additions & 8 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

/** @type {import('next').NextConfig} */
const nextConfig = withBundleAnalyzer({
const nextConfig = {
images: {
remotePatterns: [
{
Expand All @@ -13,6 +8,6 @@ const nextConfig = withBundleAnalyzer({
},
],
},
})
}

module.exports = nextConfig
export default nextConfig
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"name": "expenser",
"version": "0.1.0",
"version": "1.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"analyze": "cross-env ANALYZE=true next build",
"db:start": "pnpm dlx supabase start",
"db:stop": "pnpm dlx supabase stop",
"db:restart": "pnpm dlx supabase stop && pnpm dlx supabase start",
"lint": "next lint",
"database": "pnpx supabase gen types typescript --project-id hnnognxlfmpwfhsbdkxy --schema next_auth > src/types/database.types.ts",
"analyze": "cross-env ANALYZE=true next build"
"unlighthouse": "pnpm dlx unlighthouse --site https://spenso.vercel.app"
},
"dependencies": {
"@auth/supabase-adapter": "^0.1.18",
Expand Down Expand Up @@ -41,7 +44,7 @@
"clsx": "^2.1.0",
"cmdk": "^0.2.1",
"date-fns": "^2.30.0",
"geist": "^1.3.0",
"geist": "^1.3.1",
"jotai": "^2.7.1",
"jsonwebtoken": "^9.0.2",
"lucide-react": "^0.292.0",
Expand All @@ -63,17 +66,21 @@
},
"devDependencies": {
"@next/bundle-analyzer": "^14.1.4",
"@rocketseat/eslint-config": "^2.2.2",
"@total-typescript/ts-reset": "^0.5.1",
"@types/eslint": "^8.56.10",
"@types/node": "^20.11.30",
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"autoprefixer": "^10.4.19",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-next": "14.2.3",
"eslint-plugin-jest-dom": "^5.1.0",
"eslint-config-next": "^14.2.5",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-tailwindcss": "^3.17.4",
"happy-dom": "^12.10.3",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
Expand Down
Loading

0 comments on commit 467c241

Please sign in to comment.