Skip to content

Commit

Permalink
refactor: upgrade to NodeJS 8, Angular 6, CLI 6, Electron 2.0, RxJS 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
leo6104 committed May 18, 2018
1 parent a8c2b63 commit e37efdb
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 115 deletions.
63 changes: 0 additions & 63 deletions .angular-cli.json

This file was deleted.

3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
node_js:
- "7"
- "6"
- 8
install:
- npm install
script:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2017 - Maxime GRIS
Copyright 2018 - Maxime GRIS

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Bootstrap and package your project with Angular 5(+) and Electron (Typescript +

Currently runs with:

- Angular v5.2.5
- Angular-CLI v1.6.4
- Electron v1.8.2
- Electron Builder v20.0.4
- Angular v6.0.2
- Angular-CLI v6.0.3
- Electron v2.0.1
- Electron Builder v20.13.4

With this sample, you can :

Expand Down
135 changes: 135 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-electron": {
"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/favicon.ico",
"src/favicon.png",
"src/favicon.icns",
"src/favicon.256x256.png",
"src/favicon.512x512.png"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": []
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular-electron:build"
},
"configurations": {
"production": {
"browserTarget": "angular-electron:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular-electron: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": [
"src/styles.scss"
],
"assets": [
"src/assets",
"src/favicon.ico",
"src/favicon.png",
"src/favicon.icns",
"src/favicon.256x256.png",
"src/favicon.512x512.png"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"angular-electron-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "angular-electron:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "angular-electron",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
11 changes: 6 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@
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
},
files: [
{ pattern: './src/test.ts', watched: false }

],
preprocessors: {
'./src/test.ts': ['@angular/cli']

},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'),
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
Expand All @@ -39,6 +40,6 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
singleRun: true
});
};
72 changes: 36 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"keywords": [
"angular",
"angular 5",
"angular 6",
"electron",
"typescript",
"sass"
Expand All @@ -21,61 +21,61 @@
"ng": "ng",
"start": "node hooks/environments/set_profile.js && npm-run-all -p ng:serve electron:serve",
"build": "node hooks/environments/set_profile.js && ng build && npm run electron:tsc",
"build:prod": "node hooks/environments/set_profile.js && ng build --prod && npm run electron:tsc",
"build:prod": "node hooks/environments/set_profile.js && ng build -c production && npm run electron:tsc",
"ng:serve": "ng serve -o",
"electron:tsc": "tsc main.ts",
"electron:serve": "wait-on http-get://localhost:4200/ && npm run electron:tsc && electron . --serve",
"electron:local": "npm run build:prod && electron .",
"electron:linux": "npm run build:prod && npx electron-builder build --linux",
"electron:windows": "npm run build:prod && npx electron-builder build --windows",
"electron:mac": "npm run build:prod && npx electron-builder build --mac",
"test": "karma start ./karma.conf.js",
"test": "ng test",
"pree2e:build": "webdriver-manager update --gecko false && npm run ng serve",
"pree2e:protractor": "wait-on http-get://localhost:4200/ && protractor ./protractor.conf.js",
"e2e": "npm-run-all -p -r pree2e:build pree2e:protractor"
},
"dependencies": {},
"devDependencies": {
"@angular/cli": "1.7.4",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/compiler-cli": "5.2.9",
"@angular/core": "5.2.9",
"@angular/forms": "5.2.9",
"@angular/http": "5.2.9",
"@angular/language-service": "5.2.9",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/router": "5.2.9",
"@ngx-translate/core": "9.1.1",
"@ngx-translate/http-loader": "2.0.1",
"@types/core-js": "0.9.36",
"@types/jasmine": "2.8.6",
"@angular-devkit/build-angular": "0.6.3",
"@angular/cli": "6.0.3",
"@angular/common": "6.0.2",
"@angular/compiler": "6.0.2",
"@angular/compiler-cli": "6.0.2",
"@angular/core": "6.0.2",
"@angular/forms": "6.0.2",
"@angular/http": "6.0.2",
"@angular/language-service": "6.0.2",
"@angular/platform-browser": "6.0.2",
"@angular/platform-browser-dynamic": "6.0.2",
"@angular/router": "6.0.2",
"@ngx-translate/core": "10.0.1",
"@ngx-translate/http-loader": "3.0.1",
"@types/jasmine": "2.8.7",
"@types/jasminewd2": "2.0.3",
"@types/node": "7.0.7",
"@types/node": "8.0.58",
"codelyzer": "4.2.1",
"core-js": "2.5.5",
"cross-env": "5.1.4",
"core-js": "2.5.6",
"cross-env": "5.1.5",
"dotenv": "5.0.1",
"electron": "1.8.4",
"electron-builder": "20.8.1",
"electron": "2.0.1",
"electron-builder": "20.13.4",
"electron-reload": "1.2.2",
"fs-extra": "5.0.0",
"jasmine-core": "2.99.1",
"fs-extra": "6.0.1",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma": "2.0.2",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"karma-jasmine-html-reporter": "0.2.2",
"npm-run-all": "4.1.2",
"npx": "10.0.1",
"protractor": "5.3.1",
"karma-coverage-istanbul-reporter": "2.0.0",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.1.0",
"npm-run-all": "4.1.3",
"npx": "10.2.0",
"protractor": "5.3.2",
"replace": "0.3.0",
"rxjs": "5.5.8",
"ts-node": "4.1.0",
"tslint": "5.9.1",
"typescript": "2.6.2",
"rxjs": "6.1.0",
"ts-node": "6.0.3",
"tslint": "5.10.0",
"typescript": "2.7.2",
"wait-on": "2.1.0",
"webdriver-manager": "12.0.6",
"zone.js": "0.8.26"
Expand Down
Binary file added src/favicon.512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
import { Observable } from 'rxjs/Observable';
import { TranslateLoader, TranslateService } from '@ngx-translate/core';

declare const require: any;

Expand Down
3 changes: 2 additions & 1 deletion src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
]
},
"files": [
"test.ts"
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
Expand Down
Loading

0 comments on commit e37efdb

Please sign in to comment.