Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit eda12c3

Browse files
CaerusKaruThomasBurleson
authored andcommitted
feat(demo-app): use Angular CLI to build demo and universal apps
* Add CLI functionality to demo-app and universal-app * Update CI tasks to use the CLI instead of building manually
1 parent de72903 commit eda12c3

File tree

228 files changed

+34627
-2729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+34627
-2729
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# compiled output
4-
/dist
4+
dist
55
/tmp
66
/deploy
77
/screenshots

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"lib:lint": "gulp lint",
1919
"lib:test": "gulp test",
2020
"lib:test:ssr": "gulp test:ssr",
21-
"universal:build": "gulp universal:build",
22-
"universal:ci:prerender": "gulp ci:prerender"
21+
"universal:build": "gulp ci:prerender"
2322
},
2423
"version": "2.0.0-beta.12",
2524
"license": "MIT",

src/apps/demo-app/.angular-cli.json

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "demo-app"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist/browser",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "demo",
21+
"styles": [
22+
"styles.scss"
23+
],
24+
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
26+
"environments": {
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
},
31+
{
32+
"root": "src",
33+
"outDir": "dist/server",
34+
"assets": [
35+
"assets",
36+
"favicon.ico"
37+
],
38+
"index": "index.html",
39+
"main": "main.server.ts",
40+
"test": "test.ts",
41+
"tsconfig": "tsconfig.server.json",
42+
"testTsconfig": "tsconfig.spec.json",
43+
"prefix": "demo",
44+
"styles": [
45+
"styles.scss"
46+
],
47+
"scripts": [],
48+
"environmentSource": "environments/environment.ts",
49+
"environments": {
50+
"dev": "environments/environment.ts",
51+
"prod": "environments/environment.prod.ts"
52+
},
53+
"platform": "server"
54+
}
55+
],
56+
"e2e": {
57+
"protractor": {
58+
"config": "./protractor.conf.js"
59+
}
60+
},
61+
"lint": [
62+
{
63+
"project": "src/tsconfig.app.json",
64+
"exclude": "**/node_modules/**"
65+
},
66+
{
67+
"project": "src/tsconfig.spec.json",
68+
"exclude": "**/node_modules/**"
69+
},
70+
{
71+
"project": "e2e/tsconfig.e2e.json",
72+
"exclude": "**/node_modules/**"
73+
}
74+
],
75+
"test": {
76+
"karma": {
77+
"config": "./karma.conf.js"
78+
}
79+
},
80+
"defaults": {
81+
"styleExt": "scss",
82+
"component": {}
83+
}
84+
}

src/apps/demo-app/.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

src/apps/demo-app/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# DemoApp
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.6.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

src/apps/demo-app/e2e/app.e2e-spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('demo-app App', () => {
4+
let page: AppPage;
5+
6+
beforeEach(() => {
7+
page = new AppPage();
8+
});
9+
10+
it('should display welcome message', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('Welcome to demo!');
13+
});
14+
});

src/apps/demo-app/e2e/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('demo-root h1')).getText();
10+
}
11+
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"baseUrl": "./",
6+
"module": "commonjs",
7+
"target": "es5",
8+
"types": [
9+
"jasmine",
10+
"jasminewd2",
11+
"node"
12+
]
13+
}
14+
}

src/apps/demo-app/karma.conf.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular/cli'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
14+
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
reports: [ 'html', 'lcovonly' ],
20+
fixWebpackSourcePaths: true
21+
},
22+
angularCli: {
23+
environment: 'dev'
24+
},
25+
reporters: ['progress', 'kjhtml'],
26+
port: 9876,
27+
colors: true,
28+
logLevel: config.LOG_INFO,
29+
autoWatch: true,
30+
browsers: ['Chrome'],
31+
singleRun: false
32+
});
33+
};

0 commit comments

Comments
 (0)