Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Angular v16 and other package updates #85

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
last 2 Chrome versions
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ indent_size = 2

# Front End Languages (HTML, JS/TS, CSS etc)

[*.{js, ts, css, html}]
[*.{js,ts,css,html}]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

## JS/TS
[*.{js, ts}]
[*.{js,ts}]
quote_type = single

# Misc

# YAML Based files - 2 space indent
[*.{yml, yaml, sls}]
[*.{yml,yaml,sls}]
indent_style = space
indent_size = 2
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*package.json
package-lock.json
dist
e2e/**
karma.conf.js
commitlint.config.js*
76 changes: 76 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts", "*.tsx"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.e2e.json"
],
"createDefaultProgram": true
},
"extends": [
"eslint:recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"sort-imports": [
"error",
{
"ignoreCase": false,
"ignoreDeclarationSort": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
"allowSeparatedGroups": true
}
],
"eqeqeq": ["error", "smart"],
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-ignore": "allow-with-description",
"minimumDescriptionLength": 10
}
],
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"vars": "all",
"args": "none",
"ignoreRestSiblings": true
}
],
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run pre-commit
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
# Change Log
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [16.0.1](https://github.com/kumanu/angular-inviewport/compare/v16.0.0...v16.0.1) (2023-07-13)

<a name="16.0.0"></a>
## [16.0.0](https://github.com/kumanu/angular-inviewport/compare/v4.2.2...v16.0.0) (2023-07-13)

### ⚠ BREAKING CHANGES

* Husky updated to v8
* Angular v12+ no longer supports Internet Explorer/IE.
* requires Angular v14; supports Angular v16

### Bug Fixes

* **@nguniversal/module-map-ngfactory-loader:** remove module-map-ngfactory-loader (deprecated) ([30e6a57](https://github.com/kumanu/angular-inviewport/commit/30e6a570bf8858f10fa2cc0c711f1e94487ebfa9))
* **package.json:** update package versions to go along with Angular v10 upgrade ([ea3b739](https://github.com/kumanu/angular-inviewport/commit/ea3b739fbd327579c942511ae6f71a108e83a412)), closes [#41](https://github.com/kumanu/angular-inviewport/issues/41)
* **polyfills,lock file:** update polyfills to use proper references; rebuild lock file ([ef09fe0](https://github.com/kumanu/angular-inviewport/commit/ef09fe0490d9247022ef9e379daa0a6d7e860934)), closes [#41](https://github.com/kumanu/angular-inviewport/issues/41)
* update packages for audit issues ([2e8e7f5](https://github.com/kumanu/angular-inviewport/commit/2e8e7f5e1d580cc0555e613289c838c3e6a9fbf0)), closes [#41](https://github.com/kumanu/angular-inviewport/issues/41)
* updates peer dependencies to remove warning. ([d36d762](https://github.com/kumanu/angular-inviewport/commit/d36d762ec70841fa871e2e7c9313a4adb0ffd100))

### Angular upgrades
* Upgrade to Angular v10 ([3e5b1ca](https://github.com/kumanu/angular-inviewport/commit/3e5b1ca233d0d55d5865125c6ce6ac8afafae679))
* upgrade Angular to version 11 ([eb12c8a](https://github.com/kumanu/angular-inviewport/commit/eb12c8a8d592f5999cfc113c50079641b5c338cf))
* upgrade Angular to version 12 ([8200694](https://github.com/kumanu/angular-inviewport/commit/8200694844290860ff42760d1ec28c7a373a2c07))
* upgrade Angular to version 13 ([fffa7a6](https://github.com/kumanu/angular-inviewport/commit/fffa7a6b41eb0dcdc75ccfb2787906ce600f62b5))
* upgrade Angular to version 14 ([4201142](https://github.com/kumanu/angular-inviewport/commit/420114298b97f0dc1539e28b16d63cd45ed78fa8))
* upgrade Angular to version 15 ([78f3a65](https://github.com/kumanu/angular-inviewport/commit/78f3a65808e83313962b30461a37a8cd1c61ac7e))
* upgrade Angular to version 16 ([90922ef](https://github.com/kumanu/angular-inviewport/commit/90922efafb787d28337ce86202b3e9560fa4be82))
* update packages to latest versions ([b831c0b](https://github.com/kumanu/angular-inviewport/commit/b831c0b9464e909f78c9d90b41d1b64a09e501e5))

<a name="4.2.2"></a>
## [4.2.2](https://github.com/thisissoon/angular-inviewport/compare/v4.2.1...v4.2.2) (2020-02-03)

Expand Down
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ This is a simple library for [Angular][angular], implemented in the [Angular Pac
### via NPM

```bash
npm i @thisissoon/angular-inviewport
```

### via Yarn

```bash
yarn add @thisissoon/angular-inviewport
npm i @kumanu/angular-inviewport
```

`app.module.ts`

```ts
import { InViewportModule } from '@thisissoon/angular-inviewport';
import { InViewportModule } from '@kumanu/angular-inviewport';

@NgModule({
imports: [InViewportModule]
Expand All @@ -37,7 +31,7 @@ export class AppModule {}
Only required For Server Side Rendering

```ts
import { InViewportModule } from '@thisissoon/angular-inviewport';
import { InViewportModule } from '@kumanu/angular-inviewport';

@NgModule({
imports: [InViewportModule.forServer()]
Expand All @@ -47,9 +41,9 @@ export class AppServerModule {}

## Browser Support

This library makes use of the [Intersection Observer API][intersection-observer-api] which requires a [polyfill][intersection-observer-polyfill] to work on some browsers.
This library makes use of the [Intersection Observer API][intersection-observer-api] which may require a [polyfill][intersection-observer-polyfill] to work on some browsers.

### Install the polyfill
### Install the polyfill (if needed)

```bash
npm i intersection-observer
Expand All @@ -61,7 +55,7 @@ Or use yarn
yarn add intersection-observer
```

### Include the polyfill
### Include the polyfill (if needed)

Add this somewhere in your `src/polyfills.ts` file

Expand All @@ -71,7 +65,7 @@ import 'intersection-observer';

## Examples

A working example can be found [here](https://github.com/thisissoon/angular-inviewport/tree/master/src).
A working example can be found [here](https://github.com/kumanu/angular-inviewport/tree/master/src).

### Just using classes

Expand Down Expand Up @@ -143,7 +137,7 @@ export class AppComponent {
Amet tempor excepteur occaecat nulla.
</p>
```

po
#### `app.component.ts`

```ts
Expand Down Expand Up @@ -211,9 +205,9 @@ export class AppComponent {
constructor() {
this.inViewportChange = new Subject<boolean>().pipe(take(5));

this.inViewportChange.subscribe((inViewport: boolean) =>
this.inViewportChange.subscribe((inViewport: boolean) => {
this.highlight = inViewport;
);
});
}

onInViewportChange(inViewport: boolean) {
Expand Down Expand Up @@ -268,6 +262,9 @@ Run `npm run release` to create a new release. This will use [Standard Version][

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

Original credit for this package and the author(s) (and forked from):
https://github.com/thisissoon/angular-inviewport

[circle-badge]: https://circleci.com/gh/thisissoon/angular-inviewport.svg?style=shield
[circle-badge-url]: https://circleci.com/gh/thisissoon/angular-inviewport
[coveralls-badge]: https://coveralls.io/repos/github/thisissoon/angular-inviewport/badge.svg?branch=master
Expand Down
46 changes: 23 additions & 23 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/angular-inviewport",
"index": "src/index.html",
"main": "src/main.ts",
Expand All @@ -20,7 +19,13 @@
"assets": ["src/assets", "src/favicon.ico"],
"styles": ["src/styles.scss"],
"scripts": [],
"progress": false
"progress": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -33,9 +38,7 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -55,7 +58,8 @@
],
"progress": false
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand All @@ -71,6 +75,12 @@
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/app/**/*.ts", "src/app/**/*.html"]
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
Expand Down Expand Up @@ -99,20 +109,17 @@
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/angular-inviewport-server",
"main": "src/main.server.ts",
"tsConfig": "src/tsconfig.server.json"
}
"tsConfig": "src/tsconfig.server.json",
"sourceMap": true,
"optimization": false,
"buildOptimizer": false
},
"defaultConfiguration": ""
}
}
},
Expand All @@ -127,18 +134,10 @@
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "angular-inviewport:serve:no-progress"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"defaultProject": "angular-inviewport",
"schematics": {
"@schematics/angular:component": {
"prefix": "sn",
Expand All @@ -149,6 +148,7 @@
}
},
"cli": {
"packageManager": "yarn"
"packageManager": "yarn",
"schematicCollections": ["@angular-eslint/schematics"]
}
}
8 changes: 4 additions & 4 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export class AppPage {
}

scrollTo(x: number = 0, y: number = 0) {
browser.executeScript(`window.scrollTo(${x},${y})`);
browser.sleep(200);
void browser.executeScript(`window.scrollTo(${x},${y})`);
void browser.sleep(200);
}

scrollableElementScrollTop(y: number = 0) {
browser.executeScript(
void browser.executeScript(
`document.getElementsByClassName('scrollable')[0].scrollTop = ${y}`
);
browser.sleep(200);
void browser.sleep(200);
}
}
2 changes: 1 addition & 1 deletion e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
Expand Down
Loading