Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:

- run: npm ci

- run: npm test

- run: |
cp src/lib/config.example.js src/lib/config.js
npm run build
96 changes: 0 additions & 96 deletions .github/workflows/deploy.yml

This file was deleted.

86 changes: 81 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Release
name: Release & Deploy

on:
workflow_dispatch:
Expand All @@ -14,16 +14,27 @@ on:

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

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

jobs:
tag:
release:
if: github.actor == github.repository_owner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Compute next version
id: version
run: |
Expand All @@ -38,7 +49,9 @@ jobs:
patch) PATCH=$((PATCH + 1)) ;;
esac

echo "tag=v${MAJOR}.${MINOR}.${PATCH}" >> "$GITHUB_OUTPUT"
TAG="v${MAJOR}.${MINOR}.${PATCH}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=${MAJOR}.${MINOR}.${PATCH}" >> "$GITHUB_OUTPUT"

- name: Create and push tag
run: |
Expand All @@ -47,5 +60,68 @@ jobs:
git tag "${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"

- name: Summary
run: echo "Created tag **${{ steps.version.outputs.tag }}** — deploy workflow will run next." >> "$GITHUB_STEP_SUMMARY"
- name: Set package.json version
run: npm version "${{ steps.version.outputs.version }}" --no-git-tag-version

- name: Generate release notes
id: notes
run: |
PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | sed -n '2p')
if [ -z "$PREV_TAG" ]; then
RANGE="HEAD"
else
RANGE="${PREV_TAG}..HEAD"
fi

FEATURES=$(git log "$RANGE" --pretty=format:'%s' | grep -E '^feat' | sed 's/^/- /' || true)
FIXES=$(git log "$RANGE" --pretty=format:'%s' | grep -E '^fix' | sed 's/^/- /' || true)
OTHERS=$(git log "$RANGE" --pretty=format:'%s' | grep -vE '^(feat|fix|Merge)' | sed 's/^/- /' || true)

{
echo "notes<<NOTES_EOF"
if [ -n "$FEATURES" ]; then
echo "## Features"
echo "$FEATURES"
echo ""
fi
if [ -n "$FIXES" ]; then
echo "## Bug Fixes"
echo "$FIXES"
echo ""
fi
if [ -n "$OTHERS" ]; then
echo "## Other Changes"
echo "$OTHERS"
echo ""
fi
echo "NOTES_EOF"
} >> "$GITHUB_OUTPUT"

- name: Create GitHub release
run: |
gh release create "${{ steps.version.outputs.tag }}" \
--title "${{ steps.version.outputs.tag }}" \
--notes "${{ steps.notes.outputs.notes }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: npm ci

- name: Build
run: |
cp src/lib/config.example.js src/lib/config.js
npm run build

- uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: release
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

echo "Running pre-commit checks..."

npm test --silent
if [ $? -ne 0 ]; then
echo ""
echo "Tests failed. Fix errors before committing."
exit 1
fi

# Ensure config.js exists for build (use example if missing)
if [ ! -f src/lib/config.js ]; then
cp src/lib/config.example.js src/lib/config.js
Expand Down
12 changes: 11 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ src/
ModeToggle.svelte — restaurant / bar toggle
VenueList.svelte — ranked venue results with per-friend distance breakdown
MapView.svelte — Leaflet map with markers and walking route polylines
utils.js — pure business logic (haversine, fairness, formatting)
utils.test.js — unit tests for utils.js
```

## Commands
Expand All @@ -52,11 +54,19 @@ This app calls these APIs from the browser (no backend):

- Before every commit or push, check that `README.md` and `CLAUDE.md` are up-to-date with any features, config changes, or structural changes introduced. Update them if needed before committing.
- Commit messages must follow conventional commit format: `type(scope): description`. Enforced by the `commit-msg` hook.
- When adding or modifying business logic in `utils.js`, add or update unit tests in `utils.test.js`. Tests run automatically via pre-commit hook and CI.
- To release: push a tag `v*` (e.g. `git tag v1.0.0 && git push origin v1.0.0`). The workflow bumps `package.json`, generates release notes from conventional commits, creates a GitHub release, and deploys to Pages.

## Testing

- **Framework:** Vitest
- **Test file:** `src/lib/utils.test.js`
- **Run:** `npm test` (single run) or `npm run test:watch` (watch mode)
- Pure business logic lives in `src/lib/utils.js` (no Svelte dependencies). `stores.svelte.js` imports from `utils.js` and wraps with reactive state.
- Tests run in pre-commit hook and CI. A failing test blocks commits and PR merges.

## Notes

- No test framework is set up yet.
- No backend — everything runs client-side.
- State management uses Svelte 5 runes (`$state`) in `stores.svelte.js`, exported as shared reactive objects.
- Saved groups are persisted in `localStorage` (no database).
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<img src="assets/banner.png" alt="Rendez-vous banner" />
</p>

# Rendez-vous

A web app that helps friends find a fair meeting spot. Add everyone's address, pick restaurant or bar, and get a list of nearby venues ranked by fairness — so no one has to travel more than the others.
Expand Down
Binary file added assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading