fix(transform): 兼容 Sub-Store 2.36.32+ 手写 Peggy 解析器 - #40
Open
MbAIGC wants to merge 1 commit into
Open
Conversation
trojan-uri.js 已从内嵌 Peggy grammar 改写为手写解析器, precompilePeggyParser 不再强制要求匹配 grammars;未找到 grammar 且未引用 peggy 时原样放行,仍引用 peggy 时才报错,避免构建失败。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Sub-Store 2.36.32 将
backend/src/core/proxy-utils/parsers/peggy/trojan-uri.js从内嵌 Peggy grammar(const grammars = String.raw...)改写为手写解析器(parseTrojan+getParser()),导致vite build在sub_store环境报错:修复
precompilePeggyParser不再对 peggy 目录下所有文件强制要求匹配 grammar:getParser()接口与预编译产物一致;验证
pnpm run build:workers通过:sub_store461 个模块构建成功;peggy.generate为 0,手写parseTrojan已正确打包。