Packages
phoenix_kit
1.7.125
1.7.207
1.7.206
1.7.205
1.7.204
1.7.203
1.7.202
1.7.201
1.7.200
1.7.199
1.7.198
1.7.197
1.7.196
1.7.194
1.7.193
1.7.192
1.7.191
1.7.190
1.7.189
1.7.187
1.7.186
1.7.185
1.7.184
1.7.183
1.7.182
1.7.181
1.7.180
1.7.179
1.7.178
1.7.177
1.7.176
1.7.175
1.7.174
1.7.173
1.7.172
1.7.171
1.7.170
1.7.169
1.7.168
1.7.167
1.7.166
1.7.165
1.7.164
1.7.162
1.7.161
1.7.160
1.7.159
1.7.157
1.7.156
1.7.155
1.7.154
1.7.153
1.7.152
1.7.151
1.7.150
1.7.149
1.7.146
1.7.145
1.7.144
1.7.143
1.7.138
1.7.133
1.7.132
1.7.131
1.7.130
1.7.128
1.7.126
1.7.125
1.7.121
1.7.120
1.7.119
1.7.118
1.7.117
1.7.116
1.7.115
1.7.114
1.7.113
1.7.112
1.7.111
1.7.110
1.7.109
1.7.108
1.7.107
1.7.106
1.7.105
1.7.104
1.7.103
1.7.102
1.7.101
1.7.100
1.7.99
1.7.98
1.7.97
1.7.96
1.7.95
1.7.94
1.7.93
1.7.92
1.7.91
1.7.90
1.7.89
1.7.88
1.7.87
1.7.86
1.7.85
1.7.84
1.7.83
1.7.82
1.7.81
1.7.80
1.7.79
1.7.78
1.7.77
1.7.76
1.7.75
1.7.74
1.7.71
1.7.70
1.7.69
1.7.66
1.7.65
1.7.64
1.7.63
1.7.62
1.7.61
1.7.59
1.7.58
1.7.57
1.7.56
1.7.55
1.7.54
1.7.53
1.7.52
1.7.51
1.7.49
1.7.44
1.7.43
1.7.42
1.7.41
1.7.39
1.7.38
1.7.37
1.7.36
1.7.34
1.7.33
1.7.31
1.7.30
1.7.29
1.7.28
1.7.27
1.7.26
1.7.25
1.7.24
1.7.23
1.7.22
1.7.21
1.7.20
1.7.19
1.7.18
1.7.17
1.7.16
1.7.15
1.7.14
1.7.13
1.7.12
1.7.11
1.7.10
1.7.9
1.7.8
1.7.7
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.20
1.6.19
1.6.18
1.6.17
1.6.16
1.6.15
1.6.14
1.6.13
1.6.12
1.6.11
1.6.10
1.6.9
1.6.8
1.6.7
1.6.6
1.6.5
1.6.4
1.6.3
1.5.2
1.5.1
1.5.0
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.10
1.2.9
1.2.8
1.2.7
1.2.5
1.2.4
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
A foundation for building Elixir Phoenix apps — SaaS, social networks, ERP systems, marketplaces, and more
Current section
221 Versions
Jump to
Current section
221 Versions
Compare versions
21
files changed
+849
additions
-115
deletions
unknownCHANGELOG.md
File is too large to be displayed (100 KB limit).
| @@ -6,11 +6,7 @@ | |
| 6 6 | |
| 7 7 | We are actively building PhoenixKit, a foundation for building your Elixir Phoenix apps — SaaS, social networks, ERP systems, marketplaces, internal tools, AI-powered apps, community platforms, and more. Our goal is to eliminate the need to reinvent the wheel every time you start a new project. |
| 8 8 | |
| 9 | - **🚧 Early Access - We Need Your Feedback!** |
| 10 | - |
| 11 | - PhoenixKit is under heavy development and we're looking for early adopters to test, provide feedback, and help shape the future of this toolkit. If you're building with Phoenix and want to skip the boilerplate setup, we'd love to have you try it out and share your experience. |
| 12 | - |
| 13 | - With PhoenixKit, you will be able to create Elixir/Phoenix apps much faster and focus on your unique business logic instead of reimplementing common patterns. |
| 9 | + With PhoenixKit, you are able to create Elixir/Phoenix apps much faster and focus on your unique business logic instead of reimplementing common patterns. |
| 14 10 | |
| 15 11 | ## 📖 Documentation |
| 16 12 | |
| @@ -497,7 +493,7 @@ PhoenixKit.Modules.AI.disable_system() | |
| 497 493 | ``` |
| 498 494 | |
| 499 495 | **Important**: Attempting to use a disabled module's API functions or admin pages will result in errors or redirects. Always enable modules before: |
| 500 | - - Calling their API functions (e.g., `PhoenixKit.Modules.AI.ask/3`) |
| 496 | + - Calling their API functions (e.g., `PhoenixKitAI.ask_with_prompt/4`) |
| 501 497 | - Visiting their admin pages (e.g., `/{prefix}/admin/ai/endpoints`) |
| 502 498 | |
| 503 499 | ### Built-in Admin Interface |
| @@ -1,6 +1,6 @@ | |
| 1 1 | {<<"links">>,[{<<"GitHub">>,<<"https://github.com/BeamLabEU/phoenix_kit">>}]}. |
| 2 2 | {<<"name">>,<<"phoenix_kit">>}. |
| 3 | - {<<"version">>,<<"1.7.121">>}. |
| 3 | + {<<"version">>,<<"1.7.125">>}. |
| 4 4 | {<<"description">>, |
| 5 5 | <<65,32,102,111,117,110,100,97,116,105,111,110,32,102,111,114,32,98,117,105, |
| 6 6 | 108,100,105,110,103,32,69,108,105,120,105,114,32,80,104,111,101,110,105, |
| @@ -536,6 +536,7 @@ | |
| 536 536 | <<"lib/phoenix_kit/migrations/postgres/v66.ex">>, |
| 537 537 | <<"lib/phoenix_kit/migrations/postgres/v39.ex">>, |
| 538 538 | <<"lib/phoenix_kit/migrations/postgres/v14.ex">>, |
| 539 | + <<"lib/phoenix_kit/migrations/postgres/v124.ex">>, |
| 539 540 | <<"lib/phoenix_kit/migrations/postgres/v64.ex">>, |
| 540 541 | <<"lib/phoenix_kit/migrations/postgres/v93.ex">>, |
| 541 542 | <<"lib/phoenix_kit/migrations/postgres/v84.ex">>, |
| @@ -570,10 +571,12 @@ | |
| 570 571 | <<"lib/phoenix_kit/migrations/postgres/v05.ex">>, |
| 571 572 | <<"lib/phoenix_kit/migrations/postgres/v82.ex">>, |
| 572 573 | <<"lib/phoenix_kit/migrations/postgres/v75.ex">>, |
| 574 | + <<"lib/phoenix_kit/migrations/postgres/v122.ex">>, |
| 573 575 | <<"lib/phoenix_kit/migrations/postgres/v62.ex">>, |
| 574 576 | <<"lib/phoenix_kit/migrations/postgres/v95.ex">>, |
| 575 577 | <<"lib/phoenix_kit/migrations/postgres/v12.ex">>, |
| 576 578 | <<"lib/phoenix_kit/migrations/postgres/v13.ex">>, |
| 579 | + <<"lib/phoenix_kit/migrations/postgres/v123.ex">>, |
| 577 580 | <<"lib/phoenix_kit/migrations/postgres/v94.ex">>, |
| 578 581 | <<"lib/phoenix_kit/migrations/postgres/v63.ex">>, |
| 579 582 | <<"lib/phoenix_kit/migrations/postgres/v74.ex">>, |
| @@ -749,7 +752,7 @@ | |
| 749 752 | [{<<"name">>,<<"fresco">>}, |
| 750 753 | {<<"app">>,<<"fresco">>}, |
| 751 754 | {<<"optional">>,false}, |
| 752 | - {<<"requirement">>,<<"~> 0.5">>}, |
| 755 | + {<<"requirement">>,<<"~> 0.6">>}, |
| 753 756 | {<<"repository">>,<<"hexpm">>}], |
| 754 757 | [{<<"name">>,<<"tessera">>}, |
| 755 758 | {<<"app">>,<<"tessera">>}, |
| @@ -759,7 +762,7 @@ | |
| 759 762 | [{<<"name">>,<<"etcher">>}, |
| 760 763 | {<<"app">>,<<"etcher">>}, |
| 761 764 | {<<"optional">>,false}, |
| 762 | - {<<"requirement">>,<<"~> 0.3">>}, |
| 765 | + {<<"requirement">>,<<"~> 0.5">>}, |
| 763 766 | {<<"repository">>,<<"hexpm">>}], |
| 764 767 | [{<<"name">>,<<"aws_regions">>}, |
| 765 768 | {<<"app">>,<<"aws_regions">>}, |
| @@ -90,6 +90,7 @@ if Code.ensure_loaded?(Igniter.Mix.Task) do | |
| 90 90 | Common, |
| 91 91 | CssIntegration, |
| 92 92 | DbConnectionCheck, |
| 93 | + EndpointIntegration, |
| 93 94 | IgniterHelpers, |
| 94 95 | JsIntegration, |
| 95 96 | ObanConfig, |
| @@ -138,6 +139,7 @@ if Code.ensure_loaded?(Igniter.Mix.Task) do | |
| 138 139 | |> BasicConfiguration.add_basic_config() |
| 139 140 | |> ApplicationSupervisor.add_supervisor() |
| 140 141 | |> BootHook.add_boot_hook() |
| 142 | + |> EndpointIntegration.add_pdfjs_static_mount() |
| 141 143 | |> perform_igniter_update(opts) |
| 142 144 | end |
| 143 145 | end |
| @@ -13,9 +13,21 @@ defmodule PhoenixKit.Install.EndpointIntegration do | |
| 13 13 | |
| 14 14 | alias Igniter.Code.{Common, Function} |
| 15 15 | alias Igniter.Project.Application |
| 16 | + alias Igniter.Project.Deps |
| 16 17 | alias Igniter.Project.Module, as: IgniterModule |
| 17 18 | alias PhoenixKit.Install.IgniterHelpers |
| 18 19 | |
| 20 | + # PDF.js viewer assets are vendored in phoenix_kit_catalogue's |
| 21 | + # `priv/static/pdfjs/` and the host endpoint must serve them at |
| 22 | + # `/_pdfjs/` for the catalogue PDF viewer to load. Mounted only when the |
| 23 | + # catalogue module is a dependency. |
| 24 | + @pdfjs_static_mount """ |
| 25 | + plug Plug.Static, |
| 26 | + at: "/_pdfjs", |
| 27 | + from: {:phoenix_kit_catalogue, "priv/static/pdfjs"}, |
| 28 | + gzip: false\ |
| 29 | + """ |
| 30 | + |
| 19 31 | @doc """ |
| 20 32 | Removes deprecated `phoenix_kit_socket()` and its import from the endpoint. |
| 21 33 | |
| @@ -29,18 +41,61 @@ defmodule PhoenixKit.Install.EndpointIntegration do | |
| 29 41 | Updated igniter with deprecated socket code and import removed. |
| 30 42 | """ |
| 31 43 | def add_endpoint_integration(igniter) do |
| 32 | - case find_endpoint(igniter) do |
| 33 | - {igniter, nil} -> |
| 34 | - # No endpoint found, nothing to clean up |
| 35 | - igniter |
| 44 | + igniter = |
| 45 | + case find_endpoint(igniter) do |
| 46 | + {igniter, nil} -> |
| 47 | + # No endpoint found, nothing to clean up |
| 48 | + igniter |
| 36 49 | |
| 37 | - {igniter, endpoint_module} -> |
| 38 | - igniter |
| 39 | - |> remove_deprecated_socket(endpoint_module) |
| 40 | - |> remove_deprecated_import(endpoint_module) |
| 50 | + {igniter, endpoint_module} -> |
| 51 | + igniter |
| 52 | + |> remove_deprecated_socket(endpoint_module) |
| 53 | + |> remove_deprecated_import(endpoint_module) |
| 54 | + end |
| 55 | + |
| 56 | + add_pdfjs_static_mount(igniter) |
| 57 | + end |
| 58 | + |
| 59 | + @doc """ |
| 60 | + Ensures the host endpoint serves phoenix_kit_catalogue's vendored PDF.js |
| 61 | + viewer at `/_pdfjs/` via a `Plug.Static` mount. |
| 62 | + |
| 63 | + Only added when `:phoenix_kit_catalogue` is a dependency (the mount |
| 64 | + references that app's `priv`, so adding it without the dep would break |
| 65 | + boot). Idempotent — skips when an `at: "/_pdfjs"` mount already exists. |
| 66 | + Called by both `mix phoenix_kit.install` and `mix phoenix_kit.update`. |
| 67 | + """ |
| 68 | + def add_pdfjs_static_mount(igniter) do |
| 69 | + with true <- Deps.has_dep?(igniter, :phoenix_kit_catalogue), |
| 70 | + {igniter, endpoint_module} when not is_nil(endpoint_module) <- find_endpoint(igniter), |
| 71 | + {igniter, source, _zipper} <- IgniterModule.find_module!(igniter, endpoint_module), |
| 72 | + false <- source |> Rewrite.Source.get(:content) |> String.contains?(~s(at: "/_pdfjs")) do |
| 73 | + IgniterModule.find_and_update_module!(igniter, endpoint_module, fn zipper -> |
| 74 | + case move_to_endpoint_use(zipper) do |
| 75 | + {:ok, use_zipper} -> |
| 76 | + {:ok, Common.add_code(use_zipper, @pdfjs_static_mount, placement: :after)} |
| 77 | + |
| 78 | + :error -> |
| 79 | + {:ok, zipper} |
| 80 | + end |
| 81 | + end) |
| 82 | + else |
| 83 | + # No catalogue dep, no endpoint, or mount already present. |
| 84 | + _ -> igniter |
| 41 85 | end |
| 42 86 | end |
| 43 87 | |
| 88 | + # Locate `use Phoenix.Endpoint, otp_app: ...` so the static mount can be |
| 89 | + # inserted right after it (early in the plug pipeline). |
| 90 | + defp move_to_endpoint_use(zipper) do |
| 91 | + Function.move_to_function_call(zipper, :use, 2, fn call_zipper -> |
| 92 | + case Function.move_to_nth_argument(call_zipper, 0) do |
| 93 | + {:ok, arg_zipper} -> Common.nodes_equal?(arg_zipper, Phoenix.Endpoint) |
| 94 | + :error -> false |
| 95 | + end |
| 96 | + end) |
| 97 | + end |
| 98 | + |
| 44 99 | # Find endpoint module |
| 45 100 | defp find_endpoint(igniter) do |
| 46 101 | case Application.app_name(igniter) do |
Loading more files…