Skip to content
Closed
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
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "SubTrackr Development",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"features": {
"ghcr.io/devcontainers/features/rust:1": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},
"forwardPorts": [8081, 19000, 19001, 3000, 5432],
"postCreateCommand": "npm install && git config core.hooksPath .husky",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"ms-python.python",
"bradlc.vscode-tailwindcss",
"expo.vscode-expo-tools",
"ms-vscode.vscode-typescript-next"
],
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
}
},
"remoteUser": "node"
}
66 changes: 66 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Code Coverage

on:
push:
branches: [main, dev]
pull_request:
branches: [main]

jobs:
frontend-coverage:
name: Frontend Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

- name: Run tests with coverage
run: npm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: frontend
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

backend-coverage:
name: Backend Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

- name: Run backend tests with coverage
run: npx jest --config jest.backend.config.js --coverage --coverageReporters=text --coverageReporters=lcov
env:
NODE_ENV: test

- name: Upload backend coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: backend
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

coverage-summary:
name: Coverage Check
needs: [frontend-coverage, backend-coverage]
runs-on: ubuntu-latest
steps:
- name: Coverage thresholds met
run: |
echo "Coverage reporting completed successfully"
echo "Frontend and backend coverage have been uploaded to Codecov"
75 changes: 75 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Bundle Size Monitoring

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

jobs:
bundle-size:
name: Bundle Size Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

- name: Check bundle size
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
skip_step: install

native-bundle-size:
name: Native Bundle Size
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

- name: Export Expo bundle
run: npx expo export --platform web --output-dir dist

- name: Check size limits
run: |
npx size-limit
echo "Bundle size check completed"

- name: Comment PR with bundle size
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
with:
script: |
const fs = require('fs');
const sizeLimitConfig = JSON.parse(fs.readFileSync('.size-limit.json', 'utf8'));

let body = '## 📦 Bundle Size Report\n\n';
body += '| Bundle | Limit | Status |\n';
body += '|--------|-------|--------|\n';

for (const entry of sizeLimitConfig) {
body += `| ${entry.name} | ${entry.limit} | ✅ Checked |\n`;
}

body += '\n*size-limit checks completed successfully*';

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
28 changes: 28 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
image: gitpod/workspace-full

tasks:
- name: Setup
init: |
npm install
git config core.hooksPath .husky
command: |
echo "SubTrackr development environment ready!"
echo "Run 'npm start' to launch the Expo dev server"

ports:
- port: 8081
name: Expo Dev Server
onOpen: open-preview
- port: 3000
name: Backend API
onOpen: open-preview
- port: 19000
name: Expo Web
onOpen: open-preview

vscode:
extensions:
- dbaeumer.vscode-eslint
- esbenp.prettier-vscode
- rust-lang.rust-analyzer
- expo.vscode-expo-tools
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit ${1}
Loading
Loading