Skip to content

Commit 0a915ad

Browse files
committed
Merge branch 'develop' into feature/use-filtered-fields-in-ecto-adapter
2 parents 5117402 + 66da898 commit 0a915ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1783
-460
lines changed

.github/renovate.json

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,22 @@
1212
":automergePatch",
1313
"helpers:pinGitHubActionDigestsToSemver"
1414
],
15+
"pinDigests": false,
1516
"lockFileMaintenance": {
16-
"enabled": true
17+
"enabled": true,
18+
"extends": [
19+
"schedule:weekly"
20+
]
1721
},
1822
"additionalBranchPrefix": "{{packageFileDir}}-",
1923
"packageRules": [
24+
{
25+
"description": "Set Mix versioning strategy to update-lockfile",
26+
"matchManagers": [
27+
"mix"
28+
],
29+
"rangeStrategy": "update-lockfile"
30+
},
2031
{
2132
"description": "Group dependency updates to the Elixir base image",
2233
"groupName": "Base Image",
@@ -28,16 +39,15 @@
2839
"pinDigests": false
2940
},
3041
{
31-
"description": "Disable ubuntu major updates and digest pinning",
42+
"description": "Disable ubuntu major updates",
3243
"matchDatasources": [
3344
"docker"
3445
],
3546
"matchDepNames": [
3647
"ubuntu"
3748
],
3849
"matchUpdateTypes": [
39-
"major",
40-
"pinDigest"
50+
"major"
4151
],
4252
"enabled": false
4353
},
@@ -46,16 +56,10 @@
4656
"matchDatasources": [
4757
"docker"
4858
],
49-
"automerge": false
50-
},
51-
{
52-
"matchManagers": [
53-
"mix"
54-
],
55-
"rangeStrategy": "update-lockfile"
59+
"automerge": true
5660
},
5761
{
58-
"description": "Automatically merge github actions updates",
62+
"description": "Automatically merge non-major github actions updates",
5963
"matchManagers": [
6064
"github-actions"
6165
],
@@ -67,6 +71,26 @@
6771
],
6872
"automerge": true
6973
},
74+
{
75+
"description": "Automerge some non-major node package updates",
76+
"matchDepNames": [
77+
"@sentry/browser",
78+
"stylelint",
79+
"stylelint-config-standard",
80+
"standard",
81+
"playwright",
82+
"topbar",
83+
"npm-run-all2"
84+
],
85+
"matchDatasources": [
86+
"npm"
87+
],
88+
"matchUpdateTypes": [
89+
"minor",
90+
"patch"
91+
],
92+
"automerge": true
93+
},
7094
{
7195
"description": "Label dependency updates in demo directory",
7296
"matchFileNames": [

.github/workflows/ci.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: Checkout code
34-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535

3636
- uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
3737
with:
@@ -41,12 +41,12 @@ jobs:
4141
- name: Setup node
4242
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4343
with:
44-
node-version: 20
44+
node-version: 22
4545
cache: 'yarn'
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')) }}
@@ -99,6 +99,9 @@ jobs:
9999
- name: Gettext Check
100100
run: mix gettext.extract --check-up-to-date
101101

102+
- name: Check assets up-to-date
103+
run: mix assets.check
104+
102105
publish:
103106
needs: test
104107
if: github.event_name == 'release'
@@ -107,7 +110,7 @@ jobs:
107110

108111
steps:
109112
- name: Checkout code
110-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
113+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
111114

112115
- uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
113116
id: beam
@@ -132,7 +135,7 @@ jobs:
132135

133136
services:
134137
postgres:
135-
image: postgres:16.9@sha256:fec2740c517838d4f582e48a8a9a1cb51082af3dcae59e9b12a66ec262302b97
138+
image: postgres:16.10@sha256:66a5efb5677ffac1037774a0e141fd3a4c035c9c0c0e624c9cc980dfa10f45e5
136139
env:
137140
POSTGRES_PASSWORD: postgres
138141
options: >-
@@ -145,7 +148,7 @@ jobs:
145148

146149
steps:
147150
- name: Checkout code
148-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
149152

150153
- name: Setup beam
151154
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
@@ -157,12 +160,12 @@ jobs:
157160
- name: Setup node
158161
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
159162
with:
160-
node-version: 20
163+
node-version: 22
161164
cache: 'yarn'
162165
cache-dependency-path: demo/yarn.lock
163166

164167
- name: Restore the deps and _build cache
165-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
168+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
166169
id: restore-cache
167170
env:
168171
OTP_VERSION: ${{ steps.beam.outputs.otp-version }}
@@ -262,22 +265,22 @@ jobs:
262265

263266
steps:
264267
- name: Checkout code
265-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
268+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
266269

267270
- name: Set up Docker Buildx
268271
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
269272

270273
- name: Log in to the container registry
271274
if: env.PUSH_IMAGE == 'true'
272-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
275+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
273276
with:
274277
registry: ${{ env.REGISTRY }}
275278
username: ${{ github.actor }}
276279
password: ${{ secrets.GITHUB_TOKEN }}
277280

278281
- name: Extract metadata (tags, labels) for Docker
279282
id: meta
280-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
283+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
281284
with:
282285
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_RUNTIME }}
283286

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG ELIXIR_VERSION=1.18.4
77
# renovate: datasource=github-tags depName=erlang packageName=erlang/otp versioning=regex:^(?<major>\d+?)\.(?<minor>\d+?)(\.(?<patch>\d+))?$ extractVersion=^OTP-(?<version>\S+)
88
ARG OTP_VERSION=28.0.2
99
# renovate: datasource=docker depName=ubuntu packageName=ubuntu versioning=ubuntu
10-
ARG UBUNTU_VERSION=noble-20250714
10+
ARG UBUNTU_VERSION=noble-20250805
1111

