Skip to content

Commit

Permalink
refactor: components are standalone by default in ng v19
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoslig committed Nov 20, 2024
1 parent 971647e commit 22967d8
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 47 deletions.
1 change: 0 additions & 1 deletion apps/conduit/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { NavbarComponent } from './layout/navbar/navbar.component';

@Component({
selector: 'cdt-root',
standalone: true,
templateUrl: './app.component.html',
imports: [FooterComponent, NavbarComponent, RouterModule],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
1 change: 0 additions & 1 deletion apps/conduit/src/app/layout/footer/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';

@Component({
selector: 'cdt-footer',
standalone: true,
templateUrl: './footer.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
1 change: 0 additions & 1 deletion apps/conduit/src/app/layout/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { User } from '@realworld/core/api-types';

@Component({
selector: 'cdt-navbar',
standalone: true,
templateUrl: './navbar.component.html',
imports: [RouterModule],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ArticleStore } from '@realworld/articles/data-access';

@Component({
selector: 'cdt-article-edit',
standalone: true,
templateUrl: './article-edit.component.html',
styleUrls: ['./article-edit.component.css'],
imports: [ListErrorsComponent, ReactiveFormsModule, InputErrorsComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { FormBuilder, ReactiveFormsModule } from '@angular/forms';

@Component({
selector: 'cdt-add-comment',
standalone: true,
templateUrl: './add-comment.component.html',
imports: [ListErrorsComponent, ReactiveFormsModule, InputErrorsComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { DatePipe } from '@angular/common';

@Component({
selector: 'cdt-article-comment',
standalone: true,
templateUrl: './article-comment.component.html',
imports: [DatePipe, RouterModule],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { RouterModule } from '@angular/router';
import { Article } from '@realworld/core/api-types';
@Component({
selector: 'cdt-article-meta',
standalone: true,
templateUrl: './article-meta.component.html',
imports: [RouterModule, NgClass, DatePipe],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
1 change: 0 additions & 1 deletion libs/articles/feature-article/src/article.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AuthStore } from '@realworld/auth/data-access';

@Component({
selector: 'cdt-article',
standalone: true,
templateUrl: './article.component.html',
styleUrls: ['./article.component.css'],
imports: [ArticleMetaComponent, ArticleCommentComponent, MarkdownPipe, AddCommentComponent, RouterLink],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { NgClass, DatePipe } from '@angular/common';
import { Article } from '@realworld/core/api-types';
@Component({
selector: 'cdt-article-list-item',
standalone: true,
templateUrl: './article-list-item.component.html',
imports: [RouterModule, NgClass, DatePipe],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ArticlesListStore } from '@realworld/articles/data-access';

@Component({
selector: 'cdt-article-list',
standalone: true,
templateUrl: './article-list.component.html',
imports: [ArticleListItemComponent, PagerComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
1 change: 0 additions & 1 deletion libs/auth/feature-auth/src/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { AuthStore } from '@realworld/auth/data-access';

@Component({
selector: 'cdt-login',
standalone: true,
templateUrl: './login.component.html',
imports: [ListErrorsComponent, RouterLink, ReactiveFormsModule, InputErrorsComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
1 change: 0 additions & 1 deletion libs/auth/feature-auth/src/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';

@Component({
selector: 'cdt-register',
standalone: true,
templateUrl: './register.component.html',
styleUrls: ['./register.component.css'],
imports: [ListErrorsComponent, RouterModule, ReactiveFormsModule, InputErrorsComponent],
Expand Down
1 change: 0 additions & 1 deletion libs/core/forms/src/lib/input-errors/error-mapper-pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { VALIDATION_ERROR_MESSAGES } from './error-messages';

@Pipe({
name: 'errorMapper',
standalone: true,
})
export class ErrorMapperPipe implements PipeTransform {
private errorMessages = inject(VALIDATION_ERROR_MESSAGES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { IsErrorVisibleDirective } from './is-error-visible.directive';

@Component({
selector: 'cdt-input-errors',
standalone: true,
templateUrl: './input-errors.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [KeyValuePipe, ErrorMapperPipe, IsErrorVisibleDirective],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { AbstractControl } from '@angular/forms';

@Directive({
standalone: true,
selector: '[isErrorVisible]',
selector: '[isErrorVisible]'
})
export class IsErrorVisibleDirective implements AfterViewInit {
private readonly templateRef = inject(TemplateRef<unknown>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FormErrorsStore } from '../forms-errors.store';

@Component({
selector: 'cdt-list-errors',
standalone: true,
templateUrl: './list-errors.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
1 change: 0 additions & 1 deletion libs/home/feature-home/src/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AuthStore } from '@realworld/auth/data-access';

@Component({
selector: 'cdt-home',
standalone: true,
templateUrl: './home.component.html',
styleUrls: ['./home.component.css'],
imports: [NgClass, TagsListComponent, ArticleListComponent],
Expand Down
3 changes: 1 addition & 2 deletions libs/home/feature-home/src/tags-list/tags-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, output, input } from '@angular/core';
import { Component, ChangeDetectionStrategy, output, input } from '@angular/core';

@Component({
selector: 'cdt-tags-list',
standalone: true,
templateUrl: './tags-list.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
1 change: 0 additions & 1 deletion libs/profile/feature-profile/src/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AuthStore } from '@realworld/auth/data-access';
import { ProfileStore } from '@realworld/profile/data-access';

@Component({
standalone: true,
selector: 'cdt-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.css'],
Expand Down
1 change: 0 additions & 1 deletion libs/settings/feature-settings/src/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AuthStore } from '@realworld/auth/data-access';
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';

@Component({
standalone: true,
selector: 'cdt-settings',
templateUrl: './settings.component.html',
styleUrls: ['./settings.component.css'],
Expand Down
1 change: 0 additions & 1 deletion libs/ui/components/src/lib/pager/pager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { NgClass } from '@angular/common';
import { Component, ChangeDetectionStrategy, input, output } from '@angular/core';

@Component({
standalone: true,
selector: 'cdt-pager',
templateUrl: './pager.component.html',
styleUrls: ['./pager.component.css'],
Expand Down
96 changes: 72 additions & 24 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,82 @@
"importHelpers": true,
"target": "es2015",
"module": "esnext",
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom"],
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {
"@default/*": ["apps/conduit/src/app/*"],
"@env/*": ["apps/conduit/src/environments/*"],
"@realworld/*": ["libs/*"],
"@realworld/articles/article": ["libs/articles/feature-article/src/index.ts"],
"@realworld/articles/article-edit": ["libs/articles/feature-article-edit/src/index.ts"],
"@realworld/articles/articles-list": ["libs/articles/feature-articles-list/src/index.ts"],
"@realworld/articles/data-access": ["libs/articles/data-access/src/index.ts"],
"@realworld/auth/data-access": ["libs/auth/data-access/src/index.ts"],
"@realworld/auth/feature-auth": ["libs/auth/feature-auth/src/index.ts"],
"@realworld/core/api-types": ["libs/core/api-types/src/index.ts"],
"@realworld/core/data-access": ["libs/core/data-access/src/index.ts"],
"@realworld/core/error-handler": ["libs/core/error-handler/src/index.ts"],
"@realworld/core/forms": ["libs/core/forms/src/index.ts"],
"@realworld/core/http-client": ["libs/core/http-client/src/index.ts"],
"@realworld/home/feature-home": ["libs/home/feature-home/src/index.ts"],
"@realworld/profile/data-access": ["libs/profile/data-access/src/index.ts"],
"@realworld/profile/feature-profile": ["libs/profile/feature-profile/src/index.ts"],
"@realworld/settings/data-access": ["libs/settings/data-access/src/index.ts"],
"@realworld/settings/feature-settings": ["libs/settings/feature-settings/src/index.ts"],
"@realworld/ui/components": ["libs/ui/components/src/index.ts"]
"@default/*": [
"apps/conduit/src/app/*"
],
"@env/*": [
"apps/conduit/src/environments/*"
],
"@realworld/*": [
"libs/*"
],
"@realworld/articles/article": [
"libs/articles/feature-article/src/index.ts"
],
"@realworld/articles/article-edit": [
"libs/articles/feature-article-edit/src/index.ts"
],
"@realworld/articles/articles-list": [
"libs/articles/feature-articles-list/src/index.ts"
],
"@realworld/articles/data-access": [
"libs/articles/data-access/src/index.ts"
],
"@realworld/auth/data-access": [
"libs/auth/data-access/src/index.ts"
],
"@realworld/auth/feature-auth": [
"libs/auth/feature-auth/src/index.ts"
],
"@realworld/core/api-types": [
"libs/core/api-types/src/index.ts"
],
"@realworld/core/data-access": [
"libs/core/data-access/src/index.ts"
],
"@realworld/core/error-handler": [
"libs/core/error-handler/src/index.ts"
],
"@realworld/core/forms": [
"libs/core/forms/src/index.ts"
],
"@realworld/core/http-client": [
"libs/core/http-client/src/index.ts"
],
"@realworld/home/feature-home": [
"libs/home/feature-home/src/index.ts"
],
"@realworld/profile/data-access": [
"libs/profile/data-access/src/index.ts"
],
"@realworld/profile/feature-profile": [
"libs/profile/feature-profile/src/index.ts"
],
"@realworld/settings/data-access": [
"libs/settings/data-access/src/index.ts"
],
"@realworld/settings/feature-settings": [
"libs/settings/feature-settings/src/index.ts"
],
"@realworld/ui/components": [
"libs/ui/components/src/index.ts"
]
},
"strict": true
},
"exclude": ["node_modules", "tmp"]
}
"exclude": [
"node_modules",
"tmp"
]
}

0 comments on commit 22967d8

Please sign in to comment.