Compare commits
7 Commits
minimal-se
...
9f66da7904
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f66da7904 | ||
|
|
dbe95b9352 | ||
|
|
66651f64f8 | ||
|
|
380ad293e7 | ||
|
|
b1ab2c02b8 | ||
|
|
6581cff44f | ||
|
|
e1f1e867d6 |
@@ -13,11 +13,18 @@ jobs:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '22.x'
|
||||
|
||||
- name: Install bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.3.4
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: bun ci
|
||||
|
||||
- name: Build app
|
||||
run: bun --bun run build
|
||||
|
||||
1
bun.lock
1
bun.lock
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 0,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "rbw",
|
||||
|
||||
12
package.json
12
package.json
@@ -5,14 +5,14 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"build": "./node_modules/vite/bin/vite.js build",
|
||||
"preview": "vite preview",
|
||||
"prepare": "svelte-kit sync || echo ''",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"prepare": "./node_modules/@sveltejs/kit/svelte-kit.js sync || echo ''",
|
||||
"check": "./node_modules/@sveltejs/kit/svelte-kit.js sync && ./node_modules/svelte-check/bin/svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "./node_modules/@sveltejs/kit/svelte-kit.js sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check",
|
||||
"lint:check": "oxlint ."
|
||||
"format:check": "./node_modules/prettier/bin/prettier.cjs . --check",
|
||||
"lint:check": "./node_modules/oxlint/bin/oxlint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.4.0",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { TolgeeStaticData } from '@tolgee/svelte'
|
||||
import { env } from '$env/dynamic/private'
|
||||
import { TOLGEE_API_KEY, TOLGEE_API_URL } from '$env/static/private'
|
||||
import { loadAsync } from 'jszip'
|
||||
|
||||
class TranslationCacheItem {
|
||||
@@ -12,7 +11,7 @@ class TranslationCacheItem {
|
||||
get isExpired(): boolean {
|
||||
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
|
||||
|
||||
@@ -64,7 +63,7 @@ class LanguageService {
|
||||
}
|
||||
|
||||
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('zip', 'true')
|
||||
@@ -74,10 +73,14 @@ class LanguageService {
|
||||
url.searchParams.append('languages', lang)
|
||||
}
|
||||
|
||||
if (!env.TOLGEE_API_KEY) {
|
||||
throw new Error('TOLGEE_API_KEY not set')
|
||||
}
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'X-API-Key': TOLGEE_API_KEY,
|
||||
'X-API-Key': env.TOLGEE_API_KEY,
|
||||
Accept: 'application/*',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -9,10 +9,7 @@
|
||||
type TolgeeStaticData,
|
||||
} from '@tolgee/svelte'
|
||||
import { TopBar } from '$lib/components/ui/topBar'
|
||||
import {
|
||||
PUBLIC_TOLGEE_API_KEY,
|
||||
PUBLIC_TOLGEE_API_URL,
|
||||
} from '$env/static/public'
|
||||
import { env } from '$env/dynamic/public'
|
||||
import type { Snippet } from 'svelte'
|
||||
|
||||
let { children, data }: { data: TolgeeStaticData; children: Snippet } =
|
||||
@@ -32,9 +29,9 @@
|
||||
.init({
|
||||
language: 'de',
|
||||
|
||||
// // for development
|
||||
// apiUrl: PUBLIC_TOLGEE_API_URL,
|
||||
// apiKey: PUBLIC_TOLGEE_API_KEY,
|
||||
// for development
|
||||
apiUrl: env.PUBLIC_TOLGEE_API_URL,
|
||||
apiKey: env.PUBLIC_TOLGEE_API_KEY,
|
||||
|
||||
// for production
|
||||
staticData: {
|
||||
|
||||
Reference in New Issue
Block a user