diff --git a/.angular-cli.json b/.angular-cli.json deleted file mode 100644 index eb9f1c9c5..000000000 --- a/.angular-cli.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "project": { - "name": "angularelectron" - }, - "apps": [ - { - "root": "src", - "outDir": "dist", - "assets": [ - "assets", - "favicon.ico", - "favicon.png", - "favicon.icns", - "favicon.256x256.png" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "app", - "styles": [ - "styles.scss" - ], - "scripts": [], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } - } - ], - "e2e": { - "protractor": { - "config": "./protractor.conf.js" - } - }, - "lint": [ - { - "project": "src/tsconfig.app.json", - "exclude": "**/node_modules/**" - }, - { - "project": "src/tsconfig.spec.json", - "exclude": "**/node_modules/**" - }, - { - "project": "e2e/tsconfig.e2e.json", - "exclude": "**/node_modules/**" - } - ], - "test": { - "karma": { - "config": "./karma.conf.js" - } - }, - "defaults": { - "styleExt": "scss", - "component": {} - } -} diff --git a/.travis.yml b/.travis.yml index e3d2b94c4..e4e5e2f30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js node_js: - - "7" - - "6" + - 8 install: - npm install script: diff --git a/LICENSE.md b/LICENSE.md index 03a2105ee..344422742 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -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: diff --git a/README.md b/README.md index 68650f4f1..5f6df4699 100644 --- a/README.md +++ b/README.md @@ -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 : diff --git a/angular.json b/angular.json new file mode 100644 index 000000000..63f082d4f --- /dev/null +++ b/angular.json @@ -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" + } + } +} diff --git a/karma.conf.js b/karma.conf.js index 84b4cd5ac..74605c81d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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 }, @@ -39,6 +40,6 @@ module.exports = function (config) { logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], - singleRun: false + singleRun: true }); }; diff --git a/package.json b/package.json index 9b5f7b0ac..efe7450e6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "keywords": [ "angular", - "angular 5", + "angular 6", "electron", "typescript", "sass" @@ -21,7 +21,7 @@ "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", @@ -29,53 +29,53 @@ "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" diff --git a/src/favicon.512x512.png b/src/favicon.512x512.png new file mode 100644 index 000000000..c513ddceb Binary files /dev/null and b/src/favicon.512x512.png differ diff --git a/src/test.ts b/src/test.ts index 2f4b926c5..16317897b 100644 --- a/src/test.ts +++ b/src/test.ts @@ -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; diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index 1860d4cb2..d3092415f 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -11,7 +11,8 @@ ] }, "files": [ - "test.ts" + "test.ts", + "polyfills.ts" ], "include": [ "**/*.spec.ts", diff --git a/tsconfig.json b/tsconfig.json index a6c016bf3..c8009a032 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,8 @@ ], "lib": [ "es2017", + "es2016", + "es2015", "dom" ] } diff --git a/tslint.json b/tslint.json index 9963d6c39..d8d395663 100644 --- a/tslint.json +++ b/tslint.json @@ -18,7 +18,6 @@ "forin": true, "import-blacklist": [ true, - "rxjs", "rxjs/Rx" ], "import-spacing": true,