Skip to content

Commit

Permalink
feat: got demo app to test breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
udayvunnam committed Jul 19, 2020
1 parent d284135 commit 5d491d7
Show file tree
Hide file tree
Showing 57 changed files with 227 additions and 218 deletions.
87 changes: 54 additions & 33 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,39 +167,60 @@
},
"schematics": {}
},
"star-wars": {
"got-demo": {
"projectType": "application",
"schematics": {
"@schematics/angular:interceptor": {
"skipTests": true
},
"@nrwl/angular:class": {
"skipTests": true
},
"@nrwl/angular:component": {
"style": "scss"
"skipTests": true
},
"@nrwl/angular:directive": {
"skipTests": true
},
"@nrwl/angular:guard": {
"skipTests": true
},
"@nrwl/angular:module": {
"skipTests": true
},
"@nrwl/angular:pipe": {
"skipTests": true
},
"@nrwl/angular:service": {
"skipTests": true
}
},
"root": "apps/star-wars",
"sourceRoot": "apps/star-wars/src",
"prefix": "",
"root": "apps/got-demo",
"sourceRoot": "apps/got-demo/src",
"prefix": "got",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/star-wars",
"index": "apps/star-wars/src/index.html",
"main": "apps/star-wars/src/main.ts",
"polyfills": "apps/star-wars/src/polyfills.ts",
"tsConfig": "apps/star-wars/tsconfig.app.json",
"outputPath": "dist/apps/got-demo",
"index": "apps/got-demo/src/index.html",
"main": "apps/got-demo/src/main.ts",
"polyfills": "apps/got-demo/src/polyfills.ts",
"tsConfig": "apps/got-demo/tsconfig.app.json",
"aot": true,
"assets": [
"apps/star-wars/src/favicon.ico",
"apps/star-wars/src/assets"
"apps/got-demo/src/favicon.ico",
"apps/got-demo/src/assets"
],
"styles": ["apps/star-wars/src/styles.scss"],
"styles": ["apps/got-demo/src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/star-wars/src/environments/environment.ts",
"with": "apps/star-wars/src/environments/environment.prod.ts"
"replace": "apps/got-demo/src/environments/environment.ts",
"with": "apps/got-demo/src/environments/environment.prod.ts"
}
],
"optimization": true,
Expand Down Expand Up @@ -228,64 +249,64 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "star-wars:build"
"browserTarget": "got-demo:build"
},
"configurations": {
"production": {
"browserTarget": "star-wars:build:production"
"browserTarget": "got-demo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "star-wars:build"
"browserTarget": "got-demo:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/star-wars/tsconfig.app.json",
"apps/star-wars/tsconfig.spec.json"
"apps/got-demo/tsconfig.app.json",
"apps/got-demo/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!apps/star-wars/**/*"]
"exclude": ["**/node_modules/**", "!apps/got-demo/**/*"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/star-wars/jest.config.js",
"tsConfig": "apps/star-wars/tsconfig.spec.json",
"jestConfig": "apps/got-demo/jest.config.js",
"tsConfig": "apps/got-demo/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "apps/star-wars/src/test-setup.ts"
"setupFile": "apps/got-demo/src/test-setup.ts"
}
}
}
},
"star-wars-e2e": {
"root": "apps/star-wars-e2e",
"sourceRoot": "apps/star-wars-e2e/src",
"got-demo-e2e": {
"root": "apps/got-demo-e2e",
"sourceRoot": "apps/got-demo-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/star-wars-e2e/cypress.json",
"tsConfig": "apps/star-wars-e2e/tsconfig.e2e.json",
"devServerTarget": "star-wars:serve"
"cypressConfig": "apps/got-demo-e2e/cypress.json",
"tsConfig": "apps/got-demo-e2e/tsconfig.e2e.json",
"devServerTarget": "got-demo:serve"
},
"configurations": {
"production": {
"devServerTarget": "star-wars:serve:production"
"devServerTarget": "got-demo:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["apps/star-wars-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/star-wars-e2e/**/*"]
"tsConfig": ["apps/got-demo-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/got-demo-e2e/**/*"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"pluginsFile": "./src/plugins/index",
"supportFile": "./src/support/index.ts",
"video": true,
"videosFolder": "../../dist/cypress/apps/star-wars-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/star-wars-e2e/screenshots",
"videosFolder": "../../dist/cypress/apps/got-demo-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/got-demo-e2e/screenshots",
"chromeWebSecurity": false
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('star-wars', () => {
describe('got-demo', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('my-email@something.com', 'myPassword');

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Welcome to star-wars!');
getGreeting().contains('Welcome to got-demo!');
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
name: 'star-wars',
name: 'got-demo',
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/apps/star-wars',
coverageDirectory: '../../coverage/apps/got-demo',
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
margin: 50px auto;
}

.gutter-left {
margin-left: 9px;
}

.col-span-2 {
grid-column: span 2;
}
Expand Down
71 changes: 71 additions & 0 deletions apps/got-demo/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<header class="flex">
<h1>Welcome to {{ title }}!</h1>
</header>
<main>
<ul class="resources">
<li class="col-span-2">
<a
class="resource flex"
[routerLink]="['books']"
>
Books
</a>
</li>
<li class="col-span-2">
<a
class="resource flex"
[routerLink]="['characters']"
>
Characters
</a>
</li>
<li class="col-span-2">
<a
class="resource flex"
[routerLink]="['houses']"
>
Houses
</a>
</li>
</ul>
</main>

<h2>Description</h2>

<router-outlet></router-outlet>




<main>
<h2>Next Steps</h2>
<p>Here are some things you can do with Nx.</p>
<details open>
<summary>Add UI library</summary>
<pre>
# Generate UI lib
ng g @nrwl/angular:lib ui

# Add a component
ng g @nrwl/angular:component xyz --project ui</pre
>
</details>
<details>
<summary>View dependency graph</summary>
<pre>nx dep-graph</pre>
</details>
<details>
<summary>Run affected commands</summary>
<pre>
# see what's been affected by changes
ng affected:dep-graph

# run tests for current changes
ng affected:test

# run e2e tests for current changes
ng affected:e2e
</pre
>
</details>
</main>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'sw-root',
selector: 'got-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'Star Wars';
title = 'Game Of Thrones';
}
File renamed without changes.
26 changes: 26 additions & 0 deletions apps/got-demo/src/app/app.routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { RouterModule, Routes } from "@angular/router";
import { NgModule } from "@angular/core";
import { HousesComponent } from './houses/houses.component';
import { CharactersComponent } from './characters/characters.component';
import { BooksComponent } from './books/books.component';

export const appRoutes: Routes = [
{
path: "books",
component: BooksComponent,
}, {
path: "characters",
component: CharactersComponent,
}, {
path: "houses",
component: HousesComponent,
}
];

@NgModule({
imports: [RouterModule.forRoot(appRoutes, { initialNavigation: 'enabled' })],
exports: [RouterModule]
})
export class AppRoutingModule { }

export const ROUTER_COMPONENTS = [BooksComponent, CharactersComponent, HousesComponent];
1 change: 1 addition & 0 deletions apps/got-demo/src/app/books/books.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>books works!</p>
15 changes: 15 additions & 0 deletions apps/got-demo/src/app/books/books.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'got-books',
templateUrl: './books.component.html',
styleUrls: ['./books.component.css']
})
export class BooksComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
1 change: 1 addition & 0 deletions apps/got-demo/src/app/characters/characters.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>characters works!</p>
15 changes: 15 additions & 0 deletions apps/got-demo/src/app/characters/characters.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'got-characters',
templateUrl: './characters.component.html',
styleUrls: ['./characters.component.css']
})
export class CharactersComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
1 change: 1 addition & 0 deletions apps/got-demo/src/app/houses/houses.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>houses works!</p>
15 changes: 15 additions & 0 deletions apps/got-demo/src/app/houses/houses.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'got-houses',
templateUrl: './houses.component.html',
styleUrls: ['./houses.component.css']
})
export class HousesComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>StarWars</title>
<title>GotDemo</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<sw-root></sw-root>
<got-root></got-root>
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions apps/got-demo/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "got", "camelCase"],
"component-selector": [true, "element", "got", "kebab-case"]
},
"linterOptions": {
"exclude": ["!**/*"]
}
}
Loading

0 comments on commit 5d491d7

Please sign in to comment.