meta-json-schema 1.18.10 → 1.19.1

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.
package/CHANGELOG.md CHANGED
@@ -1,11 +1,35 @@
1
+ ## v1.19.1
2
+
3
+ ### Changes
4
+
5
+ - 新增:rule-providers 新增 `inline` 内联规则配置
6
+ - 新增:proxy-providers 新增 `inline` 内联proxies配置
7
+ - 调整: outbound 的 `header` 配置项宽松,不再限制value的类型为 string
8
+
9
+ ### Bugs Fixes
10
+
11
+ - 修复: `tuic` V4 的 `token` 配置项类型错误
12
+
13
+ ---
14
+
15
+ ## v1.19.0
16
+
17
+ ### Changes
18
+
19
+ - 新增: proxy-provider 新增 `size-limit` 配置项
20
+ - 新增: proxy 新增 `mieru` 协议
21
+
22
+ ---
23
+
1
24
  ## v1.18.10
2
25
 
3
26
  ### Changes
4
27
 
28
+ - 新增: DNS 新增 `direct-nameserver`、`direct-nameserver-follow-policy` 配置项
29
+
5
30
  ### Bugs Fixes
6
31
 
7
32
  - 修复: `skip-auth-prefixes`、`lan-allowed-ips`、`lan-disallowed-ips` 类型错误
8
- - 新增: DNS 新增 `direct-nameserver`、`direct-nameserver-follow-policy` 配置项
9
33
 
10
34
  ---
11
35
 
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  ### 🧩 VSCode 插件
2
2
 
3
- VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema`,安装扩展后即可获取 `Clash.Meta`的语法支持。
3
+ VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema` ,安装扩展后即可获取 `Clash.Meta` 的语法支持。
4
4
 
5
5
  ## 💡 用法
6
6
 
7
7
  <details>
8
8
  <summary>Visual Studio Code中使用</summary>
9
9
 
10
- 1. 安装YAML语法支持插件`redhat.vscode-yaml`。
11
- 2. 在`.vscode`目录下的`settings.json`文件中(如不存在则手动创建),填入以下内容。其中,key为schema文件的地址,value为路径通配符,请根据需求自行修改。
10
+ 1. 安装YAML语法支持插件 `redhat.vscode-yaml` 。
11
+ 2. 在 `.vscode` 目录下的 `settings.json` 文件中(如不存在则手动创建),填入以下内容。其中,key为schema文件的地址(url或本地文件),value为路径通配符,请根据需求自行修改。
12
12
  ```json
13
13
  {
14
14
  "yaml.schemas": {
@@ -21,26 +21,27 @@ VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema`
21
21
  <details>
22
22
  <summary>Monaco Editor中使用</summary>
23
23
 
24
- 1. 安装`monaco-editor`(编辑器)和`monaco-yaml`(YAML支持)。
24
+ 1. 安装 `monaco-editor` (编辑器)和 `monaco-yaml` (YAML支持)。
25
25
 
26
26
  ```
27
27
  npm install monaco-editor
28
28
  npm install monaco-yaml
29
29
  ```
30
30
 
