From 32141187ba56f8d32c654cda5677e1c263f58803 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:27:52 -0500 Subject: [PATCH] fix: Update frontend refs (#7444) --- .github/copilot-instructions.md | 16 ++++++++-------- .github/workflows/auto-merge-l10n.yml | 8 ++++---- .vscode/settings.json | 2 +- crowdin.yml | 4 ++-- dev/code-generation/gen_ts_locales.py | 6 +++--- dev/code-generation/gen_ts_types.py | 8 ++++---- dev/code-generation/utils/static.py | 2 +- .../developers-guide/starting-dev-server.md | 2 +- frontend/app/types/components.d.ts | 2 -- 9 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 97cbc382a..3f3b7287c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -28,7 +28,7 @@ Mealie is a self-hosted recipe manager, meal planner, and shopping list applicat **Schemas & Type Generation:** - Pydantic schemas in `mealie/schema/` with strict separation: `*In`, `*Out`, `*Create`, `*Update` suffixes - Auto-exported from submodules via `__init__.py` files (generated by `task dev:generate`) -- TypeScript types auto-generated from Pydantic schemas - **never manually edit** `frontend/lib/api/types/` +- TypeScript types auto-generated from Pydantic schemas - **never manually edit** `frontend/app/lib/api/types/` **Database & Sessions:** - Session management via `Depends(generate_session)` in FastAPI routes @@ -45,9 +45,9 @@ Mealie is a self-hosted recipe manager, meal planner, and shopping list applicat - **Page Components** (`components/` with page prefix): Last resort for breaking up complex pages **API Client Pattern:** -- API clients in `frontend/lib/api/` extend `BaseAPI`, `BaseCRUDAPI`, or `BaseCRUDAPIReadOnly` -- Types imported from auto-generated `frontend/lib/api/types/` (DO NOT EDIT MANUALLY) -- Composables in `frontend/composables/` for shared state and API logic (e.g., `use-mealie-auth.ts`) +- API clients in `frontend/app/lib/api/` extend `BaseAPI`, `BaseCRUDAPI`, or `BaseCRUDAPIReadOnly` +- Types imported from auto-generated `frontend/app/lib/api/types/` (DO NOT EDIT MANUALLY) +- Composables in `frontend/app/composables/` for shared state and API logic (e.g., `use-mealie-auth.ts`) - Use `useAuthBackend()` for authentication state, `useMealieAuth()` for user management **State Management:** @@ -148,7 +148,7 @@ task docker:prod # Build and run production Docker compose ### Cross-Cutting Concerns 1. **Code generation is source of truth:** After Pydantic schema changes, run `task dev:generate` to update: - - TypeScript types (`frontend/lib/api/types/`) + - TypeScript types (`frontend/app/lib/api/types/`) - Schema exports (`mealie/schema/*/__init__.py`) - Test data paths and routes @@ -189,7 +189,7 @@ task docker:prod # Build and run production Docker compose - For frontend, does TypeScript code pass strict type checking? **Generated Files:** -- Verify `frontend/lib/api/types/` files weren't manually edited (they're auto-generated) +- Verify `frontend/app/lib/api/types/` files weren't manually edited (they're auto-generated) - Check that `mealie/schema/*/__init__.py` exports match actual schema files (auto-generated) - If schemas changed, confirm generated files were updated via `task dev:generate` @@ -216,7 +216,7 @@ task docker:prod # Build and run production Docker compose ## Common Gotchas -- **Don't manually edit generated files:** `frontend/lib/api/types/`, schema `__init__.py` files +- **Don't manually edit generated files:** `frontend/app/lib/api/types/`, schema `__init__.py` files - **Repository context:** Repos are group/household-scoped - passing wrong IDs causes 404s - **Session handling:** Don't create sessions manually, use dependency injection or `session_context()` - **Schema changes require codegen:** After changing Pydantic models, run `task dev:generate` @@ -229,7 +229,7 @@ task docker:prod # Build and run production Docker compose - `Taskfile.yml` - All development commands and workflows - `mealie/routes/_base/base_controllers.py` - Controller base classes and patterns - `mealie/repos/repository_factory.py` - Repository factory and available repos -- `frontend/lib/api/base/base-clients.ts` - API client base classes +- `frontend/app/lib/api/base/base-clients.ts` - API client base classes - `tests/conftest.py` - Test fixtures and setup - `dev/code-generation/main.py` - Code generation entry point diff --git a/.github/workflows/auto-merge-l10n.yml b/.github/workflows/auto-merge-l10n.yml index d91c1d2c7..94602dc9c 100644 --- a/.github/workflows/auto-merge-l10n.yml +++ b/.github/workflows/auto-merge-l10n.yml @@ -55,8 +55,8 @@ jobs: for file in $FILES; do # Check if file matches any allowed path - if [[ "$file" == "frontend/composables/use-locales/available-locales.ts" ]] || \ - [[ "$file" =~ ^frontend/lang/ ]] || \ + if [[ "$file" == "frontend/app/composables/use-locales/available-locales.ts" ]] || \ + [[ "$file" =~ ^frontend/app/lang/ ]] || \ [[ "$file" =~ ^mealie/lang/ ]] || \ [[ "$file" =~ ^mealie/repos/seed/resources/[^/]+/locales/ ]]; then continue @@ -65,8 +65,8 @@ jobs: # File doesn't match allowed paths echo "::error::Invalid file path: $file" echo "Only the following paths are allowed:" - echo " - frontend/composables/use-locales/available-locales.ts" - echo " - frontend/lang/" + echo " - frontend/app/composables/use-locales/available-locales.ts" + echo " - frontend/app/lang/" echo " - mealie/lang/" echo " - mealie/repos/seed/resources/*/locales/" exit 1 diff --git a/.vscode/settings.json b/.vscode/settings.json index 09e792532..3d159e80d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,7 +37,7 @@ "vue" ], "i18n-ally.keystyle": "nested", - "i18n-ally.localesPaths": "frontend/lang/messages", + "i18n-ally.localesPaths": "frontend/app/lang/messages", "i18n-ally.sourceLanguage": "en-US", "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", "python.testing.autoTestDiscoverOnSaveEnabled": false, diff --git a/crowdin.yml b/crowdin.yml index 16d34a878..2e912eac6 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -4,8 +4,8 @@ pull_request_labels: [ "l10n" ] files: - - source: /frontend/lang/messages/en-US.json - translation: /frontend/lang/messages/%locale%.json + - source: /frontend/app/lang/messages/en-US.json + translation: /frontend/app/lang/messages/%locale%.json - source: /mealie/lang/messages/en-US.json translation: /mealie/lang/messages/%locale%.json - source: /mealie/repos/seed/resources/foods/locales/en-US.json diff --git a/dev/code-generation/gen_ts_locales.py b/dev/code-generation/gen_ts_locales.py index 3f92e1957..5ca1ece28 100644 --- a/dev/code-generation/gen_ts_locales.py +++ b/dev/code-generation/gen_ts_locales.py @@ -84,10 +84,10 @@ class CrowdinApi: PROJECT_DIR = Path(__file__).parent.parent.parent -datetime_dir = PROJECT_DIR / "frontend" / "lang" / "dateTimeFormats" -locales_dir = PROJECT_DIR / "frontend" / "lang" / "messages" +datetime_dir = PROJECT_DIR / "frontend" / "app" / "lang" / "dateTimeFormats" +locales_dir = PROJECT_DIR / "frontend" / "app" / "lang" / "messages" nuxt_config = PROJECT_DIR / "frontend" / "nuxt.config.ts" -i18n_config = PROJECT_DIR / "frontend" / "i18n.config.ts" +i18n_config = PROJECT_DIR / "frontend" / "app" / "i18n.config.ts" reg_valid = PROJECT_DIR / "mealie" / "schema" / "_mealie" / "validators.py" """ diff --git a/dev/code-generation/gen_ts_types.py b/dev/code-generation/gen_ts_types.py index 69c0d749e..1e03e2863 100644 --- a/dev/code-generation/gen_ts_types.py +++ b/dev/code-generation/gen_ts_types.py @@ -33,11 +33,11 @@ PROJECT_DIR = Path(__file__).parent.parent.parent def generate_global_components_types() -> None: - destination_file = PROJECT_DIR / "frontend" / "types" / "components.d.ts" + destination_file = PROJECT_DIR / "frontend" / "app" / "types" / "components.d.ts" component_paths = { - "global": PROJECT_DIR / "frontend" / "components" / "global", - "layout": PROJECT_DIR / "frontend" / "components" / "Layout", + "global": PROJECT_DIR / "frontend" / "app" / "components" / "global", + "layout": PROJECT_DIR / "frontend" / "app" / "components" / "Layout", } def render_template(template: str, data: dict) -> str | None: @@ -182,7 +182,7 @@ def generate_typescript_types() -> None: # noqa: C901 return str_path schema_path = PROJECT_DIR / "mealie" / "schema" - types_dir = PROJECT_DIR / "frontend" / "lib" / "api" / "types" + types_dir = PROJECT_DIR / "frontend" / "app" / "lib" / "api" / "types" ignore_dirs = ["__pycache__", "static", "_mealie"] diff --git a/dev/code-generation/utils/static.py b/dev/code-generation/utils/static.py index 7c48f0c6d..cba8a5c1b 100644 --- a/dev/code-generation/utils/static.py +++ b/dev/code-generation/utils/static.py @@ -16,7 +16,7 @@ class CodeTemplates: class CodeDest: interface = PARENT / "generated" / "interface.js" pytest_routes = PARENT / "generated" / "test_routes.py" - use_locales = PROJECT_DIR / "frontend" / "composables" / "use-locales" / "available-locales.ts" + use_locales = PROJECT_DIR / "frontend" / "app" / "composables" / "use-locales" / "available-locales.ts" class CodeKeys: diff --git a/docs/docs/contributors/developers-guide/starting-dev-server.md b/docs/docs/contributors/developers-guide/starting-dev-server.md index 22ff6391b..da4720d74 100644 --- a/docs/docs/contributors/developers-guide/starting-dev-server.md +++ b/docs/docs/contributors/developers-guide/starting-dev-server.md @@ -77,7 +77,7 @@ Now you're ready to start the servers. You'll need two shells open, One for the ### Frontend -We use vue-i18n package for internationalization. Translations are stored in json format located in [frontend/lang/messages](https://github.com/mealie-recipes/mealie/tree/mealie-next/frontend/lang/messages). +We use vue-i18n package for internationalization. Translations are stored in json format located in [frontend/app/lang/messages](https://github.com/mealie-recipes/mealie/tree/mealie-next/frontend/app/lang/messages). ### Backend diff --git a/frontend/app/types/components.d.ts b/frontend/app/types/components.d.ts index fd43c02d1..a10203339 100644 --- a/frontend/app/types/components.d.ts +++ b/frontend/app/types/components.d.ts @@ -16,7 +16,6 @@ import type BaseDivider from "@/components/global/BaseDivider.vue"; import type BaseExpansionPanels from "@/components/global/BaseExpansionPanels.vue"; import type BaseOverflowButton from "@/components/global/BaseOverflowButton.vue"; import type BasePageTitle from "@/components/global/BasePageTitle.vue"; -import type BaseStatCard from "@/components/global/BaseStatCard.vue"; import type ButtonLink from "@/components/global/ButtonLink.vue"; import type ContextMenu from "@/components/global/ContextMenu.vue"; import type CrudTable from "@/components/global/CrudTable.vue"; @@ -57,7 +56,6 @@ declare module "vue" { BaseExpansionPanels: typeof BaseExpansionPanels; BaseOverflowButton: typeof BaseOverflowButton; BasePageTitle: typeof BasePageTitle; - BaseStatCard: typeof BaseStatCard; ButtonLink: typeof ButtonLink; ContextMenu: typeof ContextMenu; CrudTable: typeof CrudTable;