This PR does too many things :(
1. Major refactoring of the dev/scripts and dev/code-generation folders.
Primarily this was removing duplicate code and cleaning up some poorly written code snippets as well as making them more idempotent so then can be re-run over and over again but still maintain the same results. This is working on my machine, but I've been having problems in CI and comparing diffs so running generators in CI will have to wait.
2. Re-Implement using the generated api routes for testing
This was a _huge_ refactor that touched damn near every test file but now we have auto-generated typed routes with inline hints and it's used for nearly every test excluding a few that use classes for better parameterization. This should greatly reduce errors when writing new tests.
3. Minor Perf improvements for the All Recipes endpoint
A. Removed redundant loops
B. Uses orjson to do the encoding directly and returns a byte response instead of relying on the default
jsonable_encoder.
4. Fix some TS type errors that cropped up for seemingly no reason half way through the PR.
See this issue https://github.com/phillipdupuis/pydantic-to-typescript/issues/28
Basically, the generated TS type is not-correct since Pydantic will automatically fill in null fields. The resulting TS type is generated with a ? to indicate it can be null even though we _know_ that i can't be.
* Add pytesseract
* Add simple ocr endpoint
replace extension argument
* feat/ocr-editor gui
* fix frontend linting issues
* Add service unit tests
* Add split text modes & single ingredient/instruction editing
* make split mode really reactive
* Remove default step and ingredient
* make the linter haappy
* Accept only image uploads
* Add automatic recipe title suggestion
* Correct regex
* fix incorrect array.map method usage
* make the linter happy again
* Swap route to use asset name
* Rearange buttons
* fix test data
* feat: Allow making image the recipe image
* Add translation
* Make the linter happy
* Restrict function setPropertyValueByPath generic
* Restrict template literal type
* Add a more friendly icon to creation page
* update poetry lock file
* Correct sloppy ocr classes
* Make MyPy happy
* Rewrite safer tests
* Add tesseract to backend test CI container dependencies
* Make canvas element a component global
* Remove unwanted spaces in selected text
* Add way to know if recipe was created with ocr
* Access to ocr-editor for ocr recipes
* Update Alembic revision
* Make the frontend build
* Fix scrolling offset bug
* Allow creation of recipes with custom settings
* Fix rebasing mistakes
* Add format_tsv_output test
* Exclude the tests data directory only
* Enforce camelCase for frontend functions
* Remove import of unused component
* Fix type and class initialization
* Add multi-language support
* Highlight words in mount
* Fix image ratio bug
* Better ocr creation page
* Revert awkward feature to scroll in Selection mode
* Rebasing alembic migrations sux
* Remove obsolete getShared function
* Add function docstring
* Move down ocr creation option
* Make toolbar icons more generic
* Show help at the bottom of the page
* move ocr types to own file
* Use template ref for the canvas
* Use i18n.tc to get strings directly
* Correct naming mistake
* Move Ocr editor to own directory
* Create Ocr Editor parts
* Safeguard recipe properties access
* Add loading frontend animation due to longer request time
* minor cleanup chores
Co-authored-by: Miroito <alban.vachette@gmail.com>
* created query filter classes
* extended pagination to include query filtering
* added filtering tests
* type improvements
* move type help to dev depedency
* minor type and perf fixes
* breakup test cases
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
* fix type errors on event bus
* webhooks fields required for new implementation
* db migration
* wip: webhook query + tests and stub function
* ignore type checker error
* type and method cleanup
* datetime and time utc validator
* update testing code for utc scheduled time
* fix file cmp function call
* update version_number
* add support for translating "time" objects when restoring backup
* bump recipe-scrapers
* use specific import syntax
* generate frontend types
* utilize names exports
* use utc times
* add task to scheduler
* implement new scheduler functionality
* stub for type annotation
* implement meal-plan data getter
* add experimental banner
* use locale to set language header
* rewrite i18n provider and drop dependency
* rename file
* rename CrudMixin to HttpRepo
* refactor: code-cleanup
* add crowdin source
* remove unused translations
* grab translations from dev branch
* add translation support for foods, units, and labels
* remove rich import
* Set up alembic migration usage
* Fix import order, add isort as alembic hook
* Only run migrations if needed
* Include date as part of migration file name for better sorting
* Skip initial migrations if tables already exist
This eases the transition from a pre-alembic state
* Fix deprecation warning in alembic revision
* Add alembic test stubs
* fix group page
* setup group notification for backend
* update type generators
* script to auto-generate schema exports
* setup frontend CRUD interface
* remove old notifications UI
* drop old events api
* add test functionality
* update naming for fields
* add event dispatcher functionality
* bump to python 3.10
* bump python version
* purge old event code
* use-async apprise
* set mealie logo as image
* unify styles for buttons rows
* add links to banners
* add universal toast plugin
* add server side locales
* integrate CRF++ into CI/CD Pipeline
* docs(docs): 📝 add recipe parser docs
* feat(backend): ✨ Continued work on ingredient parsers
* add new model dest
* feat(frontend): ✨ New ingredient parser page
* formatting
Co-authored-by: Hayden <hay-kot@pm.me>
* refactor(backend): ♻️ cleanup duplicate code in http services
* refactor(backend): ♻️ refactor database away from singleton design
removed the database single and instead injected the session into a new Database class that is created during each request life-cycle. Now sessions no longer need to be passed into each method on the database
All tests pass, but there are likely some hidden breaking changes that were not discovered.
* fix venv
* disable venv cache
* fix install script
* bump poetry version
* postgres fixes
* revert install
* fix db initialization for postgres
* add postgres to docker
* refactor(backend): ♻️ cleanup unused and duplicate code in http services
* refactor(backend): remove sessions from arguments
* refactor(backend): ♻️ convert units and ingredients to use http service class
* test(backend): ✅ add unit and food tests
* lint
* update tags
* re-enable cache
* fix missing fraction in db
* fix lint
Co-authored-by: hay-kot <hay-kot@pm.me>