From ed8164037395f498d16ac0500015a78849e688c9 Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 16:06:08 +0500 Subject: [PATCH 1/7] Remove bad npm package --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 4fae5ba..2f16ad2 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "@angular/platform-server": "^9.1.6", "@compodoc/compodoc": "1.1.11", "@nguniversal/express-engine": "^9.1.1", - "@nguniversal/module-map-ngfactory-loader": "^8.2.6", "@types/node": "~8.9.4", "copyfiles": "^2.2.0", "cpr": "^3.0.1", From db3764d7b3b786a3fcb1b9fa412de9abdfea00d6 Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 16:22:11 +0500 Subject: [PATCH 2/7] Update to Angular 10 --- package.json | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 2f16ad2..bce65de 100644 --- a/package.json +++ b/package.json @@ -70,23 +70,20 @@ }, "homepage": "https://github.com/ManuCutillas/ngx-responsive", "private": false, - "peerDependencies": { - "@angular/common": "^9.1.6", - "@angular/core": "^9.1.6" - }, + "peerDependencies": {}, "devDependencies": { - "@angular/animations": "^9.1.6", - "@angular/cli": "^9.0.1", - "@angular/common": "^9.1.6", - "@angular/compiler": "^9.1.6", - "@angular/compiler-cli": "^9.1.6", - "@angular/core": "^9.1.6", - "@angular/language-service": "^9.1.6", - "@angular/platform-browser": "^9.1.6", - "@angular/platform-browser-dynamic": "^9.1.6", - "@angular/platform-server": "^9.1.6", + "@angular/animations": "^10.2.5", + "@angular/cli": "^10.2.4", + "@angular/common": "^10.2.5", + "@angular/compiler": "^10.2.5", + "@angular/compiler-cli": "^10.2.5", + "@angular/core": "^10.2.5", + "@angular/language-service": "^10.2.5", + "@angular/platform-browser": "^10.2.5", + "@angular/platform-browser-dynamic": "^10.2.5", + "@angular/platform-server": "^10.2.5", "@compodoc/compodoc": "1.1.11", - "@nguniversal/express-engine": "^9.1.1", + "@nguniversal/express-engine": "^10.1.0", "@types/node": "~8.9.4", "copyfiles": "^2.2.0", "cpr": "^3.0.1", @@ -100,7 +97,7 @@ "tsickle": "^0.38.1", "ts-node": "~8.10.1", "tslint": "~6.1.2", - "typescript": "~3.8.3", + "typescript": "~4.0.8", "zone.js": "~0.10.3" } -} +} \ No newline at end of file From bd8434b44db7151424de8d1b75461703417f8afa Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 16:29:37 +0500 Subject: [PATCH 3/7] Update to Angular 11 --- package.json | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index bce65de..580e398 100644 --- a/package.json +++ b/package.json @@ -72,29 +72,28 @@ "private": false, "peerDependencies": {}, "devDependencies": { - "@angular/animations": "^10.2.5", - "@angular/cli": "^10.2.4", - "@angular/common": "^10.2.5", - "@angular/compiler": "^10.2.5", - "@angular/compiler-cli": "^10.2.5", - "@angular/core": "^10.2.5", - "@angular/language-service": "^10.2.5", - "@angular/platform-browser": "^10.2.5", - "@angular/platform-browser-dynamic": "^10.2.5", - "@angular/platform-server": "^10.2.5", + "@angular-devkit/build-angular": "~0.1102.18", + "@angular/animations": "^11.2.14", + "@angular/cli": "^11.2.19", + "@angular/common": "^11.2.14", + "@angular/compiler": "^11.2.14", + "@angular/compiler-cli": "^11.2.14", + "@angular/core": "^11.2.14", + "@angular/language-service": "^11.2.14", + "@angular/platform-browser": "^11.2.14", + "@angular/platform-browser-dynamic": "^11.2.14", + "@angular/platform-server": "^11.2.14", "@compodoc/compodoc": "1.1.11", - "@nguniversal/express-engine": "^10.1.0", + "@nguniversal/express-engine": "^11.2.1", "@types/node": "~8.9.4", "copyfiles": "^2.2.0", "cpr": "^3.0.1", "del-cli": "^3.0.0", - "codelyzer": "^5.2.2", - "ng-packagr": "^9.1.3", + "ng-packagr": "^11.0.0", "onchange": "^7.0.2", - "protractor": "~5.4.4", + "protractor": "~7.0.0", "source-map-explorer": "^2.4.2", "ts-loader": "^6.2.1", - "tsickle": "^0.38.1", "ts-node": "~8.10.1", "tslint": "~6.1.2", "typescript": "~4.0.8", From 86dff234289c893ddff9d7be8b3de7a7ea26c939 Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 16:39:27 +0500 Subject: [PATCH 4/7] Update to Angular 12 --- examples/src/polyfills.ts | 2 +- examples/src/test.ts | 2 +- package.json | 30 +++++++++++++++--------------- tsconfig.json | 1 - 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/examples/src/polyfills.ts b/examples/src/polyfills.ts index aa665d6..e484510 100644 --- a/examples/src/polyfills.ts +++ b/examples/src/polyfills.ts @@ -55,7 +55,7 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. +import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** diff --git a/examples/src/test.ts b/examples/src/test.ts index 1631789..a6f15af 100644 --- a/examples/src/test.ts +++ b/examples/src/test.ts @@ -1,6 +1,6 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/zone-testing'; +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, diff --git a/package.json b/package.json index 580e398..75e6129 100644 --- a/package.json +++ b/package.json @@ -72,31 +72,31 @@ "private": false, "peerDependencies": {}, "devDependencies": { - "@angular-devkit/build-angular": "~0.1102.18", - "@angular/animations": "^11.2.14", - "@angular/cli": "^11.2.19", - "@angular/common": "^11.2.14", - "@angular/compiler": "^11.2.14", - "@angular/compiler-cli": "^11.2.14", - "@angular/core": "^11.2.14", - "@angular/language-service": "^11.2.14", - "@angular/platform-browser": "^11.2.14", - "@angular/platform-browser-dynamic": "^11.2.14", - "@angular/platform-server": "^11.2.14", + "@angular-devkit/build-angular": "~12.2.18", + "@angular/animations": "^12.2.16", + "@angular/cli": "^12.2.18", + "@angular/common": "^12.2.16", + "@angular/compiler": "^12.2.16", + "@angular/compiler-cli": "^12.2.16", + "@angular/core": "^12.2.16", + "@angular/language-service": "^12.2.16", + "@angular/platform-browser": "^12.2.16", + "@angular/platform-browser-dynamic": "^12.2.16", + "@angular/platform-server": "^12.2.16", "@compodoc/compodoc": "1.1.11", - "@nguniversal/express-engine": "^11.2.1", + "@nguniversal/express-engine": "^12.1.3", "@types/node": "~8.9.4", "copyfiles": "^2.2.0", "cpr": "^3.0.1", "del-cli": "^3.0.0", - "ng-packagr": "^11.0.0", + "ng-packagr": "^12.2.7", "onchange": "^7.0.2", "protractor": "~7.0.0", "source-map-explorer": "^2.4.2", "ts-loader": "^6.2.1", "ts-node": "~8.10.1", "tslint": "~6.1.2", - "typescript": "~4.0.8", - "zone.js": "~0.10.3" + "typescript": "~4.3.5", + "zone.js": "~0.11.4" } } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index cdc1835..c25fb0b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { "baseUrl": ".", - "emitDecoratorMetadata": true, "experimentalDecorators": true, "strict": true, "module": "commonjs", From ce34233e59bcf59e5aec8089ce293d12d1e6fc62 Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 16:43:55 +0500 Subject: [PATCH 5/7] Update to Angular 13 --- .gitignore | 1 + ng-package.json | 4 +-- package.json | 34 ++++++++----------- .../responsive-base/responsive-base.ts | 2 ++ src/{index.ts => public_api.ts} | 0 5 files changed, 20 insertions(+), 21 deletions(-) rename src/{index.ts => public_api.ts} (100%) diff --git a/.gitignore b/.gitignore index 8f4c558..ca51a75 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ expamples/package-lock.json *.iml # misc +/.angular/cache *.js *.map *.d.ts diff --git a/ng-package.json b/ng-package.json index 26426e5..d4ee8e1 100644 --- a/ng-package.json +++ b/ng-package.json @@ -1,8 +1,8 @@ { "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "name": "ngx-responsive", - "version": "9.0.0", + "version": "9.0.1", "lib": { - "entryFile": "src/index.ts" + "entryFile": "src/public_api.ts" } } \ No newline at end of file diff --git a/package.json b/package.json index 75e6129..b624cf1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { - "$schema": "./node_modules/ng-packagr/package.schema.json", "name": "ngx-responsive", - "version": "9.0.3", + "version": "9.0.4", "description": "Superset of RESPONSIVE DIRECTIVES to show or hide items according to the size of the device screen and another features in Angular 9", "scripts": { "start": "ng serve --aot", @@ -14,9 +13,6 @@ "e2e": "ng e2e" }, "ngPackage": { - "lib": { - "entryFile": "src/index.ts" - } }, "typings": "./index.d.ts", "repository": { @@ -72,31 +68,31 @@ "private": false, "peerDependencies": {}, "devDependencies": { - "@angular-devkit/build-angular": "~12.2.18", - "@angular/animations": "^12.2.16", - "@angular/cli": "^12.2.18", - "@angular/common": "^12.2.16", - "@angular/compiler": "^12.2.16", - "@angular/compiler-cli": "^12.2.16", - "@angular/core": "^12.2.16", - "@angular/language-service": "^12.2.16", - "@angular/platform-browser": "^12.2.16", - "@angular/platform-browser-dynamic": "^12.2.16", - "@angular/platform-server": "^12.2.16", + "@angular-devkit/build-angular": "~13.3.9", + "@angular/animations": "^13.3.11", + "@angular/cli": "^13.3.9", + "@angular/common": "^13.3.11", + "@angular/compiler": "^13.3.11", + "@angular/compiler-cli": "^13.3.11", + "@angular/core": "^13.3.11", + "@angular/language-service": "^13.3.11", + "@angular/platform-browser": "^13.3.11", + "@angular/platform-browser-dynamic": "^13.3.11", + "@angular/platform-server": "^13.3.11", "@compodoc/compodoc": "1.1.11", - "@nguniversal/express-engine": "^12.1.3", + "@nguniversal/express-engine": "^13.1.1", "@types/node": "~8.9.4", "copyfiles": "^2.2.0", "cpr": "^3.0.1", "del-cli": "^3.0.0", - "ng-packagr": "^12.2.7", + "ng-packagr": "^13.3.1", "onchange": "^7.0.2", "protractor": "~7.0.0", "source-map-explorer": "^2.4.2", "ts-loader": "^6.2.1", "ts-node": "~8.10.1", "tslint": "~6.1.2", - "typescript": "~4.3.5", + "typescript": "~4.6.4", "zone.js": "~0.11.4" } } \ No newline at end of file diff --git a/src/@core/providers/responsive-base/responsive-base.ts b/src/@core/providers/responsive-base/responsive-base.ts index 88bf990..1de024a 100644 --- a/src/@core/providers/responsive-base/responsive-base.ts +++ b/src/@core/providers/responsive-base/responsive-base.ts @@ -11,12 +11,14 @@ import { OnInit, OnDestroy, ChangeDetectorRef, + Injectable, } from '@angular/core'; import { Subscription } from 'rxjs'; import { IResponsiveSubscriptions } from '../../interfaces'; import { ResponsiveState } from '../responsive-state/responsive-state'; import { PlatformService } from '../platform-service/platform.service'; +@Injectable() export abstract class RESPONSIVE_BASE implements OnInit, OnDestroy { private _noRepeat = 0; diff --git a/src/index.ts b/src/public_api.ts similarity index 100% rename from src/index.ts rename to src/public_api.ts From 66c60f1c7a4fb1f613bb72e0251b06b7f68df9f3 Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 17:02:30 +0500 Subject: [PATCH 6/7] Update to Angular 14 --- package.json | 29 ++++++++++++++++------------- tsconfig.json | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index b624cf1..7357266 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "e2e": "ng e2e" }, "ngPackage": { + "lib": { + "entryFile": "public_api.ts" + } }, "typings": "./index.d.ts", "repository": { @@ -68,24 +71,24 @@ "private": false, "peerDependencies": {}, "devDependencies": { - "@angular-devkit/build-angular": "~13.3.9", - "@angular/animations": "^13.3.11", - "@angular/cli": "^13.3.9", - "@angular/common": "^13.3.11", - "@angular/compiler": "^13.3.11", - "@angular/compiler-cli": "^13.3.11", - "@angular/core": "^13.3.11", - "@angular/language-service": "^13.3.11", - "@angular/platform-browser": "^13.3.11", - "@angular/platform-browser-dynamic": "^13.3.11", - "@angular/platform-server": "^13.3.11", + "@angular-devkit/build-angular": "^14.1.3", + "@angular/animations": "^14.1.3", + "@angular/cli": "^14.1.3", + "@angular/common": "^14.1.3", + "@angular/compiler": "^14.1.3", + "@angular/compiler-cli": "^14.1.3", + "@angular/core": "^14.1.3", + "@angular/language-service": "^14.1.3", + "@angular/platform-browser": "^14.1.3", + "@angular/platform-browser-dynamic": "^14.1.3", + "@angular/platform-server": "^14.1.3", "@compodoc/compodoc": "1.1.11", - "@nguniversal/express-engine": "^13.1.1", + "@nguniversal/express-engine": "^14.1.0", "@types/node": "~8.9.4", "copyfiles": "^2.2.0", "cpr": "^3.0.1", "del-cli": "^3.0.0", - "ng-packagr": "^13.3.1", + "ng-packagr": "^14.1.0", "onchange": "^7.0.2", "protractor": "~7.0.0", "source-map-explorer": "^2.4.2", diff --git a/tsconfig.json b/tsconfig.json index c25fb0b..37c867f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "rootDir": ".", "sourceMap": true, "inlineSources": true, - "target": "es5", + "target": "es2020", "skipLibCheck": true, "lib": [ "es2015", From 8910bda60f0665cb5d0d3c4fb6828efb24179e33 Mon Sep 17 00:00:00 2001 From: Hassan Asad Date: Sat, 20 Aug 2022 17:30:30 +0500 Subject: [PATCH 7/7] Fix ng-packagr errors --- ng-package.json | 2 - package.json | 24 +++----- tsconfig.json | 3 +- v4-0-1-to-v5-0-3.md | 145 -------------------------------------------- 4 files changed, 10 insertions(+), 164 deletions(-) delete mode 100644 v4-0-1-to-v5-0-3.md diff --git a/ng-package.json b/ng-package.json index d4ee8e1..13bbf76 100644 --- a/ng-package.json +++ b/ng-package.json @@ -1,7 +1,5 @@ { "$schema": "./node_modules/ng-packagr/ng-package.schema.json", - "name": "ngx-responsive", - "version": "9.0.1", "lib": { "entryFile": "src/public_api.ts" } diff --git a/package.json b/package.json index 7357266..42e7aaf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-responsive", - "version": "9.0.4", + "version": "9.0.5", "description": "Superset of RESPONSIVE DIRECTIVES to show or hide items according to the size of the device screen and another features in Angular 9", "scripts": { "start": "ng serve --aot", @@ -12,12 +12,6 @@ "lint": "ng lint", "e2e": "ng e2e" }, - "ngPackage": { - "lib": { - "entryFile": "public_api.ts" - } - }, - "typings": "./index.d.ts", "repository": { "type": "git", "url": "git+https://github.com/ManuCutillas/ngx-responsive.git" @@ -85,17 +79,17 @@ "@compodoc/compodoc": "1.1.11", "@nguniversal/express-engine": "^14.1.0", "@types/node": "~8.9.4", - "copyfiles": "^2.2.0", + "copyfiles": "^2.4.1", "cpr": "^3.0.1", - "del-cli": "^3.0.0", + "del-cli": "^5.0.0", "ng-packagr": "^14.1.0", - "onchange": "^7.0.2", + "onchange": "^7.1.0", "protractor": "~7.0.0", - "source-map-explorer": "^2.4.2", - "ts-loader": "^6.2.1", - "ts-node": "~8.10.1", - "tslint": "~6.1.2", + "source-map-explorer": "^2.5.2", + "ts-loader": "^9.3.1", + "ts-node": "~10.9.1", + "tslint": "~6.1.3", "typescript": "~4.6.4", - "zone.js": "~0.11.4" + "zone.js": "~0.11.8" } } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 37c867f..c557737 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "baseUrl": ".", "experimentalDecorators": true, "strict": true, - "module": "commonjs", "moduleResolution": "node", "strictNullChecks": false, "noImplicitAny": false, @@ -14,7 +13,7 @@ "target": "es2020", "skipLibCheck": true, "lib": [ - "es2015", + "es2018", "dom" ], "typeRoots": [ diff --git a/v4-0-1-to-v5-0-3.md b/v4-0-1-to-v5-0-3.md deleted file mode 100644 index 07619fa..0000000 --- a/v4-0-1-to-v5-0-3.md +++ /dev/null @@ -1,145 +0,0 @@ -### Breacking Changes in V5.0.3 - -- **New method to set the custom config**: - - - v4.0.1 - ``` - import { NgModule } from '@angular/core' - import { ResponsiveModule, ResponsiveConfig } from 'ngx-responsive' - ... - let config = { - breakPoints: { - xs: {max: 600}, - sm: {min: 601, max: 959}, - md: {min: 960, max: 1279}, - lg: {min: 1280, max: 1919}, - xl: {min: 1920} - }, - debounceTime: 100 // allow to debounce checking timer - }; - - export function ResponsiveDefinition(){ - return new ResponsiveConfig(config); - }; - ... - @NgModule({ - imports: [ - ResponsiveModule - ], - declarations: [ - AppComponent - ], - providers:[{ - provide: ResponsiveConfig, - useFactory: ResponsiveDefinition }] - }) - export class AppModule { } - ``` - - - v5.0.3 - ``` - import { NgModule } from '@angular/core' - import { ResponsiveModule } from 'ngx-responsive' - ... - const config = { - breakPoints: { - xs: {max: 600}, - sm: {min: 601, max: 959}, - md: {min: 960, max: 1279}, - lg: {min: 1280, max: 1919}, - xl: {min: 1920} - }, - debounceTime: 100 - }; - ... - @NgModule({ - imports: [ - BrowserModule, - ResponsiveModule.forRoot(config) - ], - declarations: [ - AppComponent - ], - providers:[] - }) - export class AppModule { } - ``` - -### New Features in V5.0.3: - -- **Reactive services that expose changes through observables**: - - BrowserInfoRx - - IeInfoRx - - DeviceInfoRx - - DeviceStandardInfoRx - - OrientationInfoRx - - ResponsiveSizeInfoRx - - UserAgentInfoRx - - **Example:** - We initialize the service and we subscribe to the event changes: - 1. Inject the service in the constructor: - - ``` - constructor( - public browserInfoRx: BrowserInfoRx - ) {} - - ``` - - 2. Connet to the reactive service: - - ``` - ngOnInit(): void { - this.browserInfoRx.connect(); - } - - ``` - 3. And subscribe to the events service: - - ``` - this.browserInfoRx.getBrowser.subscribe((data) => { - console.log('this.browserInfoRx.getBrowser ===>', data); - }, (err) => { - console.log('Error', err); - }); - - ``` - or : - - ``` - ngOnInit(): void { - this.browserInfoRx.connect().subscribe((data) => { - console.log('this.browserInfoRx.getBrowser ===>', data); - }, (err) => { - console.log('Error', err); - }); - } - - ``` - 4. And remove yours subscriptions: - - ``` - ngOnDestroy(): void { - this.browserInfoRx.disconnect(); - } - ``` - -### Methods to subscribe to the observables for each of the reactive services: - -- BrowserInfoRx -> getBrowser -> ```BrowserInfoRx.getBrowser ``` - -- IeInfoRx -> getIE -> ```IeInfoRx.getIE ``` - -- DeviceInfoRx -> getDevice -> ```DeviceInfoRx.getDevice ``` - -- DeviceStandardInfoRx -> getStandardDevice -> ```DeviceStandardInfoRx.getStandardDevice ``` - -- OrientationInfoRx -> getOrientation -> ```OrientationInfoRx.getOrientation ``` - -- ResponsiveSizeInfoRx -> getResponsiveSize -> ```ResponsiveSizeInfoRx.getResponsiveSize ``` - -- UserAgentInfoRx -> getUserAgent -> ```UserAgentInfoRx.getUserAgent ``` - - -