loopbackio / loopbackio/loopback-next

lb4 relation doesn't find models

未关闭
#9,653 5 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
TypeScript
星标
5.1k
派生
1.1k
平均合并
2 天 21 小时
30 天内合并 PR
27

描述

Describe the bug

I have a project with a lot of models. I organized the models in "sub directories" inside "models" directory.
The "export" is working properly and all the project is working.
What is not working is the possibility to add repositories, relations or anything else
"lb4 relation" stops with an error "Generation is aborted: Error: No models found in ".../src/models"."
I expect the script to be capable to look for models also inside according to what is available in "index.ts" from "models" directory.

Logs

No response

Additional information

No response

Reproduction

https://github.com/danysz/demo-lb4-cli-model-not-found

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从 lb4 relation 命令和 issue 中链接的复现项目开始,然后检查它如何扫描 src/models 以及如何使用该目录的 index.ts。当组织在子目录中的模型能够被发现并用于 relation 或 repository 生成,而不是产生“No models found.”时,这项工作就完成了。

由索引模型根据 Issue 内容生成。

评估

技术栈
nodejs, typescript
领域
cli, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。