Skip to content

Commit 1573f47

Browse files
authored
feat(core): adds angular 20 support
feat(core): adds angular 20 support
2 parents 1b97b0a + 411a870 commit 1573f47

File tree

12 files changed

+8378
-13396
lines changed

12 files changed

+8378
-13396
lines changed

.github/copilot-instructions.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copilot Instructions for Angular Projects
2+
3+
1. **Use the Latest Angular and TypeScript**
4+
- Always use the latest stable version of Angular (currently v20) and TypeScript.
5+
- Code examples must reference Angular 20+ APIs and features.
6+
- If unsure about a feature or API, refer to the [Angular Docs](https://angular.dev/).
7+
8+
2. **Modern Angular Features Only**
9+
- Always prefer Angular control flow syntax over legacy structural directives.
10+
- Use Angular signals for state management and reactivity.
11+
- Prefer input signals and output signals for component communication. See: [inputs](https://angular.dev/reference/api/core/InputSignal), [outputs](https://angular.dev/reference/api/core/OutputSignal).
12+
13+
3. **No Legacy Decorators**
14+
- Do not use or recommend `@Input` and `@Output` decorators in new examples.
15+
- Use signals and Angular's latest patterns for data flow and events.
16+
17+
4. **Template Syntax & Style**
18+
- Use the latest template syntax and best practices, such as `@for`, `@if`, `@switch` (Angular's new control flow).
19+
- Always use `<ng-container>` for structural grouping when needed.
20+
21+
5. **Component Architecture**
22+
- Prefer standalone components wherever possible (avoid NgModules for new features unless there’s a clear need).
23+
- Encourage use of feature encapsulation with self-contained, reusable components.
24+
25+
6. **Type Safety & Strictness**
26+
- Enable `"strict": true` in `tsconfig.json` for all projects.
27+
- Always provide explicit types for function signatures, variables, and observables.
28+
29+
7. **Dependency Injection**
30+
- Use `@Injectable({providedIn: 'root'})` for services unless there's a reason for a different scope.
31+
- Always prefer Angular DI patterns over manual instantiation or singleton hacks.
32+
33+
8. **API Communication**
34+
- Use Angular’s `HttpClient` for all HTTP/API interactions.
35+
- Prefer typed HTTP responses and error handling using RxJS.
36+
37+
9. **State Management**
38+
- For component-level state, use signals.
39+
- For app-wide state, recommend using signals-based libraries or lightweight solutions compatible with Angular 20+ (e.g., SignalStore, Akita signals, etc.), but avoid heavy, legacy state libraries like NgRx unless necessary.
40+
41+
10. **Testing**
42+
- All code examples should include unit test snippets where applicable.
43+
- Use Angular’s karma, jasmine testing APIs.
44+
45+
11. **Accessibility**
46+
- Ensure all code examples follow WCAG guidelines and Angular’s accessibility best practices.
47+
48+
12. **Documentation and Comments**
49+
- Comment public APIs, inputs, and outputs in all examples.
50+
- Reference Angular style guide for structure and naming conventions.
51+
52+
13. **No Deprecated APIs**
53+
- Never recommend deprecated Angular APIs, patterns, or features.
54+
- Double-check breaking changes or removals for each new Angular version [here](https://update.angular.io/).

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: ['ubuntu-latest']
15-
node: ['20']
15+
node: ['latest']
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Use Node.js ${{ matrix.node }}
19-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
2020
with:
2121
node-version: ${{ matrix.node }}
2222
- name: Install dependencies

.github/workflows/npm_publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v3
12+
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 20
14+
node-version: latest
1515
- name: Install NPM Dependencies
1616
run: npm i
1717
- name: Build project

.github/workflows/npm_publish_ssr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v3
12+
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 20
14+
node-version: latest
1515
- name: Install NPM Dependencies
1616
run: npm i
1717
- name: Build project

angular.json

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"prefix": "lib",
1111
"architect": {
1212
"build": {
13-
"builder": "@angular-devkit/build-angular:ng-packagr",
13+
"builder": "@angular/build:ng-packagr",
1414
"options": {
1515
"tsConfig": "projects/ngx-cookie-service/tsconfig.lib.json",
1616
"project": "projects/ngx-cookie-service/ng-package.json"
@@ -22,7 +22,7 @@
2222
}
2323
},
2424
"test": {
25-
"builder": "@angular-devkit/build-angular:karma",
25+
"builder": "@angular/build:karma",
2626
"options": {
2727
"polyfills": ["zone.js", "zone.js/testing"],
2828
"tsConfig": "projects/ngx-cookie-service/tsconfig.spec.json",
@@ -44,7 +44,7 @@
4444
"prefix": "lib",
4545
"architect": {
4646
"build": {
47-
"builder": "@angular-devkit/build-angular:ng-packagr",
47+
"builder": "@angular/build:ng-packagr",
4848
"options": {
4949
"project": "projects/ngx-cookie-service-ssr/ng-package.json"
5050
},
@@ -59,7 +59,7 @@
5959
"defaultConfiguration": "production"
6060
},
6161
"test": {
62-
"builder": "@angular-devkit/build-angular:karma",
62+
"builder": "@angular/build:karma",
6363
"options": {
6464
"tsConfig": "projects/ngx-cookie-service-ssr/tsconfig.spec.json",
6565
"karmaConfig": "karma.conf.js"
@@ -70,5 +70,31 @@
7070
},
7171
"cli": {
7272
"analytics": "672a95e4-d4b2-4161-ac1f-25d2c513bef0"
73+
},
74+
"schematics": {
75+
"@schematics/angular:component": {
76+
"type": "component"
77+
},
78+
"@schematics/angular:directive": {
79+
"type": "directive"
80+
},
81+
"@schematics/angular:service": {
82+
"type": "service"
83+
},
84+
"@schematics/angular:guard": {
85+
"typeSeparator": "."
86+
},
87+
"@schematics/angular:interceptor": {
88+
"typeSeparator": "."
89+
},
90+
"@schematics/angular:module": {
91+
"typeSeparator": "."
92+
},
93+
"@schematics/angular:pipe": {
94+
"typeSeparator": "."
95+
},
96+
"@schematics/angular:resolver": {
97+
"typeSeparator": "."
98+
}
7399
}
74100
}

karma.conf.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma')
13+
require('@angular/build'),
1414
],
1515
client: {
1616
jasmine: {
@@ -21,18 +21,15 @@ module.exports = function (config) {
2121
},
2222
},
2323
jasmineHtmlReporter: {
24-
suppressAll: true // removes the duplicated traces
24+
suppressAll: true, // removes the duplicated traces
2525
},
2626
coverageReporter: {
2727
dir: require('path').join(__dirname, './coverage/pres'),
2828
subdir: '.',
29-
reporters: [
30-
{ type: 'html' },
31-
{ type: 'text-summary' }
32-
]
29+
reporters: [{ type: 'html' }, { type: 'text-summary' }],
3330
},
3431
reporters: ['progress', 'kjhtml'],
3532
browsers: ['Chrome'],
36-
restartOnFileChange: true
33+
restartOnFileChange: true,
3734
});
3835
};

0 commit comments

Comments
 (0)