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

feat/fix: full repo Biome linting and formatting, added tests for PR checking #139

Merged
merged 12 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
134 changes: 134 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: PR Check

on:
pull_request:
branches: [ main, develop ]

jobs:
quality:
name: Code Quality & Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: |
cd frontend
pnpm install
pnpm add -D @biomejs/biome @next/bundle-analyzer
cp ../biome.json .

- name: Run Biome lint
working-directory: frontend
run: pnpm exec biome lint .

- name: Run Biome format check
working-directory: frontend
run: pnpm exec biome ci .

- name: Type check
working-directory: frontend
run: pnpm type-check

- name: Run tests
working-directory: frontend
run: pnpm test

- name: Build application
working-directory: frontend
run: pnpm build

security:
name: Security Scan
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Install dependencies
run: |
cd frontend
pnpm install

- name: Run security audit
working-directory: frontend
run: pnpm audit

- name: Check for outdated dependencies
working-directory: frontend
run: pnpm outdated

bundle-analysis:
name: Bundle Analysis
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Install dependencies
run: |
cd frontend
pnpm install
pnpm add -D @next/bundle-analyzer

- name: Build and analyze bundle
working-directory: frontend
run: pnpm build
env:
ANALYZE: 'true'

- name: Upload bundle analysis
uses: actions/upload-artifact@v4
with:
name: bundle-analysis
path: |
frontend/.next/analyze/*.html
compression-level: 9
retention-days: 14
20 changes: 0 additions & 20 deletions .github/workflows/relyance-sci.yml

This file was deleted.

40 changes: 39 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
.DS_Store
# dependencies
/node_modules
/.pnp
.pnp.js

# 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.example
.env
.env.*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# IDE
.vscode
.idea
72 changes: 72 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": true,
"include": [
"frontend/src/app/**/*.ts",
"frontend/src/app/**/*.tsx",
"frontend/src/components/**/*.ts",
"frontend/src/components/**/*.tsx",
"frontend/src/hooks/**/*.ts",
"frontend/src/hooks/**/*.tsx",
"frontend/src/providers/**/*.ts",
"frontend/src/providers/**/*.tsx",
"frontend/src/lib/**/*.ts",
"frontend/src/lib/**/*.tsx",
"frontend/src/types/**/*.ts",
"frontend/src/types/**/*.tsx",
"frontend/src/middleware.ts",
"types/**/*.ts",
"types/**/*.d.ts"
],
"ignore": [
"**/node_modules/**",
"**/.next/**",
"**/dist/**",
"**/build/**",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/coverage/**",
"**/storybook-static/**",
"frontend/src/app/api-docs/**",
"frontend/src/components/ui/icons/**"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"formatWithErrors": false,
"include": ["**/*.{ts,tsx,js,jsx,json}"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useImportType": "error"
}
}
},
"javascript": {
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"quoteStyle": "double",
"semicolons": "always"
}
}
}
23 changes: 23 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Next Auth Configuration
NEXTAUTH_URL=
NEXTAUTH_SECRET=
JWT_SECRET=

# Worldcoin Integration
WLD_CLIENT_ID=
WLD_CLIENT_SECRET=
NEXT_PUBLIC_WLD_APP_ID=
APP_ID=

# API Keys
DEV_PORTAL_API_KEY=

# Xata Database
XATA_BRANCH=
XATA_API_KEY=
XATA_DATABASE_URL=

# Environment Configuration
NEXT_PUBLIC_PAYMENT_ADDRESS=
NEXT_PUBLIC_APP_ENV=
NODE_ENV=
6 changes: 4 additions & 2 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*
# env files
.env
.env.*
!.env.example

# vercel
.vercel
Expand Down
9 changes: 7 additions & 2 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import bundleAnalyzer from '@next/bundle-analyzer'

const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
Expand All @@ -16,9 +22,8 @@ const nextConfig = {
ignoreBuildErrors: false,
},
eslint: {
dirs: ['src'],
ignoreDuringBuilds: false,
},
};

export default nextConfig;
export default withBundleAnalyzer(nextConfig);
Loading
Loading