Skip to content

Commit

Permalink
feat: update to Angular v19+
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Angular v19+ is now the minimal version to use the library.

Closes #153
  • Loading branch information
tinesoft committed Dec 22, 2024
1 parent da44154 commit 7b294af
Show file tree
Hide file tree
Showing 15 changed files with 1,993 additions and 3,521 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"firsttris.vscode-jest-runner",
"anweber.reveal-button"
"anweber.reveal-button",
"github.vscode-github-actions"
],
"settings":{
"debug.javascript.autoAttachFilter": "disabled",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ Every Nx plugin relies on the underlying Nx Workspace/DevKit it runs on. This ta

| Library Version | Angular version
| -------------- | --------------------
| `>=v8.0.0` | `>=v19.x.x`
| `>=v7.0.0` | `>=v18.x.x`
| `>=v6.0.0` | `>=v16.x.x`
| `>=v5.0.0` | `>=v15.x.x`
Expand Down
3 changes: 2 additions & 1 deletion apps/demo/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"prefix": "ngx-cookieconsent",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
},
"extends": [
"plugin:@nx/angular",
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'zone.js/node';

import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import { CommonEngine } from '@angular/ssr/node';
import * as express from 'express';
import { existsSync } from 'node:fs';
import { join } from 'node:path';
Expand Down
9 changes: 4 additions & 5 deletions apps/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import { TranslateService } from '@ngx-translate/core';
import { HeaderComponent } from "./shared/header/header.component";
import { FooterComponent } from "./shared/footer/footer.component";
@Component({
selector: 'ngc-demo-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RouterOutlet, HeaderComponent, FooterComponent]
selector: 'ngc-demo-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
imports: [RouterOutlet, HeaderComponent, FooterComponent]
})
export class AppComponent implements OnInit, OnDestroy {

Expand Down
17 changes: 6 additions & 11 deletions apps/demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HttpClient, provideHttpClient } from '@angular/common/http';
import { ENVIRONMENT_INITIALIZER, SecurityContext, ApplicationConfig } from '@angular/core';
import { SecurityContext, ApplicationConfig, inject, provideEnvironmentInitializer } from '@angular/core';

import {
NgcCookieConsentConfig,
Expand Down Expand Up @@ -100,21 +100,16 @@ export const appConfig: ApplicationConfig = {
gfm: true,
breaks: false,
pedantic: false,
smartLists: true,
smartypants: false,
},
},
sanitize: SecurityContext.NONE,
}),
{
provide: ENVIRONMENT_INITIALIZER,
useFactory: (iconLibrary: FaIconLibrary) => async () => {
provideEnvironmentInitializer(() => {
const initializerFn = ((iconLibrary: FaIconLibrary) => async () => {
// Add any icons needed here:
iconLibrary.addIcons(...iconsList);
},
// When using a factory provider you need to explicitly specify its dependencies.
deps: [FaIconLibrary],
multi: true,
},
})(inject(FaIconLibrary));
return initializerFn();
}),
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { MarkdownModule } from 'ngx-markdown';
selector: 'ngc-demo-getting-started',
templateUrl: './getting-started.component.html',
styleUrls: ['./getting-started.component.scss'],
standalone: true,
imports: [MarkdownModule]
})
export class GettingStartedComponent implements OnInit {
Expand Down
11 changes: 0 additions & 11 deletions apps/demo/src/app/home/home-routing.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/demo/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { FaIconComponent } from '@fortawesome/angular-fontawesome';
selector: 'ngc-demo-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
standalone: true,
imports: [PlaygroundComponent, FaIconComponent]
})
export class HomeComponent implements OnInit {
Expand Down
3 changes: 1 addition & 2 deletions apps/demo/src/app/home/playground/playground.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { FaIconComponent } from '@fortawesome/angular-fontawesome';
selector: 'ngc-demo-playground',
templateUrl: './playground.component.html',
styleUrls: ['./playground.component.scss'],
standalone: true,
imports: [NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, NgFor, NgClass, FormsModule,FaIconComponent, NgbAccordionModule, ColorPickerModule, ClipboardModule, JsonPipe]
imports: [NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, NgFor, NgClass, FormsModule, FaIconComponent, NgbAccordionModule, ColorPickerModule, ClipboardModule, JsonPipe]
})
export class PlaygroundComponent {

Expand Down
1 change: 0 additions & 1 deletion apps/demo/src/app/shared/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RouterLink, RouterLinkActive } from '@angular/router';
selector: 'ngc-demo-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss'],
standalone: true,
imports: [RouterLink, NgbCollapse, RouterLinkActive]
})
export class HeaderComponent {
Expand Down
3 changes: 2 additions & 1 deletion libs/ngx-cookieconsent/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"prefix": "ngc",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
},
"extends": [
"plugin:@nx/angular",
Expand Down
4 changes: 2 additions & 2 deletions libs/ngx-cookieconsent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "ngx-cookieconsent",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": ">=18.0.0",
"@angular/core": ">=18.0.0",
"@angular/common": ">=19.0.0",
"@angular/core": ">=19.0.0",
"rxjs": "^6.5.3 || ^7.4.0",
"cookieconsent": "^3.1.1"
},
Expand Down
Loading

0 comments on commit 7b294af

Please sign in to comment.