Skip to content

Commit 86fd606

Browse files
committed
New defaults & deps update
1 parent 0f406b4 commit 86fd606

File tree

11 files changed

+2077
-696
lines changed

11 files changed

+2077
-696
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v5
14+
uses: actions/checkout@v6
1515

1616
- name: Set up Node.js
1717
uses: actions/setup-node@v6
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout code
39-
uses: actions/checkout@v5
39+
uses: actions/checkout@v6
4040

4141
- name: Set up Ruby
4242
uses: ruby/setup-ruby@v1
@@ -55,7 +55,7 @@ jobs:
5555
RUBOCOP_CACHE_ROOT: tmp/rubocop
5656
steps:
5757
- name: Checkout code
58-
uses: actions/checkout@v5
58+
uses: actions/checkout@v6
5959

6060
- name: Set up Ruby
6161
uses: ruby/setup-ruby@v1
@@ -90,7 +90,7 @@ jobs:
9090
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git node-gyp pkg-config python-is-python3 google-chrome-stable
9191

9292
- name: Checkout code
93-
uses: actions/checkout@v5
93+
uses: actions/checkout@v6
9494

9595
- name: Set up Node.js
9696
uses: actions/setup-node@v6

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
BUNDLE_ONLY: deploy
2020
steps:
2121
- name: Checkout code
22-
uses: actions/checkout@v5
22+
uses: actions/checkout@v6
2323

2424
- name: Set up Docker Buildx
2525
uses: docker/setup-buildx-action@v3

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz
4343
rm -rf /tmp/node-build-master
4444

