question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
micronykscommented, Aug 24, 2018

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

1reaction
emirhgcommented, 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: https://github.com/angular/angular-cli/blob/9ee905d76bd6211e101d712f6782edfceb276114/packages/schematics/angular/library/index.ts#L153

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I rename a project folder from within Visual Studio?
In Solution Explorer, double click, or right click on Properties → goto Application Tab, rename Assembly name and Default namespace to match.
Read more >
Working with folders and files with REST - Microsoft Learn
Perform basic create, read, update, and delete (CRUD) operations on folders and files with the SharePoint REST interface.
Read more >
Rename refactorings | IntelliJ IDEA Documentation - JetBrains
In the Projects tool window right-click a directory or a module that you want to rename. From the context menu, select Refactor |...
Read more >
Creating and managing Folders - Google Cloud
A folder can contain projects, other folders, or a combination of both. Organizations can use folders to group projects under the organization node...
Read more >
Multi-root Workspaces in Visual Studio Code
Unless you are explicitly creating a multi-root workspace, a "workspace" is just your project's single root folder. Adding folders. It is easy to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found