Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fcb4cc4
♻️ 重构代码,升级为manifest v3
CodFrm Apr 23, 2025
deace16
♻️ 新储存引擎数据迁移
CodFrm Apr 24, 2025
416442c
🐛 修复重构mv3之后的一些细节问题
CodFrm Apr 25, 2025
37a5731
🔖 Release v0.17.0-alpha.3
CodFrm Apr 25, 2025
223da30
♻️ 优化引导与脚本站外部调用等功能
CodFrm Apr 28, 2025
2254fd1
🐛 修复首次打开浏览器加载脚本的问题
CodFrm Apr 28, 2025
324e27a
⚡️ 优化打包文件大小 #376
CodFrm Apr 29, 2025
2988176
🐛 修复脚本匹配、隐藏排序、首次打开浏览器加载脚本等问题 #317
CodFrm Apr 29, 2025
ca6324d
🐛 修复GM.* API问题 #363
CodFrm Apr 29, 2025
e04795a
🐛 更换交互element方式 #334
CodFrm Apr 29, 2025
28f3d86
✨ 添加 GM_info 中的 downloadMode 标识 #348
CodFrm Apr 29, 2025
47d7cec
🐛 处理 GM_xmlhttpRequest redirect问题 #330
CodFrm Apr 29, 2025
caa3bf2
🚧 firefox兼容
CodFrm Apr 29, 2025
c299df0
🐛 修复从GitHub安装脚本卡住的问题 #378
CodFrm May 1, 2025
20eba92
⚡️ 性能优化
CodFrm May 2, 2025
bcc2a5b
✨ 实现 window.close / window.focus (#383)
DreamNya May 8, 2025
e2c860d
⬆️ 更新 ESLint 依赖及规则 (#385)
DreamNya May 9, 2025
7cd1dcd
🐛 修复 ESLint 支持CATApi / Headers 问题 (#386)
DreamNya May 10, 2025
865e5f6
✨ 实现 @run-in / 分离隐身模式 (#384)
DreamNya May 10, 2025
70554c7
✨ 本地/链接导入
CodFrm May 13, 2025
01c146b
Merge remote-tracking branch 'origin/develop/mv3' into release/mv3
CodFrm May 13, 2025
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

72 changes: 0 additions & 72 deletions .eslintrc.cjs

This file was deleted.

18 changes: 10 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ jobs:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: 22
cache: 'pnpm'

- name: Package with Node
env:
Expand All @@ -26,19 +28,19 @@ jobs:
mkdir dist
echo "$CHROME_PEM" > ./dist/scriptcat.pem
chmod 600 ./dist/scriptcat.pem
npm ci
npm run pack
pnpm i
pnpm run pack

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: all-artifacts
path: |
dist/*.zip
dist/*.crx

- name: Archive extension
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: scriptcat
path: |
Expand Down
61 changes: 10 additions & 51 deletions .github/workflows/packageRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: 22
cache: 'pnpm'

- name: Package with Node
env:
Expand All @@ -25,52 +27,9 @@ jobs:
mkdir dist
echo "$CHROME_PEM" > ./dist/scriptcat.pem
chmod 600 ./dist/scriptcat.pem
npm ci
npm test
npm run pack

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
'no description'
draft: false
prerelease: false
pnpm i
pnpm run pack

- name: Upload Release Asset zip
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.zip
asset_name: scriptcat-${{ github.ref_name }}-chrome.zip
asset_content_type: application/zip

- name: Upload FireFox Release Asset zip
id: upload-firefox-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/scriptcat-${{ github.ref_name }}-firefox.zip
asset_name: scriptcat-${{ github.ref_name }}-firefox.zip
asset_content_type: application/zip

- name: Upload Crx Release Asset zip
id: upload-crx-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.crx
asset_name: scriptcat-${{ github.ref_name }}-chrome.crx
asset_content_type: application/zip
artifacts: "./dist/*.zip,./dist/*.crx"
23 changes: 11 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@ name: test
on:
push:
branches:
- main
- release/*
- dev
- develop/*
pull_request:
- disable # 暂时禁用
# pull_request:

jobs:
tests:
runs-on: ubuntu-latest
name: Run tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: 22
cache: 'pnpm'

- name: Unit Test
run: |
npm ci
npm test
pnpm i
pnpm run coverage

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
6 changes: 4 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
dist/
example/
# Lock files
package-lock.json
pnpm-lock.yaml
yarn.lock
7 changes: 3 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"printWidth": 120,
"proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"endOfLine": "auto"
}
}
18 changes: 10 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ ScriptCat 引起的,欢迎提交 Issue。在提交时,请附带详细的复

## Pull Request

ScriptCat 使用 [npm](https://www.npmjs.com/) 来管理项目依赖。如果你已经安装了
ScriptCat 使用 [pnpm](https://pnpm.io/) 来管理项目依赖。如果你已经安装了
npm,以下的命令可以帮助你快速配置开发环境:

```bash
# 安装 node.js 依赖
npm install
pnpm install
```

我们推荐使用代理来解决 npm 的网络问题,而不是使用镜像。
我们推荐使用[代理](https://pnpm.io/npmrc#https-proxy)来解决 pnpm 的网络问题,而不是使用镜像。

```bash
# 设置代理
npm config set proxy=http://127.0.0.1:1080
# 设置代理(linux/mac)
export HTTPS_PROXY=http://127.0.0.1:1080
# 设置代理(windows)
set HTTPS_PROXY=http://127.0.0.1:1080
```

### Commit 规范
Expand Down Expand Up @@ -102,6 +104,7 @@ ScriptCat 的页面开发使用了以下技术:
- [React](https://reactjs.org/)
- UI 框架 [arco](https://arco.design)
- CSS 框架 [unocss](https://unocss.dev/interactive/)
- RsPack 打包工具 [rspack](https://rspack.dev/)

如果你想在本地运行 ScriptCat,可以使用以下命令:

Expand All @@ -117,7 +120,6 @@ npm run pack

在打包前,请确保在`dist`目录下生成了`scriptcat.pem`文件。

# 注意问题
## 注意问题

- 使用`yarn install`时可能会出现错误,最好使用`npm i`
- `npm run dev`之后需要把`dist/ext`目录里面内容在浏览器扩展里面导入加载,然后开始改代码保存即可,浏览器是实时更新的
- `npm run dev`之后需要把`dist/ext`目录里面内容在浏览器扩展里面导入加载,然后开始改代码保存即可,浏览器是实时更新的,但是涉及到`manifest.json`、`service_worker`、`offscreen`、`sandbox`的改动需要重新导入加载。
Loading