Skip to content

Commit

Permalink
merge: refactor/request (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 authored Sep 13, 2021
2 parents 75c52a8 + afe0a76 commit ba26d89
Show file tree
Hide file tree
Showing 21 changed files with 8,087 additions and 90 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "10"
},
"useBuiltIns": "usage",
"corejs": {
"version": 3,
"proposals": true
}
}
]
]
}
38 changes: 38 additions & 0 deletions .github/workflows/build-precompiled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build precompiled JavaScript file

on:
push:
branches:
- enhanced
workflow_dispatch:

jobs:
run-prettier:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: yarn

- name: Install dependencies
run: yarn

- name: Build the precompiled package
run: yarn build

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PR_PAT }}
commit-message: 'build(precompiled): make a bundle with the dependencies'
delete-branch: true
title: 'build(precompiled): make a bundle with the dependencies'
body: |
Merge till a new release tagged.
labels: ci:build
4 changes: 3 additions & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- enhanced
paths-ignore:
- precompiled
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -35,4 +37,4 @@ jobs:
title: 'style: with prettier'
body: |
Please help me check this. Thanks! :-)
labels: style
labels: ci:style
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ fork 自 [nondanee 的原版](https://github.com/nondanee/UnblockNeteaseMusic)

## 运行

### 直接打開可执行文件
### 直接打开可执行文件

去右侧的 Releases 找到最新版本,然后在下方的 Assets 找到符合你系统架构的可执行文件。下載回來後点两下即可使用
去右侧的 Releases 找到最新版本,然后在下方的 Assets 找到符合你系统架构的可执行文件。下载回来后点两下即可使用

> macOS 因为签名问题,暂时不提供可执行文件。请先按照其他做法使用。
Expand Down Expand Up @@ -51,14 +51,29 @@ cd UnblockNeteaseMusic
docker-compose up
```

### 传统作法
### 直接使用 Repo 最新版本

```bash
git clone https://github.com/1715173329/UnblockNeteaseMusic
cd UnblockNeteaseMusic
node app.js # 建议使用 screen / tmux 把 app.js 挂后台
```

#### 编译最新的 package

```bash
yarn
yarn build
node app.js # 即可使用 repo 的最新开发内容
```

#### 采用(而不编译)最新的 package

```bash
yarn
DEVELOPMENT=true node app.js
```

### Android Xposed 模块

请移步至 [杜比大喇叭 β 版](https://github.com/nining377/dolby_beta)
Expand Down Expand Up @@ -102,7 +117,8 @@ optional arguments:
| SIGN_CERT | path | 自定义证书文件 | `SIGN_CERT="./ca.crt"` |
| SIGN_KEY | path | 自定义密钥文件 | `SIGN_KEY="./server.key"` |
| NO_CACHE | bool | 停用 cache | `NO_CACHE=true` |
| DISABLE_HTTPDNS | bool | 停用 Netease HTTPDNS 查詢 | `DISABLE_HTTPDNS=true` |
| ENABLE_HTTPDNS | bool | 启用故障的 Netease HTTPDNS 查询。不建议启用 | `ENABLE_HTTPDNS=true` |
| DEVELOPMENT | bool | 启用开发模式。需要自己用 `yarn` 安装依赖 (dependencies) | `DEVELOPMENT=true` |
## 使用
Expand Down
5 changes: 3 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env node
require('./src/app');
#!/usr/bin/node

require('./src/bootstrap')('app');
5 changes: 3 additions & 2 deletions bridge.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env node
require('./src/bridge');
#!/usr/bin/node

require('./src/bootstrap')('bridge');
17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@1715173329/unblockneteasemusic",
"version": "0.26.1",
"version": "v0.27.0-beta.1",
"description": "Revive unavailable songs for Netease Cloud Music",
"main": "src/provider/match.js",
"bin": {
"unblockneteasemusic": "app.js"
"unblockneteasemusic": "./precompiled/app.js"
},
"scripts": {
"build": "rollup -c",
"pkg": "pkg . --out-path=dist/",
"test": "jest"
},
"pkg": {
"scripts": "build/**/*.js",
"assets": [
"server.key",
"server.crt"
Expand All @@ -36,7 +36,16 @@
},
"private": true,
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"jest": "^27.1.0",
"prettier": "^2.3.2"
"pkg": "^5.3.2",
"prettier": "^2.3.2",
"rollup": "^2.56.3",
"core-js": "3"
}
}
Loading

0 comments on commit ba26d89

Please sign in to comment.