Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 34bfaba

Browse files
committed
fix aot examples
1 parent f5c95ae commit 34bfaba

File tree

14 files changed

+156
-21
lines changed

14 files changed

+156
-21
lines changed

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function runProtractorAoT(appDir, outputFile) {
338338
promise = promise.then(() =>
339339
spawnExt('node', [copyFileCmd], { cwd: appDir }).promise );
340340
}
341-
var aotRunSpawnInfo = spawnExt('npm', ['run', 'serve:e2e', 'aot', '--', '-s'], { cwd: appDir });
341+
var aotRunSpawnInfo = spawnExt('npm', ['run', 'serve:aot'], { cwd: appDir });
342342
return runProtractor(promise, appDir, aotRunSpawnInfo, outputFile);
343343
}
344344

public/docs/_examples/_boilerplate/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"build:cli": "ng build --no-progress",
2424
"serve:cli": "http-server dist/",
2525
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
26-
"serve:aot": "lite-server -c aot/bs-config.json",
26+
"serve:aot": "lite-server -c bs-config.aot.json",
2727
"start:webpack": "webpack-dev-server --inline --progress --port 8080",
2828
"test:webpack": "karma start karma.webpack.conf.js",
2929
"build:webpack": "rimraf dist && webpack --config config/webpack.prod.js --bail",
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"build": "build:aot",
3-
"run": "http-server:e2e"
4-
}
2+
"build": "build:aot"
3+
}

public/docs/_examples/cb-aot-compiler/ts/rollup-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import uglify from 'rollup-plugin-uglify'
66

77
// #docregion config
88
export default {
9-
entry: 'app/main.js',
10-
dest: 'dist/build.js', // output a single application bundle
9+
entry: 'src/main.js',
10+
dest: 'src/build.js', // output a single application bundle
1111
sourceMap: false,
1212
format: 'iife',
1313
onwarn: function(warning) {

public/docs/_examples/cb-aot-compiler/ts/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
<my-app>Loading...</my-app>
1919
</body>
2020
<!-- #docregion bundle -->
21-
<script src="dist/build.js"></script>
21+
<script src="build.js"></script>
2222
<!-- #enddocregion bundle -->
2323
</html>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
import { platformBrowser } from '@angular/platform-browser';
3-
import { AppModuleNgFactory } from '../aot/app/app.module.ngfactory';
3+
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';
44

55
console.log('Running AOT compiled');
66
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);

public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
},
1313

1414
"files": [
15-
"app/app.module.ts",
16-
"app/main.ts"
15+
"src/app/app.module.ts",
16+
"src/main.ts"
1717
],
1818

