generated from worldcoin/minikit-react-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from evgongora/feat/integrate-biome
feat/fix: full repo Biome linting and formatting, added tests for PR checking
- Loading branch information
Showing
96 changed files
with
5,419 additions
and
4,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
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: | | ||
echo "Node version: $(node -v)" | ||
echo "Current directory: $(pwd)" | ||
echo "Running Biome lint..." | ||
pnpm exec biome ci . | ||
- name: Run Biome format check | ||
working-directory: frontend | ||
run: | | ||
echo "Running Biome format check..." | ||
pnpm exec biome check --files-ignore-unknown=true . | ||
- name: Type check | ||
working-directory: frontend | ||
run: pnpm exec tsc --noEmit | ||
|
||
- name: Run tests | ||
working-directory: frontend | ||
run: pnpm test || echo "No tests found" | ||
|
||
- name: Build application | ||
working-directory: frontend | ||
env: | ||
NEXT_TELEMETRY_DISABLED: 1 | ||
JWT_SECRET: ${{ secrets.JWT_SECRET || 'dummy-secret-for-ci' }} | ||
NEXT_PUBLIC_WLD_APP_ID: ${{ secrets.NEXT_PUBLIC_WLD_APP_ID || 'app_staging_0' }} | ||
run: pnpm build | ||
|
||
security: | ||
name: Security Scan | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
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 || echo "Security vulnerabilities found. Please review the report above." | ||
- name: Check for outdated dependencies | ||
working-directory: frontend | ||
run: | | ||
pnpm outdated || echo "Outdated dependencies found. Please review the report above." | ||
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 | ||
env: | ||
ANALYZE: true | ||
NEXT_TELEMETRY_DISABLED: 1 | ||
JWT_SECRET: ${{ secrets.JWT_SECRET || 'dummy-secret-for-ci' }} | ||
NEXT_PUBLIC_WLD_APP_ID: ${{ secrets.NEXT_PUBLIC_WLD_APP_ID || 'app_staging_0' }} | ||
run: | | ||
pnpm build | ||
- name: Upload bundle analysis | ||
if: success() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bundle-analysis | ||
path: | | ||
frontend/.next/analyze/client.html | ||
frontend/.next/analyze/edge.html | ||
frontend/.next/analyze/nodejs.html | ||
compression-level: 9 | ||
retention-days: 14 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": true, | ||
"include": [ | ||
"src/**/*.{ts,tsx}", | ||
"src/**/*.{js,jsx}", | ||
"src/**/*.json", | ||
"*.config.{ts,js,mjs}", | ||
"*.d.ts", | ||
"eslint.config.mjs", | ||
"next.config.mjs", | ||
"tailwind.config.ts", | ||
"postcss.config.js" | ||
], | ||
"ignore": [ | ||
"**/node_modules/**", | ||
"**/.next/**", | ||
"**/dist/**", | ||
"**/build/**", | ||
"**/*.test.{ts,tsx}", | ||
"**/*.spec.{ts,tsx}", | ||
"**/coverage/**", | ||
"**/storybook-static/**", | ||
"src/app/api-docs/**", | ||
"src/components/ui/icons/**", | ||
".xata/**", | ||
"**/generated/**" | ||
] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 80, | ||
"formatWithErrors": false | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"style": { | ||
"useImportType": "error", | ||
"useNodejsImportProtocol": "error" | ||
}, | ||
"correctness": { | ||
"noUnusedVariables": "error", | ||
"noUndeclaredVariables": "error" | ||
}, | ||
"suspicious": { | ||
"noExplicitAny": "error", | ||
"noConsoleLog": "error" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 80, | ||
"quoteStyle": "double", | ||
"semicolons": "always" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.