Move Mix project to the root dir
This commit moves the mix.exs, mix.lock and priv directors that were inside app/ to the root directory. Configuration tweaks with paths were done for the asset building. The priv/ directory had to be moved because mix by default symlinks it inside the build output, and I couldn't find a configuration option to have it live inside app/
This commit is contained in:
parent
0ce0132554
commit
59c8c6ee23
17 changed files with 14 additions and 21 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -2,3 +2,7 @@
|
||||||
/.db/
|
/.db/
|
||||||
/.vagrant/
|
/.vagrant/
|
||||||
/.direnv/
|
/.direnv/
|
||||||
|
/deps/
|
||||||
|
/_build/
|
||||||
|
/priv/static/assets/
|
||||||
|
/priv/static/cache_manifest.json
|
||||||
|
|
12
app/.gitignore
vendored
12
app/.gitignore
vendored
|
@ -1,12 +1,6 @@
|
||||||
# The directory Mix will write compiled artifacts to.
|
|
||||||
/_build/
|
|
||||||
|
|
||||||
# If you run "mix test --cover", coverage assets end up here.
|
# If you run "mix test --cover", coverage assets end up here.
|
||||||
/cover/
|
/cover/
|
||||||
|
|
||||||
# The directory Mix downloads your dependencies sources to.
|
|
||||||
/deps/
|
|
||||||
|
|
||||||
# Where 3rd-party dependencies like ExDoc output generated docs.
|
# Where 3rd-party dependencies like ExDoc output generated docs.
|
||||||
/doc/
|
/doc/
|
||||||
|
|
||||||
|
@ -25,12 +19,6 @@ erl_crash.dump
|
||||||
# Ignore package tarball (built via "mix hex.build").
|
# Ignore package tarball (built via "mix hex.build").
|
||||||
prymn-*.tar
|
prymn-*.tar
|
||||||
|
|
||||||
# Ignore assets that are produced by build tools.
|
|
||||||
/priv/static/assets/
|
|
||||||
|
|
||||||
# Ignore digested assets cache.
|
|
||||||
/priv/static/cache_manifest.json
|
|
||||||
|
|
||||||
# In case you use Node.js/npm, you want to ignore these.
|
# In case you use Node.js/npm, you want to ignore these.
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
/assets/node_modules/
|
/assets/node_modules/
|
||||||
|
|
|
@ -34,9 +34,9 @@ config :esbuild,
|
||||||
version: "0.17.11",
|
version: "0.17.11",
|
||||||
default: [
|
default: [
|
||||||
args:
|
args:
|
||||||
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
|
~w(js/app.js --bundle --target=es2017 --outdir=../../priv/static/assets --external:/fonts/* --external:/images/*),
|
||||||
cd: Path.expand("../assets", __DIR__),
|
cd: Path.expand("../assets", __DIR__),
|
||||||
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
|
env: %{"NODE_PATH" => Path.expand("../../deps", __DIR__)}
|
||||||
]
|
]
|
||||||
|
|
||||||
# Configure tailwind (the version is required)
|
# Configure tailwind (the version is required)
|
||||||
|
@ -46,7 +46,7 @@ config :tailwind,
|
||||||
args: ~w(
|
args: ~w(
|
||||||
--config=tailwind.config.js
|
--config=tailwind.config.js
|
||||||
--input=css/app.css
|
--input=css/app.css
|
||||||
--output=../priv/static/assets/app.css
|
--output=../../priv/static/assets/app.css
|
||||||
),
|
),
|
||||||
cd: Path.expand("../assets", __DIR__)
|
cd: Path.expand("../assets", __DIR__)
|
||||||
]
|
]
|
||||||
|
|
|
@ -8,6 +8,7 @@ defmodule Prymn.MixProject do
|
||||||
elixir: "~> 1.15",
|
elixir: "~> 1.15",
|
||||||
compilers: [:proto | Mix.compilers()],
|
compilers: [:proto | Mix.compilers()],
|
||||||
elixirc_paths: elixirc_paths(Mix.env()),
|
elixirc_paths: elixirc_paths(Mix.env()),
|
||||||
|
config_path: Path.expand("app/config/config.exs", __DIR__),
|
||||||
start_permanent: Mix.env() == :prod,
|
start_permanent: Mix.env() == :prod,
|
||||||
aliases: aliases(),
|
aliases: aliases(),
|
||||||
deps: deps()
|
deps: deps()
|
||||||
|
@ -25,8 +26,8 @@ defmodule Prymn.MixProject do
|
||||||
end
|
end
|
||||||
|
|
||||||
# Specifies which paths to compile per environment.
|
# Specifies which paths to compile per environment.
|
||||||
defp elixirc_paths(:test), do: ["lib", "test/support"]
|
defp elixirc_paths(:test), do: ["app/lib", "app/test/support"]
|
||||||
defp elixirc_paths(_), do: ["lib"]
|
defp elixirc_paths(_), do: ["app/lib"]
|
||||||
|
|
||||||
# Specifies your project dependencies.
|
# Specifies your project dependencies.
|
||||||
#
|
#
|
||||||
|
@ -62,7 +63,7 @@ defmodule Prymn.MixProject do
|
||||||
{:tailwind_formatter, "~> 0.3.6", runtime: Mix.env() == :dev},
|
{:tailwind_formatter, "~> 0.3.6", runtime: Mix.env() == :dev},
|
||||||
{:phoenix_live_reload, "~> 1.2", only: :dev},
|
{:phoenix_live_reload, "~> 1.2", only: :dev},
|
||||||
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
|
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
|
||||||
{:prymn_proto_compiler, path: "../proto_compiler", runtime: false}
|
{:prymn_proto_compiler, path: "proto_compiler", runtime: false}
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
@ -5,8 +5,8 @@ defmodule Mix.Tasks.Compile.Proto do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def run(_args) do
|
def run(_args) do
|
||||||
output = "./lib/prymn_proto"
|
output = "./app/lib/prymn_proto"
|
||||||
sources = Path.wildcard("../proto/*.proto")
|
sources = Path.wildcard("proto/*.proto")
|
||||||
targets = Path.wildcard(output <> "/*.pb.ex")
|
targets = Path.wildcard(output <> "/*.pb.ex")
|
||||||
|
|
||||||
if Mix.Utils.stale?(sources, targets) do
|
if Mix.Utils.stale?(sources, targets) do
|
||||||
|
@ -27,7 +27,7 @@ defmodule Mix.Tasks.Compile.Proto do
|
||||||
"--elixir_out=plugins=grpc:" <> output,
|
"--elixir_out=plugins=grpc:" <> output,
|
||||||
"--elixir_opt=package_prefix=prymn_proto",
|
"--elixir_opt=package_prefix=prymn_proto",
|
||||||
"-I",
|
"-I",
|
||||||
"../proto"
|
"proto"
|
||||||
] ++ sources
|
] ++ sources
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue