Skip to content

Commit

Permalink
feat: Console
Browse files Browse the repository at this point in the history
Update arguments-builder.config.ts
Update boxjs.settings.json
Update CHANGELOG.md
Update response.dev.js
Update request.dev.js
Update database.mjs
Update response.js
Update request.js
Update setENV.mjs
Update types.d.ts
  • Loading branch information
VirgilClyne committed Dec 9, 2024
1 parent 10e8198 commit 86e4333
Show file tree
Hide file tree
Showing 43 changed files with 4,399 additions and 2,007 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,24 @@ jobs:
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
- name: Update local package.json version from release tag
if: github.ref_type == 'tag'
uses: BellCubeDev/update-package-version-by-release-tag@v2
with:
version: ${{ github.ref_name }}
keep-v: "false" # If set to "true", will not remove any 'v' prefix from the version number.
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
- name: Build scripts
run: npm run build
- name: Generate modules
run: npm run build:args
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: output
name: artifact
path: |
.github/RELEASE-TEMPLATE.md
CHANGELOG.md
rulesets
modules
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- dev

permissions:
actions: read
contents: read

jobs:
debug:
uses: ./.github/workflows/dev.yml
secrets: inherit
deploy:
needs: debug
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: artifact
- name: Deploy
uses: exuanbo/actions-deploy-gist@main
with:
token: ${{ secrets.GIST_TOKEN }}
gist_id: b5f0de011fabe5637ff53e585e9d061d
gist_description: " iRingo: ⭕ Siri β"
file_path: dist/request.bundle.js
- name: Deploy
uses: exuanbo/actions-deploy-gist@main
with:
token: ${{ secrets.GIST_TOKEN }}
gist_id: b5f0de011fabe5637ff53e585e9d061d
gist_description: " iRingo: ⭕ Siri β"
file_path: dist/response.bundle.js
39 changes: 39 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dev
on:
workflow_call:
workflow_dispatch:

permissions:
actions: read
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN }}
ref: dev
- name: Set up Node.js
uses: actions/setup-node@main
with:
node-version: 'latest'
cache: 'npm'
- name: Install dependencies
run: npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
- name: Build
run: npm run build:dev
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: artifact
path: |
CHANGELOG.md
rulesets
modules
dist
10 changes: 5 additions & 5 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ permissions:
contents: write