1212
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-ubuntu-${UBUNTU_VERSION}"
1313
ARG RUNTIME_IMAGE="ubuntu:${UBUNTU_VERSION}"
@@ -56,14 +56,15 @@ RUN mix do deps.compile
5656
COPY demo/priv priv/
5757
COPY demo/package.json demo/yarn.lock demo/.stylelintrc.json ./
5858

59+
COPY assets ../assets/
60+
COPY package.json ../
61+
5962
RUN yarn install --pure-lockfile
6063

6164
COPY demo/assets assets/
6265
COPY demo/lib lib/
6366

64-
COPY assets ../assets/
65-
COPY package.json ../
66-
67+
RUN mix compile
6768
RUN mix assets.deploy
6869

6970
# Copy the rest of the application files

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
postgres:
2121
condition: service_healthy
2222
postgres:
23-
image: postgres:16.9@sha256:fec2740c517838d4f582e48a8a9a1cb51082af3dcae59e9b12a66ec262302b97
23+
image: postgres:16.10@sha256:66a5efb5677ffac1037774a0e141fd3a4c035c9c0c0e624c9cc980dfa10f45e5
2424
environment:
2525
- POSTGRES_PASSWORD=postgres
2626
ports:

config/config.exs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Config
2+
3+
if Mix.env() == :dev do
4+
esbuild = fn args ->
5+
[
6+
args: ~w(./js/backpex --bundle) ++ args,
7+
cd: Path.expand("../assets", __DIR__),
8+
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
9+
]
10+
end
11+
12+
config :esbuild,
13+
version: "0.25.9",
14+
module: esbuild.(~w(--format=esm --sourcemap --outfile=../priv/static/js/backpex.esm.js)),
15+
main: esbuild.(~w(--format=cjs --sourcemap --outfile=../priv/static/js/backpex.cjs.js))
16+
end
17+
18+
import_config "#{config_env()}.exs"

config/dev.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import Config

config/test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Config
2+
3+
config :logger, :level, :debug
4+
config :logger, :default_handler, false

demo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ erl_crash.dump
2222
demo-*.tar
2323
/priv/cert
2424
/priv/static/assets/
25+
/priv/static/js
2526
/priv/static/cache_manifest.json
2627
report.*.json
2728
openapi.json

demo/assets/css/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import "tailwindcss";
22

3-
@plugin "./tailwind_heroicons.js";
3+
@plugin "../vendor/heroicons";
44

55
@plugin "daisyui" {
66
themes: all;

demo/assets/js/app.js

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import * as Sentry from '@sentry/browser'
33
import topbar from 'topbar'
44
import { Socket } from 'phoenix'
55
import { LiveSocket } from 'phoenix_live_view'
6-
import { Hooks as BackpexHooks } from 'backpex'
6+
import { hooks as colocatedHooks } from 'phoenix-colocated/demo'
7+
// in your app.js, just use 'backpex' like this:
8+
// import { Hooks as BackpexHooks } from 'backpex'
9+
import { Hooks as BackpexHooks } from '#backpex'
710

811
/**
912
* Sentry
@@ -32,7 +35,7 @@ const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute
3235

3336
const liveSocket = new LiveSocket('/live', Socket, {
3437
params: { _csrf_token: csrfToken },
35-
hooks: { ...BackpexHooks }
38+
hooks: { ...BackpexHooks, ...colocatedHooks }
3639
})
3740

3841
liveSocket.connect()
@@ -41,3 +44,38 @@ liveSocket.connect()
4144
* Globals
4245
*/
4346
window.liveSocket = liveSocket
47+
48+
// The lines below enable quality of life phoenix_live_reload
49+
// development features:
50+
//
51+
// 1. stream server logs to the browser console
52+
// 2. click on elements to jump to their definitions in your code editor
53+
//
54+
if (process.env.NODE_ENV === 'development') {
55+
window.addEventListener('phx:live_reload:attached', ({ detail: reloader }) => {
56+
// Enable server log streaming to client.
57+
// Disable with reloader.disableServerLogs()
58+
reloader.enableServerLogs()
59+
60+
// Open configured PLUG_EDITOR at file:line of the clicked element's HEEx component
61+
//
62+
// * click with "c" key pressed to open at caller location
63+
// * click with "d" key pressed to open at function component definition location
64+
let keyDown
65+
window.addEventListener('keydown', function (e) { keyDown = e.key })
66+
window.addEventListener('keyup', function (e) { keyDown = null })
67+
window.addEventListener('click', function (e) {
68+
if (keyDown === 'c') {
69+
e.preventDefault()
70+
e.stopImmediatePropagation()
71+
reloader.openEditorAtCaller(e.target)
72+
} else if (keyDown === 'd') {
73+
e.preventDefault()
74+
e.stopImmediatePropagation()
75+
reloader.openEditorAtDef(e.target)
76+
}
77+
}, true)
78+
79+
window.liveReloader = reloader
80+
})
81+
}

0 commit comments

Comments
 (0)