Skip to content

Commit 4ce3d2a

Browse files
authored
Merge pull request #283 from Cordobo/angular21
feat: angular 21 support
2 parents e79b651 + 3b85869 commit 4ce3d2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+7507
-14095
lines changed

.claude/CLAUDE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.
2+
3+
## TypeScript Best Practices
4+
5+
- Use strict type checking
6+
- Prefer type inference when the type is obvious
7+
- Avoid the `any` type; use `unknown` when type is uncertain
8+
9+
## Angular Best Practices
10+
11+
- Always use standalone components over NgModules
12+
- Must NOT set `standalone: true` inside Angular decorators. It's the default.
13+
- Use signals for state management
14+
- Implement lazy loading for feature routes
15+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
16+
- Use `NgOptimizedImage` for all static images.
17+
- `NgOptimizedImage` does not work for inline base64 images.
18+
19+
## Components
20+
21+
- Keep components small and focused on a single responsibility
22+
- Use `input()` and `output()` functions instead of decorators
23+
- Use `computed()` for derived state
24+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
25+
- Prefer inline templates for small components
26+
- Prefer Reactive forms instead of Template-driven ones
27+
- Do NOT use `ngClass`, use `class` bindings instead
28+
- Do NOT use `ngStyle`, use `style` bindings instead
29+
30+
## State Management
31+
32+
- Use signals for local component state
33+
- Use `computed()` for derived state
34+
- Keep state transformations pure and predictable
35+
- Do NOT use `mutate` on signals, use `update` or `set` instead
36+
37+
## Templates
38+
39+
- Keep templates simple and avoid complex logic
40+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
41+
- Use the async pipe to handle observables
42+
43+
## Services
44+
45+
- Design services around a single responsibility
46+
- Use the `providedIn: 'root'` option for singleton services
47+
- Use the `inject()` function instead of constructor injection

.cursor/rules/cursor.mdc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
context: true
3+
priority: high
4+
scope: project
5+
---
6+
7+
You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.
8+
9+
## TypeScript Best Practices
10+
11+
- Use strict type checking
12+
- Prefer type inference when the type is obvious
13+
- Avoid the `any` type; use `unknown` when type is uncertain
14+
15+
## Angular Best Practices
16+
17+
- Always use standalone components over NgModules
18+
- Must NOT set `standalone: true` inside Angular decorators. It's the default.
19+
- Use signals for state management
20+
- Implement lazy loading for feature routes
21+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
22+
- Use `NgOptimizedImage` for all static images.
23+
- `NgOptimizedImage` does not work for inline base64 images.
24+
25+
## Components
26+
27+
- Keep components small and focused on a single responsibility
28+
- Use `input()` and `output()` functions instead of decorators
29+
- Use `computed()` for derived state
30+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
31+
- Prefer inline templates for small components
32+
- Prefer Reactive forms instead of Template-driven ones
33+
- Do NOT use `ngClass`, use `class` bindings instead
34+
- Do NOT use `ngStyle`, use `style` bindings instead
35+
36+
## State Management
37+
38+
- Use signals for local component state
39+
- Use `computed()` for derived state
40+
- Keep state transformations pure and predictable
41+
- Do NOT use `mutate` on signals, use `update` or `set` instead
42+
43+
## Templates
44+
45+
- Keep templates simple and avoid complex logic
46+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
47+
- Use the async pipe to handle observables
48+
49+
## Services
50+
51+
- Design services around a single responsibility
52+
- Use the `providedIn: 'root'` option for singleton services
53+
- Use the `inject()` function instead of constructor injection

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
ij_typescript_use_double_quotes = false
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false

.eslintrc.json

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

