Skip to content

Support for nested dir structure while using generators? #6591

Description

@jagzmz

Suggestion

So, as of now, lb4 cli makes immediate files under models, controllers, repositories folders, maybe add a flag while running the generator something like --dirNested asks for the directory path and generates a file in that respective directory.

Use Cases

Some people might need to maintain a directory structure, instead of every file placed in the same dir.

Examples

lb4 controller --dirNested
> Name the directory in which you want to create the controller: UserControllers
> Name of the controller: user

lb4 controller --dirNested
> Name the directory in which you want to create the controller: UserControllers
> Name of the controller: userOrder
The file path for the above files would be like,

controllers/UserControllers/user.controller.ts
controllers/UserControllers/userOrder.controller.ts

If this looks useful, I might work on a PR for this.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions