meta-json-schema 1.18.4-beta2 → 1.18.4-beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ name: Release On Tag
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ jobs:
9
+ bundle_on_commit:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout Repository
13
+ uses: actions/checkout@v4
14
+
15
+ - uses: actions/checkout@v4
16
+ - name: Configure Git Credentials
17
+ run: |
18
+ git config user.name github-actions[bot]
19
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20
+
21
+ - name: Install Node
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: "20"
25
+
26
+ - name: Bundle
27
+ run: npm install && npm run release
28
+
29
+ - name: Release
30
+ uses: softprops/action-gh-release@v2
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
+ with:
34
+ body_path: ${{ github.workspace }}/CHANGELOG
35
+ prerelease: false
36
+ make_latest: true
37
+ files: |
38
+ schemas/*
39
+
40
+ - name: Commit and Push
41
+ run: |
42
+ git add -f schemas
43
+ git commit -m "Release On Tag"
44
+ git push --force origin HEAD:main
@@ -0,0 +1,18 @@
1
+ name: Clean Workflow Runs
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 * * *"
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ delete-workflow-runs:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Delete workflow runs
14
+ uses: dongchengjie/workflow-runs-cleaner@v1
15
+ with:
16
+ repository: ${{ github.repository }}
17
+ token: ${{ secrets.GITHUB_TOKEN }}
18
+ maintain-span: "3d"
@@ -1,3 +1,3 @@
1
1
  {
2
- "recommendations": ["redhat.vscode-yaml"]
2
+ "recommendations": ["redhat.vscode-yaml", "usernamehw.errorlens"]
3
3
  }
@@ -1,18 +1,30 @@
1
1
  {
2
2
  "json.schemas": [
3
3
  {
4
+ // src 目录的JSON文件使用JSON Schema Draft 07
4
5
  "url": "http://json-schema.org/draft-07/schema",
5
6
  "fileMatch": ["/src/**/*.json"]
6
7
  }
7
8
  ],
8
9
  "yaml.schemas": {
10
+ // test/clash-meta 目录的 YAML 文件使用编译后的 meta-json-schema.json
9
11
  ".temp/meta-json-schema.json": "test/clash-meta/**/*.yaml",
12
+ // test/clash-verge 目录的 YAML 文件使用编译后的 clash-verge-merge-json-schema.json
10
13
  ".temp/clash-verge-merge-json-schema.json": "test/clash-verge/**/*.yaml"
11
14
  },
15
+ // 使用两空格缩进
12
16
  "editor.tabSize": 2,
17
+ // 在 workspace 中排除下列文件
13
18
  "files.exclude": {
14
19
  ".gitattributes": true,
15
20
  ".gitignore": true,
16
- "package-lock.json": true
21
+ "package-lock.json": true,
22
+ "CHANGELOG": true
23
+ },
24
+ // 搜索排除下列目录
25
+ "search.exclude": {
26
+ "node_modules": true, // 忽略模块目录
27
+ ".temp": true, // 忽略编译输出目录
28
+ "schemas": true // 忽略构建发布目录
17
29
  }
18
30
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## v1.18.4-beta3
2
+
3
+ ### Changes
4
+
5
+ - 新增: `dns` 新增配置项 `use-system-hosts`
6
+ - 调整: 调整部分配置描述
7
+ - 移除: Clash Verge Merge 配置移除`prepend-rule-providers`、`prepend-proxy-providers`、`append-rule-providers`、`append-proxy-providers`
8
+
9
+ ### Bugs Fixes
10
+
11
+ - 修复: cipher 缺少 `none`
12
+ - 修复: `default-nameserver`类型错误
13
+
14
+ ---
15
+
1
16
  ## v1.18.4
2
17
 
3
18
  ### Changes
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- ## 用法
1
+ ### 🧩 VSCode 插件
2
+
3
+ VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema`,安装扩展后即可获取 `Clash.Meta`的语法支持。
4
+
5
+ ## 💡 用法
2
6
 
3
7
  <details>
4
8
  <summary>Visual Studio Code中使用</summary>
@@ -35,16 +39,16 @@
35
39
  2. 配置`vite.config.ts`。
36
40
 
37
41
  ```javascript
