Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 界面的解耦。
Expand Down Expand Up @@ -84,20 +86,27 @@ flowchart LR
- 首次启动如果 `focusflow.sqlite` 不存在,程序会自动创建空库并完成建表。
- 数据库不打进发布包;删除 `output/` 或重新打包不会删除用户数据。
- 如需迁移数据,先退出 FocusFlow,再复制 `focusflow.sqlite` 到新电脑对应的 `userData` 目录。
- 安装版、单文件便携版、`appx` 包和 `win-unpacked/` 展开版默认共享同一个 `userData` 数据库位置
- 安装版、单文件便携版、`appx` 包和 `win-unpacked/` 展开版默认共享同一个 `userData` 数据库位置。

### 输出目录与发布包

- `output/` 是生成物目录,需要时可删除后通过 `npm run build`、`npm run package` 或 `npm run package:appx:dev` 重新生成。
- `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 上运行。
Expand Down
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.TZ = 'Asia/Shanghai'
Loading