Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Phoenix 1.6 and Elixir 1.12.3 fixes #6 #7

Merged
merged 2 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: elixir
elixir:
- 1.10
- 1.12.3
otp_release:
- 23.0
- 24.0
addons: # ensure that Travis-CI provisions a DB for our test:
postgresql: '9.5'
env:
MIX_ENV=test
script:
- mix test
# after_success:
# - bash <(curl -s https://codecov.io/bash) # send coverage report
after_success:
- bash <(curl -s https://codecov.io/bash) # send coverage report
cache:
directories:
- _build
Expand Down
10 changes: 10 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ config :phoenix, :json_library, Jason
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

# https://gist.github.com/chrismccord/2ab350f154235ad4a4d0f4de6decba7b
# Configure esbuild (the version is required)
config :esbuild,
version: "0.12.18",
default: [
args: ~w(js/app.js --bundle --target=es2016 --outdir=../priv/static/assets),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
13 changes: 12 additions & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ config :app, AppWeb.Endpoint,
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: []
watchers: [
# Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]}
]

# ## SSL Support
#
Expand Down Expand Up @@ -57,3 +60,11 @@ config :phoenix, :stacktrace_depth, 20

# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime

# Configure your database
config :app, App.Repo,
username: "postgres",
password: "postgres",
database: "app_dev",
hostname: "localhost",
pool_size: 10
4 changes: 2 additions & 2 deletions elixir_buildpack.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Elixir version
elixir_version=1.9
elixir_version=1.12.3

# Erlang version
# available versions https://github.com/HashNuke/heroku-buildpack-elixir-otp-builds/blob/master/otp-versions
erlang_version=22.1.8
erlang_version=24.0

# https://hexdocs.pm/phoenix/heroku.html#compilation-error
always_rebuild=true
2 changes: 1 addition & 1 deletion lib/app_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule AppWeb.Endpoint do
at: "/",
from: :app,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
only: ~w(assets fonts images favicon.ico robots.txt)

# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title><%= assigns[:page_title] || "App · Phoenix Framework" %></title>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<%= csrf_meta_tag() %>
</head>
<body>
Expand All @@ -14,6 +13,5 @@
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
<%= @inner_content %>
</main>
<script type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<section class="phx-hero">
<h1>Welcome to Awesome App!</h1>
<p>To get started, login to your Google Account: <p>
<p>To get started, login to your Google Account: </p>

<div style="display:flex; flex-direction:column; width:368px; margin-left:133px;">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap">

<a href="<%= @oauth_google_url %>"
<a href={@oauth_google_url}
style="display:inline-flex; align-items:center; min-height:50px;
background-color:#4285F4; font-family:'Roboto',sans-serif;
font-size:28px; color:white; text-decoration:none;
Expand All @@ -23,6 +23,6 @@
Sign in with Google
</div>
</a>
<div>
</div>

</section>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<section class="phx-hero">
<h1> Welcome <%= @profile.given_name %>!
<img width="32px" src="<%= @profile.picture %>" />
<img width="32px" src={@profile.picture} >
</h1>
<p> You are <strong>signed in</strong>
with your <strong>Google Account</strong> <br />
<strong style="color:teal;"><%= @profile.email %></strong>
<p/>
</p>
</section>
30 changes: 20 additions & 10 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ defmodule App.MixProject do
def project do
[
app: :app,
version: "1.2.0",
elixir: "~> 1.9",
version: "1.5.0",
elixir: "~> 1.12.3",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -33,16 +33,25 @@ defmodule App.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.5.3"},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_html, "~> 2.13"},
{:phoenix, "~> 1.6.0"},
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.3.0"},
{:phoenix_live_view, "~> 0.16.4"},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.5"},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:swoosh, "~> 1.3"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"},

# https://github.com/dwyl/elixir-auth-google
{:elixir_auth_google, "~> 1.3.0"}
{:elixir_auth_google, "~> 1.5.0"}
]
end

Expand All @@ -56,7 +65,8 @@ defmodule App.MixProject do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["test"]
test: ["ecto.create --quiet", "ecto.migrate", "test"],
"assets.deploy": ["esbuild default --minify", "phx.digest"]
]
end
end
Loading