Skip to content

Commit

Permalink
update sourceror to ~> 1.0.0 (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoefmoraes committed Apr 9, 2024
1 parent ee8c2db commit cdc2591
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/mix/tasks/surface/surface.init/ex_patcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ defmodule Mix.Tasks.Surface.Init.ExPatcher do
|> Z.node()
|> Sourceror.to_string()

{{:., _, _}, _} ->
%Sourceror.Zipper{node: {:., _, _}} ->
# We can't get the range of the dot call in a qualified call like
# `foo.bar()`, so we apply the patch to the parent. We get into this
# situation when the qualified call has no arguments: the first child
Expand All @@ -344,7 +344,7 @@ defmodule Mix.Tasks.Surface.Init.ExPatcher do
# impossible to generate a patch for the child call alone.
append_child_patch(zipper, string)

last_child_zipper ->
%Sourceror.Zipper{} = last_child_zipper ->
append_child_patch(last_child_zipper, string)
end
end)
Expand Down
8 changes: 4 additions & 4 deletions lib/mix/tasks/surface/surface.init/ex_patcher_move.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ defmodule Mix.Tasks.Surface.Init.ExPatcher.Move do
def find_child(zipper, predicate) do
zipper
|> case do
{{name, _, _}, _} when name != :__block__ ->
%Sourceror.Zipper{node: {name, _, _}} when name != :__block__ ->
zipper

_ ->
%Sourceror.Zipper{} ->
Z.down(zipper)
end
|> return_match_or_move_right(predicate)
Expand Down Expand Up @@ -210,10 +210,10 @@ defmodule Mix.Tasks.Surface.Init.ExPatcher.Move do

defp normalize_opts(zipper) do
case zipper do
{[{{:__block__, _, _}, _} | _], _} ->
%Sourceror.Zipper{node: [{{:__block__, _, _}, _} | _]} ->
zipper

_ ->
%Sourceror.Zipper{} ->
Z.down(zipper)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule Mix.Tasks.Surface.Init.FilePatchers.MixExs do
:maybe_already_patched
)
|> find_code(~S|defp elixirc_paths(_), do: ["lib"]|)
|> replace(&"defp elixirc_paths(#{env}), do: #{body}\n #{&1}")
|> replace(&"defp elixirc_paths(#{env}), do: #{body}\n#{&1}")
end

def update_elixirc_paths_entry(code, env, update_fun, already_patched_text) do
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ defmodule Surface.MixProject do
{:phoenix_html, "~> 3.3.1"},
{:floki, "~> 0.25.0", only: :test},
{:phoenix_ecto, "~> 4.0", only: :test},
{:sourceror, "~> 0.11"},
{:sourceror, "~> 1.0.0"},
{:ecto, "~> 3.4.2", only: :test},
{:phx_new, "~> 1.6.11", only: :test},
{:phx_new, "~> 1.6.16", only: :test},
{:ex_doc, ">= 0.28.5", only: :docs}
]
end
Expand Down
4 changes: 2 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
"phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
"phoenix_view": {:hex, :phoenix_view, "2.0.3", "4d32c4817fce933693741deeb99ef1392619f942633dde834a5163124813aad3", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "cd34049af41be2c627df99cd4eaa71fc52a328c0c3d8e7d4aa28f880c30e7f64"},
"phx_new": {:hex, :phx_new, "1.6.11", "96d254395e28f2cea218f91477709869becae31cd02a98cd4fa96cd7f55a58ba", [:mix], [], "hexpm", "65ea5009f5ffff87cbea1ec0fcc362573d98441d8a861b6e7ec51ba7077ef154"},
"phx_new": {:hex, :phx_new, "1.6.16", "3c851936cc70b212bc408dc2a6904e763c6b5afec3252d5b70d95ddeb964cb8c", [:mix], [], "hexpm", "72a71e7409073244caee08b8caf17a81bddca65a62d1368d8716679c612deec5"},
"plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"},
"plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"},
"sourceror": {:hex, :sourceror, "0.11.2", "549ce48be666421ac60cfb7f59c8752e0d393baa0b14d06271d3f6a8c1b027ab", [:mix], [], "hexpm", "9ab659118896a36be6eec68ff7b0674cba372fc8e210b1e9dc8cf2b55bb70dfb"},
"sourceror": {:hex, :sourceror, "1.0.2", "c5e86fdc14881f797749d1fe5df017ca66727a8146e7ee3e736605a3df78f3e6", [:mix], [], "hexpm", "832335e87d0913658f129d58b2a7dc0490ddd4487b02de6d85bca0169ec2bd79"},
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
"websock_adapter": {:hex, :websock_adapter, "0.5.6", "0437fe56e093fd4ac422de33bf8fc89f7bc1416a3f2d732d8b2c8fd54792fe60", [:mix], [{:bandit, ">= 0.6.0", [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.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "e04378d26b0af627817ae84c92083b7e97aca3121196679b73c73b99d0d133ea"},
Expand Down

0 comments on commit cdc2591

Please sign in to comment.