Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Update rspack.dev.config.js
Update rspack.config.js
Update package-lock.json
Update package.json
Update CHANGELOG.md
Update response.dev.js
Update response.js
  • Loading branch information
VirgilClyne committed Nov 6, 2024
1 parent 74707df commit f19196b
Show file tree
Hide file tree
Showing 31 changed files with 1,496 additions and 1,176 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
cache: 'npm'
- name: Install dependencies
run: npm install
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/download-artifact@master
with:
name: artifact
- name: Deploy
- name: Deploy Response
uses: exuanbo/actions-deploy-gist@main
with:
token: ${{ secrets.GIST_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
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
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "src/utils"]
path = src/utils
url = https://github.com/NanoCat-Me/utils.git
[submodule "src/proto"]
path = src/proto
url = https://github.com/NSRingo/proto.git
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org/
@nsnanocat:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 🛠️ Bug Fixes
* 修复 `Surge` 模块内置`参数面板`默认值为空的问题
* 修复 `Loon` 插件内置`设置面板`默认值为空的问题
### 🆕 New Features
* `空气质量`增加`与昨日同时间对比`功能
* 为实现此功能,现在默认替换来自`和风天气``空气质量`数据

### 🔄 Other Changes
* `util``submodule` 更改为 `package`
270 changes: 131 additions & 139 deletions arguments-builder.config.ts
Original file line number Diff line number Diff line change
@@ -1,142 +1,134 @@
import { defineConfig } from '@iringo/arguments-builder';
import { defineConfig } from "@iringo/arguments-builder";

export default defineConfig({
output: {
surge: {
path: './dist/WeatherKit.sgmodule',
transformEgern: {
enable: true,
path: './dist/WeatherKit.yaml',
}
},
loon: {
path: './dist/WeatherKit.plugin',
},
customItems: [
{
path: './dist/WeatherKit.snippet',
template: './template/quantumultx.handlebars'
},
{
path: './dist/WeatherKit.stoverride',
template: './template/stash.handlebars'
}
],
dts: {
isExported: true,
path: './src/settings.ts'
},
boxjsSettings: {
path: './template/boxjs.settings.json',
scope: '@iRingo.WeatherKit.Settings',
}
},
args: [
{
key: 'Switch',
name: '总功能开关',
defaultValue: true,
type: 'boolean',
description: '是否启用此APP修改',
exclude: ['surge', 'loon'],
},
{
key: 'NextHour.Provider',
name: '[未来一小时降水强度]数据源',
defaultValue: 'ColorfulClouds',
type: 'string',
options: [
{ key: 'WeatherKit', label: 'WeatherKit (不进行替换)' },
{ key: 'ColorfulClouds', label: '彩云天气' },
{ key: 'QWeather', label: '和风天气' },
],
description: '始终会使用选定的数据源,填补无降水监测地区的数据。',
},
{
key: 'AQI.Provider',
name: '[空气质量]数据源',
defaultValue: 'ColorfulClouds',
type: 'string',
options: [
{ key: 'WeatherKit', label: 'WeatherKit (不进行替换)' },
{ key: 'ColorfulClouds', label: '彩云天气' },
{ key: 'QWeather', label: '和风天气' },
{ key: 'WAQI', label: 'The World Air Quality Project' },
],
description: '始终会使用选定的数据源,填补无空气质量监测地区的数据。',
},
{
key: 'AQI.ReplaceProviders',
name: '[空气质量]需要替换的供应商',
defaultValue: [],
type: 'array',
description: '选中的空气质量数据源会被替换。',
options: [
{ key: 'QWeather', label: '和风天气' },
{ key: 'BreezoMeter', label: 'BreezoMeter' },
{ key: 'TWC', label: 'The Weather Channel' },
],
},
{
key: 'AQI.Local.Scale',
type: 'string',
name: '[空气质量]本地替换算法',
description: '本地替换时使用的算法',
defaultValue: 'WAQI_InstantCast',
options: [
{ key: 'NONE', label: 'None (不进行替换)' },
{ key: 'WAQI_InstantCast', label: 'WAQI InstantCast' },
],
},
{
key: 'AQI.Local.ReplaceScales',
type: 'array',
name: '[空气质量]需要修改的标准',
description: '选中的空气质量标准会被替换。请注意各国监测的污染物种类可能有所不同,转换算法或API未必适合当地。',
defaultValue: ['HJ6332012'],
options: [{ key: 'HJ6332012', label: '中国 (HJ 633—2012)' }],
},
{
key: 'AQI.Local.ConvertUnits',
name: '[空气质量]转换污染物计量单位',
defaultValue: false,
type: 'boolean',
description: '(不推荐。不同单位互转可能会损失精度,导致数值偏大)将污染物数据替换为转换单位后的数据,方便对照转换后的标准。',
},
{
key: 'API.ColorfulClouds.Token',
name: '[API]彩云天气 API 令牌',
defaultValue: '',
type: 'string',
placeholder: '123456789123456789abcdefghijklmnopqrstuv',
description: '彩云天气 API 令牌',
},
{
key: 'API.QWeather.Host',
name: '[API]和风天气 API 主机',
defaultValue: 'devapi.qweather.com',
type: 'string',
description: '和风天气 API 使用的主机名',
options: [
{ key: 'devapi.qweather.com', label: '免费订阅 (devapi.qweather.com)' },
{ key: 'api.qweather.com', label: '付费订阅 (api.qweather.com)' },
],
},
{
key: 'API.QWeather.Token',
name: '[API]和风天气 API 令牌',
defaultValue: '',
type: 'string',
placeholder: '123456789123456789abcdefghijklmnopqrstuv',
description: '和风天气 API 令牌',
},
{
key: 'API.WAQI.Token',
name: '[API]WAQI API 令牌',
defaultValue: '',
type: 'string',
placeholder: '123456789123456789abcdefghijklmnopqrstuv',
description: 'WAQI API 令牌,填写此字段将自动使用WAQI高级API',
},
],
output: {
surge: {
path: "./dist/WeatherKit.sgmodule",
transformEgern: {
enable: true,
path: "./dist/WeatherKit.yaml",
},
},
loon: {
path: "./dist/WeatherKit.plugin",
},
customItems: [
{
path: "./dist/WeatherKit.snippet",
template: "./template/quantumultx.handlebars",
},
{
path: "./dist/WeatherKit.stoverride",
template: "./template/stash.handlebars",
},
],
dts: {
isExported: true,
path: "./src/types.d.ts",
},
boxjsSettings: {
path: "./template/boxjs.settings.json",
scope: "@iRingo.WeatherKit.Settings",
},
},
args: [
{
key: "NextHour.Provider",
name: "[未来一小时降水强度] 数据源",
defaultValue: "ColorfulClouds",
type: "string",
options: [
{ key: "WeatherKit", label: "WeatherKit (不进行替换)" },
{ key: "ColorfulClouds", label: "彩云天气" },
{ key: "QWeather", label: "和风天气" },
],
description: "始终会使用选定的数据源,填补无降水监测地区的数据。",
},
{
key: "AQI.Provider",
name: "[空气质量] 数据源",
defaultValue: "ColorfulClouds",
type: "string",
options: [
{ key: "WeatherKit", label: "WeatherKit (不进行替换)" },
{ key: "ColorfulClouds", label: "彩云天气" },
{ key: "QWeather", label: "和风天气" },
{ key: "WAQI", label: "The World Air Quality Project" },
],
description: "始终会使用选定的数据源,填补无空气质量监测地区的数据。",
},
{
key: "AQI.ReplaceProviders",
name: "[空气质量] 需要替换的供应商",
defaultValue: ["QWeather"],
type: "array",
description: "选中的空气质量数据源会被替换。",
options: [
{ key: "QWeather", label: "和风天气" },
{ key: "BreezoMeter", label: "BreezoMeter" },
{ key: "TWC", label: "The Weather Channel" },
],
},
{
key: "AQI.Local.Scale",
type: "string",
name: "[空气质量] 本地替换算法",
description: "本地替换时使用的算法",
defaultValue: "WAQI_InstantCast",
options: [
{ key: "NONE", label: "None (不进行替换)" },
{ key: "WAQI_InstantCast", label: "WAQI InstantCast" },
],
},
{
key: "AQI.Local.ReplaceScales",
type: "array",
name: "[空气质量] 需要修改的标准",
description: "选中的空气质量标准会被替换。请注意各国监测的污染物种类可能有所不同,转换算法或API未必适合当地。",
defaultValue: ["HJ6332012"],
options: [{ key: "HJ6332012", label: "中国 (HJ 633—2012)" }],
},
{
key: "AQI.Local.ConvertUnits",
name: "[空气质量] 转换污染物计量单位",
defaultValue: false,
type: "boolean",
description: "将污染物数据替换为转换单位后的数据,方便对照转换后的标准。(不推荐。不同单位互转可能会损失精度,导致数值偏大)",
},
{
key: "API.ColorfulClouds.Token",
name: "[API] 彩云天气令牌",
defaultValue: "",
type: "string",
placeholder: "123456789123456789abcdefghijklmnopqrstuv",
description: "彩云天气 API 令牌",
},
{
key: "API.QWeather.Host",
name: "[API] 和风天气主机",
defaultValue: "devapi.qweather.com",
type: "string",
description: "和风天气 API 使用的主机名",
options: [
{ key: "devapi.qweather.com", label: "免费订阅 (devapi.qweather.com)" },
{ key: "api.qweather.com", label: "付费订阅 (api.qweather.com)" },
],
},
{
key: "API.QWeather.Token",
name: "[API] 和风天气令牌",
defaultValue: "",
type: "string",
placeholder: "123456789123456789abcdefghijklmnopqrstuv",
description: "和风天气 API 令牌",
},
{
key: "API.WAQI.Token",
name: "[API] WAQI 令牌",
defaultValue: "",
type: "string",
placeholder: "123456789123456789abcdefghijklmnopqrstuv",
description: "WAQI API 令牌,填写此字段将自动使用WAQI高级API",
},
],
});
Loading

0 comments on commit f19196b

Please sign in to comment.