Skip to content

Commit ff176e8

Browse files
committed
docs: 更新提交信息规范
1 parent 8107833 commit ff176e8

3 files changed

Lines changed: 31 additions & 19 deletions

File tree

‎AGENTS.md‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Don't reimplement these inside individual windows.
8282
- `shared/types/player.ts` — `Track`, `TrackDetail`, `Artist`, `Album`, `AudioQuality`, `PlayerState`, `PlayerStatus`, `PlayerEvent`, `LoadOptions`, `LoadResult`, `IpcResponse`
8383
- `shared/types/lyrics.ts` — `LyricFormat`, `LyricSource (external | embedded | online)`, `LyricData`, `LyricLine`, `LyricWord`, `LyricSpan`
8484
- `shared/types/platform.ts` — `Platform (netease | qqmusic | kugou)`
85-
- `shared/types/streaming.ts` — `StreamingServerType`, `StreamingServerConfig`, `StreamingPingResult`, `StreamingAuthResult` 等
85+
- `shared/types/streaming.ts` — `StreamingServerType`, `StreamingServerConfig`, `StreamingPingResult`, `StreamingAuthResult`, etc.
8686

8787
`Track` is for queue storage (no heavy data); `TrackDetail` loads on demand.
8888

@@ -93,7 +93,7 @@ Declarative — defined in `src/settings/schema.ts`, types in `src/types/setting
9393
### Data Storage
9494

9595
```
96-
{userData}/app-data/ # 统一数据目录(与 Chromium 的 Cache/ 等隔开,便携版整体迁移此目录)
96+
{userData}/app-data/ # Unified data directory, separate from Chromium cache data
9797
├── config/
9898
│ ├── settings.json # Main config (electron/main/store/)
9999
│ ├── streaming.json # Streaming credentials (safeStorage encrypted)
@@ -103,7 +103,7 @@ Declarative — defined in `src/settings/schema.ts`, types in `src/types/setting
103103
├── logs/ # App logs + native/
104104
└── plugins/ # scripts/ data/ logs/
105105
106-
# 全部路径集中定义于 electron/main/utils/paths.ts,改一处即可整体迁移
106+
# All paths are defined centrally in electron/main/utils/paths.ts
107107
```
108108

109109
Renderer IndexedDB (localforage): `splayer/library`, `splayer/queue`, `splayer/playlists`, `splayer/streaming-cache`.
@@ -136,13 +136,14 @@ Renderer uses `vue-i18n` with `src/i18n/locales/{zh-CN,en-US}.json`. Main proces
136136

137137
### Comments — Chinese, with JSDoc
138138

139-
All comments in Chinese. Methods use standard JSDoc with `@param 名 - 说明` and `@returns` when meaningful:
139+
All comments in Chinese. Methods use standard JSDoc with `@param name - description` and
140+
`@returns` when meaningful:
140141

141142
```ts
142143
/**
143-
* 取或生成 PlaySessionId,trackId 不变则复用
144-
* @param trackId - Track 全局 id
145-
* @returns PlaySessionId(UUID)
144+
* <Chinese method description>
145+
* @param trackId - <Chinese parameter description>
146+
* @returns <Chinese return description>
146147
*/
147148
```
148149

@@ -154,7 +155,9 @@ Split logic into files rather than separator comments. Don't extract a helper fo
154155

155156
### Memory Discipline
156157

157-
Memory is a hard requirement. Main process logs `内存占用:` (`app.getAppMetrics()`, 60s after launch then every 10 min); when a change touches rendering, caching, or IPC, verify before/after with these samples.
158+
Memory is a hard requirement. The main process logs memory usage through `app.getAppMetrics()`
159+
60 seconds after launch and then every 10 minutes. When a change touches rendering, caching, or
160+
IPC, verify before and after with these samples.
158161

