diff --git a/bin/test b/bin/test
index dab0352e..e76ccefe 100755
--- a/bin/test
+++ b/bin/test
@@ -60,14 +60,13 @@ echo "[DEBUG] Current Elixir Version: $iexCurrentVersion"
otpCurrentVersion="$(erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell | sed 's/\"//g')"
echo "[DEBUG] Current OTP Version: $otpCurrentVersion"
-
-requiredMinVersion="22"
+requiredMinVersion="24"
if [ "$(printf '%s\n' "$requiredMinVersion" "$otpCurrentVersion" | sort -Vr | head -n1)" = "$requiredMinVersion" ]; then
- echo '[Skipping] OTP 22+ is required for Phoenix 1.6+'
+ echo '[Skipping] OTP 24+ is required for Phoenix 1.7+'
else
- cd "$TEST_ROOT/support/apps/phx1_6" && {
+ cd "$TEST_ROOT/support/apps/phx1_7" && {
bin/test || {
- echo 'Integration tests on regular Phoenix 1.6 project failed!'
+ echo 'Integration tests on regular Phoenix 1.7 project failed!'
exit 1
}
}
diff --git a/test/support/apps/phx1_6/.formatter.exs b/test/support/apps/phx1_6/.formatter.exs
deleted file mode 100644
index 8a6391c6..00000000
--- a/test/support/apps/phx1_6/.formatter.exs
+++ /dev/null
@@ -1,5 +0,0 @@
-[
- import_deps: [:ecto, :phoenix],
- inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
- subdirectories: ["priv/*/migrations"]
-]
diff --git a/test/support/apps/phx1_6/assets/css/app.css b/test/support/apps/phx1_6/assets/css/app.css
deleted file mode 100644
index 19c2e51e..00000000
--- a/test/support/apps/phx1_6/assets/css/app.css
+++ /dev/null
@@ -1,120 +0,0 @@
-/* This file is for your main application CSS */
-@import "./phoenix.css";
-
-/* Alerts and form errors used by phx.new */
-.alert {
- padding: 15px;
- margin-bottom: 20px;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-.alert-info {
- color: #31708f;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-.alert-warning {
- color: #8a6d3b;
- background-color: #fcf8e3;
- border-color: #faebcc;
-}
-.alert-danger {
- color: #a94442;
- background-color: #f2dede;
- border-color: #ebccd1;
-}
-.alert p {
- margin-bottom: 0;
-}
-.alert:empty {
- display: none;
-}
-.invalid-feedback {
- color: #a94442;
- display: block;
- margin: -1rem 0 2rem;
-}
-
-/* LiveView specific classes for your customization */
-.phx-no-feedback.invalid-feedback,
-.phx-no-feedback .invalid-feedback {
- display: none;
-}
-
-.phx-click-loading {
- opacity: 0.5;
- transition: opacity 1s ease-out;
-}
-
-.phx-loading{
- cursor: wait;
-}
-
-.phx-modal {
- opacity: 1!important;
- position: fixed;
- z-index: 1;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- overflow: auto;
- background-color: rgba(0,0,0,0.4);
-}
-
-.phx-modal-content {
- background-color: #fefefe;
- margin: 15vh auto;
- padding: 20px;
- border: 1px solid #888;
- width: 80%;
-}
-
-.phx-modal-close {
- color: #aaa;
- float: right;
- font-size: 28px;
- font-weight: bold;
-}
-
-.phx-modal-close:hover,
-.phx-modal-close:focus {
- color: black;
- text-decoration: none;
- cursor: pointer;
-}
-
-.fade-in-scale {
- animation: 0.2s ease-in 0s normal forwards 1 fade-in-scale-keys;
-}
-
-.fade-out-scale {
- animation: 0.2s ease-out 0s normal forwards 1 fade-out-scale-keys;
-}
-
-.fade-in {
- animation: 0.2s ease-out 0s normal forwards 1 fade-in-keys;
-}
-.fade-out {
- animation: 0.2s ease-out 0s normal forwards 1 fade-out-keys;
-}
-
-@keyframes fade-in-scale-keys{
- 0% { scale: 0.95; opacity: 0; }
- 100% { scale: 1.0; opacity: 1; }
-}
-
-@keyframes fade-out-scale-keys{
- 0% { scale: 1.0; opacity: 1; }
- 100% { scale: 0.95; opacity: 0; }
-}
-
-@keyframes fade-in-keys{
- 0% { opacity: 0; }
- 100% { opacity: 1; }
-}
-
-@keyframes fade-out-keys{
- 0% { opacity: 1; }
- 100% { opacity: 0; }
-}
diff --git a/test/support/apps/phx1_6/assets/css/phoenix.css b/test/support/apps/phx1_6/assets/css/phoenix.css
deleted file mode 100644
index 0d59050f..00000000
--- a/test/support/apps/phx1_6/assets/css/phoenix.css
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Includes some default style for the starter application.
- * This can be safely deleted to start fresh.
- */
-
-/* Milligram v1.4.1 https://milligram.github.io
- * Copyright (c) 2020 CJ Patoilo Licensed under the MIT license
- */
-
-*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{color:#000000;font-family:'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;font-size:1.6em;font-weight:300;letter-spacing:.01em;line-height:1.6}blockquote{border-left:0.3rem solid #d1d1d1;margin-left:0;margin-right:0;padding:1rem 1.5rem}blockquote *:last-child{margin-bottom:0}.button,button,input[type='button'],input[type='reset'],input[type='submit']{background-color:#0069d9;border:0.1rem solid #0069d9;border-radius:.4rem;color:#fff;cursor:pointer;display:inline-block;font-size:1.1rem;font-weight:700;height:3.8rem;letter-spacing:.1rem;line-height:3.8rem;padding:0 3.0rem;text-align:center;text-decoration:none;text-transform:uppercase;white-space:nowrap}.button:focus,.button:hover,button:focus,button:hover,input[type='button']:focus,input[type='button']:hover,input[type='reset']:focus,input[type='reset']:hover,input[type='submit']:focus,input[type='submit']:hover{background-color:#606c76;border-color:#606c76;color:#fff;outline:0}.button[disabled],button[disabled],input[type='button'][disabled],input[type='reset'][disabled],input[type='submit'][disabled]{cursor:default;opacity:.5}.button[disabled]:focus,.button[disabled]:hover,button[disabled]:focus,button[disabled]:hover,input[type='button'][disabled]:focus,input[type='button'][disabled]:hover,input[type='reset'][disabled]:focus,input[type='reset'][disabled]:hover,input[type='submit'][disabled]:focus,input[type='submit'][disabled]:hover{background-color:#0069d9;border-color:#0069d9}.button.button-outline,button.button-outline,input[type='button'].button-outline,input[type='reset'].button-outline,input[type='submit'].button-outline{background-color:transparent;color:#0069d9}.button.button-outline:focus,.button.button-outline:hover,button.button-outline:focus,button.button-outline:hover,input[type='button'].button-outline:focus,input[type='button'].button-outline:hover,input[type='reset'].button-outline:focus,input[type='reset'].button-outline:hover,input[type='submit'].button-outline:focus,input[type='submit'].button-outline:hover{background-color:transparent;border-color:#606c76;color:#606c76}.button.button-outline[disabled]:focus,.button.button-outline[disabled]:hover,button.button-outline[disabled]:focus,button.button-outline[disabled]:hover,input[type='button'].button-outline[disabled]:focus,input[type='button'].button-outline[disabled]:hover,input[type='reset'].button-outline[disabled]:focus,input[type='reset'].button-outline[disabled]:hover,input[type='submit'].button-outline[disabled]:focus,input[type='submit'].button-outline[disabled]:hover{border-color:inherit;color:#0069d9}.button.button-clear,button.button-clear,input[type='button'].button-clear,input[type='reset'].button-clear,input[type='submit'].button-clear{background-color:transparent;border-color:transparent;color:#0069d9}.button.button-clear:focus,.button.button-clear:hover,button.button-clear:focus,button.button-clear:hover,input[type='button'].button-clear:focus,input[type='button'].button-clear:hover,input[type='reset'].button-clear:focus,input[type='reset'].button-clear:hover,input[type='submit'].button-clear:focus,input[type='submit'].button-clear:hover{background-color:transparent;border-color:transparent;color:#606c76}.button.button-clear[disabled]:focus,.button.button-clear[disabled]:hover,button.button-clear[disabled]:focus,button.button-clear[disabled]:hover,input[type='button'].button-clear[disabled]:focus,input[type='button'].button-clear[disabled]:hover,input[type='reset'].button-clear[disabled]:focus,input[type='reset'].button-clear[disabled]:hover,input[type='submit'].button-clear[disabled]:focus,input[type='submit'].button-clear[disabled]:hover{color:#0069d9}code{background:#f4f5f6;border-radius:.4rem;font-size:86%;margin:0 .2rem;padding:.2rem .5rem;white-space:nowrap}pre{background:#f4f5f6;border-left:0.3rem solid #0069d9;overflow-y:hidden}pre>code{border-radius:0;display:block;padding:1rem 1.5rem;white-space:pre}hr{border:0;border-top:0.1rem solid #f4f5f6;margin:3.0rem 0}input[type='color'],input[type='date'],input[type='datetime'],input[type='datetime-local'],input[type='email'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='url'],input[type='week'],input:not([type]),textarea,select{-webkit-appearance:none;background-color:transparent;border:0.1rem solid #d1d1d1;border-radius:.4rem;box-shadow:none;box-sizing:inherit;height:3.8rem;padding:.6rem 1.0rem .7rem;width:100%}input[type='color']:focus,input[type='date']:focus,input[type='datetime']:focus,input[type='datetime-local']:focus,input[type='email']:focus,input[type='month']:focus,input[type='number']:focus,input[type='password']:focus,input[type='search']:focus,input[type='tel']:focus,input[type='text']:focus,input[type='url']:focus,input[type='week']:focus,input:not([type]):focus,textarea:focus,select:focus{border-color:#0069d9;outline:0}select{background:url('data:image/svg+xml;utf8, ') center right no-repeat;padding-right:3.0rem}select:focus{background-image:url('data:image/svg+xml;utf8, ')}select[multiple]{background:none;height:auto}textarea{min-height:6.5rem}label,legend{display:block;font-size:1.6rem;font-weight:700;margin-bottom:.5rem}fieldset{border-width:0;padding:0}input[type='checkbox'],input[type='radio']{display:inline}.label-inline{display:inline-block;font-weight:normal;margin-left:.5rem}.container{margin:0 auto;max-width:112.0rem;padding:0 2.0rem;position:relative;width:100%}.row{display:flex;flex-direction:column;padding:0;width:100%}.row.row-no-padding{padding:0}.row.row-no-padding>.column{padding:0}.row.row-wrap{flex-wrap:wrap}.row.row-top{align-items:flex-start}.row.row-bottom{align-items:flex-end}.row.row-center{align-items:center}.row.row-stretch{align-items:stretch}.row.row-baseline{align-items:baseline}.row .column{display:block;flex:1 1 auto;margin-left:0;max-width:100%;width:100%}.row .column.column-offset-10{margin-left:10%}.row .column.column-offset-20{margin-left:20%}.row .column.column-offset-25{margin-left:25%}.row .column.column-offset-33,.row .column.column-offset-34{margin-left:33.3333%}.row .column.column-offset-40{margin-left:40%}.row .column.column-offset-50{margin-left:50%}.row .column.column-offset-60{margin-left:60%}.row .column.column-offset-66,.row .column.column-offset-67{margin-left:66.6666%}.row .column.column-offset-75{margin-left:75%}.row .column.column-offset-80{margin-left:80%}.row .column.column-offset-90{margin-left:90%}.row .column.column-10{flex:0 0 10%;max-width:10%}.row .column.column-20{flex:0 0 20%;max-width:20%}.row .column.column-25{flex:0 0 25%;max-width:25%}.row .column.column-33,.row .column.column-34{flex:0 0 33.3333%;max-width:33.3333%}.row .column.column-40{flex:0 0 40%;max-width:40%}.row .column.column-50{flex:0 0 50%;max-width:50%}.row .column.column-60{flex:0 0 60%;max-width:60%}.row .column.column-66,.row .column.column-67{flex:0 0 66.6666%;max-width:66.6666%}.row .column.column-75{flex:0 0 75%;max-width:75%}.row .column.column-80{flex:0 0 80%;max-width:80%}.row .column.column-90{flex:0 0 90%;max-width:90%}.row .column .column-top{align-self:flex-start}.row .column .column-bottom{align-self:flex-end}.row .column .column-center{align-self:center}@media (min-width: 40rem){.row{flex-direction:row;margin-left:-1.0rem;width:calc(100% + 2.0rem)}.row .column{margin-bottom:inherit;padding:0 1.0rem}}a{color:#0069d9;text-decoration:none}a:focus,a:hover{color:#606c76}dl,ol,ul{list-style:none;margin-top:0;padding-left:0}dl dl,dl ol,dl ul,ol dl,ol ol,ol ul,ul dl,ul ol,ul ul{font-size:90%;margin:1.5rem 0 1.5rem 3.0rem}ol{list-style:decimal inside}ul{list-style:circle inside}.button,button,dd,dt,li{margin-bottom:1.0rem}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}table{border-spacing:0;display:block;overflow-x:auto;text-align:left;width:100%}td,th{border-bottom:0.1rem solid #e1e1e1;padding:1.2rem 1.5rem}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}@media (min-width: 40rem){table{display:table;overflow-x:initial}}b,strong{font-weight:bold}p{margin-top:0}h1,h2,h3,h4,h5,h6{font-weight:300;letter-spacing:-.1rem;margin-bottom:2.0rem;margin-top:0}h1{font-size:4.6rem;line-height:1.2}h2{font-size:3.6rem;line-height:1.25}h3{font-size:2.8rem;line-height:1.3}h4{font-size:2.2rem;letter-spacing:-.08rem;line-height:1.35}h5{font-size:1.8rem;letter-spacing:-.05rem;line-height:1.5}h6{font-size:1.6rem;letter-spacing:0;line-height:1.4}img{max-width:100%}.clearfix:after{clear:both;content:' ';display:table}.float-left{float:left}.float-right{float:right}
-
-/* General style */
-h1{font-size: 3.6rem; line-height: 1.25}
-h2{font-size: 2.8rem; line-height: 1.3}
-h3{font-size: 2.2rem; letter-spacing: -.08rem; line-height: 1.35}
-h4{font-size: 1.8rem; letter-spacing: -.05rem; line-height: 1.5}
-h5{font-size: 1.6rem; letter-spacing: 0; line-height: 1.4}
-h6{font-size: 1.4rem; letter-spacing: 0; line-height: 1.2}
-pre{padding: 1em;}
-
-.container{
- margin: 0 auto;
- max-width: 80.0rem;
- padding: 0 2.0rem;
- position: relative;
- width: 100%
-}
-select {
- width: auto;
-}
-
-/* Phoenix promo and logo */
-.phx-hero {
- text-align: center;
- border-bottom: 1px solid #e3e3e3;
- background: #eee;
- border-radius: 6px;
- padding: 3em 3em 1em;
- margin-bottom: 3rem;
- font-weight: 200;
- font-size: 120%;
-}
-.phx-hero input {
- background: #ffffff;
-}
-.phx-logo {
- min-width: 300px;
- margin: 1rem;
- display: block;
-}
-.phx-logo img {
- width: auto;
- display: block;
-}
-
-/* Headers */
-header {
- width: 100%;
- background: #fdfdfd;
- border-bottom: 1px solid #eaeaea;
- margin-bottom: 2rem;
-}
-header section {
- align-items: center;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
-}
-header section :first-child {
- order: 2;
-}
-header section :last-child {
- order: 1;
-}
-header nav ul,
-header nav li {
- margin: 0;
- padding: 0;
- display: block;
- text-align: right;
- white-space: nowrap;
-}
-header nav ul {
- margin: 1rem;
- margin-top: 0;
-}
-header nav a {
- display: block;
-}
-
-@media (min-width: 40.0rem) { /* Small devices (landscape phones, 576px and up) */
- header section {
- flex-direction: row;
- }
- header nav ul {
- margin: 1rem;
- }
- .phx-logo {
- flex-basis: 527px;
- margin: 2rem 1rem;
- }
-}
diff --git a/test/support/apps/phx1_6/config/prod.exs b/test/support/apps/phx1_6/config/prod.exs
deleted file mode 100644
index c1eb7ed4..00000000
--- a/test/support/apps/phx1_6/config/prod.exs
+++ /dev/null
@@ -1,49 +0,0 @@
-import Config
-
-# For production, don't forget to configure the url host
-# to something meaningful, Phoenix uses this information
-# when generating URLs.
-#
-# Note we also include the path to a cache manifest
-# containing the digested version of static files. This
-# manifest is generated by the `mix phx.digest` task,
-# which you should run after static files are built and
-# before starting your production server.
-config :phx1_6, Phx16Web.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
-
-# Do not print debug messages in production
-config :logger, level: :info
-
-# ## SSL Support
-#
-# To get SSL working, you will need to add the `https` key
-# to the previous section and set your `:url` port to 443:
-#
-# config :phx1_6, Phx16Web.Endpoint,
-# ...,
-# url: [host: "example.com", port: 443],
-# https: [
-# ...,
-# port: 443,
-# cipher_suite: :strong,
-# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
-# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")
-# ]
-#
-# The `cipher_suite` is set to `:strong` to support only the
-# latest and more secure SSL ciphers. This means old browsers
-# and clients may not be supported. You can set it to
-# `:compatible` for wider support.
-#
-# `:keyfile` and `:certfile` expect an absolute path to the key
-# and cert in disk or a relative path inside priv, for example
-# "priv/ssl/server.key". For all supported SSL configuration
-# options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1
-#
-# We also recommend setting `force_ssl` in your endpoint, ensuring
-# no data is ever sent via http, always redirecting to https:
-#
-# config :phx1_6, Phx16Web.Endpoint,
-# force_ssl: [hsts: true]
-#
-# Check `Plug.SSL` for all available options in `force_ssl`.
diff --git a/test/support/apps/phx1_6/lib/phx1_6/mailer.ex b/test/support/apps/phx1_6/lib/phx1_6/mailer.ex
deleted file mode 100644
index 6dcc10fc..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6/mailer.ex
+++ /dev/null
@@ -1,3 +0,0 @@
-defmodule Phx16.Mailer do
- use Swoosh.Mailer, otp_app: :phx1_6
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web.ex b/test/support/apps/phx1_6/lib/phx1_6_web.ex
deleted file mode 100644
index 2781433e..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web.ex
+++ /dev/null
@@ -1,110 +0,0 @@
-defmodule Phx16Web do
- @moduledoc """
- The entrypoint for defining your web interface, such
- as controllers, views, channels and so on.
-
- This can be used in your application as:
-
- use Phx16Web, :controller
- use Phx16Web, :view
-
- The definitions below will be executed for every view,
- controller, etc, so keep them short and clean, focused
- on imports, uses and aliases.
-
- Do NOT define functions inside the quoted expressions
- below. Instead, define any helper function in modules
- and import those modules here.
- """
-
- def controller do
- quote do
- use Phoenix.Controller, namespace: Phx16Web
-
- import Plug.Conn
- import Phx16Web.Gettext
- alias Phx16Web.Router.Helpers, as: Routes
- end
- end
-
- def view do
- quote do
- use Phoenix.View,
- root: "lib/phx1_6_web/templates",
- namespace: Phx16Web
-
- # Import convenience functions from controllers
- import Phoenix.Controller,
- only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1]
-
- # Include shared imports and aliases for views
- unquote(view_helpers())
- end
- end
-
- def live_view do
- quote do
- use Phoenix.LiveView,
- layout: {Phx16Web.LayoutView, "live.html"}
-
- unquote(view_helpers())
- end
- end
-
- def live_component do
- quote do
- use Phoenix.LiveComponent
-
- unquote(view_helpers())
- end
- end
-
- def component do
- quote do
- use Phoenix.Component
-
- unquote(view_helpers())
- end
- end
-
- def router do
- quote do
- use Phoenix.Router
-
- import Plug.Conn
- import Phoenix.Controller
- import Phoenix.LiveView.Router
- end
- end
-
- def channel do
- quote do
- use Phoenix.Channel
- import Phx16Web.Gettext
- end
- end
-
- defp view_helpers do
- quote do
- # Use all HTML functionality (forms, tags, etc)
- use Phoenix.HTML
-
- # Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc)
- import Phoenix.LiveView.Helpers
-
- # Import basic rendering functionality (render, render_layout, etc)
- import Phoenix.View
-
- import Phx16Web.ErrorHelpers
- import Phx16Web.Gettext
- alias Phx16Web.Router.Helpers, as: Routes
- end
- end
-
- @doc """
- When used, dispatch to the appropriate controller/view/etc.
- """
- defmacro __using__(which) when is_atom(which) do
- apply(__MODULE__, which, [])
- end
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/controllers/page_controller.ex b/test/support/apps/phx1_6/lib/phx1_6_web/controllers/page_controller.ex
deleted file mode 100644
index c17de51e..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/controllers/page_controller.ex
+++ /dev/null
@@ -1,7 +0,0 @@
-defmodule Phx16Web.PageController do
- use Phx16Web, :controller
-
- def index(conn, _params) do
- render(conn, "index.html")
- end
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/router.ex b/test/support/apps/phx1_6/lib/phx1_6_web/router.ex
deleted file mode 100644
index a6aaec6c..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/router.ex
+++ /dev/null
@@ -1,56 +0,0 @@
-defmodule Phx16Web.Router do
- use Phx16Web, :router
-
- pipeline :browser do
- plug :accepts, ["html"]
- plug :fetch_session
- plug :fetch_live_flash
- plug :put_root_layout, {Phx16Web.LayoutView, :root}
- plug :protect_from_forgery
- plug :put_secure_browser_headers
- end
-
- pipeline :api do
- plug :accepts, ["json"]
- end
-
- scope "/", Phx16Web do
- pipe_through :browser
-
- get "/", PageController, :index
- end
-
- # Other scopes may use custom stacks.
- # scope "/api", Phx16Web do
- # pipe_through :api
- # end
-
- # Enables LiveDashboard only for development
- #
- # If you want to use the LiveDashboard in production, you should put
- # it behind authentication and allow only admins to access it.
- # If your application does not have an admins-only section yet,
- # you can use Plug.BasicAuth to set up some basic authentication
- # as long as you are also using SSL (which you should anyway).
- if Mix.env() in [:dev, :test] do
- import Phoenix.LiveDashboard.Router
-
- scope "/" do
- pipe_through :browser
-
- live_dashboard("/dashboard", metrics: Phx16Web.Telemetry)
- end
- end
-
- # Enables the Swoosh mailbox preview in development.
- #
- # Note that preview only shows emails that were sent by the same
- # node running the Phoenix server.
- if Mix.env() == :dev do
- scope "/dev" do
- pipe_through :browser
-
- forward("/mailbox", Plug.Swoosh.MailboxPreview)
- end
- end
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/app.html.heex b/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/app.html.heex
deleted file mode 100644
index 169aed95..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/app.html.heex
+++ /dev/null
@@ -1,5 +0,0 @@
-
- <%= get_flash(@conn, :info) %>
- <%= get_flash(@conn, :error) %>
- <%= @inner_content %>
-
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/live.html.heex b/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/live.html.heex
deleted file mode 100644
index a29d6044..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/live.html.heex
+++ /dev/null
@@ -1,11 +0,0 @@
-
- <%= live_flash(@flash, :info) %>
-
- <%= live_flash(@flash, :error) %>
-
- <%= @inner_content %>
-
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/root.html.heex b/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/root.html.heex
deleted file mode 100644
index de203b87..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/templates/layout/root.html.heex
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- <%= csrf_meta_tag() %>
- <%= live_title_tag assigns[:page_title] || "Phx16", suffix: " ยท Phoenix Framework" %>
-
-
-
-
-
-
-
-
- Get Started
- <%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
- <%= link "LiveDashboard", to: Routes.live_dashboard_path(@conn, :home) %>
- <% end %>
-
-
-
-
-
-
-
- <%= @inner_content %>
-
-
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/templates/page/index.html.heex b/test/support/apps/phx1_6/lib/phx1_6_web/templates/page/index.html.heex
deleted file mode 100644
index f844bd8d..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/templates/page/index.html.heex
+++ /dev/null
@@ -1,41 +0,0 @@
-
- <%= gettext "Welcome to %{name}!", name: "Phoenix" %>
- Peace of mind from prototype to production
-
-
-
-
- Resources
-
-
-
- Help
-
-
-
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/views/error_helpers.ex b/test/support/apps/phx1_6/lib/phx1_6_web/views/error_helpers.ex
deleted file mode 100644
index 622312eb..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/views/error_helpers.ex
+++ /dev/null
@@ -1,47 +0,0 @@
-defmodule Phx16Web.ErrorHelpers do
- @moduledoc """
- Conveniences for translating and building error messages.
- """
-
- use Phoenix.HTML
-
- @doc """
- Generates tag for inlined form input errors.
- """
- def error_tag(form, field) do
- Enum.map(Keyword.get_values(form.errors, field), fn error ->
- content_tag(:span, translate_error(error),
- class: "invalid-feedback",
- phx_feedback_for: input_name(form, field)
- )
- end)
- end
-
- @doc """
- Translates an error message using gettext.
- """
- def translate_error({msg, opts}) do
- # When using gettext, we typically pass the strings we want
- # to translate as a static argument:
- #
- # # Translate "is invalid" in the "errors" domain
- # dgettext("errors", "is invalid")
- #
- # # Translate the number of files with plural rules
- # dngettext("errors", "1 file", "%{count} files", count)
- #
- # Because the error messages we show in our forms and APIs
- # are defined inside Ecto, we need to translate them dynamically.
- # This requires us to call the Gettext module passing our gettext
- # backend as first argument.
- #
- # Note we use the "errors" domain, which means translations
- # should be written to the errors.po file. The :count option is
- # set by Ecto and indicates we should also apply plural rules.
- if count = opts[:count] do
- Gettext.dngettext(Phx16Web.Gettext, "errors", msg, msg, count, opts)
- else
- Gettext.dgettext(Phx16Web.Gettext, "errors", msg, opts)
- end
- end
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/views/error_view.ex b/test/support/apps/phx1_6/lib/phx1_6_web/views/error_view.ex
deleted file mode 100644
index f42191ad..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/views/error_view.ex
+++ /dev/null
@@ -1,16 +0,0 @@
-defmodule Phx16Web.ErrorView do
- use Phx16Web, :view
-
- # If you want to customize a particular status code
- # for a certain format, you may uncomment below.
- # def render("500.html", _assigns) do
- # "Internal Server Error"
- # end
-
- # By default, Phoenix returns the status message from
- # the template name. For example, "404.html" becomes
- # "Not Found".
- def template_not_found(template, _assigns) do
- Phoenix.Controller.status_message_from_template(template)
- end
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/views/layout_view.ex b/test/support/apps/phx1_6/lib/phx1_6_web/views/layout_view.ex
deleted file mode 100644
index 18ce49ca..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/views/layout_view.ex
+++ /dev/null
@@ -1,7 +0,0 @@
-defmodule Phx16Web.LayoutView do
- use Phx16Web, :view
-
- # Phoenix LiveDashboard is available only in development by default,
- # so we instruct Elixir to not warn if the dashboard route is missing.
- @compile {:no_warn_undefined, {Routes, :live_dashboard_path, 2}}
-end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/views/page_view.ex b/test/support/apps/phx1_6/lib/phx1_6_web/views/page_view.ex
deleted file mode 100644
index 0c2a9749..00000000
--- a/test/support/apps/phx1_6/lib/phx1_6_web/views/page_view.ex
+++ /dev/null
@@ -1,3 +0,0 @@
-defmodule Phx16Web.PageView do
- use Phx16Web, :view
-end
diff --git a/test/support/apps/phx1_6/mix.lock b/test/support/apps/phx1_6/mix.lock
deleted file mode 100644
index 369cb6f5..00000000
--- a/test/support/apps/phx1_6/mix.lock
+++ /dev/null
@@ -1,49 +0,0 @@
-%{
- "castore": {:hex, :castore, "0.1.15", "dbb300827d5a3ec48f396ca0b77ad47058578927e9ebe792abd99fcbc3324326", [:mix], [], "hexpm", "c69379b907673c7e6eb229f09a0a09b60bb27cfb9625bcb82ea4c04ba82a8442"},
- "certifi": {:hex, :certifi, "2.8.0", "d4fb0a6bb20b7c9c3643e22507e42f356ac090a1dcea9ab99e27e0376d695eba", [:rebar3], [], "hexpm", "6ac7efc1c6f8600b08d625292d4bbf584e14847ce1b6b5c44d983d273e1097ea"},
- "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
- "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
- "cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
- "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
- "cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
- "db_connection": {:hex, :db_connection, "2.4.1", "6411f6e23f1a8b68a82fa3a36366d4881f21f47fc79a9efb8c615e62050219da", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ea36d226ec5999781a9a8ad64e5d8c4454ecedc7a4d643e4832bf08efca01f00"},
- "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
- "ecto": {:hex, :ecto, "3.7.1", "a20598862351b29f80f285b21ec5297da1181c0442687f9b8329f0445d228892", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d36e5b39fc479e654cffd4dbe1865d9716e4a9b6311faff799b6f90ab81b8638"},
- "ecto_sql": {:hex, :ecto_sql, "3.7.2", "55c60aa3a06168912abf145c6df38b0295c34118c3624cf7a6977cd6ce043081", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.7.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.4.0 or ~> 0.5.0 or ~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c218ea62f305dcaef0b915fb56583195e7b91c91dcfb006ba1f669bfacbff2a"},
- "esbuild": {:hex, :esbuild, "0.4.0", "9f17db148aead4cf1e6e6a584214357287a93407b5fb51a031f122b61385d4c2", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "b61e4e6b92ffe45e4ee4755a22de6211a67c67987dc02afb35a425a0add1d447"},
- "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
- "filtrex": {:hex, :filtrex, "0.4.3", "d59e496d385b19df7e3a613ad74deca4ac5ef1666352e9e435e8442fc9ae4c70", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "a374999d00174c3a6c617def9c9d199a2bc5928d49a227d1de622ccbadbff1d0"},
- "floki": {:hex, :floki, "0.32.0", "f915dc15258bc997d49be1f5ef7d3992f8834d6f5695270acad17b41f5bcc8e2", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "1c5a91cae1fd8931c26a4826b5e2372c284813904c8bacb468b5de39c7ececbd"},
- "gettext": {:hex, :gettext, "0.19.0", "6909d61b38bb33339558f128f8af5913d5d5fe304a770217bf352b1620fb7ec4", [:mix], [], "hexpm", "3f7a274f52ebda9bb6655dfeda3d6b0dc4537ae51ce41dcccc7f73ca7379ad5e"},
- "hackney": {:hex, :hackney, "1.18.0", "c4443d960bb9fba6d01161d01cd81173089686717d9490e5d3606644c48d121f", [:rebar3], [{:certifi, "~>2.8.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "9afcda620704d720db8c6a3123e9848d09c87586dc1c10479c42627b905b5c5e"},
- "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
- "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
- "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
- "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
- "mime": {:hex, :mime, "2.0.2", "0b9e1a4c840eafb68d820b0e2158ef5c49385d17fb36855ac6e7e087d4b1dcc5", [:mix], [], "hexpm", "e6a3f76b4c277739e36c2e21a2c640778ba4c3846189d5ab19f97f126df5f9b7"},
- "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
- "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
- "phoenix": {:hex, :phoenix, "1.6.6", "281c8ce8dccc9f60607346b72cdfc597c3dde134dd9df28dff08282f0b751754", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "807bd646e64cd9dc83db016199715faba72758e6db1de0707eef0a2da4924364"},
- "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
- "phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
- "phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.6.4", "d7ff34b2c8dd5fa950748496697da01ae1b6b259891ce1103e300bdc7abfbb99", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.3", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.1", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "ce2505256ab459663258ecba4158af130e6b7a5b85783fe442541fbb1236e1b2"},
- "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"},
- "phoenix_live_view": {:hex, :phoenix_live_view, "0.17.6", "3665f3ec426ac8d681cd7753ad4c85d2d247094dc4dc6add80dd6e3026045389", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.5.9 or ~> 1.6.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "62f06d4bbfc4dc5595070bc338119ab08e8e67a011e2923f9366419622149b9c"},
- "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"},
- "phoenix_view": {:hex, :phoenix_view, "1.1.2", "1b82764a065fb41051637872c7bd07ed2fdb6f5c3bd89684d4dca6e10115c95a", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "7ae90ad27b09091266f6adbb61e1d2516a7c3d7062c6789d46a7554ec40f3a56"},
- "plug": {:hex, :plug, "1.13.0", "61b2949a31fc8fbfb993487e82d24ddbf7e8f04d5e9339f19ddf4c79c9b69e90", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c31c0225716cf8c15ef84ec5188093cbc204e046ac85e7b1dd7d9e66d31c18b0"},
- "plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"},
- "plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
- "postgrex": {:hex, :postgrex, "0.16.1", "f94628a32c571266f53cd1e5fca705e626e2417bf1eee6f868985d14e874160a", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "6b225df32c857b9430619dbe30200a7ae664e23415a771ae9209396ee8eeee64"},
- "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
- "scrivener": {:hex, :scrivener, "2.7.2", "1d913c965ec352650a7f864ad7fd8d80462f76a32f33d57d1e48bc5e9d40aba2", [:mix], [], "hexpm", "7866a0ec4d40274efbee1db8bead13a995ea4926ecd8203345af8f90d2b620d9"},
- "scrivener_ecto": {:hex, :scrivener_ecto, "2.7.0", "cf64b8cb8a96cd131cdbcecf64e7fd395e21aaa1cb0236c42a7c2e34b0dca580", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:scrivener, "~> 2.4", [hex: :scrivener, repo: "hexpm", optional: false]}], "hexpm", "e809f171687806b0031129034352f5ae44849720c48dd839200adeaf0ac3e260"},
- "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
- "swoosh": {:hex, :swoosh, "1.6.1", "7c4b0903876ca4b93992a3225d02c9a5e906aff2610a8d1b78020563a6fd9a6c", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, 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]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3e79cc8df5eb3b375f4456cd60af083126111cc4929a06ba3839162efb57862e"},
- "telemetry": {:hex, :telemetry, "1.0.0", "0f453a102cdf13d506b7c0ab158324c337c41f1cc7548f0bc0e130bbf0ae9452", [:rebar3], [], "hexpm", "73bc09fa59b4a0284efb4624335583c528e07ec9ae76aca96ea0673850aec57a"},
- "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"},
- "telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"},
- "timex": {:hex, :timex, "3.7.6", "502d2347ec550e77fdf419bc12d15bdccd31266bb7d925b30bf478268098282f", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "a296327f79cb1ec795b896698c56e662ed7210cc9eb31f0ab365eb3a62e2c589"},
- "tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"},
- "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
-}
diff --git a/test/support/apps/phx1_6/priv/static/images/phoenix.png b/test/support/apps/phx1_6/priv/static/images/phoenix.png
deleted file mode 100644
index 9c81075f..00000000
Binary files a/test/support/apps/phx1_6/priv/static/images/phoenix.png and /dev/null differ
diff --git a/test/support/apps/phx1_6/test/phx1_6_web/controllers/page_controller_test.exs b/test/support/apps/phx1_6/test/phx1_6_web/controllers/page_controller_test.exs
deleted file mode 100644
index 7b55687d..00000000
--- a/test/support/apps/phx1_6/test/phx1_6_web/controllers/page_controller_test.exs
+++ /dev/null
@@ -1,8 +0,0 @@
-defmodule Phx16Web.PageControllerTest do
- use Phx16Web.ConnCase
-
- test "GET /", %{conn: conn} do
- conn = get(conn, "/")
- assert html_response(conn, 200) =~ "Welcome to Phoenix!"
- end
-end
diff --git a/test/support/apps/phx1_6/test/phx1_6_web/views/error_view_test.exs b/test/support/apps/phx1_6/test/phx1_6_web/views/error_view_test.exs
deleted file mode 100644
index 668c0a15..00000000
--- a/test/support/apps/phx1_6/test/phx1_6_web/views/error_view_test.exs
+++ /dev/null
@@ -1,14 +0,0 @@
-defmodule Phx16Web.ErrorViewTest do
- use Phx16Web.ConnCase, async: true
-
- # Bring render/3 and render_to_string/3 for testing custom views
- import Phoenix.View
-
- test "renders 404.html" do
- assert render_to_string(Phx16Web.ErrorView, "404.html", []) == "Not Found"
- end
-
- test "renders 500.html" do
- assert render_to_string(Phx16Web.ErrorView, "500.html", []) == "Internal Server Error"
- end
-end
diff --git a/test/support/apps/phx1_6/test/phx1_6_web/views/layout_view_test.exs b/test/support/apps/phx1_6/test/phx1_6_web/views/layout_view_test.exs
deleted file mode 100644
index bdb470e1..00000000
--- a/test/support/apps/phx1_6/test/phx1_6_web/views/layout_view_test.exs
+++ /dev/null
@@ -1,8 +0,0 @@
-defmodule Phx16Web.LayoutViewTest do
- use Phx16Web.ConnCase, async: true
-
- # When testing helpers, you may want to import Phoenix.HTML and
- # use functions such as safe_to_string() to convert the helper
- # result into an HTML string.
- # import Phoenix.HTML
-end
diff --git a/test/support/apps/phx1_6/test/phx1_6_web/views/page_view_test.exs b/test/support/apps/phx1_6/test/phx1_6_web/views/page_view_test.exs
deleted file mode 100644
index e9443b9a..00000000
--- a/test/support/apps/phx1_6/test/phx1_6_web/views/page_view_test.exs
+++ /dev/null
@@ -1,3 +0,0 @@
-defmodule Phx16Web.PageViewTest do
- use Phx16Web.ConnCase, async: true
-end
diff --git a/test/support/apps/phx1_6/test/support/channel_case.ex b/test/support/apps/phx1_6/test/support/channel_case.ex
deleted file mode 100644
index 29cf75f1..00000000
--- a/test/support/apps/phx1_6/test/support/channel_case.ex
+++ /dev/null
@@ -1,36 +0,0 @@
-defmodule Phx16Web.ChannelCase do
- @moduledoc """
- This module defines the test case to be used by
- channel tests.
-
- Such tests rely on `Phoenix.ChannelTest` and also
- import other functionality to make it easier
- to build common data structures and query the data layer.
-
- Finally, if the test case interacts with the database,
- we enable the SQL sandbox, so changes done to the database
- are reverted at the end of every test. If you are using
- PostgreSQL, you can even run database tests asynchronously
- by setting `use Phx16Web.ChannelCase, async: true`, although
- this option is not recommended for other databases.
- """
-
- use ExUnit.CaseTemplate
-
- using do
- quote do
- # Import conveniences for testing with channels
- import Phoenix.ChannelTest
- import Phx16Web.ChannelCase
-
- # The default endpoint for testing
- @endpoint Phx16Web.Endpoint
- end
- end
-
- setup tags do
- pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Phx16.Repo, shared: not tags[:async])
- on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
- :ok
- end
-end
diff --git a/test/support/apps/phx1_6/test/test_helper.exs b/test/support/apps/phx1_6/test/test_helper.exs
deleted file mode 100644
index e5426d54..00000000
--- a/test/support/apps/phx1_6/test/test_helper.exs
+++ /dev/null
@@ -1,2 +0,0 @@
-ExUnit.start()
-Ecto.Adapters.SQL.Sandbox.mode(Phx16.Repo, :manual)
diff --git a/test/support/apps/phx1_7/.formatter.exs b/test/support/apps/phx1_7/.formatter.exs
new file mode 100644
index 00000000..ef8840ce
--- /dev/null
+++ b/test/support/apps/phx1_7/.formatter.exs
@@ -0,0 +1,6 @@
+[
+ import_deps: [:ecto, :ecto_sql, :phoenix],
+ subdirectories: ["priv/*/migrations"],
+ plugins: [Phoenix.LiveView.HTMLFormatter],
+ inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
+]
diff --git a/test/support/apps/phx1_6/.gitignore b/test/support/apps/phx1_7/.gitignore
similarity index 92%
rename from test/support/apps/phx1_6/.gitignore
rename to test/support/apps/phx1_7/.gitignore
index 9841535f..edafe3d3 100644
--- a/test/support/apps/phx1_6/.gitignore
+++ b/test/support/apps/phx1_7/.gitignore
@@ -19,8 +19,11 @@ erl_crash.dump
# Also ignore archive artifacts (built via "mix archive.build").
*.ez
+# Temporary files, for example, from tests.
+/tmp/
+
# Ignore package tarball (built via "mix hex.build").
-phx1_6-*.tar
+phx1_7-*.tar
# Ignore assets that are produced by build tools.
/priv/static/assets/
diff --git a/test/support/apps/phx1_6/README.md b/test/support/apps/phx1_7/README.md
similarity index 83%
rename from test/support/apps/phx1_6/README.md
rename to test/support/apps/phx1_7/README.md
index 60f41a42..8209b18a 100644
--- a/test/support/apps/phx1_6/README.md
+++ b/test/support/apps/phx1_7/README.md
@@ -1,9 +1,8 @@
-# Phx16
+# Phx17
To start your Phoenix server:
- * Install dependencies with `mix deps.get`
- * Create and migrate your database with `mix ecto.setup`
+ * Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
diff --git a/test/support/apps/phx1_7/assets/css/app.css b/test/support/apps/phx1_7/assets/css/app.css
new file mode 100644
index 00000000..378c8f90
--- /dev/null
+++ b/test/support/apps/phx1_7/assets/css/app.css
@@ -0,0 +1,5 @@
+@import "tailwindcss/base";
+@import "tailwindcss/components";
+@import "tailwindcss/utilities";
+
+/* This file is for your main application CSS */
diff --git a/test/support/apps/phx1_6/assets/js/app.js b/test/support/apps/phx1_7/assets/js/app.js
similarity index 81%
rename from test/support/apps/phx1_6/assets/js/app.js
rename to test/support/apps/phx1_7/assets/js/app.js
index 2ca06a56..df0cdd9f 100644
--- a/test/support/apps/phx1_6/assets/js/app.js
+++ b/test/support/apps/phx1_7/assets/js/app.js
@@ -1,7 +1,3 @@
-// We import the CSS which is extracted to its own file by esbuild.
-// Remove this line if you add a your own CSS build pipeline (e.g postcss).
-import "../css/app.css"
-
// If you want to use Phoenix channels, run `mix help phx.gen.channel`
// to get started and then uncomment the line below.
// import "./user_socket.js"
@@ -31,8 +27,8 @@ let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToke
// Show progress bar on live navigation and form submits
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
-window.addEventListener("phx:page-loading-start", info => topbar.show())
-window.addEventListener("phx:page-loading-stop", info => topbar.hide())
+window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
+window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
// connect if there are any LiveViews on the page
liveSocket.connect()
diff --git a/test/support/apps/phx1_7/assets/tailwind.config.js b/test/support/apps/phx1_7/assets/tailwind.config.js
new file mode 100644
index 00000000..e3bf2413
--- /dev/null
+++ b/test/support/apps/phx1_7/assets/tailwind.config.js
@@ -0,0 +1,26 @@
+// See the Tailwind configuration guide for advanced usage
+// https://tailwindcss.com/docs/configuration
+
+const plugin = require("tailwindcss/plugin")
+
+module.exports = {
+ content: [
+ "./js/**/*.js",
+ "../lib/*_web.ex",
+ "../lib/*_web/**/*.*ex"
+ ],
+ theme: {
+ extend: {
+ colors: {
+ brand: "#FD4F00",
+ }
+ },
+ },
+ plugins: [
+ require("@tailwindcss/forms"),
+ plugin(({addVariant}) => addVariant("phx-no-feedback", [".phx-no-feedback&", ".phx-no-feedback &"])),
+ plugin(({addVariant}) => addVariant("phx-click-loading", [".phx-click-loading&", ".phx-click-loading &"])),
+ plugin(({addVariant}) => addVariant("phx-submit-loading", [".phx-submit-loading&", ".phx-submit-loading &"])),
+ plugin(({addVariant}) => addVariant("phx-change-loading", [".phx-change-loading&", ".phx-change-loading &"]))
+ ]
+}
diff --git a/test/support/apps/phx1_6/assets/vendor/topbar.js b/test/support/apps/phx1_7/assets/vendor/topbar.js
similarity index 83%
rename from test/support/apps/phx1_6/assets/vendor/topbar.js
rename to test/support/apps/phx1_7/assets/vendor/topbar.js
index 1f622097..41957274 100644
--- a/test/support/apps/phx1_6/assets/vendor/topbar.js
+++ b/test/support/apps/phx1_7/assets/vendor/topbar.js
@@ -1,6 +1,6 @@
/**
* @license MIT
- * topbar 1.0.0, 2021-01-06
+ * topbar 2.0.0, 2023-02-04
* https://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/
@@ -35,10 +35,11 @@
})();
var canvas,
- progressTimerId,
- fadeTimerId,
currentProgress,
showing,
+ progressTimerId = null,
+ fadeTimerId = null,
+ delayTimerId = null,
addEvent = function (elem, type, handler) {
if (elem.addEventListener) elem.addEventListener(type, handler, false);
else if (elem.attachEvent) elem.attachEvent("on" + type, handler);
@@ -95,21 +96,26 @@
for (var key in opts)
if (options.hasOwnProperty(key)) options[key] = opts[key];
},
- show: function () {
+ show: function (delay) {
if (showing) return;
- showing = true;
- if (fadeTimerId !== null) window.cancelAnimationFrame(fadeTimerId);
- if (!canvas) createCanvas();
- canvas.style.opacity = 1;
- canvas.style.display = "block";
- topbar.progress(0);
- if (options.autoRun) {
- (function loop() {
- progressTimerId = window.requestAnimationFrame(loop);
- topbar.progress(
- "+" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2)
- );
- })();
+ if (delay) {
+ if (delayTimerId) return;
+ delayTimerId = setTimeout(() => topbar.show(), delay);
+ } else {
+ showing = true;
+ if (fadeTimerId !== null) window.cancelAnimationFrame(fadeTimerId);
+ if (!canvas) createCanvas();
+ canvas.style.opacity = 1;
+ canvas.style.display = "block";
+ topbar.progress(0);
+ if (options.autoRun) {
+ (function loop() {
+ progressTimerId = window.requestAnimationFrame(loop);
+ topbar.progress(
+ "+" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2)
+ );
+ })();
+ }
}
},
progress: function (to) {
@@ -125,6 +131,8 @@
return currentProgress;
},
hide: function () {
+ clearTimeout(delayTimerId);
+ delayTimerId = null;
if (!showing) return;
showing = false;
if (progressTimerId != null) {
diff --git a/test/support/apps/phx1_6/bin/test b/test/support/apps/phx1_7/bin/test
similarity index 61%
rename from test/support/apps/phx1_6/bin/test
rename to test/support/apps/phx1_7/bin/test
index ca065531..f376ba1d 100755
--- a/test/support/apps/phx1_6/bin/test
+++ b/test/support/apps/phx1_7/bin/test
@@ -4,30 +4,30 @@
function cleanup() {
rm -rf priv/templates
rm -rf priv/repo/migrations/*.exs
- rm -rf lib/phx1_6/blog.ex
- rm -rf lib/phx1_6/blog
- rm -rf test/phx1_6/blog_test.exs
- rm -rf lib/phx1_6_web/controllers/post_controller.ex
- rm -rf lib/phx1_6_web/templates/layout/torch.html.heex
- rm -rf lib/phx1_6_web/templates/post/
- rm -rf lib/phx1_6_web/views/post_view.ex
- rm -rf test/phx1_6_web/controllers/post_controller_test.exs
+ rm -rf lib/phx1_7/blog.ex
+ rm -rf lib/phx1_7/blog
+ rm -rf test/phx1_7/blog_test.exs
+ rm -rf lib/phx1_7_web/controllers/post_controller.ex
+ rm -rf lib/phx1_7_web/templates/layout/torch.html.heex
+ rm -rf lib/phx1_7_web/templates/post/
+ rm -rf lib/phx1_7_web/views/post_view.ex
+ rm -rf test/phx1_7_web/controllers/post_controller_test.exs
rm -rf test/support/fixtures/
- patch -i ../../patches/install-torch.patch -p 5 -R
- patch -i ../../patches/install-route.patch -p 5 -R
+ patch -i ../../patches/install-torch.diff -p 1 -R
+ patch -i ../../patches/install-route.diff -p 1 -R
}
-patch -i ../../patches/install-torch.patch -p 5
+patch -i ../../patches/install-torch.diff -p 1
mix deps.get || { cleanup; echo 'Dependencies could not be fetched!'; exit 1; }
MIX_ENV=test mix ecto.drop || { cleanup; echo 'Database could not be dropped'; exit 1; }
MIX_ENV=test mix torch.install || { cleanup; echo 'Torch could not be installed!'; exit 1; }
MIX_ENV=test mix torch.gen.html Blog Post posts title:string published:boolean published_at:datetime views:integer || { echo 'Torch files not generated!'; exit 1; }
MIX_ENV=test mix ecto.setup || { cleanup; echo 'Torch database could not be setup!'; exit 1; }
-patch -i ../../patches/install-route.patch -p 5
+patch -i ../../patches/install-route.diff -p 1
MIX_ENV=test mix test || { echo 'Tests failed!'; cleanup; exit 1; }
# Ensure that put_root_layout is used by default on > Phx 1.5
-if ! grep -q "plug(:put_root_layout" lib/phx1_6_web/controllers/post_controller.ex ; then
+if ! grep -q "plug(:put_root_layout" lib/phx1_7_web/controllers/post_controller.ex ; then
echo 'Generated Phoenix controller not using `put_root_layout` syntax'
cleanup
exit 1;
diff --git a/test/support/apps/phx1_6/config/config.exs b/test/support/apps/phx1_7/config/config.exs
similarity index 67%
rename from test/support/apps/phx1_6/config/config.exs
rename to test/support/apps/phx1_7/config/config.exs
index 3c2eed06..f58eb520 100644
--- a/test/support/apps/phx1_6/config/config.exs
+++ b/test/support/apps/phx1_7/config/config.exs
@@ -7,15 +7,18 @@
# General application configuration
import Config
-config :phx1_6,
- ecto_repos: [Phx16.Repo]
+config :phx1_7,
+ ecto_repos: [Phx17.Repo]
# Configures the endpoint
-config :phx1_6, Phx16Web.Endpoint,
+config :phx1_7, Phx17Web.Endpoint,
url: [host: "localhost"],
- render_errors: [view: Phx16Web.ErrorView, accepts: ~w(html json), layout: false],
- pubsub_server: Phx16.PubSub,
- live_view: [signing_salt: "CxuOtNXH"]
+ render_errors: [
+ formats: [html: Phx17Web.ErrorHTML, json: Phx17Web.ErrorJSON],
+ layout: false
+ ],
+ pubsub_server: Phx17.PubSub,
+ live_view: [signing_salt: "8b3KX+rn"]
# Configures the mailer
#
@@ -24,14 +27,11 @@ config :phx1_6, Phx16Web.Endpoint,
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
-config :phx1_6, Phx16.Mailer, adapter: Swoosh.Adapters.Local
-
-# Swoosh API client is needed for adapters other than SMTP.
-config :swoosh, :api_client, false
+config :phx1_7, Phx17.Mailer, adapter: Swoosh.Adapters.Local
# Configure esbuild (the version is required)
config :esbuild,
- version: "0.14.0",
+ version: "0.14.41",
default: [
args:
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
@@ -39,6 +39,18 @@ config :esbuild,
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
+# Configure tailwind (the version is required)
+config :tailwind,
+ version: "3.2.4",
+ default: [
+ args: ~w(
+ --config=tailwind.config.js
+ --input=css/app.css
+ --output=../priv/static/assets/app.css
+ ),
+ cd: Path.expand("../assets", __DIR__)
+ ]
+
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
diff --git a/test/support/apps/phx1_6/config/dev.exs b/test/support/apps/phx1_7/config/dev.exs
similarity index 76%
rename from test/support/apps/phx1_6/config/dev.exs
rename to test/support/apps/phx1_7/config/dev.exs
index 2085faaf..f74a29a8 100644
--- a/test/support/apps/phx1_6/config/dev.exs
+++ b/test/support/apps/phx1_7/config/dev.exs
@@ -1,11 +1,12 @@
import Config
# Configure your database
-config :phx1_6, Phx16.Repo,
+config :phx1_7, Phx17.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
- database: "phx1_6_dev",
+ database: "phx1_7_dev",
+ stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10
@@ -15,17 +16,17 @@ config :phx1_6, Phx16.Repo,
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with esbuild to bundle .js and .css sources.
-config :phx1_6, Phx16Web.Endpoint,
+config :phx1_7, Phx17Web.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
- secret_key_base: "etcdxK7tzvmFU74O3YmTOtoEaeLYqDqDIWJD7e5Mm0rum20bc3snNT2l4CGwExEP",
+ secret_key_base: "19IzTkNsmuimyLpuAG1foyIGCFGux/qM5o+9Po75mKTogJIXlKESYuliyjzqLDFD",
watchers: [
- # Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
- esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]}
+ esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
+ tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
]
# ## SSL Support
@@ -36,7 +37,6 @@ config :phx1_6, Phx16Web.Endpoint,
#
# mix phx.gen.cert
#
-# Note that this task requires Erlang/OTP 20 or later.
# Run `mix help phx.gen.cert` for more information.
#
# The `http:` config above can be replaced with:
@@ -53,16 +53,18 @@ config :phx1_6, Phx16Web.Endpoint,
# different ports.
# Watch static and templates for browser reloading.
-config :phx1_6, Phx16Web.Endpoint,
+config :phx1_7, Phx17Web.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
- ~r"lib/phx1_6_web/(live|views)/.*(ex)$",
- ~r"lib/phx1_6_web/templates/.*(eex)$"
+ ~r"lib/phx1_7_web/(controllers|live|components)/.*(ex|heex)$"
]
]
+# Enable dev routes for dashboard and mailbox
+config :phx1_7, dev_routes: true
+
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
@@ -72,3 +74,6 @@ config :phoenix, :stacktrace_depth, 20
# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime
+
+# Disable swoosh api client as it is only required for production adapters.
+config :swoosh, :api_client, false
diff --git a/test/support/apps/phx1_7/config/prod.exs b/test/support/apps/phx1_7/config/prod.exs
new file mode 100644
index 00000000..3cc52c79
--- /dev/null
+++ b/test/support/apps/phx1_7/config/prod.exs
@@ -0,0 +1,21 @@
+import Config
+
+# For production, don't forget to configure the url host
+# to something meaningful, Phoenix uses this information
+# when generating URLs.
+
+# Note we also include the path to a cache manifest
+# containing the digested version of static files. This
+# manifest is generated by the `mix phx.digest` task,
+# which you should run after static files are built and
+# before starting your production server.
+config :phx1_7, Phx17Web.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
+
+# Configures Swoosh API Client
+config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Phx17.Finch
+
+# Do not print debug messages in production
+config :logger, level: :info
+
+# Runtime production configuration, including reading
+# of environment variables, is done on config/runtime.exs.
diff --git a/test/support/apps/phx1_6/config/runtime.exs b/test/support/apps/phx1_7/config/runtime.exs
similarity index 58%
rename from test/support/apps/phx1_6/config/runtime.exs
rename to test/support/apps/phx1_7/config/runtime.exs
index 54af96ad..7cfe2162 100644
--- a/test/support/apps/phx1_6/config/runtime.exs
+++ b/test/support/apps/phx1_7/config/runtime.exs
@@ -7,9 +7,17 @@ import Config
# any compile-time configuration in here, as it won't be applied.
# The block below contains prod specific runtime configuration.
-# Start the phoenix server if environment is set and running in a release
-if System.get_env("PHX_SERVER") && System.get_env("RELEASE_NAME") do
- config :phx1_6, Phx16Web.Endpoint, server: true
+# ## Using releases
+#
+# If you use `mix release`, you need to explicitly enable the server
+# by passing the PHX_SERVER=true when you start it:
+#
+# PHX_SERVER=true bin/phx1_7 start
+#
+# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
+# script that automatically sets the env var above.
+if System.get_env("PHX_SERVER") do
+ config :phx1_7, Phx17Web.Endpoint, server: true
end
if config_env() == :prod do
@@ -20,9 +28,9 @@ if config_env() == :prod do
For example: ecto://USER:PASS@HOST/DATABASE
"""
- maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []
+ maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
- config :phx1_6, Phx16.Repo,
+ config :phx1_7, Phx17.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
@@ -43,8 +51,8 @@ if config_env() == :prod do
host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")
- config :phx1_6, Phx16Web.Endpoint,
- url: [host: host, port: 443],
+ config :phx1_7, Phx17Web.Endpoint,
+ url: [host: host, port: 443, scheme: "https"],
http: [
# Enable IPv6 and bind on all interfaces.
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
@@ -55,15 +63,37 @@ if config_env() == :prod do
],
secret_key_base: secret_key_base
- # ## Using releases
+ # ## SSL Support
#
- # If you are doing OTP releases, you need to instruct Phoenix
- # to start each relevant endpoint:
+ # To get SSL working, you will need to add the `https` key
+ # to your endpoint configuration:
#
- # config :phx1_6, Phx16Web.Endpoint, server: true
+ # config :phx1_7, Phx17Web.Endpoint,
+ # https: [
+ # ...,
+ # port: 443,
+ # cipher_suite: :strong,
+ # keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
+ # certfile: System.get_env("SOME_APP_SSL_CERT_PATH")
+ # ]
#
- # Then you can assemble a release by calling `mix release`.
- # See `mix help release` for more information.
+ # The `cipher_suite` is set to `:strong` to support only the
+ # latest and more secure SSL ciphers. This means old browsers
+ # and clients may not be supported. You can set it to
+ # `:compatible` for wider support.
+ #
+ # `:keyfile` and `:certfile` expect an absolute path to the key
+ # and cert in disk or a relative path inside priv, for example
+ # "priv/ssl/server.key". For all supported SSL configuration
+ # options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1
+ #
+ # We also recommend setting `force_ssl` in your endpoint, ensuring
+ # no data is ever sent via http, always redirecting to https:
+ #
+ # config :phx1_7, Phx17Web.Endpoint,
+ # force_ssl: [hsts: true]
+ #
+ # Check `Plug.SSL` for all available options in `force_ssl`.
# ## Configuring the mailer
#
@@ -71,7 +101,7 @@ if config_env() == :prod do
# Also, you may need to configure the Swoosh API client of your choice if you
# are not using SMTP. Here is an example of the configuration:
#
- # config :phx1_6, Phx16.Mailer,
+ # config :phx1_7, Phx17.Mailer,
# adapter: Swoosh.Adapters.Mailgun,
# api_key: System.get_env("MAILGUN_API_KEY"),
# domain: System.get_env("MAILGUN_DOMAIN")
diff --git a/test/support/apps/phx1_6/config/test.exs b/test/support/apps/phx1_7/config/test.exs
similarity index 54%
rename from test/support/apps/phx1_6/config/test.exs
rename to test/support/apps/phx1_7/config/test.exs
index 3a3562d0..0aa0ea3a 100644
--- a/test/support/apps/phx1_6/config/test.exs
+++ b/test/support/apps/phx1_7/config/test.exs
@@ -1,33 +1,33 @@
import Config
# Configure your database
-{whoami, _} = System.cmd("whoami", [])
-whoami = String.replace(whoami, "\n", "")
-
#
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
-config :phx1_6, Phx16.Repo,
- username: System.get_env("DATABASE_POSTGRESQL_USERNAME") || whoami,
- password: System.get_env("DATABASE_POSTGRESQL_PASSWORD") || "",
+config :phx1_7, Phx17.Repo,
+ username: "postgres",
+ password: "postgres",
hostname: "localhost",
- database: "phx1_6_test#{System.get_env("MIX_TEST_PARTITION")}",
+ database: "phx1_7_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10
# We don't run a server during test. If one is required,
# you can enable the server option below.
-config :phx1_6, Phx16Web.Endpoint,
+config :phx1_7, Phx17Web.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
- secret_key_base: "793gV450djDXzpJmfcdfZ8QcnCYMT3KksZy6/TfFq0XTkg5CyobI4GznSK5gHtee",
+ secret_key_base: "uYFVmobYDpSImRi+J3xTBoQkUKiSXLdFIKocI31psYeQna4iIaluILDsjFYa56h6",
server: false
# In test we don't send emails.
-config :phx1_6, Phx16.Mailer, adapter: Swoosh.Adapters.Test
+config :phx1_7, Phx17.Mailer, adapter: Swoosh.Adapters.Test
+
+# Disable swoosh api client as it is only required for production adapters.
+config :swoosh, :api_client, false
# Print only warnings and errors during test
-config :logger, level: :warn
+config :logger, level: :warning
# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime
diff --git a/test/support/apps/phx1_6/lib/phx1_6.ex b/test/support/apps/phx1_7/lib/phx1_7.ex
similarity index 71%
rename from test/support/apps/phx1_6/lib/phx1_6.ex
rename to test/support/apps/phx1_7/lib/phx1_7.ex
index d531f766..d0c89c93 100644
--- a/test/support/apps/phx1_6/lib/phx1_6.ex
+++ b/test/support/apps/phx1_7/lib/phx1_7.ex
@@ -1,6 +1,6 @@
-defmodule Phx16 do
+defmodule Phx17 do
@moduledoc """
- Phx16 keeps the contexts that define your domain
+ Phx17 keeps the contexts that define your domain
and business logic.
Contexts are also responsible for managing your data, regardless
diff --git a/test/support/apps/phx1_6/lib/phx1_6/application.ex b/test/support/apps/phx1_7/lib/phx1_7/application.ex
similarity index 62%
rename from test/support/apps/phx1_6/lib/phx1_6/application.ex
rename to test/support/apps/phx1_7/lib/phx1_7/application.ex
index ff5297df..667cb481 100644
--- a/test/support/apps/phx1_6/lib/phx1_6/application.ex
+++ b/test/support/apps/phx1_7/lib/phx1_7/application.ex
@@ -1,4 +1,4 @@
-defmodule Phx16.Application do
+defmodule Phx17.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
@@ -8,21 +8,23 @@ defmodule Phx16.Application do
@impl true
def start(_type, _args) do
children = [
- # Start the Ecto repository
- Phx16.Repo,
# Start the Telemetry supervisor
- Phx16Web.Telemetry,
+ Phx17Web.Telemetry,
+ # Start the Ecto repository
+ Phx17.Repo,
# Start the PubSub system
- {Phoenix.PubSub, name: Phx16.PubSub},
+ {Phoenix.PubSub, name: Phx17.PubSub},
+ # Start Finch
+ {Finch, name: Phx17.Finch},
# Start the Endpoint (http/https)
- Phx16Web.Endpoint
- # Start a worker by calling: Phx16.Worker.start_link(arg)
- # {Phx16.Worker, arg}
+ Phx17Web.Endpoint
+ # Start a worker by calling: Phx17.Worker.start_link(arg)
+ # {Phx17.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
- opts = [strategy: :one_for_one, name: Phx16.Supervisor]
+ opts = [strategy: :one_for_one, name: Phx17.Supervisor]
Supervisor.start_link(children, opts)
end
@@ -30,7 +32,7 @@ defmodule Phx16.Application do
# whenever the application is updated.
@impl true
def config_change(changed, _new, removed) do
- Phx16Web.Endpoint.config_change(changed, removed)
+ Phx17Web.Endpoint.config_change(changed, removed)
:ok
end
end
diff --git a/test/support/apps/phx1_7/lib/phx1_7/mailer.ex b/test/support/apps/phx1_7/lib/phx1_7/mailer.ex
new file mode 100644
index 00000000..7e847e2e
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7/mailer.ex
@@ -0,0 +1,3 @@
+defmodule Phx17.Mailer do
+ use Swoosh.Mailer, otp_app: :phx1_7
+end
diff --git a/test/support/apps/phx1_6/lib/phx1_6/repo.ex b/test/support/apps/phx1_7/lib/phx1_7/repo.ex
similarity index 55%
rename from test/support/apps/phx1_6/lib/phx1_6/repo.ex
rename to test/support/apps/phx1_7/lib/phx1_7/repo.ex
index 307b0aa2..1dde45a3 100644
--- a/test/support/apps/phx1_6/lib/phx1_6/repo.ex
+++ b/test/support/apps/phx1_7/lib/phx1_7/repo.ex
@@ -1,5 +1,5 @@
-defmodule Phx16.Repo do
+defmodule Phx17.Repo do
use Ecto.Repo,
- otp_app: :phx1_6,
+ otp_app: :phx1_7,
adapter: Ecto.Adapters.Postgres
end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web.ex b/test/support/apps/phx1_7/lib/phx1_7_web.ex
new file mode 100644
index 00000000..2e0cb9c9
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web.ex
@@ -0,0 +1,113 @@
+defmodule Phx17Web do
+ @moduledoc """
+ The entrypoint for defining your web interface, such
+ as controllers, components, channels, and so on.
+
+ This can be used in your application as:
+
+ use Phx17Web, :controller
+ use Phx17Web, :html
+
+ The definitions below will be executed for every controller,
+ component, etc, so keep them short and clean, focused
+ on imports, uses and aliases.
+
+ Do NOT define functions inside the quoted expressions
+ below. Instead, define additional modules and import
+ those modules here.
+ """
+
+ def static_paths, do: ~w(assets fonts images favicon.ico robots.txt)
+
+ def router do
+ quote do
+ use Phoenix.Router, helpers: false
+
+ # Import common connection and controller functions to use in pipelines
+ import Plug.Conn
+ import Phoenix.Controller
+ import Phoenix.LiveView.Router
+ end
+ end
+
+ def channel do
+ quote do
+ use Phoenix.Channel
+ end
+ end
+
+ def controller do
+ quote do
+ use Phoenix.Controller,
+ formats: [:html, :json],
+ layouts: [html: Phx17Web.Layouts]
+
+ import Plug.Conn
+ import Phx17Web.Gettext
+
+ unquote(verified_routes())
+ end
+ end
+
+ def live_view do
+ quote do
+ use Phoenix.LiveView,
+ layout: {Phx17Web.Layouts, :app}
+
+ unquote(html_helpers())
+ end
+ end
+
+ def live_component do
+ quote do
+ use Phoenix.LiveComponent
+
+ unquote(html_helpers())
+ end
+ end
+
+ def html do
+ quote do
+ use Phoenix.Component
+
+ # Import convenience functions from controllers
+ import Phoenix.Controller,
+ only: [get_csrf_token: 0, view_module: 1, view_template: 1]
+
+ # Include general helpers for rendering HTML
+ unquote(html_helpers())
+ end
+ end
+
+ defp html_helpers do
+ quote do
+ # HTML escaping functionality
+ import Phoenix.HTML
+ # Core UI components and translation
+ import Phx17Web.CoreComponents
+ import Phx17Web.Gettext
+
+ # Shortcut for generating JS commands
+ alias Phoenix.LiveView.JS
+
+ # Routes generation with the ~p sigil
+ unquote(verified_routes())
+ end
+ end
+
+ def verified_routes do
+ quote do
+ use Phoenix.VerifiedRoutes,
+ endpoint: Phx17Web.Endpoint,
+ router: Phx17Web.Router,
+ statics: Phx17Web.static_paths()
+ end
+ end
+
+ @doc """
+ When used, dispatch to the appropriate controller/view/etc.
+ """
+ defmacro __using__(which) when is_atom(which) do
+ apply(__MODULE__, which, [])
+ end
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/components/core_components.ex b/test/support/apps/phx1_7/lib/phx1_7_web/components/core_components.ex
new file mode 100644
index 00000000..c931cd93
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/components/core_components.ex
@@ -0,0 +1,661 @@
+defmodule Phx17Web.CoreComponents do
+ @moduledoc """
+ Provides core UI components.
+
+ The components in this module use Tailwind CSS, a utility-first CSS framework.
+ See the [Tailwind CSS documentation](https://tailwindcss.com) to learn how to
+ customize the generated components in this module.
+
+ Icons are provided by [heroicons](https://heroicons.com), using the
+ [heroicons_elixir](https://github.com/mveytsman/heroicons_elixir) project.
+ """
+ use Phoenix.Component
+
+ alias Phoenix.LiveView.JS
+ import Phx17Web.Gettext
+
+ @doc """
+ Renders a modal.
+
+ ## Examples
+
+ <.modal id="confirm-modal">
+ Are you sure?
+ <:confirm>OK
+ <:cancel>Cancel
+
+
+ JS commands may be passed to the `:on_cancel` and `on_confirm` attributes
+ for the caller to react to each button press, for example:
+
+ <.modal id="confirm" on_confirm={JS.push("delete")} on_cancel={JS.navigate(~p"/posts")}>
+ Are you sure you?
+ <:confirm>OK
+ <:cancel>Cancel
+
+ """
+ attr :id, :string, required: true
+ attr :show, :boolean, default: false
+ attr :on_cancel, JS, default: %JS{}
+ attr :on_confirm, JS, default: %JS{}
+
+ slot :inner_block, required: true
+ slot :title
+ slot :subtitle
+ slot :confirm
+ slot :cancel
+
+ def modal(assigns) do
+ ~H"""
+
+
+
+
+
+ <.focus_wrap
+ id={"#{@id}-container"}
+ phx-mounted={@show && show_modal(@id)}
+ phx-window-keydown={hide_modal(@on_cancel, @id)}
+ phx-key="escape"
+ phx-click-away={hide_modal(@on_cancel, @id)}
+ class="hidden relative rounded-2xl bg-white p-14 shadow-lg shadow-zinc-700/10 ring-1 ring-zinc-700/10 transition"
+ >
+
+
+
+
+
+
+
+ <%= render_slot(@inner_block) %>
+
+ <.button
+ :for={confirm <- @confirm}
+ id={"#{@id}-confirm"}
+ phx-click={@on_confirm}
+ phx-disable-with
+ class="py-2 px-3"
+ >
+ <%= render_slot(confirm) %>
+
+ <.link
+ :for={cancel <- @cancel}
+ phx-click={hide_modal(@on_cancel, @id)}
+ class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700"
+ >
+ <%= render_slot(cancel) %>
+
+
+
+
+
+
+
+
+ """
+ end
+
+ @doc """
+ Renders flash notices.
+
+ ## Examples
+
+ <.flash kind={:info} flash={@flash} />
+ <.flash kind={:info} phx-mounted={show("#flash")}>Welcome Back!
+ """
+ attr :id, :string, default: "flash", doc: "the optional id of flash container"
+ attr :flash, :map, default: %{}, doc: "the map of flash messages to display"
+ attr :title, :string, default: nil
+ attr :kind, :atom, values: [:info, :error], doc: "used for styling and flash lookup"
+ attr :autoshow, :boolean, default: true, doc: "whether to auto show the flash on mount"
+ attr :close, :boolean, default: true, doc: "whether the flash can be closed"
+ attr :rest, :global, doc: "the arbitrary HTML attributes to add to the flash container"
+
+ slot :inner_block, doc: "the optional inner block that renders the flash message"
+
+ def flash(assigns) do
+ ~H"""
+ hide("##{@id}")}
+ role="alert"
+ class={[
+ "fixed hidden top-2 right-2 w-80 sm:w-96 z-50 rounded-lg p-3 shadow-md shadow-zinc-900/5 ring-1",
+ @kind == :info && "bg-emerald-50 text-emerald-800 ring-emerald-500 fill-cyan-900",
+ @kind == :error && "bg-rose-50 p-3 text-rose-900 shadow-md ring-rose-500 fill-rose-900"
+ ]}
+ {@rest}
+ >
+
+
+
+ <%= @title %>
+
+
<%= msg %>
+
+
+
+
+ """
+ end
+
+ @doc """
+ Shows the flash group with standard titles and content.
+
+ ## Examples
+
+ <.flash_group flash={@flash} />
+ """
+ attr :flash, :map, required: true, doc: "the map of flash messages"
+
+ def flash_group(assigns) do
+ ~H"""
+ <.flash kind={:info} title="Success!" flash={@flash} />
+ <.flash kind={:error} title="Error!" flash={@flash} />
+ <.flash
+ id="disconnected"
+ kind={:error}
+ title="We can't find the internet"
+ close={false}
+ autoshow={false}
+ phx-disconnected={show("#disconnected")}
+ phx-connected={hide("#disconnected")}
+ >
+ Attempting to reconnect
+
+ """
+ end
+
+ @doc """
+ Renders a simple form.
+
+ ## Examples
+
+ <.simple_form for={@form} phx-change="validate" phx-submit="save">
+ <.input field={@form[:email]} label="Email"/>
+ <.input field={@form[:username]} label="Username" />
+ <:actions>
+ <.button>Save
+
+
+ """
+ attr :for, :any, required: true, doc: "the datastructure for the form"
+ attr :as, :any, default: nil, doc: "the server side parameter to collect all input under"
+
+ attr :rest, :global,
+ include: ~w(autocomplete name rel action enctype method novalidate target),
+ doc: "the arbitrary HTML attributes to apply to the form tag"
+
+ slot :inner_block, required: true
+ slot :actions, doc: "the slot for form actions, such as a submit button"
+
+ def simple_form(assigns) do
+ ~H"""
+ <.form :let={f} for={@for} as={@as} {@rest}>
+
+ <%= render_slot(@inner_block, f) %>
+
+ <%= render_slot(action, f) %>
+
+
+
+ """
+ end
+
+ @doc """
+ Renders a button.
+
+ ## Examples
+
+ <.button>Send!
+ <.button phx-click="go" class="ml-2">Send!
+ """
+ attr :type, :string, default: nil
+ attr :class, :string, default: nil
+ attr :rest, :global, include: ~w(disabled form name value)
+
+ slot :inner_block, required: true
+
+ def button(assigns) do
+ ~H"""
+
+ <%= render_slot(@inner_block) %>
+
+ """
+ end
+
+ @doc """
+ Renders an input with label and error messages.
+
+ A `%Phoenix.HTML.Form{}` and field name may be passed to the input
+ to build input names and error messages, or all the attributes and
+ errors may be passed explicitly.
+
+ ## Examples
+
+ <.input field={@form[:email]} type="email" />
+ <.input name="my-input" errors={["oh no!"]} />
+ """
+ attr :id, :any, default: nil
+ attr :name, :any
+ attr :label, :string, default: nil
+ attr :value, :any
+
+ 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)
+
+ attr :field, Phoenix.HTML.FormField,
+ doc: "a form field struct retrieved from the form, for example: @form[:email]"
+
+ attr :errors, :list, default: []
+ attr :checked, :boolean, doc: "the checked flag for checkbox inputs"
+ attr :prompt, :string, default: nil, doc: "the prompt for select inputs"
+ attr :options, :list, doc: "the options to pass to Phoenix.HTML.Form.options_for_select/2"
+ attr :multiple, :boolean, default: false, doc: "the multiple flag for select inputs"
+ attr :rest, :global, include: ~w(autocomplete cols disabled form max maxlength min minlength
+ pattern placeholder readonly required rows size step)
+ slot :inner_block
+
+ def input(%{field: %Phoenix.HTML.FormField{} = field} = assigns) do
+ assigns
+ |> assign(field: nil, id: assigns.id || field.id)
+ |> assign(:errors, Enum.map(field.errors, &translate_error(&1)))
+ |> assign_new(:name, fn -> if assigns.multiple, do: field.name <> "[]", else: field.name end)
+ |> assign_new(:value, fn -> field.value end)
+ |> input()
+ end
+
+ def input(%{type: "checkbox", value: value} = assigns) do
+ assigns =
+ assign_new(assigns, :checked, fn -> Phoenix.HTML.Form.normalize_value("checkbox", value) end)
+
+ ~H"""
+
+
+
+
+ <%= @label %>
+
+ <.error :for={msg <- @errors}><%= msg %>
+
+ """
+ end
+
+ def input(%{type: "select"} = assigns) do
+ ~H"""
+
+ <.label for={@id}><%= @label %>
+
+ <%= @prompt %>
+ <%= Phoenix.HTML.Form.options_for_select(@options, @value) %>
+
+ <.error :for={msg <- @errors}><%= msg %>
+
+ """
+ end
+
+ def input(%{type: "textarea"} = assigns) do
+ ~H"""
+
+ <.label for={@id}><%= @label %>
+
+ <.error :for={msg <- @errors}><%= msg %>
+
+ """
+ end
+
+ def input(assigns) do
+ ~H"""
+
+ <.label for={@id}><%= @label %>
+
+ <.error :for={msg <- @errors}><%= msg %>
+
+ """
+ end
+
+ @doc """
+ Renders a label.
+ """
+ attr :for, :string, default: nil
+ slot :inner_block, required: true
+
+ def label(assigns) do
+ ~H"""
+
+ <%= render_slot(@inner_block) %>
+
+ """
+ end
+
+ @doc """
+ Generates a generic error message.
+ """
+ slot :inner_block, required: true
+
+ def error(assigns) do
+ ~H"""
+
+
+ <%= render_slot(@inner_block) %>
+
+ """
+ end
+
+ @doc """
+ Renders a header with title.
+ """
+ attr :class, :string, default: nil
+
+ slot :inner_block, required: true
+ slot :subtitle
+ slot :actions
+
+ def header(assigns) do
+ ~H"""
+
+ """
+ end
+
+ @doc ~S"""
+ Renders a table with generic styling.
+
+ ## Examples
+
+ <.table id="users" rows={@users}>
+ <:col :let={user} label="id"><%= user.id %>
+ <:col :let={user} label="username"><%= user.username %>
+
+ """
+ attr :id, :string, required: true
+ attr :rows, :list, required: true
+ attr :row_id, :any, default: nil, doc: "the function for generating the row id"
+ attr :row_click, :any, default: nil, doc: "the function for handling phx-click on each row"
+
+ attr :row_item, :any,
+ default: &Function.identity/1,
+ doc: "the function for mapping each row before calling the :col and :action slots"
+
+ slot :col, required: true do
+ attr :label, :string
+ end
+
+ slot :action, doc: "the slot for showing user actions in the last table column"
+
+ def table(assigns) do
+ assigns =
+ with %{rows: %Phoenix.LiveView.LiveStream{}} <- assigns do
+ assign(assigns, row_id: assigns.row_id || fn {id, _item} -> id end)
+ end
+
+ ~H"""
+
+
+
+
+ <%= col[:label] %>
+ <%= gettext("Actions") %>
+
+
+
+
+
+
+
+
+ <%= render_slot(col, @row_item.(row)) %>
+
+
+
+
+
+
+
+ <%= render_slot(action, @row_item.(row)) %>
+
+
+
+
+
+
+
+ """
+ end
+
+ @doc """
+ Renders a data list.
+
+ ## Examples
+
+ <.list>
+ <:item title="Title"><%= @post.title %>
+ <:item title="Views"><%= @post.views %>
+
+ """
+ slot :item, required: true do
+ attr :title, :string, required: true
+ end
+
+ def list(assigns) do
+ ~H"""
+
+
+
+
<%= item.title %>
+ <%= render_slot(item) %>
+
+
+
+ """
+ end
+
+ @doc """
+ Renders a back navigation link.
+
+ ## Examples
+
+ <.back navigate={~p"/posts"}>Back to posts
+ """
+ attr :navigate, :any, required: true
+ slot :inner_block, required: true
+
+ def back(assigns) do
+ ~H"""
+
+ <.link
+ navigate={@navigate}
+ class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700"
+ >
+
+ <%= render_slot(@inner_block) %>
+
+
+ """
+ end
+
+ ## JS Commands
+
+ def show(js \\ %JS{}, selector) do
+ JS.show(js,
+ to: selector,
+ transition:
+ {"transition-all transform ease-out duration-300",
+ "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
+ "opacity-100 translate-y-0 sm:scale-100"}
+ )
+ end
+
+ def hide(js \\ %JS{}, selector) do
+ JS.hide(js,
+ to: selector,
+ time: 200,
+ transition:
+ {"transition-all transform ease-in duration-200",
+ "opacity-100 translate-y-0 sm:scale-100",
+ "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}
+ )
+ end
+
+ def show_modal(js \\ %JS{}, id) when is_binary(id) do
+ js
+ |> JS.show(to: "##{id}")
+ |> JS.show(
+ to: "##{id}-bg",
+ transition: {"transition-all transform ease-out duration-300", "opacity-0", "opacity-100"}
+ )
+ |> show("##{id}-container")
+ |> JS.add_class("overflow-hidden", to: "body")
+ |> JS.focus_first(to: "##{id}-content")
+ end
+
+ def hide_modal(js \\ %JS{}, id) do
+ js
+ |> JS.hide(
+ to: "##{id}-bg",
+ transition: {"transition-all transform ease-in duration-200", "opacity-100", "opacity-0"}
+ )
+ |> hide("##{id}-container")
+ |> JS.hide(to: "##{id}", transition: {"block", "block", "hidden"})
+ |> JS.remove_class("overflow-hidden", to: "body")
+ |> JS.pop_focus()
+ end
+
+ @doc """
+ Translates an error message using gettext.
+ """
+ def translate_error({msg, opts}) do
+ # When using gettext, we typically pass the strings we want
+ # to translate as a static argument:
+ #
+ # # Translate "is invalid" in the "errors" domain
+ # dgettext("errors", "is invalid")
+ #
+ # # Translate the number of files with plural rules
+ # dngettext("errors", "1 file", "%{count} files", count)
+ #
+ # Because the error messages we show in our forms and APIs
+ # are defined inside Ecto, we need to translate them dynamically.
+ # This requires us to call the Gettext module passing our gettext
+ # backend as first argument.
+ #
+ # Note we use the "errors" domain, which means translations
+ # should be written to the errors.po file. The :count option is
+ # set by Ecto and indicates we should also apply plural rules.
+ if count = opts[:count] do
+ Gettext.dngettext(Phx17Web.Gettext, "errors", msg, msg, count, opts)
+ else
+ Gettext.dgettext(Phx17Web.Gettext, "errors", msg, opts)
+ end
+ end
+
+ @doc """
+ Translates the errors for a field from a keyword list of errors.
+ """
+ def translate_errors(errors, field) when is_list(errors) do
+ for {^field, {msg, opts}} <- errors, do: translate_error({msg, opts})
+ end
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts.ex b/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts.ex
new file mode 100644
index 00000000..d30b9f3c
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts.ex
@@ -0,0 +1,5 @@
+defmodule Phx17Web.Layouts do
+ use Phx17Web, :html
+
+ embed_templates "layouts/*"
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts/app.html.heex b/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts/app.html.heex
new file mode 100644
index 00000000..aa3878d0
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts/app.html.heex
@@ -0,0 +1,43 @@
+
+
+
+ <.flash_group flash={@flash} />
+ <%= @inner_content %>
+
+
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts/root.html.heex b/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts/root.html.heex
new file mode 100644
index 00000000..76a7851a
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/components/layouts/root.html.heex
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ <.live_title suffix=" ยท Phoenix Framework">
+ <%= assigns[:page_title] || "Phx17" %>
+
+
+
+
+
+ <%= @inner_content %>
+
+
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/controllers/error_html.ex b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/error_html.ex
new file mode 100644
index 00000000..c20b979a
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/error_html.ex
@@ -0,0 +1,19 @@
+defmodule Phx17Web.ErrorHTML do
+ use Phx17Web, :html
+
+ # If you want to customize your error pages,
+ # uncomment the embed_templates/1 call below
+ # and add pages to the error directory:
+ #
+ # * lib/phx1_7_web/controllers/error_html/404.html.heex
+ # * lib/phx1_7_web/controllers/error_html/500.html.heex
+ #
+ # embed_templates "error_html/*"
+
+ # The default is to render a plain text page based on
+ # the template name. For example, "404.html" becomes
+ # "Not Found".
+ def render(template, _assigns) do
+ Phoenix.Controller.status_message_from_template(template)
+ end
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/controllers/error_json.ex b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/error_json.ex
new file mode 100644
index 00000000..b6b036f2
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/error_json.ex
@@ -0,0 +1,15 @@
+defmodule Phx17Web.ErrorJSON do
+ # If you want to customize a particular status code,
+ # you may add your own clauses, such as:
+ #
+ # def render("500.json", _assigns) do
+ # %{errors: %{detail: "Internal Server Error"}}
+ # end
+
+ # By default, Phoenix returns the status message from
+ # the template name. For example, "404.json" becomes
+ # "Not Found".
+ def render(template, _assigns) do
+ %{errors: %{detail: Phoenix.Controller.status_message_from_template(template)}}
+ end
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_controller.ex b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_controller.ex
new file mode 100644
index 00000000..ac448d3f
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_controller.ex
@@ -0,0 +1,9 @@
+defmodule Phx17Web.PageController do
+ use Phx17Web, :controller
+
+ def home(conn, _params) do
+ # The home page is often custom made,
+ # so skip the default app layout.
+ render(conn, :home, layout: false)
+ end
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_html.ex b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_html.ex
new file mode 100644
index 00000000..44a456b8
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_html.ex
@@ -0,0 +1,5 @@
+defmodule Phx17Web.PageHTML do
+ use Phx17Web, :html
+
+ embed_templates "page_html/*"
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_html/home.html.heex b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_html/home.html.heex
new file mode 100644
index 00000000..6a7480de
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/controllers/page_html/home.html.heex
@@ -0,0 +1,237 @@
+<.flash_group flash={@flash} />
+
+
+
+
+
+
+
+ Phoenix Framework
+
+ v1.7
+
+
+
+ Peace of mind from prototype to production.
+
+
+ Build rich, interactive web applications quickly, with less code and fewer moving parts. Join our growing community of developers using Phoenix to craft APIs, HTML5 apps and more, for fun or at scale.
+
+
+
+
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex b/test/support/apps/phx1_7/lib/phx1_7_web/endpoint.ex
similarity index 70%
rename from test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex
rename to test/support/apps/phx1_7/lib/phx1_7_web/endpoint.ex
index b862727c..622d5e15 100644
--- a/test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/endpoint.ex
@@ -1,16 +1,17 @@
-defmodule Phx16Web.Endpoint do
- use Phoenix.Endpoint, otp_app: :phx1_6
+defmodule Phx17Web.Endpoint do
+ use Phoenix.Endpoint, otp_app: :phx1_7
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
@session_options [
store: :cookie,
- key: "_phx1_6_key",
- signing_salt: "pnlOLKtY"
+ key: "_phx1_7_key",
+ signing_salt: "3jDgYIOc",
+ same_site: "Lax"
]
- socket("/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]])
+ socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]
# Serve at "/" the static files from "priv/static" directory.
#
@@ -18,17 +19,17 @@ defmodule Phx16Web.Endpoint do
# when deploying your static files in production.
plug Plug.Static,
at: "/",
- from: :phx1_6,
+ from: :phx1_7,
gzip: false,
- only: ~w(assets fonts images favicon.ico robots.txt)
+ only: Phx17Web.static_paths()
# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
if code_reloading? do
- socket("/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket)
+ socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
plug Phoenix.LiveReloader
plug Phoenix.CodeReloader
- plug Phoenix.Ecto.CheckRepoStatus, otp_app: :phx1_6
+ plug Phoenix.Ecto.CheckRepoStatus, otp_app: :phx1_7
end
plug Phoenix.LiveDashboard.RequestLogger,
@@ -46,5 +47,5 @@ defmodule Phx16Web.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
- plug Phx16Web.Router
+ plug Phx17Web.Router
end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/gettext.ex b/test/support/apps/phx1_7/lib/phx1_7_web/gettext.ex
similarity index 86%
rename from test/support/apps/phx1_6/lib/phx1_6_web/gettext.ex
rename to test/support/apps/phx1_7/lib/phx1_7_web/gettext.ex
index 1f6af9f0..f0dc8f39 100644
--- a/test/support/apps/phx1_6/lib/phx1_6_web/gettext.ex
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/gettext.ex
@@ -1,11 +1,11 @@
-defmodule Phx16Web.Gettext do
+defmodule Phx17Web.Gettext do
@moduledoc """
A module providing Internationalization with a gettext-based API.
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:
- import Phx16Web.Gettext
+ import Phx17Web.Gettext
# Simple translation
gettext("Here is the string to translate")
@@ -20,5 +20,5 @@ defmodule Phx16Web.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
- use Gettext, otp_app: :phx1_6
+ use Gettext, otp_app: :phx1_7
end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/router.ex b/test/support/apps/phx1_7/lib/phx1_7_web/router.ex
new file mode 100644
index 00000000..437a6d37
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/router.ex
@@ -0,0 +1,44 @@
+defmodule Phx17Web.Router do
+ use Phx17Web, :router
+
+ pipeline :browser do
+ plug :accepts, ["html"]
+ plug :fetch_session
+ plug :fetch_live_flash
+ plug :put_root_layout, {Phx17Web.Layouts, :root}
+ plug :protect_from_forgery
+ plug :put_secure_browser_headers
+ end
+
+ pipeline :api do
+ plug :accepts, ["json"]
+ end
+
+ scope "/", Phx17Web do
+ pipe_through :browser
+
+ get "/", PageController, :home
+ end
+
+ # Other scopes may use custom stacks.
+ # scope "/api", Phx17Web do
+ # pipe_through :api
+ # end
+
+ # Enable LiveDashboard and Swoosh mailbox preview in development
+ if Application.compile_env(:phx1_7, :dev_routes) do
+ # If you want to use the LiveDashboard in production, you should put
+ # it behind authentication and allow only admins to access it.
+ # If your application does not have an admins-only section yet,
+ # you can use Plug.BasicAuth to set up some basic authentication
+ # as long as you are also using SSL (which you should anyway).
+ import Phoenix.LiveDashboard.Router
+
+ scope "/dev" do
+ pipe_through :browser
+
+ live_dashboard "/dashboard", metrics: Phx17Web.Telemetry
+ forward "/mailbox", Plug.Swoosh.MailboxPreview
+ end
+ end
+end
diff --git a/test/support/apps/phx1_7/lib/phx1_7_web/router.ex.orig b/test/support/apps/phx1_7/lib/phx1_7_web/router.ex.orig
new file mode 100644
index 00000000..437a6d37
--- /dev/null
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/router.ex.orig
@@ -0,0 +1,44 @@
+defmodule Phx17Web.Router do
+ use Phx17Web, :router
+
+ pipeline :browser do
+ plug :accepts, ["html"]
+ plug :fetch_session
+ plug :fetch_live_flash
+ plug :put_root_layout, {Phx17Web.Layouts, :root}
+ plug :protect_from_forgery
+ plug :put_secure_browser_headers
+ end
+
+ pipeline :api do
+ plug :accepts, ["json"]
+ end
+
+ scope "/", Phx17Web do
+ pipe_through :browser
+
+ get "/", PageController, :home
+ end
+
+ # Other scopes may use custom stacks.
+ # scope "/api", Phx17Web do
+ # pipe_through :api
+ # end
+
+ # Enable LiveDashboard and Swoosh mailbox preview in development
+ if Application.compile_env(:phx1_7, :dev_routes) do
+ # If you want to use the LiveDashboard in production, you should put
+ # it behind authentication and allow only admins to access it.
+ # If your application does not have an admins-only section yet,
+ # you can use Plug.BasicAuth to set up some basic authentication
+ # as long as you are also using SSL (which you should anyway).
+ import Phoenix.LiveDashboard.Router
+
+ scope "/dev" do
+ pipe_through :browser
+
+ live_dashboard "/dashboard", metrics: Phx17Web.Telemetry
+ forward "/mailbox", Plug.Swoosh.MailboxPreview
+ end
+ end
+end
diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/telemetry.ex b/test/support/apps/phx1_7/lib/phx1_7_web/telemetry.ex
similarity index 66%
rename from test/support/apps/phx1_6/lib/phx1_6_web/telemetry.ex
rename to test/support/apps/phx1_7/lib/phx1_7_web/telemetry.ex
index be4c38e5..42ee40d7 100644
--- a/test/support/apps/phx1_6/lib/phx1_6_web/telemetry.ex
+++ b/test/support/apps/phx1_7/lib/phx1_7_web/telemetry.ex
@@ -1,4 +1,4 @@
-defmodule Phx16Web.Telemetry do
+defmodule Phx17Web.Telemetry do
use Supervisor
import Telemetry.Metrics
@@ -22,32 +22,53 @@ defmodule Phx16Web.Telemetry do
def metrics do
[
# Phoenix Metrics
+ summary("phoenix.endpoint.start.system_time",
+ unit: {:native, :millisecond}
+ ),
summary("phoenix.endpoint.stop.duration",
unit: {:native, :millisecond}
),
+ summary("phoenix.router_dispatch.start.system_time",
+ tags: [:route],
+ unit: {:native, :millisecond}
+ ),
+ summary("phoenix.router_dispatch.exception.duration",
+ tags: [:route],
+ unit: {:native, :millisecond}
+ ),
summary("phoenix.router_dispatch.stop.duration",
tags: [:route],
unit: {:native, :millisecond}
),
+ summary("phoenix.socket_connected.duration",
+ unit: {:native, :millisecond}
+ ),
+ summary("phoenix.channel_join.duration",
+ unit: {:native, :millisecond}
+ ),
+ summary("phoenix.channel_handled_in.duration",
+ tags: [:event],
+ unit: {:native, :millisecond}
+ ),
# Database Metrics
- summary("phx1_6.repo.query.total_time",
+ summary("phx1_7.repo.query.total_time",
unit: {:native, :millisecond},
description: "The sum of the other measurements"
),
- summary("phx1_6.repo.query.decode_time",
+ summary("phx1_7.repo.query.decode_time",
unit: {:native, :millisecond},
description: "The time spent decoding the data received from the database"
),
- summary("phx1_6.repo.query.query_time",
+ summary("phx1_7.repo.query.query_time",
unit: {:native, :millisecond},
description: "The time spent executing the query"
),
- summary("phx1_6.repo.query.queue_time",
+ summary("phx1_7.repo.query.queue_time",
unit: {:native, :millisecond},
description: "The time spent waiting for a database connection"
),
- summary("phx1_6.repo.query.idle_time",
+ summary("phx1_7.repo.query.idle_time",
unit: {:native, :millisecond},
description:
"The time the connection spent waiting before being checked out for the query"
@@ -65,7 +86,7 @@ defmodule Phx16Web.Telemetry do
[
# A module, function and arguments to be invoked periodically.
# This function must call :telemetry.execute/3 and a metric must be added above.
- # {Phx16Web, :count_users, []}
+ # {Phx17Web, :count_users, []}
]
end
end
diff --git a/test/support/apps/phx1_6/mix.exs b/test/support/apps/phx1_7/mix.exs
similarity index 65%
rename from test/support/apps/phx1_6/mix.exs
rename to test/support/apps/phx1_7/mix.exs
index 6cd94040..34ce7214 100644
--- a/test/support/apps/phx1_6/mix.exs
+++ b/test/support/apps/phx1_7/mix.exs
@@ -1,13 +1,12 @@
-defmodule Phx16.MixProject do
+defmodule Phx17.MixProject do
use Mix.Project
def project do
[
- app: :phx1_6,
+ app: :phx1_7,
version: "0.1.0",
- elixir: "~> 1.12",
+ elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
- compilers: [:gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
@@ -19,7 +18,7 @@ defmodule Phx16.MixProject do
# Type `mix help compile.app` for more information.
def application do
[
- mod: {Phx16.Application, []},
+ mod: {Phx17.Application, []},
extra_applications: [:logger, :runtime_tools]
]
end
@@ -33,20 +32,23 @@ defmodule Phx16.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
- {:phoenix, "~> 1.6.6"},
+ {:phoenix, "~> 1.7.0"},
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
- {:phoenix_html, "~> 3.0"},
+ {:phoenix_html, "~> 3.3"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
- {:phoenix_live_view, "~> 0.17.5"},
+ {:phoenix_live_view, "~> 0.18.16"},
+ {:heroicons, "~> 0.5"},
{:floki, ">= 0.30.0", only: :test},
- {:phoenix_live_dashboard, "~> 0.6"},
- {:esbuild, "~> 0.3", runtime: Mix.env() == :dev},
+ {:phoenix_live_dashboard, "~> 0.7.2"},
+ {:esbuild, "~> 0.5", runtime: Mix.env() == :dev},
+ {:tailwind, "~> 0.1.8", runtime: Mix.env() == :dev},
{:swoosh, "~> 1.3"},
+ {:finch, "~> 0.13"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
- {:gettext, "~> 0.18"},
+ {:gettext, "~> 0.20"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"}
]
@@ -60,11 +62,13 @@ defmodule Phx16.MixProject do
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
- setup: ["deps.get", "ecto.setup"],
+ setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
- "assets.deploy": ["esbuild default --minify", "phx.digest"]
+ "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
+ "assets.build": ["tailwind default", "esbuild default"],
+ "assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
]
end
end
diff --git a/test/support/apps/phx1_7/mix.lock b/test/support/apps/phx1_7/mix.lock
new file mode 100644
index 00000000..d4ef6bf6
--- /dev/null
+++ b/test/support/apps/phx1_7/mix.lock
@@ -0,0 +1,59 @@
+%{
+ "castore": {:hex, :castore, "0.1.22", "4127549e411bedd012ca3a308dede574f43819fe9394254ca55ab4895abfa1a2", [:mix], [], "hexpm", "c17576df47eb5aa1ee40cc4134316a99f5cad3e215d5c77b8dd3cfef12a22cac"},
+ "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
+ "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
+ "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
+ "cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
+ "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
+ "cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
+ "db_connection": {:hex, :db_connection, "2.4.3", "3b9aac9f27347ec65b271847e6baeb4443d8474289bd18c1d6f4de655b70c94d", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c127c15b0fa6cfb32eed07465e05da6c815b032508d4ed7c116122871df73c12"},
+ "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
+ "ecto": {:hex, :ecto, "3.9.4", "3ee68e25dbe0c36f980f1ba5dd41ee0d3eb0873bccae8aeaf1a2647242bffa35", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "de5f988c142a3aa4ec18b85a4ec34a2390b65b24f02385c1144252ff6ff8ee75"},
+ "ecto_sql": {:hex, :ecto_sql, "3.9.2", "34227501abe92dba10d9c3495ab6770e75e79b836d114c41108a4bf2ce200ad5", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.9.2", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1eb5eeb4358fdbcd42eac11c1fbd87e3affd7904e639d77903c1358b2abd3f70"},
+ "esbuild": {:hex, :esbuild, "0.6.1", "a774bfa7b4512a1211bf15880b462be12a4c48ed753a170c68c63b2c95888150", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "569f7409fb5a932211573fc20e2a930a0d5cf3377c5b4f6506c651b1783a1678"},
+ "expo": {:hex, :expo, "0.4.0", "bbe4bf455e2eb2ebd2f1e7d83530ce50fb9990eb88fc47855c515bfdf1c6626f", [:mix], [], "hexpm", "a8ed1683ec8b7c7fa53fd7a41b2c6935f539168a6bb0616d7fd6b58a36f3abf2"},
+ "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
+ "filtrex": {:hex, :filtrex, "0.4.3", "d59e496d385b19df7e3a613ad74deca4ac5ef1666352e9e435e8442fc9ae4c70", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "a374999d00174c3a6c617def9c9d199a2bc5928d49a227d1de622ccbadbff1d0"},
+ "finch": {:hex, :finch, "0.14.0", "619bfdee18fc135190bf590356c4bf5d5f71f916adb12aec94caa3fa9267a4bc", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5459acaf18c4fdb47a8c22fb3baff5d8173106217c8e56c5ba0b93e66501a8dd"},
+ "floki": {:hex, :floki, "0.34.2", "5fad07ef153b3b8ec110b6b155ec3780c4b2c4906297d0b4be1a7162d04a7e02", [:mix], [], "hexpm", "26b9d50f0f01796bc6be611ca815c5e0de034d2128e39cc9702eee6b66a4d1c8"},
+ "gettext": {:hex, :gettext, "0.22.1", "e7942988383c3d9eed4bdc22fc63e712b655ae94a672a27e4900e3d4a2c43581", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "ad105b8dab668ee3f90c0d3d94ba75e9aead27a62495c101d94f2657a190ac5d"},
+ "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
+ "heroicons": {:hex, :heroicons, "0.5.2", "a7ae72460ecc4b74a4ba9e72f0b5ac3c6897ad08968258597da11c2b0b210683", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.2", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "7ef96f455c1c136c335f1da0f1d7b12c34002c80a224ad96fc0ebf841a6ffef5"},
+ "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
+ "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
+ "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
+ "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
+ "mime": {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"},
+ "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
+ "mint": {:hex, :mint, "1.4.2", "50330223429a6e1260b2ca5415f69b0ab086141bc76dc2fbf34d7c389a6675b2", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "ce75a5bbcc59b4d7d8d70f8b2fc284b1751ffb35c7b6a6302b5192f8ab4ddd80"},
+ "nimble_options": {:hex, :nimble_options, "0.5.2", "42703307b924880f8c08d97719da7472673391905f528259915782bb346e0a1b", [:mix], [], "hexpm", "4da7f904b915fd71db549bcdc25f8d56f378ef7ae07dc1d372cbe72ba950dce0"},
+ "nimble_pool": {:hex, :nimble_pool, "0.2.6", "91f2f4c357da4c4a0a548286c84a3a28004f68f05609b4534526871a22053cde", [:mix], [], "hexpm", "1c715055095d3f2705c4e236c18b618420a35490da94149ff8b580a2144f653f"},
+ "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
+ "phoenix": {:hex, :phoenix, "1.7.0", "cbed113bdc203e2ced75859011fe7e71eeebb6259cefa54de810d9c7048b5e22", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.4", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "8526139d4bd79ec97c5c3c8e69f6cd663597f782756cec874ba7da5429c93e34"},
+ "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
+ "phoenix_html": {:hex, :phoenix_html, "3.3.1", "4788757e804a30baac6b3fc9695bf5562465dd3f1da8eb8460ad5b404d9a2178", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "bed1906edd4906a15fd7b412b85b05e521e1f67c9a85418c55999277e553d0d3"},
+ "phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.7.2", "97cc4ff2dba1ebe504db72cb45098cb8e91f11160528b980bd282cc45c73b29c", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "0e5fdf063c7a3b620c566a30fcf68b7ee02e5e46fe48ee46a6ec3ba382dc05b7"},
+ "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"},
+ "phoenix_live_view": {:hex, :phoenix_live_view, "0.18.16", "781c6a3ac49e0451ca403848b40807171caea400896fe8ed8e5ddd6106ad5580", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "09e6ae2babe62f74bfcd1e3cac1a9b0e2c262557cc566300a843425c9cb6842a"},
+ "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
+ "phoenix_template": {:hex, :phoenix_template, "1.0.1", "85f79e3ad1b0180abb43f9725973e3b8c2c3354a87245f91431eec60553ed3ef", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "157dc078f6226334c91cb32c1865bf3911686f8bcd6bcff86736f6253e6993ee"},
+ "phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"},
+ "plug": {:hex, :plug, "1.14.0", "ba4f558468f69cbd9f6b356d25443d0b796fbdc887e03fa89001384a9cac638f", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bf020432c7d4feb7b3af16a0c2701455cbbbb95e5b6866132cb09eb0c29adc14"},
+ "plug_cowboy": {:hex, :plug_cowboy, "2.6.0", "d1cf12ff96a1ca4f52207c5271a6c351a4733f413803488d75b70ccf44aebec2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "073cf20b753ce6682ed72905cd62a2d4bd9bad1bf9f7feb02a1b8e525bd94fa6"},
+ "plug_crypto": {:hex, :plug_crypto, "1.2.3", "8f77d13aeb32bfd9e654cb68f0af517b371fb34c56c9f2b58fe3df1235c1251a", [:mix], [], "hexpm", "b5672099c6ad5c202c45f5a403f21a3411247f164e4a8fab056e5cd8a290f4a2"},
+ "postgrex": {:hex, :postgrex, "0.16.5", "fcc4035cc90e23933c5d69a9cd686e329469446ef7abba2cf70f08e2c4b69810", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "edead639dc6e882618c01d8fc891214c481ab9a3788dfe38dd5e37fd1d5fb2e8"},
+ "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
+ "scrivener": {:hex, :scrivener, "2.7.2", "1d913c965ec352650a7f864ad7fd8d80462f76a32f33d57d1e48bc5e9d40aba2", [:mix], [], "hexpm", "7866a0ec4d40274efbee1db8bead13a995ea4926ecd8203345af8f90d2b620d9"},
+ "scrivener_ecto": {:hex, :scrivener_ecto, "2.7.0", "cf64b8cb8a96cd131cdbcecf64e7fd395e21aaa1cb0236c42a7c2e34b0dca580", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:scrivener, "~> 2.4", [hex: :scrivener, repo: "hexpm", optional: false]}], "hexpm", "e809f171687806b0031129034352f5ae44849720c48dd839200adeaf0ac3e260"},
+ "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
+ "swoosh": {:hex, :swoosh, "1.9.1", "0a5d7bf9954eb41d7e55525bc0940379982b090abbaef67cd8e1fd2ed7f8ca1a", [:mix], [{: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]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "76dffff3ffcab80f249d5937a592eaef7cc49ac6f4cdd27e622868326ed6371e"},
+ "tailwind": {:hex, :tailwind, "0.1.10", "21ed80ae1f411f747ee513470578acaaa1d0eb40170005350c5b0b6d07e2d624", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "e0fc474dfa8ed7a4573851ac69c5fd3ca70fbb0a5bada574d1d657ebc6f2f1f1"},
+ "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
+ "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"},
+ "telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"},
+ "timex": {:hex, :timex, "3.7.9", "790cdfc4acfce434e442f98c02ea6d84d0239073bfd668968f82ac63e9a6788d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.1", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "64691582e5bb87130f721fc709acfb70f24405833998fabf35be968984860ce1"},
+ "tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"},
+ "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
+ "websock": {:hex, :websock, "0.4.3", "184ac396bdcd3dfceb5b74c17d221af659dd559a95b1b92041ecb51c9b728093", [:mix], [], "hexpm", "5e4dd85f305f43fd3d3e25d70bec4a45228dfed60f0f3b072d8eddff335539cf"},
+ "websock_adapter": {:hex, :websock_adapter, "0.4.5", "30038a3715067f51a9580562c05a3a8d501126030336ffc6edb53bf57d6d2d26", [:mix], [{:bandit, "~> 0.6", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.4", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "1d9812dc7e703c205049426fd4fe0852a247a825f91b099e53dc96f68bafe4c8"},
+}
diff --git a/test/support/apps/phx1_6/priv/gettext/en/LC_MESSAGES/errors.po b/test/support/apps/phx1_7/priv/gettext/en/LC_MESSAGES/errors.po
similarity index 100%
rename from test/support/apps/phx1_6/priv/gettext/en/LC_MESSAGES/errors.po
rename to test/support/apps/phx1_7/priv/gettext/en/LC_MESSAGES/errors.po
diff --git a/test/support/apps/phx1_6/priv/gettext/errors.pot b/test/support/apps/phx1_7/priv/gettext/errors.pot
similarity index 86%
rename from test/support/apps/phx1_6/priv/gettext/errors.pot
rename to test/support/apps/phx1_7/priv/gettext/errors.pot
index 39a220be..ccf5c687 100644
--- a/test/support/apps/phx1_6/priv/gettext/errors.pot
+++ b/test/support/apps/phx1_7/priv/gettext/errors.pot
@@ -48,13 +48,23 @@ msgid "are still associated with this entry"
msgstr ""
## From Ecto.Changeset.validate_length/3
+msgid "should have %{count} item(s)"
+msgid_plural "should have %{count} item(s)"
+msgstr[0] ""
+msgstr[1] ""
+
msgid "should be %{count} character(s)"
msgid_plural "should be %{count} character(s)"
msgstr[0] ""
msgstr[1] ""
-msgid "should have %{count} item(s)"
-msgid_plural "should have %{count} item(s)"
+msgid "should be %{count} byte(s)"
+msgid_plural "should be %{count} byte(s)"
+msgstr[0] ""
+msgstr[1] ""
+
+msgid "should have at least %{count} item(s)"
+msgid_plural "should have at least %{count} item(s)"
msgstr[0] ""
msgstr[1] ""
@@ -63,8 +73,13 @@ msgid_plural "should be at least %{count} character(s)"
msgstr[0] ""
msgstr[1] ""
-msgid "should have at least %{count} item(s)"
-msgid_plural "should have at least %{count} item(s)"
+msgid "should be at least %{count} byte(s)"
+msgid_plural "should be at least %{count} byte(s)"
+msgstr[0] ""
+msgstr[1] ""
+
+msgid "should have at most %{count} item(s)"
+msgid_plural "should have at most %{count} item(s)"
msgstr[0] ""
msgstr[1] ""
@@ -73,8 +88,8 @@ msgid_plural "should be at most %{count} character(s)"
msgstr[0] ""
msgstr[1] ""
-msgid "should have at most %{count} item(s)"
-msgid_plural "should have at most %{count} item(s)"
+msgid "should be at most %{count} byte(s)"
+msgid_plural "should be at most %{count} byte(s)"
msgstr[0] ""
msgstr[1] ""
diff --git a/test/support/apps/phx1_6/priv/repo/migrations/.formatter.exs b/test/support/apps/phx1_7/priv/repo/migrations/.formatter.exs
similarity index 100%
rename from test/support/apps/phx1_6/priv/repo/migrations/.formatter.exs
rename to test/support/apps/phx1_7/priv/repo/migrations/.formatter.exs
diff --git a/test/support/apps/phx1_6/priv/repo/seeds.exs b/test/support/apps/phx1_7/priv/repo/seeds.exs
similarity index 86%
rename from test/support/apps/phx1_6/priv/repo/seeds.exs
rename to test/support/apps/phx1_7/priv/repo/seeds.exs
index 1926f895..e4f596d7 100644
--- a/test/support/apps/phx1_6/priv/repo/seeds.exs
+++ b/test/support/apps/phx1_7/priv/repo/seeds.exs
@@ -5,7 +5,7 @@
# Inside the script, you can read and write to any of your
# repositories directly:
#
-# Phx16.Repo.insert!(%Phx16.SomeSchema{})
+# Phx17.Repo.insert!(%Phx17.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
diff --git a/test/support/apps/phx1_6/priv/static/favicon.ico b/test/support/apps/phx1_7/priv/static/favicon.ico
similarity index 100%
rename from test/support/apps/phx1_6/priv/static/favicon.ico
rename to test/support/apps/phx1_7/priv/static/favicon.ico
diff --git a/test/support/apps/phx1_6/priv/static/robots.txt b/test/support/apps/phx1_7/priv/static/robots.txt
similarity index 100%
rename from test/support/apps/phx1_6/priv/static/robots.txt
rename to test/support/apps/phx1_7/priv/static/robots.txt
diff --git a/test/support/apps/phx1_7/test/phx1_7_web/controllers/error_html_test.exs b/test/support/apps/phx1_7/test/phx1_7_web/controllers/error_html_test.exs
new file mode 100644
index 00000000..ad0afc1b
--- /dev/null
+++ b/test/support/apps/phx1_7/test/phx1_7_web/controllers/error_html_test.exs
@@ -0,0 +1,14 @@
+defmodule Phx17Web.ErrorHTMLTest do
+ use Phx17Web.ConnCase, async: true
+
+ # Bring render_to_string/4 for testing custom views
+ import Phoenix.Template
+
+ test "renders 404.html" do
+ assert render_to_string(Phx17Web.ErrorHTML, "404", "html", []) == "Not Found"
+ end
+
+ test "renders 500.html" do
+ assert render_to_string(Phx17Web.ErrorHTML, "500", "html", []) == "Internal Server Error"
+ end
+end
diff --git a/test/support/apps/phx1_7/test/phx1_7_web/controllers/error_json_test.exs b/test/support/apps/phx1_7/test/phx1_7_web/controllers/error_json_test.exs
new file mode 100644
index 00000000..53d68fed
--- /dev/null
+++ b/test/support/apps/phx1_7/test/phx1_7_web/controllers/error_json_test.exs
@@ -0,0 +1,12 @@
+defmodule Phx17Web.ErrorJSONTest do
+ use Phx17Web.ConnCase, async: true
+
+ test "renders 404" do
+ assert Phx17Web.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
+ end
+
+ test "renders 500" do
+ assert Phx17Web.ErrorJSON.render("500.json", %{}) ==
+ %{errors: %{detail: "Internal Server Error"}}
+ end
+end
diff --git a/test/support/apps/phx1_7/test/phx1_7_web/controllers/page_controller_test.exs b/test/support/apps/phx1_7/test/phx1_7_web/controllers/page_controller_test.exs
new file mode 100644
index 00000000..a7358948
--- /dev/null
+++ b/test/support/apps/phx1_7/test/phx1_7_web/controllers/page_controller_test.exs
@@ -0,0 +1,8 @@
+defmodule Phx17Web.PageControllerTest do
+ use Phx17Web.ConnCase
+
+ test "GET /", %{conn: conn} do
+ conn = get(conn, ~p"/")
+ assert html_response(conn, 200) =~ "Peace of mind from prototype to production"
+ end
+end
diff --git a/test/support/apps/phx1_6/test/support/conn_case.ex b/test/support/apps/phx1_7/test/support/conn_case.ex
similarity index 70%
rename from test/support/apps/phx1_6/test/support/conn_case.ex
rename to test/support/apps/phx1_7/test/support/conn_case.ex
index bd0ca2af..eeee9c96 100644
--- a/test/support/apps/phx1_6/test/support/conn_case.ex
+++ b/test/support/apps/phx1_7/test/support/conn_case.ex
@@ -1,4 +1,4 @@
-defmodule Phx16Web.ConnCase do
+defmodule Phx17Web.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
@@ -11,7 +11,7 @@ defmodule Phx16Web.ConnCase do
we enable the SQL sandbox, so changes done to the database
are reverted at the end of every test. If you are using
PostgreSQL, you can even run database tests asynchronously
- by setting `use Phx16Web.ConnCase, async: true`, although
+ by setting `use Phx17Web.ConnCase, async: true`, although
this option is not recommended for other databases.
"""
@@ -19,21 +19,20 @@ defmodule Phx16Web.ConnCase do
using do
quote do
+ # The default endpoint for testing
+ @endpoint Phx17Web.Endpoint
+
+ use Phx17Web, :verified_routes
+
# Import conveniences for testing with connections
import Plug.Conn
import Phoenix.ConnTest
- import Phx16Web.ConnCase
-
- alias Phx16Web.Router.Helpers, as: Routes
-
- # The default endpoint for testing
- @endpoint Phx16Web.Endpoint
+ import Phx17Web.ConnCase
end
end
setup tags do
- pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Phx16.Repo, shared: not tags[:async])
- on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
+ Phx17.DataCase.setup_sandbox(tags)
{:ok, conn: Phoenix.ConnTest.build_conn()}
end
end
diff --git a/test/support/apps/phx1_6/test/support/data_case.ex b/test/support/apps/phx1_7/test/support/data_case.ex
similarity index 79%
rename from test/support/apps/phx1_6/test/support/data_case.ex
rename to test/support/apps/phx1_7/test/support/data_case.ex
index 8fb19d9c..6289b5da 100644
--- a/test/support/apps/phx1_6/test/support/data_case.ex
+++ b/test/support/apps/phx1_7/test/support/data_case.ex
@@ -1,4 +1,4 @@
-defmodule Phx16.DataCase do
+defmodule Phx17.DataCase do
@moduledoc """
This module defines the setup for tests requiring
access to the application's data layer.
@@ -10,7 +10,7 @@ defmodule Phx16.DataCase do
we enable the SQL sandbox, so changes done to the database
are reverted at the end of every test. If you are using
PostgreSQL, you can even run database tests asynchronously
- by setting `use Phx16.DataCase, async: true`, although
+ by setting `use Phx17.DataCase, async: true`, although
this option is not recommended for other databases.
"""
@@ -18,21 +18,28 @@ defmodule Phx16.DataCase do
using do
quote do
- alias Phx16.Repo
+ alias Phx17.Repo
import Ecto
import Ecto.Changeset
import Ecto.Query
- import Phx16.DataCase
+ import Phx17.DataCase
end
end
setup tags do
- pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Phx16.Repo, shared: not tags[:async])
- on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
+ Phx17.DataCase.setup_sandbox(tags)
:ok
end
+ @doc """
+ Sets up the sandbox based on the test tags.
+ """
+ def setup_sandbox(tags) do
+ pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Phx17.Repo, shared: not tags[:async])
+ on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
+ end
+
@doc """
A helper that transforms changeset errors into a map of messages.
diff --git a/test/support/apps/phx1_7/test/test_helper.exs b/test/support/apps/phx1_7/test/test_helper.exs
new file mode 100644
index 00000000..b6a28c3c
--- /dev/null
+++ b/test/support/apps/phx1_7/test/test_helper.exs
@@ -0,0 +1,2 @@
+ExUnit.start()
+Ecto.Adapters.SQL.Sandbox.mode(Phx17.Repo, :manual)
diff --git a/test/support/patches/install-route.diff b/test/support/patches/install-route.diff
new file mode 100644
index 00000000..ec1b1670
--- /dev/null
+++ b/test/support/patches/install-route.diff
@@ -0,0 +1,12 @@
+diff --git a/lib/phx1_7_web/router.ex b/lib/phx1_7_web/router.ex
+index 437a6d3..5625ebb 100644
+--- a/lib/phx1_7_web/router.ex
++++ b/lib/phx1_7_web/router.ex
+@@ -18,6 +18,7 @@ defmodule Phx17Web.Router do
+ pipe_through :browser
+
+ get "/", PageController, :home
++ resources "/posts", PostController
+ end
+
+ # Other scopes may use custom stacks.
diff --git a/test/support/patches/install-route.patch b/test/support/patches/install-route.patch
deleted file mode 100644
index e973c2f1..00000000
--- a/test/support/patches/install-route.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/router.ex b/test/support/apps/phx1_6/lib/phx1_6_web/router.ex
-index a508a9c..da60647 100644
---- a/test/support/apps/phx1_6/lib/phx1_6_web/router.ex
-+++ b/test/support/apps/phx1_6/lib/phx1_6_web/router.ex
-@@ -18,6 +18,7 @@ defmodule Phx16Web.Router do
- pipe_through :browser
-
- get "/", PageController, :index
-+ resources "/posts", PostController
- end
-
- # Other scopes may use custom stacks.
diff --git a/test/support/patches/install-torch.diff b/test/support/patches/install-torch.diff
new file mode 100644
index 00000000..056d7e77
--- /dev/null
+++ b/test/support/patches/install-torch.diff
@@ -0,0 +1,46 @@
+diff --git a/config/config.exs b/config/config.exs
+index f58eb52..a3022e3 100644
+--- a/config/config.exs
++++ b/config/config.exs
+@@ -59,6 +59,10 @@ config :logger, :console,
+ # Use Jason for JSON parsing in Phoenix
+ config :phoenix, :json_library, Jason
+
++config :torch,
++ otp_app: :phx1_7,
++ template_format: "heex"
++
+ # Import environment specific config. This must remain at the bottom
+ # of this file so it overrides the configuration defined above.
+ import_config "#{config_env()}.exs"
+diff --git a/lib/phx1_7_web/endpoint.ex b/lib/phx1_7_web/endpoint.ex
+index 622d5e1..804a311 100644
+--- a/lib/phx1_7_web/endpoint.ex
++++ b/lib/phx1_7_web/endpoint.ex
+@@ -23,6 +23,12 @@ defmodule Phx17Web.Endpoint do
+ gzip: false,
+ only: Phx17Web.static_paths()
+
++ plug Plug.Static,
++ at: "/torch",
++ from: {:torch, "priv/static"},
++ gzip: true,
++ cache_control_for_etags: "public, max-age=86400"
++
+ # Code reloading can be explicitly enabled under the
+ # :code_reloader configuration of your endpoint.
+ if code_reloading? do
+diff --git a/mix.exs b/mix.exs
+index 34ce721..257007a 100644
+--- a/mix.exs
++++ b/mix.exs
+@@ -50,7 +50,8 @@ defmodule Phx17.MixProject do
+ {:telemetry_poller, "~> 1.0"},
+ {:gettext, "~> 0.20"},
+ {:jason, "~> 1.2"},
+- {:plug_cowboy, "~> 2.5"}
++ {:plug_cowboy, "~> 2.5"},
++ {:torch, path: "../../../../"}
+ ]
+ end
+
diff --git a/test/support/patches/install-torch.patch b/test/support/patches/install-torch.patch
deleted file mode 100644
index 16afca24..00000000
--- a/test/support/patches/install-torch.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff --git a/test/support/apps/phx1_6/config/config.exs b/test/support/apps/phx1_6/config/config.exs
-index 3c2eed0..df7ce7c 100644
---- a/test/support/apps/phx1_6/config/config.exs
-+++ b/test/support/apps/phx1_6/config/config.exs
-@@ -47,6 +47,10 @@ config :logger, :console,
- # Use Jason for JSON parsing in Phoenix
- config :phoenix, :json_library, Jason
-
-+config :torch,
-+ otp_app: :phx1_6,
-+ template_format: "heex"
-+
- # Import environment specific config. This must remain at the bottom
- # of this file so it overrides the configuration defined above.
- import_config "#{config_env()}.exs"
-diff --git a/test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex b/test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex
-index f42c175..594a955 100644
---- a/test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex
-+++ b/test/support/apps/phx1_6/lib/phx1_6_web/endpoint.ex
-@@ -22,6 +22,14 @@ defmodule Phx16Web.Endpoint do
- gzip: false,
- only: ~w(assets fonts images favicon.ico robots.txt)
-
-+ plug(
-+ Plug.Static,
-+ at: "/torch",
-+ from: {:torch, "priv/static"},
-+ gzip: true,
-+ cache_control_for_etags: "public, max-age=86400"
-+ )
-+
- # Code reloading can be explicitly enabled under the
- # :code_reloader configuration of your endpoint.
- if code_reloading? do
-diff --git a/test/support/apps/phx1_6/mix.exs b/test/support/apps/phx1_6/mix.exs
-index 6cd9404..f24f00c 100644
---- a/test/support/apps/phx1_6/mix.exs
-+++ b/test/support/apps/phx1_6/mix.exs
-@@ -48,7 +48,8 @@ defmodule Phx16.MixProject do
- {:telemetry_poller, "~> 1.0"},
- {:gettext, "~> 0.18"},
- {:jason, "~> 1.2"},
-- {:plug_cowboy, "~> 2.5"}
-+ {:plug_cowboy, "~> 2.5"},
-+ {:torch, path: "../../../../"}
- ]
- end
-