38
- import { defineConfig } from 'vite';
39
- import monacoEditor from 'vite-plugin-monaco-editor';
42
+ import { defineConfig } from "vite";
43
+ import monacoEditor from "vite-plugin-monaco-editor";
40
44
  export default defineConfig({
41
45
  plugins: [
42
46
  monacoEditor({
43
- languageWorkers: ['editorWorkerService'],
47
+ languageWorkers: ["editorWorkerService"],
44
48
  customWorkers: [
45
49
  {
46
- label: 'yaml',
47
- entry: 'monaco-yaml/yaml.worker'
50
+ label: "yaml",
51
+ entry: "monaco-yaml/yaml.worker"
48
52
  }
49
53
  ]
50
54
  })
@@ -55,16 +59,16 @@
55
59
  3. 代码中配置schema(请根据需求自行修改`fileMatch`)。
56
60
 
57
61
  ```javascript
58
- import * as monaco from 'monaco-editor';
59
- import { configureMonacoYaml } from 'monaco-yaml';
62
+ import * as monaco from "monaco-editor";
63
+ import { configureMonacoYaml } from "monaco-yaml";
60
64
 
61
65
  configureMonacoYaml(monaco, {
62
66
  validate: true,
63
67
  enableSchemaRequest: true,
64
68
  schemas: [
65
69
  {
66
- uri: 'https://fastly.jsdelivr.net/gh/dongchengjie/airport@main/meta-json-schema.json',
67
- fileMatch: ['**/*.clash.yaml']
70
+ uri: "https://fastly.jsdelivr.net/gh/dongchengjie/airport@main/meta-json-schema.json",
71
+ fileMatch: ["**/*.clash.yaml"]
68
72
  }
69
73
  ]
70
74
  });
@@ -78,7 +82,7 @@
78
82
 
79
83
  - <a href="https://dongchengjie.github.io/meta-json-schema/?schema=https://raw.githubusercontent.com/dongchengjie/meta-json-schema/main/schemas/clash-verge-merge-json-schema.json" target="_blank">clash-verge-merge-json-schema</a>
80
84
 
81
- ## 开发
85
+ ## 🖥️ 开发
82
86
 
83
87
  1. 下载代码
84
88
 
@@ -140,11 +144,11 @@ npm run release
140
144
  interface JSONSchema {
141
145
  // 自定义Snippet建议(数组)
142
146
  defaultSnippets?: {
143
- label?: string; // 标题
144
- description?: string; // 描述
145
- markdownDescription?: string; // 描述(markdown格式)
146
- body?: any; // 内容
147
- bodyText?: string; // 内容文本
147
+ label: string; // 标签文本(索引)
148
+ description?: string; // 标签描述(需要点击展开)
149
+ markdownDescription?: string; // 标签描述(需要点击展开,markdown格式,优先级高于description,)
150
+ body: any; // 实际取值内容
151
+ bodyText?: string; // 实际取值内容文本(暂无作用)
148
152
  }[];
149
153
  errorMessage?: string; // 错误信息
150
154
  patternErrorMessage?: string; // 格式错误信息(优先级高于errorMessage)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meta-json-schema",
3
- "version": "1.18.4-beta2",
3
+ "version": "1.18.4-beta3",
4
4
  "keywords": [
5
5
  "clash",
6
6
  "clash.meta",
@@ -1,5 +1,7 @@
1
- import bundle from './util/bundle.mjs';
2
- import { pkg, resolve } from './util/env.mjs';
1
+ import bundle from "./util/bundle.mjs";
2
+ import { pkg, resolve } from "./util/env.mjs";
3
+ import { writeToFileSync } from "./util/file.mjs";
4
+ import fs from "fs";
3
5
 
4
6
  (async () => {
5
7
  // 读取release配置
@@ -13,4 +15,15 @@ import { pkg, resolve } from './util/env.mjs';
13
15
  await bundle(source, target, optimization, true);
14
16
  }
15
17
  }
18
+
19
+ // 提取CHANGELOG
20
+ const changelogs = fs.readFileSync(resolve("CHANGELOG.md"), "utf8");
21
+ writeToFileSync(
22
+ resolve("CHANGELOG"),
23
+ changelogs
24
+ .split("---")
25
+ .map(log => log.trim())
26
+ .filter(log => log.startsWith(`## v${pkg.version}`))
27
+ .filter(Boolean)?.[0] ?? ""
28
+ );
16
29
  })();
