Skip to content

Commit

Permalink
Merge branch 'preview-features' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Mar 26, 2023
2 parents 9bf2890 + b541e18 commit 1b524b5
Show file tree
Hide file tree
Showing 81 changed files with 1,695 additions and 290 deletions.
56 changes: 55 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
# 更新日志

## v2.7.0-preview
`2023-03-26`

包含 v2.7.0 的所有更新内容.

- 新增功能 `组件二等分`, 在出现问题时可帮助定位是哪个组件导致的问题. (#3829, PR #3965 by [JLoeve](https://github.com/LonelySteve))
- 优化了 `loadFeatureCode` 的代码. (PR #4013 by [timongh](https://github.com/timongh))
- 搜索栏在搜索 ID 时的优化, 新增功能可以通过安装对应的插件来使用: (#677)
- 搜索 av / BV 号时, 支持显示视频标题
- 支持搜索专栏 cv 号 / 文集 rl 号
- 支持搜索音频 au 号 / 播放列表 am 号
- 支持搜索番剧 ss / ep 号, 或番剧详情 md 号
- `自定义顶栏` 的收藏和稍后再看支持显示数量. (#4069)
- 优化了 `网址参数清理` 的逻辑, 通过 Hook History API 来减少出现重复的历史记录. (#4039)
- 新增功能 `隐藏热搜`. (#3744)
> 隐藏搜索栏和搜索页面中的 `bilibili 热搜`.
- 新增功能 `隐藏视频分享`. (#3663)
> 隐藏视频和番剧播放器下方的分享按钮.
- `自定义顶栏` 的订阅支持过滤 在看 / 看过 / 想看. (#3217)
- 新增插件 `快捷键扩展 - 开关灯`. (#3587)
> 在快捷键的动作列表里添加一个 "开关灯".
## v2.7.0
`2023-03-26`

增加了 GitHub Projects 看板: https://github.com/users/the1812/projects/1/views/3, 上面会列出当前和未来计划的功能, 可供参考.

✨新增
- 快捷键扩展的几个插件自带了 YouTube / PotPlayer 等预设的默认按键. (#3971)
- `简化直播间` 在开启隐藏付费礼物时, 将直接隐藏左下角的打榜入口 (以前是领银瓜子所以没算进付费礼物). (#4067)
- `专栏文字选择` 更名为 `专栏复制优化`, 现在专栏的文字默认就可以直接选择, 本功能可以用于去除复制后带上的多余文本. (#4065)
- 删除功能 `直播录像下载`, 现在已经没有直播录像的页面了. (#4061)
- 在检测到[解除番剧区域限制](https://greasyfork.org/zh-CN/scripts/25718-%E8%A7%A3%E9%99%A4b%E7%AB%99%E5%8C%BA%E5%9F%9F%E9%99%90%E5%88%B6)的脚本在运行时, 本脚本将停止运行以避免兼容性问题. (#2704)
- `选集区域优化` 在多个分组时支持仅展开当前分组. (#3899)
- `播放时自动关灯` 支持星光动画. (PR #4077 by [z503722728](https://github.com/z503722728))

🐛修复
- 修复 `直播信息扩充` 失效的问题. (#4034, PR #4043 by [deepdarkssj](https://github.com/deepdarkssj))
- 修复 `简化直播间` 在开启隐藏付费礼物时, 右下布局错乱. (PR #4089 by [Pencil](https://github.com/pencilqaq))
- 修复动态相关功能对新版专栏卡片不生效. (#3994)
- 修复搜索界面的广告链接仍然可点击. (#3969)
- 修复 `图片批量导出` 在动态失效了. (#4038)
- 修复 `选集区域优化` 仅开启 `展开选集标题` 时视频标题无法显示完全. (#3909)
- 修复 `查看封面` 在复制链接后没有显示成功图标. (#4002)
- 修复番剧页面的部分夜间模式. (PR #4077 by [z503722728](https://github.com/z503722728))

☕开发者相关
- 修复 `IframePopup.vue` 的类型定义. (PR #4014 by [timongh](https://github.com/timongh))
- 修复 `UserItem.vue` 初始化 Toast 的逻辑问题. (PR #4056 by [timongh](https://github.com/timongh))
- 优化了 `switch-options.ts` 的注释. (PR #4021 by [timongh](https://github.com/timongh))
- 清理了项目中 Vue 文件里对未定义字段的引用. (#3992)
- 导出了 Dialog API (`@/core/dialog`), 允许其他组件使用.
- 调整了 CONTRIBUTING 中的本地开发流程描述. (PR #4077 by [z503722728](https://github.com/z503722728))

## v2.6.3-preview
`2023-02-09`
`2023-02-20`

包含 v2.6.3 的所有更新内容.

Expand Down
41 changes: 28 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 代码贡献指南

Bilibili Evolved 是一个基于 Web 前端技术构建的油猴脚本, 贡献代码前应具备的相关能力有:
- 了解最基础的油猴脚本的开发流程, 包括理解 [UserScript Header 和 GM API](https://www.tampermonkey.net/documentation.php?locale=en).
- 熟悉 Web 前端技术, 编写逻辑时使用 [TypeScript](https://www.typescriptlang.org/), 编写样式时使用 [Scss](https://sass-lang.com/), 创建 UI 时使用 [Vue 2](https://v2.cn.vuejs.org/).
- 新增的代码能够通过 [ESLint](https://eslint.org/)[TypeScript](https://www.typescriptlang.org/) 检查.

## 搭建开发环境

- 需要安装 [Node.js](https://nodejs.org/en/download/) (>= 14.0), [Visual Studio Code](https://code.visualstudio.com/)[pnpm](https://pnpm.io/installation).
Expand All @@ -13,17 +18,22 @@ cd registry
pnpm install
```

- [配置 VS Code 插件](https://code.visualstudio.com/docs/editor/extension-marketplace):
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint), 用于格式化 TypeScript 和 Vue 文件.
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), 用于格式化 Scss 和其他文件.

### 本体
需要说明的是, 脚本本体和功能是分开的两个项目. 本体的代码在 `src/` 下, 开发时产生 `dist/bilibili-evolved.dev.user.js` 文件. 功能的代码位于 `registry/` 下, 开发时在 `registry/dist/` 下产生文件.
> 如果不使用 Visual Studio Code, 则需要根据 `.vscode/tasks.json` 中各个任务定义的命令手动在终端执行. (npm scripts 仅用于 CI)
配置本地调试环境:

**如果使用的是基于 Chromium 的浏览器**
1. Chrome 插件管理 `chrome://extensions/` > Tampermonkey > 详细信息
2. 打开 `允许访问文件网址`
3. 新建脚本
4. 粘贴内容:
1. VS Code 中运行 `启动开发服务 dev-server` 任务, 会在项目的 `dist/` 文件夹下生成一个开发用的脚本 `dist/bilibili-evolved.dev.user.js`.
2. Chrome 插件管理 `chrome://extensions/` > Tampermonkey > 详细信息
3. 打开 `允许访问文件网址`
4. 新建脚本
5. 粘贴内容:
```js
// ==UserScript==
// @name Bilibili Evolved (Local)
Expand Down Expand Up @@ -63,19 +73,20 @@ pnpm install
// @connect localhost
// @connect *
// @require https://raw.githubusercontent.com/lodash/lodash/4.17.15/dist/lodash.min.js
// @require file://{{ bilibili-evolved.dev.user.js的绝对路径 }}
// @icon https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/logo-small.png
// @icon64 https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/logo.png
// ==/UserScript==
```
6. 在那些 `@require` 下面再添加一行 `@require file://{{ bilibili-evolved.dev.user.js的绝对路径 }}`
> Windows 例子: `@require file://C:/xxx/Bilibili-Evolved/bilibili-evolved.dev.user.js`

> macOS 例子: `@require file:///Users/xxx/Documents/Bilibili-Evolved/bilibili-evolved.dev.user.js`
6. 将里面的 `{{ bilibili-evolved.dev.user.js的绝对路径 }}` 替换为第一步生成的文件的真实路径.
> Windows 例子: `@require file://C:/xxx/Bilibili-Evolved/dist/bilibili-evolved.dev.user.js`
> macOS 例子: `@require file:///Users/xxx/Documents/Bilibili-Evolved/dist/bilibili-evolved.dev.user.js`
> 上面那些其他的 @require`src/client/common.meta.json` 里的保持一致就行, 偶尔这些依赖项会变动导致这个本地调试脚本失效, 到时候照着改一下就行.
7. 保存脚本, 运行 `启动开发服务 dev-server` 任务
8. 进入 b 站, 安装 `DevClient` 组件, 功能中显示已连接时就是成功了
7. 进入 b 站, 安装 `DevClient` 组件, 功能中显示已连接时就是成功了

**如果使用 Firefox 或 Safari**
1. 运行 `启动开发服务 dev-server` 任务时, 假设得到的本体链接为 `http://localhost:23333/dist/bilibili-evolved.dev.user.js`
Expand Down Expand Up @@ -138,6 +149,7 @@ pnpm install
## 可用资源
本体提供了大量 API 供组件 / 插件使用.

### 全局
全局变量, 无需 `import` 就可以直接使用. (Tampermonkey API 这里不再列出了, 可根据代码提示使用)

Expand Down Expand Up @@ -230,7 +242,11 @@ pnpm install
- `ui/AsyncButton.vue`: `click` 事件为异步函数时, 执行期间自动使 `Button` 禁用, 其他和 `Button` 相同.

## 代码风格检查
项目中含有 ESLint, 不通过 ESLint 是无法进行 Pull Request 的. 配置基于 `airbnb-base`, `typescript-eslint/recommended`, `vue/recommended` 修改而来, 几个比较特殊的规则如下:
项目中含有 ESLint, 不通过 ESLint 是无法进行 Pull Request 的.

你可以使用 [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 插件实时检查当前代码, 也可以运行 `生产:代码检查 prod:lint``生产:代码修复 prod:lint-fix` 来使用 ESLint 的命令行进行检查.

配置基于 `airbnb-base`, `typescript-eslint/recommended`, `vue/recommended` 修改而来, 几个比较特殊的规则如下:

### 强制性
- 除了 Vue 单文件组件, 禁止使用 `export default`, 所有导出必须命名.
Expand All @@ -243,12 +259,11 @@ pnpm install
- 不需要使用 `this` 特性的函数, 均使用箭头函数.

## 提交 commit
仅提交源代码上的修改即可, 不建议把 dist 文件夹里的产物也提交, 否则容易在 PR 时产生冲突.
仅提交源代码上的修改即可, 不要把 dist 文件夹里的产物也提交, 产物会在发布新版本时在对应的生产分支上构建.

commit message 只需写明改动点, 中英文随意, 也不强求类似 [commit-lint](https://github.com/conventional-changelog/commitlint) 的格式.

## 发起 PR (合并请求)
将你的分支往主仓库的 `preview-features` (新增功能) 或 `preview-fixes` (功能修复) 分支合并就行.

## 自行保留
你可以选择不将功能代码合并到主仓库, 因此也没有 ESLint 的限制. PR 时仅添加指向你的仓库中的组件信息即可, 具体来说, 是在 `registry/lib/docs/third-party.ts` 中, 往对应数组中添加你的功能的相关信息, 当然别忘了把 `owner` 设为你的 GitHub 用户名.
或者, 也可以选择不将功能代码合并到主仓库, 因此也没有 ESLint 的限制. PR 时仅添加指向你的仓库中的组件信息即可, 具体来说, 是在 `registry/lib/docs/third-party.ts` 中, 往对应数组中添加你的功能的相关信息, 当然别忘了把 `owner` 设为你的 GitHub 用户名.
10 changes: 10 additions & 0 deletions doc/donate.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ https://afdian.net/@the1812?tab=sponsor

| 时间 | 用户名 | 单号后4位 | 金额 |
| ------------------- | ---------------- | --------- | ------- |
| 2023.03.20 21:41:05 | 匿名 | 2237 | ¥6.66 |
| 2023.03.19 22:06:03 | *| 3670 | ¥20.00 |
| 2023.03.15 11:36:31 | k*n | 6491 | ¥1.00 |
| 2023.03.14 00:29:54 | *| 6448 | ¥10.00 |
| 2023.03.14 00:28:35 | *| 8124 | ¥10.00 |
| 2023.03.04 11:47:53 | 匿名 | 0764 | ¥5.00 |
| 2023.02.28 20:56:51 | *| 2857 | ¥10.00 |
| 2023.02.26 19:52:19 |*n | 0780 | ¥1.00 |
| 2023.02.20 23:40:27 | 匿名 | 5551 | ¥5.00 |
| 2023.02.20 21:15:04 | 匿名 | 6088 | ¥5.00 |
| 2023.02.18 22:49:21 | \*😕\* | 9195 | ¥5.00 |
| 2023.02.14 20:40:45 | 匿名 | 9914 | ¥5.00 |
| 2023.02.13 12:33:00 | A*l | 2182 | ¥66.00 |
Expand Down
62 changes: 51 additions & 11 deletions doc/features/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@
"fullRelativePath": "../../registry/dist/components/live/danmaku-sendbar.js",
"fullAbsolutePath": "registry/dist/components/live/danmaku-sendbar.js"
},
{
"type": "component",
"name": "downloadLiveRecords",
"displayName": "直播录像下载",
"description": "在直播录像页面 `live.bilibili.com/record/` 中添加下载支持.",
"fullRelativePath": "../../registry/dist/components/live/download-records.js",
"fullAbsolutePath": "registry/dist/components/live/download-records.js"
},
{
"type": "component",
"name": "liveGiftBox",
Expand Down Expand Up @@ -223,6 +215,14 @@
"fullRelativePath": "../../registry/dist/components/style/hide/banner.js",
"fullAbsolutePath": "registry/dist/components/style/hide/banner.js"
},
{
"type": "component",
"name": "hideTrendingSearch",
"displayName": "隐藏热搜",
"description": "隐藏搜索栏和搜索页面中的 `bilibili 热搜`.",
"fullRelativePath": "../../registry/dist/components/style/hide/trending-search.js",
"fullAbsolutePath": "registry/dist/components/style/hide/trending-search.js"
},
{
"type": "component",
"name": "hideRecommendedLive",
Expand All @@ -239,6 +239,14 @@
"fullRelativePath": "../../registry/dist/components/style/hide/video/related-videos.js",
"fullAbsolutePath": "registry/dist/components/style/hide/video/related-videos.js"
},
{
"type": "component",
"name": "hideVideoShare",
"displayName": "隐藏视频分享",
"description": "隐藏视频和番剧播放器下方的分享按钮.\r\n",
"fullRelativePath": "../../registry/dist/components/style/hide/video/share.js",
"fullAbsolutePath": "registry/dist/components/style/hide/video/share.js"
},
{
"type": "component",
"name": "hideVideoTopMask",
Expand Down Expand Up @@ -402,8 +410,8 @@
{
"type": "component",
"name": "columnUnlock",
"displayName": "专栏文字选择",
"description": "使专栏的文字可以选择.",
"displayName": "专栏复制优化",
"description": "(原名: 专栏文字选择, 现在专栏已经不限制选中文字了)\r\n\r\n避免专栏的文字复制后在最后带上出处信息, 更贴近原生的复制行为.\r\n",
"fullRelativePath": "../../registry/dist/components/utils/column-unlock.js",
"fullAbsolutePath": "registry/dist/components/utils/column-unlock.js"
},
Expand Down Expand Up @@ -483,7 +491,7 @@
"type": "component",
"name": "urlParamsClean",
"displayName": "网址参数清理",
"description": "自动删除网址中的多余跟踪参数. 请注意这会导致浏览器历史记录出现重复的标题 (分别是转换前后的网址), 并可能导致后退要多退几次.",
"description": "自动删除网址中的多余跟踪参数. 请注意这会导致浏览器历史记录出现重复的标题 (分别是转换前后的网址), 并可能导致后退要多退几次.\r\n",
"fullRelativePath": "../../registry/dist/components/utils/url-params-clean.js",
"fullAbsolutePath": "registry/dist/components/utils/url-params-clean.js"
},
Expand Down Expand Up @@ -776,6 +784,30 @@
"description": "by FoundTheWOUT\n\n在视频播放器右上角显示系统时间.",
"owner": "FoundTheWOUT"
},
{
"type": "plugin",
"name": "launchBar.actions.audioSearch",
"displayName": "搜索栏 - 音频跳转",
"description": "在输入音频的 au 号或播放列表的 am 号时, 提供对应的跳转选项.\r\n",
"fullRelativePath": "../../registry/dist/plugins/launch-bar/audio-search.js",
"fullAbsolutePath": "registry/dist/plugins/launch-bar/audio-search.js"
},
{
"type": "plugin",
"name": "launchBar.actions.bangumiSearch",
"displayName": "搜索栏 - 番剧跳转",
"description": "在输入番剧的 ss 号 / ep 号, 或番剧详情的 md 号时, 提供对应的跳转选项.\r\n",
"fullRelativePath": "../../registry/dist/plugins/launch-bar/bangumi-search.js",
"fullAbsolutePath": "registry/dist/plugins/launch-bar/bangumi-search.js"
},
{
"type": "plugin",
"name": "launchBar.actions.cvSearch",
"displayName": "搜索栏 - 专栏跳转",
"description": "在输入专栏的 cv 号或专栏文集的 rl 号时, 提供对应的跳转选项.\r\n",
"fullRelativePath": "../../registry/dist/plugins/launch-bar/cv-search.js",
"fullAbsolutePath": "registry/dist/plugins/launch-bar/cv-search.js"
},
{
"type": "plugin",
"name": "launchBar.trendingSearch",
Expand Down Expand Up @@ -832,6 +864,14 @@
"fullRelativePath": "../../registry/dist/plugins/utils/keymap-toggle-danmaku-list.js",
"fullAbsolutePath": "registry/dist/plugins/utils/keymap-toggle-danmaku-list.js"
},
{
"type": "plugin",
"name": "keymap.actions.togglePlayerLight",
"displayName": "快捷键扩展 - 开关灯",
"description": "在快捷键的动作列表里添加一个 \"开关灯\".",
"fullRelativePath": "../../registry/dist/plugins/utils/keymap-toggle-player-light.js",
"fullAbsolutePath": "registry/dist/plugins/utils/keymap-toggle-player-light.js"
},
{
"type": "plugin",
"name": "keymap.actions.toggleSubtitle",
Expand Down
Loading

0 comments on commit 1b524b5

Please sign in to comment.