Skip to content

Commit 63a36ee

Browse files
committed
chore(dashboard): resolve durable via Hex by default with a path-dep toggle
Replace the dynamic durable_dep/publishing?/DURABLE_PUBLISH switching with the Nx-style comment toggle: the Hex requirement {:durable, "~> 0.1.0-rc"} is the committed default and the path dep is a commented line for local co-development. mix deps.get and mix hex.publish now resolve durable from Hex with no special steps; the durable Hex entry becomes a normal committed lock entry (no churn). Drops the @durable_version attribute and the durable_dep/publishing?/publish_task? helpers.
1 parent c0c0140 commit 63a36ee

2 files changed

Lines changed: 8 additions & 22 deletions

File tree

durable_dashboard/mix.exs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ defmodule DurableDashboard.MixProject do
1818
# Versioned independently of durable.
1919
@version "0.1.0-rc"
2020

21-
# Hex requirement for durable when this package is published. In the monorepo
22-
# durable is a path dependency (see durable_dep/0); the published package must
23-
# depend on a released Hex version instead. durable and durable_dashboard
24-
# version independently, so bump this to match the durable release you target.
25-
@durable_version "~> 0.1.0-rc"
26-
2721
@elixir_requirement Keyword.fetch!(shared, :elixir)
2822
@source_url Keyword.fetch!(shared, :source_url)
2923
@homepage_url Keyword.fetch!(shared, :homepage_url)
@@ -65,7 +59,13 @@ defmodule DurableDashboard.MixProject do
6559

6660
defp deps do
6761
[
68-
{:durable, durable_dep()},
62+
# The Hex version is the committed default, so a plain `mix deps.get` and
63+
# `mix hex.publish` resolve durable from Hex with no special steps. For
64+
# monorepo co-development, comment it and uncomment the path dep below.
65+
# Bump the requirement to the durable release this dashboard targets.
66+
# (Same toggle pattern as elixir-nx/nx's torchx.)
67+
{:durable, "~> 0.1.0-rc"},
68+
# {:durable, path: "../durable"},
6969
{:phoenix_live_view, "~> 1.1"},
7070
{:phoenix, "~> 1.8"},
7171
{:jason, "~> 1.4"},
@@ -74,21 +74,6 @@ defmodule DurableDashboard.MixProject do
7474
]
7575
end
7676

77-
# Path dependency for local monorepo development; the released Hex version when
78-
# building or publishing the package. Hex refuses to publish a package with a
79-
# path dependency, so the hex.build / hex.publish tasks (or DURABLE_PUBLISH=1)
80-
# switch to the version requirement.
81-
defp durable_dep do
82-
if publishing?(), do: @durable_version, else: [path: "../durable"]
83-
end
84-
85-
defp publishing? do
86-
System.get_env("DURABLE_PUBLISH") in ~w(1 true) or publish_task?(System.argv())
87-
end
88-
89-
defp publish_task?([task | _]), do: task in ~w(hex.build hex.publish)
90-
defp publish_task?(_), do: false
91-
9277
defp aliases do
9378
[
9479
setup: ["deps.get", "assets.setup"],

durable_dashboard/mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"crontab": {:hex, :crontab, "1.2.0", "503611820257939d5d0fd272eb2b454f48a470435a809479ddc2c40bb515495c", [:mix], [{:ecto, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "ebd7ef4d831e1b20fa4700f0de0284a04cac4347e813337978e25b4cc5cc2207"},
44
"db_connection": {:hex, :db_connection, "2.9.0", "a6a97c5c958a2d7091a58a9be40caf41ab496b0701d21e1d1abff3fa27a7f371", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "17d502eacaf61829db98facf6f20808ed33da6ccf495354a41e64fe42f9c509c"},
55
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
6+
"durable": {:hex, :durable, "0.1.0-rc", "641e535081348ec56689f72b305a55add2efc43ce8bd8ef9074045be117cadef", [:mix], [{:crontab, "~> 1.1", [hex: :crontab, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.12", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:igniter, "~> 0.6", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.1", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "385faed89685d5a8f1f38ea3ce5751fa9477a1ca8fa14441b68b229f306ff6f6"},
67
"earmark_parser": {:hex, :earmark_parser, "1.4.45", "cba8369ab2a1342e419bc2760eec731b17be828941dcf494045d44766227e1d5", [:mix], [], "hexpm", "d3ec045bf122965db20c0bdb420e19ee1415843135327124918473feb4b328e8"},
78
"ecto": {:hex, :ecto, "3.13.5", "9d4a69700183f33bf97208294768e561f5c7f1ecf417e0fa1006e4a91713a834", [:mix], [{:decimal, "~> 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", "df9efebf70cf94142739ba357499661ef5dbb559ef902b68ea1f3c1fabce36de"},
89
"ecto_sql": {:hex, :ecto_sql, "3.13.5", "2f8282b2ad97bf0f0d3217ea0a6fff320ead9e2f8770f810141189d182dc304e", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 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", "aa36751f4e6a2b56ae79efb0e088042e010ff4935fc8684e74c23b1f49e25fdc"},

0 commit comments

Comments
 (0)