Skip to content
Merged

7.3.3 #645

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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ node_modules
.idea
.trae
.claude
.agents
.qoder
opencode.json

# Notes
notes
Expand Down
51 changes: 51 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 项目概述

BLTH(Bilibili Live Tasks Helper)是基于 Vue 3 + Vite + vite-plugin-monkey + Element Plus + TypeScript 的用户脚本(Userscript),通过用户脚本管理器(Tampermonkey/Violentmonkey)运行在 Bilibili 直播页面(`https://live.bilibili.com/直播间号`),实现自动完成每日任务、观看体验优化和页面元素清理。

# 常用命令

```sh
npm run dev # 启动 Vite 开发服务器并安装脚本(支持 HMR)
npm run build # type-check 与 build+minify 并行
npm run type-check # 仅 Vue TypeScript 类型检查
npm run lint # ESLint + Stylelint 自动修复
npm run format # 使用 Prettier 格式化 src/
npm run preview # 打开提供编译产物安装链接的本地预览网页
```

无自动化测试。

# 架构

## 模块系统

所有模块继承 `src/modules/BaseModule.ts`,由 `src/stores/useModuleStore.ts` 管理生命周期。

模块分两类:

- **默认模块**(`src/modules/default/`):做准备工作,如基础数据获取,先于大多数功能模块加载
- **功能模块**:实现具体业务逻辑,如完成每日任务

## 配置持久化

`src/library/storage/` 通过 `GM_setValue`/`GM_getValue` 存取配置。

## 多标签页安全

脚本分三类:`Main`,`SubMain`,`Other`。同时打开多个直播间页面时,`src/stores/useCacheStore.ts` 会选出唯一 `Main` 脚本,避免部分模块重复加载。

# 分支

- `master`:发布分支。合并来自 `dev` 的 PR 后触发 GitHub Actions 自动构建并创建 Release
- `dev`:开发分支。非发布 PR 的目标分支

# 规范

- `src/library/bili-api/` 中的 API 必须有详细的请求/响应类型定义
- 路径别名 `@/` 映射到 `src/`
- Commit message 使用约定式提交格式

# 易踩坑点

- 新增第三方库须写进 `vite.config.ts` 的 `externalGlobals`/`externalResource` 中,通过 `@require`/`@resource` 引入,不打包进脚本
- 调试早期模块(`runAt = 'document-start'`)时 dev 模式注入太晚,请用 `npm run build` 的产物测试
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## [Unreleased]

## [7.3.3] - 2026-7-25

### 新增

- 【移除礼物赠送提示弹窗】支持移除粉丝勋章过期后随机出现在聊天框上的送礼点亮勋章提醒(你和xxx的灯牌已熄灭,一键点亮(1电池))

### 调整

- 优化脚本在多个标签页中运行时的身份判定问题,避免重复执行某些任务模块

## [7.3.2] - 2026-7-13

### 新增
Expand Down
52 changes: 1 addition & 51 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,51 +1 @@
# 项目概述

BLTH(Bilibili Live Tasks Helper)是基于 Vue 3 + Vite + vite-plugin-monkey + Element Plus + TypeScript 的用户脚本(Userscript),通过用户脚本管理器(Tampermonkey/Violentmonkey)运行在 Bilibili 直播页面(`https://live.bilibili.com/直播间号`),实现自动完成每日任务、观看体验优化和页面元素清理。

# 常用命令

```sh
npm run dev # 启动 Vite 开发服务器并安装脚本(支持 HMR)
npm run build # type-check 与 build+minify 并行
npm run type-check # 仅 Vue TypeScript 类型检查
npm run lint # ESLint + Stylelint 自动修复
npm run format # 使用 Prettier 格式化 src/
npm run preview # 打开提供编译产物安装链接的本地预览网页
```

无自动化测试。

# 架构

## 模块系统

所有模块继承 `src/modules/BaseModule.ts`,由 `src/stores/useModuleStore.ts` 管理生命周期。

模块分两类:

- **默认模块**(`src/modules/default/`):做准备工作,如基础数据获取,先于大多数功能模块加载
- **功能模块**:实现具体业务逻辑,如完成每日任务

## 配置持久化

`src/library/storage/` 通过 `GM_setValue`/`GM_getValue` 存取配置。

## 多标签页安全

脚本分三类:`Main`,`SubMain`,`Other`。同时打开多个直播间页面时,`src/stores/useCacheStore.ts` 会选出唯一 `Main` 脚本,避免部分模块重复加载。

# 分支

- `master`:发布分支。合并来自 `dev` 的 PR 后触发 GitHub Actions 自动构建并创建 Release
- `dev`:开发分支。非发布 PR 的目标分支

# 规范

- `src/library/bili-api/` 中的 API 必须有详细的请求/响应类型定义
- 路径别名 `@/` 映射到 `src/`
- Commit message 使用约定式提交格式

# 易踩坑点

- 新增第三方库须写进 `vite.config.ts` 的 `externalGlobals`/`externalResource` 中,通过 `@require`/`@resource` 引入,不打包进脚本
- 调试早期模块(`runAt = 'document-start'`)时 dev 模式注入太晚,请用 `npm run build` 的产物测试
@AGENTS.md
Loading