Skip to content

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

Closed

Description

@dopry

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.

Activity

  1. dopry commented on Feb 7, 2017

    @dopry
    Author

    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.

  2. Brocco commented on Feb 7, 2017

    @Brocco
    Contributor

    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.

  3. dopry commented on Feb 7, 2017

    @dopry
    Author
  4. dopry commented on Feb 9, 2017

    @dopry
    Author

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

  5. Brocco commented on Feb 9, 2017

    @Brocco
    Contributor

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

  6. reopened this on Feb 9, 2017
  7. dopry commented on Feb 9, 2017

    @dopry
    Author
  8. Brocco commented on Feb 9, 2017

    @Brocco
    Contributor

    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.

  9. e-cloud commented on Feb 13, 2017

    @e-cloud
    Contributor

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

  10. filipesilva commented on Mar 9, 2017

    @filipesilva
    Contributor

    Fixed by #4754

  11. leocaseiro commented on Apr 4, 2017

    @leocaseiro

    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.

  12. TroelsWibergJensen commented on Jun 20, 2018

    @TroelsWibergJensen

    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.

  13. leocaseiro commented on Jun 21, 2018

    @leocaseiro

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

  14. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  15. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions