mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-27 16:24:31 -04:00 
			
		
		
		
	* fix ts types * feat(code-generation): ♻️ update code-generation formats * new scope * add step button * fix linter error * update code-generation tags * feat(backend): ✨ start multi-tenant support * feat(backend): ✨ group invitation token generation and signup * refactor(backend): ♻️ move group admin actions to admin router * set url base to include `/admin` * feat(frontend): ✨ generate user sign-up links * test(backend): ✅ refactor test-suite to further decouple tests (WIP) * feat(backend): 🐛 assign owner on backup import for recipes * fix(backend): 🐛 assign recipe owner on migration from other service Co-authored-by: hay-kot <hay-kot@pm.me>
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| from pathlib import Path
 | |
| 
 | |
| from _gen_utils import inject_inline
 | |
| from _static import CodeKeys
 | |
| 
 | |
| PROJECT_DIR = Path(__file__).parent.parent.parent
 | |
| 
 | |
| 
 | |
| datetime_dir = PROJECT_DIR / "frontend" / "lang" / "dateTimeFormats"
 | |
| locales_dir = PROJECT_DIR / "frontend" / "lang" / "messages"
 | |
| nuxt_config = PROJECT_DIR / "frontend" / "nuxt.config.js"
 | |
| 
 | |
| """
 | |
| This snippet walks the message and dat locales directories and generates the import information
 | |
| for the nuxt.config.js file and automatically injects it into the nuxt.config.js file. Note that
 | |
| the code generation ID is hardcoded into the script and required in the nuxt config.
 | |
| """
 | |
| 
 | |
| 
 | |
| def main():  # sourcery skip: list-comprehension
 | |
|     print("Starting...")
 | |
| 
 | |
|     all_date_locales = []
 | |
|     for match in datetime_dir.glob("*.json"):
 | |
|         all_date_locales.append(f'"{match.stem}": require("./lang/dateTimeFormats/{match.name}"),')
 | |
| 
 | |
|     all_langs = []
 | |
|     for match in locales_dir.glob("*.json"):
 | |
|         lang_string = f'{{ code: "{match.stem}", file: "{match.name}" }},'
 | |
|         all_langs.append(lang_string)
 | |
| 
 | |
|     inject_inline(nuxt_config, CodeKeys.nuxt_local_messages, all_langs)
 | |
|     inject_inline(nuxt_config, CodeKeys.nuxt_local_dates, all_date_locales)
 | |
| 
 | |
|     print("Finished...")
 | |
| 
 | |
| 
 | |
| if __name__ == "__main__":
 | |
|     main()
 |