Skip to content

Commit

Permalink
feat(test-bed): add test-bed project to test experimental components …
Browse files Browse the repository at this point in the history
…or new features (Teradata#1186)
  • Loading branch information
emoralesb05 authored Jul 5, 2018
1 parent 3149b68 commit 51f7386
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 0 deletions.
67 changes: 67 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"newProjectRoot": "projects",
"defaultProject": "covalent-docs",
"projects": {
"covalent-docs": {
"root": "",
Expand Down Expand Up @@ -124,6 +125,72 @@
}
}
}
},
"covalent-test-bed": {
"root": "",
"projectType": "application",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/covalent-test-bed",
"index": "src/test-bed/index.html",
"main": "src/test-bed/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
{
"glob": "favicon.ico",
"input": "src",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
],
"styles": [
"src/styles.scss",
"src/theme.scss"
],
"scripts": [
"node_modules/hammerjs/hammer.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "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": "covalent-test-bed:build"
},
"configurations": {
"production": {
"browserTarget": "covalent-test-bed:build:production"
}
}
}
}
}
},
"schematics": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"coverage:mac": "open -a \"Google Chrome\" coverage/index.html",
"coveralls": "cat ./coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js",
"serve": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng serve",
"serve:test-bed": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng serve covalent-test-bed",
"serve:prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng serve --aot --prod --source-map=false --optimization",
"build:docs": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --aot --prod --source-map=false --optimization",
"build:lib": "bash scripts/build-release && gulp version-placeholder",
Expand Down
7 changes: 7 additions & 0 deletions src/test-bed/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// The file for the current environment will overwrite this one during build
// Different environments can be found in config/environment.{dev|prod}.ts
// The build system defaults to the dev environment

export const environment: {production: boolean} = {
production: false,
};
11 changes: 11 additions & 0 deletions src/test-bed/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test Bed</title>
<base href="/">
</head>
<body>
<test-bed>Loading...</test-bed>
</body>
</html>
10 changes: 10 additions & 0 deletions src/test-bed/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from '../environments/environment';
import { TestBedModule } from './test-bed.module';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(TestBedModule);
20 changes: 20 additions & 0 deletions src/test-bed/test-bed.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { TestBedComponent } from './test-bed/test-bed.component';

@NgModule({
declarations: [TestBedComponent],
imports: [
BrowserModule,
CommonModule,
BrowserAnimationsModule,
FormsModule,
/** Experimental Modules */
],
bootstrap: [TestBedComponent],
})
export class TestBedModule { }
1 change: 1 addition & 0 deletions src/test-bed/test-bed/test-bed.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h3>Test Bed</h3>
Empty file.
10 changes: 10 additions & 0 deletions src/test-bed/test-bed/test-bed.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'test-bed',
templateUrl: './test-bed.component.html',
styleUrls: ['./test-bed.component.scss'],
})
export class TestBedComponent {

}

0 comments on commit 51f7386

Please sign in to comment.