Skip to content

Commit

Permalink
chore: Nx migration (all packages and their migration)
Browse files Browse the repository at this point in the history
- ran `npx nx migrate latest` (bump most of libraries to the latest version) and `npx nx migrate --run-migration` (run packages' migration, all except angular's migration from initializer tokens to helper functions)
- bump '@angular/animations' to version '^19.0.3'
- bump '@angular/common' to version '^19.0.3'
- bump '@angular/compiler' to version '^19.0.3'
- bump '@angular/core' to version '^19.0.3'
- bump '@angular/forms' to version '^19.0.3'
- bump '@angular/platform-browser' to version '^19.0.3'
- bump '@angular/platform-browser-dynamic' to version '^19.0.3'
- bump '@angular/platform-server' to version '^19.0.3'
- bump '@angular/pwa' to version '^19.0.4'
- bump '@angular/router' to version '^19.0.3'
- bump '@angular/service-worker' to version '^19.0.3'
- bump '@angular/ssr' to version '^19.0.4'
- bump '@ng-select/ng-select' to version '^14.1.0'
- bump 'angular-oauth2-oidc' to version '19.0.0'
- bump 'ngx-infinite-scroll' to version '^19.0.0'
- bump 'zone.js' to version '0.15.0'
- bump '@angular-devkit/build-angular' to version '^19.0.4'
- bump '@angular-devkit/core' to version '^19.0.4'
- bump '@angular-devkit/schematics' to version '^19.0.4'
- bump '@angular-eslint/builder' to version '19.0.2'
- bump '@angular-eslint/eslint-plugin' to version '^19.0.2'
- bump '@angular-eslint/eslint-plugin-template' to version '^19.0.2'
- bump '@angular-eslint/schematics' to version '^19.0.2'
- bump '@angular-eslint/template-parser' to version '^19.0.2'
- bump '@angular-eslint/test-utils' to version '^19.0.2'
- bump '@angular-eslint/utils' to version '^19.0.2'
- bump '@angular/cli' to version '^19.0.4'
- bump '@angular/compiler-cli' to version '^19.0.3'
- bump '@angular/language-service' to version '^19.0.3'
- bump '@nx/angular' to version '^20.2.2'
- bump '@nx/devkit' to version '^20.2.2'
- bump '@nx/eslint-plugin' to version '^20.2.2'
- bump '@nx/jest' to version '^20.2.2'
- bump '@nx/workspace' to version '^20.2.2'
- bump '@schematics/angular' to version '^19.0.4'
- bump 'jest-preset-angular' to version '14.4.2'
- bump 'ng-packagr' to version '^19.0.1'
- bump 'nx' to version '^20.2.2'
- bump 'typescript' to version '^5.6.3'
- add `standalone: false` to all components, directives and pipes
  for more, see: angular/angular#57643
- add rule `"@angular-eslint/prefer-standalone": "off"` in eslint files
- remove deprecated `"angular-eslint/no-host-metadata-property"`
  for more, see: angular-eslint/angular-eslint#2113
- update '@angular/ssr' import paths to use the new '/node' entry point when 'CommonEngine' is detected
  for more, see: angular/angular-cli#28278
  • Loading branch information
pawelfras committed Dec 12, 2024
1 parent 44b084c commit 158766c
Show file tree
Hide file tree
Showing 915 changed files with 13,923 additions and 7,297 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
],
"plugins": ["deprecation", "@typescript-eslint", "@nx", "@stylistic/ts"],
"rules": {
"@angular-eslint/no-host-metadata-property": "off",
"deprecation/deprecation": "warn",
"prefer-arrow/prefer-arrow-functions": "off",
"space-before-function-paren": "off",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { CommonEngineOptions, CommonEngineRenderOptions } from '@angular/ssr';
import {
CommonEngineOptions,
CommonEngineRenderOptions,
} from '@angular/ssr/node';
import { NgSetupOptions } from '../engine/ng-express-engine';
import {
OptimizedSsrEngine,
Expand Down
2 changes: 1 addition & 1 deletion core-libs/setup/ssr/engine/cx-common-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CommonEngine,
CommonEngineOptions,
CommonEngineRenderOptions,
} from '@angular/ssr';
} from '@angular/ssr/node';
import { PROPAGATE_ERROR_TO_SERVER } from '../error-handling/error-response/propagate-error-to-server';

/**
Expand Down
5 changes: 4 additions & 1 deletion core-libs/setup/ssr/engine/ng-express-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*/

