From 62d0728dbabe2adc372abf2f0268bf0fc1661e68 Mon Sep 17 00:00:00 2001
From: Volodymyr BIlyachat
Date: Fri, 17 Aug 2018 12:42:02 +1000
Subject: [PATCH 1/2] fix(@schematics/angular): generate application with
projectRoot is provided
---
docs/documentation/generate/application.md | 9 +++++++++
docs/documentation/stories/multiple-projects.md | 2 +-
packages/schematics/angular/application/index.ts | 4 +---
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/docs/documentation/generate/application.md b/docs/documentation/generate/application.md
index 439d24693cf2..c103c3496042 100644
--- a/docs/documentation/generate/application.md
+++ b/docs/documentation/generate/application.md
@@ -96,3 +96,12 @@ Create an Angular application.
Do not add dependencies to package.json.
+
+ project-root
+
+ --project-root
+
+
+ Specify root folder for new application and e2e tests
+
+
\ No newline at end of file
diff --git a/docs/documentation/stories/multiple-projects.md b/docs/documentation/stories/multiple-projects.md
index d1a49bce61e4..43b03277a7a1 100644
--- a/docs/documentation/stories/multiple-projects.md
+++ b/docs/documentation/stories/multiple-projects.md
@@ -7,7 +7,7 @@ To create another app you can use the following command:
ng generate application my-other-app
```
-The new application will be generated inside `projects/my-other-app`.
+The new application will be generated inside `projects/my-other-app`. If you wish to override root folder specify `--project-root applicationPath`
Now we can `serve`, `build` etc. both the apps by passing the project name with the commands:
diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts
index 269e30d2f44d..ab02f6d25905 100644
--- a/packages/schematics/angular/application/index.ts
+++ b/packages/schematics/angular/application/index.ts
@@ -270,10 +270,8 @@ export default function (options: ApplicationOptions): Rule {
name: `${options.name}-e2e`,
relatedAppName: options.name,
rootSelector: appRootSelector,
+ projectRoot: `${newProjectRoot}/e2e`,
};
- if (options.projectRoot !== undefined) {
- e2eOptions.projectRoot = 'e2e';
- }
return chain([
addAppToWorkspaceFile(options, workspace),
From d48360da7bbf5ff5ac2070d63fab301d95e74d7e Mon Sep 17 00:00:00 2001
From: Volodymyr BIlyachat
Date: Fri, 17 Aug 2018 14:52:09 +1000
Subject: [PATCH 2/2] fix(@schematics/angular): to build proper path for e2e in
new project command
---
packages/schematics/angular/application/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts
index ab02f6d25905..0bf909f0a5a6 100644
--- a/packages/schematics/angular/application/index.ts
+++ b/packages/schematics/angular/application/index.ts
@@ -270,7 +270,7 @@ export default function (options: ApplicationOptions): Rule {
name: `${options.name}-e2e`,
relatedAppName: options.name,
rootSelector: appRootSelector,
- projectRoot: `${newProjectRoot}/e2e`,
+ projectRoot: newProjectRoot ? `${newProjectRoot}/e2e` : 'e2e',
};
return chain([