关于JHipster蓝图/模块创建的一些问题

发布于 2025-01-11 13:51:39 字数 1256 浏览 1 评论 0原文

我最近一直在尝试在工作中创建自定义蓝图,但我需要一些帮助,因为老实说,我无法对我应该做什么有一个高层次的了解。我有一些一般性问题,还有一些针对我想做的事情的具体问题。

  1. 模块和蓝图有什么区别?网站的解释不是很清楚。从我的实验中,我得到的印象是模块与覆盖“app”子生成器有关,但我不太明白。

  2. 创建蓝图的推荐方法是什么?我尝试使用generator-jhipster-blueprint,但它很旧。然后我克隆了它的代码,直接使用最新的,但它说它仅适用于jhipster 7.0.0beta,并中止(当时我的系统上有jhipster 7.6.0)。然后我只是从generator-jhipster本身获取我需要的东西,同时模仿其他蓝图所做的事情,并以某种方式设法使其工作,但我确信这并不理想。看到最近发布的[email protected],有一个新工具:generate -蓝图。这是现在推荐的方式吗?

  3. 我应该如何处理与generator-jhipster一起升级我的蓝图?我现在的蓝图是基于7.6.0的。升级是否像将generator-jhipster的依赖更新到7.7.0那么简单?

  4. 据我所知,有这样的层次结构: JHipsterBasePrivateGenerator > JHipsterBaseGenerator > JHipsterBaseBlueprintGenerator。最后一个定义了生成的一些阶段。这反过来又由 jhipster 的子生成器本身扩展(所以它们本身实际上就是蓝图?),它们实现了这些阶段。我们还希望在创建蓝图时覆盖这些阶段,但没有关于每个阶段应该做什么的文档。我看到许多蓝图只是覆盖了写作阶段,但如果您能在那里阐明一些观点,那就太好了。

  5. 我找不到模板文件中可用的变量,每个生成器它们是否不同?我想是这样,因为例如实体生成器获取当前迭代的每个特定实体的变量。有这方面的信息吗?另外,我应该在哪里创建自己的变量以在我的蓝图或模板文件中使用?

现在,我正在尝试做的工作:

a)我正在尝试修改反应前端的生成。我只覆盖以下子生成器的写入阶段是否正确? :“客户端”、“实体客户端”,如果需要的话可能还有“实体-i18n”?

b) 我最好不要使用提示,并通过 jdl + 配置文件完成所有操作。这样的配置文件(例如描述keycloak和代理配置)应该放在哪里?

I've been trying to create a custom blueprint at work lately, but I'd like some help, because I honestly can't get a high level picture of what I should be doing. I have some general questions, and some specific to what I'm trying to do.

  1. What is the difference between a module and a blueprint? The website explanation isn't very clear. From my experimentation, I got the impression that modules have to do with overriding the 'app' subgenerator, but I don't really understand.

  2. What is the recommended way to create a blueprint? I tried with generator-jhipster-blueprint, but it was old. Then I cloned its code, to use the latest directly, but it said it was only for jhipster 7.0.0beta, and aborted (I had jhipster 7.6.0 on my system at the time). Then I just took what I needed from generator-jhipster itself, while mimicking what other blueprints had done, and somehow managed to make it work, but I'm sure this isn't ideal. Seeing the recently released [email protected], there is a new tool: generate-blueprint. Is this the recommended way now?

  3. How should I handle upgrading my blueprint together with generator-jhipster? My blueprint right now is based on 7.6.0. Is upgrading as simple as updating the dependency to generator-jhipster to 7.7.0?

  4. From what I could gather, there is this hierarchy: JHipsterBasePrivateGenerator > JHipsterBaseGenerator > JHipsterBaseBlueprintGenerator. The last one defines some phases of generation. This is in turn extended by jhipster's subgenerators themselves (so they are in effect blueprints themselves?), which implement these phases. We are also expected to override these phases when creating a blueprint, but there is no documentation on what each phase is supposed to do. I see many blueprints just overriding the writing phase, but it would be great if you could shed some light there.

  5. I cannot find which variables are usable in template files, are they different per generator? I would imagine so, since for example the entity generators get variables for each specific entity currently iterated on. Any info on that? Also where should I be creating my own variables for use inside my blueprint or template files?

Now for the work I'm trying to do:

a) I'm trying to modify the generation of a react frontend. Am I right in overriding only the following subgenerators' writing phase? : 'client', 'entity-client', and maybe 'entity-i18n' if needed?

b) I'd preferably like not to use prompts, and do everything via jdl + configuration files. Where should such configuration files (e.g. describing keycloak and proxy configuration) live?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文