feat(newsletter): add newsletter generation utilities and pages #69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "exe-dev-bot/market:feat/newsletter-generation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements the Newsletter Generation section of spec-003 (Weekly Newsletter). This PR adds the core utilities and pages for generating, storing, and viewing newsletters.
Changes
New Files
src/lib/newsletter.ts- Newsletter content generation utility withgenerateNewsletterContent()functionsrc/lib/newsletter-email.ts- HTML email template renderer withrenderNewsletterEmail()functionsrc/lib/service-client.ts- Isolated service role client (bypasses RLS, restricted by ESLint)src/lib/format.ts- Shared formatting utilities (truncateText, formatDate, getInitials)src/lib/theme-colors.generated.ts- Auto-generated email-safe hex colors from themes.cssscripts/generate-theme-colors.ts- Build script to regenerate theme colorssrc/pages/my/newsletters/index.astro- Page listing user's newsletters (up to 4 most recent)src/pages/my/newsletters/[id].astro- Newsletter detail view pageModified Files
src/lib/auth.ts- Removed service client (moved to separate restricted file)src/pages/dashboard.astro- Added "My Newsletters" link to Quick Access sectionsrc/styles/themes.css- Added documentation about regenerating email colorsjustfile- Addedgenerate-theme-colorsrecipeeslint.config.js- Added restriction on service-client imports (only allowed in src/worker.ts)specs/003-weekly-newsletter.md- Marked Newsletter Generation tasks as completeTheme Color Generation
Theme colors are defined in
themes.cssusing OKLCH format. Since email clients don't support OKLCH or CSS variables, we generate hex equivalents:Run this after modifying theme colors in
themes.css.Testing
Setup
just db-resetjust devDashboard Link
Newsletter Detail View (Manual Insert)
/my/newsletters- should now show one newsletterNotes
src/worker.tscan import it)