159162
- **Images by display size** — anything blurred, sampled, or rendered small uses the 300px `cover` thumbnail (player blur background, color extraction, lists). `coverOriginal` only for the visible large cover and poster export. Large `<img>`: add `decoding="async"`; preload with `img.decode()` before fading in.
160163
- **Compositing layers are budgeted** — never put `will-change` in CSS on unbounded element collections; promote dynamically and only near the viewport (lyric engine `lineWillChange` pattern). New full-screen `filter: blur` / `backdrop-filter` layers need justification.
@@ -195,4 +198,6 @@ Put cross-process types (`LocaleCode / SystemConfig / StreamingServerType`, etc.
195198

196199
### Commit Messages
197200

198-
Single-line title in Chinese; no body/bullets unless explicitly requested.
201+
Use Conventional Commits with a Chinese summary: `<type>: <summary>`. Keep the title on one line;
202+
do not add a body or bullets unless explicitly requested. Use the type that matches the change,
203+
such as `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `build`, `ci`, `style`, or `chore`.

‎CLAUDE.md‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Don't reimplement these inside individual windows.
8282
- `shared/types/player.ts` — `Track`, `TrackDetail`, `Artist`, `Album`, `AudioQuality`, `PlayerState`, `PlayerStatus`, `PlayerEvent`, `LoadOptions`, `LoadResult`, `IpcResponse`
8383
- `shared/types/lyrics.ts` — `LyricFormat`, `LyricSource (external | embedded | online)`, `LyricData`, `LyricLine`, `LyricWord`, `LyricSpan`
8484
- `shared/types/platform.ts` — `Platform (netease | qqmusic | kugou)`
85-
- `shared/types/streaming.ts` — `StreamingServerType`, `StreamingServerConfig`, `StreamingPingResult`, `StreamingAuthResult` 等
85+
- `shared/types/streaming.ts` — `StreamingServerType`, `StreamingServerConfig`, `StreamingPingResult`, `StreamingAuthResult`, etc.
8686

8787
`Track` is for queue storage (no heavy data); `TrackDetail` loads on demand.
8888

@@ -93,7 +93,7 @@ Declarative — defined in `src/settings/schema.ts`, types in `src/types/setting
9393
### Data Storage
9494

9595
```
96-
{userData}/app-data/ # 统一数据目录(与 Chromium 的 Cache/ 等隔开,便携版整体迁移此目录)
96+
{userData}/app-data/ # Unified data directory, separate from Chromium cache data
9797
├── config/
9898
│ ├── settings.json # Main config (electron/main/store/)
9999
│ ├── streaming.json # Streaming credentials (safeStorage encrypted)
@@ -103,7 +103,7 @@ Declarative — defined in `src/settings/schema.ts`, types in `src/types/setting
103103
├── logs/ # App logs + native/
104104
└── plugins/ # scripts/ data/ logs/
105105
106-
# 全部路径集中定义于 electron/main/utils/paths.ts,改一处即可整体迁移
106+
# All paths are defined centrally in electron/main/utils/paths.ts
107107
```
108108

109109
Renderer IndexedDB (localforage): `splayer/library`, `splayer/queue`, `splayer/playlists`, `splayer/streaming-cache`.
@@ -136,13 +136,14 @@ Renderer uses `vue-i18n` with `src/i18n/locales/{zh-CN,en-US}.json`. Main proces
136136

137137
### Comments — Chinese, with JSDoc
138138

139-
All comments in Chinese. Methods use standard JSDoc with `@param 名 - 说明` and `@returns` when meaningful:
139+
All comments in Chinese. Methods use standard JSDoc with `@param name - description` and
140+
`@returns` when meaningful:
140141

141142
```ts
142143
/**
143-
* 取或生成 PlaySessionId,trackId 不变则复用
144-
* @param trackId - Track 全局 id
145-
* @returns PlaySessionId(UUID)
144+
* <Chinese method description>
145+
* @param trackId - <Chinese parameter description>
146+
* @returns <Chinese return description>
146147
*/
147148
```
148149

@@ -154,7 +155,9 @@ Split logic into files rather than separator comments. Don't extract a helper fo
154155

155156
### Memory Discipline
156157

157-
Memory is a hard requirement. Main process logs `内存占用:` (`app.getAppMetrics()`, 60s after launch then every 10 min); when a change touches rendering, caching, or IPC, verify before/after with these samples.
158+
Memory is a hard requirement. The main process logs memory usage through `app.getAppMetrics()`
159+
60 seconds after launch and then every 10 minutes. When a change touches rendering, caching, or
160+
IPC, verify before and after with these samples.
158161

159162
- **Images by display size** — anything blurred, sampled, or rendered small uses the 300px `cover` thumbnail (player blur background, color extraction, lists). `coverOriginal` only for the visible large cover and poster export. Large `<img>`: add `decoding="async"`; preload with `img.decode()` before fading in.
160163
- **Compositing layers are budgeted** — never put `will-change` in CSS on unbounded element collections; promote dynamically and only near the viewport (lyric engine `lineWillChange` pattern). New full-screen `filter: blur` / `backdrop-filter` layers need justification.
@@ -195,4 +198,6 @@ Put cross-process types (`LocaleCode / SystemConfig / StreamingServerType`, etc.
195198

196199
### Commit Messages
197200

198-
Single-line title in Chinese; no body/bullets unless explicitly requested.
201+
Use Conventional Commits with a Chinese summary: `<type>: <summary>`. Keep the title on one line;
202+
do not add a body or bullets unless explicitly requested. Use the type that matches the change,
203+
such as `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `build`, `ci`, `style`, or `chore`.

‎docs/contributing.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ shared/ 跨进程共享的类型与默认配置
7777
- **格式**:遵循 Prettier 配置(双引号、分号、100 列、尾随逗号);提交前请运行 `pnpm format`。
7878
- **类型检查**:提交前确保 `pnpm typecheck` 与 `pnpm lint` 通过。
7979
- **原生类型**:从 `@splayer/*` 导入,切勿手写 `native/*/index.d.ts`。
80-
- **提交信息**:使用单行中文标题,无特殊说明不附正文。
80+
- **提交信息**:使用 Conventional Commits,格式为 `<类型>: <中文摘要>`;标题保持单行,
81+
无特殊说明不附正文。类型按改动选择,如
82+
`feat`、`fix`、`refactor`、`perf`、`docs`、`test`、`build`、`ci`、`style`、`chore`。
8183

8284
## 国际化
8385

0 commit comments

Comments
 (0)