Skip to content

Commit 194dfb0

Browse files
authored
Merge pull request #60 from kilobyteno/develop
2 parents 1c482ed + 54f1b8a commit 194dfb0

File tree

23 files changed

+194
-131
lines changed

23 files changed

+194
-131
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,11 @@ jobs:
2222
npm version ${{ github.event.release.tag_name }}
2323
cd ..
2424
25-
- name: Commit updated package.json
26-
uses: stefanzweifel/git-auto-commit-action@v5
27-
with:
28-
branch: ${{ env.TARGET_BRANCH }}
29-
commit_message: Update version in package.json
30-
file_pattern: package.json
31-
3225
- name: Update version in backend/config.py
3326
run: |
34-
sed -i "s/API_DOCS_VERSION = '.*'/API_DOCS_VERSION = '${{ github.event.release.tag_name }}'/g" backend/config.py
35-
36-
- name: Commit updated backend/config.py
37-
uses: stefanzweifel/git-auto-commit-action@v5
38-
with:
39-
branch: ${{ env.TARGET_BRANCH }}
40-
commit_message: Update version in backend/config.py
41-
file_pattern: backend/config.py
27+
cd backend
28+
echo ${{ github.event.release.tag_name }} > .version
29+
cd ..
4230
4331
- name: Update changelog
4432
uses: stefanzweifel/changelog-updater-action@v1
@@ -50,17 +38,14 @@ jobs:
5038
uses: stefanzweifel/git-auto-commit-action@v5
5139
with:
5240
branch: ${{ env.TARGET_BRANCH }}
53-
commit_message: Update changelog
54-
file_pattern: CHANGELOG.md
55-
56-
- name: Move tag to current commit
57-
run: |
58-
git tag -f ${{ github.event.release.tag_name }}
41+
commit_message: Release version ${{ github.event.release.tag_name }}
5942

60-
- name: Push changes
43+
- name: Force move the tag to the current commit
6144
run: |
62-
git push origin ${{ env.TARGET_BRANCH }}
63-
git push origin ${{ github.event.release.tag_name }}
45+
git config user.name "github-actions[bot]"
46+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
47+
git tag -fa ${{ github.event.release.tag_name }} -m "Release version ${{ github.event.release.tag_name }}"
48+
git push -f --tags
6449
6550
- name: "Send webhook to Discord"
6651
uses: sarisia/actions-status-discord@v1

CHANGELOG.md

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,59 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## 3.0.0-alpha.0 - A New Beginning - 2025-01-10
65

7-
We are thrilled to announce the upcoming release of **LAN-party Management System (LANMS) 3.0**, a modern, web-based application designed to help you effortlessly manage your LAN-party events. Whether it's tournaments, games, tickets, or participants, LANMS is crafted to make event organization a breeze.
6+
## 3.0.0-alpha.8 - 2025-01-10
87

9-
### What is LANMS?
8+
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.7...3.0.0-alpha.8
109

11-
LANMS is your go-to solution for managing LAN-party events, designed to handle everything from game setup to participant management.
10+
## 3.0.0-alpha.7 - 2025-01-10
1211

13-
LANMS will offer both **self-hosted** and **cloud-based** options, giving you the flexibility to manage your events the way you prefer.
12+
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.6...3.0.0-alpha.7
1413

15-
### Current Project Status
14+
## 3.0.0-alpha.6 - 2025-01-10
1615

17-
LANMS 3.0 is currently **under active development** and not yet ready for production use. Originally started in February 2023, the project encountered delays due to unforeseen circumstances. However, as of **September 25th, 2024**, we have officially restarted development from scratch, focusing on making LANMS 3.0 more **user-friendly, scalable, flexible,** and **open-source**.
16+
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.5...3.0.0-alpha.6
1817

19-
Our goal is to deliver an advanced, community-driven platform that sets a new standard in LAN-party management.
18+
## 3.0.0-alpha.5 - 2025-01-10
2019

21-
### A Brief History
20+
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.4...3.0.0-alpha.5
2221