31
- 2. 如果是vite项目,可通过安装插件简化初始化(其他构建工具如`webpack`请参考[monaco-yaml文档](https://github.com/remcohaszing/monaco-yaml?tab=readme-ov-file#using-monaco-webpack-loader-plugin))。
31
+ 2. 如果是vite项目,可通过安装插件简化初始化(其他构建工具如 `webpack` 请参考[monaco-yaml文档](https://github.com/remcohaszing/monaco-yaml?tab=readme-ov-file#using-monaco-webpack-loader-plugin))。
32
32
 
33
- 1. 安装`vite-plugin-monaco-editor`。
33
+ 1. 安装 `vite-plugin-monaco-editor` 。
34
34
 
35
35
  ```
36
36
  npm install vite-plugin-monaco-editor
37
37
  ```
38
38
 
39
- 2. 配置`vite.config.ts`。
39
+ 2. 配置 `vite.config.ts` 。
40
40
 
41
41
  ```javascript
42
42
  import { defineConfig } from "vite";
43
43
  import monacoEditor from "vite-plugin-monaco-editor";
44
+
44
45
  export default defineConfig({
45
46
  plugins: [
46
47
  monacoEditor({
@@ -56,7 +57,7 @@ VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema`
56
57
  });
57
58
  ```
58
59
 
59
- 3. 代码中配置schema(请根据需求自行修改`fileMatch`)。
60
+ 3. 代码中配置schema(请根据需求自行修改 `fileMatch` )。
60
61
 
61
62
  ```javascript
62
63
  import * as monaco from "monaco-editor";
@@ -67,7 +68,7 @@ VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema`
67
68
  enableSchemaRequest: true,
68
69
  schemas: [
69
70
  {
70
- uri: "https://fastly.jsdelivr.net/gh/dongchengjie/airport@main/meta-json-schema.json",
71
+ uri: "https://fastly.jsdelivr.net/gh/dongchengjie/meta-json-schema@main/schemas/meta-json-schema.json",
71
72
  fileMatch: ["**/*.clash.yaml"]
72
73
  }
73
74
  ]
@@ -84,52 +85,56 @@ VS Code 扩展商店搜索 `Meta JSON Schema` 或 `ClashMeta.meta-json-schema`
84
85
 
85
86
  - <a href="https://dongchengjie.github.io/meta-json-schema/?schema=https://raw.githubusercontent.com/dongchengjie/meta-json-schema/main/schemas/clash-nyanpasu-merge-json-schema.json" target="_blank">clash-nyanpasu-merge-json-schema</a>
86
87
 
87
- ## 🖥️ 开发
88
+ ## 🖥️ 贡献代码
88
89
 
89
- 1. 下载代码
90
+ 1. Fork仓库代码
90
91
 
91
- ```bash
92
- git clone https://github.com/dongchengjie/meta-json-schema.git
93
- ```
94
-
95
- 2. 使用Visual Studio Code打开项目(工作目录为.vscode所在目录)。
92
+ 2. 使用Visual Studio Code打开项目(工作目录为.vscode所在目录)
96
93
 
97
94
  ```bash
98
- code /path/to/project/location
95
+ code path/to/project
99
96
  ```
100
97
 
101
98
  > [!NOTE]
102
- > 项目打开后会弹出建议安装YAML插件的提示,请点击确认安装或手动安装,以获取良好的开发体验。
99
+ > 项目打开后会弹出建议安装YAML插件的提示,请点击确认安装或手动安装,以获取良好的开发体验。
103
100
 
104
- 3. 安装依赖
101
+ 3. 安装依赖
105
102
 
106
103
  ```bash
107
- npm install
104
+ pnpm install
108
105
  ```
109
106
 
110
- 4. 启动项目。执行下列命令后,会对`src`目录进行监视,如果发生变动则会对项目进行bundle,输出到`schemas`目录下。
107
+ 4. 启动项目。
108
+
109
+ - 执行下列命令后,会对 `src` 目录进行监视。
110
+ - 如果发生变动则会对项目进行打包,输出到 `schemas` 目录下。
111
111
 
112
112
  ```bash
113
- npm run dev
113
+ pnpm dev
114
114
  ```
115
115
 
116
- 5. 测试schema。由于`.vscode`目录下`settings.json`中已事先配置了如下配置(`test`目录下的文件使用`schemas`目录下输出的schema文件)。因此可以对`src`进行修改,并在`test`目录下新增测试文件,及时观察变动并做出修正。
116
+ 5. 测试验证生成的schema文件
117
+
118
+ - 由于 `.vscode` 目录下 `settings.json` 中已事先配置了如下配置( `test` 目录下的文件使用 `schemas` 目录下输出的schema文件)。于是可以对`src`目录中的内容进行修改,通过自动打包更新schema文件。
119
+ - 通过在 `test` 目录下新增测试文件,观察并验证校验结果,并及时做出修正。
117
120
 
118
121
  ```json
119
122
  "yaml.schemas": {
120
123
  "schemas/meta-json-schema.json": "test/clash-meta/**/*.yaml",
121
124
  "schemas/clash-verge-merge-json-schema.json": "test/clash-verge/**/*.yaml",
122
125
  "schemas/clash-verge-nyanpasu-json-schema.json": "test/clash-nyanpasu/**/*.yaml"
123
- },
126
+ }
124
127
  ```
125
128
 
126
- 6. 发布release。执行下列命令后,会根据`package.json`文件中定义的`releases`进行输出,并根据`optimization`决定是否进行压缩。
129
+ 6. 输出打包
130
+
131
+ - 执行下列命令后,会根据 `package.json` 文件中定义的`releases`进行输出,并根据 `optimization` 决定是否进行压缩。
127
132
 
128
133
  ```bash
129
- npm run release
134
+ pnpm release
130
135
  ```
131
136
 
132
- ## 📚 语法参考
137
+ ## 📖 JSON Schema 语法参考
133
138
 
134
139
  <details>
135
140
  <summary>JSON Schema标准语法</summary>
@@ -141,7 +146,7 @@ npm run release
141
146
  <details>
142
147
  <summary>Monaco Editor扩展语法</summary>
143
148
 
144
- > Monaco 编辑器是为 VS Code 提供支持的开源代码编辑器,使用下列属性提供更丰富的`Snippet`支持。
149
+ > Monaco 编辑器是为 VS Code 提供支持的开源代码编辑器,使用下列属性提供更丰富的 `Snippet` 支持。
145
150
 
146
151
  ```typescript
147
152
  interface JSONSchema {
@@ -149,7 +154,7 @@ interface JSONSchema {
149
154
  defaultSnippets?: {
150
155
  label: string; // 标签文本(索引)
151
156
  description?: string; // 标签描述(需要点击展开)
152
- markdownDescription?: string; // 标签描述(需要点击展开,markdown格式,优先级高于description,)
157
+ markdownDescription?: string; // 标签描述(需要点击展开,markdown格式,优先级高于description)
153
158
  body: any; // 实际取值内容
154
159
  bodyText?: string; // 实际取值内容文本(暂无作用)
155
160
  }[];
@@ -168,12 +173,14 @@ interface JSONSchema {
168
173
 
169
174
  </details>
170
175
 
171
- ## 🤔 FAQ
176
+ ## FAQ
177
+
178
+ ### definitions目录下的 `compatible.json` 文件的用途是什么?
172
179
 
173
- ### definitions中的`compatible.json`文件的用途是什么?
180
+ YAML支持 `Folded Style` 和 `Inline Style` 的写法。
181
+ 使用`"type": "boolean"`来定义某个属性,那么`'true'`和`'false'`就会提示`Incorrect type. Expected "boolean".`。
174
182
 
175
- YAML支持`Folded Style`和`Inline Style`的写法。
176
- 使用`"type": "boolean"`来定义某个属性,那么`'true'`和`'false'`就会提示`Incorrect type. Expected "boolean".`。因此引入compatible类型,以兼容多种编码风格。
183
+ 因此引入compatible类型,以兼容多种编码风格。
177
184
 
178
185
  <details>
179
186
  <summary>Inline Style</summary>
@@ -204,4 +211,4 @@ proxies:
204
211
  </details>
205
212
 
206
213
  > [!NOTE]
207
- > 由于这种情况多发生于`proxies`配置部分,所以目前仅`proxies`配置中使用了`compatible.json`,其余地方可视情况使用。
214
+ > 由于这种情况多发生于 `proxies` 配置部分,所以目前仅 `proxies` 配置中使用了 `compatible.json` ,其余地方可视情况使用。
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "meta-json-schema",
3
- "version": "1.18.10",
3
+ "version": "1.19.1",
4
4
  "description": "JSON Schema for Clash Meta",
5
5
  "keywords": [
6
6
  "clash",
7
7
  "clash.meta",
8
8
  "schema"
9
9
  ],
10
+ "files": [
11
+ "schemas",
12
+ "CHANGELOG.md"
13
+ ],
10
14
  "publishConfig": {
11
15
  "registry": "https://registry.npmjs.org"
12
16
  },
@@ -16,16 +20,31 @@
16
20
  },
17
21
  "license": "MIT",
18
22
  "repository": {
19
- "type": "git",
20
- "url": "https://github.com/dongchengjie/meta-json-schema"
23
+ "url": "git+https://github.com/dongchengjie/meta-json-schema.git"
21
24
  },
22
25
  "scripts": {
26
+ "preinstall": "npx only-allow pnpm",
27
+ "prepare": "lefthook install",
23
28
  "dev": "npx json-schema-artifact --watch",
24
29
  "release": "npx json-schema-artifact",
25
- "preview": "npm publish --dry-run"
30
+ "preview": "pnpm publish --dry-run"
26
31
  },
27
32
  "devDependencies": {
28
- "json-schema-artifact": "^1.1.1"
33
+ "@commitlint/cli": "^19.6.0",
34
+ "@commitlint/config-conventional": "^19.6.0",
35
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
36
+ "json-schema-artifact": "^1.1.3",
37
+ "lefthook": "^1.9.0",
38
+ "prettier": "^3.4.2"
39
+ },
40
+ "commitlint": {
41
+ "extends": [
42
+ "@commitlint/config-conventional"
43
+ ]
44
+ },
45
+ "engines": {
46
+ "node": ">=18",
47
+ "pnpm": ">=9"
29
48
  },
30
- "packageManager": "npm@10.8.3"
49
+ "packageManager": "pnpm@9.15.0"
31
50
  }