1919
"angularCompilerOptions": {

public/docs/_examples/toh-6/ts/aot/bs-config.json

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/* #docregion , quickstart, toh */
2+
/* Master Styles */
3+
h1 {
4+
color: #369;
5+
font-family: Arial, Helvetica, sans-serif;
6+
font-size: 250%;
7+
}
8+
h2, h3 {
9+
color: #444;
10+
font-family: Arial, Helvetica, sans-serif;
11+
font-weight: lighter;
12+
}
13+
body {
14+
margin: 2em;
15+
}
16+
/* #enddocregion quickstart */
17+
body, input[text], button {
18+
color: #888;
19+
font-family: Cambria, Georgia;
20+
}
21+
/* #enddocregion toh */
22+
a {
23+
cursor: pointer;
24+
cursor: hand;
25+
}
26+
button {
27+
font-family: Arial;
28+
background-color: #eee;
29+
border: none;
30+
padding: 5px 10px;
31+
border-radius: 4px;
32+
cursor: pointer;
33+
cursor: hand;
34+
}
35+
button:hover {
36+
background-color: #cfd8dc;
37+
}
38+
button:disabled {
39+
background-color: #eee;
40+
color: #aaa;
41+
cursor: auto;
42+
}
43+
44+
/* Navigation link styles */
45+
nav a {
46+
padding: 5px 10px;
47+
text-decoration: none;
48+
margin-right: 10px;
49+
margin-top: 10px;
50+
display: inline-block;
51+
background-color: #eee;
52+
border-radius: 4px;
53+
}
54+
nav a:visited, a:link {
55+
color: #607D8B;
56+
}
57+
nav a:hover {
58+
color: #039be5;
59+
background-color: #CFD8DC;
60+
}
61+
nav a.active {
62+
color: #039be5;
63+
}
64+
65+
/* items class */
66+
.items {
67+
margin: 0 0 2em 0;
68+
list-style-type: none;
69+
padding: 0;
70+
width: 24em;
71+
}
72+
.items li {
73+
cursor: pointer;
74+
position: relative;
75+
left: 0;
76+
background-color: #EEE;
77+
margin: .5em;
78+
padding: .3em 0;
79+
height: 1.6em;
80+
border-radius: 4px;
81+
}
82+
.items li:hover {
83+
color: #607D8B;
84+
background-color: #DDD;
85+
left: .1em;
86+
}
87+
.items li.selected {
88+
background-color: #CFD8DC;
89+
color: white;
90+
}
91+
.items li.selected:hover {
92+
background-color: #BBD8DC;
93+
}
94+
.items .text {
95+
position: relative;
96+
top: -3px;
97+
}
98+
.items .badge {
99+
display: inline-block;
100+
font-size: small;
101+
color: white;
102+
padding: 0.8em 0.7em 0 0.7em;
103+
background-color: #607D8B;
104+
line-height: 1em;
105+
position: relative;
106+
left: -1px;
107+
top: -4px;
108+
height: 1.8em;
109+
margin-right: .8em;
110+
border-radius: 4px 0 0 4px;
111+
}
112+
/* #docregion toh */
113+
/* everywhere else */
114+
* {
115+
font-family: Arial, Helvetica, sans-serif;
116+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"open": false,
3+
"logLevel": "silent",
4+
"port": 8080,
5+
"server": {
6+
"baseDir": "aot",
7+
"routes": {
8+
"/node_modules": "node_modules"
9+
},
10+
"middleware": {
11+
"0": null
12+
}
13+
}
14+
}

public/docs/_examples/toh-6/ts/copy-dist-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var fs = require('fs');
33
var resources = [
44
'node_modules/core-js/client/shim.min.js',
55
'node_modules/zone.js/dist/zone.min.js',
6-
'styles.css'
6+
'src/styles.css'
77
];
88
resources.map(function(f) {
99
var path = f.split('/');

public/docs/_examples/toh-6/ts/rollup-config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@ import uglify from 'rollup-plugin-uglify'
66

77
//paths are relative to the execution path
88
export default {
9-
entry: 'app/main-aot.js',
9+
entry: 'src/main-aot.js',
1010
dest: 'aot/dist/build.js', // output a single application bundle
1111
sourceMap: true,
1212
sourceMapFile: 'aot/dist/build.js.map',
1313
format: 'iife',
14+
onwarn: function(warning) {
15+
// Skip certain warnings
16+
17+
// should intercept ... but doesn't in some rollup versions
18+
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
19+
// intercepts in some rollup versions
20+
if ( warning.indexOf("The 'this' keyword is equivalent to 'undefined'") > -1 ) { return; }
21+
22+
// console.warn everything else
23+
console.warn( warning.message );
24+
},
1425
plugins: [
1526
nodeResolve({jsnext: true, module: true}),
1627
commonjs({
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
import { platformBrowser } from '@angular/platform-browser';
33

4-
import { AppModuleNgFactory } from '../aot/app/app.module.ngfactory';
4+
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';
55

66
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);

public/docs/_examples/toh-6/ts/tsconfig-aot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
},
1616

1717
"files": [
18-
"app/app.module.ts",
19-
"app/main-aot.ts"
18+
"src/app/app.module.ts",
19+
"src/main-aot.ts"
2020
],
2121

2222
"angularCompilerOptions": {

0 commit comments

Comments
 (0)