From 1fc892f2544f310fa17065b3eddc9582c3a61c0b Mon Sep 17 00:00:00 2001 From: Jessica Phoenix Canady Date: Mon, 27 May 2024 18:57:36 -0400 Subject: [PATCH] Finally fix the jol/JOL module name shit. Regenerated a new Phoenix app using `--module` like I should've done in the first damn place. --- config/config.exs | 3 ++- config/dev.exs | 9 ++++++--- config/test.exs | 6 +++++- lib/jol_web.ex | 2 +- lib/jol_web/components/core_components.ex | 7 ++++--- lib/jol_web/components/layouts.ex | 9 +++++++++ lib/jol_web/controllers/error_html.ex | 5 +++++ lib/jol_web/controllers/error_json.ex | 6 ++++++ lib/jol_web/controllers/page_html.ex | 5 +++++ lib/jol_web/endpoint.ex | 2 +- mix.exs | 4 ++-- mix.lock | 4 ++-- 12 files changed, 48 insertions(+), 14 deletions(-) diff --git a/config/config.exs b/config/config.exs index 3997642..cb27f63 100644 --- a/config/config.exs +++ b/config/config.exs @@ -8,6 +8,7 @@ import Config config :jol, + namespace: JOL, ecto_repos: [JOL.Repo], generators: [timestamp_type: :utc_datetime] @@ -20,7 +21,7 @@ config :jol, JOLWeb.Endpoint, layout: false ], pubsub_server: JOL.PubSub, - live_view: [signing_salt: "4pcqZGxe"] + live_view: [signing_salt: "4zfcEMvi"] # Configures the mailer # diff --git a/config/dev.exs b/config/dev.exs index 333e1b1..2cdfb60 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -23,7 +23,7 @@ config :jol, JOLWeb.Endpoint, check_origin: false, code_reloader: true, debug_errors: true, - secret_key_base: "9rmK754o3RoBXorXcCf0PTZkCJbfAOdNGyXSQizgF5CYcd9iQTR2UhaNGw5v74DR", + secret_key_base: "t4tMZg7U+xf+PupkCcUHxhYX63+dRHjN5qyy1noQ6XCjuX1clwVrnMbY4S5kPftd", watchers: [ esbuild: {Esbuild, :install_and_run, [:jol, ~w(--sourcemap=inline --watch)]}, tailwind: {Tailwind, :install_and_run, [:jol, ~w(--watch)]} @@ -75,8 +75,11 @@ config :phoenix, :stacktrace_depth, 20 # Initialize plugs at runtime for faster development compilation config :phoenix, :plug_init_mode, :runtime -# Include HEEx debug annotations as HTML comments in rendered markup -config :phoenix_live_view, :debug_heex_annotations, true +config :phoenix_live_view, + # Include HEEx debug annotations as HTML comments in rendered markup + debug_heex_annotations: true, + # Enable helpful, but potentially expensive runtime checks + enable_expensive_runtime_checks: true # Disable swoosh api client as it is only required for production adapters. config :swoosh, :api_client, false diff --git a/config/test.exs b/config/test.exs index e28474f..a6ee46b 100644 --- a/config/test.exs +++ b/config/test.exs @@ -17,7 +17,7 @@ config :jol, JOL.Repo, # you can enable the server option below. config :jol, JOLWeb.Endpoint, http: [ip: {127, 0, 0, 1}, port: 4002], - secret_key_base: "TcmWd6GafOT64XVzHiK6e6Yub8o8jhoi4gMK5K4PlAXyD7nfwzjsutXiMDifprgw", + secret_key_base: "zsh38Gmypl+JSuchn078P5JaE2Am1vYbPRGapKTwVqgj7dVznb4gRGeWE+fW9m9/", server: false # In test we don't send emails. @@ -31,3 +31,7 @@ config :logger, level: :warning # Initialize plugs at runtime for faster test compilation config :phoenix, :plug_init_mode, :runtime + +config :phoenix_live_view, + # Enable helpful, but potentially expensive runtime checks + enable_expensive_runtime_checks: true diff --git a/lib/jol_web.ex b/lib/jol_web.ex index 479dc77..0f8130a 100644 --- a/lib/jol_web.ex +++ b/lib/jol_web.ex @@ -105,7 +105,7 @@ defmodule JOLWeb do end @doc """ - When used, dispatch to the appropriate controller/view/etc. + When used, dispatch to the appropriate controller/live_view/etc. """ defmacro __using__(which) when is_atom(which) do apply(__MODULE__, which, []) diff --git a/lib/jol_web/components/core_components.ex b/lib/jol_web/components/core_components.ex index 6afc6a7..e0067fc 100644 --- a/lib/jol_web/components/core_components.ex +++ b/lib/jol_web/components/core_components.ex @@ -260,7 +260,8 @@ defmodule JOLWeb.CoreComponents do * For live file uploads, see `Phoenix.Component.live_file_input/1` See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input - for more information. + for more information. Unsupported types, such as hidden and radio, + are best written directly in your templates. ## Examples @@ -274,8 +275,8 @@ defmodule JOLWeb.CoreComponents do attr :type, :string, default: "text", - values: ~w(checkbox color date datetime-local email file hidden month number password - range radio search select tel text textarea time url week) + values: ~w(checkbox color date datetime-local email file month number password + range search select tel text textarea time url week) attr :field, Phoenix.HTML.FormField, doc: "a form field struct retrieved from the form, for example: @form[:email]" diff --git a/lib/jol_web/components/layouts.ex b/lib/jol_web/components/layouts.ex index ccf2be9..b8c4291 100644 --- a/lib/jol_web/components/layouts.ex +++ b/lib/jol_web/components/layouts.ex @@ -1,4 +1,13 @@ defmodule JOLWeb.Layouts do + @moduledoc """ + This module holds different layouts used by your application. + + See the `layouts` directory for all templates available. + The "root" layout is a skeleton rendered as part of the + application router. The "app" layout is set as the default + layout on both `use JOLWeb, :controller` and + `use JOLWeb, :live_view`. + """ use JOLWeb, :html embed_templates "layouts/*" diff --git a/lib/jol_web/controllers/error_html.ex b/lib/jol_web/controllers/error_html.ex index 3a5e1f1..da01d92 100644 --- a/lib/jol_web/controllers/error_html.ex +++ b/lib/jol_web/controllers/error_html.ex @@ -1,4 +1,9 @@ defmodule JOLWeb.ErrorHTML do + @moduledoc """ + This module is invoked by your endpoint in case of errors on HTML requests. + + See config/config.exs. + """ use JOLWeb, :html # If you want to customize your error pages, diff --git a/lib/jol_web/controllers/error_json.ex b/lib/jol_web/controllers/error_json.ex index 76a5e55..5187ef4 100644 --- a/lib/jol_web/controllers/error_json.ex +++ b/lib/jol_web/controllers/error_json.ex @@ -1,4 +1,10 @@ defmodule JOLWeb.ErrorJSON do + @moduledoc """ + This module is invoked by your endpoint in case of errors on JSON requests. + + See config/config.exs. + """ + # If you want to customize a particular status code, # you may add your own clauses, such as: # diff --git a/lib/jol_web/controllers/page_html.ex b/lib/jol_web/controllers/page_html.ex index 36e1cb6..489bf30 100644 --- a/lib/jol_web/controllers/page_html.ex +++ b/lib/jol_web/controllers/page_html.ex @@ -1,4 +1,9 @@ defmodule JOLWeb.PageHTML do + @moduledoc """ + This module contains pages rendered by PageController. + + See the `page_html` directory for all templates available. + """ use JOLWeb, :html embed_templates "page_html/*" diff --git a/lib/jol_web/endpoint.ex b/lib/jol_web/endpoint.ex index 14bd7f1..a01a926 100644 --- a/lib/jol_web/endpoint.ex +++ b/lib/jol_web/endpoint.ex @@ -7,7 +7,7 @@ defmodule JOLWeb.Endpoint do @session_options [ store: :cookie, key: "_jol_key", - signing_salt: "EfeMJI5X", + signing_salt: "8p+TO3NA", same_site: "Lax" ] diff --git a/mix.exs b/mix.exs index 12b5e2b..49be7fb 100644 --- a/mix.exs +++ b/mix.exs @@ -32,7 +32,7 @@ defmodule JOL.MixProject do # Type `mix help deps` for examples and options. defp deps do [ - {:phoenix, "~> 1.7.11"}, + {:phoenix, "~> 1.7.12"}, {:phoenix_ecto, "~> 4.4"}, {:ecto_sql, "~> 3.10"}, {:postgrex, ">= 0.0.0"}, @@ -52,7 +52,7 @@ defmodule JOL.MixProject do depth: 1}, {:swoosh, "~> 1.5"}, {:finch, "~> 0.13"}, - {:telemetry_metrics, "~> 0.6"}, + {:telemetry_metrics, "~> 1.0"}, {:telemetry_poller, "~> 1.0"}, {:gettext, "~> 0.20"}, {:jason, "~> 1.2"}, diff --git a/mix.lock b/mix.lock index c470325..dcb6fe4 100644 --- a/mix.lock +++ b/mix.lock @@ -19,7 +19,7 @@ "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, "mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"}, - "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"}, "nimble_publisher": {:hex, :nimble_publisher, "1.1.0", "49dee0f30536140268996660a5927d0282946949c35c88ccc6da11a19231b4b6", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "80fb42d8d1e34f41ff29fc2a1ae6ab86ea7b764b3c2d38e5268a43cf33825782"}, @@ -37,7 +37,7 @@ "swoosh": {:hex, :swoosh, "1.16.7", "9dd0c172b4519a023f58e94d3ea79480b469dd4c0cd5369fabfbfd2e39bf5545", [:mix], [{:bandit, ">= 1.0.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mua, "~> 0.1.0", [hex: :mua, repo: "hexpm", optional: true]}, {:multipart, "~> 0.4", [hex: :multipart, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:req, "~> 0.4 or ~> 1.0", [hex: :req, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "21073982816cff3410e90c0d80ebfd5a0bf4839c7b39db20bc69a6df123bbf35"}, "tailwind": {:hex, :tailwind, "0.2.2", "9e27288b568ede1d88517e8c61259bc214a12d7eed271e102db4c93fcca9b2cd", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "ccfb5025179ea307f7f899d1bb3905cd0ac9f687ed77feebc8f67bdca78565c4"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, - "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.2", "2caabe9344ec17eafe5403304771c3539f3b6e2f7fb6a6f602558c825d0d0bfb", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9b43db0dc33863930b9ef9d27137e78974756f5f198cae18409970ed6fa5b561"}, + "telemetry_metrics": {:hex, :telemetry_metrics, "1.0.0", "29f5f84991ca98b8eb02fc208b2e6de7c95f8bb2294ef244a176675adc7775df", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f23713b3847286a534e005126d4c959ebcca68ae9582118ce436b521d1d47d5d"}, "telemetry_poller": {:hex, :telemetry_poller, "1.1.0", "58fa7c216257291caaf8d05678c8d01bd45f4bdbc1286838a28c4bb62ef32999", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9eb9d9cbfd81cbd7cdd24682f8711b6e2b691289a0de6826e58452f28c103c8f"}, "thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"}, "toml": {:hex, :toml, "0.7.0", "fbcd773caa937d0c7a02c301a1feea25612720ac3fa1ccb8bfd9d30d822911de", [:mix], [], "hexpm", "0690246a2478c1defd100b0c9b89b4ea280a22be9a7b313a8a058a2408a2fa70"},