Skip to content

Commit d7baa96

Browse files
Copilottobiasdiez
andauthored
chore: upgrade to Nuxt v4.0.1 (#2714)
This PR successfully upgrades JabRefOnline from Nuxt 3.15.0 to Nuxt v4.0.1 following the [official upgrade guide](https://nuxt.com/docs/4.x/getting-started/upgrade) and merges the latest changes from the main branch. ### Core Upgrade - **Nuxt**: 3.15.0 → 4.0.1 (stable version) - **@nuxt/kit**: 3.15.0 → 4.0.1 - **Nitro**: 2.10.4 → 2.12.5 (automatically updated) --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: tobiasdiez <[email protected]> Co-authored-by: Tobias Diez <[email protected]>
1 parent 3212023 commit d7baa96

File tree

8 files changed

+2856
-2291
lines changed

8 files changed

+2856
-2291
lines changed

layouts/content.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if (import.meta.client) {
8080
value: (option: { top: number; left: number }) => {
8181
const els = document.querySelectorAll(contentElementSelector)
8282
const el = els[els.length - 1]
83-
if (el.scrollHeight > el.clientHeight) {
83+
if (el && el.scrollHeight > el.clientHeight) {
8484
// element can be scrolled
8585
el.scrollTo(option.left, el.scrollTop + option.top - offset)
8686
} else {

nuxt.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ export default defineNuxtConfig({
209209
* SEO configuration
210210
* https://nuxtseo.com/nuxt-seo/guides/configuring-modules
211211
*/
212-
// @ts-expect-error: temporary issue
213212
site: {
214213
// Hide information message during startup
215214
splash: false,
@@ -253,5 +252,5 @@ export default defineNuxtConfig({
253252
* Provide compatibility information for Nitro presets, and Nuxt modules
254253
* https://nuxt.com/docs/api/nuxt-config#compatibilitydate
255254
*/
256-
compatibilityDate: '2024-07-13',
255+
compatibilityDate: '2024-12-24',
257256
})

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@
6868
"ioredis": "5.7.0",
6969
"json-bigint-patch": "0.0.8",
7070
"lodash": "4.17.21",
71-
"pinia": "3.0.2",
71+
"pinia": "3.0.3",
7272
"reflect-metadata": "0.2.2",
7373
"ts-loader": "9.5.4",
7474
"ts-node": "10.9.2",
7575
"tsyringe": "4.10.0",
76-
"unstorage": "1.14.1",
76+
"unstorage": "1.16.1",
7777
"vee-validate": "4.15.0",
7878
"vue": "3.5.21",
7979
"vue-router": "4.5.1",
@@ -84,7 +84,7 @@
8484
"@apollo/utils.keyvaluecache": "4.0.0",
8585
"@azure/core-rest-pipeline": "1.22.0",
8686
"@azure/static-web-apps-cli": "2.0.6",
87-
"@bg-dev/nuxt-naiveui": "v2.0.0-rc.5",
87+
"@bg-dev/nuxt-naiveui": "2.0.0-rc.5",
8888
"@chromatic-com/storybook": "4.1.1",
8989
"@graphql-codegen/add": "5.0.3",
9090
"@graphql-codegen/cli": "5.0.7",
@@ -100,8 +100,8 @@
100100
"@nuxt/content": "3.6.3",
101101
"@nuxt/eslint": "1.5.2",
102102
"@nuxt/icon": "1.15.0",
103-
"@nuxt/kit": "3.15.0",
104-
"@nuxt/test-utils": "3.15.1",
103+
"@nuxt/kit": "4.0.1",
104+
"@nuxt/test-utils": "3.19.2",
105105
"@nuxtjs/seo": "3.1.0",
106106
"@nuxtjs/storybook": "npm:@nuxtjs/storybook@nightly",
107107
"@tailwindcss/forms": "0.5.10",
@@ -131,7 +131,7 @@
131131
"jiti": "2.5.1",
132132
"mount-vue-component": "0.10.2",
133133
"naive-ui": "2.42.0",
134-
"nuxt": "3.15.0",
134+
"nuxt": "4.0.1",
135135
"nuxt-auth-utils": "0.4.4",
136136
"nuxt-graphql-server": "3.1.4",
137137
"oxlint": "1.14.0",

pnpm-lock.yaml

Lines changed: 2837 additions & 2275 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/journals/journal.service.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ describe('userDocumentService', () => {
3030
describe('getJournalById', () => {
3131
it('should return a journal with the given ISSN', async () => {
3232
prisma.journal.findFirst.mockResolvedValue(testJournal)
33-
const journal = await journalService.getJournalByIssn(testJournal.issn[0])
33+
const journal = await journalService.getJournalByIssn(
34+
testJournal.issn[0]!,
35+
)
3436
expect(journal).toBeDefined()
3537
expect(journal).toEqual(testJournal)
3638
expect(prisma.journal.findFirst).toBeCalledWith({

server/user/e2e.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ describe('test-utils', () => {
156156
const { cookies } = await login(request)
157157
expect(cookies.length).toBe(1)
158158
expect(cookies[0]).toMatch('nuxt-session=')
159-
expect(cookies[0].toLowerCase()).toContain('httponly')
160-
expect(cookies[0].toLowerCase()).toContain('secure')
161-
expect(cookies[0].toLowerCase()).toContain('samesite=strict')
159+
expect(cookies[0]!.toLowerCase()).toContain('httponly')
160+
expect(cookies[0]!.toLowerCase()).toContain('secure')
161+
expect(cookies[0]!.toLowerCase()).toContain('samesite=strict')
162162
})
163163
})

server/user/resolvers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ export class UserResolver {
204204
return {
205205
edges: documents.map((document) => ({ node: document })),
206206
pageInfo: {
207-
endCursor: documents.length ? documents[documents.length - 1].id : null,
207+
endCursor: documents.length
208+
? documents[documents.length - 1]?.id
209+
: null,
208210
hasNextPage,
209211
},
210212
}
@@ -244,7 +246,7 @@ export class UserResolver {
244246

245247
function constructCursor(documents: UserDocument[]) {
246248
if (documents.length === 0) return null
247-
const lastDoc = documents[documents.length - 1]
249+
const lastDoc = documents[documents.length - 1]!
248250
return {
249251
id: lastDoc.id,
250252
lastModified: lastDoc.lastModified,

test/email.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function getEmail(email: string): Promise<EmailMessage> {
2525
}, 1000)
2626
})
2727
}
28-
const message = messages[0]
28+
const message = messages[0]!
2929
const messageResponse = await fetch(
3030
`https://www.1secmail.com/api/v1/?action=readMessage&login=${login}&domain=${domain}&id=${message.id}`,
3131
)

0 commit comments

Comments
 (0)