Skip to content

Commit

Permalink
chore: code gen (#3012)
Browse files Browse the repository at this point in the history
* code-gen

* remove old generator commands

* remove old docker stuff
  • Loading branch information
hay-kot authored Jan 20, 2024
1 parent 0602d0b commit 8d8a101
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 51 deletions.
3 changes: 2 additions & 1 deletion dev/code-generation/gen_ts_locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ class TargetLanguage(MealieModel):
id: str
name: str
locale: str
dir: str
dir: str = "ltr"
threeLettersCode: str
twoLettersCode: str
progress: float = 0.0

class Config:
extra = Extra.allow
allow_population_by_field_name = True


class CrowdinApi:
Expand Down
72 changes: 39 additions & 33 deletions frontend/composables/use-locales/available-locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,97 +3,97 @@ export const LOCALES = [
{
name: "繁體中文 (Chinese traditional)",
value: "zh-TW",
progress: 28,
progress: 30,
dir: "ltr",
},
{
name: "简体中文 (Chinese simplified)",
value: "zh-CN",
progress: 65,
progress: 98,
dir: "ltr",
},
{
name: "Tiếng Việt (Vietnamese)",
value: "vi-VN",
progress: 2,
progress: 1,
dir: "ltr",
},
{
name: "Українська (Ukrainian)",
value: "uk-UA",
progress: 99,
progress: 100,
dir: "ltr",
},
{
name: "Türkçe (Turkish)",
value: "tr-TR",
progress: 50,
progress: 53,
dir: "ltr",
},
{
name: "Svenska (Swedish)",
value: "sv-SE",
progress: 71,
progress: 94,
dir: "ltr",
},
{
name: "српски (Serbian)",
value: "sr-SP",
progress: 4,
progress: 32,
dir: "ltr",
},
{
name: "Slovenian",
value: "sl-SI",
progress: 49,
progress: 47,
dir: "ltr",
},
{
name: "Slovak",
value: "sk-SK",
progress: 97,
progress: 93,
dir: "ltr",
},
{
name: "Pусский (Russian)",
value: "ru-RU",
progress: 99,
progress: 98,
dir: "ltr",
},
{
name: "Română (Romanian)",
value: "ro-RO",
progress: 32,
progress: 42,
dir: "ltr",
},
{
name: "Português (Portuguese)",
value: "pt-PT",
progress: 99,
progress: 100,
dir: "ltr",
},
{
name: "Português do Brasil (Brazilian Portuguese)",
value: "pt-BR",
progress: 98,
progress: 97,
dir: "ltr",
},
{
name: "Polski (Polish)",
value: "pl-PL",
progress: 97,
progress: 98,
dir: "ltr",
},
{
name: "Norsk (Norwegian)",
value: "no-NO",
progress: 85,
progress: 99,
dir: "ltr",
},
{
name: "Nederlands (Dutch)",
value: "nl-NL",
progress: 98,
progress: 100,
dir: "ltr",
},
{
Expand All @@ -105,7 +105,7 @@ export const LOCALES = [
{
name: "Lithuanian",
value: "lt-LT",
progress: 97,
progress: 93,
dir: "ltr",
},
{
Expand All @@ -117,31 +117,37 @@ export const LOCALES = [
{
name: "日本語 (Japanese)",
value: "ja-JP",
progress: 11,
progress: 12,
dir: "ltr",
},
{
name: "Italiano (Italian)",
value: "it-IT",
progress: 96,
progress: 100,
dir: "ltr",
},
{
name: "Icelandic",
value: "is-IS",
progress: 0,
dir: "ltr",
},
{
name: "Magyar (Hungarian)",
value: "hu-HU",
progress: 99,
progress: 100,
dir: "ltr",
},
{
name: "Croatian",
value: "hr-HR",
progress: 97,
progress: 93,
dir: "ltr",
},
{
name: "עברית (Hebrew)",
value: "he-IL",
progress: 99,
progress: 97,
dir: "rtl",
},
{
Expand All @@ -153,7 +159,7 @@ export const LOCALES = [
{
name: "Français (French)",
value: "fr-FR",
progress: 99,
progress: 100,
dir: "ltr",
},
{
Expand All @@ -165,13 +171,13 @@ export const LOCALES = [
{
name: "Suomi (Finnish)",
value: "fi-FI",
progress: 95,
progress: 91,
dir: "ltr",
},
{
name: "Español (Spanish)",
value: "es-ES",
progress: 76,
progress: 79,
dir: "ltr",
},
{
Expand All @@ -183,37 +189,37 @@ export const LOCALES = [
{
name: "British English",
value: "en-GB",
progress: 4,
progress: 3,
dir: "ltr",
},
{
name: "Ελληνικά (Greek)",
value: "el-GR",
progress: 35,
progress: 34,
dir: "ltr",
},
{
name: "Deutsch (German)",
value: "de-DE",
progress: 99,
progress: 100,
dir: "ltr",
},
{
name: "Dansk (Danish)",
value: "da-DK",
progress: 100,
progress: 98,
dir: "ltr",
},
{
name: "Čeština (Czech)",
value: "cs-CZ",
progress: 66,
progress: 64,
dir: "ltr",
},
{
name: "Català (Catalan)",
value: "ca-ES",
progress: 61,
progress: 75,
dir: "ltr",
},
{
Expand All @@ -225,13 +231,13 @@ export const LOCALES = [
{
name: "العربية (Arabic)",
value: "ar-SA",
progress: 16,
progress: 20,
dir: "rtl",
},
{
name: "Afrikaans (Afrikaans)",
value: "af-ZA",
progress: 96,
progress: 92,
dir: "ltr",
},
]
6 changes: 1 addition & 5 deletions frontend/lib/api/admin/admin-about.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseAPI } from "../base/base-clients";
import { AdminAboutInfo, DockerVolumeText, CheckAppConfig } from "~/lib/api/types/admin";
import { AdminAboutInfo, CheckAppConfig } from "~/lib/api/types/admin";

const prefix = "/api";

Expand All @@ -24,10 +24,6 @@ export class AdminAboutAPI extends BaseAPI {
return await this.requests.get<CheckAppConfig>(routes.check);
}

async checkDocker() {
return await this.requests.get<DockerVolumeText>(routes.docker);
}

async getDockerValidateFileContents() {
return await this.requests.get<string>(routes.validationFile);
}
Expand Down
3 changes: 0 additions & 3 deletions frontend/lib/api/types/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ export interface CustomPageOut {
categories?: RecipeCategoryResponse[];
id: number;
}
export interface DockerVolumeText {
text: string;
}
export interface EmailReady {
ready: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions frontend/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export default {
{ code: "fr-FR", file: "fr-FR.json" },
{ code: "zh-TW", file: "zh-TW.json" },
{ code: "af-ZA", file: "af-ZA.json" },
{ code: "is-IS", file: "is-IS.json" },
{ code: "sl-SI", file: "sl-SI.json" },
{ code: "ru-RU", file: "ru-RU.json" },
{ code: "he-IL", file: "he-IL.json" },
Expand Down
7 changes: 0 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ docs: ## 📄 Start Mkdocs Development Server
poetry run python dev/code-generation/gen_docs_api.py && \
cd docs && poetry run python -m mkdocs serve

code-gen: ## 🤖 Run Code-Gen Scripts
poetry run python dev/scripts/app_routes_gen.py

# -----------------------------------------------------------------------------
# Backend makefile

Expand All @@ -55,7 +52,6 @@ setup-model: ## 🤖 Get the latest NLP CRF++ Model
@echo Fetching NLP Model - CRF++ is still Required
curl -L0 https://github.com/mealie-recipes/nlp-model/releases/download/v1.0.0/model.crfmodel --output ./mealie/services/parser_services/crfpp/model.crfmodel


clean-data: ## ⚠️ Removes All Developer Data for a fresh server start
rm -r ./dev/data/recipes/
rm -r ./dev/data/users/
Expand Down Expand Up @@ -113,9 +109,6 @@ frontend: ## 🎬 Start Mealie Frontend Development Server
frontend-build: ## 🏗 Build Frontend in frontend/dist
cd frontend && yarn run build

frontend-generate: ## 🏗 Generate Code for Frontend
poetry run python dev/code-generation/gen_frontend_types.py

frontend-lint: ## 🧺 Run yarn lint
cd frontend && yarn lint

Expand Down
2 changes: 0 additions & 2 deletions tests/utils/api_routes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"""`/api/admin/about`"""
admin_about_check = "/api/admin/about/check"
"""`/api/admin/about/check`"""
admin_about_docker_validate = "/api/admin/about/docker/validate"
"""`/api/admin/about/docker/validate`"""
admin_about_statistics = "/api/admin/about/statistics"
"""`/api/admin/about/statistics`"""
admin_analytics = "/api/admin/analytics"
Expand Down

0 comments on commit 8d8a101

Please sign in to comment.