Skip to content

Commit c33c3c3

Browse files
authored
chore(build): add manual build verifier for Angular 5.0 (#1294)
* chore(deps): upgrade typescript * chore(build): add manual build verifier for Angular 5.0
1 parent 4a21857 commit c33c3c3

21 files changed

+5414
-0
lines changed

test/ng-build/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd ng5 && ng build --prod

test/ng-build/index.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const fs = require('fs');
2+
const { spawn, spawnSync } = require('child_process');
3+
const ng5Pkg = require('./ng5/package.json');
4+
const pkg = require('../../package.json');
5+
const shell = require('shelljs');
6+
7+
const PACKAGED_VERSION = `angularfire2-${pkg.version}.tgz`;
8+
9+
function packageAngularFire() {
10+
console.log(`------------ PACKAGING VERSION ${PACKAGED_VERSION} ------------`);
11+
const res = spawnSync('sh', ['pack.sh']);
12+
console.log(`------------ FINISHED PACKAGING VERSION ${PACKAGED_VERSION} ------------`);
13+
console.log(`------------ INSTALLING VERSION ${PACKAGED_VERSION} ------------`);
14+
if (shell.exec(`cd ng5 && npm i firebase ../${PACKAGED_VERSION}`).code !== 0) {
15+
shell.echo('Error');
16+
shell.exit(1);
17+
}
18+
console.log(`------------ FINISHED INSTALLING VERSION ${PACKAGED_VERSION} ------------`);
19+
buildVersion5();
20+
}
21+
22+
function buildVersion5() {
23+
console.log(`------------ BUILDING VERSION ${ng5Pkg.dependencies['@angular/core']} ------------`);
24+
const cmd = spawn('sh', ['build.sh']);
25+
cmd.stdout.on('data', (data) => {
26+
console.log(data.toString('utf8'));
27+
});
28+
cmd.stderr.on('data', (data) => {
29+
console.log(data.toString('utf8'));
30+
});
31+
cmd.on('close', () => {
32+
try {
33+
const dir = fs.readdirSync(__dirname + '/ng5/dist');
34+
console.log(dir);
35+
console.log(`------------ SUCCESS VERSION ${ng5Pkg.dependencies['@angular/core']} ------------`);
36+
} catch (e) {
37+
console.log(`------------ FAIL VERSION ${ng5Pkg.dependencies['@angular/core']} ------------`);
38+
console.log(e);
39+
throw new Error('ng build failed');
40+
}
41+
});
42+
}
43+
44+
packageAngularFire();
45+
//buildVersion5();

test/ng-build/ng5/.angular-cli.json

Lines changed: 84 additions & 0 deletions
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": "ng5"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
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": "app",
21+
"styles": [
22+
"styles.css"
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+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json",
40+
"exclude": "**/node_modules/**"
41+
},
42+
{
43+
"project": "src/tsconfig.spec.json",
44+
"exclude": "**/node_modules/**"
45+
},
46+
{
47+
"project": "e2e/tsconfig.e2e.json",
48+
"exclude": "**/node_modules/**"
49+
}
50+
],
51+
"test": {
52+
"karma": {
53+
"config": "./karma.conf.js"
54+
}
55+
},
56+
"defaults": {
57+
"styleExt": "css",
58+
"class": {
59+
"spec": false
60+
},
61+
"component": {
62+
"inlineStyle": true
63+
,
64+
"inlineTemplate": true
65+
,
66+
"spec": false
67+
},
68+
"directive": {
69+
"spec": false
70+
},
71+
"guard": {
72+
"spec": false
73+
},
74+
"module": {
75+
"spec": false
76+
},
77+
"pipe": {
78+
"spec": false
79+
},
80+
"service": {
81+
"spec": false
82+
}
83+
}
84+
}

test/ng-build/ng5/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/e2e/*.js
38+
/e2e/*.map
39+
40+
# System Files
41+
.DS_Store
42+
Thumbs.db

test/ng-build/ng5/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "ng5",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve",
8+
"build": "ng build",
9+
"test": "ng test",
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
12+
},
13+
"private": true,
14+
"dependencies": {
15+
"@angular/animations": "5.0.0-rc.3",
16+
"@angular/common": "5.0.0-rc.3",
17+
"@angular/compiler": "5.0.0-rc.3",
18+
"@angular/core": "5.0.0-rc.3",
19+
"@angular/forms": "5.0.0-rc.3",
20+
"@angular/http": "5.0.0-rc.3",
21+
"@angular/platform-browser": "5.0.0-rc.3",
22+
"@angular/platform-browser-dynamic": "5.0.0-rc.3",
23+
"@angular/router": "5.0.0-rc.3",
24+
"core-js": "^2.4.1",
25+
"rxjs": "^5.5.0",
26+
"zone.js": "^0.8.14"
27+
},
28+
"devDependencies": {
29+
"@angular/cli": "1.4.9",
30+
"@angular/compiler-cli": "5.0.0-rc.3",
31+
"@angular/language-service": "5.0.0-rc.3",
32+
"typescript": "~2.4.2"
33+
}
34+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Component } from '@angular/core';
2+
import { FirebaseApp } from 'angularfire2';
3+
import { AngularFireDatabase } from 'angularfire2/database';
4+
import { AngularFireAuth } from 'angularfire2/auth';
5+
import { AngularFirestore } from 'angularfire2/firestore';
6+
7+
@Component({
8+
selector: 'app-root',
9+
template: `
10+
<!--The content below is only a placeholder and can be replaced.-->
11+
<div style="text-align:center">
12+
<img width="300" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
13+
</div>
14+
<h2>Here are some links to help you start: </h2>
15+
<ul>
16+
<li>
17+
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
18+
</li>
19+
<li>
20+
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
21+
</li>
22+
<li>
23+
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
24+
</li>
25+
</ul>
26+
27+
`,
28+
styles: []
29+
})
30+
export class AppComponent {
31+
constructor(
32+
private readonly app: FirebaseApp,
33+
private readonly db: AngularFireDatabase,
34+
private readonly auth: AngularFireAuth,
35+
private readonly afStore: AngularFirestore
36+
) {
37+
console.log(app, db, auth, afStore);
38+
}
39+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
import { AngularFireModule } from 'angularfire2';
4+
import { AngularFireDatabaseModule } from 'angularfire2/database';
5+
import { AngularFireAuthModule } from 'angularfire2/auth';
6+
import { AngularFirestoreModule } from 'angularfire2/firestore';
7+
8+
import { AppComponent } from './app.component';
9+
10+
@NgModule({
11+
declarations: [
12+
AppComponent
13+
],
14+
imports: [
15+
BrowserModule,
16+
AngularFireModule.initializeApp({}),
17+
AngularFireAuthModule,
18+
AngularFireDatabaseModule,
19+
AngularFirestoreModule
20+
],
21+
providers: [],
22+
bootstrap: [AppComponent]
23+
})
24+
export class AppModule { }

test/ng-build/ng5/src/assets/.gitkeep

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// The file contents for the current environment will overwrite these during build.
2+
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3+
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4+
// The list of which env maps to which file can be found in `.angular-cli.json`.
5+
6+
export const environment = {
7+
production: false
8+
};

0 commit comments

Comments
 (0)