Skip to content

Commit fbb0dad

Browse files
committed
Merge branch 'develop' into feature/js-bundle
2 parents f2ed5e8 + ae15bb7 commit fbb0dad

File tree

11 files changed

+581
-55
lines changed

11 files changed

+581
-55
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
cache-dependency-path: yarn.lock
4747

4848
- name: Restore the deps and _build cache
49-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
49+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
5050
id: restore-cache
5151
env:
5252
MIX_LOCK_HASH: ${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
@@ -165,7 +165,7 @@ jobs:
165165
cache-dependency-path: demo/yarn.lock
166166

167167
- name: Restore the deps and _build cache
168-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
168+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
169169
id: restore-cache
170170
env:
171171
OTP_VERSION: ${{ steps.beam.outputs.otp-version }}
@@ -272,15 +272,15 @@ jobs:
272272

273273
- name: Log in to the container registry
274274
if: env.PUSH_IMAGE == 'true'
275-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
275+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
276276
with:
277277
registry: ${{ env.REGISTRY }}
278278
username: ${{ github.actor }}
279279
password: ${{ secrets.GITHUB_TOKEN }}
280280

281281
- name: Extract metadata (tags, labels) for Docker
282282
id: meta
283-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
283+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
284284
with:
285285
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_RUNTIME }}
286286

demo/mix.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ defmodule Demo.MixProject do
4343
{:smokestack, "~> 0.9.2"},
4444
{:faker, "~> 0.18"},
4545
{:phoenix_test, "~> 0.7.0", only: :test, runtime: false},
46-
{:sourceror, "~> 1.7", only: [:dev, :test]},
4746
{:phoenix_test_playwright, "~> 0.7.0", only: :test, runtime: false},
4847
{:a11y_audit, "~> 0.2.3", only: :test},
4948
{:live_debugger, "~> 0.3", only: :dev},

demo/mix.lock

Lines changed: 15 additions & 3 deletions
Large diffs are not rendered by default.

demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"gettext": "mix gettext.extract --merge"
2121
},
2222
"devDependencies": {
23-
"@sentry/browser": "9.44.0",
23+
"@sentry/browser": "9.44.2",
2424
"npm-run-all2": "8.0.4",
2525
"playwright": "1.54.2",
2626
"postcss": "8.5.6",
2727
"standard": "17.1.2",
28-
"stylelint": "16.23.0",
28+
"stylelint": "16.23.1",
2929
"stylelint-config-standard": "39.0.0",
3030
"topbar": "3.0.0"
3131
},

demo/yarn.lock

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -123,51 +123,51 @@
123123
resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8"
124124
integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==
125125

126-
"@sentry-internal/[email protected].0":
127-
version "9.44.0"
128-
resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-9.44.0.tgz#1bb9cfe7bcc0e5f87c060133e2e3f0b9d7ab6e06"
129-
integrity sha512-ySIXxq3xq2lhY/XPMLUtaUd6HghJUsz+S5GksuRCxv6exY6mRMjsbm7VhcAEPmY4IrhsXjnEzCONP+M7pzAc3A==
126+
"@sentry-internal/[email protected].2":
127+
version "9.44.2"
128+
resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-9.44.2.tgz#9d6be15ee170b8aae5045a0eacd9dfe5d70e93ad"
129+
integrity sha512-VvaSk8DDV8fsUZf+bnbjziyu4RJgSNAxZ4jFo5Jq7Z/SXc7uciOGElpEzgALcY0uMbFA/0IsXQKpB1s01ZsoZQ==
130130
dependencies:
131-
"@sentry/core" "9.44.0"
131+
"@sentry/core" "9.44.2"
132132

133-
"@sentry-internal/[email protected].0":
134-
version "9.44.0"
135-
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-9.44.0.tgz#1fe4fe83e42122b4bba31ac8882b0a15371a347a"
136-
integrity sha512-ptA74gXPU7qV9eBuz2UUyFv+BroMrVMZD58eIG3IkRu93mAH0dhJiKmd1rhlWheXfhFhiw82WdNH9sTQj7++GA==
133+
"@sentry-internal/[email protected].2":
134+
version "9.44.2"
135+
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-9.44.2.tgz#ab97736219e3dcd4d055e8b09701a4cb5a219402"
136+
integrity sha512-EVyTIc/V2p3aK2GwMk1/r192C8uxLipJXYB+nQCIqYTduuvdg9jCUFsK90FbRCbIqQtglcvVYmyNZwY4IaMxoQ==
137137
dependencies:
138-
"@sentry/core" "9.44.0"
138+
"@sentry/core" "9.44.2"
139139

