Skip to content

Commit 8e8fa39

Browse files
kid141252010Holden-Crossimsyyd4yt1m3
authored
平稳合入 dev:保留 AM 功能并修复启动迁移与同步门禁 (#35)
* fix: 修复 Windows 网易云扫码登录设备名称 * feat: 添加共享元素过渡 * feat: 添加减弱动画设置 * feat: 添加播放器封面共享过渡并优化内容加载 * fix: 修复开发环境冷启动与设置弹窗触发重载 * fix: 完善登录上报 * fix: 修复共享过渡与减弱动画的边界问题 * fix: 修复歌曲列表排序状态跨页面串用 * fix: 修复歌词图片导出未沿用字体配置的问题 * fix: 优化播放页过渡与封面切换 * build: 升级 Electron 44 并适配异步安全存储 * build: 升级 electron-vite 6 与 Vite 8 工具链 * build: 避免原生构建通过 shell 启动 NAPI CLI * build: 升级基础依赖并适配 reka-ui 数字输入 * refactor: 使用内置窗口状态持久化并隔离窗口缩放 * build: 升级 pnpm 12 与 Node 24 工具链 * chore: 更新版本号至 1.2.0 * feat: 优化过渡发光模式 * feat: 优化窄窗口布局样式 SPlayer-Dev#149 * feat: 新增歌曲播放按钮行为设置 * feat: 新增歌曲列表紧凑样式 SPlayer-Dev#401 * fix: 完善快捷键录入与全局注册 SPlayer-Dev#406 * fix: 完善歌曲缓存与预载的联动 fixed SPlayer-Dev#387 * fix: 修复元素过渡丢失动画效果 --------- Co-authored-by: Holden Cross <[email protected]> Co-authored-by: imsyy <[email protected]> Co-authored-by: imsyy <[email protected]> Co-authored-by: d4yt1m3 <[email protected]>
1 parent 6bcada8 commit 8e8fa39

120 files changed

Lines changed: 5452 additions & 3073 deletions

File tree

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CI
33
on:
44
pull_request:
55
push:
6-
branches: [main, dev]
6+
branches: [main, dev, master]
77

88
concurrency:
9-
group: ci-${{ github.event.pull_request.number || github.ref }}
9+
group: ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
1010
cancel-in-progress: true
1111

1212
jobs:
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/setup-node@v6
2121
with:
22-
node-version: 22
22+
node-version: 24.x
2323
cache: pnpm
2424

2525
- run: pnpm install --frozen-lockfile

‎.github/workflows/dev.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dev 分支推送构建
1+
# master 推送及面向 master 的 PR 三平台构建
22
name: Build Dev
33

44
on:
@@ -19,14 +19,16 @@ on:
1919
- "electron.vite.config.ts"
2020
- "tsconfig*.json"
2121
- ".github/workflows/dev.yml"
22+
pull_request:
23+
branches: [master]
2224
workflow_dispatch:
2325

2426
concurrency:
25-
group: dev-build-${{ github.ref }}
27+
group: dev-build-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
2628
cancel-in-progress: true
2729

2830
env:
29-
NODE_VERSION: 22.x
31+
NODE_VERSION: 24.x
3032

3133
jobs:
3234
build:

‎.github/workflows/docs.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup Node
3535
uses: actions/setup-node@v6
3636
with:
37-
node-version: 24
37+
node-version: 24.x
3838
- name: Setup Pages
3939
uses: actions/configure-pages@v5
4040
# 文档构建无需原生模块,跳过 postinstall(electron-rebuild)

‎.github/workflows/nightly.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: false
1616

1717
env:
18-
NODE_VERSION: 22.x
18+
NODE_VERSION: 24.x
1919

2020
jobs:
2121
# 智能检查 dev 分支自上次发布以来是否有新提交

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
contents: write
1818

1919
env:
20-
NODE_VERSION: 22.x
20+
NODE_VERSION: 24.x
2121
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
2222

2323
# 同一个 tag 的发布串行执行,避免并发上传资源产生竞态

‎.github/workflows/sync-dev.yml‎

Lines changed: 34 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,67 @@
11
name: Sync Dev to Master
22

33
on:
4-
schedule:
5-
# 每天北京时间凌晨 03:00 自动运行 (UTC 19:00)
6-
- cron: "0 19 * * *"
74
workflow_dispatch:
8-
inputs:
9-
auto_push:
10-
description: "合并并检查成功后自动推送到 master"
11-
type: boolean
12-
required: true
13-
default: true
145

15-
# 授予仓库写入权限,确保能够正常 git push
166
permissions:
177
contents: write
18-
issues: write
8+
pull-requests: write
199

10+
# 所有手动同步共享目标 master,串行执行,不中断已经创建的集成现场。
2011
concurrency:
2112
group: sync-dev-to-master
22-
cancel-in-progress: true
13+
cancel-in-progress: false
2314

2415
jobs:
2516
sync:
26-
name: Sync upstream/dev into master
17+
name: Prepare checked integration branch and PR
2718
runs-on: ubuntu-latest
19+
env:
20+
CI: true
21+
GH_TOKEN: ${{ secrets.SYNC_TOKEN || github.token }}
2822
steps:
2923
- name: Checkout repository
30-
uses: actions/checkout@v4
24+
uses: actions/checkout@v6
3125
with:
3226
ref: master
3327
fetch-depth: 0
3428
token: ${{ secrets.SYNC_TOKEN || github.token }}
3529

36-
- name: Setup Git identity
30+
- name: Setup Git identity and upstream
3731
run: |
3832
git config --global user.name "github-actions[bot]"
3933
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
34+
git remote add upstream https://github.com/SPlayer-Dev/SPlayer-Next.git
4035
41-
- name: Setup upstream remote
42-
run: |
43-
if ! git remote | grep -q "^upstream$"; then
44-
git remote add upstream https://github.com/SPlayer-Dev/SPlayer-Next.git
45-
fi
46-
git fetch upstream dev
47-
git fetch origin master
48-
49-
- name: Check for new commits
50-
id: check_commits
51-
run: |
52-
COMMITS=$(git log master..upstream/dev --oneline)
53-
if [ -z "$COMMITS" ]; then
54-
echo "has_commits=false" >> $GITHUB_OUTPUT
55-
echo "upstream/dev 的所有提交已包含在 master 中,无需合并。"
56-
else
57-
echo "has_commits=true" >> $GITHUB_OUTPUT
58-
echo "发现待合并提交:"
59-
echo "$COMMITS"
60-
fi
61-
62-
- name: Merge upstream/dev
63-
if: steps.check_commits.outputs.has_commits == 'true'
64-
run: |
65-
git checkout master
66-
git merge upstream/dev -m "Merge branch 'upstream/dev' into master"
67-
36+
# 不指定 version:pnpm/action-setup 使用 packageManager 中锁定的 pnpm 12。
6837
- name: Setup pnpm
69-
if: steps.check_commits.outputs.has_commits == 'true'
70-
uses: pnpm/action-setup@v4
38+
uses: pnpm/action-setup@v6
7139

7240
- name: Setup Node.js
73-
if: steps.check_commits.outputs.has_commits == 'true'
74-
uses: actions/setup-node@v4
41+
uses: actions/setup-node@v6
7542
with:
76-
node-version: 22.x
43+
node-version: 24.x
7744
cache: pnpm
7845

79-
- name: Install dependencies
80-
if: steps.check_commits.outputs.has_commits == 'true'
81-
run: pnpm install --frozen-lockfile
82-
83-
- name: Verify types
84-
if: steps.check_commits.outputs.has_commits == 'true'
85-
run: pnpm typecheck
46+
# Node 24 原生执行 TS;与本地 sync:master 共用唯一实现。
47+
# 脚本在独立 worktree 合并后执行 frozen install、typecheck 和 test,再发布分支/PR。
48+
- name: Integrate, install, check, test and open PR
49+
run: node scripts/sync-master.ts --push
8650

87-
- name: Push to master
88-
if: steps.check_commits.outputs.has_commits == 'true' && (github.event_name == 'schedule' || inputs.auto_push == true)
51+
- name: Explain downstream checks
52+
if: always()
53+
env:
54+
HAS_SYNC_TOKEN: ${{ secrets.SYNC_TOKEN != '' }}
8955
run: |
90-
git push origin master
56+
{
57+
echo '## Dev → master integration'
58+
echo 'This workflow never pushes master; pending changes are checked in an isolated worktree and published as an integration branch/PR only after frozen installation, typecheck and tests pass.'
59+
echo 'If there are no pending commits, no installation, checks or PR are needed. A failed sync is not a successful validation.'
60+
if [ "$HAS_SYNC_TOKEN" = true ]; then
61+
echo 'SYNC_TOKEN is configured. New push/PR events can trigger downstream workflows if that token has the required repository/workflow permissions.'
62+
else
63+
echo 'GITHUB_TOKEN is in use. GitHub suppresses downstream push/PR workflow events created with this token; this sync run does NOT establish that PR CI or the three-platform build ran.'
64+
echo 'An authorized user must close and reopen the PR to trigger PR checks, or manually dispatch Test and Build Dev on the integration branch. Required checks must still pass before merging.'
65+
echo 'Repository Actions settings must allow GitHub Actions to create pull requests; otherwise configure SYNC_TOKEN and rerun to reuse the published branch.'
66+
fi
67+
} >> "$GITHUB_STEP_SUMMARY"

‎.github/workflows/test.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: Test
22

33
on:
44
push:
5-
branches: [dev]
5+
branches: [dev, master]
66
pull_request:
7-
branches: [dev]
7+
branches: [dev, master]
88
workflow_dispatch:
99

1010
permissions:
1111
contents: read
1212

1313
concurrency:
14-
group: test-${{ github.event.pull_request.number || github.ref }}
14+
group: test-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
1515
cancel-in-progress: true
1616

1717
env:
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup Node.js
3333
uses: actions/setup-node@v6
3434
with:
35-
node-version: 22.19.0
35+
node-version: 24.x
3636
cache: pnpm
3737

3838
- name: Install dependencies
@@ -55,7 +55,7 @@ jobs:
5555
- name: Setup Node.js
5656
uses: actions/setup-node@v6
5757
with:
58-
node-version: 22.19.0
58+
node-version: 24.x
5959
cache: pnpm
6060

6161
- name: Cache Rust build

‎components.d.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ declare module 'vue' {
4747
CoverList: typeof import('./src/components/list/CoverList.vue')['default']
4848
DbCacheManager: typeof import('./src/components/settings/custom/DbCacheManager.vue')['default']
4949
DefaultLyrics: typeof import('./src/components/player/Lyrics/DefaultLyrics.vue')['default']
50+
DetailCover: typeof import('./src/components/collection/DetailCover.vue')['default']
5051
DeviceSelector: typeof import('./src/components/settings/custom/DeviceSelector.vue')['default']
5152
DialogClose: typeof import('reka-ui')['DialogClose']
5253
DialogContent: typeof import('reka-ui')['DialogContent']
@@ -117,6 +118,7 @@ declare module 'vue' {
117118
IconLucideHeart: typeof import('~icons/lucide/heart')['default']
118119
IconLucideHeartOff: typeof import('~icons/lucide/heart-off')['default']
119120
IconLucideHistory: typeof import('~icons/lucide/history')['default']
121+
IconLucideHourglass: typeof import('~icons/lucide/hourglass')['default']
120122
IconLucideInfinity: typeof import('~icons/lucide/infinity')['default']
121123
IconLucideKey: typeof import('~icons/lucide/key')['default']
122124
IconLucideKeyRound: typeof import('~icons/lucide/key-round')['default']

‎docs/contributing.md‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
## 环境要求
66

7-
- **Node.js** >= 22.19.0
8-
- **pnpm** >= 10
7+
- **Node.js** >= 24.0.0
8+
- **pnpm** >= 12
99
- **Rust 工具链**(构建原生模块所需,见 [原生模块](/native))
1010

1111
## 快速开始
@@ -41,8 +41,9 @@ pnpm build:linux # 打包 Linux
4141
高级命令
4242

4343
```bash
44-
# 上面的构建命令默认会构建当前平台和架构的全部 target。可以通过下面的方法指定只打包某些 target
45-
pnpm build:win nsis # 打包 Windows 的 nsis 格式
44+
# Windows 默认仅构建 x64 NSIS 安装包;验证时禁止发布
45+
pnpm build:win --publish never
46+
# macOS / Linux 可继续指定 target
4647
pnpm build:mac dmg # 打包 macOS 的 dmg 格式
4748
pnpm build:linux tar.gz # 打包 Linux 的 tar.gz 格式
4849
# 全部 target 的列表详见 https://www.electron.build/docs/targets
@@ -58,8 +59,25 @@ pnpm typecheck # tsc + vue-tsc(node + web 双目标)
5859
pnpm lint # ESLint
5960
pnpm format # Prettier
6061
pnpm build:native # 仅构建 Rust 原生模块(加 `--dev` 为 debug 构建)
62+
pnpm test # 主进程与渲染层行为回归
63+
pnpm test:native # Rust workspace 回归
6164
```
6265

66+
## 将 dev 集成到 master
67+
68+
同步入口使用 Node.js 24 和 `packageManager` 锁定的 pnpm 12。运行前提交当前改动;未跟踪文件也会阻止同步。
69+
70+
```bash
71+
pnpm sync:master # 仅本地集成,不发布
72+
pnpm sync:master --push # 发布集成分支并创建或复用面向 master 的 PR
73+
```
74+
75+
脚本固定最新 `origin/master` 与 `upstream/dev`(没有 upstream 时使用 `origin/dev`),在独立兄弟 worktree 中合并,不切换或合并当前工作区的 master/dev。冲突或检查失败会保留现场并打印路径,不 stash、不覆盖已有分支,也不强推。
76+
77+
集成结果必须通过冻结锁文件安装、类型检查和测试;`--push` 只推送集成分支,绝不直接推送 master。手动 **Sync Dev to Master** 工作流复用相同入口,已停用定时直推。面向 master 的 PR 会执行 CI、测试与 Windows/macOS/Linux 构建;使用 merge commit 合入以保留上游祖先关系。
78+
79+
若同步工作流使用 `GITHUB_TOKEN` 创建 PR,GitHub 不会因此触发下游 push/PR 工作流。应配置具备仓库及工作流权限的 `SYNC_TOKEN`,或由用户关闭再重新打开 PR 触发检查;也可在集成分支手动运行 Test、Build Dev,但这不代表其他 PR 必需检查已经通过。发布前仍需验收真实播放、旧凭据解密和窗口状态迁移。
80+
6381
## 项目结构
6482

6583
```

‎docs/en/contributing.md‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Thank you for contributing to SPlayer-Next. This page covers the local environme
44

55
## Requirements
66

7-
- **Node.js** >= 22.19.0
8-
- **pnpm** >= 10
7+
- **Node.js** >= 24.0.0
8+
- **pnpm** >= 12
99
- **Rust toolchain** for [native modules](/en/native)
1010

1111
## Getting started
@@ -30,8 +30,9 @@ pnpm build:win
3030
pnpm build:mac
3131
pnpm build:linux
3232

33-
# Build selected electron-builder targets
34-
pnpm build:win nsis
33+
# Windows defaults to an x64 NSIS installer; never publish verification builds
34+
pnpm build:win --publish never
35+
# macOS / Linux can select electron-builder targets
3536
pnpm build:mac dmg
3637
pnpm build:linux tar.gz
3738

@@ -49,8 +50,25 @@ pnpm lint
4950
pnpm format
5051
pnpm build:native
5152
pnpm build:native --dev
53+
pnpm test
54+
pnpm test:native
5255
```
5356

57+
## Integrating dev into master
58+
59+
Use Node.js 24 and the pnpm 12 version pinned by `packageManager`. Commit your work first; untracked files also block synchronization.
60+
61+
```bash
62+
pnpm sync:master # Local integration only
63+
pnpm sync:master --push # Publish the integration branch and create or reuse a master PR
64+
```
65+
66+
The script pins the latest `origin/master` and `upstream/dev` (or `origin/dev` without upstream), then merges in a separate sibling worktree. It never switches or merges the current worktree's master/dev, stashes work, overwrites an existing branch, or force-pushes. Conflicts and failed checks remain in the printed worktree for inspection.
67+
68+
Frozen-lockfile installation, type checking, and tests must pass before publication. `--push` publishes only the integration branch, never master. The manual **Sync Dev to Master** workflow uses the same entry point; scheduled direct pushes are disabled. Master PRs run CI, tests, and Windows/macOS/Linux builds. Merge with a merge commit to retain upstream ancestry.
69+
70+
PRs created with `GITHUB_TOKEN` do not trigger downstream push/PR workflows. Configure `SYNC_TOKEN` with repository/workflow permissions, or have a user close and reopen the PR to trigger checks. Test and Build Dev can also be dispatched on the integration branch, but that does not satisfy other required PR checks. Verify real playback, legacy credential decryption, and window-state migration before release.
71+
5472
## Project structure
5573

5674
```text

0 commit comments

Comments
 (0)