Skip to content

Commit dd059d0

Browse files
committed
opt.: js -> ts
1 parent 73e5688 commit dd059d0

13 files changed

Lines changed: 58 additions & 88 deletions

File tree

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,6 @@ If I forgot to add your name to the contributors list, please add a comment in t
7474
2. Clone this repo, run `flutter run` to start the app.
7575
3. Run `dart run fl_build -p PLATFORM` to build the app.
7676

77-
### Release macOS notarized DMG
78-
79-
1. Copy `.env.release.example` to `.env.release`.
80-
2. Fill in `APPLE_TEAM_ID` and `APPLE_NOTARY_KEYCHAIN_PROFILE`.
81-
3. Make sure the `Developer ID Application` certificate is already installed in Keychain.
82-
4. Make sure notarization credentials are already stored via `xcrun notarytool store-credentials`.
83-
5. Install the provisioning profile used for DMG packaging. The script defaults to `ServerBox DMG Profile`, and you can override it with `APP_PROFILE_NAME`.
84-
6. Run `bash scripts/release/release-macos-dmg.sh`.
85-
86-
This flow does not modify the default Xcode Release signing config. It injects a temporary `xcconfig` only for archive/export, builds a signed `.app`, packages a DMG, submits it to notarization, staples the result, and optionally uploads the DMG to the GitHub Release for `v<version>`.
87-
8877
### Translation
8978

9079
- [Guide](https://blog.lpkt.cn/posts/faq/) can be found in my blog.

README_zh.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/rel
7676
2. 克隆这个仓库, 运行 `flutter run` 启动应用
7777
3. 运行 `dart run fl_build -p PLATFORM` 构建应用
7878

79-
### 发布 macOS 公证 DMG
80-
81-
1. 复制 `.env.release.example``.env.release`
82-
2. 填入 `APPLE_TEAM_ID``APPLE_NOTARY_KEYCHAIN_PROFILE`
83-
3. 确保 `Developer ID Application` 证书已经安装到 Keychain
84-
4. 确保已经通过 `xcrun notarytool store-credentials` 存好了公证凭据
85-
5. 安装用于 DMG 打包的 provisioning profile。脚本默认使用 `ServerBox DMG Profile`,也可以通过 `APP_PROFILE_NAME` 覆盖
86-
6. 运行 `bash scripts/release/release-macos-dmg.sh`
87-
88-
这套流程不会修改工程默认的 Xcode Release 签名配置。脚本只会在归档和导出时注入临时 `xcconfig`,生成已签名 `.app`、打包 DMG、提交公证、回填 stapler,并可选把 DMG 上传到 `v<version>` 对应的 GitHub Release。
89-
9079
### 翻译
9180

9281
[指南](https://blog.lpkt.cn/faq/) 可在我的博客中找到。

website/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
</head>
1313
<body>
1414
<div id="app"></div>
15-
<script type="module" src="/src/main.js"></script>
15+
<script type="module" src="/src/main.ts"></script>
1616
</body>
1717
</html>

website/jsconfig.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

website/src/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
locales,
1212
localeStorageKey,
1313
syncLocaleToUrl,
14-
} from './lib/i18n.js'
14+
} from './lib/i18n'
1515
1616
const capabilities = ['Status chart', 'SSH Terminal', 'SFTP', 'Docker', 'Process', 'Systemd', 'S.M.A.R.T', 'GPU', 'Sensors', 'Push', 'Home Widget', 'watchOS']
1717
@@ -172,7 +172,7 @@
172172
<a href="#features" onclick={(event) => scrollToSection(event, 'features')}>{$LL.nav.features()}</a>
173173
<a href="#capabilities" onclick={(event) => scrollToSection(event, 'capabilities')}>{$LL.nav.capabilities()}</a>
174174
<a href="#download" onclick={(event) => scrollToSection(event, 'download')}>{$LL.nav.download()}</a>
175-
<a href="/docs/">Docs</a>
175+
<a href="/docs/">{$LL.nav.docs()}</a>
176176
</nav>
177177
<div class="nav-actions">
178178
<label class="language-switcher">

website/src/i18n/es/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const es: Translation = {
1111
features: 'Funciones',
1212
capabilities: 'Capacidades',
1313
download: 'Descargar',
14-
docs: 'Docs',
14+
docs: 'Documentación',
1515
languageLabel: 'Idioma',
1616
},
1717
hero: {

website/src/i18n/fr/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const fr: Translation = {
1111
features: 'Fonctions',
1212
capabilities: 'Capacités',
1313
download: 'Télécharger',
14-
docs: 'Docs',
14+
docs: 'Documentation',
1515
languageLabel: 'Langue',
1616
},
1717
hero: {
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { baseLocale, locales as generatedLocales } from '../i18n/i18n-util'
2+
import type { Locales } from '../i18n/i18n-types'
3+
4+
type LocaleOption = {
5+
code: Locales
6+
label: string
7+
}
28

39
export const defaultLocale = baseLocale
410

5-
export const locales = [
11+
export const locales: LocaleOption[] = [
612
{ code: 'en', label: 'English' },
713
{ code: 'zh-CN', label: '简体中文' },
814
{ code: 'fr', label: 'Français' },
@@ -12,11 +18,11 @@ export const locales = [
1218
{ code: 'es', label: 'Español' },
1319
].filter((locale) => generatedLocales.includes(locale.code))
1420

15-
export const localeStorageKey = 'mfuse.website.locale'
21+
export const localeStorageKey = 'serverbox.website.locale'
1622

17-
export function normalizeLocale(locale) {
23+
export function normalizeLocale(locale: string | null | undefined): Locales {
1824
if (!locale) return defaultLocale
19-
if (generatedLocales.includes(locale)) return locale
25+
if (generatedLocales.includes(locale as Locales)) return locale as Locales
2026

2127
const lowerLocale = locale.toLowerCase()
2228
if (lowerLocale.startsWith('zh')) return 'zh-CN'
@@ -30,7 +36,7 @@ export function normalizeLocale(locale) {
3036
return defaultLocale
3137
}
3238

33-
export function getInitialLocale() {
39+
export function getInitialLocale(): Locales {
3440
const params = new URLSearchParams(window.location.search)
3541
const queryLocale = normalizeLocale(params.get('lang'))
3642
if (params.has('lang')) return queryLocale
@@ -41,7 +47,7 @@ export function getInitialLocale() {
4147
return normalizeLocale(navigator.languages?.[0] || navigator.language)
4248
}
4349

44-
export function syncLocaleToUrl(locale) {
50+
export function syncLocaleToUrl(locale: Locales): void {
4551
const url = new URL(window.location.href)
4652
url.searchParams.set('lang', normalizeLocale(locale))
4753
window.history.replaceState({}, '', url)

website/src/lib/utils.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

website/src/lib/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { clsx, type ClassValue } from 'clsx'
2+
import { twMerge } from 'tailwind-merge'
3+
4+
export function cn(...inputs: ClassValue[]): string {
5+
return twMerge(clsx(inputs))
6+
}

0 commit comments

Comments
 (0)