.gemini/GEMINI.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.
2+
3+
## TypeScript Best Practices
4+
5+
- Use strict type checking
6+
- Prefer type inference when the type is obvious
7+
- Avoid the `any` type; use `unknown` when type is uncertain
8+
9+
## Angular Best Practices
10+
11+
- Always use standalone components over NgModules
12+
- Must NOT set `standalone: true` inside Angular decorators. It's the default.
13+
- Use signals for state management
14+
- Implement lazy loading for feature routes
15+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
16+
- Use `NgOptimizedImage` for all static images.
17+
- `NgOptimizedImage` does not work for inline base64 images.
18+
19+
## Components
20+
21+
- Keep components small and focused on a single responsibility
22+
- Use `input()` and `output()` functions instead of decorators
23+
- Use `computed()` for derived state
24+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
25+
- Prefer inline templates for small components
26+
- Prefer Reactive forms instead of Template-driven ones
27+
- Do NOT use `ngClass`, use `class` bindings instead
28+
- Do NOT use `ngStyle`, use `style` bindings instead
29+
30+
## State Management
31+
32+
- Use signals for local component state
33+
- Use `computed()` for derived state
34+
- Keep state transformations pure and predictable
35+
- Do NOT use `mutate` on signals, use `update` or `set` instead
36+
37+
## Templates
38+
39+
- Keep templates simple and avoid complex logic
40+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
41+
- Use the async pipe to handle observables
42+
43+
## Services
44+
45+
- Design services around a single responsibility
46+
- Use the `providedIn: 'root'` option for singleton services
47+
- Use the `inject()` function instead of constructor injection

.github/copilot-instructions.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.
2+
3+
## TypeScript Best Practices
4+
5+
- Use strict type checking
6+
- Prefer type inference when the type is obvious
7+
- Avoid the `any` type; use `unknown` when type is uncertain
8+
9+
## Angular Best Practices
10+
11+
- Always use standalone components over NgModules
12+
- Must NOT set `standalone: true` inside Angular decorators. It's the default.
13+
- Use signals for state management
14+
- Implement lazy loading for feature routes
15+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
16+
- Use `NgOptimizedImage` for all static images.
17+
- `NgOptimizedImage` does not work for inline base64 images.
18+
19+
## Components
20+
21+
- Keep components small and focused on a single responsibility
22+
- Use `input()` and `output()` functions instead of decorators
23+
- Use `computed()` for derived state
24+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
25+
- Prefer inline templates for small components
26+
- Prefer Reactive forms instead of Template-driven ones
27+
- Do NOT use `ngClass`, use `class` bindings instead
28+
- Do NOT use `ngStyle`, use `style` bindings instead
29+
30+
## State Management
31+
32+
- Use signals for local component state
33+
- Use `computed()` for derived state
34+
- Keep state transformations pure and predictable
35+
- Do NOT use `mutate` on signals, use `update` or `set` instead
36+
37+
## Templates
38+
39+
- Keep templates simple and avoid complex logic
40+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
41+
- Use the async pipe to handle observables
42+
43+
## Services
44+
45+
- Design services around a single responsibility
46+
- Use the `providedIn: 'root'` option for singleton services
47+
- Use the `inject()` function instead of constructor injection

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v6
22+
with:
23+
cache: npm
24+
node-version-file: '.nvmrc'
25+
registry-url: https://npm.pkg.github.com/
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Build library
29+
run: npm run ci:build:lib

.github/workflows/npm-publish-github-packages.yml renamed to .github/workflows/publish.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,26 @@ on:
88
types: [created]
99

1010
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v3
16-
with:
17-
node-version: 24
18-
- run: npm install
19-
20-
publish-gpr:
21-
needs: build
11+
publish:
2212
runs-on: ubuntu-latest
2313
permissions:
2414
contents: read
2515
packages: write
2616
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-node@v3
17+
- uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v6
2921
with:
30-
node-version: 24
22+
cache: npm
23+
node-version-file: '.nvmrc'
3124
registry-url: https://npm.pkg.github.com/
32-
- name: Install
33-
run: npm install
34-
- name: Build
25+
- name: Install dependencies
26+
run: npm ci
27+
- name: Build library
3528
run: npm run ci:build:lib && npm run ci:build:app && ls && cd dist/angularx-qrcode
36-
- name: Publish
29+
- name: Publish to npm
30+
working-directory: ./dist/angularx-qrcode
3731
run: npm publish
3832
env:
3933
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)