{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular-cli/pulls/comments/152750773","pull_request_review_id":78658125,"id":152750773,"diff_hunk":"@@ -0,0 +1,142 @@\n+import { ng, npm } from '../../utils/process';\n+import { expectFileToMatch, writeFile } from '../../utils/fs';\n+import { getGlobalVariable } from '../../utils/env';\n+import { expectToFail } from '../../utils/utils';\n+import { updateJsonFile } from '../../utils/project';\n+import { readNgVersion } from '../../utils/version';\n+import { stripIndent } from 'common-tags';\n+\n+\n+export default function () {\n+  // Skip this in ejected tests.\n+  if (getGlobalVariable('argv').eject) {\n+    return Promise.resolve();\n+  }\n+\n+  let platformServerVersion = readNgVersion();\n+\n+  if (getGlobalVariable('argv').nightly) {\n+    platformServerVersion = 'github:angular/platform-server-builds';\n+  }\n+\n+  return Promise.resolve()\n+    .then(() => updateJsonFile('.angular-cli.json', configJson => {\n+      const app = configJson['apps'][0];\n+      app['appShell'] = {\n+        app: '1',\n+        route: 'shell'\n+      };\n+      configJson['apps'].push({\n+        platform: 'server',\n+        root: 'src',\n+        outDir: 'dist-server',\n+        assets: [\n+          'assets',\n+          'favicon.ico'\n+        ],\n+        index: 'index.html',\n+        main: 'main.server.ts',\n+        test: 'test.ts',\n+        tsconfig: 'tsconfig.server.json',\n+        testTsconfig: 'tsconfig.spec.json',\n+        prefix: 'app',\n+        styles: [\n+          'styles.css'\n+        ],\n+        scripts: [],\n+        environmentSource: 'environments/environment.ts',\n+        environments: {\n+          dev: 'environments/environment.ts',\n+          prod: 'environments/environment.prod.ts'\n+        }\n+      });\n+    }))\n+    .then(() => writeFile('src/app/app.module.ts', stripIndent`\n+      import { BrowserModule } from '@angular/platform-browser';\n+      import { NgModule } from '@angular/core';\n+      import { RouterModule } from '@angular/router';\n+\n+      import { AppComponent } from './app.component';\n+\n+      @NgModule({\n+        imports: [\n+          BrowserModule.withServerTransition({ appId: 'appshell-play' }),\n+          RouterModule\n+        ],\n+        declarations: [AppComponent],\n+        bootstrap: [AppComponent]\n+      })\n+      export class AppModule { }\n+    `))\n+    .then(() => writeFile('src/app/app.component.html', stripIndent`\n+      Hello World\n+      <router-outlet></router-outlet>\n+    `))\n+    .then(() => writeFile('src/tsconfig.server.json', stripIndent`\n+      {\n+        \"extends\": \"../tsconfig.json\",\n+        \"compilerOptions\": {\n+          \"outDir\": \"../out-tsc/app\",\n+          \"baseUrl\": \"./\",\n+          \"module\": \"commonjs\",\n+          \"types\": []\n+        },\n+        \"exclude\": [\n+          \"test.ts\",\n+          \"**/*.spec.ts\"\n+        ],\n+        \"angularCompilerOptions\": {\n+          \"entryModule\": \"app/app.server.module#AppServerModule\"\n+        }\n+      }\n+    `))\n+    .then(() => writeFile('src/main.server.ts', stripIndent`\n+      export {AppServerModule} from './app/app.server.module';\n+    `))\n+    .then(() => writeFile('src/app/app.server.module.ts', stripIndent`\n+      import {NgModule} from '@angular/core';\n+      import {ServerModule} from '@angular/platform-server';\n+      import { Routes, RouterModule } from '@angular/router';\n+\n+      import { AppModule } from './app.module';\n+      import { AppComponent } from './app.component';\n+      import { ShellComponent } from './shell.component';\n+\n+      const routes: Routes = [\n+        { path: 'shell', component: ShellComponent }\n+      ];\n+\n+      @NgModule({\n+        imports: [\n+          // The AppServerModule should import your AppModule followed\n+          // by the ServerModule from @angular/platform-server.\n+          AppModule,\n+          ServerModule,\n+          RouterModule.forRoot(routes),\n+        ],\n+        // Since the bootstrapped component is not inherited from your\n+        // imported AppModule, it needs to be repeated here.\n+        bootstrap: [AppComponent],\n+        declarations: [ShellComponent],\n+      })\n+      export class AppServerModule {}\n+    `))\n+    .then(() => writeFile('src/app/shell.component.ts', stripIndent`\n+      import { Component } from '@angular/core';\n+      @Component({\n+        selector: 'app-shell',\n+        template: '<p>shell Works!</p>',\n+        styles: []\n+      })\n+      export class ShellComponent {}\n+    `))\n+    .then(() => updateJsonFile('package.json', packageJson => {\n+      const dependencies = packageJson['dependencies'];\n+      dependencies['@angular/platform-server'] = platformServerVersion;\n+    })\n+    .then(() => npm('install')))\n+    .then(() => ng('build', '--prod'))\n+    .then(() => expectFileToMatch('dist/index.html', /shell Works!/))\n+    .then(() => ng('build', '--prod', '--skip-app-shell'))\n+    .then(() => expectToFail(() => expectFileToMatch('dist/index.html', /shell Works!/)));","path":"tests/e2e/tests/build/build-app-shell.ts","position":141,"original_position":141,"commit_id":"235f036f0c8c20a4ab80dc1710e7f4a7c0160ddd","original_commit_id":"6cbbb9ac268c31d926d0b775fec3882a88b00edf","user":{"login":"cyrilletuzi","id":555867,"avatar_url":"https://avatars2.githubusercontent.com/u/555867?v=4","gravatar_id":"","url":"https://api.github.com/users/cyrilletuzi","html_url":"https://github.com/cyrilletuzi","followers_url":"https://api.github.com/users/cyrilletuzi/followers","following_url":"https://api.github.com/users/cyrilletuzi/following{/other_user}","gists_url":"https://api.github.com/users/cyrilletuzi/gists{/gist_id}","starred_url":"https://api.github.com/users/cyrilletuzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyrilletuzi/subscriptions","organizations_url":"https://api.github.com/users/cyrilletuzi/orgs","repos_url":"https://api.github.com/users/cyrilletuzi/repos","events_url":"https://api.github.com/users/cyrilletuzi/events{/privacy}","received_events_url":"https://api.github.com/users/cyrilletuzi/received_events","type":"User","site_admin":false},"body":"I think he means this : angular/angular#20360\r\n\r\nJust tested AppShell from CLI 1.6.0-rc.0 and it's failing because of this.","created_at":"2017-11-23T09:21:55Z","updated_at":"2017-11-23T09:21:55Z","html_url":"https://github.com/angular/angular-cli/pull/7780#discussion_r152750773","pull_request_url":"https://api.github.com/repos/angular/angular-cli/pulls/7780","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/comments/152750773"},"html":{"href":"https://github.com/angular/angular-cli/pull/7780#discussion_r152750773"},"pull_request":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/7780"}},"in_reply_to_id":152110477},"pull_request":{"url":"https://api.github.com/repos/angular/angular-cli/pulls/7780","id":142487382,"html_url":"https://github.com/angular/angular-cli/pull/7780","diff_url":"https://github.com/angular/angular-cli/pull/7780.diff","patch_url":"https://github.com/angular/angular-cli/pull/7780.patch","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/7780","number":7780,"state":"closed","locked":false,"title":"feat(@angular/cli): Add ability to build AppShell","user":{"login":"Brocco","id":1565117,"avatar_url":"https://avatars0.githubusercontent.com/u/1565117?v=4","gravatar_id":"","url":"https://api.github.com/users/Brocco","html_url":"https://github.com/Brocco","followers_url":"https://api.github.com/users/Brocco/followers","following_url":"https://api.github.com/users/Brocco/following{/other_user}","gists_url":"https://api.github.com/users/Brocco/gists{/gist_id}","starred_url":"https://api.github.com/users/Brocco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brocco/subscriptions","organizations_url":"https://api.github.com/users/Brocco/orgs","repos_url":"https://api.github.com/users/Brocco/repos","events_url":"https://api.github.com/users/Brocco/events{/privacy}","received_events_url":"https://api.github.com/users/Brocco/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-22T02:57:55Z","updated_at":"2017-11-23T09:21:55Z","closed_at":"2017-11-23T06:35:32Z","merged_at":"2017-11-23T06:35:32Z","merge_commit_sha":"8c0779f6a33169ad22bb6410646f5283b399cfbe","assignee":{"login":"hansl","id":681969,"avatar_url":"https://avatars1.githubusercontent.com/u/681969?v=4","gravatar_id":"","url":"https://api.github.com/users/hansl","html_url":"https://github.com/hansl","followers_url":"https://api.github.com/users/hansl/followers","following_url":"https://api.github.com/users/hansl/following{/other_user}","gists_url":"https://api.github.com/users/hansl/gists{/gist_id}","starred_url":"https://api.github.com/users/hansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansl/subscriptions","organizations_url":"https://api.github.com/users/hansl/orgs","repos_url":"https://api.github.com/users/hansl/repos","events_url":"https://api.github.com/users/hansl/events{/privacy}","received_events_url":"https://api.github.com/users/hansl/received_events","type":"User","site_admin":false},"assignees":[{"login":"hansl","id":681969,"avatar_url":"https://avatars1.githubusercontent.com/u/681969?v=4","gravatar_id":"","url":"https://api.github.com/users/hansl","html_url":"https://github.com/hansl","followers_url":"https://api.github.com/users/hansl/followers","following_url":"https://api.github.com/users/hansl/following{/other_user}","gists_url":"https://api.github.com/users/hansl/gists{/gist_id}","starred_url":"https://api.github.com/users/hansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansl/subscriptions","organizations_url":"https://api.github.com/users/hansl/orgs","repos_url":"https://api.github.com/users/hansl/repos","events_url":"https://api.github.com/users/hansl/events{/privacy}","received_events_url":"https://api.github.com/users/hansl/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular-cli/pulls/7780/commits","review_comments_url":"https://api.github.com/repos/angular/angular-cli/pulls/7780/comments","review_comment_url":"https://api.github.com/repos/angular/angular-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/7780/comments","statuses_url":"https://api.github.com/repos/angular/angular-cli/statuses/235f036f0c8c20a4ab80dc1710e7f4a7c0160ddd","head":{"label":"Brocco:app-shell-build","ref":"app-shell-build","sha":"235f036f0c8c20a4ab80dc1710e7f4a7c0160ddd","user":{"login":"Brocco","id":1565117,"avatar_url":"https://avatars0.githubusercontent.com/u/1565117?v=4","gravatar_id":"","url":"https://api.github.com/users/Brocco","html_url":"https://github.com/Brocco","followers_url":"https://api.github.com/users/Brocco/followers","following_url":"https://api.github.com/users/Brocco/following{/other_user}","gists_url":"https://api.github.com/users/Brocco/gists{/gist_id}","starred_url":"https://api.github.com/users/Brocco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brocco/subscriptions","organizations_url":"https://api.github.com/users/Brocco/orgs","repos_url":"https://api.github.com/users/Brocco/repos","events_url":"https://api.github.com/users/Brocco/events{/privacy}","received_events_url":"https://api.github.com/users/Brocco/received_events","type":"User","site_admin":false},"repo":{"id":46990623,"name":"angular-cli","full_name":"Brocco/angular-cli","owner":{"login":"Brocco","id":1565117,"avatar_url":"https://avatars0.githubusercontent.com/u/1565117?v=4","gravatar_id":"","url":"https://api.github.com/users/Brocco","html_url":"https://github.com/Brocco","followers_url":"https://api.github.com/users/Brocco/followers","following_url":"https://api.github.com/users/Brocco/following{/other_user}","gists_url":"https://api.github.com/users/Brocco/gists{/gist_id}","starred_url":"https://api.github.com/users/Brocco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brocco/subscriptions","organizations_url":"https://api.github.com/users/Brocco/orgs","repos_url":"https://api.github.com/users/Brocco/repos","events_url":"https://api.github.com/users/Brocco/events{/privacy}","received_events_url":"https://api.github.com/users/Brocco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Brocco/angular-cli","description":null,"fork":true,"url":"https://api.github.com/repos/Brocco/angular-cli","forks_url":"https://api.github.com/repos/Brocco/angular-cli/forks","keys_url":"https://api.github.com/repos/Brocco/angular-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Brocco/angular-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Brocco/angular-cli/teams","hooks_url":"https://api.github.com/repos/Brocco/angular-cli/hooks","issue_events_url":"https://api.github.com/repos/Brocco/angular-cli/issues/events{/number}","events_url":"https://api.github.com/repos/Brocco/angular-cli/events","assignees_url":"https://api.github.com/repos/Brocco/angular-cli/assignees{/user}","branches_url":"https://api.github.com/repos/Brocco/angular-cli/branches{/branch}","tags_url":"https://api.github.com/repos/Brocco/angular-cli/tags","blobs_url":"https://api.github.com/repos/Brocco/angular-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Brocco/angular-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Brocco/angular-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Brocco/angular-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Brocco/angular-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Brocco/angular-cli/languages","stargazers_url":"https://api.github.com/repos/Brocco/angular-cli/stargazers","contributors_url":"https://api.github.com/repos/Brocco/angular-cli/contributors","subscribers_url":"https://api.github.com/repos/Brocco/angular-cli/subscribers","subscription_url":"https://api.github.com/repos/Brocco/angular-cli/subscription","commits_url":"https://api.github.com/repos/Brocco/angular-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Brocco/angular-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Brocco/angular-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Brocco/angular-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Brocco/angular-cli/contents/{+path}","compare_url":"https://api.github.com/repos/Brocco/angular-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Brocco/angular-cli/merges","archive_url":"https://api.github.com/repos/Brocco/angular-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Brocco/angular-cli/downloads","issues_url":"https://api.github.com/repos/Brocco/angular-cli/issues{/number}","pulls_url":"https://api.github.com/repos/Brocco/angular-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Brocco/angular-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Brocco/angular-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Brocco/angular-cli/labels{/name}","releases_url":"https://api.github.com/repos/Brocco/angular-cli/releases{/id}","deployments_url":"https://api.github.com/repos/Brocco/angular-cli/deployments","created_at":"2015-11-27T16:49:39Z","updated_at":"2016-08-10T18:24:54Z","pushed_at":"2017-11-23T03:31:41Z","git_url":"git://github.com/Brocco/angular-cli.git","ssh_url":"git@github.com:Brocco/angular-cli.git","clone_url":"https://github.com/Brocco/angular-cli.git","svn_url":"https://github.com/Brocco/angular-cli","homepage":null,"size":6001,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"e3e04c57551040b94f6c19bf4b9fbb872d30655f","user":{"login":"angular","id":139426,"avatar_url":"https://avatars3.githubusercontent.com/u/139426?v=4","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":36891867,"name":"angular-cli","full_name":"angular/angular-cli","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars3.githubusercontent.com/u/139426?v=4","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular-cli","description":"CLI tool for Angular","fork":false,"url":"https://api.github.com/repos/angular/angular-cli","forks_url":"https://api.github.com/repos/angular/angular-cli/forks","keys_url":"https://api.github.com/repos/angular/angular-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular-cli/teams","hooks_url":"https://api.github.com/repos/angular/angular-cli/hooks","issue_events_url":"https://api.github.com/repos/angular/angular-cli/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular-cli/events","assignees_url":"https://api.github.com/repos/angular/angular-cli/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular-cli/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular-cli/tags","blobs_url":"https://api.github.com/repos/angular/angular-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular-cli/languages","stargazers_url":"https://api.github.com/repos/angular/angular-cli/stargazers","contributors_url":"https://api.github.com/repos/angular/angular-cli/contributors","subscribers_url":"https://api.github.com/repos/angular/angular-cli/subscribers","subscription_url":"https://api.github.com/repos/angular/angular-cli/subscription","commits_url":"https://api.github.com/repos/angular/angular-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular-cli/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular-cli/merges","archive_url":"https://api.github.com/repos/angular/angular-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular-cli/downloads","issues_url":"https://api.github.com/repos/angular/angular-cli/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular-cli/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular-cli/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular-cli/deployments","created_at":"2015-06-04T19:49:37Z","updated_at":"2017-11-23T09:09:29Z","pushed_at":"2017-11-23T06:57:05Z","git_url":"git://github.com/angular/angular-cli.git","ssh_url":"git@github.com:angular/angular-cli.git","clone_url":"https://github.com/angular/angular-cli.git","svn_url":"https://github.com/angular/angular-cli","homepage":"","size":6780,"stargazers_count":13953,"watchers_count":13953,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2963,"mirror_url":null,"archived":false,"open_issues_count":817,"forks":2963,"open_issues":817,"watchers":13953,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/7780"},"html":{"href":"https://github.com/angular/angular-cli/pull/7780"},"issue":{"href":"https://api.github.com/repos/angular/angular-cli/issues/7780"},"comments":{"href":"https://api.github.com/repos/angular/angular-cli/issues/7780/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/7780/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/7780/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular-cli/statuses/235f036f0c8c20a4ab80dc1710e7f4a7c0160ddd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cyrilletuzi"}}