Skip to content

Commit 9afcd03

Browse files
s-torrisicwithhart
andauthored
chore: updated to angular 18 (#125)
* init * version up * updating to 18 * fix: yarn updated to 1.22.22 and tests fix * chore: reverted changes to lock files and updated yarn to 1.22.22 --------- Co-authored-by: Chris Withhart <CWithhart@locktonaffinity.com>
1 parent e87409d commit 9afcd03

File tree

11 files changed

+28235
-28464
lines changed

11 files changed

+28235
-28464
lines changed

.yarn/releases/yarn-1.22.1.cjs renamed to .yarn/releases/yarn-1.22.22.cjs

Lines changed: 24301 additions & 23638 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarnPath: .yarn/releases/yarn-1.22.1.cjs
1+
yarnPath: .yarn/releases/yarn-1.22.22.cjs

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ npm install angular-cc-library --save
3232

3333
| Angular | Library |
3434
|---------|---------|
35+
| 18.x | 3.4.x |
3536
| 17.x | 3.3.x |
3637
| 16.x | 3.2.x |
3738
| 15.x | 3.1.x |

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-cc-library",
3-
"version": "3.3.0",
3+
"version": "3.4.0",
44
"scripts": {
55
"run:demo": "ng serve example",
66
"build:demo": "ng build example --configuration production",
@@ -14,41 +14,41 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/common": "^17.1.2",
18-
"@angular/compiler": "^17.1.2",
19-
"@angular/core": "^17.1.2",
20-
"@angular/forms": "^17.1.2",
21-
"@angular/platform-browser": "^17.1.2",
22-
"@angular/platform-browser-dynamic": "^17.1.2",
17+
"@angular/common": "^18.2.2",
18+
"@angular/compiler": "^18.2.2",
19+
"@angular/core": "^18.2.2",
20+
"@angular/forms": "^18.2.2",
21+
"@angular/platform-browser": "^18.2.2",
22+
"@angular/platform-browser-dynamic": "^18.2.2",
2323
"rxjs": "~7.8.1",
24-
"tslib": "^2.1.0",
25-
"zone.js": "~0.14.3"
24+
"tslib": "^2.7.0",
25+
"zone.js": "~0.14.10"
2626
},
2727
"devDependencies": {
28-
"@angular-builders/jest": "17.0.0",
29-
"@angular-devkit/build-angular": "^17.1.2",
30-
"@angular-eslint/builder": "17.2.1",
31-
"@angular-eslint/eslint-plugin": "17.2.1",
32-
"@angular-eslint/eslint-plugin-template": "17.2.1",
33-
"@angular-eslint/schematics": "17.2.1",
34-
"@angular-eslint/template-parser": "17.2.1",
35-
"@angular/cli": "^17.1.2",
36-
"@angular/compiler-cli": "^17.1.2",
37-
"@angular/language-service": "^17.1.2",
28+
"@angular-builders/jest": "18.0.0",
29+
"@angular-devkit/build-angular": "^18.2.2",
30+
"@angular-eslint/builder": "18.3.0",
31+
"@angular-eslint/eslint-plugin": "18.3.0",
32+
"@angular-eslint/eslint-plugin-template": "18.3.0",
33+
"@angular-eslint/schematics": "18.3.0",
34+
"@angular-eslint/template-parser": "18.3.0",
35+
"@angular/cli": "^18.2.2",
36+
"@angular/compiler-cli": "^18.2.2",
37+
"@angular/language-service": "^18.2.2",
3838
"@release-it/bumper": "^6.0.1",
3939
"@release-it/conventional-changelog": "^8.0.1",
40-
"@types/jest": "^29.5.2",
41-
"@types/node": "^20.11.16",
42-
"@typescript-eslint/eslint-plugin": "6.19.0",
43-
"@typescript-eslint/parser": "6.19.0",
40+
"@types/jest": "^29.5.12",
41+
"@types/node": "^22.5.3",
42+
"@typescript-eslint/eslint-plugin": "8.4.0",
43+
"@typescript-eslint/parser": "8.4.0",
4444
"eslint": "^8.56.0",
45-
"husky": "^9.0.10",
46-
"jest": "29.5.0",
47-
"lint-staged": "^15.2.1",
48-
"ng-packagr": "^17.1.2",
49-
"release-it": "^17.0.3",
50-
"ts-node": "~9.1.1",
51-
"typescript": "~5.3.3"
45+
"husky": "^9.1.5",
46+
"jest": "29.7.0",
47+
"lint-staged": "^15.2.10",
48+
"ng-packagr": "^18.2.1",
49+
"release-it": "^17.6.0",
50+
"ts-node": "~10.9.2",
51+
"typescript": "~5.5.4"
5252
},
5353
"lint-staged": {
5454
"*.{ts,component.html}": [

projects/angular-cc-library/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"tslib": "^2.4.1"
2424
},
2525
"peerDependencies": {
26-
"@angular/common": "^17.0.0",
27-
"@angular/core": "^17.0.0"
26+
"@angular/common": "^18.0.0",
27+
"@angular/core": "^18.0.0"
2828
}
2929
}

projects/angular-cc-library/src/lib/directives/credit-card-format.directive.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ describe('Directive: CreditCardFormat', () => {
2929
let inputEl: DebugElement;
3030
beforeEach(() => {
3131
TestBed.configureTestingModule({
32-
declarations: [TestCreditCardFormatComponent, CreditCardFormatDirective],
32+
declarations: [TestCreditCardFormatComponent],
33+
imports: [CreditCardFormatDirective]
3334
});
3435
fixture = TestBed.createComponent(TestCreditCardFormatComponent);
3536
inputEl = fixture.debugElement.query(By.css('input'));
@@ -152,7 +153,8 @@ describe('Directive: CreditCardFormat', () => {
152153

153154
beforeEach(() => {
154155
TestBed.configureTestingModule({
155-
declarations: [TestCreditCardFormatComponent, CreditCardFormatDirective],
156+
declarations: [TestCreditCardFormatComponent],
157+
imports: [CreditCardFormatDirective],
156158
});
157159
fixture = TestBed.createComponent(TestCreditCardFormatComponent);
158160
inputEl = fixture.debugElement.query(By.css('input'));

projects/example/src/app/app.component.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
<p>A general purpose library for building credit card forms, validating inputs and formatting numbers.</p>
66
<div class="form-group">
77
<label for="cc-number" class="control-label">Card number formatting
8-
<small class="text-muted"
9-
*ngIf="type$ | async as type">[<span class="cc-brand">{{type}}</span>]</small></label>
8+
@if(type$ | async; as type) {
9+
<small class="text-muted">[<span class="cc-brand">{{type}}</span>]</small>
10+
}
11+
</label>
1012
<input id="cc-number"
1113
(input)="goToNextField('creditCard', expireInput)"
1214
formControlName="creditCard"
@@ -44,9 +46,15 @@
4446
</div>
4547

4648
<div class="errors">
47-
<div *ngIf="!demoForm.controls.creditCard.valid && demoForm.controls.creditCard.dirty" class="alert alert-danger">Credit Card is invalid</div>
48-
<div *ngIf="!demoForm.controls.expDate.valid && demoForm.controls.expDate.dirty" class="alert alert-danger">Expiration Date is required</div>
49-
<div *ngIf="!demoForm.controls.cvc.valid && demoForm.controls.cvc.dirty" class="alert alert-danger">CVC is required</div>
49+
@if(!demoForm.controls.creditCard.valid && demoForm.controls.creditCard.dirty){
50+
<div class="alert alert-danger">Credit Card is invalid</div>
51+
}
52+
@if(!demoForm.controls.expDate.valid && demoForm.controls.expDate.dirty){
53+
<div class="alert alert-danger">Expiration Date is required</div>
54+
}
55+
@if(!demoForm.controls.cvc.valid && demoForm.controls.cvc.dirty){
56+
<div class="alert alert-danger">CVC is required</div>
57+
}
5058
</div>
5159
</form>
5260

projects/example/src/app/app.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
import { AsyncPipe } from '@angular/common';
12
import { Component } from '@angular/core';
2-
import { Validators, FormGroup, FormBuilder } from '@angular/forms';
3-
import { CreditCardValidators, CreditCard } from 'angular-cc-library';
3+
import { Validators, FormGroup, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
4+
import { CreditCardValidators, CreditCard, CreditCardDirectivesModule } from 'angular-cc-library';
45
import { defer } from 'rxjs';
56
import { map } from 'rxjs/operators';
67

78
@Component({
89
selector: 'app-root',
910
templateUrl: './app.component.html',
11+
standalone: true,
12+
imports: [FormsModule, ReactiveFormsModule, AsyncPipe, CreditCardDirectivesModule]
1013
})
1114
export class AppComponent {
1215
public demoForm = this.fb.group({

projects/example/src/app/app.module.ts

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

projects/example/src/main.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { enableProdMode } from '@angular/core';
2-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3-
4-
import { AppModule } from './app/app.module';
52
import { environment } from './environments/environment';
3+
import { AppComponent } from './app/app.component';
4+
import { bootstrapApplication } from '@angular/platform-browser';
65

76
if (environment.production) {
87
enableProdMode();
98
}
109

11-
platformBrowserDynamic().bootstrapModule(AppModule)
12-
.catch(err => console.error(err));
10+
bootstrapApplication(AppComponent)
11+
.catch(err => console.error(err));

0 commit comments

Comments
 (0)