From 197454ce21642ef2cfdbf32feb27af97d51a4b65 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Wed, 29 May 2019 23:25:37 +0530 Subject: [PATCH 1/6] Bump angular dependencies --- .../client/templates/angular/package.json.ejs | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 5f9f93049c46..5101fab5fd6d 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -27,17 +27,17 @@ "node_modules" ], "dependencies": { - "@angular/common": "7.2.12", - "@angular/compiler": "7.2.12", - "@angular/core": "7.2.12", - "@angular/forms": "7.2.12", - "@angular/platform-browser": "7.2.12", - "@angular/platform-browser-dynamic": "7.2.12", - "@angular/router": "7.2.12", - "@fortawesome/angular-fontawesome": "0.3.0", - "@fortawesome/fontawesome-svg-core": "1.2.17", - "@fortawesome/free-solid-svg-icons": "5.8.1", - "@ng-bootstrap/ng-bootstrap": "4.1.1", + "@angular/common": "8.0.0", + "@angular/compiler": "8.0.0", + "@angular/core": "8.0.0", + "@angular/forms": "8.0.0", + "@angular/platform-browser": "8.0.0", + "@angular/platform-browser-dynamic": "8.0.0", + "@angular/router": "8.0.0", + "@fortawesome/angular-fontawesome": "0.4.0", + "@fortawesome/fontawesome-svg-core": "1.2.18", + "@fortawesome/free-solid-svg-icons": "5.8.2", + "@ng-bootstrap/ng-bootstrap": "4.2.0", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "bootstrap": "4.3.1", @@ -47,27 +47,27 @@ "core-js": "2.6.5", "moment": "2.24.0", "ng-jhipster": "0.9.3", - "ngx-cookie": "4.0.2", + "ngx-cookie": "4.1.2", "ngx-infinite-scroll": "7.1.0", "ngx-webstorage": "3.0.2", - "rxjs": "6.4.0", + "rxjs": "6.5.2", "swagger-ui": "2.2.10", <%_ if (websocket === 'spring-websocket') { _%> "sockjs-client": "1.3.0", "webstomp-client": "1.2.6", <%_ } _%> "tslib": "1.9.3", - "zone.js": "0.8.29" + "zone.js": "0.9.1" }, "devDependencies": { - "@angular/cli": "7.3.8", - "@angular/compiler-cli": "7.2.12", - "@ngtools/webpack": "7.3.8", + "@angular/cli": "8.0.0", + "@angular/compiler-cli": "8.0.0", + "@ngtools/webpack": "8.0.0", <%_ if (protractorTests) { _%> "@types/chai": "4.1.7", "@types/chai-string": "1.4.1", <%_ } _%> - "@types/jest": "24.0.11", + "@types/jest": "24.0.13", <%_ if (protractorTests) { _%> "@types/mocha": "5.2.6", <%_ } _%> @@ -77,7 +77,7 @@ <%_ } _%> "angular-router-loader": "0.8.5", "angular2-template-loader": "0.6.2", - "autoprefixer": "9.5.0", + "autoprefixer": "9.5.1", "base-href-webpack-plugin": "2.0.0", "browser-sync": "2.26.5", "browser-sync-webpack-plugin": "2.2.2", @@ -87,69 +87,69 @@ "chai-as-promised": "7.1.1", "chai-string": "1.5.0", <%_ } _%> - "codelyzer": "5.0.0", - "copy-webpack-plugin": "5.0.2", + "codelyzer": "5.0.1", + "copy-webpack-plugin": "5.0.3", "css-loader": "2.1.1", "file-loader": "3.0.1", - "fork-ts-checker-webpack-plugin": "1.0.1", + "fork-ts-checker-webpack-plugin": "1.3.4", "friendly-errors-webpack-plugin": "1.7.0", "generator-jhipster": "<%= packagejs.version %>", "html-loader": "0.5.5", "html-webpack-plugin": "3.2.0", <%_ if (!skipCommitHook) { _%> - "husky": "1.3.1", + "husky": "2.3.0", <%_ } _%> - "jest": "24.7.1", - "jest-junit": "6.3.0", - "jest-preset-angular": "7.0.1", + "jest": "24.8.0", + "jest-junit": "6.4.0", + "jest-preset-angular": "7.1.1", "jest-sonar-reporter": "2.0.0", <%_ if (!skipCommitHook) { _%> - "lint-staged": "8.1.5", + "lint-staged": "8.1.7", <%_ } _%> <%_ if (enableTranslation) { _%> - "merge-jsons-webpack-plugin": "1.0.18", + "merge-jsons-webpack-plugin": "1.0.19", <%_ } _%> - "mini-css-extract-plugin": "0.5.0", + "mini-css-extract-plugin": "0.7.0", <%_ if (protractorTests) { _%> "mocha": "6.1.4", <%_ } _%> "moment-locales-webpack-plugin": "1.0.7", "optimize-css-assets-webpack-plugin": "5.0.1", "postcss-loader": "3.0.0", - "prettier": "1.16.4", + "prettier": "1.17.1", <%_ if (protractorTests) { _%> "protractor": "5.4.2", <%_ } _%> "reflect-metadata": "0.1.13", "rimraf": "2.6.3", - "sass": "1.17.4", + "sass": "1.20.1", "sass-loader": "7.1.0", "simple-progress-webpack-plugin": "1.1.2", "style-loader": "0.23.1", - "terser-webpack-plugin": "1.2.3", + "terser-webpack-plugin": "1.3.0", "thread-loader": "2.1.2", "to-string-loader": "1.1.5", - "ts-loader": "5.3.3", + "ts-loader": "6.0.1", <%_ if (protractorTests) { _%> "ts-node": "8.0.3", <%_ } _%> - "tslint": "5.15.0", + "tslint": "5.16.0", "tslint-config-prettier": "1.18.0", "tslint-loader": "3.5.4", - "typescript": "3.2.4", + "typescript": "3.4.5", <%_ otherModules.forEach(module => { _%> "<%= module.name %>": "<%= module.version %>", <%_ }); _%> <%_ if (protractorTests) { _%> "webdriver-manager": "12.1.4", <%_ } _%> - "webpack": "4.29.6", - "webpack-cli": "3.3.0", - "webpack-dev-server": "3.2.1", + "webpack": "4.32.2", + "webpack-cli": "3.3.2", + "webpack-dev-server": "3.4.1", "webpack-merge": "4.2.1", "webpack-notifier": "1.7.0", "webpack-visualizer-plugin": "0.1.11", - "workbox-webpack-plugin": "3.6.3", + "workbox-webpack-plugin": "4.3.1", "write-file-webpack-plugin": "4.5.0"<% if (buildTool === 'maven') { %>, "xml2js": "0.4.19" <%_ } _%> From 341cadda1ad7e46261487fcd3ea002aa0ff2e76d Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 30 May 2019 00:02:20 +0530 Subject: [PATCH 2/6] revert ngx-cookie upgrade and fix health check tests --- generators/client/templates/angular/package.json.ejs | 2 +- .../spec/app/admin/health/health.component.spec.ts.ejs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 5101fab5fd6d..1e82719625f6 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -47,7 +47,7 @@ "core-js": "2.6.5", "moment": "2.24.0", "ng-jhipster": "0.9.3", - "ngx-cookie": "4.1.2", + "ngx-cookie": "4.0.2", "ngx-infinite-scroll": "7.1.0", "ngx-webstorage": "3.0.2", "rxjs": "6.5.2", diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/health/health.component.spec.ts.ejs b/generators/client/templates/angular/src/test/javascript/spec/app/admin/health/health.component.spec.ts.ejs index 9492fc8d39e4..cbf180d73b2e 100644 --- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/health/health.component.spec.ts.ejs +++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/health/health.component.spec.ts.ejs @@ -313,7 +313,7 @@ describe('Component Tests', () => { it('should call refresh on init', () => { // GIVEN spyOn(service, 'checkHealth').and.returnValue(of(new HttpResponse())); - spyOn(service, 'transformHealthData').and.returnValue(of({data: 'test'})); + spyOn(service, 'transformHealthData').and.returnValue({ data: 'test' }); // WHEN comp.ngOnInit() @@ -321,12 +321,12 @@ describe('Component Tests', () => { // THEN expect(service.checkHealth).toHaveBeenCalled(); expect(service.transformHealthData).toHaveBeenCalled(); - expect(comp.healthData.value).toEqual({data: 'test'}); + expect(comp.healthData).toEqual({data: 'test'}); }); it('should handle a 503 on refreshing health data', () => { // GIVEN spyOn(service, 'checkHealth').and.returnValue(throwError(new HttpErrorResponse({status: 503, error: 'Mail down'}))); - spyOn(service, 'transformHealthData').and.returnValue(of({health: 'down'})); + spyOn(service, 'transformHealthData').and.returnValue({ health: 'down' }); // WHEN comp.refresh(); @@ -334,7 +334,7 @@ describe('Component Tests', () => { // THEN expect(service.checkHealth).toHaveBeenCalled(); expect(service.transformHealthData).toHaveBeenCalled(); - expect(comp.healthData.value).toEqual({health: 'down'}); + expect(comp.healthData).toEqual({health: 'down'}); }); }); }); From 236ab0c07cab65d09d6f76a11f207d18d74ea944 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 30 May 2019 22:37:16 +0530 Subject: [PATCH 3/6] Update corejs, e2e dependencies, and removed storage mocks --- generators/client/templates/angular/package.json.ejs | 8 ++++---- .../angular/src/main/webapp/app/polyfills.ts.ejs | 2 +- .../src/test/javascript/jest-global-mocks.ts.ejs | 12 ------------ 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 1e82719625f6..a1c14f53fde1 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -44,12 +44,12 @@ <%_ if (clientTheme !== 'none') { _%> "bootswatch": "4.3.1", <%_ } _%> - "core-js": "2.6.5", + "core-js": "3.1.3", "moment": "2.24.0", "ng-jhipster": "0.9.3", "ngx-cookie": "4.0.2", "ngx-infinite-scroll": "7.1.0", - "ngx-webstorage": "3.0.2", + "ngx-webstorage": "4.0.0", "rxjs": "6.5.2", "swagger-ui": "2.2.10", <%_ if (websocket === 'spring-websocket') { _%> @@ -73,7 +73,7 @@ <%_ } _%> "@types/node": "10.12.27", <%_ if (protractorTests) { _%> - "@types/selenium-webdriver": "3.0.15", + "@types/selenium-webdriver": "4.0.0", <%_ } _%> "angular-router-loader": "0.8.5", "angular2-template-loader": "0.6.2", @@ -131,7 +131,7 @@ "to-string-loader": "1.1.5", "ts-loader": "6.0.1", <%_ if (protractorTests) { _%> - "ts-node": "8.0.3", + "ts-node": "8.2.0", <%_ } _%> "tslint": "5.16.0", "tslint-config-prettier": "1.18.0", diff --git a/generators/client/templates/angular/src/main/webapp/app/polyfills.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/polyfills.ts.ejs index 00850a7365c3..15004a2aa011 100644 --- a/generators/client/templates/angular/src/main/webapp/app/polyfills.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/polyfills.ts.ejs @@ -16,6 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import 'core-js/es7/reflect'; +import 'core-js/proposals/reflect-metadata'; import 'zone.js/dist/zone'; require('../manifest.webapp'); diff --git a/generators/client/templates/angular/src/test/javascript/jest-global-mocks.ts.ejs b/generators/client/templates/angular/src/test/javascript/jest-global-mocks.ts.ejs index a99825985793..46af033b4e53 100644 --- a/generators/client/templates/angular/src/test/javascript/jest-global-mocks.ts.ejs +++ b/generators/client/templates/angular/src/test/javascript/jest-global-mocks.ts.ejs @@ -1,15 +1,3 @@ -const mock = () => { - let storage = {}; - return { - getItem: key => (key in storage ? storage[key] : null), - setItem: (key, value) => (storage[key] = value || ''), - removeItem: key => delete storage[key], - clear: () => (storage = {}) - }; -}; - -Object.defineProperty(window, 'localStorage', { value: mock() }); -Object.defineProperty(window, 'sessionStorage', { value: mock() }); Object.defineProperty(window, 'getComputedStyle', { value: () => ['-webkit-appearance'] }); From 65146f01c96b753f68dc316314b57121343202e4 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 30 May 2019 22:41:41 +0530 Subject: [PATCH 4/6] Update cache loader --- generators/client/templates/angular/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index a1c14f53fde1..61d7de6b815e 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -81,7 +81,7 @@ "base-href-webpack-plugin": "2.0.0", "browser-sync": "2.26.5", "browser-sync-webpack-plugin": "2.2.2", - "cache-loader": "2.0.1", + "cache-loader": "3.0.1", <%_ if (protractorTests) { _%> "chai": "4.2.0", "chai-as-promised": "7.1.1", From bccc3054a39c51b22e5806abb725cb0171742e27 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Fri, 31 May 2019 17:17:45 +0530 Subject: [PATCH 5/6] Revert ng-bootstrap to old version --- generators/client/templates/angular/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 61d7de6b815e..34ac95cf8d7d 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -37,7 +37,7 @@ "@fortawesome/angular-fontawesome": "0.4.0", "@fortawesome/fontawesome-svg-core": "1.2.18", "@fortawesome/free-solid-svg-icons": "5.8.2", - "@ng-bootstrap/ng-bootstrap": "4.2.0", + "@ng-bootstrap/ng-bootstrap": "4.1.3", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "bootstrap": "4.3.1", From 0ef1e00626058581484ea3806052c8214204445f Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Fri, 31 May 2019 20:06:17 +0530 Subject: [PATCH 6/6] Disable cli analytics --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index cb4455e0ae7d..a50d86e573b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,7 @@ env: - JHI_DISABLE_WEBPACK_LOGS=true - JHI_E2E_HEADLESS=true - JHI_SCRIPTS=$TRAVIS_BUILD_DIR/test-integration/scripts + - NG_CLI_ANALYTICS="false" matrix: - JHI_APP=ngx-default JHI_PROFILE=prod JHI_PROTRACTOR=1 JHI_ENTITY=sql JHI_SONAR=1 - JHI_APP=ngx-psql-es-noi18n-mapsid JHI_PROFILE=prod JHI_PROTRACTOR=1 JHI_ENTITY=sqlfull