最近,我一直在尝试为 JHipster 实现一个蓝图。我决定覆盖实体和实体服务器子生成器。每个子生成器都有多个阶段,我可以选择/完全覆盖/部分覆盖/不覆盖/。这些阶段是:
/initializing()/prompting()/configuring()/default()/writing()/install()/end()/
因为这个名字,我对几个阶段的作用有一个模糊的理解,但即便如此仍然不够清楚。我没有在任何地方找到任何关于子发电机阶段的文件。谁能告诉我每个阶段的确切目的是什么?
如果我没有找到有关该主题的文档,请将其链接给我!
最佳答案
Jhipster 遵循 Yeoman 的优先级
链接:https://yeoman.io/authoring/running-context.html#the-run-loop
可用的优先级是(按运行顺序):
initializing - Your initialization methods (checking current project state, getting configs, etc)
prompting - Where you prompt users for options (where you’d call this.prompt())
configuring - Saving configurations and configure the project (creating .editorconfig files and other metadata files)
default - If the method name doesn’t match a priority, it will be pushed to this group.
writing - Where you write the generator specific files (routes, controllers, etc)
install - Where installations are run (npm, bower)
end - Called last, cleanup, say good bye, etc
关于jhipster - JHipster 子生成器阶段有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72635182/