From c261d333bd1ee2713d023c7ac805e86f899bd916 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Wed, 5 Mar 2025 12:58:43 +0100 Subject: [PATCH 1/5] Fix issue with Typescript compiler Signed-off-by: Christian Wolf --- src/guest.ts | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guest.ts b/src/guest.ts index 75dbcf265..85a45a6b8 100644 --- a/src/guest.ts +++ b/src/guest.ts @@ -14,7 +14,7 @@ import AppInvalidGuest from './components/AppInvalidGuest.vue'; declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any - OC: any; + OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | Nextcloud.v20.OC; n: string; t: string; } diff --git a/src/main.ts b/src/main.ts index d377bd4f2..611be065b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -24,7 +24,7 @@ import AppMain from './components/AppMain.vue'; declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any - OC: any; + OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | Nextcloud.v20.OC; n: string; t: string; escapeHTML(text: string): string; From 37ec5f3c4ba5ab8e0283e620041be62a998b4b35 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Wed, 5 Mar 2025 13:00:41 +0100 Subject: [PATCH 2/5] Make prettier happy Signed-off-by: Christian Wolf --- src/guest.ts | 7 ++++++- src/main.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/guest.ts b/src/guest.ts index 85a45a6b8..24edbc419 100644 --- a/src/guest.ts +++ b/src/guest.ts @@ -14,7 +14,12 @@ import AppInvalidGuest from './components/AppInvalidGuest.vue'; declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any - OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | Nextcloud.v20.OC; + OC: + | Nextcloud.v16.OC + | Nextcloud.v17.OC + | Nextcloud.v18.OC + | Nextcloud.v19.OC + | Nextcloud.v20.OC; n: string; t: string; } diff --git a/src/main.ts b/src/main.ts index 611be065b..5be8f4f01 100644 --- a/src/main.ts +++ b/src/main.ts @@ -24,7 +24,12 @@ import AppMain from './components/AppMain.vue'; declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any - OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | Nextcloud.v20.OC; + OC: + | Nextcloud.v16.OC + | Nextcloud.v17.OC + | Nextcloud.v18.OC + | Nextcloud.v19.OC + | Nextcloud.v20.OC; n: string; t: string; escapeHTML(text: string): string; From 6b6a21b6b8c5f36bf4330aad389e4e5521df5a26 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Wed, 5 Mar 2025 13:14:12 +0100 Subject: [PATCH 3/5] Update Changelog Signed-off-by: Christian Wolf --- .changelog/current/2682-fix-typescript.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/current/2682-fix-typescript.md diff --git a/.changelog/current/2682-fix-typescript.md b/.changelog/current/2682-fix-typescript.md new file mode 100644 index 000000000..e56de39a1 --- /dev/null +++ b/.changelog/current/2682-fix-typescript.md @@ -0,0 +1,3 @@ +# Fixed + +- Typescript error during building of app frontend From 4ea1d25754aa91558877210e2b5e7312f211ae25 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Wed, 5 Mar 2025 13:48:09 +0100 Subject: [PATCH 4/5] Install TS package Signed-off-by: Christian Wolf --- package-lock.json | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index 27c4329bb..2b69c75d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^3.0.0", "@nextcloud/stylelint-config": "^3.0.1", + "@nextcloud/typings": "^1.9.1", "@nextcloud/webpack-vue-config": "^6.0.0", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.8", diff --git a/package.json b/package.json index 9edf56711..38689b924 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^3.0.0", "@nextcloud/stylelint-config": "^3.0.1", + "@nextcloud/typings": "^1.9.1", "@nextcloud/webpack-vue-config": "^6.0.0", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.8", From 3bbbc8c5e80d53c12cd46dbaf0c5211936758afc Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Wed, 5 Mar 2025 15:00:41 +0100 Subject: [PATCH 5/5] Use NC typings library Signed-off-by: Christian Wolf --- package-lock.json | 2 +- package.json | 2 +- src/guest.ts | 2 ++ src/main.ts | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b69c75d1..342e382ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@nextcloud/event-bus": "^3.1.0", "@nextcloud/moment": "^1.2.2", "@nextcloud/router": "^3.0.1", + "@nextcloud/typings": "^1.9.1", "@nextcloud/vue": "^8.3.0", "caret-pos": "^2.0.0", "fuse.js": "^7.0.0", @@ -35,7 +36,6 @@ "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^3.0.0", "@nextcloud/stylelint-config": "^3.0.1", - "@nextcloud/typings": "^1.9.1", "@nextcloud/webpack-vue-config": "^6.0.0", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.8", diff --git a/package.json b/package.json index 38689b924..04755abf6 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@nextcloud/event-bus": "^3.1.0", "@nextcloud/moment": "^1.2.2", "@nextcloud/router": "^3.0.1", + "@nextcloud/typings": "^1.9.1", "@nextcloud/vue": "^8.3.0", "caret-pos": "^2.0.0", "fuse.js": "^7.0.0", @@ -56,7 +57,6 @@ "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^3.0.0", "@nextcloud/stylelint-config": "^3.0.1", - "@nextcloud/typings": "^1.9.1", "@nextcloud/webpack-vue-config": "^6.0.0", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.8", diff --git a/src/guest.ts b/src/guest.ts index 24edbc419..7ce32a605 100644 --- a/src/guest.ts +++ b/src/guest.ts @@ -5,6 +5,8 @@ * @license AGPL3 or later */ +/// + import Vue from 'vue'; import { useStore } from './store'; diff --git a/src/main.ts b/src/main.ts index 5be8f4f01..b5f9ba056 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,6 +5,8 @@ * @license AGPL3 or later */ +/// + // Markdown import VueShowdown from 'vue-showdown';