GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(@angular/cli): make appRoot customizable by vsavkin · Pull Request #7775 · angular/angular-cli

Conversation

@vsavkin

@vsavkin vsavkin commented Sep 21, 2017

Copy link
Copy Markdown
Contributor

Currently, the CLI hardcodes appRoot to app, which is a reasonable default.

In complex projects with many apps (some of which aren't actually bundles shipped to the client), the prefix gets in a way. It looks awkward.

Using schematics we can generate apps that do not follow the default. Currently if you do that, ng generate won't work for those apps.

The PR changes the CLI to allow the provisioning of appRoot

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jehoshua02, guilhermejcgois, and dmnBrest reacted with thumbs up emoji jehoshua02 and dmnBrest reacted with hooray emoji jehoshua02 and dmnBrest reacted with heart emoji
All reactions
  • 👍 3 reactions
  • 🎉 2 reactions
  • ❤️ 2 reactions
@googlebot googlebot added the cla: yes label Sep 21, 2017
Brocco
Brocco suggested changes Sep 21, 2017
View reviewed changes

@Brocco Brocco left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few minor things.
@hansl has done some work on appRoot changes recently, so I'd like him to review as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/@angular/cli/utilities/dynamic-path-parser.ts Outdated
const appRoot = path.join(sourceDir, 'app');

const p = options.appConfig.appRoot === undefined ? 'app' : options.appConfig.appRoot;
const appRoot = path.join(sourceDir, options.appConfig.appRoot);

@Brocco Brocco Sep 21, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating local variable p with the determined root, but tot using it within the join on line 18

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vsavkin vsavkin Sep 21, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it. Bad rebase.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/acceptance/generate-component.spec.ts Outdated
@@ -1,5 +1,5 @@
// tslint:disable:max-line-length
import { mkdirsSync, pathExistsSync, readFile, readFileSync } from 'fs-extra';
import { mkdirsSync, pathExistsSync, readFile, readFileSync, writeFileSync } from 'fs-extra';

@Brocco Brocco Sep 21, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New import is not being used.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vsavkin vsavkin Sep 21, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/helpers/index.ts
});
}

function addAppToProject(): Promise<any> {

@Brocco Brocco Sep 21, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required, but would be nice to have:
Add parameter(s) here to specify values for the app being created.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vsavkin vsavkin Sep 21, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is: since this function is called by a single caller, it would make it unnecessary complex.

But I can make a change, if you think it is better this way.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Brocco
Brocco requested a review from hansl September 21, 2017 14:55
@vsavkin
vsavkin force-pushed the make_app_customizable branch 2 times, most recently from 1dea1bf to 10b0478 Compare September 21, 2017 15:03
@filipesilva
filipesilva requested a review from Brocco September 25, 2017 10:41
@filipesilva filipesilva assigned Brocco Sep 25, 2017
@vsavkin
feat(@angular/cli): make appRoot customizable
e6b1eb6
@vsavkin
vsavkin force-pushed the make_app_customizable branch from 10b0478 to e6b1eb6 Compare October 4, 2017 17:44
Brocco
Brocco approved these changes Oct 4, 2017
View reviewed changes

@Brocco Brocco left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Brocco
Brocco merged commit b6dfa8d into angular:master Oct 4, 2017
This was referenced Oct 5, 2017
Angular CLI 1.4.2 is generating unwanted directories when root directory is custom (src/app1) #7869
Closed
ng generate doesn't work with multiple apps #7418
Closed
@raghulrajnkl

raghulrajnkl commented Oct 28, 2017

Copy link
Copy Markdown

i want create three different application, and first secenrio merge three and other one first and second merge, how its possible?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@raghulrajnkl

raghulrajnkl commented Oct 28, 2017

Copy link
Copy Markdown

i created three app folder (app, newapp1,newapp2), seperate module, and developed three team seperaetly.
after finished i merge three module as per my plan of router configuration ..is it right way or else any new solutions?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@raghulrajnkl

raghulrajnkl commented Oct 28, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

i need ng generate module in newapp folder? how it is possble?
because three web apps merge in one application, help me, give solutions

playground reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@towertop

towertop commented Nov 23, 2017

Copy link
Copy Markdown

@Brocco I think the wiki for config schema should be updated accordingly。

https://github.com/angular/angular-cli/wiki/angular-cli
https://github.com/angular/angular-cli/wiki/stories-multiple-apps

For I just come to this issue from that wiki. Thx~

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@playground

playground commented Dec 21, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

How would you target a new module or component to a specific app?

I guess this works "ng g module app2/new-module"

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vvolodin

vvolodin commented Dec 29, 2017

Copy link
Copy Markdown

How do I use this? Is there any documentation on appRoot?
I need to keep my app in a directory different from app and this breaks ng generate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@towertop

towertop commented Jan 3, 2018

Copy link
Copy Markdown

@playground

Most ng subcommand have an option "--app" to specify the name of app.

@vvolodin

No document get updated as I mentioned above. But you can use it this way for an app "common" sibling to the default "app".

    },
    {
      "name": "common",
      "appRoot": "common",
      "root": "src",
      "tsconfig": "tsconfig.app.json",
spankyed reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@martinsik martinsik mentioned this pull request Feb 13, 2018
Ng generate always assumes an app folder #9370
Open
@PierreChavaroche

PierreChavaroche commented May 28, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Do you have any idea how we have to configure with Angular 6 "angular.json" config?

Thank you very much!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@leonadler

leonadler commented Jun 19, 2018

Copy link
Copy Markdown

Using appRoot leads to an error "Workspace needs to be loaded before it is used."
and is not included in the json-schema for angular.json.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@angular-automatic-lock-bot

angular-automatic-lock-bot Bot commented Sep 12, 2019

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot unassigned Brocco Sep 12, 2019
@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@hansl hansl Awaiting requested review from hansl
1 more reviewer
@Brocco Brocco Brocco approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@vsavkin @raghulrajnkl @towertop @playground @vvolodin @PierreChavaroche @leonadler @Brocco @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.