Skip to content

Commit 380fd42

Browse files
committed
add: 文件整理桌面版与自动发布流程
0 parents  commit 380fd42

51 files changed

Lines changed: 9366 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: Release tag, for example v26.07.02
13+
required: true
14+
type: string
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
windows-release:
21+
name: Build Windows exe and publish release
22+
runs-on: windows-latest
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 24
32+
33+
- name: Set up pnpm
34+
run: |
35+
corepack enable
36+
corepack prepare pnpm@11.7.0 --activate
37+
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Run tests
42+
run: pnpm test
43+
44+
- name: Build desktop executable
45+
env:
46+
CSC_IDENTITY_AUTO_DISCOVERY: false
47+
run: pnpm run release:desktop
48+
49+
- name: Resolve release tag
50+
id: release
51+
shell: pwsh
52+
env:
53+
EVENT_NAME: ${{ github.event_name }}
54+
INPUT_TAG: ${{ inputs.tag }}
55+
REF_TYPE: ${{ github.ref_type }}
56+
REF_NAME: ${{ github.ref_name }}
57+
run: |
58+
$package = Get-Content package.json -Raw | ConvertFrom-Json
59+
if ($env:EVENT_NAME -eq 'workflow_dispatch' -and $env:INPUT_TAG) {
60+
$tag = $env:INPUT_TAG
61+
} elseif ($env:REF_TYPE -eq 'tag') {
62+
$tag = $env:REF_NAME
63+
} else {
64+
$tag = "v$($package.releaseVersion)"
65+
}
66+
67+
if (-not $tag.StartsWith('v')) {
68+
$tag = "v$tag"
69+
}
70+
71+
"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
72+
"title=文件整理 $tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
73+
"assetName=文件整理-$tag.exe" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
74+
75+
- name: Create or update GitHub release
76+
shell: pwsh
77+
env:
78+
GH_TOKEN: ${{ github.token }}
79+
RELEASE_TAG: ${{ steps.release.outputs.tag }}
80+
RELEASE_TITLE: ${{ steps.release.outputs.title }}
81+
ASSET_NAME: ${{ steps.release.outputs.assetName }}
82+
run: |
83+
$asset = "dist/$env:ASSET_NAME#$env:ASSET_NAME"
84+
85+
gh release view "$env:RELEASE_TAG" *> $null
86+
if ($LASTEXITCODE -eq 0) {
87+
gh release upload "$env:RELEASE_TAG" "$asset" --clobber
88+
gh release edit "$env:RELEASE_TAG" --title "$env:RELEASE_TITLE"
89+
} else {
90+
gh release create "$env:RELEASE_TAG" "$asset" --title "$env:RELEASE_TITLE" --generate-notes --target "${{ github.sha }}"
91+
}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules/
2+
dist/
3+
qa-output/
4+
5+
.env
6+
.env.*
7+
*.log
8+
9+
coverage/
10+
.vite/
11+
.turbo/
12+
13+
Thumbs.db
14+
Desktop.ini

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 更新日志
2+
3+
**中文** | [English](CHANGELOG_EN.md)
4+
5+
本文件记录文件整理的重要变更。
6+
7+
## [26.07.02] - 2026-07-02
8+
9+
### 新增
10+
11+
- 软件名称统一为 `文件整理`,英文说明中使用 `File Organizer`
12+
- 支持按时间线浏览图片、视频和普通文件。
13+
- 支持自定义批量改名模板,包括 `{yy}``{MM}``{dd}``{index}``{name}`
14+
- 支持移动和“改名并移动”的文件夹模板。
15+
- 支持 Excel 导出、导入和表格改名。
16+
- 支持通过 Excel 修改后缀;新后缀为空时保留原后缀。
17+
- 支持按固定间隔批量修改文件创建时间、修改时间和访问时间。
18+
- 支持按大小和 SHA-256 哈希查找重复文件。
19+
- 支持操作历史和撤销改名、移动操作。
20+
- 执行文件操作前会检测目标冲突。
21+
- 为首个开源候选版本生成产品检测报告。
22+
23+
### 调整
24+
25+
- 将 UI 统一调整为蓝色系。
26+
- 将搜索、文件类型、包含子文件夹、页面切换和 Excel 操作移到顶部工具栏。
27+
- 将批量操作按钮和目标文件夹选择放到右侧预览区域。
28+
- 将生成的 Windows exe 改名为 `dist\文件整理.exe`
29+
- 将项目元信息改为 `file-organizer``local.file-organizer``文件整理`
30+
31+
### 修复
32+
33+
- 修复打包后主进程路径错误导致的启动失败。
34+
- 修复顶部工具栏和空状态页面的排版问题。
35+
- 清理蓝色主题更新后残留的旧绿色样式。
36+
37+
### 已知说明
38+
39+
- 如果 Windows exe 正在运行,`pnpm run build:desktop` 可能因为 `dist\文件整理.exe` 被占用而失败。重新打包前请先关闭软件。
40+
- `package.json` 使用 `26.7.2`,因为 npm 包版本需要符合语义化版本规则。公开发布版本仍为 `26.07.02`

