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

Commit cdfe957

Browse files
thelgevoldwardbell
authored andcommitted
docs(toh-6-aot): add aot to toh-6 (#2496)
* docs(toh-6-aot): add aot to toh-6 s s s s s * docs(toh-6-aot): add aot to toh-6 * docs(toh-6-aot): make aot e2e tests run in the same project Updates tooling for this purpose and also the prose.
1 parent 2e17d58 commit cdfe957

File tree

21 files changed

+335
-32
lines changed

21 files changed

+335
-32
lines changed

gulpfile.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ function runE2eTsTests(appDir, outputFile) {
296296
var appBuildSpawnInfo = spawnExt('npm', ['run', config.build], { cwd: appDir });
297297
var appRunSpawnInfo = spawnExt('npm', ['run', config.run, '--', '-s'], { cwd: appDir });
298298

299-
return runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
299+
var run = runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
300+
301+
if (fs.existsSync(appDir + '/aot/index.html')) {
302+
run = run.then(() => runProtractorAoT(appDir, outputFile));
303+
}
304+
return run;
300305
}
301306

302307
function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
@@ -341,6 +346,20 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
341346
}
342347
}
343348

349+
function runProtractorAoT(appDir, outputFile) {
350+
fs.appendFileSync(outputFile, '++ AoT version ++\n');
351+
var aotBuildSpawnInfo = spawnExt('npm', ['run', 'build:aot'], { cwd: appDir });
352+
var promise = aotBuildSpawnInfo.promise;
353+
354+
var copyFileCmd = 'copy-dist-files.js';
355+
if (fs.existsSync(appDir + '/' + copyFileCmd)) {
356+
promise = promise.then(() =>
357+
spawnExt('node', [copyFileCmd], { cwd: appDir }).promise );
358+
}
359+
var aotRunSpawnInfo = spawnExt('npm', ['run', 'http-server:e2e', 'aot', '--', '-s'], { cwd: appDir });
360+
return runProtractor(promise, appDir, aotRunSpawnInfo, outputFile);
361+
}
362+
344363
// start the server in appDir/build/web; then run protractor with the specified
345364
// fileName; then shut down the example. All protractor output is appended
346365
// to the outputFile.
@@ -883,7 +902,7 @@ function harpCompile() {
883902
gutil.log("NODE_ENV: " + process.env.NODE_ENV);
884903

885904
if(argv.page) harpJsonSetJade2NgTo(true);
886-
905+
887906
if(skipLangs && fs.existsSync(WWW) && backupApiHtmlFilesExist(WWW)) {
888907
gutil.log(`Harp site recompile: skipping recompilation of API docs for [${skipLangs}]`);
889908
gutil.log(`API docs will be copied from existing ${WWW} folder.`)

public/docs/_examples/_boilerplate/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"http-server:e2e": "http-server",
1010
"http-server:cli": "http-server dist/",
1111
"lite": "lite-server",
12+
"lite:aot": "lite-server -c aot/bs-config.json",
1213
"postinstall": "typings install",
1314
"test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
1415
"tsc": "tsc",
@@ -17,7 +18,8 @@
1718
"test:webpack": "karma start karma.webpack.conf.js",
1819
"build:webpack": "rimraf dist && webpack --config config/webpack.prod.js --bail",
1920
"build:cli": "ng build",
20-
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup.js",
21+
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
22+
"copy-dist-files": "node ./copy-dist-files.js",
2123
"i18n": "ng-xi18n"
2224
},
2325
"keywords": [],

public/docs/_examples/_boilerplate/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
"noImplicitAny": true,
1111
"suppressImplicitAnyIndexErrors": true,
1212
"types": []
13-
}
13+
},
14+
"exclude": [
15+
"node_modules/*",
16+
"**/*-aot.ts"
17+
]
1418
}

public/docs/_examples/cb-aot-compiler/ts/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
**/*.metadata.json
33
dist
44
!app/tsconfig.json
5-
!rollup.js
5+
!rollup-config.js

public/docs/_examples/cb-aot-compiler/ts/app/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ export class AppComponent {
1313
toggleHeading() {
1414
this.showHeading = !this.showHeading;
1515
}
16-
1716
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<script src="node_modules/core-js/client/shim.min.js"></script>
1111
<script src="node_modules/zone.js/dist/zone.js"></script>
12-
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1312

1413
</head>
1514

public/docs/_examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"raw-loader": "^0.5.1",
7575
"rimraf": "^2.5.4",
7676
"rollup-plugin-commonjs": "^4.1.0",
77+
"source-map-explorer": "^1.3.2",
7778
"style-loader": "^0.13.1",
7879
"ts-loader": "^0.8.2",
7980
"ts-node": "^1.3.0",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
**/*.js
2+
aot/**/*.ts
3+
!rollup-config.js
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"port": 8000,
3+
"files": ["./aot/**/*.{html,htm,css,js}"],
4+
"server": { "baseDir": "./aot" }
5+
}

0 commit comments

Comments
 (0)