Skip to content

Commit

Permalink
feat: init nx-starter workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
seantrane committed Feb 16, 2019
1 parent f4d367e commit 8d63825
Show file tree
Hide file tree
Showing 65 changed files with 21,332 additions and 0 deletions.
175 changes: 175 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "",
"projects": {
"nxsweb": {
"root": "apps/nxsweb/",
"sourceRoot": "apps/nxsweb/src",
"projectType": "application",
"prefix": "apps/nxsweb",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/nxsweb",
"index": "apps/nxsweb/src/index.html",
"main": "apps/nxsweb/src/main.ts",
"polyfills": "apps/nxsweb/src/polyfills.ts",
"tsConfig": "apps/nxsweb/tsconfig.app.json",
"assets": [
"apps/nxsweb/src/favicon.ico",
"apps/nxsweb/src/assets",
{
"glob": "**/*",
"input": "apps/nxsweb/src/_rootfiles",
"output": "/"
}
],
"styles": [
"apps/nxsweb/src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/nxsweb/src/environments/environment.ts",
"with": "apps/nxsweb/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "nxsweb:build"
},
"configurations": {
"production": {
"browserTarget": "nxsweb:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "nxsweb:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "apps/nxsweb/src/test.ts",
"polyfills": "apps/nxsweb/src/polyfills.ts",
"tsConfig": "apps/nxsweb/tsconfig.spec.json",
"karmaConfig": "apps/nxsweb/karma.conf.js",
"codeCoverage": true,
"sourceMap": true,
"styles": [
"apps/nxsweb/src/styles.scss"
],
"scripts": [],
"assets": [
"apps/nxsweb/src/favicon.ico",
"apps/nxsweb/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/nxsweb/tsconfig.app.json",
"apps/nxsweb/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"nxsweb-e2e": {
"root": "apps/nxsweb-e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "apps/nxsweb-e2e/protractor.conf.js",
"devServerTarget": "nxsweb:serve"
},
"configurations": {
"production": {
"devServerTarget": "nxsweb:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "apps/nxsweb-e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"nxsui": {
"root": "libs/nxsui",
"sourceRoot": "libs/nxsui/src",
"projectType": "library",
"prefix": "libs/nxsui",
"architect": {
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "libs/nxsui/src/test.ts",
"tsConfig": "libs/nxsui/tsconfig.spec.json",
"karmaConfig": "libs/nxsui/karma.conf.js",
"codeCoverage": true,
"sourceMap": true
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/nxsui/tsconfig.lib.json",
"libs/nxsui/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"cli": {
"warnings": {
"typescriptMismatch": false,
"versionMismatch": false
},
"defaultCollection": "@nrwl/schematics"
},
"defaultProject": "nxsweb"
}
1 change: 1 addition & 0 deletions apps/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

31 changes: 31 additions & 0 deletions apps/nxsweb-e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
chromeOptions: {
args: ['--headless', '--no-sandbox']
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
14 changes: 14 additions & 0 deletions apps/nxsweb-e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AppPage } from './app.po';

describe('workspace-project App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to nxsweb!');
});
});
11 changes: 11 additions & 0 deletions apps/nxsweb-e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
}

getParagraphText() {
return element(by.css('nxsweb-root h1')).getText();
}
}
13 changes: 13 additions & 0 deletions apps/nxsweb-e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc/apps/nxsweb-e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
9 changes: 9 additions & 0 deletions apps/nxsweb/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For IE 9-11 support, please uncomment the last line of the file and adjust as needed
> 0.5%
last 2 versions
Firefox ESR
not dead
# IE 9-11
16 changes: 16 additions & 0 deletions apps/nxsweb/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

const { join } = require('path');
const getBaseKarmaConfig = require('../../karma.conf');

module.exports = function(config) {
const baseConfig = getBaseKarmaConfig();
config.set({
...baseConfig,
coverageIstanbulReporter: {
...baseConfig.coverageIstanbulReporter,
dir: join(__dirname, '../../coverage/apps/nxsweb')
}
});
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/nxsweb/src/_rootfiles/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/nxsweb/src/_rootfiles/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#126da0</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added apps/nxsweb/src/_rootfiles/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/nxsweb/src/_rootfiles/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/nxsweb/src/_rootfiles/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/nxsweb/src/_rootfiles/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/nxsweb/src/_rootfiles/nx-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/nxsweb/src/_rootfiles/og-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions apps/nxsweb/src/_rootfiles/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions apps/nxsweb/src/_rootfiles/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Nx Starter",
"short_name": "Nx Starter",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
15 changes: 15 additions & 0 deletions apps/nxsweb/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div style="text-align:center">
<h1>Welcome to the {{title}} website!</h1>
<img width="300" src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png" alt="Nrwl Nx logo">
</div>

<h2>This is an Angular CLI app built with Nrwl Nx!</h2>

An open source toolkit for enterprise Angular applications.

Nx is designed to help you create and build enterprise grade Angular applications. It provides an opinionated approach to application project structure and patterns.

<h2>Quick Start & Documentation</h2>

<a href="https://nrwl.io/nx">Watch a 5-minute video on how to get started with Nx.</a>
<router-outlet></router-outlet>
1 change: 1 addition & 0 deletions apps/nxsweb/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Place all 'nxsweb-root' context styles here
36 changes: 36 additions & 0 deletions apps/nxsweb/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { RouterTestingModule } from '@angular/router/testing';

import { appMetadata } from './app.metadata';

describe('appMetadata', () => {
it(`should contain 'Nx Workspace Starter Kit' in the title`, async(() => {
expect(appMetadata.title).toContain('Nx Workspace Starter Kit');
}));
});

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent]
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should contain '${appMetadata.title}' in the title`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toContain(appMetadata.title);
}));
it('should render title in an h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain(appMetadata.title);
}));
});
Loading

0 comments on commit 8d63825

Please sign in to comment.