Commit c5e07045 authored by Matt Teeter's avatar Matt Teeter

Initial Commit

parents
Pipeline #73925 failed with stages
in 3 minutes and 51 seconds
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
include:
- project: k8s/gitlab-ci-templates
ref: master
file: eio-swe-angular-library/.gitlab-ci.yml
variables:
SONAR_ENABLED: "false"
DEMO_ENABLED: "false"
DIST_LIB: dist/libs/utils
{
"html": {
"wrap_attributes": "force"
},
"css": {
"allowed_file_extensions": ["css", "scss", "sass", "less"],
"selector_separator": " ",
"selector_separator_newline": false
},
"indent_char": " ",
"end_with_newline": true,
"indent_size": 2,
"max_preserve_newlines": 1,
"wrap_attributes": "force"
}
registry=https://nexus.ci.psu.edu/repository/npm-all/
\ No newline at end of file
*.html
*.scss
{
"singleQuote": true,
"tabWidth": 2,
"printWidth": 120
}
{
"recommendations": [
"nrwl.angular-console",
"angular.ng-template",
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode"
]
}
FROM nexus.ci.psu.edu:5000/swe/angular-app:latest
COPY dist/libs/utils ${NGINX_HTML}
# UtilsLib
This project was generated using [Nx](https://nx.dev).
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png" width="450"></p>
🔎 **Nx is a set of Angular CLI power-ups for modern development.**
## Quick Start & Documentation
[Nx Documentation](https://nx.dev)
[30-minute video showing all Nx features](https://nx.dev/getting-started/what-is-nx)
[Interactive Tutorial](https://nx.dev/tutorial/01-create-application)
## Adding capabilities to your workspace
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
These capabilities include generating applications, libraries, .etc as well as the devtools to test, and build projects as well.
Below are some plugins which you can add to your workspace:
- [Angular](https://angular.io)
- `ng add @nrwl/angular`
- [React](https://reactjs.org)
- `ng add @nrwl/react`
- Web (no framework frontends)
- `ng add @nrwl/web`
- [Nest](https://nestjs.com)
- `ng add @nrwl/nest`
- [Express](https://expressjs.com)
- `ng add @nrwl/express`
- [Node](https://nodejs.org)
- `ng add @nrwl/node`
## Generate an application
Run `ng g @nrwl/angular:app my-app` to generate an application.
> You can use any of the plugins above to generate applications as well.
When using Nx, you can create multiple applications and libraries in the same workspace.
## Generate a library
Run `ng g @nrwl/angular:lib my-lib` to generate a library.
> You can also use any of the plugins above to generate libraries as well.
Libraries are sharable across libraries and applications. They can be imported from `@utils-lib/mylib`.
## Development server
Run `ng serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng g component my-component --project=my-app` to generate a new component.
## Build
Run `ng build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test my-app` to execute the unit tests via [Jest](https://jestjs.io).
Run `npm run affected:test` to execute the unit tests affected by a change.
## Running end-to-end tests
Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).
Run `npm run affected:e2e` to execute the end-to-end tests affected by a change.
## Understand your workspace
Run `npm run dep-graph` to see a diagram of the dependencies of your projects.
## Further help
Visit the [Nx Documentation](https://nx.dev) to learn more.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "",
"projects": {
"demo": {
"projectType": "application",
"schematics": {
"@nrwl/workspace:component": {
"style": "scss"
}
},
"root": "apps/demo",
"sourceRoot": "apps/demo/src",
"prefix": "dmo",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/demo",
"index": "apps/demo/src/index.html",
"main": "apps/demo/src/main.ts",
"polyfills": "apps/demo/src/polyfills.ts",
"tsConfig": "apps/demo/tsconfig.app.json",
"assets": ["apps/demo/src/favicon.ico", "apps/demo/src/assets"],
"styles": ["apps/demo/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/demo/src/environments/environment.ts",
"with": "apps/demo/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "demo:build"
},
"configurations": {
"production": {
"browserTarget": "demo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/demo/tsconfig.app.json",
"apps/demo/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/demo/jest.config.js",
"tsConfig": "apps/demo/tsconfig.spec.json",
"setupFile": "apps/demo/src/test-setup.ts"
}
}
}
},
"demo-e2e": {
"root": "apps/demo-e2e",
"sourceRoot": "apps/demo-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/demo-e2e/cypress.json",
"tsConfig": "apps/demo-e2e/tsconfig.e2e.json",
"devServerTarget": "demo:serve"
},
"configurations": {
"production": {
"devServerTarget": "demo:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "apps/demo-e2e/tsconfig.e2e.json"
}
}
}
},
"utils": {
"projectType": "library",
"root": "libs/utils",
"sourceRoot": "libs/utils/src",
"prefix": "ut",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "libs/utils/tsconfig.lib.json",
"project": "libs/utils/ng-package.json"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/utils/tsconfig.lib.json",
"libs/utils/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/utils/jest.config.js",
"tsConfig": "libs/utils/tsconfig.spec.json",
"setupFile": "libs/utils/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
}
},
"cli": {
"warnings": {
"typescriptMismatch": false,
"versionMismatch": false
},
"defaultCollection": "@psu/schematics",
"packageManager": "yarn"
},
"schematics": {
"@nrwl/angular:application": {
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"unitTestRunner": "jest"
},
"@psu/schematics:ng-new": {
"workspaceType": "library"
}
},
"defaultProject": "demo"
}
{
"fileServerFolder": "../../dist/out-tsc/apps/demo-e2e",
"fixturesFolder": "../../dist/out-tsc/apps/demo-e2e/src/fixtures",
"integrationFolder": "../../dist/out-tsc/apps/demo-e2e/src/integration",
"pluginsFile": "../../dist/out-tsc/apps/demo-e2e/src/plugins/index.js",
"supportFile": false,
"video": true,
"videosFolder": "../../dist/out-tsc/apps/demo-e2e/videos",
"screenshotsFolder": "../../dist/out-tsc/apps/demo-e2e/screenshots",
"chromeWebSecurity": false
}
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io"
}
import { getGreeting } from "../support/app.po";
describe("demo", () => {
beforeEach(() => cy.visit("/"));
it("should display welcome message", () => {
getGreeting().contains("Welcome to demo!");
});
});
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
module.exports = (on: Cypress.Actions, config: Cypress.ConfigOptions) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
export const getGreeting = () => cy.get("h1");
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "./commands";
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc"
},
"include": ["src/**/*.ts"]
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
module.exports = {
name: "demo",
preset: "../../jest.config.js",
coverageDirectory: "../../coverage/apps/demo",
snapshotSerializers: [
"jest-preset-angular/AngularSnapshotSerializer.js",
"jest-preset-angular/HTMLCommentSerializer.js"
]
};
<div style="text-align:center">
<h1>Welcome to {{ title }}!</h1>
<img
width="450"
src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png"
/>
</div>
<p>This is an Angular app built with <a href="https://nx.dev">Nx</a>.</p>
<p>🔎 **Nx is a set of Angular CLI power-ups for modern development.**</p>
<h2>Quick Start & Documentation</h2>
<ul>
<li>
<a href="https://nx.dev/getting-started/what-is-nx"
>30-minute video showing all Nx features</a
>
</li>
<li>
<a href="https://nx.dev/tutorial/01-create-application"
>Interactive tutorial</a
>
</li>
</ul>
<router-outlet></router-outlet>
import { TestBed, async } from "@angular/core/testing";
import { AppComponent } from "./app.component";
import { RouterTestingModule } from "@angular/router/testing";
describe("AppComponent", () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent]
}).compileComponents();
}));
it("should create the app", () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'demo'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual("demo");
});
it("should render title in a h1 tag", () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector("h1").textContent).toContain(
"Welcome to demo!"
);
});
});
import { Component } from "@angular/core";
@Component({
selector: "dmo-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"]
})
export class AppComponent {
title = "demo";
}
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AppComponent } from "./app.component";
import { RouterModule } from "@angular/router";
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
RouterModule.forRoot([], { initialNavigation: "enabled" })
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}