Skip to content

Extract Publishing, Entities, and AI modules into external packages - #449

Merged
ddon merged 7 commits into
BeamLabEU:devfrom
mdon:dev
Mar 24, 2026
Merged

Extract Publishing, Entities, and AI modules into external packages#449
ddon merged 7 commits into
BeamLabEU:devfrom
mdon:dev

Conversation

@mdon

@mdon mdon commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extract PhoenixKit.Modules.Publishingphoenix_kit_publishing hex package
  • Extract PhoenixKit.Modules.Entitiesphoenix_kit_entities hex package
  • Extract PhoenixKit.Modules.AIphoenix_kit_ai hex package
  • Guard all cross-module references behind Code.ensure_loaded? for optional dependency support
  • Add css_sources/0 callback to PhoenixKit.Module behaviour for external module CSS scanning
  • Add :phoenix_kit_optional_scope pipeline for admin edit buttons on public pages
  • Auto-discover external module routes via route_module/0 for both admin and public routes
  • Add all three to known_external_packages in module registry
  • Move HtmlSanitizer and Multilang utilities to PhoenixKit.Utils namespace
  • Update all test counts, dialyzer ignores, and documentation

Key changes

  • 15 internal modules remain (down from 21)
  • 6 known external packages: Newsletters, Sync, Posts, Publishing, Entities, AI
  • All sitemap, legal, languages, shared components, and dashboard references to extracted modules are runtime-guarded
  • Blog catch-all routes moved to publishing package via route_module/0 callback
  • compile_external_admin_routes and compile_external_public_routes now discover routes from external modules automatically

mdon and others added 7 commits March 24, 2026 05:00
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>
PhoenixKitEntities, PhoenixKitAI, PhoenixKitPosts, Multilang, and
HtmlSanitizer are optional external modules that cannot be aliased
at the top of invoking modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These modules are used behind Code.ensure_loaded? guards and cannot
be aliased at the top of invoking modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_undefined

Add @compile {:no_warn_undefined, ...} to all files that reference
extracted Publishing, Entities, and AI modules so that
--warnings-as-errors passes in CI prod builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ddon
ddon merged commit b0f8fe1 into BeamLabEU:dev Mar 24, 2026
6 checks passed
ddon added a commit that referenced this pull request Mar 24, 2026
…extraction

- Guard EntityForm render call with Code.ensure_loaded? check in Pages renderer
- Add Logger.debug for CSS source discovery failures in installer
- Document why ensure_compiled is used over ensure_loaded? in integration routes
- Make module registry and permissions tests count-independent
- Add PR review doc for #449

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants