From 9c371cf69817f1cced15a36fff853d09517cc64a Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 00:58:03 +0200 Subject: [PATCH 1/9] Started adding first Deps --- README.md | 9 ++++++++- package.json | 6 +++++- src/main.ts | 0 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/main.ts diff --git a/README.md b/README.md index e0ab1d1..1500c11 100644 --- a/README.md +++ b/README.md @@ -189,4 +189,11 @@ This value allows you to control dynamic offsets based on the width of the devic [opt-dep-status-badge]: https://img.shields.io/david/optional/nicky-lenaers/ngx-scroll-to.svg?style=flat-square [opt-dep-status-badge-url]: https://david-dm.org/nicky-lenaers/ngx-scroll-to?type=optional [licence-badge]: https://img.shields.io/npm/l/@nicky-lenaers/ngx-scroll-to.svg?style=flat-square -[licence-badge-url]: https://github.com/nicky-lenaers/ngx-scroll-to/blob/master/LICENSE \ No newline at end of file +[licence-badge-url]: https://github.com/nicky-lenaers/ngx-scroll-to/blob/master/LICENSE + + \ No newline at end of file diff --git a/package.json b/package.json index c2959ee..cba0eb6 100644 --- a/package.json +++ b/package.json @@ -52,11 +52,15 @@ "@angular/compiler": "^4.0.0", "@angular/compiler-cli": "^4.0.0", "@types/node": "^8.0.14", + "angular2-template-loader": "^0.6.2", + "awesome-typescript-loader": "^3.2.1", "copyfiles": "^1.2.0", + "raw-loader": "^0.5.1", "renamer": "^0.6.1", "rimraf": "^2.6.1", "rollup": "^0.45.2", "typescript": "^2.3.4", - "uglify-js": "^3.0.16" + "uglify-js": "^3.0.16", + "webpack": "^3.3.0" } } diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..e69de29 From 52ccdb74ec48e58027ddba9ea49e5a8ee75bd880 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 18:23:22 +0200 Subject: [PATCH 2/9] =Release 0.2.0 --- CHANGELOG.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- src/package.json | 2 +- 3 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..830c33b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,103 @@ + +# 0.2.0 (2017-07-21) + +* Add Publish Script ([f755650](https://github.com/nicky-lenaers/ngx-scroll-to/commit/f755650)) +* Change Command for Publish Version ([deea855](https://github.com/nicky-lenaers/ngx-scroll-to/commit/deea855)) +* Remove shell script ([362174a](https://github.com/nicky-lenaers/ngx-scroll-to/commit/362174a)) +* Reverse Script Order ([a34949b](https://github.com/nicky-lenaers/ngx-scroll-to/commit/a34949b)) +* Support for nested scrolling ([da68855](https://github.com/nicky-lenaers/ngx-scroll-to/commit/da68855)), closes [#2](https://github.com/nicky-lenaers/ngx-scroll-to/issues/2) +* Update Packages ([9e3f592](https://github.com/nicky-lenaers/ngx-scroll-to/commit/9e3f592)) +* Update README ([54791de](https://github.com/nicky-lenaers/ngx-scroll-to/commit/54791de)) +* Update README ([5fc2e33](https://github.com/nicky-lenaers/ngx-scroll-to/commit/5fc2e33)) +* Update README ([e7a94c1](https://github.com/nicky-lenaers/ngx-scroll-to/commit/e7a94c1)) +* Update README ([8763ab2](https://github.com/nicky-lenaers/ngx-scroll-to/commit/8763ab2)) +* Update README ([72d0ce5](https://github.com/nicky-lenaers/ngx-scroll-to/commit/72d0ce5)) +* Update README ([f79b975](https://github.com/nicky-lenaers/ngx-scroll-to/commit/f79b975)) + + + + +## 0.1.7 (2017-07-20) + +* 0.1.7 ([57ab364](https://github.com/nicky-lenaers/ngx-scroll-to/commit/57ab364)) +* Update README ([cd9e75f](https://github.com/nicky-lenaers/ngx-scroll-to/commit/cd9e75f)) + + + + +## 0.1.6 (2017-07-20) + +* 0.1.6 ([78007b2](https://github.com/nicky-lenaers/ngx-scroll-to/commit/78007b2)) +* Update README ([54b6361](https://github.com/nicky-lenaers/ngx-scroll-to/commit/54b6361)) + + + + +## 0.1.5 (2017-07-20) + +* 0.1.5 ([2184b68](https://github.com/nicky-lenaers/ngx-scroll-to/commit/2184b68)) +* Update Description ([3591eee](https://github.com/nicky-lenaers/ngx-scroll-to/commit/3591eee)) +* Update README ([c433029](https://github.com/nicky-lenaers/ngx-scroll-to/commit/c433029)) + + + + +## 0.1.4 (2017-07-20) + +* 0.1.4 ([a5afa36](https://github.com/nicky-lenaers/ngx-scroll-to/commit/a5afa36)) +* Update Dependencies ([f199092](https://github.com/nicky-lenaers/ngx-scroll-to/commit/f199092)) +* Update README ([ed1438c](https://github.com/nicky-lenaers/ngx-scroll-to/commit/ed1438c)) + + + + +## 0.1.3 (2017-07-20) + +* 0.1.3 ([47dc5c5](https://github.com/nicky-lenaers/ngx-scroll-to/commit/47dc5c5)) +* Added GitHub Release Script ([21e488a](https://github.com/nicky-lenaers/ngx-scroll-to/commit/21e488a)) +* Typo ([d5f14ae](https://github.com/nicky-lenaers/ngx-scroll-to/commit/d5f14ae)) +* Update README ([31a87cd](https://github.com/nicky-lenaers/ngx-scroll-to/commit/31a87cd)) +* Update README ([130b961](https://github.com/nicky-lenaers/ngx-scroll-to/commit/130b961)) + + + + +## 0.1.2 (2017-07-20) + +* 0.1.2 ([5bafd90](https://github.com/nicky-lenaers/ngx-scroll-to/commit/5bafd90)) +* Update README ([3263e59](https://github.com/nicky-lenaers/ngx-scroll-to/commit/3263e59)) +* Update Version ([3bf4438](https://github.com/nicky-lenaers/ngx-scroll-to/commit/3bf4438)) + + + + +## 0.1.1 (2017-07-20) + +* 0.1.1 ([667b923](https://github.com/nicky-lenaers/ngx-scroll-to/commit/667b923)) +* Export Interfaces ([67bc0a6](https://github.com/nicky-lenaers/ngx-scroll-to/commit/67bc0a6)) +* Update README ([b866300](https://github.com/nicky-lenaers/ngx-scroll-to/commit/b866300)) +* Update Version ([419b331](https://github.com/nicky-lenaers/ngx-scroll-to/commit/419b331)) + + + + +# 0.1.0 (2017-07-20) + +* 0.1.0 ([4d8a5e2](https://github.com/nicky-lenaers/ngx-scroll-to/commit/4d8a5e2)) +* Added Types for Event ([6e9adcc](https://github.com/nicky-lenaers/ngx-scroll-to/commit/6e9adcc)) +* Update README ([5c948f9](https://github.com/nicky-lenaers/ngx-scroll-to/commit/5c948f9)) +* Update Version ([6679ef8](https://github.com/nicky-lenaers/ngx-scroll-to/commit/6679ef8)) + + + + +## 0.0.2 (2017-07-20) + +* 0.0.2 ([7a3a6c2](https://github.com/nicky-lenaers/ngx-scroll-to/commit/7a3a6c2)) +* Initial commit ([743a391](https://github.com/nicky-lenaers/ngx-scroll-to/commit/743a391)) +* Proper Angular 4 Peer Dependency ([6af5014](https://github.com/nicky-lenaers/ngx-scroll-to/commit/6af5014)) +* Source Files ([15aa04c](https://github.com/nicky-lenaers/ngx-scroll-to/commit/15aa04c)) +* Update Version ([9aa506e](https://github.com/nicky-lenaers/ngx-scroll-to/commit/9aa506e)) + + + diff --git a/package.json b/package.json index 046c8ce..4e6ac18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.1.7", + "version": "0.2.0", "description": "Angular X Scroll To", "main": "dist/index.js", "scripts": { diff --git a/src/package.json b/src/package.json index acb1806..6e0edb4 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.1.7", + "version": "0.2.0", "description": "A simple Angular 4+ plugin enabling you to scroll to any element on your page and enhance scroll-based features in your app.", "main": "bundles/ngx-scroll-to.umd.min.js", "module": "index.js", From 93490d136131ca03e211a4ad86b96bc036780c04 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 18:28:18 +0200 Subject: [PATCH 3/9] Revert Version Update --- package.json | 2 +- scripts/prepublish.sh | 1 + src/package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4e6ac18..046c8ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.2.0", + "version": "0.1.7", "description": "Angular X Scroll To", "main": "dist/index.js", "scripts": { diff --git a/scripts/prepublish.sh b/scripts/prepublish.sh index 3a57c33..549c963 100644 --- a/scripts/prepublish.sh +++ b/scripts/prepublish.sh @@ -46,6 +46,7 @@ eval "git tag ${PACKAGE_VERSION}" # Push git push +git push --tags # Get Repo Name REPO=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p') diff --git a/src/package.json b/src/package.json index 6e0edb4..acb1806 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.2.0", + "version": "0.1.7", "description": "A simple Angular 4+ plugin enabling you to scroll to any element on your page and enhance scroll-based features in your app.", "main": "bundles/ngx-scroll-to.umd.min.js", "module": "index.js", From 873baf53653f4935e44027e8e5372f9f07defdb3 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 18:29:19 +0200 Subject: [PATCH 4/9] Release 0.2.0 --- CHANGELOG.md | 3 +++ package.json | 2 +- src/package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 830c33b..4bd157f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ # 0.2.0 (2017-07-21) +* =Release 0.2.0 ([52ccdb7](https://github.com/nicky-lenaers/ngx-scroll-to/commit/52ccdb7)) * Add Publish Script ([f755650](https://github.com/nicky-lenaers/ngx-scroll-to/commit/f755650)) * Change Command for Publish Version ([deea855](https://github.com/nicky-lenaers/ngx-scroll-to/commit/deea855)) +* Fix Commit Message ([89d9669](https://github.com/nicky-lenaers/ngx-scroll-to/commit/89d9669)) * Remove shell script ([362174a](https://github.com/nicky-lenaers/ngx-scroll-to/commit/362174a)) * Reverse Script Order ([a34949b](https://github.com/nicky-lenaers/ngx-scroll-to/commit/a34949b)) +* Revert Version Update ([93490d1](https://github.com/nicky-lenaers/ngx-scroll-to/commit/93490d1)) * Support for nested scrolling ([da68855](https://github.com/nicky-lenaers/ngx-scroll-to/commit/da68855)), closes [#2](https://github.com/nicky-lenaers/ngx-scroll-to/issues/2) * Update Packages ([9e3f592](https://github.com/nicky-lenaers/ngx-scroll-to/commit/9e3f592)) * Update README ([54791de](https://github.com/nicky-lenaers/ngx-scroll-to/commit/54791de)) diff --git a/package.json b/package.json index 046c8ce..4e6ac18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.1.7", + "version": "0.2.0", "description": "Angular X Scroll To", "main": "dist/index.js", "scripts": { diff --git a/src/package.json b/src/package.json index acb1806..6e0edb4 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.1.7", + "version": "0.2.0", "description": "A simple Angular 4+ plugin enabling you to scroll to any element on your page and enhance scroll-based features in your app.", "main": "bundles/ngx-scroll-to.umd.min.js", "module": "index.js", From 90208727e5de6b6ec032ce494717e0dc440e758a Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 19:14:25 +0200 Subject: [PATCH 5/9] Release 0.2.1 --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- src/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd157f..095c2a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ + +## 0.2.1 (2017-07-21) + +* Support for *ngIf ([c8567dc](https://github.com/nicky-lenaers/ngx-scroll-to/commit/c8567dc)), closes [#6](https://github.com/nicky-lenaers/ngx-scroll-to/issues/6) + + + # 0.2.0 (2017-07-21) @@ -5,6 +12,7 @@ * Add Publish Script ([f755650](https://github.com/nicky-lenaers/ngx-scroll-to/commit/f755650)) * Change Command for Publish Version ([deea855](https://github.com/nicky-lenaers/ngx-scroll-to/commit/deea855)) * Fix Commit Message ([89d9669](https://github.com/nicky-lenaers/ngx-scroll-to/commit/89d9669)) +* Release 0.2.0 ([873baf5](https://github.com/nicky-lenaers/ngx-scroll-to/commit/873baf5)) * Remove shell script ([362174a](https://github.com/nicky-lenaers/ngx-scroll-to/commit/362174a)) * Reverse Script Order ([a34949b](https://github.com/nicky-lenaers/ngx-scroll-to/commit/a34949b)) * Revert Version Update ([93490d1](https://github.com/nicky-lenaers/ngx-scroll-to/commit/93490d1)) diff --git a/package.json b/package.json index 4e6ac18..af1652b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.2.0", + "version": "0.2.1", "description": "Angular X Scroll To", "main": "dist/index.js", "scripts": { diff --git a/src/package.json b/src/package.json index 6e0edb4..5d7e179 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@nicky-lenaers/ngx-scroll-to", - "version": "0.2.0", + "version": "0.2.1", "description": "A simple Angular 4+ plugin enabling you to scroll to any element on your page and enhance scroll-based features in your app.", "main": "bundles/ngx-scroll-to.umd.min.js", "module": "index.js", From 76c0004f26c34e0df850591ea3b2a083af13a2c7 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 22:02:26 +0200 Subject: [PATCH 6/9] Working Development Server - Added a server for development using Webpack --- demo/app/app.component.html | 7 ++++ demo/app/app.component.ts | 7 ++++ demo/app/app.module.ts | 18 +++++++++ demo/index.html | 14 +++++++ demo/main.ts | 6 +++ demo/tsconfig.demo.json | 6 +++ package.json | 26 +++++++----- src/main.ts | 0 src/statics/scroll-to-animation.ts | 2 +- src/tsconfig.ngc.json | 43 ++++++++++++++++++++ tsconfig.json | 55 +++++++------------------- webpack.config.ts | 63 ++++++++++++++++++++++++++++++ 12 files changed, 196 insertions(+), 51 deletions(-) create mode 100644 demo/app/app.component.html create mode 100644 demo/app/app.component.ts create mode 100644 demo/app/app.module.ts create mode 100644 demo/index.html create mode 100644 demo/main.ts create mode 100644 demo/tsconfig.demo.json delete mode 100644 src/main.ts create mode 100644 src/tsconfig.ngc.json create mode 100644 webpack.config.ts diff --git a/demo/app/app.component.html b/demo/app/app.component.html new file mode 100644 index 0000000..843a292 --- /dev/null +++ b/demo/app/app.component.html @@ -0,0 +1,7 @@ +

App Works!

+ + + +
+ This is the destination +
diff --git a/demo/app/app.component.ts b/demo/app/app.component.ts new file mode 100644 index 0000000..5534daa --- /dev/null +++ b/demo/app/app.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'my-app', + templateUrl: './app.component.html' +}) +export class AppComponent { } diff --git a/demo/app/app.module.ts b/demo/app/app.module.ts new file mode 100644 index 0000000..9b73ed9 --- /dev/null +++ b/demo/app/app.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { AppComponent } from './app.component'; +import { ScrollToModule } from '../../src/scroll-to.module'; + +@NgModule({ + imports: [ + ScrollToModule.forRoot(), + BrowserModule + ], + declarations: [ + AppComponent + ], + bootstrap: [ + AppComponent + ] +}) +export class AppModule { } diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..35ae220 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,14 @@ + + + + + + + Demo + + + + loading... + + + diff --git a/demo/main.ts b/demo/main.ts new file mode 100644 index 0000000..29b081a --- /dev/null +++ b/demo/main.ts @@ -0,0 +1,6 @@ +import 'core-js'; +import 'zone.js/dist/zone'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app/app.module'; + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/demo/tsconfig.demo.json b/demo/tsconfig.demo.json new file mode 100644 index 0000000..1a6fbcc --- /dev/null +++ b/demo/tsconfig.demo.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "angularCompilerOptions": { + "entryModule": "./app/app.module#AppModule" + } +} diff --git a/package.json b/package.json index 5f75440..82c2d4e 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,19 @@ "description": "Angular X Scroll To", "main": "dist/index.js", "scripts": { - "clean": "rimraf .tmp && rimraf dist", - "copy": "copyfiles -u 1 ./src/package.json dist && copyfiles README.md dist", - "transpile": "ngc", - "package": "rollup -c rollup.config.ts", - "minify": "uglifyjs dist/bundles/ngx-scroll-to.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/ngx-scroll-to.umd.min.js", + "preserve": "npm run clean", + "serve": "webpack --progress --watch", + "dev": "webpack-dev-server", "build": "npm run clean && npm run transpile && npm run package && npm run minify && npm run copy", "prepublish": "npm run build", "publish": "cd ./dist && npm publish --access=public", + "copy": "copyfiles -u 1 ./src/package.json dist && copyfiles README.md dist", + "transpile": "ngc -p ./src/tsconfig.ngc.json", + "package": "rollup -c rollup.config.ts", + "minify": "uglifyjs dist/bundles/ngx-scroll-to.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/ngx-scroll-to.umd.min.js", "changelog": "conventional-changelog -i CHANGELOG.md -s -r 0", - "test": "echo \"No test command\"" + "test": "echo \"No test command\"", + "clean": "rimraf .tmp && rimraf dist" }, "repository": { "type": "git", @@ -52,17 +55,22 @@ "devDependencies": { "@angular/compiler": "^4.0.0", "@angular/compiler-cli": "^4.0.0", + "@angular/platform-browser-dynamic": "^4.3.1", + "@ngtools/webpack": "^1.5.2", "@types/node": "^8.0.14", - "angular2-template-loader": "^0.6.2", - "awesome-typescript-loader": "^3.2.1", + "@types/webpack": "^3.0.4", + "@types/webpack-dev-server": "^2.4.0", "conventional-changelog-cli": "^1.3.2", "copyfiles": "^1.2.0", + "html-webpack-plugin": "^2.29.0", "raw-loader": "^0.5.1", "renamer": "^0.6.1", "rimraf": "^2.6.1", "rollup": "^0.45.2", + "ts-node": "^3.2.1", "typescript": "^2.3.4", "uglify-js": "^3.0.16", - "webpack": "^3.3.0" + "webpack": "^3.3.0", + "webpack-dev-server": "^2.5.1" } } diff --git a/src/main.ts b/src/main.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/statics/scroll-to-animation.ts b/src/statics/scroll-to-animation.ts index 6c7375d..907ff85 100644 --- a/src/statics/scroll-to-animation.ts +++ b/src/statics/scroll-to-animation.ts @@ -6,7 +6,7 @@ import { ScrollToAnimationOptions } from '../models/scroll-to-options.model'; export class ScrollAnimation { private _tick: number; - private _interval: NodeJS.Timer; + private _interval: any; private _time_lapsed: number; private _percentage: number; private _position: number; diff --git a/src/tsconfig.ngc.json b/src/tsconfig.ngc.json new file mode 100644 index 0000000..b9a0edc --- /dev/null +++ b/src/tsconfig.ngc.json @@ -0,0 +1,43 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "stripInternal": true, + "experimentalDecorators": true, + "strictNullChecks": false, + "noImplicitAny": true, + "module": "es2015", + "moduleResolution": "node", + "paths": { + "@angular/core": [ + "node_modules/@angular/core" + ], + "@angular/common": [ + "node_modules/@angular/common" + ], + "@angular/platform-browser": [ + "node_modules/@angular/platform-browser" + ], + "rxjs/*": [ + "node_modules/rxjs/*" + ] + }, + "rootDir": "../src", + "outDir": "../dist", + "sourceMap": true, + "inlineSources": true, + "target": "es5", + "skipLibCheck": true, + "lib": [ + "es2015", + "dom" + ] + }, + "files": [ + "../src/index.ts" + ], + "angularCompilerOptions": { + "genDir": "../.tmp", + "strictMetadataEmit": true + } +} diff --git a/tsconfig.json b/tsconfig.json index 782e9cb..d010daa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,43 +1,16 @@ { - "compilerOptions": { - "baseUrl": ".", - "declaration": true, - "stripInternal": true, - "experimentalDecorators": true, - "strictNullChecks": false, - "noImplicitAny": true, - "module": "es2015", - "moduleResolution": "node", - "paths": { - "@angular/core": [ - "node_modules/@angular/core" - ], - "@angular/common": [ - "node_modules/@angular/common" - ], - "@angular/platform-browser": [ - "node_modules/@angular/platform-browser" - ], - "rxjs/*": [ - "node_modules/rxjs/*" - ] - }, - "rootDir": "src", - "outDir": "dist", - "sourceMap": true, - "inlineSources": true, - "target": "es5", - "skipLibCheck": true, - "lib": [ - "es2015", - "dom" - ] - }, - "files": [ - "./src/index.ts" - ], - "angularCompilerOptions": { - "genDir": ".tmp", - "strictMetadataEmit": true - } + "compilerOptions": { + "moduleResolution": "node", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "lib": [ + "es2016", + "dom" + ], + "skipLibCheck": true, + "noStrictGenericChecks": true + } } diff --git a/webpack.config.ts b/webpack.config.ts new file mode 100644 index 0000000..fb424c2 --- /dev/null +++ b/webpack.config.ts @@ -0,0 +1,63 @@ +import * as webpack from 'webpack'; +import { resolve } from 'path'; +import { AotPlugin } from '@ngtools/webpack'; +import * as HtmlWebpackPlugin from 'html-webpack-plugin'; + +export = function () { + + let config: webpack.Configuration = { + entry: { + main: './demo/main.ts' + }, + output: { + path: resolve(__dirname, './', './dist'), + filename: '[name].bundle.js' + }, + resolve: { + extensions: ['.js', '.ts', '.json'] + }, + module: { + rules: [ + { + test: /\.ts$/, + loader: '@ngtools/webpack' + }, + { + test: /\.html$/, + loader: 'raw-loader' + } + ] + }, + devtool: 'inline-source-map', + stats: { + colors: true, + hash: true, + timings: true, + chunks: true, + chunkModules: false, + children: false, + modules: false, + reasons: false, + warnings: true, + assets: false, + version: false + }, + plugins: [ + new AotPlugin({ + tsConfigPath: resolve(__dirname, './', './demo/tsconfig.demo.json'), + skipCodeGeneration: true + }), + new HtmlWebpackPlugin({ + template: resolve(__dirname, './', './demo/index.html') + }) + ], + devServer: { + publicPath: '/', + contentBase: resolve(__dirname, './', './demo'), + port: 3000 + } + }; + + return config; +}; +// https://stackoverflow.com/questions/42152223/webpack-dev-server-serves-one-version-old-bundle From 405ad75808776fc0a7873aac1f55fb696342fa15 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Fri, 21 Jul 2017 22:33:33 +0200 Subject: [PATCH 7/9] Added Sass - Using sass-loader and node-sass --- demo/app/app.component.scss | 3 +++ demo/app/app.component.ts | 3 ++- package.json | 8 +++++--- webpack.config.ts | 37 ++++++++++++++++++++++++++++++++++--- 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 demo/app/app.component.scss diff --git a/demo/app/app.component.scss b/demo/app/app.component.scss new file mode 100644 index 0000000..8a65886 --- /dev/null +++ b/demo/app/app.component.scss @@ -0,0 +1,3 @@ +:host { + color: green; +} diff --git a/demo/app/app.component.ts b/demo/app/app.component.ts index 5534daa..a08bf42 100644 --- a/demo/app/app.component.ts +++ b/demo/app/app.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-app', - templateUrl: './app.component.html' + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] }) export class AppComponent { } diff --git a/package.json b/package.json index 82c2d4e..6181337 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "Angular X Scroll To", "main": "dist/index.js", "scripts": { - "preserve": "npm run clean", - "serve": "webpack --progress --watch", - "dev": "webpack-dev-server", + "prebuild:demo": "npm run clean", + "build:demo": "webpack --progress --watch", + "serve": "webpack-dev-server", "build": "npm run clean && npm run transpile && npm run package && npm run minify && npm run copy", "prepublish": "npm run build", "publish": "cd ./dist && npm publish --access=public", @@ -63,10 +63,12 @@ "conventional-changelog-cli": "^1.3.2", "copyfiles": "^1.2.0", "html-webpack-plugin": "^2.29.0", + "node-sass": "^4.5.3", "raw-loader": "^0.5.1", "renamer": "^0.6.1", "rimraf": "^2.6.1", "rollup": "^0.45.2", + "sass-loader": "^6.0.6", "ts-node": "^3.2.1", "typescript": "^2.3.4", "uglify-js": "^3.0.16", diff --git a/webpack.config.ts b/webpack.config.ts index fb424c2..f7f5789 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -3,6 +3,11 @@ import { resolve } from 'path'; import { AotPlugin } from '@ngtools/webpack'; import * as HtmlWebpackPlugin from 'html-webpack-plugin'; +/** + * @todo generic 'stats' + * @todo seperate files + * @todo webpack helper file + */ export = function () { let config: webpack.Configuration = { @@ -25,7 +30,21 @@ export = function () { { test: /\.html$/, loader: 'raw-loader' - } + }, + { + test: /\.scss$/, + include: [ + resolve(__dirname, './', './demo/app') + ], + use: [ + { + loader: 'raw-loader' + }, + { + loader: 'sass-loader' + } + ] + }, ] }, devtool: 'inline-source-map', @@ -54,10 +73,22 @@ export = function () { devServer: { publicPath: '/', contentBase: resolve(__dirname, './', './demo'), - port: 3000 + port: 3000, + stats: { + colors: true, + hash: true, + timings: true, + chunks: true, + chunkModules: false, + children: false, + modules: false, + reasons: false, + warnings: true, + assets: false, + version: false + } } }; return config; }; -// https://stackoverflow.com/questions/42152223/webpack-dev-server-serves-one-version-old-bundle From 5e2cb9c4677ed3fcced160365e00c3d306c7e73a Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Sat, 22 Jul 2017 19:07:20 +0200 Subject: [PATCH 8/9] Demo Update --- demo/app/app.component.html | 7 +------ demo/app/app.component.scss | 2 +- demo/app/app.component.ts | 5 ++++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/demo/app/app.component.html b/demo/app/app.component.html index 843a292..08cc8c1 100644 --- a/demo/app/app.component.html +++ b/demo/app/app.component.html @@ -1,7 +1,2 @@

App Works!

- - - -
- This is the destination -
+

This demo is being worked on as we speak and will be available soon.

diff --git a/demo/app/app.component.scss b/demo/app/app.component.scss index 8a65886..32c65c8 100644 --- a/demo/app/app.component.scss +++ b/demo/app/app.component.scss @@ -1,3 +1,3 @@ :host { - color: green; + } diff --git a/demo/app/app.component.ts b/demo/app/app.component.ts index a08bf42..821648e 100644 --- a/demo/app/app.component.ts +++ b/demo/app/app.component.ts @@ -5,4 +5,7 @@ import { Component } from '@angular/core'; templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) -export class AppComponent { } +export class AppComponent { + + constructor() { } +} From 9ccae5b2511833b58bb0ca6d97b8a7c15fda2012 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Sat, 22 Jul 2017 19:07:38 +0200 Subject: [PATCH 9/9] Handle hidden overflow - This fixes #11 --- src/scroll-to.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scroll-to.service.ts b/src/scroll-to.service.ts index e11faf1..1441978 100644 --- a/src/scroll-to.service.ts +++ b/src/scroll-to.service.ts @@ -70,6 +70,9 @@ export class ScrollToService { // Skip Absolute Positioning if (style.position === 'absolute') continue; + // Skip Hidden Overflow + if (style.overflow === 'hidden' || style.overflowY === 'hidden') continue; + // Return Body if (parent.tagName === 'BODY') return parent;