diff --git a/.github/pull_request.yml b/.github/workflows/build.yml similarity index 79% rename from .github/pull_request.yml rename to .github/workflows/build.yml index dd6c042..92e2501 100644 --- a/.github/pull_request.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ -name: Pull_Request_Validation +name: Build on: - pull_request: - branches: [ "main" ] + push: + branches: + - 'main' workflow_dispatch: @@ -13,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v3 - + - name: Setup Node uses: actions/setup-node@v3 with: @@ -22,23 +23,21 @@ jobs: - name: Install Dependencies run: npm ci - + - name: Build Library run: npm run lib:build - - name: Test Library - run: npm run ci:test-lib verify-changelog: name: Verify Changelog runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v3 - + - name: Changelog Reader uses: mindsers/changelog-reader-action@v2.2.0 with: # Path to the CHANGELOG file containing the log entries - path: ./projects/zeiss-id-library/CHANGELOG.md + path: ./projects/ng-infinite-scroll/CHANGELOG.md # Specifies if the CHANGELOG.md file should be validated and the behavior of the action validation_level: error diff --git a/README.md b/README.md index 6dc999e..75f229f 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,50 @@ ![DALL-E Prompt: Angular Infinity Scroll](/docs/images/header.png) -Content will be added: To be defined as soon as we release the first version +This library provides a directive to implement infinite scrolling in Angular applications. The directive listens to the scroll event and emits an event when the user is near the end of the scrollable container. ## Basic Usage -Usage of directive and components need to be documented here. +1. Install the package from the registry. Make sure you have added the Github PlanB. registry to your `.npmrc` file. + +```bash +npm install @planbgmbh/ng-infinity-scroll +``` + +2. Import the directive into your application / component where you want to use it. + +```typescript +import { NgScrollObserverDirective } from '@planbgmbh/ng-infinite-scroll'; +@Component({ + selector: 'app-root', + standalone: true, + imports: [RouterOutlet, NgScrollObserverDirective], + templateUrl: './app.component.html', + styleUrl: './app.component.scss', +}) +``` + +3. Use the directive inside your template. + +```html +
+ Item {{ item }} +
+``` + +## Supported Angular Version + +We currently support every Angular Version with a minimum requirement of Angular 17.0.0. + +| Package Version | Supported Angular Version | +| --------------- | ------------------------- | +| 1.x | 17, 18 | ## Credits diff --git a/package-lock.json b/package-lock.json index 57fc122..76984ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,22 +9,22 @@ "version": "0.0.0", "license": "GPL-3.0-only", "dependencies": { - "@angular/animations": "^17.0.0", - "@angular/common": "^17.0.0", - "@angular/compiler": "^17.0.0", - "@angular/core": "^17.0.0", - "@angular/forms": "^17.0.0", - "@angular/platform-browser": "^17.0.0", - "@angular/platform-browser-dynamic": "^17.0.0", - "@angular/router": "^17.0.0", + "@angular/animations": ">=17.0.0", + "@angular/common": ">=17.0.0", + "@angular/compiler": ">=17.0.0", + "@angular/core": ">=17.0.0", + "@angular/forms": ">=17.0.0", + "@angular/platform-browser": ">=17.0.0", + "@angular/platform-browser-dynamic": ">=17.0.0", + "@angular/router": ">=17.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.14.2" }, "devDependencies": { - "@angular-devkit/build-angular": "^17.3.7", - "@angular/cli": "^17.0.5", - "@angular/compiler-cli": "^17.0.0", + "@angular-devkit/build-angular": ">=17.3.7", + "@angular/cli": ">=17.0.5", + "@angular/compiler-cli": ">=17.0.0", "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", "@types/jasmine": "~5.1.0", diff --git a/projects/ng-infinite-scroll-demo/src/app/app.component.html b/projects/ng-infinite-scroll-demo/src/app/app.component.html index 611515f..4ba3e01 100644 --- a/projects/ng-infinite-scroll-demo/src/app/app.component.html +++ b/projects/ng-infinite-scroll-demo/src/app/app.component.html @@ -45,98 +45,7 @@

Hello, {{ title }}

Congratulations! Your app is running. 🎉

-
- -
+
diff --git a/projects/ng-infinite-scroll/CHANGELOG.md b/projects/ng-infinite-scroll/CHANGELOG.md index 905b1ad..66d2051 100644 --- a/projects/ng-infinite-scroll/CHANGELOG.md +++ b/projects/ng-infinite-scroll/CHANGELOG.md @@ -5,11 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.0] +## [1.0.0] - 2024-07-08 ### Added -- ci: basic setup for CI -- chore: setup for Github and PRs -- chore: basic library setup -- feat: providing infinite scroll directive +- Initial release and implementation of infinite scroll directive diff --git a/projects/ng-infinite-scroll/package.json b/projects/ng-infinite-scroll/package.json index 52e8ce9..deca398 100644 --- a/projects/ng-infinite-scroll/package.json +++ b/projects/ng-infinite-scroll/package.json @@ -1,6 +1,6 @@ { "name": "@planbgmbh/ng-infinite-scroll", - "version": "0.0.0", + "version": "1.0.0", "author": { "name": "Aaron Czichon, PlanB. GmbH", "email": "aaron.czichon@plan-b-gmbh.com"