4545
# Install application gems
46-
COPY Gemfile Gemfile.lock vendor ./
46+
COPY vendor/* ./vendor/
47+
COPY Gemfile Gemfile.lock ./
4748

4849
RUN bundle install && \
4950
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \

Dockerfile-ssr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ RUN apt-get update -qq && \
4343
rm -rf /var/lib/apt/lists /var/cache/apt/archives
4444

4545
# Install application gems
46-
COPY Gemfile Gemfile.lock vendor ./
46+
COPY vendor/* ./vendor/
47+
COPY Gemfile Gemfile.lock ./
4748

4849
RUN bundle install && \
4950
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \

Gemfile.lock

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ GEM
8484
bcrypt_pbkdf (1.1.1)
8585
bigdecimal (3.3.1)
8686
bindex (0.8.1)
87-
bootsnap (1.18.6)
87+
bootsnap (1.19.0)
8888
msgpack (~> 1.2)
89-
brakeman (7.1.0)
89+
brakeman (7.1.1)
9090
racc
9191
builder (3.3.0)
9292
bundler-audit (0.9.2)
@@ -119,7 +119,7 @@ GEM
119119
drb (2.2.3)
120120
dry-cli (1.3.0)
121121
ed25519 (1.4.0)
122-
erb (5.1.3)
122+
erb (6.0.0)
123123
erubi (1.13.1)
124124
et-orbi (1.4.0)
125125
tzinfo
@@ -135,10 +135,10 @@ GEM
135135
activesupport (>= 6.1)
136136
i18n (1.14.7)
137137
concurrent-ruby (~> 1.0)
138-
inertia_rails (3.11.0)
138+
inertia_rails (3.13.0)
139139
railties (>= 6)
140140
io-console (0.8.1)
141-
irb (1.15.2)
141+
irb (1.15.3)
142142
pp (>= 0.6.0)
143143
rdoc (>= 4.0.0)
144144
reline (>= 0.4.2)
@@ -148,7 +148,7 @@ GEM
148148
js-routes (2.3.5)
149149
railties (>= 5)
150150
sorbet-runtime
151-
json (2.15.2)
151+
json (2.16.0)
152152
kamal (2.8.2)
153153
activesupport (>= 7.0)
154154
base64 (~> 0.2)
@@ -181,7 +181,7 @@ GEM
181181
marcel (1.1.0)
182182
matrix (0.4.3)
183183
mini_mime (1.1.5)
184-
minitest (5.26.0)
184+
minitest (5.26.2)
185185
msgpack (1.8.0)
186186
mutex_m (0.3.0)
187187
net-imap (0.5.12)
@@ -198,7 +198,7 @@ GEM
198198
net-smtp (0.5.1)
199199
net-protocol
200200
net-ssh (7.3.0)
201-
nio4r (2.7.4)
201+
nio4r (2.7.5)
202202
nokogiri (1.18.10-aarch64-linux-gnu)
203203
racc (~> 1.4)
204204
nokogiri (1.18.10-aarch64-linux-musl)
@@ -234,7 +234,7 @@ GEM
234234
nio4r (~> 2.0)
235235
raabro (1.4.0)
236236
racc (1.8.1)
237-
rack (3.2.3)
237+
rack (3.2.4)
238238
rack-proxy (0.7.7)
239239
rack
240240
rack-session (2.1.1)
@@ -276,20 +276,20 @@ GEM
276276
zeitwerk (~> 2.6)
277277
rainbow (3.1.1)
278278
rake (13.3.1)
279-
rdoc (6.15.0)
279+
rdoc (6.15.1)
280280
erb
281281
psych (>= 4.0.0)
282282
tsort
283283
regexp_parser (2.11.3)
284-
reline (0.6.2)
284+
reline (0.6.3)
285285
io-console (~> 0.5)
286286
rexml (3.4.4)
287287
rspec-core (3.13.6)
288288
rspec-support (~> 3.13.0)
289289
rspec-expectations (3.13.5)
290290
diff-lcs (>= 1.2.0, < 2.0)
291291
rspec-support (~> 3.13.0)
292-
rspec-mocks (3.13.6)
292+
rspec-mocks (3.13.7)
293293
diff-lcs (>= 1.2.0, < 2.0)
294294
rspec-support (~> 3.13.0)
295295
rspec-rails (8.0.2)
@@ -301,7 +301,7 @@ GEM
301301
rspec-mocks (~> 3.13)
302302
rspec-support (~> 3.13)
303303
rspec-support (3.13.6)
304-
rubocop (1.81.6)
304+
rubocop (1.81.7)
305305
json (~> 2.3)
306306
language_server-protocol (~> 3.17.0.2)
307307
lint_roller (~> 1.1.0)
@@ -312,14 +312,14 @@ GEM
312312
rubocop-ast (>= 1.47.1, < 2.0)
313313
ruby-progressbar (~> 1.7)
314314
unicode-display_width (>= 2.4.0, < 4.0)
315-
rubocop-ast (1.47.1)
315+
rubocop-ast (1.48.0)
316316
parser (>= 3.3.7.2)
317317
prism (~> 1.4)
318318
rubocop-performance (1.26.1)
319319
lint_roller (~> 1.1)
320320
rubocop (>= 1.75.0, < 2.0)
321321
rubocop-ast (>= 1.47.1, < 2.0)
322-
rubocop-rails (2.33.4)
322+
rubocop-rails (2.34.0)
323323
activesupport (>= 4.2.0)
324324
lint_roller (~> 1.1)
325325
rack (>= 1.1)
@@ -331,7 +331,7 @@ GEM
331331
rubocop-rails (>= 2.30)
332332
ruby-progressbar (1.13.0)
333333
ruby2_keywords (0.0.5)
334-
rubyzip (3.2.1)
334+
rubyzip (3.2.2)
335335
securerandom (0.4.1)
336336
selenium-webdriver (4.38.0)
337337
base64 (~> 0.2)
@@ -344,7 +344,7 @@ GEM
344344
activejob (>= 7.2)
345345
activerecord (>= 7.2)
346346
railties (>= 7.2)
347-
solid_cache (1.0.8)
347+
solid_cache (1.0.10)
348348
activejob (>= 7.2)
349349
activerecord (>= 7.2)
350350
railties (>= 7.2)
@@ -355,22 +355,22 @@ GEM
355355
fugit (~> 1.11)
356356
railties (>= 7.1)
357357
thor (>= 1.3.1)
358-
sorbet-runtime (0.6.12683)
359-
sqlite3 (2.7.4-aarch64-linux-gnu)
360-
sqlite3 (2.7.4-aarch64-linux-musl)
361-
sqlite3 (2.7.4-arm-linux-gnu)
362-
sqlite3 (2.7.4-arm-linux-musl)
363-
sqlite3 (2.7.4-arm64-darwin)
364-
sqlite3 (2.7.4-x86_64-linux-gnu)
365-
sqlite3 (2.7.4-x86_64-linux-musl)
358+
sorbet-runtime (0.6.12780)
359+
sqlite3 (2.8.0-aarch64-linux-gnu)
360+
sqlite3 (2.8.0-aarch64-linux-musl)
361+
sqlite3 (2.8.0-arm-linux-gnu)
362+
sqlite3 (2.8.0-arm-linux-musl)
363+
sqlite3 (2.8.0-arm64-darwin)
364+
sqlite3 (2.8.0-x86_64-linux-gnu)
365+
sqlite3 (2.8.0-x86_64-linux-musl)
366366
sshkit (1.24.0)
367367
base64
368368
logger
369369
net-scp (>= 1.1.2)
370370
net-sftp (>= 2.1.2)
371371
net-ssh (>= 2.8.0)
372372
ostruct
373-
stringio (3.1.7)
373+
stringio (3.1.8)
374374
thor (1.4.0)
375375
thruster (0.1.16)
376376
thruster (0.1.16-aarch64-linux)
@@ -383,7 +383,7 @@ GEM
383383
unicode-display_width (3.2.0)
384384
unicode-emoji (~> 4.1)
385385
unicode-emoji (4.1.0)
386-
uri (1.0.4)
386+
uri (1.1.1)
387387
useragent (0.16.11)
388388
vite_rails (3.0.19)
389389
railties (>= 5.1, < 9)

app/frontend/entrypoints/inertia.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1+
import type { ResolvedComponent } from "@inertiajs/react"
12
import { createInertiaApp } from "@inertiajs/react"
2-
import { type ReactNode, StrictMode, createElement } from "react"
3+
import { type ReactNode, StrictMode } from "react"
34
import { createRoot } from "react-dom/client"
45

56
import { initializeTheme } from "@/hooks/use-appearance"
67
import PersistentLayout from "@/layouts/persistent-layout"
78

8-
// Temporary type definition, until @inertiajs/react provides one
9-
interface ResolvedComponent {
10-
default: ReactNode & { layout?: (page: ReactNode) => ReactNode }
11-
}
12-
139
const appName = import.meta.env.VITE_APP_NAME ?? "React Starter Kit"
1410

1511
void createInertiaApp({
@@ -19,9 +15,12 @@ void createInertiaApp({
1915
title: (title) => (title ? `${title} - ${appName}` : appName),
2016

2117
resolve: (name) => {
22-
const pages = import.meta.glob<ResolvedComponent>("../pages/**/*.tsx", {
23-
eager: true,
24-
})
18+
const pages = import.meta.glob<{ default: ResolvedComponent }>(
19+
"../pages/**/*.tsx",
20+
{
21+
eager: true,
22+
},
23+
)
2524
const page = pages[`../pages/${name}.tsx`]
2625
if (!page) {
2726
console.error(`Missing Inertia page component: '${name}.tsx'`)
@@ -31,8 +30,9 @@ void createInertiaApp({
3130
// and use the following line.
3231
// see https://inertia-rails.dev/guide/pages#default-layouts
3332
//
34-
page.default.layout ??= (page) =>
35-
createElement(PersistentLayout, null, page)
33+
page.default.layout ??= (page: ReactNode) => (
34+
<PersistentLayout>{page}</PersistentLayout>
35+
)
3636

3737
return page
3838
},
@@ -51,14 +51,14 @@ void createInertiaApp({
5151
},
5252

5353
defaults: {
54+
form: {
55+
forceIndicesArrayFormatInFormData: true,
56+
},
5457
future: {
5558
useDataInertiaHeadAttribute: true,
5659
useDialogForErrorModal: true,
5760
preserveEqualProps: true,
5861
},
59-
visitOptions: () => {
60-
return { queryStringArrayFormat: "brackets" }
61-
},
6262
},
6363

6464
progress: {

app/frontend/hooks/use-flash.tsx

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
import { router, usePage } from "@inertiajs/react"
2-
import { useEffect, useState } from "react"
1+
import { router } from "@inertiajs/react"
32
import { toast } from "sonner"
43

54
import type { Flash } from "@/types"
65

7-
const emptyFlash = {}
8-
96
export const useFlash = () => {
10-
const { flash } = usePage().props
11-
const [currentFlash, setCurrentFlash] = useState<Flash>(emptyFlash)
12-
13-
useEffect(() => {
14-
setCurrentFlash(flash)
15-
}, [flash])
16-
17-
router.on("start", () => {
18-
setCurrentFlash(emptyFlash)
19-
})
20-
21-
useEffect(() => {
22-
if (currentFlash.alert) {
23-
toast.error(currentFlash.alert)
7+
router.on("beforeUpdate", (event) => {
8+
const flash = event.detail.page.props.flash as Flash
9+
if (flash.alert) {
10+
toast.error(flash.alert)
2411
}
25-
if (currentFlash.notice) {
26-
toast(currentFlash.notice)
12+
if (flash.notice) {
13+
toast(flash.notice)
2714
}
28-
}, [currentFlash])
15+
event.detail.page.props.flash = {}
16+
})
2917
}

eslint.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export default [
3434
{
3535
...importPlugin.flatConfigs.recommended,
3636
...importPlugin.flatConfigs.typescript,
37+
...importPlugin.flatConfigs.react,
38+
settings: { "import/resolver": { typescript: {} } },
3739
rules: {
3840
"import/order": [
3941
"error",
@@ -51,7 +53,16 @@ export default [
5153
},
5254
],
5355
"import/first": "error",
54-
"import/extensions": ["error", "never"],
56+
"import/extensions": [
57+
"error",
58+
"always",
59+
{
60+
js: "never",
61+
jsx: "never",
62+
ts: "never",
63+
tsx: "never",
64+
},
65+
],
5566
"@typescript-eslint/consistent-type-imports": "error",
5667
},
5768
},

0 commit comments

Comments
 (0)