Yeoman 生成器命名

Yeoman generator naming

我可以在 Yeoman 文档中看到它明确指出:

The name property must be prefixed by generator-. The keywords property must contain "yeoman-generator" and the repo must have a description to be indexed by our generators page.

但是我的问题是,如果我正在开发一个自定义生成器供私人使用/私人 npm(因此不关心将其编入索引)我给生成器起什么名字仍然重要吗??

本质上,Yeoman 如何确定哪些 npm 模块是生成器,哪些不是?它是基于模块名称还是关键字? (或两者)

谢谢

这仍然很重要,因为 Yeoman (yeoman-environment) 会在您的 npm 搜索路径匹配 generator-*.

的任何位置查找安装的 NPM 包

因此名称对于 yo 自动找到您的发电机很重要。

但还要注意,Yeoman 可以通过路径 (yo ./node_modules/some-generator/app) 运行 生成器。在这种情况下,您不需要特定的名称。