managarten/uload/scripts/extract-templates.js
Till-JS c712a2504a feat: integrate uload and picture, unify package naming
- Add uload project with apps/web structure
  - Reorganize from flat to monorepo structure
  - Remove PocketBase binary and local data
  - Update to pnpm and @uload/web namespace

- Add picture project to monorepo
  - Remove embedded git repository

- Unify all package names to @{project}/{app} schema:
  - @maerchenzauber/* (was @storyteller/*)
  - @manacore/* (was manacore-*, manacore)
  - @manadeck/* (was web, backend, manadeck)
  - @memoro/* (was memoro-web, landing, memoro)
  - @picture/* (already unified)
  - @uload/web

- Add convenient dev scripts for all apps:
  - pnpm dev:{project}:web
  - pnpm dev:{project}:landing
  - pnpm dev:{project}:mobile
  - pnpm dev:{project}:backend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 04:00:36 +01:00

41 lines
1.3 KiB
JavaScript

import fs from 'fs';
// Read the markdown file
const content = fs.readFileSync('docs/mail/email-templates-bilingual.md', 'utf8');
// Extract templates
const templates = {};
// Find verification template
const verificationMatch = content.match(/## 1\. E-Mail-Verifizierung.*?```html\n([\s\S]*?)```/);
if (verificationMatch) {
templates.verification = verificationMatch[1].trim();
}
// Find password reset template
const passwordMatch = content.match(/## 2\. Passwort-Reset.*?```html\n([\s\S]*?)```/);
if (passwordMatch) {
templates.passwordReset = passwordMatch[1].trim();
}
// Find email change template
const emailChangeMatch = content.match(/## 3\. E-Mail-Änderung.*?```html\n([\s\S]*?)```/);
if (emailChangeMatch) {
templates.emailChange = emailChangeMatch[1].trim();
}
// Find OTP template
const otpMatch = content.match(/## 4\. OTP.*?```html\n([\s\S]*?)```/);
if (otpMatch) {
templates.otp = otpMatch[1].trim();
}
// Find login alert template
const loginAlertMatch = content.match(/## 5\. Login-Alert.*?```html\n([\s\S]*?)```/);
if (loginAlertMatch) {
templates.loginAlert = loginAlertMatch[1].trim();
}
// Save to JSON file
fs.writeFileSync('email-templates.json', JSON.stringify(templates, null, 2));
console.log('Templates extracted to email-templates.json');