@@ -7,9 +7,7 @@
7
7
  "definitions": {
8
8
  "meta-json-schema": { "$ref": "./meta-json-schema.json" },
9
9
  "proxies": { "$ref": "./modules/config/proxies.json" },
10
- "proxy-providers": { "$ref": "./modules/config/proxy-providers.json" },
11
10
  "proxy-groups": { "$ref": "./modules/config/proxy-groups.json" },
12
- "rule-providers": { "$ref": "./modules/rules/provider/provider.json" },
13
11
  "rules": { "$ref": "./modules/config/rules.json" }
14
12
  },
15
13
  "allOf": [
@@ -21,13 +19,6 @@
21
19
  "prepend-rules": { "title": "前置规则配置", "$ref": "#/definitions/rules" }
22
20
  }
23
21
  },
24
- {
25
- "type": "object",
26
- "title": "前置规则集合配置",
27
- "properties": {
28
- "prepend-rule-providers": { "title": "前置规则集合配置", "$ref": "#/definitions/rule-providers" }
29
- }
30
- },
31
22
  {
32
23
  "type": "object",
33
24
  "title": "前置代理节点配置",
@@ -35,13 +26,6 @@
35
26
  "prepend-proxies": { "title": "前置代理节点配置", "$ref": "#/definitions/proxies" }
36
27
  }
37
28
  },
38
- {
39
- "type": "object",
40
- "title": "前置代理集合配置",
41
- "properties": {
42
- "prepend-proxy-providers": { "title": "前置代理集合配置", "$ref": "#/definitions/proxy-providers" }
43
- }
44
- },
45
29
  {
46
30
  "type": "object",
47
31
  "title": "前置代理组配置",
@@ -56,13 +40,6 @@
56
40
  "append-rules": { "title": "后置规则配置", "$ref": "#/definitions/rules" }
57
41
  }
58
42
  },
59
- {
60
- "type": "object",
61
- "title": "后置规则集合配置",
62
- "properties": {
63
- "append-rule-providers": { "title": "后置规则集合配置", "$ref": "#/definitions/rule-providers" }
64
- }
65
- },
66
43
  {
67
44
  "type": "object",
68
45
  "title": "后置代理节点配置",
@@ -70,13 +47,6 @@
70
47
  "append-proxies": { "title": "后置代理节点配置", "$ref": "#/definitions/proxies" }
71
48
  }
72
49
  },
