Skip to content

Generating Blueprints in directory other than src/app #5995

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

Closed
somombo opened this issue Apr 18, 2017 · 3 comments
Closed

Generating Blueprints in directory other than src/app #5995

somombo opened this issue Apr 18, 2017 · 3 comments

Comments

@somombo
Copy link

somombo commented Apr 18, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report
- [x] feature request

I posted the following question on gitter:

hi.. If I change the name of the folder src/app to say src/lib how do i ensure that if I do things like ng generate component foo, angular-cli will know to place the FooComponent in src/lib? Is there something in .angular-cli.json I'm supposed to update? Thanks

@hansl was kind enough to respond:

@somombo no way right now unfortunately. We’re working on removing the hard coded app directories, in favor of looking at the bootstrapping code.

@hansl that's nice for apps that are bootstrapped. But if someone is working on let's say a library that's bootstrapped only in unit tests, then that will be problematic, unless you are incorporating that into your plans somehow?

I think its not a bad idea to just have an extra configuration in .angular-cli.json to simply change the default name from "app".

Another alternative resolution for the meantime, is to allow the following to command to work
ng generate directive mydirname --export --module="../lib/mylib.module"

It current results in the error:
Invalid path: "../lib/quill.module.ts" cannot be above the "src/app" directory

Ultimately I could see having multiple sibling source directories at "src/*" level such some subset of :

["app", "browser", "server", "common", "android", "ios", "webworker" , "lib"]

(I'll call these "ngRoots", so for example the ngRoot directory server is located at "src/server")

It would be nice to have the ability to generate blueprints by specifying relative which ngRoot directory they should generated in. e.g.

ng generate directive mydirname --export --module="./mylib.module" --ngRoot="./lib"

Thought?

@filipesilva
Copy link
Contributor

There's a couple of things in this issue:

@somombo
Copy link
Author

somombo commented Oct 5, 2017

looks like #6079 fixes this

@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 Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants