From 19c12aa11f8af8d286b231394deb21e157d857b9 Mon Sep 17 00:00:00 2001 From: gis2all <1262057294@qq.com> Date: Wed, 29 Apr 2026 19:59:21 +0800 Subject: [PATCH 1/2] chore: add release readiness foundation --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 13 +++++++++++-- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 LICENSE diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a670b57 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + +jobs: + validate: + runs-on: windows-latest + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build app + run: npm run build diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4446f2b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Github Gis2all + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ec76164..a81623c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # FocusFlow +[![CI](https://github.com/gis2all/focus-flow/actions/workflows/ci.yml/badge.svg)](https://github.com/gis2all/focus-flow/actions/workflows/ci.yml) + FocusFlow 是一个本地优先的 Windows 桌面番茄钟客户端,面向个人专注、任务绑定和本地统计场景。它把番茄钟、待办任务、专注统计、系统托盘、小窗和 Windows 通知整合在一个轻量桌面应用里。 项目以本地数据为核心,不依赖账号体系或云同步,保持业务规则、桌面能力和 React 界面的解耦。 @@ -84,7 +86,7 @@ flowchart LR - 首次启动如果 `focusflow.sqlite` 不存在,程序会自动创建空库并完成建表。 - 数据库不打进发布包;删除 `output/` 或重新打包不会删除用户数据。 - 如需迁移数据,先退出 FocusFlow,再复制 `focusflow.sqlite` 到新电脑对应的 `userData` 目录。 -- 安装版、单文件便携版、`appx` 包和 `win-unpacked/` 展开版默认共享同一个 `userData` 数据库位置 +- 安装版、单文件便携版、`appx` 包和 `win-unpacked/` 展开版默认共享同一个 `userData` 数据库位置。 ### 输出目录与发布包 @@ -92,12 +94,19 @@ flowchart LR - `output/build/`:`npm run build` 生成的 Electron main、preload、renderer 构建产物。 - `output/release/focusflow-setup.exe`:Windows 标准安装向导,可选当前用户或所有用户安装,并可修改安装目录。 - `output/release/focusflow-single.exe`:Windows 单文件便携版,双击即可运行。 -- `output/release/focusflow-appx.appx`:微软商店安装包,安装目录由 Windows 系统托管,不支持自选路径。 +- `output/release/focusflow-appx.appx`:Windows `appx` 开发验证包,安装目录由 Windows 系统托管,不支持自选路径,当前不作为公开下载承诺。 - `output/release/win-unpacked/focusflow.exe`:展开版应用,主要用于开发者烟测。 - `output/release/latest.yml` 和 `output/release/*.blockmap`:发布与更新相关元数据。 - `output/cache/electron-builder/`:`package-win.mjs` 使用的项目级 `electron-builder` cache。 - Windows 打包通过根目录的 `package-win.mjs` 驱动 `electron-builder`;默认无参数时打 `nsis portable`,显式传 `appx` 时只打 `appx`。 +### 公开发布 + +- 当前正式对外分发优先使用 `focusflow-setup.exe` 和 `focusflow-single.exe`。 +- `win-unpacked/` 仅用于开发者烟测,不作为正式下载项。 +- `focusflow-appx.appx` 当前是开发验证链路,仍依赖本地开发证书与占位身份信息,不作为公开下载承诺。 +- 如需手动制作公开发布,建议流程是:从 `main` 拉取最新代码,运行 `npm ci`、`npm test`、`npm run package`,手动验证 `focusflow-setup.exe` 与 `focusflow-single.exe` 后,再创建 GitHub Release 并上传这两个产物。 + ### 运行依赖 - 当前发布包面向 x64 Windows,建议在 Windows 10/11 x64 上运行。 From ab6830d6927329b8f6542f0445e9746a851f711c Mon Sep 17 00:00:00 2001 From: gis2all <1262057294@qq.com> Date: Wed, 29 Apr 2026 20:07:04 +0800 Subject: [PATCH 2/2] test: pin vitest timezone for local-day assertions --- vitest.config.ts | 1 + vitest.setup.ts | 1 + 2 files changed, 2 insertions(+) create mode 100644 vitest.setup.ts diff --git a/vitest.config.ts b/vitest.config.ts index 8b2583d..73e756b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,6 +5,7 @@ export default defineConfig({ test: { environment: 'node', globals: true, + setupFiles: ['vitest.setup.ts'], include: [ '{core,main,preload,renderer,shared}/**/*.test.ts', '{core,main,preload,renderer,shared}/**/*.test.tsx' diff --git a/vitest.setup.ts b/vitest.setup.ts new file mode 100644 index 0000000..ab0042e --- /dev/null +++ b/vitest.setup.ts @@ -0,0 +1 @@ +process.env.TZ = 'Asia/Shanghai'