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

chore: bump deps and nx version #1148

Merged
merged 1 commit into from
Dec 30, 2024
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
10 changes: 2 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,12 @@
{
"allowExpressions": true
}
],
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
]
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
"extends": ["plugin:@nx/javascript"]
},
{
"files": [
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ generate a new component, run
`npx nx g @nrwl/angular:component --project=spa-<lib> --name=<component name>`.
This will generate a new component in the correct folder. For more information,
check out the [NX documentation]https://nx.dev/more-concepts/nx-and-angular). By
default the Component will be standalone and with `OnPush` Change Detection. Please
try to stick to this as much as possible. You can serve the SPA with `npm run serve:spa`.
Instead of an OAuth Provider, in development environments you will get redirected
to a login page where you can choose a persona. This will set a JWT in the local
storage.
default the Component will be standalone and with `OnPush` Change Detection.
Please try to stick to this as much as possible. You can serve the SPA with
`npm run serve:spa`. Instead of an OAuth Provider, in development environments
you will get redirected to a login page where you can choose a persona. This
will set a JWT in the local storage.

We agreed on supporting only Chromium based browsers with their 2 latest major
versions. This allows us to use features that are available for these browsers
Expand Down
3 changes: 2 additions & 1 deletion apps/spa/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"prefix": "kordis",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
},
"extends": [
"plugin:@nx/angular",
Expand Down
1 change: 1 addition & 0 deletions apps/spa/src/app/component/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TraceComponent } from '@kordis/spa/core/observability';
selector: 'kordis-root',
template: ` <router-outlet></router-outlet> `,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
})
@TraceComponent()
export class AppComponent {
Expand Down
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJestProjects } from '@nx/jest';
import { getJestProjectsAsync } from '@nx/jest';