import { StaticProvider } from '@angular/core';
import { CommonEngineOptions, CommonEngineRenderOptions } from '@angular/ssr';
import {
CommonEngineOptions,
CommonEngineRenderOptions,
} from '@angular/ssr/node';
import { Request, Response } from 'express';
import { REQUEST, RESPONSE } from '../tokens/express.tokens';
import { CxCommonEngine } from './cx-common-engine';
Expand Down
10 changes: 9 additions & 1 deletion feature-libs/asm/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": ["schematics/**/*.d.ts"]
"ignorePatterns": ["schematics/**/*.d.ts"],
"overrides": [
{
"files": ["*.ts"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
} from './asm-bind-cart-dialog.component';

@Pipe({
name: 'cxTranslate',
name: 'cxTranslate',
standalone: false
})
class MockTranslatePipe implements PipeTransform {
transform(): any {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export enum BIND_CART_DIALOG_ACTION {
}

@Component({
selector: 'cx-asm-bind-cart-dialog',
templateUrl: './asm-bind-cart-dialog.component.html',
selector: 'cx-asm-bind-cart-dialog',
templateUrl: './asm-bind-cart-dialog.component.html',
standalone: false
})
export class AsmBindCartDialogComponent {
BIND_CART_ACTION = BIND_CART_DIALOG_ACTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ import { AsmBindCartComponent } from './asm-bind-cart.component';
import createSpy = jasmine.createSpy;

@Component({
selector: 'cx-icon',
template: '',
selector: 'cx-icon',
template: '',
standalone: false
})
class MockCxIconComponent {
@Input() type: ICON_TYPE;
Expand Down Expand Up @@ -84,7 +85,8 @@ class MockActiveCartService implements Partial<ActiveCartFacade> {
}

@Pipe({
name: 'cxTranslate',
name: 'cxTranslate',
standalone: false
})
class MockTranslatePipe implements PipeTransform {
transform(): any {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ import { SAVE_CART_DIALOG_ACTION } from '../asm-save-cart-dialog/asm-save-cart-d
import { AsmComponentService } from '../services/asm-component.service';

@Component({
selector: 'cx-asm-bind-cart',
templateUrl: './asm-bind-cart.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'cx-asm-bind-cart',
templateUrl: './asm-bind-cart.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false
})
export class AsmBindCartComponent implements OnInit, OnDestroy {
activeCartValidator: ValidatorFn = (control) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ const duplicatedUidErrorResponse: HttpErrorModel = {
};

@Component({
selector: 'cx-icon',
template: '',
selector: 'cx-icon',
template: '',
standalone: false
})
class MockCxIconComponent {
@Input() type: ICON_TYPE;
Expand All @@ -98,7 +99,8 @@ class MockAsmCreateCustomerFacade implements Partial<AsmCreateCustomerFacade> {
}

@Directive({
selector: '[cxFocus]',
selector: '[cxFocus]',
standalone: false
})
export class MockKeyboadFocusDirective {
@Input('cxFocus') config: FocusConfig = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import { first } from 'rxjs/operators';
import { CreatedCustomer } from './asm-create-customer-form.model';

@Component({
selector: 'cx-asm-create-customer-form',
templateUrl: './asm-create-customer-form.component.html',
selector: 'cx-asm-create-customer-form',
templateUrl: './asm-create-customer-form.component.html',
standalone: false
})
export class AsmCreateCustomerFormComponent {
createdCustomer: CreatedCustomer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ class MockAuthService implements Partial<AuthService> {
}

@Component({
selector: 'cx-icon',
template: '',
selector: 'cx-icon',
template: '',
standalone: false
})
class MockCxIconComponent {
@Input() type: ICON_TYPE;
Expand Down Expand Up @@ -101,28 +102,32 @@ class MockLaunchDialogService implements Partial<LaunchDialogService> {
}

@Component({
selector: 'cx-asm-toggle-ui',
template: '',
selector: 'cx-asm-toggle-ui',
template: '',
standalone: false
})
class MockAsmToggleUiComponent {}

@Component({
selector: 'cx-asm-session-timer',
template: '',
selector: 'cx-asm-session-timer',
template: '',
standalone: false
})
class MockAsmSessionTimerComponent {}

@Component({
selector: 'cx-customer-selection',
template: '',
selector: 'cx-customer-selection',
template: '',
standalone: false
})
class MockCustomerSelectionComponent {
@Output()
submitEvent = new EventEmitter();
}
@Component({
selector: 'cx-csagent-login-form',
template: '',
selector: 'cx-csagent-login-form',
template: '',
standalone: false
})
class MockCSAgentLoginFormComponent {
@Output()
Expand All @@ -131,8 +136,9 @@ class MockCSAgentLoginFormComponent {
csAgentTokenLoading = false;
}
@Component({
template: '',
selector: 'cx-customer-emulation',
template: '',
selector: 'cx-customer-emulation',
standalone: false
})
class MockCustomerEmulationComponent {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ export const CART_TYPE_KEY: CartTypeKey = {
inactive: 'asm.saveInactiveCartAlertInfo',
};
@Component({
selector: 'cx-asm-main-ui',
templateUrl: './asm-main-ui.component.html',
selector: 'cx-asm-main-ui',
templateUrl: './asm-main-ui.component.html',
standalone: false
})
export class AsmMainUiComponent implements OnInit, OnDestroy {
customerSupportAgentLoggedIn$: Observable<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
import { GlobalMessageType } from '@spartacus/core';

@Pipe({
name: 'cxTranslate',
name: 'cxTranslate',
standalone: false
})
class MockTranslatePipe implements PipeTransform {
transform(): any {}
Expand All @@ -45,8 +46,9 @@ class MockLaunchDialogService implements Partial<LaunchDialogService> {
}

@Component({
selector: 'cx-message',
template: '',
selector: 'cx-message',
template: '',
standalone: false
})
class MockCxMessageComponent {
@Input() text: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export enum SAVE_CART_DIALOG_ACTION {
}

@Component({
selector: 'cx-asm-save-cart-dialog',
templateUrl: './asm-save-cart-dialog.component.html',
selector: 'cx-asm-save-cart-dialog',
templateUrl: './asm-save-cart-dialog.component.html',
standalone: false
})
export class AsmSaveCartDialogComponent implements OnInit {
BIND_CART_ACTION = SAVE_CART_DIALOG_ACTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class MockRoutingService implements Partial<RoutingService> {
}

@Pipe({
name: 'formatTimer',
name: 'formatTimer',
standalone: false
})
class MockFormatTimerPipe implements PipeTransform {
transform() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { distinctUntilChanged } from 'rxjs/operators';
import { AsmComponentService } from '../services/asm-component.service';

@Component({
selector: 'cx-asm-session-timer',
templateUrl: './asm-session-timer.component.html',
selector: 'cx-asm-session-timer',
templateUrl: './asm-session-timer.component.html',
standalone: false
})
export class AsmSessionTimerComponent implements OnInit, OnDestroy {
protected subscriptions = new Subscription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
name: 'formatTimer',
name: 'formatTimer',
standalone: false
})
export class FormatTimerPipe implements PipeTransform {
transform(totalSeconds: number): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
} from './asm-switch-customer-dialog.component';

@Pipe({
name: 'cxTranslate',
name: 'cxTranslate',
standalone: false
})
class MockTranslatePipe implements PipeTransform {
transform(): any {}
Expand All @@ -44,8 +45,9 @@ class MockAsmComponentService extends AsmComponentService {
}

@Component({
selector: 'cx-icon',
template: '',
selector: 'cx-icon',
template: '',
standalone: false
})
class MockCxIconComponent {
@Input() type: ICON_TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export interface SwitchCustomerData {
}

@Component({
selector: 'cx-asm-switch-customer-dialog',
templateUrl: './asm-switch-customer-dialog.component.html',
selector: 'cx-asm-switch-customer-dialog',
templateUrl: './asm-switch-customer-dialog.component.html',
standalone: false
})
export class AsmSwitchCustomerDialogComponent implements OnInit {
SWITCH_CUSTOMER_DIALOG_ACTION = SWITCH_CUSTOMER_DIALOG_ACTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import { AsmUi } from '@spartacus/asm/root';
import { Subscription } from 'rxjs';

@Component({
selector: 'cx-asm-toggle-ui',
templateUrl: './asm-toggle-ui.component.html',
selector: 'cx-asm-toggle-ui',
templateUrl: './asm-toggle-ui.component.html',
standalone: false
})
export class AsmToggleUiComponent implements OnInit, OnDestroy {
protected subscription = new Subscription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import {
import { useFeatureStyles } from '@spartacus/core';

@Component({
selector: 'cx-csagent-login-form',
templateUrl: './csagent-login-form.component.html',
selector: 'cx-csagent-login-form',
templateUrl: './csagent-login-form.component.html',
standalone: false
})
export class CSAgentLoginFormComponent implements OnInit {
csAgentLoginForm: UntypedFormGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ describe('CustomerEmulationComponent', () => {
@Component({
selector: 'cx-asm-bind-cart',
template: '',
})
standalone: false
})
class MockAsmBindCartComponent {}

const dialogClose$ = new BehaviorSubject<any>('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import { filter } from 'rxjs/operators';
import { AsmComponentService } from '../services/asm-component.service';

@Component({
selector: 'cx-customer-emulation',
templateUrl: './customer-emulation.component.html',
selector: 'cx-customer-emulation',
templateUrl: './customer-emulation.component.html',
standalone: false
})
export class CustomerEmulationComponent implements OnInit, OnDestroy {
customer: User;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ class MockLaunchDialogService implements Partial<LaunchDialogService> {
}

@Component({
selector: 'cx-icon',
template: '',
selector: 'cx-icon',
template: '',
standalone: false
})
class MockCxIconComponent {
@Input() type: ICON_TYPE;
Expand Down Expand Up @@ -201,7 +202,8 @@ class MockAsmCustomerListFacade implements Partial<AsmCustomerListFacade> {
}

@Directive({
selector: '[cxFocus]',
selector: '[cxFocus]',
standalone: false
})
export class MockKeyboadFocusDirective {
@Input('cxFocus') config: FocusConfig = {};
Expand Down
Loading

0 comments on commit 158766c

Please sign in to comment.