Skip to content

Commit 6567953

Browse files
authored
Merge pull request #30 from philenius/feat/angular-18-upgrade
Feature: upgrade to Angular 18
2 parents bc7ae4e + cfc0c88 commit 6567953

29 files changed

+6596
-5469
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ trim_trailing_whitespace = true
1010

1111
[*.ts]
1212
quote_type = single
13+
ij_typescript_use_double_quotes = false
1314

1415
[*.md]
1516
max_line_length = off

.eslintrc.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
- name: Setup Node.js
1515
uses: actions/setup-node@v3
1616
with:
17-
node-version: '18.x'
17+
node-version: '22.x'
1818

1919
- name: Install dependencies
2020
run: npm ci
2121

2222
- name: Build
23-
run: npm run build ngx-annotate-text '--configuration production'
23+
run: npm run build:lib:prod
2424

2525
- name: Lint
2626
run: npm run lint ngx-annotate-text
@@ -29,4 +29,4 @@ jobs:
2929
run: npm run test-headless ngx-annotate-text
3030

3131
- name: Build Angular demo app
32-
run: npm run build --omit=dev
32+
run: npm run build

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
- name: Setup Node.js
1313
uses: actions/setup-node@v3
1414
with:
15-
node-version: '20.x'
15+
node-version: '22.x'
1616

1717
- name: Install dependencies
1818
run: npm ci
1919

2020
- name: Build
21-
run: npm run build ngx-annotate-text '--configuration production'
21+
run: npm run build:lib:prod
2222

2323
- name: Lint
2424
run: npm run lint ngx-annotate-text

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
22

33
# Compiled output
44
/dist

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.11.1
1+
v22.11.0

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 18.0.0
4+
5+
Pull request: https://github.com/philenius/ngx-annotate-text/pull/30
6+
7+
- Upgrade to Angular 18.2.0
8+
39
## 17.3.0
410

511
Pull request: https://github.com/philenius/ngx-annotate-text/pull/29

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ View and edit the live demo Angular app on <a href="https://codesandbox.io/s/ngx
104104
| Input | Description | Type | Default value |
105105
| :-------------------------- | ------------------------------------------------------------ | ------------------ | :------------ |
106106
| annotations | Represents the parts of the given text which shall be annotated. | `Annotation[]` | `[]` |
107-
| annotationClass | An optional CSS class applied to all elements which wrap the annotated parts of the given text. | `string|undefined` | `undefined` |
107+
| annotationClass | An optional CSS class applied to all elements which wrap the annotated parts of the given text. | `string\|undefined` | `undefined` |
108108
| annotationRendererComponent | An optional Angular component that shall be used for rendering the annotation. By default, it uses the provided `NgxAnnotationRendererComponent`. You can implement your own annotation rendering component to customize the visualization of annotations. The custom component must implement the interface `NgxAnnotationRendererComponentInterface`. | `NgxAnnotationRendererComponentInterface` | `NgxAnnotationRendererComponent` |
109109
| removable | Determines whether annotations shall have a small button in the top right corner so that the user can remove an annotation. | `boolean` | `true` |
110110
| text | The text which shall be displayed and annotated. | `string` | empty string |
@@ -129,12 +129,17 @@ View and edit the live demo Angular app on <a href="https://codesandbox.io/s/ngx
129129
### Recreate project from scratch
130130

131131
```bash
132-
npm install -g @angular/cli@^17
132+
npm install -g @angular/cli@^18
133133
ng new ngx-annotate-text-workspace
134134
cd ngx-annotate-text-workspace/
135135
ng generate library ngx-annotate-text
136-
ng add @angular-eslint/schematics
137-
npm install prettier
136+
ng add angular-eslint@^18
137+
ng g angular-eslint:add-eslint-to-project ngx-annotate-text-workspace
138+
ng g angular-eslint:add-eslint-to-project ngx-annotate-text
139+
npm install prettier --save-dev
140+
ng build ngx-annotate-text
141+
ng lint
142+
ng test ngx-annotate-text
138143
```
139144

