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

扫描器屏蔽有关目录的问题 #106

Open
wengeezhang opened this issue Jun 9, 2022 · 0 comments
Open

扫描器屏蔽有关目录的问题 #106

wengeezhang opened this issue Jun 9, 2022 · 0 comments

Comments

@wengeezhang
Copy link
Collaborator

wengeezhang commented Jun 9, 2022

问题

目前扫描器扫描插件目录时,是全部扫描的(有几个特殊的过滤规则)。
而用户的插件目录可能千奇百怪,各种文件夹和不用类型的文件都有。如果需要通过ignore的方式去屏蔽,可能要一直调整。

可能解决方案:

通过读取meta.yaml中属性scanDir,来让用户指定扫描目录。代码改动如下:

// 代码位置:core/src/scanner/scan.ts
// function scanManifestByEnv:
await this.walk(
     // 调整前
    // plugin.importPath,
    // 调整后
    plugin.metadata.scanDir? path.resolve(plugin.importPath, plugin.metadata.scanDir) : plugin.importPath,
    this.formatWalkOptions('plugin', plugin.importPath, plugin.name, plugin.metadata.configDir)
);

带来的影响:

@noahziheng 提到,现在的设计,需要额外扫描更目录下的package.json等文件。如果按照上面的建议调整,可能扫描不到。

看下这些特殊文件,是否可以抽出来,在this.walk之前,提前放到manijest.json中?

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

No branches or pull requests

1 participant