Skip to content

Commit

Permalink
Update to angular 6 (fixes #881) (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbert authored and lmmrssa committed Jun 7, 2018
1 parent be1b4a2 commit 4c401fc
Show file tree
Hide file tree
Showing 64 changed files with 262 additions and 208 deletions.
68 changes: 0 additions & 68 deletions .angular-cli.json

This file was deleted.

5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ Vagrant.configure(2) do |config|
#docker pull portainer/portainer
#sudo docker run -d -p 9000:9000 --name treehouse -v /var/run/docker.sock:/var/run/docker.sock portainer:portainer
# Install latest version of npm and node for Angular 6
add-apt-repository "deb https://deb.nodesource.com/node_8.x stretch main"
sudo apt update
sudo apt upgrade -y
# Add CouchDB Docker
sudo docker run -d -p 5984:5984 -p 5986:5986 --name planet -v /srv/data/bell:/usr/local/var/lib/couchdb -v /srv/log/bell:/usr/local/var/log/couchdb couchdb:2.1.1
# Install Angular CLI
Expand Down
151 changes: 151 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ang-bell-app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/manifest.json"
],
"styles": [
"node_modules/material-design-icons/iconfont/material-icons.css",
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true,
"ngswConfigPath": "src/ngsw-config.json",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"test": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ang-bell-app:build",
"port": 3000,
"host": "0.0.0.0"
},
"configurations": {
"production": {
"browserTarget": "ang-bell-app:build:production"
},
"test": {
"browserTarget": "ang-bell-app:build:test"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ang-bell-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"node_modules/material-design-icons/iconfont/material-icons.css",
"src/styles.scss"
],
"assets": [
"src/assets",
"src/manifest.json"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
"ang-bell-app-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "ang-bell-app:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "ang-bell-app",
"schematics": {
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:component": {
"spec": true,
"inlineStyle": false,
"inlineTemplate": false,
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
2 changes: 1 addition & 1 deletion docker/db-init/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:6.11-alpine
FROM node:8.11.2-alpine

RUN apk update ;\
apk add --no-cache bash curl git jq ca-certificates;\
Expand Down
2 changes: 1 addition & 1 deletion docker/db-init/crosscompile_db-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "Building db-init for ${ARCH}"
if [[ "${ACT}" == "install" ]]; then
apt-get update -qq
apt-get install -y curl gnupg
curl -sL https://deb.nodesource.com/setup_6.x | bash -
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs build-essential ${PACKAGES}
npm install "--arch=${TRIPLE}" -g add-cors-to-couchdb
else
Expand Down
2 changes: 1 addition & 1 deletion docker/planet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:6.11-alpine as builder
FROM node:8.11.2-alpine as builder
LABEL maintainer="[email protected],[email protected]"

WORKDIR /ng-app
Expand Down
4 changes: 2 additions & 2 deletions docker/planet/crosscompile_planet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ if [[ "${ACT}" == "install" ]]; then
echo "Install stage"
apt-get update -qq
apt-get install -y curl gnupg
curl -sL https://deb.nodesource.com/setup_6.x | bash -
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs build-essential ${PACKAGES}
npm install "--arch=${TRIPLE}"
elif [[ "${ACT}" == "build" ]]; then
echo "Build the angular app in production mode stage"
$(npm bin)/ng build "--arch=${TRIPLE}" --prod
$(npm bin)/ng build --prod
else
echo "Error: No action Specified"
fi
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
Expand Down
45 changes: 23 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,44 @@
"v-test": "vagrant ssh -- -t 'cd /vagrant;ng test'",
"htmlhint": "./node_modules/htmlhint-ng2/bin/htmlhint --config .htmlhintrc",
"sass-lint": "./node_modules/sass-lint/bin/sass-lint.js -c ./sass-lint.yml -v -q",
"lint": "ng lint --type-check",
"lint-all": "npm run sass-lint && ng lint --type-check && npm run htmlhint",
"lint": "ng lint ang-bell-app --type-check",
"lint-all": "npm run sass-lint && ng lint ang-bell-app --type-check && npm run htmlhint",
"v-lint": "vagrant ssh -- -t 'cd /vagrant;npm run lint -s'",
"v-lint-fix": "vagrant ssh -- -t 'cd /vagrant;ng lint --fix --type-check'",
"v-lint-fix": "vagrant ssh -- -t 'cd /vagrant;ng lint ang-bell-app --fix --type-check'",
"e2e": "ng e2e --environment test",
"v-e2e": "vagrant ssh -- -t 'cd /vagrant;ng e2e --environment test'",
"install-hooks": "cp -a git-hooks/. .git/hooks/"
},
"private": true,
"dependencies": {
"@angular/animations": "5.2.5",
"@angular/cdk": "^5.0.4",
"@angular/common": "5.2.5",
"@angular/compiler": "5.2.5",
"@angular/core": "5.2.5",
"@angular/forms": "5.2.5",
"@angular/material": "^5.0.4",
"@angular/platform-browser": "5.2.5",
"@angular/platform-browser-dynamic": "5.2.5",
"@angular/platform-server": "5.2.5",
"@angular/router": "5.2.5",
"@angular/service-worker": "^5.2.1",
"@angular/animations": "6.0.3",
"@angular/cdk": "^6.0.0",
"@angular/common": "6.0.3",
"@angular/compiler": "6.0.3",
"@angular/core": "6.0.3",
"@angular/forms": "6.0.3",
"@angular/material": "^6.0.0",
"@angular/platform-browser": "6.0.3",
"@angular/platform-browser-dynamic": "6.0.3",
"@angular/platform-server": "6.0.3",
"@angular/router": "6.0.3",
"@angular/service-worker": "6.0.3",
"@types/cropperjs": "^1.1.2",
"core-js": "^2.5.1",
"cropperjs": "^1.3.4",
"jszip": "^3.1.5",
"material-design-icons": "^3.0.1",
"material-icons": "^0.1.0",
"mime-types": "^2.1.17",
"mime": "^2.3.1",
"ngx-img": "^10.15.0",
"rxjs": "5.5.2",
"zone.js": "^0.8.18"
"rxjs": "^6.2.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular/cli": "1.7.0",
"@angular/compiler-cli": "5.2.5",
"@angular/language-service": "5.2.5",
"@angular-devkit/build-angular": "~0.6.6",
"@angular/cli": "^6.0.7",
"@angular/compiler-cli": "6.0.3",
"@angular/language-service": "6.0.3",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
Expand All @@ -69,6 +70,6 @@
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"tslint-eslint-rules": "^4.1.1",
"typescript": "~2.6.2"
"typescript": "2.7.2"
}
}
3 changes: 1 addition & 2 deletions src/app/community/community.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { CouchService } from '../shared/couchdb.service';
import { DialogsPromptComponent } from '../shared/dialogs/dialogs-prompt.component';
import { MatTableDataSource, MatPaginator, MatDialog, MatSort } from '@angular/material';
import { switchMap, map } from 'rxjs/operators';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { of } from 'rxjs/observable/of';
import { forkJoin, of } from 'rxjs';
import { findDocuments } from '../shared/mangoQueries';
import { filterSpecificFields, composeFilterFunctions, filterDropdowns } from '../shared/table-helpers';
import { DialogsViewComponent } from '../shared/dialogs/dialogs-view.component';
Expand Down
2 changes: 1 addition & 1 deletion src/app/configuration/configuration-guard.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { CouchService } from '../shared/couchdb.service';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

@Injectable()
Expand Down
Loading

0 comments on commit 4c401fc

Please sign in to comment.