Skip to content

I don't want to call my 'app', 'app'. #4506

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
dopry opened this issue Feb 7, 2017 · 13 comments
Closed

I don't want to call my 'app', 'app'. #4506

dopry opened this issue Feb 7, 2017 · 13 comments

Comments

@dopry
Copy link

dopry commented Feb 7, 2017

There is an assumption that I want have a /src/app folder. When I do not really want to have this folder. I actually want to have /src/{{moduleName}}/ , but totally appreciate using /src/app as a standard.

It'd be really nice if

const sourceRoot = path.join(project.root, project.ngConfig.apps[0].root, 'app');
just used root instead of enforcing 'app' and the angular-cli.json use src/app as root or there was another property for app folder on the application entity.

This would help enable multiple apps in one project...

a la
#1140

the apps proper in ng-cli.json is already an array.

@dopry
Copy link
Author

dopry commented Feb 7, 2017

If the ng-cli maintainers have a direction or thoughts on this, I'm happy to implement, I just want to get a firm nod on the direction before I put in the work.

@Brocco
Copy link
Contributor

Brocco commented Feb 7, 2017

You can rename this dir with the --source-dir option when you run ng new the documentation in the wiki explains the available options here.

@Brocco Brocco closed this as completed Feb 7, 2017
@dopry
Copy link
Author

dopry commented Feb 7, 2017 via email

@dopry
Copy link
Author

dopry commented Feb 9, 2017

@Brocco, so are you saying the maintainers of angular-cli want to keep the hard coded name and aren't open to this change?

@Brocco
Copy link
Contributor

Brocco commented Feb 9, 2017

@dopry I'm sorry my last response didn't answer what you were asking, just a simple misunderstanding.

We're certainly open to making that change, but there's some portions that are tied to that name which we'd need to ensure were all updated to allow for making that name configurable.

That being said, I'm not sure of the priority of the team working on this change. If you're willing to put together a PR, I'd be happy to help you with it.

@Brocco Brocco reopened this Feb 9, 2017
@dopry
Copy link
Author

dopry commented Feb 9, 2017 via email

@Brocco
Copy link
Contributor

Brocco commented Feb 9, 2017

Not at all, there are some things that are the way they are for a reason. But making the app name configurable is not one of them.

@e-cloud
Copy link
Contributor

e-cloud commented Feb 13, 2017

at least tag some labels to indicate this is really a problem!

@filipesilva
Copy link
Contributor

Fixed by #4754

@leocaseiro
Copy link

leocaseiro commented Apr 4, 2017

Hi @filipesilva,

I'm afraid the #4754 didn't fix this issue.

I've tried to implement with the --app, but now I have some app folders, with the app folder still.

Eq:

example
+-- /src
     +- /admin
     |  +- /app
     |     +- admin.component.scss
     |     +- admin.component.html
     |     +- admin.component.spec.ts
     |     +- admin.component.ts
     |     +- admin.module.ts
     |
     +- /shop
        +- /app
           +- shop.component.scss
           +- shop.component.html
           +- shop.component.spec.ts
           +- shop.component.ts
           +- shop.module.ts

Any way to get rid of the /app and use the generate still?

PS: I can remove by myself and run serve/build and so on, but I won't be able to use generate which is the feature I'm expecting most.

I've tried to rename the root on the cli, but everytime I run generate it creates the app folder.

Eq: ng g m admin --app admin

Thanks.

@TroelsWibergJensen
Copy link

Please enable us to configure this. It's really annoying when you working on a long running project and want to fit Angular in with your existing mvc api, and don't want to maintain a duplicate file structure, for example.

@leocaseiro
Copy link

@nnit-TroelsJensen the newest @angular/cli lets you set the path into angular.json.

See the https://github.com/nrwl/nx as a reference: https://github.com/nrwl/nx-examples/blob/master/angular.json

PS: Perhaps, you might need to fix the generators using schematics.

@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 8, 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

Successfully merging a pull request may close this issue.

6 participants