Skip to content

Commit 6e25236

Browse files
authored
chore: add angular v21 support #352 (#356)
1 parent e35a14e commit 6e25236

3 files changed

Lines changed: 84 additions & 8 deletions

File tree

.github/workflows/angular-test-and-lint.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- rc
8+
89
jobs:
910
lint:
1011
runs-on: ubuntu-latest
@@ -37,6 +38,12 @@ jobs:
3738
run: |
3839
npm ci --cache .npm --prefer-offline
3940
npm run build
41+
- name: Upload dist
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: library-dist
45+
path: dist/
46+
retention-days: 1
4047

4148
test:
4249
runs-on: ubuntu-latest
@@ -79,6 +86,50 @@ jobs:
7986
token: ${{ secrets.CODECOV_TOKEN }}
8087
working-directory: ./
8188

89+
compatibility:
90+
needs: build
91+
runs-on: ubuntu-latest
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
angular-version: [19, 20, 21]
96+
name: compatibility (Angular ${{ matrix.angular-version }})
97+
steps:
98+
- name: Setup Node.js
99+
uses: actions/setup-node@v4
100+
with:
101+
node-version: "lts/*"
102+
- name: Download built library
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: library-dist
106+
path: dist/
107+
- name: Pack library tarball
108+
run: cd dist && npm pack
109+
- name: Create test app and verify build
110+
run: |
111+
npx @angular/cli@${{ matrix.angular-version }} new test-app \
112+
--skip-git --skip-tests --style=scss --ssr=false --skip-install
113+
cd test-app
114+
npm install
115+
npm install ../dist/*.tgz @angular/animations@${{ matrix.angular-version }} @angular/forms@${{ matrix.angular-version }} @angular/cdk@${{ matrix.angular-version }} ngx-float-ui@${{ matrix.angular-version }}
116+
117+
# Import a component to verify the library is consumable
118+
cat > src/app/app.component.ts << 'EOF'
119+
import { Component } from '@angular/core';
120+
import { ButtonComponent } from '@tedi-design-system/angular/tedi';
121+
122+
@Component({
123+
selector: 'app-root',
124+
standalone: true,
125+
imports: [ButtonComponent],
126+
template: '<button tedi-button>Test</button>',
127+
})
128+
export class AppComponent {}
129+
EOF
130+
131+
npx ng build
132+
82133
chromatic:
83134
runs-on: ubuntu-latest
84135
if: |

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,34 @@ To view and develop components in isolation, start Storybook for Angular:
3030
npm run start
3131
```
3232

33+
## Angular Version Support
34+
35+
The library supports the three latest Angular major versions. Angular releases a new major every 6 months and deprecates versions after 18 months. See the [Angular release schedule](https://angular.dev/reference/releases) for upcoming dates.
36+
37+
**Currently supported: Angular 19, 20, 21**
38+
39+
CI runs build and test jobs against all supported versions using a matrix strategy. The base version (used for `npm ci`) is determined by `devDependencies` in `package.json` — the other versions are installed on top via `ng update`.
40+
41+
### Adding a new Angular version
42+
43+
When a new Angular major is released (e.g. v22):
44+
45+
1. **`package.json`** — add `|| ^22.0.0` to every Angular peer dependency and `ngx-float-ui`
46+
2. **`.github/workflows/angular-test-and-lint.yml`** — add `22` to the `angular-version` matrix in the `build` and `test` jobs
47+
3. **`.github/workflows/angular-release.yml`** — add `22` to the `angular-version` matrix in the `test` job
48+
49+
### Dropping a deprecated Angular version
50+
51+
When an Angular major reaches end-of-life (e.g. v19):
52+
53+
1. **`package.json`** — remove `^19.0.0 ||` from every Angular peer dependency and `ngx-float-ui`
54+
2. **`.github/workflows/angular-test-and-lint.yml`** — remove `19` from the `angular-version` matrix in the `build` and `test` jobs
55+
3. **`.github/workflows/angular-release.yml`** — remove `19` from the `angular-version` matrix in the `test` job
56+
4. Bump `devDependencies` to the new minimum supported Angular version so the library is always built and developed against a supported release
57+
3358
## Contributing
3459

35-
Check the [wiki](https://github.com/TEDI-Design-System/general) for component guidelines and coding standards.
60+
Check the [wiki](https://github.com/TEDI-Design-System/general) for component guidelines and coding standards.
3661
Report issues or contribute via [GitHub Issues](https://github.com/TEDI-Design-System/angular/issues).
3762

3863
---

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"chromatic": "npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --build-script-name=build:sb --baseline-branch=rc --include=\"tedi/**/*.stories.*\""
2424
},
2525
"peerDependencies": {
26-
"@angular/animations": "^19.0.0 || ^20.0.0",
27-
"@angular/cdk": "^19.0.0 || ^20.0.0",
28-
"@angular/common": "^19.0.0 || ^20.0.0",
29-
"@angular/core": "^19.0.0 || ^20.0.0",
30-
"@angular/forms": "^19.0.0 || ^20.0.0",
31-
"@angular/platform-browser": "^19.0.0 || ^20.0.0",
32-
"ngx-float-ui": "^19.0.1 || ^20.0.0"
26+
"@angular/animations": "^19.0.0 || ^20.0.0 || ^21.0.0",
27+
"@angular/cdk": "^19.0.0 || ^20.0.0 || ^21.0.0",
28+
"@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
29+
"@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
30+
"@angular/forms": "^19.0.0 || ^20.0.0 || ^21.0.0",
31+
"@angular/platform-browser": "^19.0.0 || ^20.0.0 || ^21.0.0",
32+
"ngx-float-ui": "^19.0.1 || ^20.0.0 || ^21.0.0"
3333
},
3434
"dependencies": {
3535
"@tedi-design-system/core": "^3.0.1"

0 commit comments

Comments
 (0)