CHANGELOG_EN.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
[中文](CHANGELOG.md) | **English**
4+
5+
This file documents notable changes to File Organizer.
6+
7+
## [26.07.02] - 2026-07-02
8+
9+
### Added
10+
11+
- Unified the app name as `文件整理`, with `File Organizer` used in English documentation.
12+
- Added timeline browsing for photos, videos, and ordinary files.
13+
- Added custom batch rename templates, including `{yy}`, `{MM}`, `{dd}`, `{index}`, and `{name}`.
14+
- Added folder templates for move and rename-and-move operations.
15+
- Added Excel export, import, and spreadsheet-based rename workflows.
16+
- Added extension editing through Excel import. Empty new extension values keep the original extension.
17+
- Added batch editing for file creation, modified, and access times with configurable intervals.
18+
- Added duplicate file detection by size and SHA-256 hash.
19+
- Added operation history and undo support for completed rename and move operations.
20+
- Added conflict detection before file operations.
21+
- Added a product QA report for the first public release candidate.
22+
23+
### Changed
24+
25+
- Changed the visual theme to a blue color system.
26+
- Moved search, file type, recursive mode, page navigation, and Excel actions into the top toolbar.
27+
- Moved operation controls and destination folder selection into the right-side preview panel.
28+
- Renamed the generated Windows executable to `dist\文件整理.exe`.
29+
- Updated project metadata to `file-organizer`, `local.file-organizer`, and `文件整理`.
30+
31+
### Fixed
32+
33+
- Fixed a packaged app startup error caused by an incorrect main process path.
34+
- Fixed layout issues in the toolbar and empty state.
35+
- Removed old green theme remnants after the blue theme update.
36+
37+
### Known Notes
38+
39+
- If the Windows executable is running, `pnpm run build:desktop` may fail because Windows locks `dist\文件整理.exe`. Close the app before rebuilding.
40+
- `package.json` uses `26.7.2` because npm package versions must follow semantic version rules. The public release version remains `26.07.02`.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 File Organizer contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
20+
OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# 文件整理
2+
3+
**中文** | [English](README_EN.md)
4+
5+
文件整理是一个本地文件整理软件。它可以读取图片、视频和普通文件的时间信息,按时间浏览文件,并批量完成改名、移动、表格改名、修改文件时间、查找重复文件等操作。
6+
7+
它不只适合相册,也可以整理普通文件夹。文件夹里只有图片和视频时,软件会用缩略图预览;如果包含普通文件或混合文件,软件会自动切换成列表显示。
8+
9+
## 适合这些场景
10+
11+
- 手机、相机、微信导出的照片和视频名称混乱。
12+
- 想把文件改成 `001_IMG_0001.jpg` 这类统一格式。
13+
- 想按日期生成文件夹,比如 `260702_IMG_0001`
14+
- 想把文件移动到指定文件夹,同时保留或改名。
15+
- 想用 Excel 手动填写新文件名和新后缀,再批量执行。
16+
- 想统一修改一批文件的创建时间、修改时间和访问时间。
17+
- 想找出重复文件,再选择要处理的重复项。
18+
19+
## 界面预览
20+
21+
![主界面预览](docs/images/main-window.png)
22+
23+
左侧设置文件名和文件夹格式,中间浏览文件,右侧预览和执行批量操作。
24+
25+
## 主要功能
26+
27+
- **扫描文件夹**:选择本地文件夹后读取文件列表,可选择是否包含子文件夹。
28+
- **按时间浏览**:优先读取图片 EXIF 时间和视频创建时间,缺失时使用文件修改时间。
29+
- **搜索和筛选**:按文件名搜索,也可以筛选全部、图片、视频或文件。
30+
- **批量改名**:使用模板生成新文件名,执行前会在右侧显示预览。
31+
- **批量移动**:选择目标文件夹后,把选中文件移动过去。
32+
- **改名并移动**:一次完成新文件名和目标文件夹归档。
33+
- **Excel 表格改名**:导出文件清单,编辑新文件名和新后缀,再导入执行。
34+
- **修改文件时间**:设置文件起始时间和时间间隔,一键修改创建、修改和访问时间。
35+
- **查找重复文件**:按大小和 SHA-256 哈希查找重复项。
36+
- **操作历史**:记录已执行的改名和移动操作,可撤销。
37+
38+
## 使用方法
39+
40+
1. 点击顶部 **选择文件夹**,选择要整理的本地文件夹。
41+
2. 按需要勾选或取消 **包含子文件夹**
42+
3. 点击 **扫描**,软件会读取文件时间并生成预览。
43+
4. 用顶部搜索框或类型筛选缩小文件范围。
44+
5.**全选****反选** 选择要处理的文件。
45+
6. 在右侧选择批量操作:**改名****移动****改名并移动**
46+
7. 如果要移动文件,先在右侧选择目标文件夹。
47+
8. 检查右侧预览,确认无误后点击执行按钮。
48+
49+
## 批量改名
50+
51+
默认文件名格式:
52+
53+
```text
54+
{index}_{name}
55+
```
56+
57+
示例:
58+
59+
```text
60+
IMG_0001.jpg -> 001_IMG_0001.jpg
61+
IMG_0002.png -> 002_IMG_0002.png
62+
```
63+
64+
常用令牌:
65+
66+
| 令牌 | 含义 | 示例 |
67+
|---|---|---|
68+
| `{yyyy}` | 四位年份 | `2026` |
69+
| `{yy}` | 两位年份 | `26` |
70+
| `{MM}` | 月份 | `07` |
71+
| `{dd}` | 日期 | `02` |
72+
| `{HH}` | 小时 | `09` |
73+
| `{mm}` | 分钟 | `30` |
74+
| `{ss}` || `05` |
75+
| `{index}` | 三位序号 | `001` |
76+
| `{i}` | 普通序号 | `1` |
77+
| `{name}` | 原文件名,不含后缀 | `IMG_0001` |
78+
| `{type}` | 文件类型 | `image` |
79+
80+
## 移动到指定文件夹
81+
82+
移动文件时可以只选择目标文件夹,也可以设置文件夹格式。
83+
84+
默认文件夹格式:
85+
86+
```text
87+
{yy}{MM}{dd}_{name}
88+
```
89+
90+
示例:
91+
92+
```text
93+
IMG_0001.jpg -> 260702_IMG_0001\IMG_0001.jpg
94+
```
95+
96+
选择 **改名并移动** 时,软件会先按文件名格式生成新文件名,再按文件夹格式移动到目标位置。
97+
98+
## Excel 表格改名
99+
100+
1. 先扫描文件并选中要处理的文件。
101+
2. 点击顶部 **Excel 表格**,选择 **导出表格**
102+
3. 在表格里编辑 **新文件名****新后缀**
103+
4. 回到软件,点击 **Excel 表格**,选择 **导入表格**
104+
5. 右侧会显示表格改名预览,确认后点击 **运行表格改名**
105+
106+
`新后缀` 可以填写 `jpg``.jpg``png``.pdf` 这类格式。没有填写新后缀时,软件会保留原后缀。
107+
108+
## 修改文件时间
109+
110+
右侧可以设置 **文件起始时间****时间间隔**。执行后,软件会按当前文件顺序依次修改每个文件的创建时间、修改时间和访问时间。
111+
112+
示例:起始时间为 `2026-07-02 09:30:00`,时间间隔为 `1` 秒,4 个文件会依次变成:
113+
114+
```text
115+
09:30:00
116+
09:30:01
117+
09:30:02
118+
09:30:03
119+
```
120+
121+
## 更新日志
122+
123+
查看 [CHANGELOG.md](CHANGELOG.md)
124+
125+
## 下载和运行
126+
127+
Windows 用户可以从 GitHub Release 下载 exe 文件后直接运行。
128+
129+
如果从源码运行:
130+
131+
```bash
132+
pnpm install
133+
pnpm run dev
134+
```
135+
136+
如果要重新打包桌面软件:
137+
138+
```bash
139+
pnpm run build:desktop
140+
```

0 commit comments

Comments
 (0)