Skip to content

Commit 9ac8a5e

Browse files
authored
feat: depricate cheriot, upgrade merino to Nuxt 4 (#55)
1 parent bfb6a33 commit 9ac8a5e

21 files changed

+87
-132
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ jobs:
9191

9292
# start prod-app
9393
- name: app:run in prod
94+
env:
95+
AUTH_ORIGIN: http://localhost:3000/api/auth
9496
run: "cd my-sidebase-app && npm run build && timeout 30 npm run preview || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
9597

9698
# start dev-app and curl from it
9799
- name: app:test in prod
100+
env:
101+
AUTH_ORIGIN: http://localhost:3000/api/auth
98102
run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 20 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"

src/configs/droneCI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ trigger:
1010
1111
steps:
1212
- name: lint-and-typecheck
13-
image: node:20.9.0-slim
13+
image: node:24.10.0-slim
1414
commands:
1515
- npm i -g @antfu/ni
1616
- nci
1717
- nr lint
1818
- nr typecheck
1919
- name: build
20-
image: node:20.9.0-slim
20+
image: node:24.10.0-slim
2121
commands:
2222
- npm i -g @antfu/ni
2323
- nci

src/configs/eslint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ const eslint: Config = {
4848
dependencies: [
4949
{
5050
name: 'eslint',
51-
version: '^9.18.0',
51+
version: '^9.37.0',
5252
isDev: true
5353
},
5454
{
5555
name: '@antfu/eslint-config',
56-
version: '^3.15.0',
56+
version: '^5.4.1',
5757
isDev: true
5858
},
5959
{
6060
name: 'oxlint',
61-
version: '^0.15.7',
61+
version: '^1.20.0',
6262
isDev: true
6363
}
6464
],

src/configs/github-actions.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ on:
99
pull_request:
1010
branches: [ main ]
1111
12+
env:
13+
NODE_VERSION: '24.10.0'
14+
1215
jobs:
1316
lint:
1417
runs-on: ubuntu-latest
1518
steps:
1619
- uses: actions/checkout@v4
17-
- name: Use Node.js 20.6.1
20+
- name: Use Node.js $/{{ env.NODE_VERSION }}
1821
uses: actions/setup-node@v4
1922
with:
20-
node-version: 20.6.1
23+
node-version: $/{{ env.NODE_VERSION }}
2124
2225
- name: Setup
2326
run: npm i -g @antfu/ni
@@ -32,10 +35,10 @@ jobs:
3235
runs-on: ubuntu-latest
3336
steps:
3437
- uses: actions/checkout@v4
35-
- name: Use Node.js 20.6.1
38+
- name: Use Node.js $/{{ env.NODE_VERSION }}
3639
uses: actions/setup-node@v4
3740
with:
38-
node-version: 20.6.1
41+
node-version: $/{{ env.NODE_VERSION }}
3942
4043
- name: Setup
4144
run: npm i -g @antfu/ni

src/configs/i18n.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const i18n: ModuleConfig = {
5050
dependencies: [
5151
{
5252
name: '@nuxtjs/i18n',
53-
version: '^9.2.1',
53+
version: '^10.1.0',
5454
isDev: true
5555
}
5656
],
@@ -64,9 +64,7 @@ const i18n: ModuleConfig = {
6464
],
6565
strategy: 'prefix_except_default',
6666
detectBrowserLanguage: false,
67-
lazy: true,
6867
experimental: {
69-
autoImportTranslationFunctions: true,
7068
localeDetector: 'localeDetector.ts'
7169
}
7270
}
@@ -81,7 +79,7 @@ const i18n: ModuleConfig = {
8179
content: englishLocaleFile
8280
},
8381
{
84-
path: 'components/Welcome/I18nDemo.vue',
82+
path: 'app/components/Welcome/I18nDemo.vue',
8583
content: i18nDemoComponent
8684
}
8785
],

src/configs/naiveui.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const naiveui: ModuleConfig = {
4242
dependencies: [
4343
{
4444
name: '@bg-dev/nuxt-naiveui',
45-
version: '2.0.0-rc.4',
45+
version: '2.0.0',
4646
isDev: true
4747
}
4848
],
@@ -51,11 +51,11 @@ const naiveui: ModuleConfig = {
5151
},
5252
files: [
5353
{
54-
path: 'components/Welcome/NaiveDemo.vue',
54+
path: 'app/components/Welcome/NaiveDemo.vue',
5555
content: naiveDemoComponent
5656
},
5757
{
58-
path: 'app.vue',
58+
path: 'app/app.vue',
5959
content: nuxtAppVueWithNaiveConfig
6060
}
6161
],

src/configs/prisma.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ const prismaRootSchema = `// This is your Prisma schema file,
66
// learn more about it in the docs: https://pris.ly/d/prisma-schema
77
88
generator client {
9-
provider = "prisma-client-js"
10-
previewFeatures = ["prismaSchemaFolder"]
9+
provider = "prisma-client"
10+
output = "./client"
11+
12+
// NOTE: \`library\` will be deprecated in Prisma 7 where \`client\`, which is officially stable ("Generally Available") since Prisma 6.16, will become the new default.
13+
// Nevertheless, at this time, there seem to be substantial problems with the \`client\` engine, forcing us to revert to \`library\`
14+
engineType = "library"
1115
}
1216
1317
datasource db {
@@ -21,9 +25,8 @@ datasource db {
2125
// This is required for development only.
2226
shadowDatabaseUrl = "postgres://postgres@localhost/prisma-shadow?pgbouncer=true&connection_limit=1"
2327
}
24-
`
2528
26-
const prismaExampleSchema = `model Example {
29+
model Example {
2730
id String @id @default(uuid())
2831
details String
2932
}
@@ -49,7 +52,8 @@ const prismaExampleEndpoint = `/**
4952
export default defineEventHandler(event => event.context.prisma.example.findMany())
5053
`
5154

52-
const prismaServerMiddleware = `import { PrismaClient } from '@prisma/client'
55+
const prismaServerMiddleware = `import { PrismaPg } from '@prisma/adapter-pg'
56+
import { PrismaClient } from '~~/prisma/client/client'
5357
5458
let prisma: PrismaClient
5559
@@ -61,7 +65,8 @@ declare module 'h3' {
6165
6266
export default eventHandler((event) => {
6367
if (!prisma) {
64-
prisma = new PrismaClient()
68+
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
69+
prisma = new PrismaClient({ adapter })
6570
}
6671
event.context.prisma = prisma
6772
})
@@ -166,20 +171,25 @@ const prisma: ModuleConfig = {
166171
scripts: [
167172
{
168173
name: 'db',
169-
command: 'vite-node prisma/pglite.ts',
174+
command: 'node prisma/pglite.ts',
170175
}
171176
],
172177
dependencies: [
173178
{
174179
name: 'prisma',
175-
version: '^5.22.0',
180+
version: '^6.17.1',
176181
isDev: true
177182
},
178183
{
179184
name: '@prisma/client',
180-
version: '^5.22.0',
185+
version: '^6.17.1',
181186
isDev: false
182187
},
188+
{
189+
name: '@prisma/adapter-pg',
190+
version: '^6.17.1',
191+
isDev: false,
192+
},
183193
{
184194
name: '@electric-sql/pglite',
185195
version: '0.2.13',
@@ -189,11 +199,6 @@ const prisma: ModuleConfig = {
189199
name: 'pg-gateway',
190200
version: '0.3.0-beta.3',
191201
isDev: true,
192-
},
193-
{
194-
name: 'vite-node',
195-
version: '^2.1.5',
196-
isDev: true,
197202
}
198203
],
199204
nuxtConfig: {},
@@ -203,13 +208,9 @@ const prisma: ModuleConfig = {
203208
content: prismaEnvFile
204209
},
205210
{
206-
path: 'prisma/schema/schema.prisma',
211+
path: 'prisma/schema.prisma',
207212
content: prismaRootSchema
208213
},
209-
{
210-
path: 'prisma/schema/example.prisma',
211-
content: prismaExampleSchema
212-
},
213214
{
214215
path: 'server/api/examples.get.ts',
215216
content: prismaExampleEndpoint
@@ -219,7 +220,7 @@ const prisma: ModuleConfig = {
219220
content: prismaServerMiddleware
220221
},
221222
{
222-
path: 'components/Welcome/PrismaDemo.vue',
223+
path: 'app/components/Welcome/PrismaDemo.vue',
223224
content: prismaDemoComponent,
224225
},
225226
{

src/configs/sidebase-auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const sidebaseAuth: ModuleConfig = {
8686
dependencies: [
8787
{
8888
name: '@sidebase/nuxt-auth',
89-
version: '^0.9.4',
89+
version: '^1.1.0',
9090
isDev: true
9191
},
9292
{
@@ -105,7 +105,7 @@ const sidebaseAuth: ModuleConfig = {
105105
content: nuxtAuthServerFile
106106
},
107107
{
108-
path: 'components/Welcome/AuthDemo.vue',
108+
path: 'app/components/Welcome/AuthDemo.vue',
109109
content: authDemoComponent
110110
}
111111
],

src/configs/tailwind.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const tailwind: ModuleConfig = {
2121
dependencies: [
2222
{
2323
name: '@nuxtjs/tailwindcss',
24-
version: '^6.13.1',
24+
version: '^6.14.0',
2525
isDev: true
2626
}
2727
],
@@ -30,7 +30,7 @@ const tailwind: ModuleConfig = {
3030
},
3131
files: [
3232
{
33-
path: 'components/Welcome/TailwindDemo.vue',
33+
path: 'app/components/Welcome/TailwindDemo.vue',
3434
content: tailwindDemoComponent,
3535
}
3636
],

src/configs/trpc.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const nuxtTrpcRootConfig = `/**
1010
* @see https://trpc.io/docs/v10/router
1111
* @see https://trpc.io/docs/v10/procedures
1212
*/
13-
import type { Context } from '~/server/trpc/context'
13+
import type { Context } from '~~/server/trpc/context'
1414
import { initTRPC } from '@trpc/server'
1515
import superjson from 'superjson'
1616
@@ -69,8 +69,8 @@ export type Context = inferAsyncReturnType<typeof createContext>
6969
`
7070

7171
const nuxtTrpcApiHandler = `import { createNuxtApiHandler } from 'trpc-nuxt'
72-
import { createContext } from '~/server/trpc/context'
73-
import { appRouter } from '~/server/trpc/routers'
72+
import { createContext } from '~~/server/trpc/context'
73+
import { appRouter } from '~~/server/trpc/routers'
7474
7575
// export API handler
7676
export default createNuxtApiHandler({
@@ -79,7 +79,7 @@ export default createNuxtApiHandler({
7979
})
8080
`
8181

82-
const nuxtTrpcPlugin = `import type { AppRouter } from '~/server/trpc/routers'
82+
const nuxtTrpcPlugin = `import type { AppRouter } from '~~/server/trpc/routers'
8383
import superjson from 'superjson'
8484
import { createTRPCNuxtClient, httpBatchLink } from 'trpc-nuxt/client'
8585
@@ -89,10 +89,10 @@ export default defineNuxtPlugin(() => {
8989
* built on top of \`useAsyncData\`.
9090
*/
9191
const client = createTRPCNuxtClient<AppRouter>({
92-
transformer: superjson,
9392
links: [
9493
httpBatchLink({
95-
url: '/api/trpc'
94+
url: '/api/trpc',
95+
transformer: superjson
9696
})
9797
]
9898
})
@@ -126,33 +126,33 @@ const hello = await $client.hello.useQuery({ text: 'client' })
126126
`
127127

128128
const trpc: ModuleConfig = {
129-
humanReadableName: 'tRPC 10',
129+
humanReadableName: 'tRPC',
130130
description: 'Build end-to-end typesafe APIs in Nuxt applications. See more: https://trpc.io/',
131131
scripts: [],
132132
dependencies: [
133133
{
134134
name: '@trpc/server',
135-
version: '^10.45.2',
135+
version: '^11.6.0',
136136
isDev: false
137137
},
138138
{
139139
name: '@trpc/client',
140-
version: '^10.45.2',
140+
version: '^11.6.0',
141141
isDev: false
142142
},
143143
{
144144
name: 'trpc-nuxt',
145-
version: '^0.10.21',
145+
version: '^1.2.0',
146146
isDev: false
147147
},
148148
{
149149
name: 'zod',
150-
version: '^3.23.8',
150+
version: '^4.1.12',
151151
isDev: false
152152
},
153153
{
154154
name: 'superjson',
155-
version: '^2.2.1',
155+
version: '^2.2.2',
156156
isDev: false
157157
}
158158
],
@@ -179,11 +179,11 @@ const trpc: ModuleConfig = {
179179
content: nuxtTrpcApiHandler
180180
},
181181
{
182-
path: 'plugins/trpcClient.ts',
182+
path: 'app/plugins/trpcClient.ts',
183183
content: nuxtTrpcPlugin
184184
},
185185
{
186-
path: 'components/Welcome/TRPCDemo.vue',
186+
path: 'app/components/Welcome/TRPCDemo.vue',
187187
content: trpcDemoComponent,
188188
}
189189
],

0 commit comments

Comments
 (0)