From 29d77985ace46455a9c657943c2807ff35089d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20HOU=C3=8BL?= Date: Tue, 25 Apr 2017 22:30:00 +0200 Subject: [PATCH 1/7] Switch to AngularCli and remove all Webpack functions You can use my sample app for tests : https://github.com/stevehouel/jhipster-angularcli-app I removed all webpack configuration and dependencies and switch fully on angularly. I added also dedicated environment files for prod and dev configuration Fix #5624 --- generators/client/files-angular.js | 23 +-- .../templates/angular/_.angular-cli.json | 24 ++- .../client/templates/angular/_package.json | 94 +++------ .../templates/angular/_postcss.config.js | 21 -- .../client/templates/angular/_tsconfig.json | 5 +- .../src/main/webapp/app/_app.constants.ts | 27 --- .../angular/src/main/webapp/app/_app.main.ts | 2 + .../angular/src/main/webapp/app/_vendor.ts | 5 - .../webapp/app/blocks/config/_prod.config.ts | 6 +- .../app/layouts/navbar/_navbar.component.ts | 4 +- .../webapp/environments/_environment.prod.ts | 4 + .../main/webapp/environments/_environment.ts | 9 + .../src/test/javascript/_karma.conf.js | 187 +++++------------- .../src/test/javascript/_protractor.conf.js | 80 ++++---- .../src/test/javascript/spec/_entry.ts | 32 ++- .../angular/webpack/_webpack.common.js | 142 ------------- .../templates/angular/webpack/_webpack.dev.js | 93 --------- .../angular/webpack/_webpack.prod.js | 41 ---- .../angular/webpack/_webpack.vendor.js | 81 -------- .../angular/webpack/logo-jhipster.png | Bin 4459 -> 0 bytes generators/server/templates/_pom.xml | 10 +- 21 files changed, 196 insertions(+), 694 deletions(-) delete mode 100644 generators/client/templates/angular/_postcss.config.js delete mode 100644 generators/client/templates/angular/src/main/webapp/app/_app.constants.ts create mode 100644 generators/client/templates/angular/src/main/webapp/environments/_environment.prod.ts create mode 100644 generators/client/templates/angular/src/main/webapp/environments/_environment.ts delete mode 100644 generators/client/templates/angular/webpack/_webpack.common.js delete mode 100644 generators/client/templates/angular/webpack/_webpack.dev.js delete mode 100644 generators/client/templates/angular/webpack/_webpack.prod.js delete mode 100644 generators/client/templates/angular/webpack/_webpack.vendor.js delete mode 100644 generators/client/templates/angular/webpack/logo-jhipster.png diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js index 599ede943112..b230bbbef4ec 100644 --- a/generators/client/files-angular.js +++ b/generators/client/files-angular.js @@ -19,12 +19,7 @@ const files = { '_tsconfig.json', '_tsconfig-aot.json', '_tslint.json', - '_.angular-cli.json', - 'webpack/_webpack.common.js', - 'webpack/_webpack.dev.js', - 'webpack/_webpack.prod.js', - 'webpack/_webpack.vendor.js', - { file: 'webpack/logo-jhipster.png', method: 'copy' } + '_.angular-cli.json' ] } ], @@ -49,12 +44,6 @@ const files = { 'content/scss/_global.scss', 'content/scss/_vendor.scss' ] - }, - { - condition: generator => generator.useSass, - templates: [ - '_postcss.config.js' - ] } ], image: [ @@ -87,6 +76,15 @@ const files = { ] } ], + environments: [ + { + path: MAIN_SRC_DIR, + templates: [ + 'environments/_environment.ts', + 'environments/_environment.prod.ts' + ] + } + ], angularApp: [ { path: ANGULAR_DIR, @@ -94,7 +92,6 @@ const files = { '_app.main.ts', '_app.route.ts', '_app.module.ts', - '_app.constants.ts', '_polyfills.ts', '_vendor.ts', 'blocks/config/_prod.config.ts', diff --git a/generators/client/templates/angular/_.angular-cli.json b/generators/client/templates/angular/_.angular-cli.json index adca86dbc2fa..db68041759a9 100644 --- a/generators/client/templates/angular/_.angular-cli.json +++ b/generators/client/templates/angular/_.angular-cli.json @@ -25,16 +25,18 @@ "root": "<%= MAIN_SRC_DIR %>", "outDir": "<%= DIST_DIR %>app", "assets": [ - "content", + "content/images", <%_ if (enableTranslation) { _%> "i18n", <%_ } _%> - "favicon.ico" + "favicon.ico", + "swagger-ui", + "robots.txt" ], "index": "index.html", "main": "app/app.main.ts", "polyfills": "app/polyfills.ts", - "test": "", + "test": "./src/test/javascript/spec/entry.ts", "tsconfig": "../../../tsconfig.json", "prefix": "<%= jhiPrefix %>", "mobile": false, @@ -47,7 +49,12 @@ "content/css/global.css" <%_ } _%> ], - "scripts": [] + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } }], "addons": [], "packages": [], @@ -58,11 +65,14 @@ } }, <%_ } _%> - "lint": [{ - "project": "../../../tsconfig.json" + "lint": [ + { + "project": "tsconfig.json", + "exclude": "**/node_modules/**/*" }, { - "project": "../../../tsconfig-aot.json" + "project": "tsconfig-aot.json", + "exclude": "**/node_modules/**/*" } ], "test": { diff --git a/generators/client/templates/angular/_package.json b/generators/client/templates/angular/_package.json index bb2bad1752e8..b4b1723d18ef 100644 --- a/generators/client/templates/angular/_package.json +++ b/generators/client/templates/angular/_package.json @@ -60,98 +60,56 @@ <%_ if (protractorTests) { _%> "@types/selenium-webdriver": "2.53.39", <%_ } _%> - "add-asset-html-webpack-plugin": "1.0.2", - "angular2-template-loader": "0.6.2", - "awesome-typescript-loader": "3.1.2", - "browser-sync": "2.18.8", - "browser-sync-webpack-plugin": "1.1.4", "codelyzer": "2.1.1", - "copy-webpack-plugin": "4.0.0", - "css-loader": "0.28.0", - "del": "2.2.2", - "event-stream": "3.3.4", - "exports-loader": "0.6.4", - "extract-text-webpack-plugin": "2.1.0", - "file-loader": "0.11.1", - "generator-jhipster": "<%= packagejs.version %>", - "html-loader": "0.4.5", - "html-webpack-plugin": "2.28.0", "jasmine-core": "2.5.2", <%_ if (protractorTests) { _%> - "jasmine-reporters": "2.2.1", + "jasmine-spec-reporter": "3.2.0", + "protractor": "5.1.1", + "protractor-jasmine2-screenshot-reporter": "0.3.5", + "ts-node": "2.1.0", <%_ } _%> - "karma": "1.6.0", + "generator-jhipster": "<%= packagejs.version %>", + "karma": "1.4.1", "karma-chrome-launcher": "2.0.0", - "karma-coverage": "1.1.1", - "karma-intl-shim": "1.0.3", + "karma-cli": "1.0.1", + "karma-coverage-istanbul-reporter": "^0.2.0", "karma-jasmine": "1.1.0", + "karma-intl-shim": "1.0.3", + "karma-jasmine-html-reporter": "^0.2.2", + "karma-phantomjs-launcher": "1.0.4", "karma-junit-reporter": "1.2.0", "karma-notify-reporter": "1.0.1", - "karma-phantomjs-launcher": "1.0.4", - "karma-remap-istanbul": "0.6.0", - "karma-sourcemap-loader": "0.3.7", - "karma-webpack": "2.0.3", - "lazypipe": "1.0.1", - "lodash": "4.17.4", - "map-stream": "0.0.7", - "phantomjs-prebuilt": "2.1.14", - <%_ if (protractorTests) { _%> - "protractor": "5.1.1", - "protractor-jasmine2-screenshot-reporter": "0.3.5", - "ts-node": "2.1.0", - <%_ } _%> - "proxy-middleware": "0.15.0", - "rimraf": "2.6.1", - "run-sequence": "1.2.2", - "sourcemap-istanbul-instrumenter-loader": "0.2.0", - "string-replace-webpack-plugin": "0.1.3", - "style-loader": "0.16.1", - "to-string-loader": "1.1.5", - "tslint": "4.5.1", - "tslint-loader": "3.5.2", - "typescript": "2.2.2", - "webpack": "2.3.3", - "webpack-dev-server": "2.4.2", - "webpack-merge": "4.1.0", - "webpack-notifier": "1.5.0", - "webpack-visualizer-plugin": "0.1.11", - "write-file-webpack-plugin": "3.4.2", <%_ if (buildTool == 'maven') { _%> "xml2js": "0.4.17", <%_ } _%> - <%_ if (useSass) { _%> - "sass-loader": "5.0.1", - "node-sass": "4.5.0", - "postcss-loader": "1.3.0", - <%_ } _%> <%_ otherModules.forEach(module => { _%> "<%= module.name %>": "<%= module.version %>", <%_ }); _%> - "yargs": "6.6.0" + "tslint": "4.5.1", + "phantomjs-prebuilt": "2.1.14", + "rimraf": "2.6.1", + "typescript": "2.2.2" }, "engines": { "node": ">=6.9.0" }, "scripts": { - "lint": "tslint '<%= MAIN_SRC_DIR%>app/**/*.ts'", - "lint:fix": "tslint '<%= MAIN_SRC_DIR%>app/**/*.ts' --fix", + "ng": "ng", + "start": "ng serve --proxy-conf proxy.conf.json", + "build": "ng build", + "build:prod": "ng build --prod", + "test": "ng test", + "lint": "ng lint", + "lint:fix": "ng lint --fix", "tsc": "tsc", "tsc:w": "tsc -w", "ngc": "ngc -p tsconfig-aot.json", - "cleanup": "rimraf <%= BUILD_DIR %>{aot,www}", - "start": "<%= clientPackageManager %> run webpack:dev", - "webpack:build": "<%= clientPackageManager %> run ngc && webpack --config webpack/webpack.vendor.js && webpack --config webpack/webpack.dev.js", - "webpack:build:dev": "webpack --config webpack/webpack.dev.js", - "webpack:build:vendor": "webpack --config webpack/webpack.vendor.js", - "webpack:dev": "webpack-dev-server --config webpack/webpack.dev.js --progress --inline --hot --profile --port=9060", - "webpack:prod": "<%= clientPackageManager %> run ngc && <%= clientPackageManager %> run test && webpack -p --config webpack/webpack.vendor.js && webpack -p --config webpack/webpack.prod.js", - "test": "<%= clientPackageManager %> run lint && karma start src/test/javascript/karma.conf.js", - "test:watch": "karma start --watch", + "cleanup": "rimraf target/", <%_ if (protractorTests) { _%> - "e2e": "protractor <%= TEST_SRC_DIR %>protractor.conf.js", - "postinstall": "webdriver-manager update && node node_modules/phantomjs-prebuilt/install.js && <%= clientPackageManager %> run webpack:build" + "e2e": "ng e2e --proxy-conf proxy.conf.json", + "postinstall": "webdriver-manager update && node node_modules/phantomjs-prebuilt/install.js && yarn build" <%_ } else { _%> - "postinstall": "node node_modules/phantomjs-prebuilt/install.js && <%= clientPackageManager %> run webpack:build" + "postinstall": "node node_modules/phantomjs-prebuilt/install.js && yarn build" <%_ } _%> } } diff --git a/generators/client/templates/angular/_postcss.config.js b/generators/client/templates/angular/_postcss.config.js deleted file mode 100644 index 5cc463f30293..000000000000 --- a/generators/client/templates/angular/_postcss.config.js +++ /dev/null @@ -1,21 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -module.exports = { - plugins: [] -} diff --git a/generators/client/templates/angular/_tsconfig.json b/generators/client/templates/angular/_tsconfig.json index 79abc951b4bd..f589016eb535 100644 --- a/generators/client/templates/angular/_tsconfig.json +++ b/generators/client/templates/angular/_tsconfig.json @@ -34,7 +34,6 @@ ] }, "include": [ - "src/main/webapp/app", - "src/test/javascript" + "src/main/webapp/app" ] -} \ No newline at end of file +} diff --git a/generators/client/templates/angular/src/main/webapp/app/_app.constants.ts b/generators/client/templates/angular/src/main/webapp/app/_app.constants.ts deleted file mode 100644 index 4b0ec957901a..000000000000 --- a/generators/client/templates/angular/src/main/webapp/app/_app.constants.ts +++ /dev/null @@ -1,27 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -// DO NOT EDIT THIS FILE, EDIT THE WEBPACK COMMON CONFIG INSTEAD, WHICH WILL MODIFY THIS FILE - /* tslint:disable */ -let _VERSION = '0.0.0'; // This value will be overwritten by webpack -let _DEBUG_INFO_ENABLED = true; // This value will be overwritten by webpack -/* @toreplace VERSION */ -/* @toreplace DEBUG_INFO_ENABLED */ -/* tslint:enable */ -export const VERSION = _VERSION; -export const DEBUG_INFO_ENABLED = _DEBUG_INFO_ENABLED; diff --git a/generators/client/templates/angular/src/main/webapp/app/_app.main.ts b/generators/client/templates/angular/src/main/webapp/app/_app.main.ts index eb7150f86e5d..b599fbe414fa 100644 --- a/generators/client/templates/angular/src/main/webapp/app/_app.main.ts +++ b/generators/client/templates/angular/src/main/webapp/app/_app.main.ts @@ -18,6 +18,8 @@ -%> import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { ProdConfig } from './blocks/config/prod.config'; +import { enableProdMode } from '@angular/core'; + import { <%=angular2AppName%>AppModule } from './app.module'; ProdConfig(); diff --git a/generators/client/templates/angular/src/main/webapp/app/_vendor.ts b/generators/client/templates/angular/src/main/webapp/app/_vendor.ts index a14c70f174fb..eedcb5008f63 100644 --- a/generators/client/templates/angular/src/main/webapp/app/_vendor.ts +++ b/generators/client/templates/angular/src/main/webapp/app/_vendor.ts @@ -18,8 +18,3 @@ -%> /* after changing this file run '<%= clientPackageManager %> run webpack:build:vendor' or '<%= clientPackageManager %> install' or '<%= clientPackageManager %> run webpack:build' */ /* tslint:disable */ -<%_ if (useSass) { _%> -import '../content/scss/vendor.scss'; -<%_} else { _%> -import '../content/css/vendor.css'; -<%_ } _%> diff --git a/generators/client/templates/angular/src/main/webapp/app/blocks/config/_prod.config.ts b/generators/client/templates/angular/src/main/webapp/app/blocks/config/_prod.config.ts index 4dc3b966aead..a76c0cf444ed 100644 --- a/generators/client/templates/angular/src/main/webapp/app/blocks/config/_prod.config.ts +++ b/generators/client/templates/angular/src/main/webapp/app/blocks/config/_prod.config.ts @@ -17,11 +17,11 @@ limitations under the License. -%> import { enableProdMode } from '@angular/core'; -import { DEBUG_INFO_ENABLED } from '../../app.constants'; +import { environment } from '../../../environments/environment'; export function ProdConfig() { // disable debug data on prod profile to improve performance - if (!DEBUG_INFO_ENABLED) { - enableProdMode(); + if (environment.production) { + enableProdMode(); } } diff --git a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts index ace8ab1b54a2..4ebef529aac4 100644 --- a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts +++ b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts @@ -24,7 +24,7 @@ import { JhiLanguageService } from 'ng-jhipster'; import { ProfileService } from '../profiles/profile.service'; import { <% if (enableTranslation) { %>JhiLanguageHelper, <% } %>Principal, LoginModalService, LoginService } from '../../shared'; -import { VERSION, DEBUG_INFO_ENABLED } from '../../app.constants'; +import { environment } from '../../../environments/environment'; @Component({ selector: '<%=jhiPrefix%>-navbar', @@ -57,7 +57,7 @@ export class NavbarComponent implements OnInit { private profileService: ProfileService, private router: Router ) { - this.version = VERSION ? 'v' + VERSION : ''; + this.version = environment.VERSION; this.isNavbarCollapsed = true; <%_ if (enableTranslation) { _%> this.languageService.addLocation('home'); diff --git a/generators/client/templates/angular/src/main/webapp/environments/_environment.prod.ts b/generators/client/templates/angular/src/main/webapp/environments/_environment.prod.ts new file mode 100644 index 000000000000..68ec6a9fda5b --- /dev/null +++ b/generators/client/templates/angular/src/main/webapp/environments/_environment.prod.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + VERSION: 'v' + require('../../../../package.json').version +}; diff --git a/generators/client/templates/angular/src/main/webapp/environments/_environment.ts b/generators/client/templates/angular/src/main/webapp/environments/_environment.ts new file mode 100644 index 000000000000..2d2ec4da2d6a --- /dev/null +++ b/generators/client/templates/angular/src/main/webapp/environments/_environment.ts @@ -0,0 +1,9 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `.angular-cli.json`. + +export const environment = { + production: false, + VERSION: require('../../../../package.json').version +}; diff --git a/generators/client/templates/angular/src/test/javascript/_karma.conf.js b/generators/client/templates/angular/src/test/javascript/_karma.conf.js index 9c3f0a358d88..0dbbb453261f 100644 --- a/generators/client/templates/angular/src/test/javascript/_karma.conf.js +++ b/generators/client/templates/angular/src/test/javascript/_karma.conf.js @@ -18,139 +18,60 @@ -%> 'use strict'; -const path = require('path'); -const webpack = require('webpack'); -const WATCH = process.argv.indexOf('--watch') > -1; -const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin"); +// Karma configuration file, see link for more information +// https://karma-runner.github.io/0.13/config/configuration-file.html module.exports = function (config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: './', - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine', 'intl-shim'], - - // list of files / patterns to load in the browser - files: [ - 'spec/entry.ts' - ], - - - // list of files to exclude - exclude: [<% if (protractorTests) { %>'e2e/**'<% } %>], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - 'spec/entry.ts': ['webpack', 'sourcemap'] - }, - - webpack: { - resolve: { - extensions: ['.ts', '.js'] - }, - module: { - rules: [ - { - test: /\.ts$/, enforce: 'pre', loader: 'tslint-loader', exclude: /(test|node_modules)/ - }, - { - test: /\.ts$/, - loaders: ['awesome-typescript-loader', 'angular2-template-loader?keepUrl=true'], - exclude: /node_modules/ - }, - { - test: /\.(html|css)$/, - loader: 'raw-loader', - exclude: /\.async\.(html|css)$/ - }, - { - test: /\.async\.(html|css)$/, - loaders: ['file?name=[name].[hash].[ext]', 'extract'] - }, - <%_ if (useSass) { _%> - { - test: /\.scss$/, - loaders: ['to-string-loader', 'css-loader', 'sass-loader'] - }, - <%_ } _%> - { - test: /\.(jpe?g|png|gif|svg|woff2?|ttf|eot)$/i, - loaders: ['file-loader?hash=sha512&digest=hex&name=[hash].[ext]'] - }, - { - test: /src[\/|\\]main[\/|\\]webapp[\/|\\].+\.ts$/, - enforce: 'post', - exclude: /(test|node_modules)/, - loader: 'sourcemap-istanbul-instrumenter-loader?force-sourcemap=true' - }] - }, - devtool: 'inline-source-map', - plugins: [ - new webpack.ContextReplacementPlugin( - // The (\\|\/) piece accounts for path separators in *nix and Windows - /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, - root('./src') // location of your src - ), - new LoaderOptionsPlugin({ - options: { - tslint: { - emitErrors: !WATCH, - failOnHint: false - } - } - }) - ] - }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['dots', 'junit', 'progress', 'karma-remap-istanbul', 'notify'], - - junitReporter: { - outputFile: '../../../../<%= BUILD_DIR %>test-results/karma/TESTS-results.xml' - }, - - notifyReporter: { - reportEachFailure: true, // Default: false, will notify on every failed sepc - reportSuccess: true // Default: true, will notify when a suite was successful - }, - - - remapIstanbulReporter: { - reports: { // eslint-disable-line - 'html': '<%= BUILD_DIR %>test-results/coverage', - 'text-summary': null - } - }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: WATCH, - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: !WATCH - }); + config.set({ + basePath: './', + frameworks: ['jasmine', 'intl-shim', '@angular/cli'], + plugins: [ + require('karma-jasmine'), + require('karma-phantomjs-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-intl-shim'), + require('karma-notify-reporter'), + require('karma-junit-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular/cli/plugins/karma') + ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + files: [ + { pattern: './spec/entry.ts', watched: false } + ], + // list of files to exclude + exclude: [<% if (protractorTests) { %>'e2e/**'<% } %>], + preprocessors: { + './spec/entry.ts': ['@angular/cli'] + }, + mime: { + 'text/x-typescript': ['ts','tsx'] + }, + coverageIstanbulReporter: { + reports: [ 'html', 'lcovonly' ], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: config.angularCli && config.angularCli.codeCoverage + ? ['dots', 'junit', 'progress', 'coverage-istanbul', 'notify'] + : ['dots', 'junit', 'progress', 'kjhtml', 'notify'], + junitReporter: { + outputFile: '../../../../target/test-results/karma/TESTS-results.xml' + }, + + notifyReporter: { + reportEachFailure: true, // Default: false, will notify on every failed sepc + reportSuccess: true // Default: true, will notify when a suite was successful + }, + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['PhantomJS'], + singleRun: true + }); }; - -function root(__path) { - return path.join(__dirname, __path); -} diff --git a/generators/client/templates/angular/src/test/javascript/_protractor.conf.js b/generators/client/templates/angular/src/test/javascript/_protractor.conf.js index 65ea1daec4be..7775c402a132 100644 --- a/generators/client/templates/angular/src/test/javascript/_protractor.conf.js +++ b/generators/client/templates/angular/src/test/javascript/_protractor.conf.js @@ -16,51 +16,43 @@ See the License for the specific language governing permissions and limitations under the License. -%> -const HtmlScreenshotReporter = require("protractor-jasmine2-screenshot-reporter"); -const JasmineReporters = require('jasmine-reporters'); - -exports.config = { - allScriptsTimeout: 20000, - - specs: [ - './e2e/account/*.spec.ts', - './e2e/admin/*.spec.ts', - './e2e/entities/*.spec.ts' - ], - - capabilities: { - 'browserName': 'chrome', - 'phantomjs.binary.path': require('phantomjs-prebuilt').path, - 'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG'] - }, - - directConnect: true, - baseUrl: 'http://localhost:<%= serverPort %>/', +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts - framework: 'jasmine2', - - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000 - }, - - beforeLaunch: function() { - require('ts-node').register({ - project: '' - }); - }, - - onPrepare: function() { - browser.driver.manage().window().setSize(1280, 1024); - jasmine.getEnv().addReporter(new JasmineReporters.JUnitXmlReporter({ - savePath: '<%= BUILD_DIR %>reports/e2e', - consolidateAll: false - })); - jasmine.getEnv().addReporter(new HtmlScreenshotReporter({ - dest: "<%= BUILD_DIR %>reports/e2e/screenshots" - })); - }, +const { SpecReporter } = require('jasmine-spec-reporter'); +const HtmlScreenshotReporter = require("protractor-jasmine2-screenshot-reporter"); - useAllAngular2AppRoots: true +exports.config = { + allScriptsTimeout: 20000, + specs: [ + './e2e/account/*.spec.ts', + './e2e/admin/*.spec.ts', + './e2e/entities/*.spec.ts' + ], + capabilities: { + 'browserName': 'chrome', + 'phantomjs.binary.path': require('phantomjs-prebuilt').path, + 'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG'] + }, + directConnect: true, + baseUrl: 'http://localhost:<%= serverPort %>/', + framework: 'jasmine2', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + }, + beforeLaunch: function() { + require('ts-node').register({ + project: '' + }); + }, + onPrepare() { + browser.driver.manage().window().setSize(1280, 1024); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + jasmine.getEnv().addReporter(new HtmlScreenshotReporter({ + dest: "<%= BUILD_DIR %>reports/e2e/screenshots" + })); + }, + useAllAngular2AppRoots: true }; diff --git a/generators/client/templates/angular/src/test/javascript/spec/_entry.ts b/generators/client/templates/angular/src/test/javascript/spec/_entry.ts index 95bb6df8a015..0d555bc0376a 100644 --- a/generators/client/templates/angular/src/test/javascript/spec/_entry.ts +++ b/generators/client/templates/angular/src/test/javascript/spec/_entry.ts @@ -17,6 +17,9 @@ limitations under the License. -%> /// +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +/** Evergreen browsers require these. **/ import 'core-js'; import 'zone.js/dist/zone'; import 'zone.js/dist/long-stack-trace-zone'; @@ -27,11 +30,28 @@ import 'zone.js/dist/proxy'; import 'zone.js/dist/jasmine-patch'; import 'rxjs'; import 'intl/locale-data/jsonp/en-US.js'; -import { TestBed } from '@angular/core/testing'; -import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; -TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. +declare var __karma__: any; +declare var require: any; + +// Prevent Karma from running prematurely. +__karma__.loaded = function () {}; -declare let require: any; -const testsContext: any = require.context('./', true, /\.spec/); -testsContext.keys().forEach(testsContext); +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start(); diff --git a/generators/client/templates/angular/webpack/_webpack.common.js b/generators/client/templates/angular/webpack/_webpack.common.js deleted file mode 100644 index d49d9907e316..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.common.js +++ /dev/null @@ -1,142 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const webpack = require('webpack'); -const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const StringReplacePlugin = require('string-replace-webpack-plugin'); -const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin'); -const WebpackNotifierPlugin = require('webpack-notifier'); -const path = require('path'); - -module.exports = function (options) { - const DATAS = { - VERSION: JSON.stringify(require("../package.json").version), - DEBUG_INFO_ENABLED: options.env === 'dev' - }; - return { - entry: { - 'polyfills': './src/main/webapp/app/polyfills', - <%_ if (useSass) { _%> - 'global': './src/main/webapp/content/scss/global.scss', - <%_ } else { _%> - 'global': './src/main/webapp/content/css/global.css', - <%_ } _%> - 'main': './src/main/webapp/app/app.main' - }, - resolve: { - extensions: ['.ts', '.js'], - modules: ['node_modules'] - }, - module: { - rules: [ - { test: /bootstrap\/dist\/js\/umd\//, loader: 'imports-loader?jQuery=jquery' }, - { - test: /\.ts$/, - loaders: [ - 'angular2-template-loader', - 'awesome-typescript-loader' - ], - exclude: ['node_modules/generator-jhipster'] - }, - { - test: /\.html$/, - loader: 'html-loader', - options: { - minimize: true, - caseSensitive: true, - removeAttributeQuotes:false, - minifyJS:false, - minifyCSS:false - }, - exclude: ['./src/main/webapp/index.html'] - }, - <%_ if (useSass) { _%> - { - test: /\.scss$/, - loaders: ['to-string-loader', 'css-loader', 'sass-loader'], - exclude: /(vendor\.scss|global\.scss)/ - }, - { - test: /(vendor\.scss|global\.scss)/, - loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] - }, - <%_ } _%> - { - test: /\.css$/, - loaders: ['to-string-loader', 'css-loader'], - exclude: /(vendor\.css|global\.css)/ - }, - { - test: /(vendor\.css|global\.css)/, - loaders: ['style-loader', 'css-loader'] - }, - { - test: /\.(jpe?g|png|gif|svg|woff2?|ttf|eot)$/i, - loaders: ['file-loader?hash=sha512&digest=hex&name=[hash].[ext]'] - }, - { - test: /app.constants.ts$/, - loader: StringReplacePlugin.replace({ - replacements: [{ - pattern: /\/\* @toreplace (\w*?) \*\//ig, - replacement: function (match, p1, offset, string) { - return `_${p1} = ${DATAS[p1]};`; - } - }] - }) - } - ] - }, - plugins: [ - new CommonsChunkPlugin({ - names: ['manifest', 'polyfills'].reverse() - }), - new webpack.DllReferencePlugin({ - context: './', - manifest: require(path.resolve('./<%= BUILD_DIR %>www/vendor.json')) - }), - new CopyWebpackPlugin([ - { from: './node_modules/core-js/client/shim.min.js', to: 'core-js-shim.min.js' }, - { from: './node_modules/swagger-ui/dist', to: 'swagger-ui/dist' }, - { from: './src/main/webapp/swagger-ui/', to: 'swagger-ui' }, - { from: './src/main/webapp/favicon.ico', to: 'favicon.ico' }, - { from: './src/main/webapp/robots.txt', to: 'robots.txt' }<% if (enableTranslation) { %>, - { from: './src/main/webapp/i18n', to: 'i18n' }<% } %> - ]), - new webpack.ProvidePlugin({ - $: "jquery", - jQuery: "jquery" - }), - new HtmlWebpackPlugin({ - template: './src/main/webapp/index.html', - chunksSortMode: 'dependency', - inject: 'body' - }), - new AddAssetHtmlPlugin([ - { filepath: path.resolve('./<%= BUILD_DIR %>www/vendor.dll.js'), includeSourcemap: false } - ]), - new StringReplacePlugin(), - new WebpackNotifierPlugin({ - title: 'JHipster', - contentImage: path.join(__dirname, 'logo-jhipster.png') - }) - ] - }; -}; diff --git a/generators/client/templates/angular/webpack/_webpack.dev.js b/generators/client/templates/angular/webpack/_webpack.dev.js deleted file mode 100644 index 5b59a361c878..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.dev.js +++ /dev/null @@ -1,93 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const webpack = require('webpack'); -const path = require('path'); -const commonConfig = require('./webpack.common.js'); -const writeFilePlugin = require('write-file-webpack-plugin'); -const webpackMerge = require('webpack-merge'); -const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); -const ExtractTextPlugin = require("extract-text-webpack-plugin"); -const ENV = 'dev'; -const execSync = require('child_process').execSync; -const fs = require('fs'); -const ddlPath = './<%= BUILD_DIR %>www/vendor.json'; - -if (!fs.existsSync(ddlPath)) { - execSync('webpack --config webpack/webpack.vendor.js'); -} - -module.exports = webpackMerge(commonConfig({ env: ENV }), { - devtool: 'inline-source-map', - devServer: { - contentBase: './<%= BUILD_DIR %>www', - proxy: [{ - context: [<% if (authenticationType === 'oauth2') { %> - '/oauth',<% } %><% if (authenticationType === 'uaa') { %> - '/<%= uaaBaseName.toLowerCase() %>',<% } %> - /* jhipster-needle-add-entity-to-webpack - JHipster will add entity api paths here */ - '/api', - '/management', - '/swagger-resources', - '/v2/api-docs', - '/h2-console' - ], - target: 'http://127.0.0.1:<%= serverPort %>', - secure: false - }<% if (websocket === 'spring-websocket') { %>,{ - context: [ - '/websocket' - ], - target: 'ws://127.0.0.1:<%= serverPort %>', - ws: true - }<% } %>] - }, - output: { - path: path.resolve('<%= BUILD_DIR %>www'), - filename: '[name].bundle.js', - chunkFilename: '[id].chunk.js' - }, - module: { - rules: [{ - test: /\.ts$/, - loaders: [ - 'tslint-loader' - ], - exclude: ['node_modules', new RegExp('reflect-metadata\\' + path.sep + 'Reflect\\.ts')] - }] - }, - plugins: [ - new BrowserSyncPlugin({ - host: 'localhost', - port: 9000, - proxy: { - target: 'http://localhost:9060'<% if (websocket === 'spring-websocket') { %>, - ws: true<% } %> - } - }, { - reload: false - }), - new ExtractTextPlugin('styles.css'), - new webpack.NoEmitOnErrorsPlugin(), - new webpack.NamedModulesPlugin(), - new writeFilePlugin(), - new webpack.WatchIgnorePlugin([ - path.resolve('./src/test'), - ]) - ] -}); diff --git a/generators/client/templates/angular/webpack/_webpack.prod.js b/generators/client/templates/angular/webpack/_webpack.prod.js deleted file mode 100644 index 0266bc2d253d..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.prod.js +++ /dev/null @@ -1,41 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const commonConfig = require('./webpack.common.js'); -const webpackMerge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const ExtractTextPlugin = require("extract-text-webpack-plugin"); -const Visualizer = require('webpack-visualizer-plugin'); -const path = require('path'); -const ENV = 'prod'; - -module.exports = webpackMerge(commonConfig({ env: ENV }), { - devtool: 'source-map', - output: { - path: path.resolve('./<%= BUILD_DIR %>www'), - filename: '[hash].[name].bundle.js', - chunkFilename: '[hash].[id].chunk.js' - }, - plugins: [ - new ExtractTextPlugin('[hash].styles.css'), - new Visualizer({ - // Webpack statistics in target folder - filename: '../stats.html' - }) - ] -}); diff --git a/generators/client/templates/angular/webpack/_webpack.vendor.js b/generators/client/templates/angular/webpack/_webpack.vendor.js deleted file mode 100644 index f1180cc3ff61..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.vendor.js +++ /dev/null @@ -1,81 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const webpack = require('webpack'); -const path = require('path'); -module.exports = { - entry: { - 'vendor': [ - './src/main/webapp/app/vendor', - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/forms', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@ng-bootstrap/ng-bootstrap', - 'angular2-cookie', - 'ngx-infinite-scroll', - 'jquery', - 'ng-jhipster', - 'ng2-webstorage', - <%_ if (websocket == 'spring-websocket') { _%> - 'sockjs-client', - 'webstomp-client', - <%_ } _%> - 'rxjs' - ] - }, - resolve: { - extensions: ['.ts', '.js'], - modules: ['node_modules'] - }, - module: { - exprContextCritical: false, - rules: [ - <%_ if (useSass) { _%> - { - test: /(vendor\.scss|global\.scss)/, - loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] - }, - <%_ } else { _%> - { - test: /(vendor\.css|global\.css)/, - loaders: ['style-loader', 'css-loader'] - }, - <%_ } _%> - { - test: /\.(jpe?g|png|gif|svg|woff2?|ttf|eot)$/i, - loaders: ['file-loader?hash=sha512&digest=hex&name=[hash].[ext]'] - } - ] - }, - output: { - filename: '[name].dll.js', - path: path.resolve('./<%= BUILD_DIR %>www'), - library: '[name]' - }, - plugins: [ - new webpack.DllPlugin({ - name: '[name]', - path: path.resolve('./<%= BUILD_DIR %>www/[name].json') - }) - ] -}; diff --git a/generators/client/templates/angular/webpack/logo-jhipster.png b/generators/client/templates/angular/webpack/logo-jhipster.png deleted file mode 100644 index d8eb48da05c157571eed9fd7303f8d9566f2ea12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4459 zcmX|E1yB@V)238FK~j(qNkODUIgmU;(gO(*P${JZ=?3XM8YCs8kB$SRLmH0mJmRPW zjygDwxc}z=zWHYM-FJ7N_u1LmnVoqzLJOo!LC!=@KtMpDs-mckzrWy*J1H?wbcBiIKI{l~?l|FQ8} zGHf6(+!t^B7X_K9f{bfoefMF_h_P-2VhbNfP4`Pj4&zy(j>UKvG2D*N^Cq~ z3ULNT!6=*t3j-aGm&Rya2O$w2`K^=SsxjR0HtuxidS@xe$9fOe){q>6Ma&n5xud3f zXId+p(!xQBBTODckT6%=#XjzMrY9%*WNrvC(g~~1#bM@f$T7!)F>b%%r`|&&MTxDy z!O+COn=9hJxj*L-JH@Zfj;7-=_>W5}WdMaao@(9S|ZqIR7s7ut2 zRO%LPYr1)0d}d-)EOdCaF55pWI_Zazx`G-P2RAV>@!8s_UG^}KO+iXV7MWg(A7sSr z_efP`c@YGXpP!eVlTG&}D`(FLc@R8?9{`YxHb{qn-wCvDW+EGJ zElW?f_TlvtI&`K#aao|+bLQSgwp%O`F+S3m{XYGBjnPednx=>?{N(x zqvhlXI|2%;{U)c9lZfFoHzjk)O$733PeHPHS!wW{oHvFz`@#u8{5?Fo_Gd@U7g-nM z18myb1IANM1va-Q|NL^a%AKL?Tq%C`?ufGBZfY|i@I>U4azx{{#4AfEX=vVtHI8~U zkA!1nWv5N5IV2o*H(&aQCGcq2^;qECmXh-6Q_}#{*z5h+;Kh^O^HWYhH3JEYES%&b zn~`IQ4wS_3-GPLjbm^uQ9`8#*Np5r~?w!#3DUdUjU%W~f(;qWT-KNePOb4pohLdh~ zaW7E_M_L^Cqlm)<0BL8gQS$*Wq|$s|NoiX?30DYG`!#798_Mw8#H1GORusc9N6CUU zP@f%DBQw)FigQ|Xo}2g0b_nJyft<}!g~9G9ACjd}ynGVcO=b3}pvoBd`!%iDpD80M ziDoEmFvDhIWgTUL$1Y!W>lmfcl?8=}_Vg*ymq5WoA|iO!wpMt2h0J3Nv(esXqMh)u zCnGVu8xcw_nQt!piI`~vh8e!XKE>)N=F>wWbsVWk470IAZ7enF*+LsBCIt zrVUJ&R2^m7|er zR`k5JtaQ}dyu&>(#K4Ybfp0R@N8*r4+B~1Pq-6CqR`lxLqA`5k)mNbAJI2~;)mF@? zb;as@o`Sae%~#})Wk^Ylg1%R)qp~P%pU$vS?c`OKpg>7UOw=vhwB8VQ*6$m<^1DRb z=X{oCCc*0A&Ed+Q5?C^Ip|qC#h5FfB^R^31TDut*nRn<^#b3NQMSJw;A&v8T1n}jb zpnwuCrFPuF0%^i0ZlGiC8tr7JjA2#57toQr9M5ucNj|({?XY*0-q>$c>uN>)oBr7? z<{|eMZN@9QzT+KWYpTZtIK8L48w{}b63NmSo_I@cXZ?rY&Qwd0*J`eqCTF>SYfMC? z``;AgDi7}Hr6v06eQFrBrl8S!&G5c(%Fckt$;F`GyO{%Tt05G^7khxZSwZp(68n); z6?*8is~k`Wars8O!dUEElYgCWWyRHiN=58p$C^?>LW;KbG+^Hbs@u5B-cfmrKvwh@ z*&F**D^}nu_gTyNo~+B%c&|T%A!s=&63Q9j_&t!Az@0mJ??eve?u^f+k1pI)39k%B zQ%CRe^4!x-gFqU&K55%+Lp#3Rd#RH)6~slq37;p8LC=k)TeR_hLUPmn^NQ=AQ(+); ziU*JfPHgJ*XgPH=Q~<3uw)LMS=dQZlQxrV-7|x>%rQo9$+yg7)Xll*}TN9L;#g0YyG+5zfcN5Ou)ef_O&HZPzR0Is+goj`iUR;ca)<#R7at8nf>X#8 zfk3V+JN=>L*GO3#b~a{@$i{mU81eAfydg{|>$+R|Y!ee4+sw+@>m-wLS+xGMC{dd# z#8Jr37&Uc%4!Dasduy`mm6A;KfWq;|n0tp$;@cTzH+Iw!wl#;0%VjP5W5$<`{bMAp zjbuzd=sG-apRTJJ18USIeQ%N_RH}b%D6c-OQU$W(ebunRT z>W}VLA`hY-S#1E$^gR?3M*4X6JdOticP#mszBkRTu3`322pW?wJFZfpN8tPJ4%g!+ zD0-H5QPE|G*moD7gbUbW`_1l;5+lCXHQl-P40iwiAdkY+9Ly4vU8Y+))PHM6E5yTL z`EG|{P9--wb|YuoXgb?}n|LqGY2{#K_F6=O^mtmO7~z2YAbTj&)zYeC*`g`QeqM37bl%$mk2m^@@y&WEwtQXhdSL`c6)0J zS9;!6)92o+OptB0cG)f2QenpN3%SK()G}pmOAlw z;V;Jwcr|pc#yOsi56A88BsX<;n2T)0tR0GbJy)a7-P(#?h^R6XWKI%WT7KU6cp-*R z))-sFUI}hMaGi<1v`^3KwoTO_t8^(e3a7-hm!*xWFPbp+EwlW9yJpo7k#tVp&AMy; z#CbKRssTPPgTz{;cG&P;ks zCK=NTkv9~J{(jY(&vi7QzQQ9lx=r>(=q&3?vC>x^g}V9qA>|GH7n1e49$HhxbtU@g zurasC?2 zpSV+LOR8ry;d`rq(;nM7)zD9dFL{I_1L02;h}u;-T540Mdh%O!qAiX#0I033rG@sF zE2bjRr?i0+V&4KPU+*S)8gzLt2{=cb-f5fwSu!NL9kRsxyI5Wy{BH1S*SIUbnj7N5 z)z=`wLHg%o+dEN3XJZ3}XboI|; zw$wN=wz)#G?^5$Q!+%HHMa1(5bUTtD5l$oW;ld;pfXmx1N);-qi09(zj-6xLsoZy# zh|R~HP;R-_X$X7Y8n3}XK5k{?}!pLX)rY{_UUfu#VUb{(7$|a7K169Sg5ld|Up*q5gfl@ChTK{qZb-;uhx{ z%Le-;u|%5UOyw@?F@^HCuF24RY9Tl4+EJz0mxdoQbg^08G$ltWIH#SyQNI=xu5?;>Amv4PB-Q^XbyB^*O>oqurI-2z% z!jbbv%2#2{(TNFfSgsq^=P&*(*RFTQ_h$ra)tsTv`UZg2)!u%L7>I0ns=5mEd%93d z+8wSQITdztdd2Y6zgp|W%g~Pn%SlLH1E{=v;gI}il|Nejy>9U@njE5pAqF7{(B77$ zxCCgZNhcTgmMK(^Ebz7V3mGcw`>pP&!(XFjttWpDNu;5&E=Re+w3=^x{~)19f+~iOopzsOqPCO^+0B(Q-PVeg^emHYpY_2J|xyo{9yA9|~+- zJAJ6^(+%oCu?Z%sbAJ$nxYItG!)yi|5FAz-T-idyryDq%Y2fLrVX#vSEo4bEb=*@VxG&b#1g <%_ if (!skipClient && clientFramework !== 'angular1') { _%> - webpack + angularcli @@ -1173,13 +1173,13 @@ <%_ } _%> - webpack build dev + angularcli build dev <%= clientPackageManager %> generate-resources - run webpack:build:dev + build @@ -1361,13 +1361,13 @@ <%_ } _%> <%_ if (clientFramework !== 'angular1') { _%> - webpack build prod + angularcli build prod <%= clientPackageManager %> generate-resources - run webpack:prod + ng build --prod <%_ } _%> From ec7c69e26800045c1511326b4639a0ec89a9946a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20HOU=C3=8BL?= Date: Tue, 25 Apr 2017 22:36:06 +0200 Subject: [PATCH 2/7] Add again postcss file AngularCli already use posts loader in his webpack configuration so we can still use it --- generators/client/files-angular.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js index b230bbbef4ec..31d0be21b2ea 100644 --- a/generators/client/files-angular.js +++ b/generators/client/files-angular.js @@ -42,7 +42,8 @@ const files = { path: MAIN_SRC_DIR, templates: [ 'content/scss/_global.scss', - 'content/scss/_vendor.scss' + 'content/scss/_vendor.scss', + '_postcss.config.js' ] } ], From 4a4b3b4095fde4af2cb6a46ef1315225028db1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20HOU=C3=8BL?= Date: Thu, 27 Apr 2017 10:41:49 +0200 Subject: [PATCH 3/7] Add postcss file which was missing --- generators/client/files-angular.js | 9 +++++++- .../templates/angular/_postcss.config.js | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 generators/client/templates/angular/_postcss.config.js diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js index 31d0be21b2ea..8dd3ac66fe8c 100644 --- a/generators/client/files-angular.js +++ b/generators/client/files-angular.js @@ -42,11 +42,18 @@ const files = { path: MAIN_SRC_DIR, templates: [ 'content/scss/_global.scss', - 'content/scss/_vendor.scss', + 'content/scss/_vendor.scss' + ] + }, + { + condition: generator => generator.useSass, + templates: [ '_postcss.config.js' ] } ], + + image: [ { path: MAIN_SRC_DIR, diff --git a/generators/client/templates/angular/_postcss.config.js b/generators/client/templates/angular/_postcss.config.js new file mode 100644 index 000000000000..5cc463f30293 --- /dev/null +++ b/generators/client/templates/angular/_postcss.config.js @@ -0,0 +1,21 @@ +<%# + Copyright 2013-2017 the original author or authors. + + This file is part of the JHipster project, see https://jhipster.github.io/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +module.exports = { + plugins: [] +} From fe4a3313528b1103f5a59209c36003616c4980ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20HOU=C3=8BL?= Date: Fri, 28 Apr 2017 11:25:44 +0200 Subject: [PATCH 4/7] Add browsersync compatibility by default when using yarn start Also reduce test execution to a single shot --- generators/client/templates/angular/_bs_config.json | 6 ++++++ generators/client/templates/angular/_package.json | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 generators/client/templates/angular/_bs_config.json diff --git a/generators/client/templates/angular/_bs_config.json b/generators/client/templates/angular/_bs_config.json new file mode 100644 index 000000000000..db65c1795f49 --- /dev/null +++ b/generators/client/templates/angular/_bs_config.json @@ -0,0 +1,6 @@ +{ + "host": "localhost", + "port": 9000, + "files": ["./target/www/app/**/*.{html,htm,css,js}"], + "server": { "baseDir": "./target/www/app" } +} diff --git a/generators/client/templates/angular/_package.json b/generators/client/templates/angular/_package.json index b4b1723d18ef..4cada5f27967 100644 --- a/generators/client/templates/angular/_package.json +++ b/generators/client/templates/angular/_package.json @@ -88,19 +88,22 @@ "tslint": "4.5.1", "phantomjs-prebuilt": "2.1.14", "rimraf": "2.6.1", - "typescript": "2.2.2" + "typescript": "2.2.2", + "lite-server": "2.3.0", + "concurrently": "3.4.0" }, "engines": { "node": ">=6.9.0" }, "scripts": { "ng": "ng", - "start": "ng serve --proxy-conf proxy.conf.json", + "start": "concurrently --kill-others \"ng build --watch\" \"lite-server\" ", "build": "ng build", "build:prod": "ng build --prod", - "test": "ng test", + "test": "ng test --single-run", "lint": "ng lint", "lint:fix": "ng lint --fix", + "lite-server": "lite-server", "tsc": "tsc", "tsc:w": "tsc -w", "ngc": "ngc -p tsconfig-aot.json", From 494ac45ccc2a2cc4a209b65a3b1ba6c852e790df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20HOU=C3=8BL?= Date: Wed, 3 May 2017 10:13:35 +0200 Subject: [PATCH 5/7] Fix issues on angular-cli integration Copy swagger and shim static files when building app Revert and remove browsersync till angular-cli issue is not fix Move target to www --- generators/client/templates/angular/_.angular-cli.json | 6 ++++-- generators/client/templates/angular/_package.json | 9 +++------ .../client/templates/angular/src/main/webapp/_index.html | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/generators/client/templates/angular/_.angular-cli.json b/generators/client/templates/angular/_.angular-cli.json index db68041759a9..c66a2cead6ee 100644 --- a/generators/client/templates/angular/_.angular-cli.json +++ b/generators/client/templates/angular/_.angular-cli.json @@ -23,7 +23,7 @@ }, "apps": [{ "root": "<%= MAIN_SRC_DIR %>", - "outDir": "<%= DIST_DIR %>app", + "outDir": "<%= DIST_DIR %>", "assets": [ "content/images", <%_ if (enableTranslation) { _%> @@ -31,7 +31,9 @@ <%_ } _%> "favicon.ico", "swagger-ui", - "robots.txt" + "robots.txt", + { "glob": "shim.min.js", "input": "../../../node_modules/core-js/client/", "output": "./" }, + { "glob": "**/*", "input": "../../../node_modules/swagger-ui/dist/", "output": "swagger-ui/dist" } ], "index": "index.html", "main": "app/app.main.ts", diff --git a/generators/client/templates/angular/_package.json b/generators/client/templates/angular/_package.json index b2c193f7cadb..4e7bd51b9897 100644 --- a/generators/client/templates/angular/_package.json +++ b/generators/client/templates/angular/_package.json @@ -53,7 +53,7 @@ "zone.js": "0.8.5" }, "devDependencies": { - "@angular/cli": "1.0.0", + "@angular/cli": "1.0.1", "@angular/compiler-cli": "4.0.0", "@types/jasmine": "2.5.47", "@types/node": "7.0.12", @@ -88,22 +88,19 @@ "tslint": "4.5.1", "phantomjs-prebuilt": "2.1.14", "rimraf": "2.6.1", - "typescript": "2.2.2", - "lite-server": "2.3.0", - "concurrently": "3.4.0" + "typescript": "2.2.2" }, "engines": { "node": ">=6.9.0" }, "scripts": { "ng": "ng", - "start": "concurrently --kill-others \"ng build --watch\" \"lite-server\" ", + "start": "ng serve", "build": "ng build", "build:prod": "ng build --prod", "test": "ng test --single-run", "lint": "ng lint", "lint:fix": "ng lint --fix", - "lite-server": "lite-server", "tsc": "tsc", "tsc:w": "tsc -w", "ngc": "ngc -p tsconfig-aot.json", diff --git a/generators/client/templates/angular/src/main/webapp/_index.html b/generators/client/templates/angular/src/main/webapp/_index.html index aefa2bb01ddf..967dad0decb7 100644 --- a/generators/client/templates/angular/src/main/webapp/_index.html +++ b/generators/client/templates/angular/src/main/webapp/_index.html @@ -37,7 +37,7 @@ // load shim for IE if (window.navigator.userAgent.indexOf('Trident/') > 0) { var script = document.createElement('script'); - script.src = 'core-js-shim.min.js'; + script.src = 'shim.min.js'; script.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(script) } From eb468a495a73c4fc9b3c914efcf1aa3c57f5471b Mon Sep 17 00:00:00 2001 From: HOUEL Steve Date: Fri, 12 May 2017 10:31:29 +0200 Subject: [PATCH 6/7] Remove webpack files --- .../angular/webpack/_webpack.common.js | 154 ------------------ .../templates/angular/webpack/_webpack.dev.js | 93 ----------- .../angular/webpack/_webpack.prod.js | 41 ----- .../angular/webpack/_webpack.vendor.js | 81 --------- 4 files changed, 369 deletions(-) delete mode 100644 generators/client/templates/angular/webpack/_webpack.common.js delete mode 100644 generators/client/templates/angular/webpack/_webpack.dev.js delete mode 100644 generators/client/templates/angular/webpack/_webpack.prod.js delete mode 100644 generators/client/templates/angular/webpack/_webpack.vendor.js diff --git a/generators/client/templates/angular/webpack/_webpack.common.js b/generators/client/templates/angular/webpack/_webpack.common.js deleted file mode 100644 index 00a2d3fb6dec..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.common.js +++ /dev/null @@ -1,154 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors from the JHipster project. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const webpack = require('webpack'); -const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const StringReplacePlugin = require('string-replace-webpack-plugin'); -const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin'); -const WebpackNotifierPlugin = require('webpack-notifier'); -<%_ if (enableTranslation) { _%> -const MergeJsonWebpackPlugin = require("merge-jsons-webpack-plugin") -<%_ } _%> -const path = require('path'); - -module.exports = function (options) { - const DATAS = { - VERSION: JSON.stringify(require("../package.json").version), - DEBUG_INFO_ENABLED: options.env === 'dev' - }; - return { - entry: { - 'polyfills': './src/main/webapp/app/polyfills', - <%_ if (useSass) { _%> - 'global': './src/main/webapp/content/scss/global.scss', - <%_ } else { _%> - 'global': './src/main/webapp/content/css/global.css', - <%_ } _%> - 'main': './src/main/webapp/app/app.main' - }, - resolve: { - extensions: ['.ts', '.js'], - modules: ['node_modules'] - }, - module: { - rules: [ - { test: /bootstrap\/dist\/js\/umd\//, loader: 'imports-loader?jQuery=jquery' }, - { - test: /\.ts$/, - loaders: [ - 'angular2-template-loader', - 'awesome-typescript-loader' - ], - exclude: ['node_modules/generator-jhipster'] - }, - { - test: /\.html$/, - loader: 'html-loader', - options: { - minimize: true, - caseSensitive: true, - removeAttributeQuotes:false, - minifyJS:false, - minifyCSS:false - }, - exclude: ['./src/main/webapp/index.html'] - }, - <%_ if (useSass) { _%> - { - test: /\.scss$/, - loaders: ['to-string-loader', 'css-loader', 'sass-loader'], - exclude: /(vendor\.scss|global\.scss)/ - }, - { - test: /(vendor\.scss|global\.scss)/, - loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] - }, - <%_ } _%> - { - test: /\.css$/, - loaders: ['to-string-loader', 'css-loader'], - exclude: /(vendor\.css|global\.css)/ - }, - { - test: /(vendor\.css|global\.css)/, - loaders: ['style-loader', 'css-loader'] - }, - { - test: /\.(jpe?g|png|gif|svg|woff2?|ttf|eot)$/i, - loaders: ['file-loader?hash=sha512&digest=hex&name=[hash].[ext]'] - }, - { - test: /app.constants.ts$/, - loader: StringReplacePlugin.replace({ - replacements: [{ - pattern: /\/\* @toreplace (\w*?) \*\//ig, - replacement: function (match, p1, offset, string) { - return `_${p1} = ${DATAS[p1]};`; - } - }] - }) - } - ] - }, - plugins: [ - new CommonsChunkPlugin({ - names: ['manifest', 'polyfills'].reverse() - }), - new webpack.DllReferencePlugin({ - context: './', - manifest: require(path.resolve('./<%= BUILD_DIR %>www/vendor.json')) - }), - new CopyWebpackPlugin([ - { from: './node_modules/core-js/client/shim.min.js', to: 'core-js-shim.min.js' }, - { from: './node_modules/swagger-ui/dist', to: 'swagger-ui/dist' }, - { from: './src/main/webapp/swagger-ui/', to: 'swagger-ui' }, - { from: './src/main/webapp/favicon.ico', to: 'favicon.ico' }, - { from: './src/main/webapp/robots.txt', to: 'robots.txt' }<% if (enableTranslation) { %>, - { from: './src/main/webapp/i18n', to: 'i18n' }<% } %> - ]), - new webpack.ProvidePlugin({ - $: "jquery", - jQuery: "jquery" - }), - <%_ if (enableTranslation) { _%> - new MergeJsonWebpackPlugin({ - output: { - groupBy: [ - // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array - ] - } - }), - <%_ } _%> - new HtmlWebpackPlugin({ - template: './src/main/webapp/index.html', - chunksSortMode: 'dependency', - inject: 'body' - }), - new AddAssetHtmlPlugin([ - { filepath: path.resolve('./<%= BUILD_DIR %>www/vendor.dll.js'), includeSourcemap: false } - ]), - new StringReplacePlugin(), - new WebpackNotifierPlugin({ - title: 'JHipster', - contentImage: path.join(__dirname, 'logo-jhipster.png') - }) - ] - }; -}; diff --git a/generators/client/templates/angular/webpack/_webpack.dev.js b/generators/client/templates/angular/webpack/_webpack.dev.js deleted file mode 100644 index 53d8ccc99c8a..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.dev.js +++ /dev/null @@ -1,93 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors from the JHipster project. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const webpack = require('webpack'); -const path = require('path'); -const commonConfig = require('./webpack.common.js'); -const writeFilePlugin = require('write-file-webpack-plugin'); -const webpackMerge = require('webpack-merge'); -const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); -const ExtractTextPlugin = require("extract-text-webpack-plugin"); -const ENV = 'dev'; -const execSync = require('child_process').execSync; -const fs = require('fs'); -const ddlPath = './<%= BUILD_DIR %>www/vendor.json'; - -if (!fs.existsSync(ddlPath)) { - execSync('webpack --config webpack/webpack.vendor.js'); -} - -module.exports = webpackMerge(commonConfig({ env: ENV }), { - devtool: 'inline-source-map', - devServer: { - contentBase: './<%= BUILD_DIR %>www', - proxy: [{ - context: [<% if (authenticationType === 'oauth2') { %> - '/oauth',<% } %><% if (authenticationType === 'uaa') { %> - '/<%= uaaBaseName.toLowerCase() %>',<% } %> - /* jhipster-needle-add-entity-to-webpack - JHipster will add entity api paths here */ - '/api', - '/management', - '/swagger-resources', - '/v2/api-docs', - '/h2-console' - ], - target: 'http://127.0.0.1:<%= serverPort %>', - secure: false - }<% if (websocket === 'spring-websocket') { %>,{ - context: [ - '/websocket' - ], - target: 'ws://127.0.0.1:<%= serverPort %>', - ws: true - }<% } %>] - }, - output: { - path: path.resolve('<%= BUILD_DIR %>www'), - filename: '[name].bundle.js', - chunkFilename: '[id].chunk.js' - }, - module: { - rules: [{ - test: /\.ts$/, - loaders: [ - 'tslint-loader' - ], - exclude: ['node_modules', new RegExp('reflect-metadata\\' + path.sep + 'Reflect\\.ts')] - }] - }, - plugins: [ - new BrowserSyncPlugin({ - host: 'localhost', - port: 9000, - proxy: { - target: 'http://localhost:9060'<% if (websocket === 'spring-websocket') { %>, - ws: true<% } %> - } - }, { - reload: false - }), - new ExtractTextPlugin('styles.css'), - new webpack.NoEmitOnErrorsPlugin(), - new webpack.NamedModulesPlugin(), - new writeFilePlugin(), - new webpack.WatchIgnorePlugin([ - path.resolve('./src/test'), - ]) - ] -}); diff --git a/generators/client/templates/angular/webpack/_webpack.prod.js b/generators/client/templates/angular/webpack/_webpack.prod.js deleted file mode 100644 index 54f372a9b072..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.prod.js +++ /dev/null @@ -1,41 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors from the JHipster project. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const commonConfig = require('./webpack.common.js'); -const webpackMerge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const ExtractTextPlugin = require("extract-text-webpack-plugin"); -const Visualizer = require('webpack-visualizer-plugin'); -const path = require('path'); -const ENV = 'prod'; - -module.exports = webpackMerge(commonConfig({ env: ENV }), { - devtool: 'source-map', - output: { - path: path.resolve('./<%= BUILD_DIR %>www'), - filename: '[hash].[name].bundle.js', - chunkFilename: '[hash].[id].chunk.js' - }, - plugins: [ - new ExtractTextPlugin('[hash].styles.css'), - new Visualizer({ - // Webpack statistics in target folder - filename: '../stats.html' - }) - ] -}); diff --git a/generators/client/templates/angular/webpack/_webpack.vendor.js b/generators/client/templates/angular/webpack/_webpack.vendor.js deleted file mode 100644 index 1c785048bca7..000000000000 --- a/generators/client/templates/angular/webpack/_webpack.vendor.js +++ /dev/null @@ -1,81 +0,0 @@ -<%# - Copyright 2013-2017 the original author or authors from the JHipster project. - - This file is part of the JHipster project, see https://jhipster.github.io/ - for more information. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> -const webpack = require('webpack'); -const path = require('path'); -module.exports = { - entry: { - 'vendor': [ - './src/main/webapp/app/vendor', - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/forms', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@ng-bootstrap/ng-bootstrap', - 'angular2-cookie', - 'ngx-infinite-scroll', - 'jquery', - 'ng-jhipster', - 'ng2-webstorage', - <%_ if (websocket == 'spring-websocket') { _%> - 'sockjs-client', - 'webstomp-client', - <%_ } _%> - 'rxjs' - ] - }, - resolve: { - extensions: ['.ts', '.js'], - modules: ['node_modules'] - }, - module: { - exprContextCritical: false, - rules: [ - <%_ if (useSass) { _%> - { - test: /(vendor\.scss|global\.scss)/, - loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] - }, - <%_ } else { _%> - { - test: /(vendor\.css|global\.css)/, - loaders: ['style-loader', 'css-loader'] - }, - <%_ } _%> - { - test: /\.(jpe?g|png|gif|svg|woff2?|ttf|eot)$/i, - loaders: ['file-loader?hash=sha512&digest=hex&name=[hash].[ext]'] - } - ] - }, - output: { - filename: '[name].dll.js', - path: path.resolve('./<%= BUILD_DIR %>www'), - library: '[name]' - }, - plugins: [ - new webpack.DllPlugin({ - name: '[name]', - path: path.resolve('./<%= BUILD_DIR %>www/[name].json') - }) - ] -}; From 44527fecadbd8b7e82519d4ebe630a3ca9b31a13 Mon Sep 17 00:00:00 2001 From: HOUEL Steve Date: Fri, 12 May 2017 10:50:22 +0200 Subject: [PATCH 7/7] Fix versions --- generators/client/templates/angular/_package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/client/templates/angular/_package.json b/generators/client/templates/angular/_package.json index ebf6494b9aa3..493155bdef85 100644 --- a/generators/client/templates/angular/_package.json +++ b/generators/client/templates/angular/_package.json @@ -72,10 +72,10 @@ "karma": "1.4.1", "karma-chrome-launcher": "2.0.0", "karma-cli": "1.0.1", - "karma-coverage-istanbul-reporter": "^0.2.0", + "karma-coverage-istanbul-reporter": "0.2.0", "karma-jasmine": "1.1.0", "karma-intl-shim": "1.0.3", - "karma-jasmine-html-reporter": "^p0.2.2", + "karma-jasmine-html-reporter": "0.2.2", "karma-phantomjs-launcher": "1.0.4", "karma-junit-reporter": "1.2.0", "karma-notify-reporter": "1.0.1",