-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nx migration: - "@angular-eslint/eslint-plugin" bumped to 18.4.2, - "@angular-eslint/eslint-plugin-template" bumped to 18.4.2, - "@angular-eslint/template-parser" bumped to 18.4.2, - "@nx/angular" bumped to 20.1.3 - "@nx/devkit" bumped to 20.1.3 - "@nx/eslint-plugin" bumped to 20.1.3 - "@nx/jest" bumped to 20.1.3 - "@nx/workspace" bumped to 20.1.3 - "@types/jest" bumped to 29.5.14 - "jest" bumped to 29.7.0 - "jest-preset-angular" bumped to 14.1.1 - "nx" bumped to 20.1.3, - "useInferencePlugins": false added to nx.json for more, see: https://nx.dev/concepts/inferred-tasks#existing-nx-workspaces - "useLegacyCache": true added to nx.json for more, see: https://nx.dev/nx-api/devkit/documents/Workspace#uselegacycach - /.nx/workspace-data added to .gitignore and .prettierignore Angular migration: - "@angular/.." libraries bumped from 17.0.5 to 18.2.9 - "@angular-devkit/.." libraries bumped from 17.0.5 to 18.2.9 - "@angular-eslint/.." libraries bumped from 17.1.0 to 18.4.2 - "@typescript-eslint/" libraries bumped from 6.13.1 to 7.2.0 - "@schematics/angular" bumped from 17.0.5 to 18.2.9 - "@ng-select/ng-select" bumped from 12.0.4 to 13.9.0 - "ngx-infinite-scroll" bumped from 17.0.0 to 18.0.0 - "zone.js" bumped from 0.14.2 to 0.14.10 - "@angular-builders/custom-webpack" bumped from 15.0.0 to 18.0.0 - "ng-packagr" bumped from 17.0.2 to 18.2.1 - replaced deprecated HTTP related modules with provider functions - fixed issues after replacement in some tests (redundant code) (?) - adjusted 'form-errors.component.ts' to new 'AbstractControl' shape - set 'MessageService' as optional in form.component.ts and remove it from FormModule providers' array - replaced boolean | UrlTree return type with GuardResult for canActivate guard functions and related code with NgRx: - "@ngrx/effects" bumped from 17.0.1 to 18.1.0 - "@ngrx/router-store" bumped from 17.0.1 to 18.1.0 - "@ngrx/store" bumped from 17.0.1 to 18.1.0 - "@ngrx/store-devtools" bumped from 17.0.1 to 18.1.0 - "@ngrx/operators" introduced - TypedAction removed in favour of Action Build issues: - replaced Observable<boolean | UrlTree> with combined Observable<GuardResult> from @angular/router for more, see: feat(router): Add ability to return UrlTree with NavigationBehaviorOptions from guards angular/angular#45023 - add node to "types" in all tsconfig.schematics.json to support node API - remove redundant dist and assets property from nested ng-package.json in CDP, OPF and OMF for more, see: https://github.com/ng-packagr/ng-packagr/pull/2754/files - Unit tests: - add support for RedirectCommand type in guard tests - adjust order-return-requrest-list.component.spec.ts to look for input[aria-controls="order-return-table"] instead of div[aria-controls="order-return-table"] due to changes in ng-select for more, see: fix(wcag): adds role 'combobox' to input ng-select/ng-select#2428 - remove recommended property from eslint rules - add fix-jsdom-environment.ts containing fix for missing support of structuredClone in jest-environment-jsdom for more, see: [Bug]: structuredClone is not defined jsdom/jsdom#3363 (comment) - convertAnnotatedSourceToFailureCase is now imported from @angular-eslint/test-utils(new dependency) instead from @angular-eslint/utils - include TS files in tsconfig.spec.json - replace/remove redundant RouterTestingModule - update snapshots in schematics tests Linting: - added new @stylistic/eslint-plugin-ts due to moving some there som config from @typescript-eslint/eslint-plugin: - quotes - member-delimiter-style - semi - type-annotation-spacing` for more, see e.g.: https://typescript-eslint.io/rules/member-delimiter-style/ - removed redundant rules from legacy-ng-cli-compat files Schematics: - fixed type in file-utils_spec.ts - update dependencies.json - adjusted schema.json to work with new Angular for more, see: fix(@angular/cli): support default options for multiselect list x-prompt angular/angular-cli#28842 - Linter for styles: - fixed issues caught after bumping minor version of "stylelint" packages (when upgrading package-lock.json) - added "integration-libs" to the linter scope
- Loading branch information
Showing
547 changed files
with
15,186 additions
and
27,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,5 @@ Thumbs.db | |
**/git-ignore | ||
|
||
.nx/cache | ||
.nx/workspace-data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# (EARLY NOTES) Migrating a custom app to use Spartacus with Angular v18 | ||
|
||
Before upgrading Spartacus to the new version with Angular 18, you need to first: | ||
- upgrade to the latest 2211.x of Spartacus | ||
- upgrade Angular to version v18 | ||
|
||
## Update Angular to 17 and 18 | ||
|
||
### Update Angular to 17 and 3rd party deps to be compatible with Angular 18 | ||
|
||
Follow the [Angular guidelines for upgrading from v17 to v18](https://angular.dev/update-guide?v=17.0-18.0&l=3) and bump the Angular version locally, and update other 3rd party dependencies from Angular ecosystem to versions compatible with Angular 18 (e.g. `@ng-select/ng-select@13`, `@ngrx/store@18`, `ngx-infinite-scroll@18`): | ||
|
||
```bash | ||
ng update @angular/core@18 @angular/cli@18 @ng-select/ng-select@13 @ngrx/store@18 ngx-infinite-scroll@18 --force | ||
git add . | ||
git commit -m "update angular 18 and 3rd party deps angular 18 compatible" | ||
``` | ||
Note: Do not select `use-application-builder` migration when migrating to Angular 18. Applications created before SPA 2211.19 doesn't support this builder. Applications created starting from 2211.19 already supports it. | ||
|
||
### Run Spartacus update | ||
|
||
After successfully updating the application to Angular 18, execute this command to initiate the Spartacus update process. | ||
|
||
```bash | ||
ng update @spartacus/schematics@latest | ||
``` | ||
|
||
### Adjust Angular configuration | ||
|
||
Due to changes in Angular's application builder, for applications created starting from SPA 2211.19, you need to adjust the `angular.json` file to generate the `index.html` file in the `dist` folder. This is required for CCv2 to map `OCC_BACKEND_BASE_URL_VALUE` and `MEDIA_BACKEND_BASE_URL_VALUE` meta tags to the correct values. Unfortunately, this will contribute to pre-rendering to not work properly (which is a known issue) | ||
|
||
```diff | ||
- "index": "src/index.html" | ||
+ "index": { | ||
+ "input": "src/index.html", | ||
+ "output": "index.html" | ||
+ } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
feature-libs/asm/customer-360/styles/components/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.