Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(project): update to Angular v19 #225

Merged
merged 2 commits into from
Mar 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ testem.log
Thumbs.db

.nx/cache
.nx/workspace-data
.angular
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/coverage
.angular
.nx

/.nx/workspace-data
3 changes: 2 additions & 1 deletion apps/ngx-popovers/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"prefix": "ngx-popovers",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
3 changes: 0 additions & 3 deletions apps/ngx-popovers/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"outputPath": "dist/apps/ngx-popovers",
"index": "apps/ngx-popovers/src/index.html",
"browser": "apps/ngx-popovers/src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "apps/ngx-popovers/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
Expand Down
2 changes: 1 addition & 1 deletion apps/ngx-popovers/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import { CommonEngine } from '@angular/ssr/node';
import express from 'express';
import { fileURLToPath } from 'node:url';
import { dirname, join, resolve } from 'node:path';
Expand Down
6 changes: 3 additions & 3 deletions apps/ngx-popovers/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Component } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { ArrowProvider } from './core/custom-arrow';
import { PopoverProvider } from './core/custom-popover';
import { TooltipConfigProvider, TooltipProvider } from './core/custom-tooltip';

@Component({
standalone: true,
imports: [
RouterOutlet
],
Expand All @@ -17,7 +16,8 @@ import { TooltipConfigProvider, TooltipProvider } from './core/custom-tooltip';
TooltipConfigProvider,
PopoverProvider,
ArrowProvider
]
],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent {

Expand Down
27 changes: 15 additions & 12 deletions apps/ngx-popovers/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { APP_INITIALIZER, ApplicationConfig, importProvidersFrom } from '@angular/core';
import {
ApplicationConfig,
importProvidersFrom,
inject,
provideAppInitializer,
provideExperimentalZonelessChangeDetection
} from '@angular/core';
import { provideClientHydration } from '@angular/platform-browser';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { provideRouter, withInMemoryScrolling } from '@angular/router';
Expand All @@ -9,6 +15,7 @@ import { HighlightService } from '@demo/core/highlight/highlight.service';
export const appConfig: ApplicationConfig = {
providers: [
provideClientHydration(),
provideExperimentalZonelessChangeDetection(),
provideRouter(appRoutes, withInMemoryScrolling({
scrollPositionRestoration: 'enabled',
anchorScrolling: 'enabled'
Expand All @@ -17,16 +24,12 @@ export const appConfig: ApplicationConfig = {
importProvidersFrom(
LucideAngularModule.pick({ Code })
),
{
provide: APP_INITIALIZER,
useFactory: (service: HighlightService) => {
return () => service.init({
langs: ['ts', 'angular-html', 'scss', 'bash'],
themes: ['one-dark-pro']
});
},
deps: [HighlightService],
multi: true
}
provideAppInitializer(async () => {
const service = inject(HighlightService);
await service.init({
langs: ['ts', 'angular-html', 'scss', 'bash'],
themes: ['one-dark-pro']
});
})
]
};
2 changes: 1 addition & 1 deletion apps/ngx-popovers/src/app/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*?raw" {
declare module '*?raw' {
const src: string;
export default src;
}
2 changes: 1 addition & 1 deletion apps/ngx-popovers/src/app/core/custom-popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export const PopoverProvider: Provider = {
flip()
]
})
}
};
2 changes: 1 addition & 1 deletion apps/ngx-popovers/src/app/core/custom-tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TooltipConfigProvider: Provider = {
middleware: [
flip(),
shift(),
offset(8),
offset(8)
]
})
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('CodeComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [CodeComponent],
imports: [CodeComponent]
}).compileComponents();

fixture = TestBed.createComponent(CodeComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { DomSanitizer } from '@angular/platform-browser';

@Component({
selector: 'demo-code',
standalone: true,
imports: [CommonModule],
templateUrl: './code.component.html',
styleUrl: './code.component.scss',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('HighlightComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HighlightComponent],
imports: [HighlightComponent]
}).compileComponents();

fixture = TestBed.createComponent(HighlightComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { booleanAttribute, ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Clipboard } from '@angular/cdk/clipboard';
import { PortalComponent } from '@ngx-popovers/core';
import { CodeComponent } from './code/code.component';

enum CopyStatus {
Expand All @@ -12,11 +11,10 @@ enum CopyStatus {

@Component({
selector: 'highlight',
standalone: true,
imports: [CommonModule, PortalComponent, CodeComponent],
imports: [CommonModule, CodeComponent],
templateUrl: './highlight.component.html',
styleUrl: './highlight.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HighlightComponent {
code = input<string | null | {} | undefined>(undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('DocumentationTemplateComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [DocumentationTemplateComponent],
imports: [DocumentationTemplateComponent]
}).compileComponents();

fixture = TestBed.createComponent(DocumentationTemplateComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { CommonModule } from '@angular/common';
import { FooterComponent } from '@demo/template/footer';
import { FormsModule } from '@angular/forms';
import { HeaderComponent } from '@demo/template/header';
import { NavigationEnd, Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
import { NavigationEnd, Router, RouterOutlet } from '@angular/router';
import { filter, tap } from 'rxjs';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { DocNavigationComponent } from '@demo/pages/documentation/ui/components/doc-navigation';

@Component({
selector: 'ngx-popovers-documentation-template',
standalone: true,
imports: [CommonModule, FooterComponent, FormsModule, HeaderComponent, RouterLinkActive, RouterOutlet, RouterLink, DocNavigationComponent],
imports: [CommonModule, FooterComponent, FormsModule, HeaderComponent, RouterOutlet, DocNavigationComponent],
templateUrl: './documentation-template.component.html',
styleUrl: './documentation-template.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div #reference>trigger</div>

<ngx-floating
[reference]="reference"
placement="bottom"
<ngx-floating
[reference]="reference"
placement="bottom"
bindTo="main"
>
<div class="floating">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('IndexComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [IndexComponent],
imports: [IndexComponent]
}).compileComponents();

fixture = TestBed.createComponent(IndexComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Arrow, FloatingComponent } from "@ngx-popovers/core";
import { Arrow, FloatingComponent } from '@ngx-popovers/core';

@Component({
selector: 'demo-index',
standalone: true,
imports: [
FloatingComponent,
Arrow
],
templateUrl: './index.component.html',
styleUrl: './index.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class IndexComponent { }
export class IndexComponent {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Provider } from "@angular/core";
import { ArrowBase, NGX_ARROW_COMPONENT } from "@ngx-popovers/core";
import { Component, Provider } from '@angular/core';
import { ArrowBase, NGX_ARROW_COMPONENT } from '@ngx-popovers/core';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe('PageArrowComponent', () => {
await TestBed.configureTestingModule({
imports: [PageArrowComponent]
})
.compileComponents();
.compileComponents();

fixture = TestBed.createComponent(PageArrowComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { AsyncPipe, CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { HighlightComponent } from '@demo/core/highlight';
import { TitleComponent } from '@demo/pages/documentation/ui/components/title/title.component';
import { CodeExampleTabsComponent } from "../../ui/components/code-example-tabs/code-example-tabs.component";
import { DocPageComponent } from "../../ui/components/doc-page/doc-page.component";
import { DocSectionComponent } from "../../ui/components/doc-page/doc-section/doc-section.component";
import { SubTitleComponent } from "../../ui/components/doc-page/sub-title/sub-title.component";
import { CodeExampleTabsComponent } from '../../ui/components/code-example-tabs/code-example-tabs.component';
import { DocPageComponent } from '../../ui/components/doc-page/doc-page.component';
import { DocSectionComponent } from '../../ui/components/doc-page/doc-section/doc-section.component';
import { SubTitleComponent } from '../../ui/components/doc-page/sub-title/sub-title.component';

@Component({
selector: 'ngx-popovers-page-arrow',
standalone: true,
imports: [
CommonModule,
TitleComponent,
Expand All @@ -19,7 +18,7 @@ import { SubTitleComponent } from "../../ui/components/doc-page/sub-title/sub-ti
SubTitleComponent,
CodeExampleTabsComponent,
AsyncPipe
],
],
templateUrl: './page-arrow.component.html',
styleUrl: './page-arrow.component.css',
changeDetection: ChangeDetectionStrategy.OnPush
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('PageClickOutsideComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PageClickOutsideComponent],
imports: [PageClickOutsideComponent]
}).compileComponents();

fixture = TestBed.createComponent(PageClickOutsideComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
import { TitleComponent } from '@demo/pages/documentation/ui/components/title/title.component';
import { HighlightComponent } from '@demo/core/highlight';
import { ExampleComponent } from '@demo/template/example';
import { Arrow, ClickOutsideDirective, flip, FloatingComponent, offset } from '@ngx-popovers/core';
import { ClickOutsideDirective, flip, FloatingComponent, offset } from '@ngx-popovers/core';
import { animate, style, transition, trigger } from '@angular/animations';

class LogItem {
Expand Down Expand Up @@ -51,15 +51,13 @@ export class ClickOutsideExample {

@Component({
selector: 'ngx-popovers-page-click-outside',
standalone: true,
imports: [
CommonModule,
TitleComponent,
HighlightComponent,
ExampleComponent,
ClickOutsideDirective,
FloatingComponent,
Arrow
FloatingComponent
],
templateUrl: './page-click-outside.component.html',
styleUrl: './page-click-outside.component.scss',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ <h2 class="text-4xl mb-4 font-bold">About</h2>
</p>
<p class="text-lg py-4">
<a [routerLink]="['/', 'docs', 'core']" class="link inline-flex gap-2 items-center">
<core-icon class="text-primary" /> Core package
<core-icon class="text-primary" />
Core package
</a>
</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TitleComponent } from '@demo/pages/documentation/ui/components/title/title.component';
import { ArrowIcon, ClickOutsideIcon, CoreIcon, FloatingIcon, PortalIcon } from '@demo/app-routes-icons';
import { CoreIcon } from '@demo/app-routes-icons';
import { RouterLink } from '@angular/router';
import { HighlightComponent } from '@demo/core/highlight';
import { ComponentsRoutes } from '@demo/app-routes';

@Component({
selector: 'ngx-popovers-page-core',
standalone: true,
imports: [CommonModule, TitleComponent, CoreIcon, RouterLink, HighlightComponent, PortalIcon, FloatingIcon, ClickOutsideIcon, ArrowIcon],
imports: [CommonModule, TitleComponent, CoreIcon, RouterLink, HighlightComponent],
templateUrl: './page-core.component.html',
styleUrl: './page-core.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('IndexComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [IndexComponent],
imports: [IndexComponent]
}).compileComponents();

fixture = TestBed.createComponent(IndexComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Arrow, flip, FloatingComponent, offset, shift } from '@ngx-popovers/cor

@Component({
selector: 'demo-index',
standalone: true,
imports: [
CommonModule,
FloatingComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('IndexComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [IndexComponent],
imports: [IndexComponent]
}).compileComponents();

fixture = TestBed.createComponent(IndexComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { flip } from '@floating-ui/dom';

@Component({
selector: 'demo-index',
standalone: true,
imports: [
CommonModule,
Arrow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('IndexComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [IndexComponent],
imports: [IndexComponent]
}).compileComponents();

fixture = TestBed.createComponent(IndexComponent);
Expand Down
Loading