Skip to content

Commit ff8ad3b

Browse files
authored
Merge pull request #11 from sameboat-platform/restore-main-fix
Establish v0.1.0 baseline; Restore main: reintroduce lost files.
2 parents a20b436 + ff35d06 commit ff8ad3b

File tree

80 files changed

+12503
-2246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+12503
-2246
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
build
3+
coverage
4+
node_modules

.eslintrc.cjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2021: true, node: true },
4+
parser: "@typescript-eslint/parser",
5+
parserOptions: {
6+
ecmaVersion: "latest",
7+
sourceType: "module",
8+
project: false, // set to tsconfig.json if you later need type-aware rules
9+
ecmaFeatures: { jsx: true },
10+
},
11+
plugins: ["@typescript-eslint", "react", "react-hooks", "jsx-a11y"],
12+
extends: [
13+
"eslint:recommended",
14+
"plugin:@typescript-eslint/recommended",
15+
"plugin:react/recommended",
16+
"plugin:react-hooks/recommended",
17+
"plugin:jsx-a11y/recommended",
18+
],
19+
settings: {
20+
react: { version: "detect" },
21+
},
22+
rules: {
23+
// sensible defaults
24+
"react/react-in-jsx-scope": "off", // Vite + React 17+ doesn’t need React in scope
25+
"react/prop-types": "off", // we use TypeScript for types
26+
"@typescript-eslint/explicit-module-boundary-types": "off",
27+
// a11y nudges that are helpful in forms/links
28+
"jsx-a11y/anchor-is-valid": "warn",
29+
"jsx-a11y/no-autofocus": "warn",
30+
},
31+
ignorePatterns: [
32+
"dist",
33+
"build",
34+
"node_modules",
35+
"*.config.*",
36+
"**/*.d.ts",
37+
],
38+
};

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .gitattributes
2+
.husky/** text eol=lf
3+
*.sh text eol=lf
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Pull Request
2+
3+
## Summary
4+
5+
Describe the change concisely.
6+
7+
## Type of Change
8+
9+
- [ ] Feature
10+
- [ ] Fix
11+
- [ ] Refactor
12+
- [ ] Documentation
13+
- [ ] Chore / Internal
14+
15+
## Changelog
16+
17+
- [ ] I added an entry under `[Unreleased]` in `CHANGELOG.md` (or this PR does not warrant a changelog line).
18+
19+
## Testing
20+
21+
Describe how you tested this (or include screenshots/logs if UI/behavioral change).
22+
23+
## Checklist
24+
25+
- [ ] Types pass (`npm run typecheck`)
26+
- [ ] Lint passes (`npm run lint`)
27+
- [ ] Tests pass (`npm test`)
28+
- [ ] No unused exports / dead code introduced
29+
30+
## Follow-Up Tasks (Optional)
31+
32+
List any deferred work.

.github/workflows/frontend-ci.yml

Lines changed: 36 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,7 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8-
workflow_dispatch:
9-
inputs:
10-
node-version:
11-
description: Node version
12-
default: "20"
13-
required: true
14-
type: string
15-
run-lint:
16-
description: Run ESLint
17-
default: true
18-
type: boolean
19-
run-typecheck:
20-
description: Run TypeScript type check
21-
default: true
22-
type: boolean
23-
run-tests:
24-
description: Run unit tests (Vitest/Jest) with coverage if available
25-
default: false
26-
type: boolean
27-
run-build:
28-
description: Run production build
29-
default: true
30-
type: boolean
8+
workflow_dispatch: {}
319

3210
permissions:
3311
contents: read
@@ -51,14 +29,13 @@ jobs:
5129
- name: Use Node.js
5230
uses: actions/setup-node@v4
5331
with:
54-
node-version: ${{ inputs.node-version || '20' }}
32+
node-version: 20
5533
cache: npm
5634

5735
- name: Install deps
5836
run: npm ci
5937

6038
- name: Lint
61-
if: ${{ inputs.run-lint != false }}
6239
run: |
6340
if npm run -s | grep -q "^ lint"; then
6441
npm run lint -- --format github
@@ -67,29 +44,33 @@ jobs:
6744
fi
6845
6946
- name: Typecheck
70-
if: ${{ inputs.run-typecheck != false }}
7147
run: |
7248
if npm run -s | grep -q "^ typecheck"; then
7349
npm run typecheck
7450
else
7551
npx tsc --noEmit
7652
fi
7753
78-
- name: Tests (Vitest/Jest)
79-
if: ${{ inputs.run-tests }}
54+
- name: Tests (Vitest)
8055
run: |
8156
if npm run -s | grep -q "^ test"; then
82-
npx vitest --run --coverage || npm test -- --run
57+
npm run test
8358
else
8459
echo "No test script – skipping"
8560
fi
8661
62+
- name: Changelog Check
63+
run: |
64+
if npm run -s | grep -q "changelog:check"; then
65+
npm run changelog:check || (echo "\nChangelog check failed." && exit 1)
66+
else
67+
echo "No changelog:check script – skipping"
68+
fi
69+
8770
- name: Build
88-
if: ${{ inputs.run-build != false }}
8971
run: npm run build
9072

9173
- name: Upload build artifact (dist/)
92-
if: ${{ inputs.run-build != false }}
9374
uses: actions/upload-artifact@v4
9475
with:
9576
name: web-dist
@@ -98,7 +79,6 @@ jobs:
9879
retention-days: 7
9980

10081
- name: Upload coverage (if generated)
101-
if: ${{ inputs.run-tests }}
10282
uses: actions/upload-artifact@v4
10383
with:
10484
name: coverage
@@ -107,39 +87,27 @@ jobs:
10787
coverage/**/*
10888
if-no-files-found: ignore
10989
retention-days: 7
110-
111-
# netlify-deploy:
112-
# name: Netlify deploy
113-
# needs: build-test
114-
# runs-on: ubuntu-latest
115-
# if: >
116-
# (github.event_name == 'pull_request') ||
117-
# (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
118-
# steps:
119-
# - name: Download build artifact
120-
# uses: actions/download-artifact@v4
121-
# with:
122-
# name: web-dist
123-
# path: dist
124-
#
125-
# - name: Install Netlify CLI
126-
# run: npm i -g netlify-cli
127-
#
128-
# - name: Deploy preview (PR) or prod (manual on main)
129-
# env:
130-
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
131-
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
132-
# run: |
133-
# if [ "${{ github.event_name }}" = "pull_request" ]; then
134-
# netlify deploy \
135-
# --dir=dist \
136-
# --site="$NETLIFY_SITE_ID" \
137-
# --auth="$NETLIFY_AUTH_TOKEN" \
138-
# --message "PR #${{ github.event.pull_request.number }}" \
139-
# --draft --json
140-
# else
141-
# netlify deploy \
142-
# --dir=dist \
143-
# --site="$NETLIFY_SITE_ID" \
144-
# --auth="$NETLIFY_AUTH_TOKEN" \
145-
# --prod --message "manual main" --json
90+
# name: web-dist
91+
# path: dist
92+
#
93+
# - name: Install Netlify CLI
94+
# run: npm i -g netlify-cli
95+
#
96+
# - name: Deploy preview (PR) or prod (manual on main)
97+
# env:
98+
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
99+
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
100+
# run: |
101+
# if [ "${{ github.event_name }}" = "pull_request" ]; then
102+
# netlify deploy \
103+
# --dir=dist \
104+
# --site="$NETLIFY_SITE_ID" \
105+
# --auth="$NETLIFY_AUTH_TOKEN" \
106+
# --message "PR #${{ github.event.pull_request.number }}" \
107+
# --draft --json
108+
# else
109+
# netlify deploy \
110+
# --dir=dist \
111+
# --site="$NETLIFY_SITE_ID" \
112+
# --auth="$NETLIFY_AUTH_TOKEN" \
113+
# --prod --message "manual main" --json

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ dist-ssr
2626
# local env
2727
.env
2828
.env.*
29-
!.env.example
29+
!.env.example
30+
31+
# Agent Reports
32+
agent-reports