23-
LANMS has a rich history, with its origins dating back to **2014**, when [dsbilling](https://dsbilling.no) joined forces with [chilloman](https://github.com/chilloman) to build a system for a LAN-party event. The original version, **LANMS 1.0**, was heavily hardcoded for a specific event and remains closed-source for now.
22+
## 3.0.0-alpha.4 - 2025-01-10
2423

25-
In **February 2015**, the project evolved into **LANMS 2.0**, a more flexible and scalable version, which was maintained privately until now and will become **open-source** in late September 2024 as **LANMS Legacy**.
24+
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.3...3.0.0-alpha.4
2625

27-
LANMS 3.0, a complete rewrite of the previous version, marks a significant leap forward. Built with modern technologies and a strong focus on flexibility and user experience, it promises to be a powerful tool for LAN-party organizers across the globe.
26+
## 3.0.0-alpha.3 - 2025-01-09
2827

29-
### What’s Next?
28+
### Changed
3029

31-
We are dedicated to delivering a robust platform, and we invite the community to follow our progress as we work toward the first public release of LANMS 3.0. Stay tuned for updates and opportunities to contribute!
30+
- **Enhanced GitHub Action Workflow**:
31+
32+
- Updated to use a new environment variable for more flexible management.
33+
- Now handles updates to critical files (`package.json`, `backend/config.py`) that track software versioning.
34+
- Improved automation ensures effective tracking and management of software changes.
35+
36+
- **Frontend Markdown Component Styling**:
37+
38+
- Slight adjustments to the `ReactMarkdown` component for a more refined display experience.
39+
40+
- **Styling Adjustments to the Changelog Page**:
41+
42+
- Increased the size of the main title (`CardTitle` component) to improve readability and visual appeal.
43+
44+
45+
### Added
3246

47+
- **Utility Function Simplification**:
48+
- Consolidated date-utilities into `frontend/src/lib/utils.ts` for better organization and maintainability.
49+
3350

34-
---
51+
### Removed
3552

36-
**Follow development on [GitHub](https://github.com/kilobyteno/lanms), join us on [Discord](https://kilobyte.no/discord) and help us in building the future of LAN-party management!**
53+
- **Redundant Files**:
54+
- Deleted the redundant file `frontend/src/lib/date.ts` to eliminate duplications in the codebase.
55+
56+
57+
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.2...3.0.0-alpha.3
3758

3859
## 3.0.0-alpha.2 - 2025-01-02
3960

backend/.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0.0-alpha.8

backend/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ class Config:
114114
# API Docs
115115
API_DOCS_TITLE: str = f'{MICRO_SERVICE_NAME_FOR_HUMANS} API'
116116
API_DOCS_VERSION: str = '3.0.0-alpha.1'
117+
try:
118+
with open('.version') as version_file:
119+
API_DOCS_VERSION: str = version_file.read().strip()
120+
except Exception as e:
121+
logging.error(f'Error reading version file: {e}')
117122
API_DOCS_DESCRIPTION: str = f'Endpoints for the {MICRO_SERVICE_NAME_FOR_HUMANS}'
118123
API_DOCS_OPENAPI_URL: Optional[str] = None if MICRO_SERVICE_IN_PRODUCTION else '/openapi.json'
119124
API_DOCS_URL: str = '/docs'

frontend/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<!--<link rel="icon" type="image/svg+xml" href="/vite.svg" />-->
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>LANMS</title>
88
</head>

frontend/package-lock.json

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

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lanms-frontend",
33
"private": true,
4-
"version": "3.0.0-alpha.1",
4+
"version": "3.0.0-alpha.8",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

frontend/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {AuthProvider} from './context/AuthContext';
33
import {OrganisationProvider} from './context/OrganisationContext';
44
import {EventProvider} from './context/EventContext';
55
import {router} from './routes';
6-
import {ThemeProvider} from "@/components/theme-provider.tsx";
6+
import {ThemeProvider} from "@/providers/theme-provider";
77

88
function App() {
99
return (
10-
<ThemeProvider defaultTheme="light" storageKey="lanms-ui-theme">
10+
<ThemeProvider>
1111
<AuthProvider>
1212
<OrganisationProvider>
1313
<EventProvider>

frontend/src/components/nav-theme-switch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
DropdownMenuItem,
66
DropdownMenuTrigger,
77
} from "@/components/ui/dropdown-menu"
8-
import {useTheme} from "@/components/theme-provider"
98
import {DesktopTower, Moon, Sun} from "@phosphor-icons/react";
109
import {useTranslation} from "react-i18next";
1110
import {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from "@/components/ui/tooltip.tsx";
11+
import { useTheme } from "@/providers/theme-provider"
1212

1313
export function NavThemeSwitch() {
1414
const {setTheme, theme} = useTheme()
Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {createContext, useContext, useEffect, useState} from "react"
1+
import { createContext, useContext, useEffect, useState } from "react"
22

33
type Theme = "dark" | "light" | "system"
44

@@ -21,38 +21,52 @@ const initialState: ThemeProviderState = {
2121
const ThemeProviderContext = createContext<ThemeProviderState>(initialState)
2222

2323
export function ThemeProvider({
24-
children,
25-
defaultTheme = "system",
26-
storageKey = "lanms-ui-theme",
27-
...props
28-
}: ThemeProviderProps) {
29-
const [theme, setTheme] = useState<Theme>(
30-
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
31-
)
24+
children,
25+
defaultTheme = "system",
26+
storageKey = "theme",
27+
...props
28+
}: ThemeProviderProps) {
29+
const [theme, setTheme] = useState<Theme>(() => {
30+
const storedTheme = localStorage.getItem(storageKey) as Theme
31+
return storedTheme || defaultTheme
32+
})
3233

3334
useEffect(() => {
3435
const root = window.document.documentElement
36+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)")
3537

38+
// Remove existing theme classes
3639
root.classList.remove("light", "dark")
3740

38-
if (theme === "system") {
39-
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
40-
.matches
41-
? "dark"
42-
: "light"
41+
// Apply theme
42+
const applyTheme = (theme: Theme) => {
43+
if (theme === "system") {
44+
const systemTheme = mediaQuery.matches ? "dark" : "light"
45+
root.classList.add(systemTheme)
46+
} else {
47+
root.classList.add(theme)
48+
}
49+
}
50+
51+
// Initial theme application
52+
applyTheme(theme)
4353

44-
root.classList.add(systemTheme)
45-
return
54+
// Listen for system theme changes
55+
const handleChange = () => {
56+
if (theme === "system") {
57+
applyTheme("system")
58+
}
4659
}
4760

48-
root.classList.add(theme)
61+
mediaQuery.addEventListener("change", handleChange)
62+
return () => mediaQuery.removeEventListener("change", handleChange)
4963
}, [theme])
5064

5165
const value = {
5266
theme,
53-
setTheme: (theme: Theme) => {
54-
localStorage.setItem(storageKey, theme)
55-
setTheme(theme)
67+
setTheme: (newTheme: Theme) => {
68+
localStorage.setItem(storageKey, newTheme)
69+
setTheme(newTheme)
5670
},
5771
}
5872

@@ -66,8 +80,9 @@ export function ThemeProvider({
6680
export const useTheme = () => {
6781
const context = useContext(ThemeProviderContext)
6882

69-
if (context === undefined)
83+
if (context === undefined) {
7084
throw new Error("useTheme must be used within a ThemeProvider")
85+
}
7186

7287
return context
7388
}

0 commit comments

Comments
 (0)