140145
### Build

angular.json

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
"browser": "src/main.ts",
1919
"polyfills": ["zone.js"],
2020
"tsConfig": "tsconfig.app.json",
21-
"assets": ["src/favicon.ico", "src/assets"],
21+
"assets": [
22+
{
23+
"glob": "**/*",
24+
"input": "public"
25+
}
26+
],
2227
"styles": ["src/styles.css"],
2328
"scripts": []
2429
},
@@ -27,13 +32,13 @@
2732
"budgets": [
2833
{
2934
"type": "initial",
30-
"maximumWarning": "500kb",
31-
"maximumError": "1mb"
35+
"maximumWarning": "500kB",
36+
"maximumError": "1MB"
3237
},
3338
{
3439
"type": "anyComponentStyle",
35-
"maximumWarning": "2kb",
36-
"maximumError": "4kb"
40+
"maximumWarning": "2kB",
41+
"maximumError": "4kB"
3742
}
3843
],
3944
"outputHashing": "all"
@@ -59,18 +64,19 @@
5964
"defaultConfiguration": "development"
6065
},
6166
"extract-i18n": {
62-
"builder": "@angular-devkit/build-angular:extract-i18n",
63-
"options": {
64-
"buildTarget": "ngx-annotate-text-workspace:build"
65-
}
67+
"builder": "@angular-devkit/build-angular:extract-i18n"
6668
},
6769
"test": {
6870
"builder": "@angular-devkit/build-angular:karma",
6971
"options": {
7072
"polyfills": ["zone.js", "zone.js/testing"],
7173
"tsConfig": "tsconfig.spec.json",
72-
"karmaConfig": "karma.conf.js",
73-
"assets": ["src/favicon.ico", "src/assets"],
74+
"assets": [
75+
{
76+
"glob": "**/*",
77+
"input": "public"
78+
}
79+
],
7480
"styles": ["src/styles.css"],
7581
"scripts": []
7682
}
@@ -114,13 +120,11 @@
114120
"lint": {
115121
"builder": "@angular-eslint/builder:lint",
116122
"options": {
117-
"lintFilePatterns": ["projects/ngx-annotate-text/**/*.ts", "projects/ngx-annotate-text/**/*.html"]
123+
"lintFilePatterns": ["projects/ngx-annotate-text/**/*.ts", "projects/ngx-annotate-text/**/*.html"],
124+
"eslintConfig": "projects/ngx-annotate-text/eslint.config.js"
118125
}
119126
}
120127
}
121128
}
122-
},
123-
"cli": {
124-
"schematicCollections": ["@angular-eslint/schematics"]
125129
}
126130
}

eslint.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// @ts-check
2+
const eslint = require("@eslint/js");
3+
const tseslint = require("typescript-eslint");
4+
const angular = require("angular-eslint");
5+
6+
module.exports = tseslint.config(
7+
{
8+
files: ["**/*.ts"],
9+
extends: [
10+
eslint.configs.recommended,
11+
...tseslint.configs.recommended,
12+
...tseslint.configs.stylistic,
13+
...angular.configs.tsRecommended,
14+
],
15+
processor: angular.processInlineTemplates,
16+
rules: {
17+
"@angular-eslint/directive-selector": [
18+
"error",
19+
{
20+
type: "attribute",
21+
prefix: "app",
22+
style: "camelCase",
23+
},
24+
],
25+
"@angular-eslint/component-selector": [
26+
"error",
27+
{
28+
type: "element",
29+
prefix: "app",
30+
style: "kebab-case",
31+
},
32+
],
33+
},
34+
},
35+
{
36+
files: ["**/*.html"],
37+
extends: [
38+
...angular.configs.templateRecommended,
39+
...angular.configs.templateAccessibility,
40+
],
41+
rules: {},
42+
}
43+
);

0 commit comments

Comments
 (0)