jobs:
test:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
draft:
needs: test
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: output
name: artifact
- name: Publish Draft
uses: softprops/action-gh-release@v2
with:
body_path: .github/RELEASE-TEMPLATE.md
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rulesets/*
dist/*.js
modules/*
dist/*
draft: true
8 changes: 4 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*.*.*-alpha*'
- 'v*.*.*-beta*'
- v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+

permissions:
actions: read
Expand All @@ -21,14 +21,14 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: output
name: artifact
- name: Publish Pre-Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rulesets/*
dist/*.js
modules/*
dist/*
prerelease: true
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*.*.*-rc*'
- v[0-9]+.[0-9]+.[0-9]+

permissions:
actions: read
Expand All @@ -20,14 +20,14 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: output
name: artifact
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rulesets/*
dist/*.js
modules/*
dist/*
make_latest: "true"
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "src/proto"]
path = src/proto
url = https://github.com/NSRingo/proto.git
[submodule "src/utils"]
path = src/utils
url = https://github.com/NanoCat-Me/utils.git
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry=https://registry.npmjs.org/
@nsnanocat:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
* 首次发布
### 🛠️ Bug Fixes
* 修复 `$argument``$persistentStore` 载入顺序颠倒的问题
* 正确顺序为先读取 `$argument` 再读取 `$persistentStore (BoxJs)`
* 即,有相同键名时,`$persistentStore (BoxJs)` 的值会覆盖 `$argument` 的值

### ‼️ Breaking Changes
* 从脚本中移除了 `@nsnanocat/url` polyfill
* 由于 `@nsnanocat/url` 已经被移除,所以 `⭕ Siri` 项目已完全不再支持 `🚀 ShadowRocket`

### 🔣 Dependencies
* 升级了 `@nsnanocat/util`
* `util``submodule` 更改为 `package`
* `$platform` 改为 `$app`
* 使用了全新的 `Console` polyfill

### 🔄 Other Changes
* 打包器由 `rollup` 更改为 `rspack`
153 changes: 153 additions & 0 deletions arguments-builder.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import { defineConfig } from "@iringo/arguments-builder";
export default defineConfig({
output: {
surge: {
path: "./dist/iRingo.Siri.sgmodule",
transformEgern: {
enable: true,
path: "./dist/iRingo.Siri.yaml",
},
},
loon: {
path: "./dist/iRingo.Siri.plugin",
},
customItems: [
{
path: "./dist/iRingo.Siri.snippet",
template: "./template/quantumultx.handlebars",
},
{
path: "./dist/iRingo.Siri.stoverride",
template: "./template/stash.handlebars",
},
],
dts: { isExported: true, path: "./src/types.d.ts" },
boxjsSettings: {
path: "./template/boxjs.settings.json",
scope: "@iRingo.Spotlight.Settings",
},
},
args: [
{
key: "CountryCode",
name: "国家或地区代码",
type: "string",
defaultValue: "SG",
description: "不同国家或地区提供的内容或有差别,此选项同时会影响分配给您不同地区的 Siri 服务器。",
options: [
{ key: "AUTO", label: "🇺🇳自动(跟随系统地区设置)" },
{ key: "CN", label: "🇨🇳中国大陆" },
{ key: "HK", label: "🇭🇰中国香港" },
{ key: "TW", label: "🇹🇼中国台湾" },
{ key: "SG", label: "🇸🇬新加坡" },
{ key: "US", label: "🇺🇸美国" },
{ key: "JP", label: "🇯🇵日本" },
{ key: "AU", label: "🇦🇺澳大利亚" },
{ key: "GB", label: "🇬🇧英国" },
{ key: "KR", label: "🇰🇷韩国" },
{ key: "CA", label: "🇨🇦加拿大" },
{ key: "IE", label: "🇮🇪爱尔兰" },
],
},
{
key: "Domains",
name: "搜索领域",
type: "array",
defaultValue: ["web", "itunes", "app_store", "movies", "restaurants", "maps"],
description: "启用搜索的领域,领域数据由国家或地区设置决定,此选项仅开启搜索的领域,不代表设置的地区一定有相应的数据和服务。",
options: [
{
key: "web",
label: "网页",
},
{
key: "itunes",
label: "iTunes",
},
{
key: "app_store",
label: "App Store",
},
{
key: "movies",
label: "电影",
},
{
key: "restaurants",
label: "餐厅",
},
{
key: "maps",
label: "地图",
},
],
},
{
key: "Functions",
name: "功能",
type: "array",
defaultValue: ["flightutilities", "lookup", "mail", "messages", "news", "safari", "siri", "spotlight", "visualintelligence"],
description: "启用的「Siri 建议」功能,未选的功能不代表关闭,仅代表还原到该地区默认设置状态。",
options: [
{
key: "flightutilities",
label: "航班工具",
},
{
key: "lookup",
label: "查询",
},
{
key: "mail",
label: "邮件",
},
{
key: "messages",
label: "信息",
},
{
key: "news",
label: "新闻",
},
{
key: "safari",
label: "Safari浏览器",
},
{
key: "siri",
label: "Siri",
},
{
key: "spotlight",
label: "聚焦搜索",
},
{
key: "visualintelligence",
label: "视觉智能",
},
],
},
{
key: "SafariSmartHistory",
name: "Safari 智能历史记录",
type: "boolean",
defaultValue: true,
description: "是否在 Safari 浏览器中启用基于历史记录的Siri建议功能,启用后将在Safari浏览器起始页推荐基于时间地点跨设备等的相关浏览记录。",
},
{
key: "LogLevel",
name: "[调试] 日志等级",
type: "string",
defaultValue: "WARN",
description: "选择脚本日志的输出等级,低于所选等级的日志将全部输出。",
options: [
{ key: "OFF", label: "关闭" },
{ key: "ERROR", label: "❌ 错误" },
{ key: "WARN", label: "⚠️ 警告" },
{ key: "INFO", label: "ℹ️ 信息" },
{ key: "DEBUG", label: "🅱️ 调试" },
{ key: "ALL", label: "全部" },
],
},
],
});
Loading

0 comments on commit 86e4333

Please sign in to comment.