Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
last 2 Chrome versions
last 2 Firefox versions
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not dead
not op_mini all
63 changes: 63 additions & 0 deletions .github/workflows/build-publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish NPM Package
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+"
permissions:
id-token: write
contents: read
jobs:
get_semver:
name: Create semver
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Verify commit is on main for safety
run: git branch --remote --contains | grep origin/main

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: "5.x"

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7

outputs:
semVer: ${{ steps.gitversion.outputs.semVer }}

build_and_publish:
name: Build centeva-angular-mentions
runs-on: [self-hosted, linux]
needs:
- get_semver
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24.18.0

- name: Set package version
run: |
cd ./projects/angular-mentions
npm version ${{ needs.get_semver.outputs.semVer }} --git-tag-version=false

- name: Install dependencies
run: npm ci

- name: Build library (production)
run: npx ng build angular-mentions --configuration production

- name: Publish
run: |
cd ./dist/centeva-angular-mentions
npm publish --ignore-scripts --access public
44 changes: 44 additions & 0 deletions .github/workflows/pr-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Checks
on:
pull_request:
types: [opened, reopened, synchronize, edited]
jobs:
frontend-checks:
name: Build Angular workspace
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24.x

- name: Cache npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install dependencies
run: npm ci --cache ~/.npm

- name: Lint
run: npx ng lint

- name: Build library
run: npx ng build angular-mentions

- name: Build demo app
run: npx ng build demo-app

- name: Test library
run: npx ng test angular-mentions --watch=false

- name: Test demo app
run: npx ng test demo-app --watch=false
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Angular Mentions

This project is a maintained fork of https://github.com/dmacfarlane/angular-mentions, published by Centeva as centeva-angular-mentions. For this fork, use https://github.com/Centeva/centeva-angular-mentions for issues and releases.

Simple Angular mentions inspired by [Ment.io](https://github.com/jeff-collins/ment.io).

[Click here for a Demo](http://dmacfarlane.github.io/angular-mentions/)
[Click here for a Demo](https://github.com/Centeva/centeva-angular-mentions)

This package provides auto-complete suggestions for @mentions in text input fields, text areas,
and content editable fields.
Expand All @@ -11,21 +13,21 @@ and content editable fields.

To install and start the demo application:

git clone https://github.com/dmacfarlane/angular-mentions.git
cd angular-mentions
git clone https://github.com/Centeva/centeva-angular-mentions.git
cd centeva-angular-mentions
npm install
ng serve

### Usage

Add the package as a dependency to your project using:

npm install angular-mentions
npm install centeva-angular-mentions

Add the module to your app.module imports:

```typescript
import { MentionModule } from 'angular-mentions';
import { MentionModule } from 'centeva-angular-mentions';
...

@NgModule({
Expand Down
74 changes: 56 additions & 18 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"builder": "@angular/build:ng-packagr",
"options": {
"tsConfig": "projects/angular-mentions/tsconfig.lib.json",
"project": "projects/angular-mentions/ng-package.json"
}
, "configurations": {
"development": {
"tsConfig": "projects/angular-mentions/tsconfig.lib.json"
},
"production": {
"tsConfig": "projects/angular-mentions/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:unit-test",
"options": {
"main": "projects/angular-mentions/src/test.ts",
"tsConfig": "projects/angular-mentions/tsconfig.spec.json",
"karmaConfig": "projects/angular-mentions/karma.conf.js"
"reporters": [
"default"
],
"buildTarget": "angular-mentions:build:development",
"runner": "vitest"
}
}
}
Expand All @@ -39,7 +45,7 @@
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"builder": "@angular/build:application",
"options": {
"outputPath": {
"base": "dist/demo-app"
Expand Down Expand Up @@ -67,6 +73,7 @@
"browser": "projects/demo-app/src/main.ts"
},
"configurations": {
"development": {},
"production": {
"fileReplacements": [
{
Expand All @@ -90,11 +97,22 @@
"maximumWarning": "6kb"
}
]
},
"testing": {
"aot": false,
"assets": [
"projects/demo-app/src/favicon.ico",
"projects/demo-app/src/assets"
],
"scripts": [],
"polyfills": [
"zone.js"
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular/build:dev-server",
"options": {
"buildTarget": "demo-app:build"
},
Expand All @@ -105,26 +123,20 @@
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"builder": "@angular/build:extract-i18n",
"options": {
"buildTarget": "demo-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:unit-test",
"options": {
"main": "projects/demo-app/src/test.ts",
"polyfills": "projects/demo-app/src/polyfills.ts",
"tsConfig": "projects/demo-app/tsconfig.spec.json",
"karmaConfig": "projects/demo-app/karma.conf.js",
"styles": [
"projects/demo-app/src/styles.css"
"reporters": [
"default"
],
"scripts": [],
"assets": [
"projects/demo-app/src/favicon.ico",
"projects/demo-app/src/assets"
]
"buildTarget": "demo-app:build:testing",
"runner": "vitest"
}
}
}
Expand All @@ -148,5 +160,31 @@
}
}
}
},
"schematics": {
"@schematics/angular:component": {
"type": "component"
},
"@schematics/angular:directive": {
"type": "directive"
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": "."
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
}
}
Loading
Loading