Skip to content

Commit c44bfed

Browse files
committed
more fixes and live reloading
1 parent eeadc99 commit c44bfed

File tree

10 files changed

+29
-40
lines changed

10 files changed

+29
-40
lines changed

assets/css/app.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/* This file is for your main application CSS */
66

77
@import "tailwindcss";
8+
@plugin "@tailwindcss/forms";
9+
@config "../tailwind.config.js";

assets/tailwind.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ const path = require("path")
77

88
module.exports = {
99
content: [
10-
"../deps/ash_authentication_phoenix/**/*.*ex",
1110
"./js/**/*.js",
12-
"../lib/uro_web.ex",
13-
"../lib/uro_web/**/*.*ex"
11+
"../lib/uro_web/**/*.*ex",
12+
"../lib/uro/**/*.*ex",
1413
],
1514
theme: {
1615
extend: {
@@ -20,7 +19,6 @@ module.exports = {
2019
},
2120
},
2221
plugins: [
23-
require("@tailwindcss/forms"),
2422
// Allows prefixing tailwind classes with LiveView classes to add rules
2523
// only when LiveView classes are applied, for example:
2624
//

config/config.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ config :tailwind,
1717
version: "4.0.9",
1818
uro: [
1919
args: ~w(
20-
--config=tailwind.config.js
2120
--input=css/app.css
2221
--output=../priv/static/assets/app.css
2322
),
@@ -46,7 +45,7 @@ config :uro, Uro.Endpoint,
4645
url: [host: "localhost"],
4746
pubsub_server: Uro.PubSub,
4847
render_errors: [
49-
formats: [html: OruWeb.ErrorHTML, json: OruWeb.ErrorJSON],
48+
formats: [html: UroWeb.ErrorHTML, json: UroWeb.ErrorJSON],
5049
layout: false
5150
],
5251
live_view: [signing_salt: "0dBPUwA2"]

config/dev.exs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ config :uro, Uro.Endpoint,
1717
patterns: [
1818
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",
1919
~r"priv/gettext/.*(po)$",
20-
~r"lib/uro_web/(controllers|live|components)/.*(ex|heex)$"
20+
~r"lib/uro_web/(controllers|live|components)/.*(ex|heex)$",
21+
~r"lib/uro/(controllers|live|components)/.*(ex|heex)$"
2122
]
2223
]
2324

@@ -47,3 +48,9 @@ config :uro, Uro.Repo,
4748

4849
redis_url = Helpers.get_env("REDIS_URL", nil)
4950
config :uro, Redix, url: if(redis_url, do: redis_url, else: "redis://localhost:6379")
51+
52+
config :phoenix_live_view,
53+
# Include HEEx debug annotations as HTML comments in rendered markup
54+
debug_heex_annotations: true,
55+
# Enable helpful, but potentially expensive runtime checks
56+
enable_expensive_runtime_checks: true

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
in
1919
{
2020
devShells.x86_64-linux.default = pkgs.x86_64-linux.mkShell {
21-
buildInputs = with pkgs.x86_64-linux; [elixir_1_17 elixir-ls tailwindcss-language-server inotify-tools];
21+
buildInputs = with pkgs.x86_64-linux; [elixir_1_17 elixir-ls tailwindcss-language-server inotify-tools watchman];
2222
shellHook = ''
2323
export HEX_OFFLINE=0
2424
'';

lib/uro/endpoint.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ defmodule Uro.Endpoint do
3434
gzip: false
3535
)
3636

37+
# Code reloading can be explicitly enabled under the
38+
# :code_reloader configuration of your endpoint.
39+
if code_reloading? do
40+
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
41+
plug Phoenix.LiveReloader
42+
plug Phoenix.CodeReloader
43+
plug Phoenix.Ecto.CheckRepoStatus, otp_app: :oru
44+
end
45+
3746
plug(Plug.RequestId, assign_as: :request_id)
3847
plug(Plug.Telemetry, event_prefix: [:phoenix, :endpoint])
3948

lib/uro/gettext.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule Uro.Gettext do
2020
2121
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
2222
"""
23-
use Gettext, otp_app: :uro
23+
use Gettext.Backend, otp_app: :uro
2424
end
2525

2626
# TODO(benbot) migrate Uro to UroWeb where needed
@@ -46,5 +46,5 @@ defmodule UroWeb.Gettext do
4646
4747
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
4848
"""
49-
use Gettext, otp_app: :uro
49+
use Gettext.Backend, otp_app: :uro
5050
end
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
1-
<header class="px-4 sm:px-6 lg:px-8">
2-
<div class="flex items-center justify-between border-b border-zinc-100 py-3 text-sm">
3-
<div class="flex items-center gap-4">
4-
<a href="/">
5-
<img src={~p"/images/logo.svg"} width="36" />
6-
</a>
7-
<p class="bg-brand/5 text-brand rounded-full px-2 font-medium leading-6">
8-
v{Application.spec(:phoenix, :vsn)}
9-
</p>
10-
</div>
11-
<div class="flex items-center gap-4 font-semibold leading-6 text-zinc-900">
12-
<a href="https://twitter.com/elixirphoenix" class="hover:text-zinc-700">
13-
@elixirphoenix
14-
</a>
15-
<a href="https://github.com/phoenixframework/phoenix" class="hover:text-zinc-700">
16-
GitHub
17-
</a>
18-
<a
19-
href="https://hexdocs.pm/phoenix/overview.html"
20-
class="rounded-lg bg-zinc-100 px-2 py-1 hover:bg-zinc-200/80"
21-
>
22-
Get Started <span aria-hidden="true">&rarr;</span>
23-
</a>
24-
</div>
25-
</div>
1+
<header>
262
</header>
27-
<main class="px-4 py-20 sm:px-6 lg:px-8">
28-
<div class="mx-auto max-w-2xl">
3+
<main>
294
<.flash_group flash={@flash} />
305
{@inner_content}
31-
</div>
326
</main>

lib/uro_web/components/layouts/root.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
1414
</script>
1515
</head>
16-
<body class="bg-white">
16+
<body class="width-[100vw] height-[100vh]">
1717
{@inner_content}
1818
</body>
1919
</html>

lib/uro_web/live/login.live.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule UroWeb.LoginLive do
33

44
def render(assigns) do
55
~H"""
6-
Hello, world
6+
<p class="text-orange orange bg-red">Hellop</p>
77
"""
88
end
99

0 commit comments

Comments
 (0)