Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
milansismanovic committed Sep 16, 2019
1 parent 0c0359c commit 2e5dbc8
Show file tree
Hide file tree
Showing 21 changed files with 1,166 additions and 95 deletions.
12 changes: 12 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ExpandedNodes": [
"",
"\\apps",
"\\apps\\ch-maker-quiz",
"\\apps\\ch-maker-quiz\\src",
"\\apps\\ch-maker-quiz\\src\\app",
"\\libs"
],
"SelectedNode": "\\apps\\ch-maker-quiz\\src\\app\\app.component.ts",
"PreviewInSolutionExplorer": false
}
1,027 changes: 1,027 additions & 0 deletions .vs/milan-nx/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added .vs/milan-nx/v16/.suo
Binary file not shown.
Binary file added .vs/slnx.sqlite
Binary file not shown.
31 changes: 31 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,37 @@
}
}
}
},
"ui": {
"projectType": "library",
"root": "libs/ui",
"sourceRoot": "libs/ui/src",
"prefix": "milan-nx",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/ui/tsconfig.lib.json",
"libs/ui/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!libs/ui/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/ui/jest.config.js",
"tsConfig": "libs/ui/tsconfig.spec.json",
"setupFile": "libs/ui/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
}
},
"cli": {
Expand Down
1 change: 1 addition & 0 deletions apps/ch-maker-quiz-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const getGreeting = () => cy.get('h1');

94 changes: 3 additions & 91 deletions apps/ch-maker-quiz/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,10 @@
<img
alt="Nx logo"
width="75"
src="https://nx.dev/assets/images/nx-logo-white.svg"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Coat_of_arms_of_Switzerland.svg/2000px-Coat_of_arms_of_Switzerland.svg.png"
/>
<h1>Welcome to {{ title }}!</h1>
<h1>{{ title }}</h1>
</header>
<main>
<h2>Resources &amp; Tools</h2>
<p>
Thank you for using and showing some ♥ for Nx.
</p>
<div class="flex github-star-container">
<a
href="https://github.com/nrwl/nx"
target="_blank"
rel="noopener noreferrer"
>
If you like Nx, please give it a star:
<div class="github-star-badge">
<svg
class="material-icons"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
/>
</svg>
Star
</div>
</a>
</div>
<p>
Here are some links to help you get started.
</p>
<ul class="resources">
<li class="col-span-2">
<a
class="resource flex"
href="https://nx.dev/angular/getting-started/what-is-nx"
>
Nx video tutorial
</a>
</li>
<li class="col-span-2">
<a
class="resource flex"
href="https://nx.dev/angular/tutorial/01-create-application"
>
Interactive tutorial
</a>
</li>
<li class="col-span-2">
<a class="resource flex" href="https://connect.nrwl.io/">
<img
height="36"
alt="Nrwl Connect"
src="https://connect.nrwl.io/assets/img/CONNECT_ColorIcon.png"
/>
<span class="gutter-left">Nrwl Connect</span>
</a>
</li>
</ul>
<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>
4 changes: 2 additions & 2 deletions apps/ch-maker-quiz/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ describe('AppComponent', () => {
it(`should have as title 'ch-maker-quiz'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('ch-maker-quiz');
expect(app.title).toEqual('Das Schweizermacher Quiz');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain(
'Welcome to ch-maker-quiz!'
'Das Schweizermacher Quiz'
);
});
});
2 changes: 1 addition & 1 deletion apps/ch-maker-quiz/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'ch-maker-quiz';
title = 'Das Schweizermacher Quiz';
}
7 changes: 7 additions & 0 deletions libs/ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ui

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test ui` to execute the unit tests.
9 changes: 9 additions & 0 deletions libs/ui/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
name: 'ui',
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/ui',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js'
]
};
1 change: 1 addition & 0 deletions libs/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/ui.module';
14 changes: 14 additions & 0 deletions libs/ui/src/lib/ui.module.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { async, TestBed } from '@angular/core/testing';
import { UiModule } from './ui.module';

describe('UiModule', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [UiModule]
}).compileComponents();
}));

it('should create', () => {
expect(UiModule).toBeDefined();
});
});
7 changes: 7 additions & 0 deletions libs/ui/src/lib/ui.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
imports: [CommonModule]
})
export class UiModule {}
1 change: 1 addition & 0 deletions libs/ui/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular';
7 changes: 7 additions & 0 deletions libs/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
20 changes: 20 additions & 0 deletions libs/ui/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": ["src/test-setup.ts", "**/*.spec.ts"]
}
10 changes: 10 additions & 0 deletions libs/ui/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
7 changes: 7 additions & 0 deletions libs/ui/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "milanNx", "camelCase"],
"component-selector": [true, "element", "milan-nx", "kebab-case"]
}
}
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"ch-maker-quiz": {
"tags": []
},
"ui": {
"tags": []
}
}
}
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {}
"paths": {
"@milan-nx/ui": ["libs/ui/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
}

0 comments on commit 2e5dbc8

Please sign in to comment.