Extract Publishing, Entities, and AI modules into external packages - #448
Closed
mdon wants to merge 30 commits into
Closed
Extract Publishing, Entities, and AI modules into external packages#448mdon wants to merge 30 commits into
mdon wants to merge 30 commits into
Conversation
Group listing pages (/news, /legal) now use the most recent published post date as lastmod. Homepage (/) uses the latest date across all publishing entries. Other static pages use the sitemap generation date.
- Add PhoenixKit.Email.Provider behaviour and DefaultProvider (no-op) - Refactor Mailer to use email_provider() instead of hard Emails aliases - Remove send_test_tracking_email from core (moves to emails package) - Refactor UserNotifier to use email_provider(), strip HTML fallbacks - Add Emails to ModuleRegistry known_external_packages - Remove email/sqs_polling queues from core Oban config, add add_oban_queue/3 - Fix pre-existing dialyzer ignore for Sync MapSet opaque types - Fix pre-existing credo alias ordering in shop catalog modules
- New PhoenixKitWeb.AdminEditHelper module (supports both Plug.Conn and LiveView.Socket) - Fix Shop catalog: admin edit URL now only assigned for admin users (was assigned to all visitors) - Add admin edit links to Publishing controller (blog listing, post show, date URL) - Add conditional Edit button in Publishing templates (index + show)
- Delete lib/modules/emails/ (35 source files + web LiveViews/controllers) - Delete PhoenixKitWeb.Routes.EmailsRoutes and all email mix tasks (15 files) - Remove PhoenixKit.Modules.Emails from module_registry internal_modules - Add to known_external_packages for admin Modules page - Remove EmailsRoutes alias and safe_route_call references from integration.ex - Update billing.ex to use PhoenixKit.Mailer.send_from_template instead of Templates.send_email - Guard dashboard.html.heex Emails.enabled?() with Code.ensure_loaded? + apply - Update v15.ex and v31.ex migrations to use dynamic module dispatch - Clean up .dialyzer_ignore.exs entries for removed files Also: Add legal_links to cookie consent widget config for dynamic legal page links
…I toggle - Replace hardcoded cookie/privacy URLs with Routes.path() to fix double-slash bug - Add dynamic legal_links from published pages + single /legal index link - Use bg-base-100/70 backdrop instead of bg-black for light/dark theme compatibility - Improve glass opacity (0.95→0.98), card bg (50→80%), text contrast - Replace custom toggle with standard daisyUI toggle toggle-primary
…dule_card component
- Add system_prompt field to Prompt schema with V85 migration, variable extraction from both fields, render_system_prompt/2, and form UI - Add AI Playground LiveView at /admin/ai/playground for interactive endpoint and prompt testing with variable inputs, editable templates, freeform mode, response display with usage stats, and auto-scroll - Add Playground tab to all AI page navigation bars - Update ask_with_prompt to auto-include system prompt when present - Add 44 unit tests for Prompt schema covering all new functionality Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add system_prompt field to AI prompts and AI Playground page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change z-50 to z-[10001] so the media selector modal renders above other fixed/absolute positioned elements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add database connection check to install and update tasks
# Conflicts: # lib/phoenix_kit/install/oban_config.ex # lib/phoenix_kit/module_registry.ex
Bump mix.exs dep to ~> 0.2.5 and CDN URL to v0.2.5. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix/Update to leaf editor 0.2.5
…m status task - Rename check?/check! to connected?/ensure_connected! for idiomatic Elixir naming - Fix @SPEC from no_return() to :ok | no_return() (function does return on success) - Return explicit :ok instead of nil on happy path - Use Mix.env() in error message instead of hardcoded config/dev.exs - Add timeout: 5_000 to SELECT 1 query to prevent hangs - Remove DbConnectionCheck from status task — it already handles DB failures gracefully via get_database_status/1 and shows "Connection failed" in the status tree; the hard exit was preventing status from doing its job - Add PR review docs for BeamLabEU#445 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract Emails module to standalone package
- Remove Emails from internal_modules, add to known_external_packages - Remove email/sqs_polling queues and ensure_sqs_polling_queue from ObanConfig - Eliminate double get_active_template_by_name calls in Mailer and UserNotifier - Centralize email_provider() as Provider.current/0 - Update test counts for Emails+Posts extractions (20→18, 19→17, 24→22) - Add PR review docs for BeamLabEU#447 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove all publishing source code, tests, and routes from the monorepo. Add css_sources/0 callback to PhoenixKit.Module behaviour for external module CSS source scanning. Update CSS installer to auto-discover and resolve plugin module source paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…al module support Remove Publishing from internal_modules and add to known_external_packages. Delete blog.ex routes (now provided by phoenix_kit_publishing via route_module). Add :phoenix_kit_optional_scope pipeline for admin edit buttons on public pages. Update integration.ex to discover route modules from external packages for both admin and public routes. Make sitemap, legal, languages, and shared components conditional on Publishing availability. Update tests and docs for new module count. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove all entities source code, tests, routes, mix tasks, and guides. Move HtmlSanitizer and Multilang utilities to PhoenixKit.Utils namespace. Guard Pages renderer EntityForm references with Code.ensure_loaded?. Add Entities to known_external_packages. Update dialyzer ignores, test counts, and Languages README for new namespaces. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove all AI source code, tests, and admin routes from the monorepo. Add AI to known_external_packages in module registry. Update test counts and remove AI-specific assertions across module, registry, and permissions tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PhoenixKit.Modules.Publishing→phoenix_kit_publishinghex packagePhoenixKit.Modules.Entities→phoenix_kit_entitieshex packagePhoenixKit.Modules.AI→phoenix_kit_aihex packageCode.ensure_loaded?for optional dependency supportcss_sources/0callback toPhoenixKit.Modulebehaviour for external module CSS scanning:phoenix_kit_optional_scopepipeline for admin edit buttons on public pagesroute_module/0for both admin and public routesknown_external_packagesin module registryHtmlSanitizerandMultilangutilities toPhoenixKit.UtilsnamespaceKey changes
route_module/0callbackcompile_external_admin_routesandcompile_external_public_routesnow discover routes from external modules automaticallyTest plan
mix compile— clean (only expected warnings for optional external modules)mix format— cleanmix credo --strict— no issues (10 design suggestions for intentionally unaliased external modules)mix dialyzer— passes (all external module warnings in ignore list)mix test— 116 tests, 0 failures🤖 Generated with Claude Code