73
- {
74
- "type": "object",
75
- "title": "后置代理集合配置",
76
- "properties": {
77
- "append-proxy-providers": { "title": "后置代理集合配置", "$ref": "#/definitions/proxy-providers" }
78
- }
79
- },
80
50
  {
81
51
  "type": "object",
82
52
  "title": "后置代理组配置",
@@ -2,6 +2,7 @@
2
2
  "cipher": {
3
3
  "description": "加密方法",
4
4
  "enum": [
5
+ "none",
5
6
  "auto",
6
7
  "dummy",
7
8
  "aes-128-gcm",
@@ -8,20 +8,20 @@
8
8
  "enums": { "$ref": "../../../definitions/enums.json" },
9
9
  "base-option": {
10
10
  "type": "object",
11
- "title": "outbound基础配置",
11
+ "title": "出站基础配置",
12
12
  "properties": {
13
13
  "name": {
14
14
  "$ref": "#/definitions/compatible/string",
15
- "title": "outbound名称",
16
- "description": "outbound名称",
17
- "markdownDescription": "outbound名称"
15
+ "title": "出站名称",
16
+ "description": "出站名称",
17
+ "markdownDescription": "出站名称"
18
18
  },
19
19
  "type": {
20
20
  "enum": ["select", "url-test", "fallback", "load-balance", "relay"],
21
21
  "markdownEnumDescriptions": ["手动选择", "延迟选优", "故障转移", "负载均衡", "链式代理"],
22
- "title": "outbound类型",
23
- "description": "outbound类型",
24
- "markdownDescription": "outbound类型"
22
+ "title": "出站类型",
23
+ "description": "出站类型",
24
+ "markdownDescription": "出站类型"
25
25
  },
26
26
  "interface-name": {
27
27
  "$ref": "#/definitions/compatible/string",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "basic-option": {
41
41
  "type": "object",
42
- "title": "outbound基本配置",
42
+ "title": "出站基本配置",
43
43
  "properties": {
44
44
  "tfo": {
45
45
  "$ref": "#/definitions/compatible/boolean",
@@ -9,7 +9,7 @@
9
9
  "health-check": { "$ref": "../provider/health-check.json" }
10
10
  },
11
11
  "allOf": [
12
- { "title": "outbound基础配置", "required": ["name", "type"], "$ref": "#/definitions/base-option" },
12
+ { "title": "出站基础配置", "required": ["name", "type"], "$ref": "#/definitions/base-option" },
13
13
  {
14
14
  "allOf": [
15
15
  {
@@ -31,8 +31,8 @@
31
31
  "max-failed-times": {
32
32
  "type": "integer",
33
33
  "title": "最大失败次数",
34
- "description": "在timeout时间长度内,请求失败max-failed-times次,提前主动触发健康检查",
35
- "markdownDescription": "在`timeout`时间长度内,请求失败`max-failed-times`次,提前主动触发健康检查",
34
+ "description": "在timeout时间长度内,请求失败max-failed-times次,强制提前主动触发健康检查",
35
+ "markdownDescription": "在`timeout`时间长度内,请求失败`max-failed-times`次,强制提前主动触发健康检查",
36
36
  "default": 5
37
37
  },
38
38
  "disable-udp": {
@@ -35,10 +35,17 @@
35
35
  "default": 100
36
36
  },
37
37
  "use-hosts": {
38
+ "type": "boolean",
39
+ "title": "启用配置中的hosts配置",
40
+ "description": "启用配置中的hosts配置",
41
+ "markdownDescription": "启用配置中的`hosts`配置",
42
+ "default": true
43
+ },
44
+ "use-system-hosts": {
38
45
  "type": "boolean",
39
46
  "title": "查询系统hosts文件",
40
- "description": "查询系统hosts文件",
41
- "markdownDescription": "查询系统`hosts`文件",
47
+ "description": "优先级低于配置中的hosts配置",
48
+ "markdownDescription": "优先级低于配置中的`hosts`配置",
42
49
  "default": true
43
50
  },
44
51
  "nameserver": {
@@ -113,30 +120,30 @@
113
120
  "fake-ip-range": {
114
121
  "$ref": "#/definitions/patterns/ipCIDR",
115
122
  "title": "fake-ip的预留映射地址段",
116
- "description": "tun模式的网卡默认IP也使用此值作为参考",
117
- "markdownDescription": "tun模式的网卡默认IP也使用此值作为参考",
123
+ "description": "TUN模式的网卡默认IP也使用此值作为参考",
124
+ "markdownDescription": "TUN模式的网卡默认IP也使用此值作为参考",
118
125
  "default": "198.18.0.1/16"
119
126
  },
120
127
  "fake-ip-filter": {
121
128
  "$ref": "#/definitions/types/stringArray",
122
129
  "title": "fake-ip过滤",
123
- "description": "不使用fake-ip的地址范围",
124
- "markdownDescription": "不使用`fake-ip`的地址范围",
130
+ "description": "哪些域名不使用fake-ip",
131
+ "markdownDescription": "哪些域名不使用`fake-ip`",
125
132
  "default": ["dns.msftnsci.com", "www.msftnsci.com", "www.msftconnecttest.com"]
126
133
  },
127
134
  "default-nameserver": {
128
- "$ref": "#/definitions/types/serverArray",
135
+ "$ref": "#/definitions/types/stringArray",
129
136
  "title": "元域名解析服务器",
130
- "description": "解析nameserver,fallback以及其他DNS服务器配置的DNS服务器(只能使用纯IP地址,支持加密DNS)",
131
- "markdownDescription": "解析`nameserver`,`fallback`以及其他DNS服务器配置的DNS服务器(只能使用纯IP地址,支持加密DNS)",
137
+ "description": "解析nameserver,fallback以及其他DNS服务器配置的DNS服务器(只能使用纯IP地址,支持UDP,TCP,DoT,DoH,DoQ)",
138
+ "markdownDescription": "解析`nameserver`,`fallback`以及其他DNS服务器配置的DNS服务器(只能使用纯IP地址,支持`UDP`,`TCP`,`DoT`,`DoH`,`DoQ`)",
132
139
  "default": ["114.114.114.114", "223.5.5.5", "8.8.8.8", "1.0.0.1"]
133
140
  },
134
141
  "cache-algorithm": {
135
142
  "enum": ["lru", "arc"],
136
143
  "markdownEnumDescriptions": ["最近最少使用", "自适应替换缓存"],
137
144
  "title": "缓存算法",
138
- "description": "lru: Least Recently Used, arc: Adaptive Replacement Cache",
139
- "markdownDescription": "`lru`: Least Recently Used, `arc`: Adaptive Replacement Cache",
145
+ "description": "缓存算法",
146
+ "markdownDescription": "缓存算法",
140
147
  "default": "lru"
141
148
  },
142
149
  "nameserver-policy": {
@@ -132,7 +132,7 @@
132
132
  "title": "全局UA",
133
133
  "description": "下载外部资源(proxy-provider、rule-provider、Geo等)时使用",
134
134
  "markdownDescription": "下载外部资源(proxy-provider、rule-provider、Geo等)时使用",
135
- "default": "clash.meta/version"
135
+ "default": "clash.meta"
136
136
  }
137
137
  }
138
138
  }
@@ -57,8 +57,8 @@
57
57
  },
58
58
  {
59
59
  "type": "object",
60
- "title": "tun配置",
61
- "properties": { "type": { "title": "tun配置", "const": "tun" } },
60
+ "title": "TUN配置",
61
+ "properties": { "type": { "title": "TUN配置", "const": "tun" } },
62
62
  "$ref": "#/definitions/tun"
63
63
  },
64
64
  {
@@ -43,8 +43,8 @@
43
43
  "auto-route": {
44
44
  "type": "boolean",
45
45
  "title": "自动设置全局路由",
46
- "description": "可以自动将全局流量路由进入tun网卡",
47
- "markdownDescription": "可以自动将全局流量路由进入`tun`网卡",
46
+ "description": "可以自动将全局流量路由进入TUN网卡",
47
+ "markdownDescription": "可以自动将全局流量路由进入`TUN`网卡",
48
48
  "default": true
49
49
  },
50
50
  "auto-detect-interface": {
@@ -15,9 +15,9 @@
15
15
  "properties": {
16
16
  "device": {
17
17
  "type": "string",
18
- "title": "指定tun网卡名称",
19
- "description": "指定tun网卡名称(macOS强制为utun)",
20
- "markdownDescription": "指定tun网卡名称(macOS强制为`utun`)"
18
+ "title": "指定TUN网卡名称",
19
+ "description": "指定TUN网卡名称(macOS强制为utun)",
20
+ "markdownDescription": "指定TUN网卡名称(macOS强制为`utun`)"
21
21
  },
22
22
  "stack": {
23
23
  "type": "string",
@@ -43,7 +43,7 @@
43
43
  "type": "boolean",
44
44
  "title": "自动设置全局路由",
45
45
  "description": "可以自动将全局流量路由进入tun网卡",
46
- "markdownDescription": "可以自动将全局流量路由进入`tun`网卡",
46
+ "markdownDescription": "可以自动将全局流量路由进入`TUN`网卡",
47
47
  "default": true
48
48
  },
49
49
  "auto-detect-interface": {