Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Clash配置、Merge配置提供JSON Schema语法支持、[连接]界面调整 #887

Merged
merged 10 commits into from
Apr 17, 2024

Conversation

dongchengjie
Copy link
Contributor

改动点

  1. 修复monaco-editor版本过低,导致编辑器的javascript语法提示失效(0.34.1升级到0.47.0)。同时引入monaco-yaml提供提供YAML语法支持。

  2. Clash配置、Merge配置使用JSON Schema提供语法建议和备注Snippet支持。
    动画

  3. 连接界面,列表默认按照连接建立时间逆序,解决每次需要拉到最底下寻找最新连接的问题

  4. 连接界面,连接详细信息同时显示进程名称和进程路径

@dongchengjie dongchengjie changed the title 提供JSON Schema支持 feat: Clash配置、Merge配置提供JSON Schema语法支持、[连接]界面调整 Apr 17, 2024
@MystiPanda MystiPanda merged commit 402299e into clash-verge-rev:main Apr 17, 2024
@MystiPanda
Copy link
Member

Merge配置文件支持直接写clash配置的所有字段,效果是直接覆盖主配置文件中的对应字段,所以Merge配置文件一样需要clash的所有字段提示。

@dongchengjie
Copy link
Contributor Author

@MystiPanda Merge配置文件也一并添加了JSON schema支持,支持的范围就是默认模板中的所有属性,语法和clash的一样,其余clash配置字段没有放进去

@MystiPanda
Copy link
Member

我的意思就是其他clash配置字段是不是也应该一并放进去

@dongchengjie
Copy link
Contributor Author

dongchengjie commented Apr 17, 2024

@MystiPanda 其他的字段也支持merge进去了吗?有哪些啊?还是说全部字段都支持merge进去?
不就是这些吗?我去验证下,加进去倒是不费事

prepend-rules: []
prepend-rule-providers: {}
prepend-proxies: []
prepend-proxy-providers: {}
prepend-proxy-groups: []
append-rules: []
append-rule-providers: {}
append-proxies: []
append-proxy-providers: {}
append-proxy-groups: []

@dongchengjie
Copy link
Contributor Author

这哪是Merge啊,根本就是覆盖,原profile的影子都见不着了😅
行吧,我改下schema,jsdelivr CDN更新有几个小时的间隔

@MystiPanda
Copy link
Member

效果是直接覆盖主配置文件中的对应字段

我说的就是覆盖啊,另外你那个json有没有办法一起打包进项目里,客户端功能不需要外部的请求是最好的。

@dongchengjie
Copy link
Contributor Author

dongchengjie commented Apr 17, 2024

@MystiPanda
我已经改完提交了,CDN的缓存有点久
离线schema可以的,还有一个schema参数,就是schema的JSON文件,优先从URI获取
但我不知道该怎么组织文件,文件放在那、怎么引入文件的内容、如果是引入的文件的话如何管理版本(我都不清楚怎么更新的内核,是执行那个check脚本还是怎么滴,schema文件是否也是采取这样的方式)
你可以改一下
image

@MystiPanda
Copy link
Member

有没有可能把你那个项目发布为npm包来导入呢

@dongchengjie
Copy link
Contributor Author

@MystiPanda npm得注册账号吧,我也没发过package,我研究一下吧😄

@dongchengjie
Copy link
Contributor Author

@MystiPanda 已经弄好了,通过npm install引入,等PR
npm撤包有24小时的CD,寻思着把测试过程中的几个version history清掉,就delete package了。然后再次上传提示不让republish,说要等24小时😂

@s749312025
Copy link

好难受,
mac 版本:10.15.7
monaco-editor 之前的版本我还能用
更新后,编辑器我已经用不了了。
image
打开控制台,我把报错复制出来了

[Warning] Proxy addEventListener: – Arguments (3) (localhost, line 42)
Arguments (3)
[Error] Unhandled Promise Rejection: ReferenceError: Can't find variable: WeakRef
	create (index-DkCL_k4o.js:427:1952574)
	_attachModel (index-DkCL_k4o.js:459:2261168)
	hU (index-DkCL_k4o.js:1010:3102083)
	construct
	createInstance (index-DkCL_k4o.js:1000:2945790)
	(anonymous function) (index-DkCL_k4o.js:1091:4407957)
	promiseReactionJob
[Warning] Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq (index-DkCL_k4o.js, line 380)
[Warning] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (index-DkCL_k4o.js, line 380)
[Warning] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (index-DkCL_k4o.js, line 380)
[Error] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (yaml.worker.bundle.js, line 30551)
[Error] Unhandled Promise Rejection: Error: Unexpected usage
	(anonymous function) (index-DkCL_k4o.js:1086:4098462)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob

目前我暂时回退到merge之前的版本

@dongchengjie
Copy link
Contributor Author

好难受, mac 版本:10.15.7 monaco-editor 之前的版本我还能用 更新后,编辑器我已经用不了了。 image 打开控制台,我把报错复制出来了

[Warning] Proxy addEventListener: – Arguments (3) (localhost, line 42)
Arguments (3)
[Error] Unhandled Promise Rejection: ReferenceError: Can't find variable: WeakRef
	create (index-DkCL_k4o.js:427:1952574)
	_attachModel (index-DkCL_k4o.js:459:2261168)
	hU (index-DkCL_k4o.js:1010:3102083)
	construct
	createInstance (index-DkCL_k4o.js:1000:2945790)
	(anonymous function) (index-DkCL_k4o.js:1091:4407957)
	promiseReactionJob
[Warning] Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq (index-DkCL_k4o.js, line 380)
[Warning] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (index-DkCL_k4o.js, line 380)
[Warning] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (index-DkCL_k4o.js, line 380)
[Error] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (yaml.worker.bundle.js, line 30551)
[Error] Unhandled Promise Rejection: Error: Unexpected usage
	(anonymous function) (index-DkCL_k4o.js:1086:4098462)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob

目前我暂时回退到merge之前的版本

项目一开始就不支持mac 11以下
image

@MystiPanda
Copy link
Member

低版本的 mac 不支持新的 js 语法,只有自己升级系统了,项目不可能为了兼容这么老的版本不去升级。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants