munch-ease-frontend/refactor-strategy.md

47 lines
1.8 KiB
Markdown
Raw Normal View History

2025-10-18 01:30:30 +00:00
# Refactor Strategy
This document outlines a pragmatic, step-by-step refactor plan to improve structure, readability, and maintainability. Each step includes a clear outcome and a checkbox to track progress.
Last updated: 2025-10-18
## Goals
2025-10-18 02:08:22 +00:00
2025-10-18 01:30:30 +00:00
- Separate concerns (routing, HTTP/API, mapping/normalization, UI logic)
- Improve readability and testability
- Establish light-weight standards (naming, lint/format) without blocking development
- Keep changes incremental and safe
## Phases and Steps
### Phase 1 — Routing and Auth (Foundational)
2025-10-18 02:08:22 +00:00
2025-10-18 03:06:24 +00:00
# Refactor Strategy (Outstanding Work)
2025-10-18 02:39:25 +00:00
Last updated: 2025-10-18
2025-10-18 03:06:24 +00:00
Only outstanding, actionable steps are listed below. Completed work has been removed for clarity.
2025-10-18 02:39:25 +00:00
2025-10-18 03:06:24 +00:00
## 1) Linting and rules modernization
- Evaluate upgrading ESLint and eslint-plugin-vue to latest that fully supports Vue 3 macros and recommended rules.
- Align rules with Composition API best practices; ensure Prettier remains source of truth.
2025-10-18 02:39:25 +00:00
2025-10-18 03:06:24 +00:00
Acceptance: ESLint upgrade plan decided (or implemented), rules apply cleanly, lint passes.
2025-10-18 02:39:25 +00:00
2025-10-18 03:12:27 +00:00
## 2) Alerts as a composable
- DONE: Replaced the event bus with `useAlert` composable and updated `AlertToast.vue` and callers.
- Follow-up: consider queuing multiple alerts if needed (current behavior shows latest only).
2025-10-18 02:39:25 +00:00
2025-10-18 03:12:27 +00:00
Acceptance: N/A (completed). Optional enhancement if queuing desired.
2025-10-18 02:39:25 +00:00
2025-10-18 03:06:24 +00:00
## 3) Incremental test coverage
- Add unit tests for new utilities/composables when added (e.g., `useAlert`).
- Consider snapshot tests for components with stable UI fragments (cards, list items).
2025-10-18 02:47:56 +00:00
2025-10-18 03:06:24 +00:00
Acceptance: New logic lands with tests; existing tests stay green.
2025-10-18 02:39:25 +00:00
2025-10-18 03:06:24 +00:00
## 4) Developer experience
- Document .env usage with `VUE_APP_API_BASE` and add a `.env.example` file.
- Add Volar as a recommended extension in the project docs (README updated).
2025-10-18 02:57:40 +00:00
2025-10-18 03:06:24 +00:00
Acceptance: Clear env setup; editor help consistent.