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

Upgrade: elixir 1.17 otp 27 node 22 #699

Merged
merged 4 commits into from
Sep 26, 2024
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
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.14.3-otp-25
erlang 25.2.3
nodejs 19.0.0
elixir 1.17.2-otp-27
erlang 27.0.1
nodejs 22.8.0
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# - https://pkgs.org/ - resource for finding needed packages
# - Ex: hexpm/elixir:1.14.1-erlang-25.0-debian-bullseye-20210902-slim
#
ARG ELIXIR_VERSION=1.14.3
ARG OTP_VERSION=25.2.3
ARG DEBIAN_VERSION=bullseye-20230202-slim
ARG ELIXIR_VERSION=1.17.2
ARG OTP_VERSION=27.0.1
ARG DEBIAN_VERSION=bullseye-20240812-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
Expand All @@ -23,14 +23,14 @@ FROM ${BUILDER_IMAGE} as builder

# install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git nodejs npm\
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
&& apt-get clean && rm -f /var/lib/apt/lists/*_*

# prepare build dir
WORKDIR /app

# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
mix local.rebar --force

# set build ENV
ENV MIX_ENV="prod"
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ config :esbuild,
]

config :dart_sass,
version: "1.54.5",
version: "1.78.0",
default: [
args: ~w(css/app.scss ../priv/static/assets/app.css),
cd: Path.expand("../assets", __DIR__)
Expand Down
6 changes: 3 additions & 3 deletions lib/companies_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ defmodule CompaniesWeb do
def controller do
quote do
use Phoenix.Controller, namespace: CompaniesWeb
use Gettext, backend: CompaniesWeb.Gettext

import Phoenix.LiveView.Controller
import Plug.Conn
import CompaniesWeb.Gettext
import CompaniesWeb.UserHelpers
import CompaniesWeb.LocaleHelpers

Expand All @@ -42,9 +42,9 @@ defmodule CompaniesWeb do

# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
use Gettext, backend: CompaniesWeb.Gettext

import CompaniesWeb.ErrorHelpers
import CompaniesWeb.Gettext
import CompaniesWeb.SiteHelpers
import CompaniesWeb.UserHelpers
import CompaniesWeb.LocaleHelpers
Expand All @@ -66,7 +66,7 @@ defmodule CompaniesWeb do
def channel do
quote do
use Phoenix.Channel
import CompaniesWeb.Gettext
use Gettext, backend: CompaniesWeb.Gettext
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/companies_web/gettext.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule CompaniesWeb.Gettext do
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:

import CompaniesWeb.Gettext
use Gettext, backend: CompaniesWeb.Gettext

# Simple translation
gettext("Here is the string to translate")
Expand All @@ -20,5 +20,5 @@ defmodule CompaniesWeb.Gettext do

See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
use Gettext, otp_app: :companies
use Gettext.Backend, otp_app: :companies
end
2 changes: 1 addition & 1 deletion lib/companies_web/helpers/site_helpers.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule CompaniesWeb.SiteHelpers do
@moduledoc false

import CompaniesWeb.Gettext
use Gettext, backend: CompaniesWeb.Gettext

def query_params(%{query_params: %{"type" => type}}), do: [type: type]
def query_params(%{query_params: %{"approved" => approved}}), do: [approved: approved]
Expand Down
4 changes: 2 additions & 2 deletions lib/mix/tasks/test.websites.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ defmodule Mix.Tasks.Test.Websites do
Logger.info("No issues detected")

errors ->
Logger.warn("There where #{length(errors)} unreachable websites:")
Logger.warning("There where #{length(errors)} unreachable websites:")

errors
|> Enum.each(fn {company, reason} ->
last_activity = maybe_get_last_activity(company, opts)

Logger.warn(
Logger.warning(
"#{company.name} (#{company.website}, #{company.github}#{last_activity}) is unreachable because #{inspect(reason)}"
)
end)
Expand Down
9 changes: 5 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ defmodule Companies.MixProject do
[
app: :companies,
version: "0.1.0",
elixir: "~> 1.14",
elixir: "~> 1.17",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix] ++ Mix.compilers(),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [coveralls: :test, "coveralls.html": :test],
Expand Down Expand Up @@ -52,7 +52,7 @@ defmodule Companies.MixProject do
{:earmark, "~> 1.4"},
{:gettext, "~> 0.22"},
{:html_sanitize_ex, "~> 1.4"},
{:httpoison, "~> 1.6"},
{:httpoison, "~> 2.0"},
{:jason, "~> 1.1"},
{:libcluster, "~> 3.3"},
{:live_dashboard_history, "~> 0.1"},
Expand All @@ -61,6 +61,7 @@ defmodule Companies.MixProject do
{:phoenix_html, "~> 3.2", override: true},
{:phoenix_live_view, "~> 0.18"},
{:phoenix_pubsub, "~> 2.1"},
{:phoenix_view, "~> 2.0"},
{:plug_cowboy, "~> 2.6"},
{:set_locale, "~> 0.2"},
{:slugify, "~> 1.3.1"},
Expand All @@ -69,7 +70,7 @@ defmodule Companies.MixProject do
{:timex, "~> 3.6.1"},

# Dev & Test
{:credo, "~> 1.6.4", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:excoveralls, "~> 0.12", only: :test},
Expand Down
Loading
Loading