.husky/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
npx --no-install commitlint --edit "$1"

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

CHANGELOG.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and (once stabilized) will align with [Semantic Versioning](https://semver.org/) for tagged releases.
6+
7+
## [Unreleased]
8+
9+
### Added
10+
- Nothing yet.
11+
12+
### Changed
13+
- Nothing yet.
14+
15+
### Fixed
16+
- Nothing yet.
17+
18+
### Documentation
19+
- Nothing yet.
20+
21+
### Internal
22+
- Nothing yet.
23+
24+
### Notes
25+
- Nothing yet.
26+
27+
## [0.1.0] - 2025-10-02
28+
29+
> Initial structured milestone capturing Week 3 outcomes (auth + UI/UX + tooling baseline).
30+
31+
### Added
32+
- Auth pages: Login, Register, Me (protected) with Chakra-based forms.
33+
- Central `AuthProvider` with single guarded bootstrap (`/api/me`).
34+
- Error mapping layer (`errors.ts`) with friendly codes (BAD_CREDENTIALS, EMAIL_EXISTS, etc.).
35+
- User normalization (role→roles[], displayName inference).
36+
- ProtectedRoute gating + framer-motion route/state transitions.
37+
- Health check card with interval polling, skeleton debounce, manual refresh.
38+
- Runtime Debug Panel (collapsible, probe history, copy helpers, error count, reduced-motion respect).
39+
- Chakra theme (dark mode default), selective component integration (Cards, Alerts, Buttons, Badges).
40+
- Sticky footer with version + commit hash + feedback link.
41+
- Environment variable typings (`vite-env.d.ts`).
42+
- Release automation script (`scripts/release.mjs`).
43+
- Changelog enforcement script (`scripts/check-changelog.mjs`).
44+
- Husky integration & commitlint hook enforcement.
45+
- Conventional commit rules (`commitlint.config.cjs`).
46+
- Vitest coverage thresholds (50%).
47+
- Developer Workflow Checklist (`docs/developer-workflow-checklist.md`).
48+
- Coverage & workflow docs surfaced in README / architecture.
49+
- CI enhancements (tests default, coverage gate, changelog step, ordered pipeline).
50+
51+
### Changed
52+
- Layout refactored to full-height flex shell (`AppShell`) with sticky footer.
53+
- Forms migrated from basic HTML to Chakra primitives with inline validation.
54+
- Me page enhanced (avatar placeholder, role badges, grouped sections).
55+
- `README.md`: workflow, coverage threshold, release script, Husky/commitlint details, expanded scripts table.
56+
- `docs/architecture.md`: CI pipeline order clarity, tooling extension point, release automation details.
57+
- `TTD.md`: Expanded workflow/tooling backlog (test guard, auto-labeling, feature test heuristics).
58+
59+
### Documentation
60+
- README: Auth lifecycle, runtime debug panel, planning artifacts.
61+
- `architecture.md`: Auth lifecycle, transitions, planning references.
62+
- Week 3 progress checklist (percent metrics & blockers).
63+
- Week 4 draft plan scaffold.
64+
- Developer workflow appendix (git hooks, commit message enforcement) & planning/workflow links.
65+
66+
### Internal / Tooling / Dev Experience
67+
- Structured fetch wrapper (`api.ts`) with typed generics and error cause propagation.
68+
- Optional verbose auth bootstrap logging via `VITE_DEBUG_AUTH*` flags.
69+
- ESLint configuration tightened (import sorting / a11y plugins; explicit `lint` / `lint:fix`).
70+
- Standardized test invocation (`npm run test`) for coverage gating.
71+
- Added `release`, `changelog:check`, and `lint:fix` scripts to `package.json`.
72+
- Implemented `prepare` script for automatic Husky hook install.
73+
74+
### Notes
75+
- Testing breadth still partial (protected route + basic form validation only).
76+
- Next minor release (`0.2.0`) will focus on auth test gap closure + first resilience enhancement (pause-on-error health polling or reduced-motion toggle).
77+
- Patch release pathway (`0.1.x`) available if urgent fixes needed.
78+
79+
---
80+
81+
Guidelines:
82+
83+
- Start new entries under [Unreleased]; move them into a dated version section when cutting a release (and optionally tagging in git).
84+
- Group changes under: Added / Changed / Fixed / Removed / Deprecated / Security / Docs / Internal as needed.
85+
86+
[Unreleased]: https://github.com/sameboat-platform/frontend/compare/0.1.0...HEAD
87+
[0.1.0]: https://github.com/sameboat-platform/frontend/tree/0.1.0

0 commit comments

Comments
 (0)