From 90e6842d71f56e2c19b4764ab6f77e56dd5be9c9 Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Wed, 27 Aug 2025 22:51:50 +0200 Subject: [PATCH 1/4] setup ci, fix files using biome --- .gitlab-ci.yml | 19 +++++++++++++++++++ .prettierignore | 3 --- .prettierrc | 4 ---- biome.json | 1 - eslint.config.js | 4 ++-- src/api/homeAssistant.ts | 16 +++++++++------- .../DepartureList/DepartureList.tsx | 6 +++--- src/components/Flatastic/Flatastic.tsx | 2 +- .../HomeAssistant/HomeAssistant.tsx | 8 ++++++-- 9 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 .gitlab-ci.yml delete mode 100644 .prettierignore delete mode 100644 .prettierrc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f25c9ab --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +default: + image: oven/bun + +stages: + - build + - lint + +build: + tags: + - linux + + +lint: + tags: + - linux + script: + - bun install -g biome + - biome check + - biome lint \ No newline at end of file diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 1b8ac88..0000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore artifacts: -build -coverage diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 55ea2b2..0000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "tabWidth": 4, - "useTabs": false -} diff --git a/biome.json b/biome.json index 6f79c00..8a3e2dc 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,4 @@ { - "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json", "vcs": { "enabled": false, "clientKind": "git", diff --git a/eslint.config.js b/eslint.config.js index 47fbe76..7fcd840 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,9 +1,9 @@ import js from "@eslint/js"; -import globals from "globals"; +import { globalIgnores } from "eslint/config"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; +import globals from "globals"; import tseslint from "typescript-eslint"; -import { globalIgnores } from "eslint/config"; export default tseslint.config([ globalIgnores(["dist"]), diff --git a/src/api/homeAssistant.ts b/src/api/homeAssistant.ts index ded16d7..a621fb5 100644 --- a/src/api/homeAssistant.ts +++ b/src/api/homeAssistant.ts @@ -1,12 +1,14 @@ -const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkMjQ1OTg0YjliYzE0OTNjYTdmZDJmNTA3ODgzN2U1YSIsImlhdCI6MTc1MzQwMjAzNiwiZXhwIjoyMDY4NzYyMDM2fQ.fnLSFKPdk8lkAEB-4ekdGUJ1PSCBxcAyasQF1PyrD3k"; +const token = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkMjQ1OTg0YjliYzE0OTNjYTdmZDJmNTA3ODgzN2U1YSIsImlhdCI6MTc1MzQwMjAzNiwiZXhwIjoyMDY4NzYyMDM2fQ.fnLSFKPdk8lkAEB-4ekdGUJ1PSCBxcAyasQF1PyrD3k"; async function fetchTentHumidity() { - const url = "/api/states/sensor.third_reality_inc_3rths0224z_luftfeuchtigkeit_2"; + const url = + "/api/states/sensor.third_reality_inc_3rths0224z_luftfeuchtigkeit_2"; const response = await fetch(url, { method: "GET", headers: { - "Authorization": `Bearer ${token}`, - } + Authorization: `Bearer ${token}`, + }, }); const data = await response.json(); @@ -18,8 +20,8 @@ async function fetchTentTemperature() { const response = await fetch(url, { method: "GET", headers: { - "Authorization": `Bearer ${token}`, - } + Authorization: `Bearer ${token}`, + }, }); const data = await response.json(); @@ -27,4 +29,4 @@ async function fetchTentTemperature() { return data.state; } -export { fetchTentHumidity, fetchTentTemperature }; \ No newline at end of file +export { fetchTentHumidity, fetchTentTemperature }; diff --git a/src/components/DepartureList/DepartureList.tsx b/src/components/DepartureList/DepartureList.tsx index 12ca5e4..376b813 100644 --- a/src/components/DepartureList/DepartureList.tsx +++ b/src/components/DepartureList/DepartureList.tsx @@ -60,9 +60,9 @@ export default function DepartureList(props: {

{name} Departures

- {departureTables(left)} - {departureTables(right)} -
+ {departureTables(left)} + {departureTables(right)} +
); } diff --git a/src/components/Flatastic/Flatastic.tsx b/src/components/Flatastic/Flatastic.tsx index cea8544..dc4894c 100644 --- a/src/components/Flatastic/Flatastic.tsx +++ b/src/components/Flatastic/Flatastic.tsx @@ -1,5 +1,5 @@ -import { useFlatasticStore } from "@/store/flatastic"; import { useEffect } from "react"; +import { useFlatasticStore } from "@/store/flatastic"; import type { FlatasticChore } from "@/types/flatasticChore"; diff --git a/src/components/HomeAssistant/HomeAssistant.tsx b/src/components/HomeAssistant/HomeAssistant.tsx index 4d4ac81..472a8a1 100644 --- a/src/components/HomeAssistant/HomeAssistant.tsx +++ b/src/components/HomeAssistant/HomeAssistant.tsx @@ -2,8 +2,12 @@ import { useEffect } from "react"; import { useHomeAssistantStore } from "@/store/homeAssistant"; export default function Timetable() { - const fetchHomeAssistantData = useHomeAssistantStore((state) => state.fetch); - const tentTemperature = useHomeAssistantStore((state) => state.tentTemperature); + const fetchHomeAssistantData = useHomeAssistantStore( + (state) => state.fetch, + ); + const tentTemperature = useHomeAssistantStore( + (state) => state.tentTemperature, + ); const tentHumidity = useHomeAssistantStore((state) => state.tentHumidity); useEffect(() => { From 4ae7e7968b5c3f52c6654ef748760a071dac0aa5 Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Wed, 27 Aug 2025 22:54:09 +0200 Subject: [PATCH 2/4] fix gitlab ci yml --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f25c9ab..0aad7e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,11 +6,15 @@ stages: - lint build: + stage: build tags: - linux - + script: + - bun install + - bun run build lint: + stage: lint tags: - linux script: From 741720ed07c84f0835f3c156cbebb791141a93d1 Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Wed, 27 Aug 2025 23:34:53 +0200 Subject: [PATCH 3/4] add build image script --- pipeline/build-image.sh | 1 + 1 file changed, 1 insertion(+) create mode 100755 pipeline/build-image.sh diff --git a/pipeline/build-image.sh b/pipeline/build-image.sh new file mode 100755 index 0000000..cc1f786 --- /dev/null +++ b/pipeline/build-image.sh @@ -0,0 +1 @@ +#!/bin/bash \ No newline at end of file From 16131521bc6954df62683add292ff03c3c84590e Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Wed, 27 Aug 2025 23:38:47 +0200 Subject: [PATCH 4/4] remove tags from gitlab yaml --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0aad7e9..d1a7d3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,16 +7,12 @@ stages: build: stage: build - tags: - - linux script: - bun install - bun run build lint: stage: lint - tags: - - linux script: - bun install -g biome - biome check