Current section

Files

Jump to
Raw

mix.exs

defmodule ExShopifySchema.MixProject do
use Mix.Project
# NOTE: This is the patch number of the version.
@patch_number 3
@repo_url "https://github.com/TeamLunaris/ex_shopify_schema"
def project do
[
app: :ex_shopify_schema,
version: get_version(),
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
dialyzer: dialyzer(),
elixirc_paths: elixirc_paths(Mix.env()),
# Docs
name: "ExShopifySchema",
source_url: @repo_url,
homepage_url: @repo_url,
docs: docs(),
package: package()
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
{:ecto, "~> 3.11"},
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
{:typed_ecto_schema, "~> 0.4.1", runtime: false},
{:typed_structor, "~> 0.5.0"}
]
end
defp aliases do
[
check: ["format", "deps.unlock --check-unused", "credo --strict", "dialyzer"]
]
end
defp dialyzer do
[
plt_add_apps: [:mix],
plt_local_path: "priv/plts/ex_shopify_schema.plt",
plt_core_path: "priv/plts/core.plt"
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
defp docs do
[
main: "ExShopifySchema",
source_url: @repo_url,
source_ref: "v#{@patch_number}",
extras: ["README.md"],
nest_modules_by_prefix: [
ExShopifySchema.Generator.Graphql.Introspection
],
filter_modules: ~r/^(?!.*ExShopifySchema\.Graphql\.).*$/,
formatters: ["html"]
]
end
defp package do
[
name: "ex_shopify_schema",
description: "A library for working with Shopify's GraphQL Admin API schema in Elixir",
files: package_files(),
licenses: ["MIT"],
links: %{
"GitHub" => @repo_url
}
]
end
defp package_files do
~w(lib .formatter.exs mix.exs README.md SHOPIFY_VERSION
priv/graphql/templates
priv/graphql/introspections/#{get_shopify_version()}.json)
end
defp get_shopify_version do
System.get_env("SHOPIFY_VERSION", "SHOPIFY_VERSION" |> File.read!() |> String.trim())
end
defp get_version do
shopify_version = get_shopify_version()
[year, month] = shopify_version |> String.split("-") |> Enum.map(&String.to_integer/1)
Enum.join([year, month, @patch_number], ".")
end
end