7 Commits

Author SHA1 Message Date
Tobias Klemp
9f66da7904 check api key
All checks were successful
CI / build-and-test (pull_request) Successful in 14m42s
2025-12-07 20:14:00 +01:00
Tobias Klemp
dbe95b9352 try github for faster download
Some checks failed
CI / build-and-test (pull_request) Failing after 14m23s
2025-12-07 19:24:47 +01:00
Tobias Klemp
66651f64f8 add node for svelte-kit sync
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
2025-12-07 18:59:16 +01:00
Tobias Klemp
380ad293e7 hopefully check fixed
Some checks failed
CI / build-and-test (pull_request) Failing after 14m7s
2025-12-07 18:42:05 +01:00
Tobias Klemp
b1ab2c02b8 fix: new bun version and script to use node_modules
Some checks failed
CI / build-and-test (pull_request) Failing after 13m7s
2025-12-07 16:50:54 +01:00
Tobias Klemp
6581cff44f fix: env variables
Some checks failed
CI / build-and-test (pull_request) Failing after 11m37s
2025-12-07 16:29:37 +01:00
Tobias Klemp
e1f1e867d6 fix
Some checks failed
CI / build-and-test (pull_request) Failing after 7m55s
2025-12-07 15:45:47 +01:00
5 changed files with 26 additions and 18 deletions

View File

@@ -13,11 +13,18 @@ jobs:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Install bun - name: Install bun
uses: oven-sh/setup-bun@v2 uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.4
- name: Install dependencies - name: Install dependencies
run: bun install run: bun ci
- name: Build app - name: Build app
run: bun --bun run build run: bun --bun run build

View File

@@ -1,5 +1,6 @@
{ {
"lockfileVersion": 1, "lockfileVersion": 1,
"configVersion": 0,
"workspaces": { "workspaces": {
"": { "": {
"name": "rbw", "name": "rbw",

View File

@@ -5,14 +5,14 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "./node_modules/vite/bin/vite.js build",
"preview": "vite preview", "preview": "vite preview",
"prepare": "svelte-kit sync || echo ''", "prepare": "./node_modules/@sveltejs/kit/svelte-kit.js sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "./node_modules/@sveltejs/kit/svelte-kit.js sync && ./node_modules/svelte-check/bin/svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "./node_modules/@sveltejs/kit/svelte-kit.js sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .", "format": "prettier --write .",
"format:check": "prettier --check", "format:check": "./node_modules/prettier/bin/prettier.cjs . --check",
"lint:check": "oxlint ." "lint:check": "./node_modules/oxlint/bin/oxlint ."
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^1.4.0", "@eslint/compat": "^1.4.0",

View File

@@ -1,6 +1,5 @@
import type { TolgeeStaticData } from '@tolgee/svelte' import type { TolgeeStaticData } from '@tolgee/svelte'
import { env } from '$env/dynamic/private' import { env } from '$env/dynamic/private'
import { TOLGEE_API_KEY, TOLGEE_API_URL } from '$env/static/private'
import { loadAsync } from 'jszip' import { loadAsync } from 'jszip'
class TranslationCacheItem { class TranslationCacheItem {
@@ -12,7 +11,7 @@ class TranslationCacheItem {
get isExpired(): boolean { get isExpired(): boolean {
const now = Date.now() const now = Date.now()
const TTL = Number(env.PRIVATE_TRANSLATION_CACHE_TTL) const TTL = Number(env.TRANSLATION_CACHE_TTL)
if (Number.isNaN(TTL)) return false if (Number.isNaN(TTL)) return false
@@ -64,7 +63,7 @@ class LanguageService {
} }
protected async fetchTranslations(languageCodes: string | string[]) { protected async fetchTranslations(languageCodes: string | string[]) {
const url = new URL(`${TOLGEE_API_URL}/v2/projects/2/export`) const url = new URL(`${env.TOLGEE_API_URL}/v2/projects/2/export`)
url.searchParams.append('format', 'JSON') url.searchParams.append('format', 'JSON')
url.searchParams.append('zip', 'true') url.searchParams.append('zip', 'true')
@@ -74,10 +73,14 @@ class LanguageService {
url.searchParams.append('languages', lang) url.searchParams.append('languages', lang)
} }
if (!env.TOLGEE_API_KEY) {
throw new Error('TOLGEE_API_KEY not set')
}
const response = await fetch(url, { const response = await fetch(url, {
method: 'GET', method: 'GET',
headers: { headers: {
'X-API-Key': TOLGEE_API_KEY, 'X-API-Key': env.TOLGEE_API_KEY,
Accept: 'application/*', Accept: 'application/*',
}, },
}) })

View File

@@ -9,10 +9,7 @@
type TolgeeStaticData, type TolgeeStaticData,
} from '@tolgee/svelte' } from '@tolgee/svelte'
import { TopBar } from '$lib/components/ui/topBar' import { TopBar } from '$lib/components/ui/topBar'
import { import { env } from '$env/dynamic/public'
PUBLIC_TOLGEE_API_KEY,
PUBLIC_TOLGEE_API_URL,
} from '$env/static/public'
import type { Snippet } from 'svelte' import type { Snippet } from 'svelte'
let { children, data }: { data: TolgeeStaticData; children: Snippet } = let { children, data }: { data: TolgeeStaticData; children: Snippet } =
@@ -32,9 +29,9 @@
.init({ .init({
language: 'de', language: 'de',
// // for development // for development
// apiUrl: PUBLIC_TOLGEE_API_URL, apiUrl: env.PUBLIC_TOLGEE_API_URL,
// apiKey: PUBLIC_TOLGEE_API_KEY, apiKey: env.PUBLIC_TOLGEE_API_KEY,
// for production // for production
staticData: { staticData: {