140-
"@sentry-internal/[email protected].0":
141-
version "9.44.0"
142-
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-9.44.0.tgz#9a580a53eb7721eec6a5b4b0d233150378de3b71"
143-
integrity sha512-JTRBlKsd46tz/bE6FE8bRsapteWwBt+4eviYZlE6Wn/QSirYOqEniibhJ8GIUIpUmHpkrvNAfIRaKJ4tXYaqGQ==
140+
"@sentry-internal/[email protected].2":
141+
version "9.44.2"
142+
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-9.44.2.tgz#e751089af0fd6efaf4f90292a51d86142c34b00b"
143+
integrity sha512-49wOCuXz5qf507BW6UuGOFGSxCGke84rreglLRr+N/8n3Ag2GQC7zcxn25SwidVsWYQo70GxSqzAwZVrOCe6Vw==
144144
dependencies:
145-
"@sentry-internal/replay" "9.44.0"
146-
"@sentry/core" "9.44.0"
145+
"@sentry-internal/replay" "9.44.2"
146+
"@sentry/core" "9.44.2"
147147

148-
"@sentry-internal/[email protected].0":
149-
version "9.44.0"
150-
resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-9.44.0.tgz#0fd0b1f5c682113c97584cca0094879751953064"
151-
integrity sha512-IVRbONKaoxcDItpcXV9wpNCL+T5iMnTLJv2glMULMnqU4nplhBynxjSyng1s/rpTU4PwwYYIgwkb4Z0GMIYPlg==
148+
"@sentry-internal/[email protected].2":
149+
version "9.44.2"
150+
resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-9.44.2.tgz#c727d766249787bd2c9840c13ba63b47f8372dc8"
151+
integrity sha512-LALsZg8n0F5OsOUELByXnCxPdovwl7eJja903fjamzC1MoWtTB06RXiZHqv/E1+HuTsseR2EggS0dLXfptximg==
152152
dependencies:
153-
"@sentry-internal/browser-utils" "9.44.0"
154-
"@sentry/core" "9.44.0"
153+
"@sentry-internal/browser-utils" "9.44.2"
154+
"@sentry/core" "9.44.2"
155155

156-
"@sentry/[email protected].0":
157-
version "9.44.0"
158-
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-9.44.0.tgz#e5db81fd0508b24dc71335b443c31efc15422098"
159-
integrity sha512-QhZds04ta8m1SGN8jpF22kFu2SyM2FcHM2tFBaFuYTK6b7ouBII6YpYLhXulZvF+xl/pxnYsXHgyeTJ5JseITg==
156+
"@sentry/[email protected].2":
157+
version "9.44.2"
158+
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-9.44.2.tgz#c7a61ac6c79a409e1cf21096d32afbb515c73b55"
159+
integrity sha512-m5oMprtmPTeZB9PFrQfWmRQglSgzozAUFUFiQdL0g2QJkmyNL4LzEE2L88dxGSbnABLRu0MI1ySiEQTFa7ZSbw==
160160
dependencies:
161-
"@sentry-internal/browser-utils" "9.44.0"
162-
"@sentry-internal/feedback" "9.44.0"
163-
"@sentry-internal/replay" "9.44.0"
164-
"@sentry-internal/replay-canvas" "9.44.0"
165-
"@sentry/core" "9.44.0"
161+
"@sentry-internal/browser-utils" "9.44.2"
162+
"@sentry-internal/feedback" "9.44.2"
163+
"@sentry-internal/replay" "9.44.2"
164+
"@sentry-internal/replay-canvas" "9.44.2"
165+
"@sentry/core" "9.44.2"
166166

167-
"@sentry/[email protected].0":
168-
version "9.44.0"
169-
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-9.44.0.tgz#99be002aada90d70afb4f0293b1a8e186294cdca"
170-
integrity sha512-U+KBNGgq/eXIj226CPtRk+n5dx0q1xGVvbLbyfAyeek9C/wxQ3f+mvqeVqF9cx8FfrWIOeDM1F8ISH5uRkjjQg==
167+
"@sentry/[email protected].2":
168+
version "9.44.2"
169+
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-9.44.2.tgz#a2d55a6b108702925dfa7d97eb423cbc671fd2cc"
170+
integrity sha512-4wduCY9vz+VRMZXTT1dzk08L2nReeR+lzpY8hCcc+Wu100BoJR+TNlrSn1rG5iIo98NDW860JsRA7SVDUDOiNQ==
171171

172172
"@types/json5@^0.0.29":
173173
version "0.0.29"
@@ -2443,10 +2443,10 @@ [email protected]:
24432443
dependencies:
24442444
stylelint-config-recommended "^17.0.0"
24452445

2446-
2447-
version "16.23.0"
2448-
resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-16.23.0.tgz#a50c3340b5ba3ed4e05f7e89d8ec5e3350092dd0"
2449-
integrity sha512-69T5aS2LUY306ekt1Q1oaSPwz/jaG9HjyMix3UMrai1iEbuOafBe2Dh8xlyczrxFAy89qcKyZWWtc42XLx3Bbw==
2446+
2447+
version "16.23.1"
2448+
resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-16.23.1.tgz#e5f5ee173adf989db0855b825e66f9ccdde3c78a"
2449+
integrity sha512-dNvDTsKV1U2YtiUDfe9d2gp902veFeo3ecCWdGlmLm2WFrAV0+L5LoOj/qHSBABQwMsZPJwfC4bf39mQm1S5zw==
24502450
dependencies:
24512451
"@csstools/css-parser-algorithms" "^3.0.5"
24522452
"@csstools/css-tokenizer" "^3.0.4"

