From d06b3ebb567940aad73dfb108f7b3d4cd7229168 Mon Sep 17 00:00:00 2001 From: Krzysztof Platis Date: Mon, 10 Feb 2025 21:01:36 +0100 Subject: [PATCH] doc: update modernization docs - tell how to run automated migration (#19977) Co-authored-by: Matthew <43279967+gladius-mtl@users.noreply.github.com> --- ...e-apps-migrated-from-2211.32-to-2211.35.md | 16 +++++++++ ...rnize-apps-migrated-from-6.8-to-2211.19.md | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/docs/migration/2211_35/modernize-apps-migrated-from-2211.32-to-2211.35.md b/docs/migration/2211_35/modernize-apps-migrated-from-2211.32-to-2211.35.md index 91f7f8c4553..f49c15cfa66 100644 --- a/docs/migration/2211_35/modernize-apps-migrated-from-2211.32-to-2211.35.md +++ b/docs/migration/2211_35/modernize-apps-migrated-from-2211.32-to-2211.35.md @@ -2,6 +2,22 @@ New Angular 19 apps are configured a bit differently than the Angular 17 apps migrated to v19. This document is a migration guide for modernizing the migrated apps to look as much as possible like the new Angular 19 apps. +# Automatic migration + +The Spartacus team provides special schematics that automatically modernize the app to look as much as possible like the new Angular 19 apps. + +Please run the following command from your project root directory: + +```bash +ng g @spartacus/schematics:modernize-app-migrated-from-2211_32-to-2211_35 +``` + +In case of any issues during the automatic migration, you can always fall back to the manual migration steps below. + +# Manual migration + +Here are the migration steps in detail: + ### `angular.json` 1. In the section `architect > build > options > assets`, please replace 2 string values in the array: `"src/favicon.ico"` and `"src/assets"` with a single object `{ "glob": "**/*", "input": "public" }` diff --git a/docs/migration/2211_35/modernize-apps-migrated-from-6.8-to-2211.19.md b/docs/migration/2211_35/modernize-apps-migrated-from-6.8-to-2211.19.md index e9aa41e1726..aa5a6b6da49 100644 --- a/docs/migration/2211_35/modernize-apps-migrated-from-6.8-to-2211.19.md +++ b/docs/migration/2211_35/modernize-apps-migrated-from-6.8-to-2211.19.md @@ -11,6 +11,40 @@ The benefits of using the new Angular configuration format are: The side-effect consequences of using the new configuration format are: - For SSR apps: the server-side rendering and prerendering scripts will be executed differently (it will be explained in the last section of this page "[New commands for SSR projects](#new-commands-for-ssr-projects)") + +# Automatic migration + +The Spartacus team provides special schematics that automatically modernize the app to look as much as possible like the new Angular 17 apps. + +Note: the tool was released only in `@spartacus/schematics` v2211.35.0, but you need to run it before fully upgrading your app to this version. +To do this, you'll need to install `@spartacus/schematics@2211.35.0` in a temporary directory and execute the migration schematic from there. + +Please run those commands from your project root directory: + +```bash +# 1. Create a temporary sibling directory for the isolated Schematics v2211.35 installation +node -e "require('fs').mkdirSync('../temp-schematics-35')" + +# 2. Install schematics in the temporary directory +npm install @spartacus/schematics@2211.35.0 --prefix ../temp-schematics-35 + +# 3. Execute in your project the schematics from the temporary directory +ng g ../temp-schematics-35/node_modules/@spartacus/schematics:modernize-app-migrated-from-6_8-to-2211_19 + +# 4. Clean up the temporary directory +node -e "require('fs').rmSync('../temp-schematics-35', { recursive: true, force: true })" +``` + +In case of any issues during the automatic migration, you can always fall back to the manual migration steps below. + +> ⚠️ Warning: +> +> Reminder for SSR apps: from now on the server-side rendering and prerendering scripts will be executed differently (see the last section of this page "[New commands for SSR projects](#new-commands-for-ssr-projects)") + +In case of any issues during the automatic migration, you can always fall back to the manual migration steps below. + +# Manual migration + Here are the migration steps in detail: ## Migration to the new Angular `application` builder