loopbackio / loopbackio/loopback-next
lb4 relation doesn't find models
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### 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
Contributor guide
Research direction
Start with the `lb4 relation` command and the reproduction project linked in the issue, then inspect how it scans `src/models` and uses that directory's `index.ts`. The work is done when models organized in subdirectories are discovered for relation or repository generation instead of producing “No models found.”
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100