guides/get_started/installation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Installation
22

3-
The following guide will help you to install Backpex in your Phoenix application. We will guide you through the installation process and show you how to create a simple resource.
3+
The following guide will help you to install Backpex in your Phoenix application. We will guide you through the installation process and show you how to create a simple resource.
44

55
## Prerequisites
66

@@ -10,6 +10,10 @@ Backpex integrates seamlessly with your existing Phoenix LiveView application, b
1010

1111
Backpex is built on top of Phoenix LiveView, so you need to have Phoenix LiveView installed in your application. If you generate a new Phoenix application using the latest version of the `mix phx.new` generator, Phoenix LiveView is included by default.
1212

13+
> #### Info {: .info}
14+
>
15+
> We have created an initial version of the [Backpex installer task](Mix.Tasks.Backpex.Install.html), which runs with the help of the [Igniter](https://github.com/ash-project/igniter) framework. This installer automates the upcoming steps up to the "[Create an example resource](installation.html#create-an-example-resource)" step. Feedback is welcome!
16+
1317
### Tailwind CSS
1418

1519
Backpex uses Tailwind CSS for styling. Make sure you have Tailwind CSS installed in your application. You can install Tailwind CSS by following the [official installation guide](https://tailwindcss.com/docs/installation/framework-guides/phoenix). If you generate a new Phoenix application using the latest version of the `mix phx.new` generator, Tailwind CSS is included by default.

lib/mix/helpers.ex

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
defmodule Backpex.Mix.Helpers do
2+
@moduledoc """
3+
Helper functions for the Backpex mix tasks.
4+
"""
5+
6+
alias Igniter.Libs.Phoenix
7+
alias Igniter.Project.Application, as: IgniterApp
8+
alias Igniter.Project.Module, as: IgniterModule
9+
alias Igniter.Util.Warning
10+
11+
@doc """
12+
Gets the Phoenix PubSub module from the application configuration.
13+
"""
14+
def pubsub_module(igniter) do
15+
web_module = Phoenix.web_module(igniter)
16+
endpoint_module = Module.safe_concat(web_module, Endpoint)
17+
app_name = IgniterApp.app_name(igniter)
18+
19+
Application.get_env(app_name, endpoint_module)[:pubsub_server]
20+
end
21+
22+
@doc """
23+
Checks if a specific string exists within a module's source code.
24+
"""
25+
def exists_in_module?(igniter, module, line) do
26+
case IgniterModule.find_module(igniter, module) do
27+
{:ok, {igniter, source, _zipper}} ->
28+
{:ok, {igniter, string_in_source?(source, line)}}
29+
30+
{:error, igniter} ->
31+
Mix.shell().warning("Could not find module #{inspect(module)}")
32+
{:error, igniter}
33+
end
34+
end
35+
36+
@doc """
37+
Checks if a specific string exists within a source's content.
38+
"""
39+
def string_in_source?(source, string) do
40+
source
41+
|> Rewrite.Source.get(:content)
42+
|> String.contains?(string)
43+
end
44+
45+
@doc """
46+
Updates a file by adding a line if it doesn't already exist.
47+
"""
48+
def add_line_to_file(igniter, file_path, new_line) do
49+
if Igniter.exists?(igniter, file_path) do
50+
Igniter.update_file(igniter, file_path, &add_line(&1, file_path, new_line))
51+
else
52+
Warning.warn_with_code_sample(
53+
igniter,
54+
"File not found at #{file_path}. Please manually add the following line:",
55+
new_line
56+
)
57+
end
58+
end
59+
60+
defp add_line(source, file_path, line) do
61+
content = Rewrite.Source.get(source, :content)
62+
63+
if String.contains?(content, line) do
64+
Mix.shell().info("'#{line}' already exists in #{file_path}.")
65+
source
66+
else
67+
Rewrite.Source.update(source, :content, content <> "\n#{line}")
68+
end
69+
end
70+
71+
@doc """
72+
Gets the web folder path for the Phoenix application.
73+
"""
74+
def web_folder_path(igniter) do
75+
igniter
76+
|> IgniterApp.app_name()
77+
|> Mix.Phoenix.web_path()
78+
end
79+
80+
@doc """
81+
Checks if an npm package is already installed in the project.
82+
"""
83+
def npm_package_installed?(package_name) do
84+
env = [{"PATH", System.get_env("PATH")}]
85+
86+
case System.cmd("npm", ["list", "--depth=0", package_name], stderr_to_stdout: true, env: env) do
87+
{_output, 0} -> true
88+
{_output, _int} -> false
89+
end
90+
end
91+
end

0 commit comments

Comments
 (0)