Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow to generate libraries within a particular folder & allow to rename 'projects' folder name #11927

Closed
micronyks opened this issue Aug 17, 2018 · 6 comments
Labels
area: @schematics/angular feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature
Milestone

Comments

@micronyks
Copy link

micronyks commented Aug 17, 2018

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

@hansl hansl added feature Issue that requests a new feature area: @schematics/angular labels Aug 20, 2018
@ngbot ngbot bot added this to the Backlog milestone Aug 20, 2018
@jorroll
Copy link

jorroll commented Aug 24, 2018

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).

@micronyks
Copy link
Author

@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.

@emirhg
Copy link

emirhg commented Dec 18, 2020

It's been two years and this issue remains open. I'll like to work on it as I'll find it very useful on a current project. So far I've identified the involved line:

const newProjectRoot = workspace.extensions.newProjectRoot as (string | undefined) || '';

I'm thinking on a CLI argument like ng generate library my-lib --newProjectRoot=my-prefix-path in order to be consistent with the JSON config file. Would love to read your comments about it

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Feb 1, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 1, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@ngbot ngbot bot modified the milestones: Backlog, needsTriage Feb 1, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 21, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors and removed feature: votes required Feature request which is currently still in the voting phase labels Feb 21, 2022
@clydin clydin closed this as completed in d8bff4f Oct 7, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

6 participants