Merge pull request 'dev' (#9) from dev into main
All checks were successful
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Successful in 1m58s
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

Reviewed-on: #9
This commit was merged in pull request #9.
This commit is contained in:
2026-04-27 16:52:43 +02:00
3 changed files with 21 additions and 6 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.1.3", "version": "1.1.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.1.3", "version": "1.1.4",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@pinia/nuxt": "^0.11.2", "@pinia/nuxt": "^0.11.2",

View File

@@ -1,6 +1,6 @@
{ {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.1.3", "version": "1.1.4",
"description": "Moderne Webseite für den Harheimer Tischtennis Club", "description": "Moderne Webseite für den Harheimer Tischtennis Club",
"private": true, "private": true,
"type": "module", "type": "module",

View File

@@ -3,9 +3,24 @@ import path from 'path'
import { getUserFromToken } from '../../utils/auth.js' import { getUserFromToken } from '../../utils/auth.js'
async function readPackageVersion() { async function readPackageVersion() {
const packageJsonPath = path.join(process.cwd(), 'package.json') const cwd = process.cwd()
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8')) const candidatePaths = [
return String(packageJson.version || '') path.join(cwd, 'package.json'),
path.join(cwd, '../package.json')
]
for (const packageJsonPath of candidatePaths) {
try {
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'))
if (packageJson?.version) {
return String(packageJson.version)
}
} catch (_error) {
// Try next candidate path (e.g. .output runtime)
}
}
return ''
} }
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {