Skip to content

Commit c54f04e

Browse files
committed
chore: arguments-builder
Update package.json
1 parent 483dd6b commit c54f04e

25 files changed

+911
-150
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,22 @@ jobs:
2323
cache: 'npm'
2424
- name: Install dependencies
2525
run: npm install
26-
- name: Build
26+
- name: Update local package.json version from release tag
27+
if: github.ref_type == 'tag'
28+
uses: BellCubeDev/update-package-version-by-release-tag@v2
29+
with:
30+
version: ${{ github.ref_name }}
31+
keep-v: "false" # If set to "true", will not remove any 'v' prefix from the version number.
32+
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
33+
- name: Build scripts
2734
run: npm run build
35+
- name: Generate modules
36+
run: npm run build:args
2837
- name: Upload artifact
2938
uses: actions/upload-artifact@master
3039
with:
31-
name: output
40+
name: artifact
3241
path: |
33-
.github/RELEASE-TEMPLATE.md
3442
CHANGELOG.md
3543
modules
3644
dist

.github/workflows/debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
- name: Upload artifact
3030
uses: actions/upload-artifact@master
3131
with:
32-
name: dist
32+
name: artifact
3333
path: dist

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Download artifact
2121
uses: actions/download-artifact@master
2222
with:
23-
name: dist
23+
name: artifact
2424
path: dist
2525
- name: Deploy
2626
uses: exuanbo/actions-deploy-gist@main

.github/workflows/draft.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
- name: Download artifact
2121
uses: actions/download-artifact@master
2222
with:
23-
name: output
23+
name: artifact
2424
- name: Publish Draft
2525
uses: softprops/action-gh-release@v2
2626
with:
27-
body_path: .github/RELEASE-TEMPLATE.md
27+
body_path: CHANGELOG.md
2828
token: ${{ secrets.GITHUB_TOKEN }}
2929
files: |
30-
dist/*.js
30+
dist/*
3131
modules/*
3232
draft: true

.github/workflows/pre-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
push:
44
# Sequence of patterns matched against refs/tags
55
tags:
6-
- 'v*.*.*-alpha*'
7-
- 'v*.*.*-beta*'
6+
- v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+
7+
- v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+
88

99
permissions:
1010
actions: read
@@ -21,13 +21,13 @@ jobs:
2121
- name: Download artifact
2222
uses: actions/download-artifact@master
2323
with:
24-
name: output
24+
name: artifact
2525
- name: Publish Pre-Release
2626
uses: softprops/action-gh-release@v2
2727
with:
2828
body_path: CHANGELOG.md
2929
token: ${{ secrets.GITHUB_TOKEN }}
3030
files: |
31-
dist/*.js
31+
dist/*
3232
modules/*
3333
prerelease: true

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
# Sequence of patterns matched against refs/tags
55
tags:
6-
- 'v*.*.*-rc*'
6+
- v[0-9]+.[0-9]+.[0-9]+
77

88
permissions:
99
actions: read
@@ -20,13 +20,13 @@ jobs:
2020
- name: Download artifact
2121
uses: actions/download-artifact@master
2222
with:
23-
name: output
23+
name: artifact
2424
- name: Publish Release
2525
uses: softprops/action-gh-release@v2
2626
with:
2727
body_path: CHANGELOG.md
2828
token: ${{ secrets.GITHUB_TOKEN }}
2929
files: |
30-
dist/*.js
30+
dist/*
3131
modules/*
3232
make_latest: "true"

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
### 🛠️ Bug Fixes
2-
* 修复 Shadowrocket 专用模块内链
1+
### 🔄 Other Changes
2+
* 自动生成模块

arguments-builder.config.ts

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
import { defineConfig } from "@iringo/arguments-builder";
2+
export default defineConfig({
3+
output: {
4+
surge: {
5+
path: "./dist/Maps.sgmodule",
6+
},
7+
loon: {
8+
path: "./dist/Maps.plugin",
9+
},
10+
customItems: [
11+
{
12+
path: "./dist/Maps.snippet",
13+
template: "./template/quantumultx.handlebars",
14+
},
15+
{
16+
path: "./dist/Maps.stoverride",
17+
template: "./template/stash.handlebars",
18+
},
19+
{
20+
path: "./dist/Maps.srmodule",
21+
template: "./template/shadowrocket.handlebars",
22+
},
23+
],
24+
dts: { isExported: true, path: "./src/settings.ts" },
25+
boxjsSettings: {
26+
path: "./template/boxjs.settings.json",
27+
scope: "@iRingo.Maps.Settings",
28+
},
29+
},
30+
args: [
31+
{
32+
defaultValue: true,
33+
description: "是否启用此APP修改",
34+
exclude: ["surge", "loon"],
35+
key: "Switch",
36+
name: "总功能开关",
37+
type: "boolean",
38+
},
39+
{
40+
defaultValue: "CN",
41+
description: "此选项影响“地图”整体配置内容,包括以下的地图功能与服务。",
42+
key: "GeoManifest.Dynamic.Config.CountryCode.default",
43+
name: "[全局 动态配置]资源清单的国家或地区代码",
44+
options: [
45+
{ key: "AUTO", label: "🇺🇳自动(跟随用户当前所在地区)" },
46+
{ key: "CN", label: "🇨🇳中国大陆" },
47+
{ key: "HK", label: "🇭🇰中国香港" },
48+
{ key: "TW", label: "🇹🇼中国台湾" },
49+
{ key: "SG", label: "🇸🇬新加坡" },
50+
{ key: "US", label: "🇺🇸美国" },
51+
{ key: "JP", label: "🇯🇵日本" },
52+
{ key: "AU", label: "🇦🇺澳大利亚" },
53+
{ key: "GB", label: "🇬🇧英国" },
54+
{ key: "KR", label: "🇰🇷韩国" },
55+
{ key: "CA", label: "🇨🇦加拿大" },
56+
{ key: "IE", label: "🇮🇪爱尔兰" },
57+
],
58+
type: "string",
59+
},
60+
{
61+
defaultValue: "US",
62+
description: "此选项影响 watchOS “地图”整体配置内容,包括以下的地图功能与服务。",
63+
key: "GeoManifest.Dynamic.Config.CountryCode.watchOS",
64+
name: "[watchOS 动态配置]资源清单的国家或地区代码",
65+
options: [
66+
{ key: "AUTO", label: "🇺🇳自动(跟随用户当前所在地区)" },
67+
{ key: "CN", label: "🇨🇳中国大陆" },
68+
{ key: "HK", label: "🇭🇰中国香港" },
69+
{ key: "TW", label: "🇹🇼中国台湾" },
70+
{ key: "SG", label: "🇸🇬新加坡" },
71+
{ key: "US", label: "🇺🇸美国" },
72+
{ key: "JP", label: "🇯🇵日本" },
73+
{ key: "AU", label: "🇦🇺澳大利亚" },
74+
{ key: "GB", label: "🇬🇧英国" },
75+
{ key: "KR", label: "🇰🇷韩国" },
76+
{ key: "CA", label: "🇨🇦加拿大" },
77+
{ key: "IE", label: "🇮🇪爱尔兰" },
78+
],
79+
type: "string",
80+
},
81+
{
82+
defaultValue: "AutoNavi",
83+
description:
84+
"地点数据接口,此选项影响公共指南,兴趣点(POI)与位置信息等功能。",
85+
key: "UrlInfoSet.Dispatcher",
86+
name: "[URL信息集]调度器",
87+
options: [
88+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
89+
{
90+
key: "AutoNavi",
91+
label:
92+
"🧭高德(🇨🇳:互动百科/大众点评/携程 | 🇺🇳:维基百科/Yelp/Booking)",
93+
},
94+
{ key: "Apple", label: "Apple(维基百科/Yelp/Booking)" },
95+
],
96+
type: "string",
97+
},
98+
{
99+
defaultValue: "AutoNavi",
100+
description: "导航与ETA服务接口,此选项影响导航与ETA(到达时间)等功能。",
101+
key: "UrlInfoSet.Directions",
102+
name: "[URL信息集]导航与ETA",
103+
options: [
104+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
105+
{ key: "AutoNavi", label: "🧭高德(🇨🇳:高德地图 | 🇺🇳:TomTom)" },
106+
{ key: "Apple", label: "Apple(🇨🇳:🈚️ | 🇺🇳:TomTom)" },
107+
],
108+
type: "string",
109+
},
110+
{
111+
defaultValue: "Apple",
112+
description: "评分和照片服务接口,此选项影响评分和照片服务以及照片使用。",
113+
key: "UrlInfoSet.RAP",
114+
name: "[URL信息集]评分和照片",
115+
options: [
116+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
117+
{ key: "AutoNavi", label: "🧭高德(🇨🇳:🈶️但未开放 | 🇺🇳:🈚️)" },
118+
{ key: "Apple", label: "Apple(🇨🇳:🈚️ | 🇺🇳:🈶️)" },
119+
],
120+
type: "string",
121+
},
122+
{
123+
defaultValue: "AUTO",
124+
description:
125+
"定位漂移修正服务接口,控制定位漂移和🧭指南针与📍坐标的经纬度。",
126+
key: "UrlInfoSet.LocationShift",
127+
name: "[URL信息集]定位漂移",
128+
options: [
129+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
130+
{ key: "AutoNavi", label: "🧭高德(🈚️坐标,使用🇨🇳GCJ-02坐标)" },
131+
{ key: "Apple", label: "Apple(🈶️坐标,使用🇺🇳WGS-84坐标)" },
132+
],
133+
type: "string",
134+
},
135+
{
136+
defaultValue: "HYBRID",
137+
description: "此选项影响所列位图、影像与模型数据。",
138+
key: "TileSet.Satellite",
139+
name: "[瓦片数据集]卫星图像",
140+
options: [
141+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
142+
{ key: "HYBRID", label: "混合(🇨🇳:2D较新 | 🇺🇳:主要城市3D)" },
143+
{ key: "CN", label: "🇨🇳中国四维(🇨🇳:2D较新 | 🇺🇳:🈚️)" },
144+
{ key: "XX", label: "🇺🇳DigitalGlobe(🇨🇳:2D较旧 | 🇺🇳:2D+主要城市3D)" },
145+
],
146+
type: "string",
147+
},
148+
{
149+
defaultValue: "XX",
150+
description: "此选项影响飞行俯瞰全球各地的主要地标和城市功能。",
151+
key: "TileSet.Flyover",
152+
name: "[瓦片数据集]飞行俯瞰",
153+
options: [
154+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
155+
{ key: "CN", label: "🇨🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈚️)" },
156+
{ key: "XX", label: "🇺🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈶️)" },
157+
],
158+
type: "string",
159+
},
160+
{
161+
defaultValue: "XX",
162+
description: "此选项影响 360 度全景视角在某些地点四处看看功能。",
163+
key: "TileSet.Munin",
164+
name: "[瓦片数据集]四处看看",
165+
options: [
166+
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
167+
{ key: "CN", label: "🇨🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈚️)" },
168+
{ key: "XX", label: "🇺🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈶️)" },
169+
],
170+
type: "string",
171+
},
172+
],
173+
});

modules/Location.plugin

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
#!icon=https://images.macrumors.com/article-new/2019/07/ios_location_services-250x250.jpg
88
#!tag= iRingo
99

10+
[Argument]
11+
PEP.GCC = select,"US","AUTO","HK","TW","SG","US","JP","AU","GB","KR","CA","IE",tag=[地区检测]地理国家或地区代码,desc=要更改为的地区或国家,此选项影响Wi-Fi或有线网络下国家和地区检测的结果。
12+
1013
[Rule]
1114
# 📍 Country Code
1215
DOMAIN,gspe1-ssl.ls.apple.com,DIRECT
1316

1417
[Script]
1518
# 📍 Country Code
16-
http-response ^https?:\/\/gspe1-ssl\.ls\.apple\.com\/pep\/gcc script-path=https://github.com/NSRingo/GeoServices/releases/latest/download/response.js, requires-body=1, tag=📍 Location.pep.gcc.response, argument=
19+
http-response ^https?:\/\/gspe1-ssl\.ls\.apple\.com\/pep\/gcc script-path=https://github.com/NSRingo/GeoServices/releases/latest/download/response.js, requires-body=1, tag=📍 Location.pep.gcc.response, argument=[{PEP.GCC}]
1720

1821
[MITM]
1922
hostname = gspe1-ssl.ls.apple.com

0 commit comments

Comments
 (0)