Angular-cli: Feature Request: Allow to generate libraries within a particular folder & allow to rename 'projects' folder name

Created on 17 Aug 2018  路  2Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Latest

Desired functionality

Currently It is not possible to generate a library within a specific folder with relative path.
When I run ng generate library mylib --prefix=mylib command, it generates a folder called projects under root directory and places mylib under projects

_Current Flow,_

|---MyFoodApplication
|                    |---projects
|                                |---mylib-1
|                                |---mylib-2
|                    |---src

_Sometimes use-case can be like:_

1) Create all libraries under common folder resides at (anywhere) angular project's root directory. (common is just a folder and nothing else)

2) When I want to create any library, It should create desire name of the folder (eg. companyname-libraries) which must contain all generated library.

_So, the final output should be like below,_

|---MyFoodApplication
|                    |---common
|                              |---companyname-libraries
|                                                       |---mylib-1
|                                                       |---mylib-2
|                    |---src

schematicangular triage #1 feature

Most helpful comment

@thefliik I have already done it but it should not be a manual process ! That's why I've added this as a feature request.

All 2 comments

Obviously this isn't ideal, but I work around this issue by simply updating the angular.json "newProjectRoot" property to be whatever I want for the project I'm generating at that moment.

In general, I keep it at the project root for my libraries (because I generate more of those) and I temporarily change it to the project root for my apps when I need to generate a new app (and then immediately change it back to my libraries' project root).

@thefliik I have already done it but it should not be a manual process ! That's why I've added this as a feature request.

Was this page helpful?
0 / 5 - 0 ratings