export default {
projects: getJestProjects(),
};
export default async () => ({
projects: await getJestProjectsAsync(),
});
2 changes: 1 addition & 1 deletion libs/api/tetra/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/api/tetra/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion libs/api/unit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/api/unit/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion libs/api/user/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/api/user/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/test-helpers/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/shared/test-helpers/**/*.ts"]
Expand Down
3 changes: 2 additions & 1 deletion libs/spa/core/auth/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"prefix": "krd",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
19 changes: 11 additions & 8 deletions libs/spa/core/auth/src/lib/auth.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
import {
ModuleWithProviders,
NgModule,
inject,
provideAppInitializer,
} from '@angular/core';
import { RouterModule } from '@angular/router';
import {
AuthConfig,
Expand Down Expand Up @@ -33,19 +38,17 @@ export class AuthModule {
provide: OAuthStorage,
useFactory: () => localStorage,
},
{
provide: APP_INITIALIZER,
useFactory: (oauthService: OAuthService) => {
provideAppInitializer(() => {
const initializerFn = ((oauthService: OAuthService) => {
return async () => {
oauthService.configure(authConfig);
oauthService.setupAutomaticSilentRefresh();
await oauthService.loadDiscoveryDocument(discoveryDocumentUrl);
await oauthService.tryLoginCodeFlow();
};
},
deps: [OAuthService, AUTH_SERVICE],
multi: true,
},
})(inject(OAuthService));
return initializerFn();
}),
{
provide: HTTP_INTERCEPTORS,
useClass: DefaultOAuthInterceptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { DevAuthService } from '../services/dev-auth.service';

@Component({
selector: 'krd-auth',
standalone: true,
styles: [
`
.container {
Expand Down
3 changes: 2 additions & 1 deletion libs/spa/core/graphql/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"prefix": "krd",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
},
"extends": [
"plugin:@nx/angular",
Expand Down
2 changes: 1 addition & 1 deletion libs/spa/core/graphql/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
Expand Down
3 changes: 2 additions & 1 deletion libs/spa/core/observability/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"prefix": "krd",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
},
"extends": [
"plugin:@nx/angular",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { CommonModule } from '@angular/common';
import {
APP_INITIALIZER,
ErrorHandler,
ModuleWithProviders,
NgModule,
inject,
provideAppInitializer,
} from '@angular/core';
import { Router } from '@angular/router';
import {
Expand Down Expand Up @@ -41,13 +42,13 @@ export class SentryObservabilityModule {
provide: TraceService,
deps: [Router],
},
{
provide: APP_INITIALIZER,
// eslint-disable-next-line @typescript-eslint/no-empty-function
useFactory: () => () => {},
deps: [TraceService],
multi: true,
},
provideAppInitializer(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
const initializerFn = ((_: TraceService) => () => {})(
inject(TraceService),
);
return initializerFn();
}),
{
provide: OBSERVABILITY_SERVICE,
useClass: SentryObservabilityService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { alertGroupMinUnitsValidator } from '../rescue-station/rescue-station-ed

@Component({
selector: 'krd-alert-group-edit-modal',
standalone: true,
imports: [
NzButtonComponent,
NzSpinComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { DeploymentUnitComponent } from '../unit/deployment-unit.component';

@Component({
selector: 'krd-deployment-alert-group',
standalone: true,
imports: [CommonModule, DeploymentUnitComponent, NzCardComponent],
template: `
<nz-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { NzSpinComponent } from 'ng-zorro-antd/spin';

@Component({
selector: 'krd-note-popup',
standalone: true,
imports: [
FormsModule,
NzInputDirective,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { DeploymentSearchWrapperComponent } from './deployment-search-wrapper.co

@Component({
selector: 'krd-search-wrapper-child',
/* eslint-disable @angular-eslint/prefer-standalone */
standalone: false,
template: `
<krd-deployment-search-wrapper
[assignments]="assignments()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { DeploymentsSearchStateService } from '../../services/deployments-search

@Component({
selector: 'krd-deployment-search-wrapper',
standalone: true,
imports: [NgTemplateOutlet],
template: `
@if (isVisible()) {
Expand Down Expand Up @@ -52,7 +51,6 @@ export class DeploymentSearchWrapperComponent {
return this.assignments();
}
// otherwise we have a search term, return filtered assignments

return this.assignments().filter((assignment) => {
const hasUnitMatch = (unit: Unit): boolean => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const DEPLOYMENTS_QUERY = gql`

@Component({
selector: 'krd-deployments',
standalone: true,
imports: [
DeploymentCardComponent,
DeploymentSearchWrapperComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const STATUS_SORT_ORDER: Readonly<Record<number, number>> = Object.freeze({

@Component({
selector: 'krd-deployment-card',
standalone: true,
imports: [
DeploymentAlertGroupComponent,
DeploymentUnitComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { NameSearchWrapperComponent } from './name-search-wrapper.component';

@Component({
selector: 'krd-name-search-wrapper-child',
/* eslint-disable @angular-eslint/prefer-standalone */
standalone: false,
template: `
<krd-name-search-wrapper [name]="name()">
<span data-testid="child-content">hello</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Component, computed, inject, input } from '@angular/core';
import { DeploymentsSearchStateService } from '../../services/deployments-search-state.service';

@Component({
standalone: true,
selector: 'krd-name-search-wrapper',
template: `
@if (isVisible()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { NzTooltipDirective } from 'ng-zorro-antd/tooltip';

@Component({
selector: 'krd-note-indicator',
standalone: true,
imports: [NzIconDirective, NzTooltipDirective],
template: `<i
nz-icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { NoteIndicatorComponent } from '../note-indicator.component';

@Component({
selector: 'krd-rescue-station-deployment-card-header',
standalone: true,
imports: [NoteIndicatorComponent],
template: `
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { DeploymentCardComponent } from './deplyoment-card.component';
import { RescueStationDeploymentCardHeaderComponent } from './rescue-station/rescue-station-deployment-card-header.component';

@Component({
standalone: true,
selector: 'krd-signed-in-deployments',
template: `
@if (showNoSearchResults()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { DeploymentsSearchStateService } from '../../services/deployments-search
import { NameSearchWrapperComponent } from './name-search-wrapper.component';

@Component({
standalone: true,
selector: 'krd-signed-off-deployments',
template: `
@if (showNoSearchResults()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { StatusBadgeComponent } from './status-badge.component';

@Component({
selector: 'krd-deployment-unit',
standalone: true,
imports: [
DeploymentNotePopupComponent,
NoteIndicatorComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { STATUS_EXPLANATIONS } from '../../../status-explanations';

@Component({
selector: 'krd-status-badge',
standalone: true,
imports: [NzTooltipDirective, NgClass],
template: `
@if (hasStatus()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { PossibleAlertGroupSelectionsService } from '../../service/alert-group-s

@Component({
selector: 'krd-alert-group-autocomplete',
standalone: true,
imports: [
AsyncPipe,
NzAutocompleteModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { UnitsSelectComponent } from '../unit/units-select.component';

@Component({
selector: 'krd-alert-group-selection',
standalone: true,
imports: [
NzFormControlComponent,
NzFormItemComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { AlertGroupSelectionComponent } from './alert-group-selection.component'

@Component({
selector: 'krd-alert-group-selections',
standalone: true,
imports: [
AlertGroupAutocompleteComponent,
AlertGroupSelectionComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { Unit } from '@kordis/shared/model';
// placeholder until we have the protocol frontend ready!
@Component({
selector: 'krd-protocol-data',
standalone: true,
imports: [CommonModule, ReactiveFormsModule, NzInputDirective],
template: `
<div [formGroup]="formGroup()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { Subject, map, of, startWith, takeUntil } from 'rxjs';

@Component({
selector: 'krd-strength',
standalone: true,
template: `
<div [formGroup]="formGroup()" nz-form nzLayout="inline">
<nz-form-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { StatusBadgeComponent } from '../../../../deployment/unit/status-badge.c

@Component({
selector: 'krd-unit-selection-option',
standalone: true,
imports: [StatusBadgeComponent],
template: `
<div class="result-item">
Expand Down
Loading
Loading