Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 10 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: 'Next.js + Tailwind development standards and instructions'
applyTo: '**/*.tsx, **/*.ts, **/*.jsx, **/*.js, **/*.css'
description: "Next.js + Tailwind development standards and instructions"
applyTo: "**/*.tsx, **/*.ts, **/*.jsx, **/*.js, **/*.css"
---

# Next.js + Tailwind Development Instructions
Expand Down Expand Up @@ -30,52 +30,60 @@ Instructions for high-quality Next.js applications with Tailwind CSS styling and
## Development Standards

### Architecture

- App Router with server and client components
- Group routes by feature/domain
- Implement proper error boundaries
- Use React Server Components by default
- Leverage static optimization where possible

### TypeScript

- Strict mode enabled
- Clear type definitions
- Proper error handling with type guards
- Zod for runtime type validation

### Styling

- Tailwind CSS with consistent color palette
- Responsive design patterns
- Dark mode support
- Follow container queries best practices
- Maintain semantic HTML structure

### State Management

- React Server Components for server state
- React hooks for client state
- Proper loading and error states
- Optimistic updates where appropriate

### Data Fetching

- Server Components for direct database queries
- React Suspense for loading states
- Proper error handling and retry logic
- Cache invalidation strategies

### Security

- Input validation and sanitization
- Proper authentication checks
- CSRF protection
- Rate limiting implementation
- Secure API route handling

### Performance

- Image optimization with next/image
- Font optimization with next/font
- Route prefetching
- Proper code splitting
- Bundle size optimization

## Implementation Process

1. Plan component hierarchy
2. Define types and interfaces
3. Implement server-side logic
Expand Down
61 changes: 61 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: 2
updates:
# Enable version updates for npm (JavaScript/TypeScript dependencies)
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "UTC"
# Group all minor and patch updates into a single PR
groups:
dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"
# Keep major updates separate for careful review
open-pull-requests-limit: 10
labels:
- "dependencies"
- "npm"
commit-message:
prefix: "chore(deps)"
include: "scope"
# Increase pull request limit for initial update
pull-request-branch-name:
separator: "-"
reviewers:
- "DanStuartDept"
- "copilot"
# Allow Dependabot to rebase PRs
rebase-strategy: "auto"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "UTC"
# Group all GitHub Actions updates into a single PR
groups:
github-actions:
patterns:
- "*"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "chore(deps)"
include: "scope"
pull-request-branch-name:
separator: "-"
reviewers:
- "DanStuartDept"
- "copilot"
rebase-strategy: "auto"
66 changes: 33 additions & 33 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # For commenting coverage on PRs
pull-requests: write # For commenting coverage on PRs
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -39,7 +39,7 @@ jobs:
run: pnpm run test

- name: Comment coverage on PR
uses: romeovs/lcov-reporter-action@v0.3.1
uses: romeovs/lcov-reporter-action@v0.4.0
if: github.event_name == 'pull_request'
with:
lcov-file: ./coverage/lcov.info
Expand All @@ -53,18 +53,18 @@ jobs:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -79,18 +79,18 @@ jobs:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -105,18 +105,18 @@ jobs:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -134,21 +134,21 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # For commenting performance results on PRs
pull-requests: write # For commenting performance results on PRs
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
continue-on-error: true

- name: Upload Lighthouse results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
if: always()
continue-on-error: true
with:
Expand All @@ -201,37 +201,37 @@ jobs:
include-hidden-files: true

- name: Comment performance summary on PR
uses: actions/github-script@v7
uses: actions/github-script@v8
if: github.event_name == 'pull_request' && always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');

// Find Lighthouse JSON report files
const lighthouseDir = '.lighthouseci';
if (!fs.existsSync(lighthouseDir)) {
console.log('No Lighthouse results found');
return;
}

const files = fs.readdirSync(lighthouseDir);
const jsonFiles = files.filter(f => f.startsWith('lhr-') && f.endsWith('.json'));

if (jsonFiles.length === 0) {
console.log('No Lighthouse JSON reports found');
return;
}

// Get artifact URL for HTML reports
const runId = context.runId;
const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}`;

let comment = '## 🚀 Lighthouse Performance Results\n\n';
comment += '| URL | Performance | Accessibility | Best Practices | SEO | Report |\n';
comment += '|-----|-------------|---------------|----------------|-----|--------|\n';

// Process each JSON report
for (const jsonFile of jsonFiles) {
const reportPath = path.join(lighthouseDir, jsonFile);
Expand All @@ -251,9 +251,9 @@ jobs:

comment += `| ${url} | ${perf} | ${a11y} | ${bp} | ${seo} | ${reportLink} |\n`;
}

comment += '\n*Download the `lighthouse-results` artifact from the workflow run to view detailed HTML reports.*';

await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@ name: Build and Publish Storybook to GitHub Pages
on:
push:
branches:
- 'main'
- "main"

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

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

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install dependencies
run: pnpm install

- name: Build Storybook
run: pnpm build-storybook

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: storybook-static

Expand Down
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pnpm commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pnpm lint-staged
Loading