diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..36bccb0 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# Base URL for the backend API +# Example: http://localhost:8081 +VUE_APP_API_BASE= diff --git a/package.json b/package.json index 1f55db5..bcf5409 100644 --- a/package.json +++ b/package.json @@ -42,13 +42,16 @@ "vue/setup-compiler-macros": true }, "extends": [ - "plugin:vue/vue3-essential", + "plugin:vue/vue3-recommended", "eslint:recommended" ], "parserOptions": { "parser": "@babel/eslint-parser" }, - "rules": {} + "rules": { + "vue/multi-word-component-names": "off", + "vue/no-mutating-props": "error" + } }, "browserslist": [ "> 1%", diff --git a/refactor-strategy.md b/refactor-strategy.md deleted file mode 100644 index 02456a3..0000000 --- a/refactor-strategy.md +++ /dev/null @@ -1,46 +0,0 @@ -# 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 - -- 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) - -# Refactor Strategy (Outstanding Work) - -Last updated: 2025-10-18 - -Only outstanding, actionable steps are listed below. Completed work has been removed for clarity. - -## 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. - -Acceptance: ESLint upgrade plan decided (or implemented), rules apply cleanly, lint passes. - -## 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). - -Acceptance: N/A (completed). Optional enhancement if queuing desired. - -## 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). - -Acceptance: New logic lands with tests; existing tests stay green. - -## 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). - -Acceptance: Clear env setup; editor help consistent. diff --git a/src/App.vue b/src/App.vue index aa23d13..e96fb13 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,19 +2,31 @@
- {{
+ {{
ingredient?.quantity || 'qty'
}}
- {{
+ {{
ingredient?.unit || 'unit'
}}
of
- {{
+ {{
ingredient?.name || 'name'
- }}:
-
-
+ }}:
+
+
( {{ ingredient?.product?.name }}
+ >
)
- (search?)
+ (search?)
(product)
+ > + >
diff --git a/src/components/meals/DatePicker.vue b/src/components/meals/DatePicker.vue
index 67c002f..bd0d104 100644
--- a/src/components/meals/DatePicker.vue
+++ b/src/components/meals/DatePicker.vue
@@ -1,15 +1,22 @@
-
+
servings
Purchased {{ ago(meal.purchase_date) }}
Cooked by
-
+
{{ chef.name }}{{ englishSeperator(index, meal.chefs) }}
somebody?
For
-
+
{{ consumer.name }}{{ englishSeperator(index, meal.consumers) }}
somebody?
Purchased {{ ago(meal.purchase_date) }}
+ Purchased {{ ago(meal.purchase_date) }}
+
-
+ {{ recipe.name }}
{{ recipe.name }}
-
diff --git a/src/components/meals/EditMealPage.vue b/src/components/meals/EditMealPage.vue
index 0ccf9f3..ccb5704 100644
--- a/src/components/meals/EditMealPage.vue
+++ b/src/components/meals/EditMealPage.vue
@@ -1,7 +1,10 @@
Recipes
-
+
-
+
@@ -30,11 +51,44 @@
+ >
+
-
+
+
-
-
diff --git a/src/components/recipes/EditRecipePage.vue b/src/components/recipes/EditRecipePage.vue
index ac29183..1ad915a 100644
--- a/src/components/recipes/EditRecipePage.vue
+++ b/src/components/recipes/EditRecipePage.vue
@@ -1,9 +1,18 @@
+
-
+
+
+
-
- View Recipe
+
+
+ View Recipe
+
Ingredients
-
+
+
+
+ >
+
Included Meals
@@ -26,119 +26,79 @@