@dsivd/prestations-ng 19.0.0-beta-9 → 19.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/UPGRADING_V19.md CHANGED
@@ -81,7 +81,7 @@ Replace `com.fasterxml.jackson.databind.ObjectMapper` with `tools.jackson.databi
81
81
 
82
82
  ### BO : Brave Tracer
83
83
 
84
- If you are using Brave Tracer (search `brace.Tracer` in the code, usually in backoffices), you need to replace it with
84
+ If you are using Brave Tracer (search `brave.Tracer` in the code, usually in backoffices), you need to replace it with
85
85
  OpenTelemetry by adding the following dependencies (already included by `ch.vd.cyber:starter-bo-jdbc-jms` and `ch.vd.cyber:starter-prestation`):
86
86
 
87
87
  ```xml
@@ -102,7 +102,8 @@ And replace `brave.Tracer` imports by `io.micrometer.tracing.Tracer`;
102
102
 
103
103
  This base class has been moved from `ch.vd.cyber.sdk:cyberadmin-be` to `ch.vd.cyber.sdk:backoffice-be`
104
104
  and renamed `EsbMessageListenerWithTracingPropagation`.
105
- the constructor has also been updated :
105
+
106
+ The constructor has also been updated :
106
107
 
107
108
  ```java
108
109
  import ch.vd.cyberadminbe.jms.EsbMessageListenerWithSleuthIntegration;
@@ -132,7 +133,7 @@ public class MyListener extends EsbMessageListenerWithTracingPropagation {
132
133
  }
133
134
  ```
134
135
 
135
- finally, if you have mock issues with you integration tests, you can use `ch.vd.cyber.backofficebe.jms.JmsTestUtils.mockTracingPropagation(final Tracer tracerMock, final Propagator propagatorMock)`
136
+ finally, if you have mock issues with your integration tests, you can use `ch.vd.cyber.backofficebe.jms.JmsTestUtils.mockTracingPropagation(final Tracer tracerMock, final Propagator propagatorMock)`
136
137
 
137
138
  ### BO : ESB Integration
138
139
 
@@ -155,7 +156,7 @@ Look for logs that indicate property you should migrate (watch for WARN logs of
155
156
 
156
157
  ### BO using jpa repositories
157
158
 
158
- As we also have jdbc in the classpath, to avoid having dozens of log like "Spring Data JDBC - Could not safely
159
+ As we also have jdbc in the classpath, to avoid having dozens of log like "Spring Data JDBC - Could not safely
159
160
  identify store assignment for repository candidate interface", add the property in your application.properties :
160
161
 
161
162
  spring.data.jdbc.repositories.enabled=false
@@ -182,7 +183,7 @@ Take a look at Sonar to see other things that you can improve or ignore.
182
183
 
183
184
  ## PRESTATIONS-NG
184
185
 
185
- For the commands in this guide, it is supposed that your are in the `front` folder of your project.
186
+ For the commands in this guide, it is supposed that you are in the `front` folder of your project.
186
187
 
187
188
  The main feature in `prestations-ng` v19 is the update of the `@angular/*` peer dependencies
188
189
  to `^21.2.14`, using `node 22+` to build, `npm 10+` for package manager and `Foehn 2+ (Bootstrap 5+)` for our design system.
@@ -207,8 +208,6 @@ Remove your `resolutions` in `package.json` before starting : if you have `resol
207
208
 
208
209
  In the next commands, commit before each ng update.
209
210
 
210
- Unlink `@dsivd/prestations-ng` by running `yarn unlink @dsivd/prestations-ng` in your `front` folder if you have linked it before.
211
-
212
211
  ```bash
213
212
  npm install
214
213
  npm install @angular/cli@19 -g
@@ -216,33 +215,6 @@ ng update @angular/core@19 @angular/cli@19
216
215
  ng update @dsivd/prestations-ng@18
217
216
  ```
218
217
 
219
- ```bash
220
- npm install @angular/cli@20 -g
221
- ng update @angular/core@20 @angular/cli@20
222
- ```
223
-
224
- When asked the question "Select the migrations that you'd like to run",
225
-
226
- accept **"use-application-builder"** by hitting "Space" key then "Enter".
227
-
228
- When asked the question "Select the migrations that you'd like to run",
229
-
230
- accept **"control-flow-migration"** by hitting "Space" key.
231
-
232
- accept **"router-current-navigation"** by hitting "Space" key.
233
-
234
- Then press "Enter" key.
235
-
236
- **IMPORTANT: Search for every `@for` in your project and check that `track` statement is present and has a unique identifier**
237
-
238
- **NB: When using `@angular/cdk` in your project**
239
-
240
- ```bash
241
- ng update @angular/cdk@20
242
- ```
243
-
244
- ### Running with node 22+
245
-
246
218
  #### Switch to node 22+
247
219
 
248
220
  ##### If you are using our `slave-apps`
@@ -269,6 +241,33 @@ Be sure to use a node version 22+ in your terminal:
269
241
  node -v
270
242
  ```
271
243
 
244
+ #### Continue with Angular 20 migration
245
+
246
+ ```bash
247
+ npm install @angular/cli@20 -g
248
+ ng update @angular/core@20 @angular/cli@20
249
+ ```
250
+
251
+ - When asked "Select the migrations that you'd like to run",
252
+ - accept **"use-application-builder"** by hitting "Space" key
253
+ - hit "Enter" key
254
+ - When asked "Select the migrations that you'd like to run",
255
+ - accept **"control-flow-migration"** by hitting "Space" key
256
+ - hit "Down arrow" key
257
+ - accept **"router-current-navigation"** by hitting "Space" key
258
+ - hit "Enter" key
259
+
260
+ **IMPORTANT: Search for every `@for` in your project and check that `track` statement is present and has a unique identifier.
261
+ When a unique identifier is not possible, use `track $index`.**
262
+
263
+ **NB: When using `@angular/cdk` in your project**
264
+
265
+ ```bash
266
+ ng update @angular/cdk@20
267
+ ```
268
+
269
+ ### Running with node 22+
270
+
272
271
  #### In your project
273
272
 
274
273
  Update your `package.json` file to specify the node engine:
@@ -307,17 +306,17 @@ npm install @angular/cli@21 -g
307
306
  ng update @dsivd/prestations-ng@latest
308
307
  ```
309
308
 
310
- When asked again the question "Select the migrations that you'd like to run",
311
-
312
- accept **"router-current-navigation"** by hitting "Space" key then "Enter".
309
+ - When asked again "Select the migrations that you'd like to run"
310
+ - accept **"router-current-navigation"** by hitting "Space" key
311
+ - hit "Enter" key
313
312
 
314
313
  ```bash
315
314
  ng update @angular/cli@21
316
315
  ```
317
316
 
318
- When asked the question "Select the migrations that you'd like to run",
319
-
320
- accept **"use-application-builder"** by hitting "Space" key then "Enter".
317
+ - When asked "Select the migrations that you'd like to run"
318
+ - accept **"use-application-builder"** by hitting "Space" key
319
+ - hit "Enter" key
321
320
 
322
321
  ```bash
323
322
  npm install @types/node@22 ts-node@10
@@ -348,18 +347,15 @@ ng update ngx-matomo-client@9
348
347
  ```
349
348
 
350
349
  - In your `.eslintrc.json`, remove `"/src/main.ts",` from `ignorePatterns`.
351
-
352
350
  - In `main.ts`, replace `platformBrowserDynamic` by `platformBrowser`.
353
-
354
351
  - When using `<foehn-list-summary` component, replace `list` by `model`.
355
352
 
356
353
  ### Now fix your project before continuing
357
354
 
358
355
  **IMPORTANT: Fix your project because our new prestations-ng v19+ is standalone, uses signals instead of observables and inject function instead of constructor injection parameter.**
359
356
 
360
- Remove all your `@dsivd/prestations-ng` imports of modules and make sure you are using the new standalone components instead by adding them directly from your html file "alt+enter".
361
-
362
- Check every `constructor` in your project, and remove useless `constructor` parameters that are not used anymore (like `ActivatedRoute` in components extending `AbstractPageComponent`).
357
+ - Remove all your `@dsivd/prestations-ng` imports of modules and make sure you are using the new standalone components instead by adding them directly from your html file "alt+enter".
358
+ - Check every `constructor` in your project, and remove useless `constructor` parameters that are not used anymore (like `ActivatedRoute` in components extending `AbstractPageComponent`).
363
359
 
364
360
  Run the following command until you have no more errors.
365
361
 
@@ -385,11 +381,13 @@ ng generate @angular/core:inject
385
381
  ✔ Do you want optional inject calls to be non-nullable? Enable this option if you want the return type to be identical to @Optional(), at the expense of worse
386
382
  type safety. **Yes**
387
383
 
388
- Go through every file that has changed and fix what is broken.
384
+ Then:
385
+
386
+ - Go through every file that has changed and fix what is broken.
387
+ - Reorder public / private and remove unused imports so ESLINT is happy again.
389
388
 
390
- Reorder public / private and remove unused imports so ESLINT is happy again.
389
+ Little example of cleaning when extending `AbstractPageComponent`:
391
390
 
392
- For example, when extending `AbstractPageComponent`:
393
391
  Before:
394
392
 
395
393
  ```ts
@@ -548,7 +546,7 @@ You may have some other modules that are maybe lazy-loaded. Just be sure that al
548
546
  ng generate @angular/core:route-lazy-loading
549
547
  ```
550
548
 
551
- Here is a example when doing it manually because schematic above does not work as intended:
549
+ Here is an example when doing it manually because schematic above does not work as intended:
552
550
 
553
551
  Your `app.routing.ts` file should look something like this:
554
552
 
@@ -615,9 +613,8 @@ ng generate @angular/core:ngclass-to-class
615
613
 
616
614
  ✔ Should the migration also migrate space-separated keys? **Yes**
617
615
 
618
- Check every file that has changed and fix what is broken.
619
-
620
- Check remaining `ngClass` usage in your project and replace it with class bindings.
616
+ - Check every file that has changed and fix what is broken.
617
+ - Check remaining `ngClass` usage in your project and replace it with class bindings.
621
618
 
622
619
  **Be aware that `[class]` replaces all element classes. When you have static classes, concatenate them with dynamic ones.**
623
620
 
@@ -683,9 +680,8 @@ ng generate @angular/core:ngstyle-to-style
683
680
 
684
681
  ✔ Should the migration also migrate object references? **No**
685
682
 
686
- Check every file that has changed and fix what is broken.
687
-
688
- Check remaining `ngStyle` usage in your project and replace it with style bindings.
683
+ - Check every file that has changed and fix what is broken.
684
+ - Check remaining `ngStyle` usage in your project and replace it with style bindings.
689
685
 
690
686
  ### Convert CommonModule usage to standalone imports
691
687
 
@@ -703,7 +699,7 @@ ng generate @angular/core:common-to-standalone
703
699
 
704
700
  ✔ Which directory do you want to migrate? **./**
705
701
 
706
- Check every file that has changed and fix what is broken.
702
+ - Check every file that has changed and fix what is broken.
707
703
 
708
704
  ### Migrate @HostListener
709
705
 
@@ -762,11 +758,9 @@ ng generate @angular/core:signal-queries-migration --insert-todos
762
758
 
763
759
  ✔ Do you want to migrate as much as possible, even if it may break your build? **No**
764
760
 
765
- Check every file that has changed and fix what is broken.
766
-
767
- Check every remaining `@ViewChild`, `@ViewChildren`, `@ContentChild`, and `@ContentChildren` usage in your project and replace them with signal queries.
768
-
769
- Check every **TODO** comment added by the migration and fix them.
761
+ - Check every file that has changed and fix what is broken.
762
+ - Check every remaining `@ViewChild`, `@ViewChildren`, `@ContentChild`, and `@ContentChildren` usage in your project and replace them with signal queries.
763
+ - Check every **TODO** comment added by the migration and fix them.
770
764
 
771
765
  ### Migrate to output functions
772
766
 
@@ -808,11 +802,9 @@ ng generate @angular/core:signal-input-migration --insert-todos
808
802
 
809
803
  ✔ Do you want to migrate as much as possible, even if it may break your build? **No**
810
804
 
811
- Check every file that has changed and fix what is broken.
812
-
813
- Check every remaining `@Input` usage in your project and replace them with input signals.
814
-
815
- Check every **TODO** comment added by the migration and fix them.
805
+ - Check every file that has changed and fix what is broken.
806
+ - Check every remaining `@Input` usage in your project and replace them with input signals.
807
+ - Check every **TODO** comment added by the migration and fix them.
816
808
 
817
809
  ### Migrate to vitest
818
810
 
@@ -884,8 +876,8 @@ npm uninstall @types/jasmine @types/jasminewd2
884
876
  rm karma.conf.js
885
877
  ```
886
878
 
887
- Now search for `karma.conf.js` in your project and remove all references to it.
888
- Now search for `protractor.conf.js` in your project and remove them if they still exist.
879
+ - search for `karma.conf.js` in your project and remove all references to it.
880
+ - search for `protractor.conf.js` in your project and remove them if they still exist.
889
881
 
890
882
  Then run following command to migrate from jasmine to vitest:
891
883
 
@@ -1031,9 +1023,8 @@ Remove your old `.eslintrc.json` file in your `front` folder:
1031
1023
  rm .eslintrc.json
1032
1024
  ```
1033
1025
 
1034
- Now search for `.eslintrc.json` in your project and remove them.
1035
-
1036
- Then add a new `eslint.config.mjs` file with the following content:
1026
+ - search for `.eslintrc.json` in your project and remove them.
1027
+ - add a new `eslint.config.mjs` file with the following content:
1037
1028
 
1038
1029
  ```ts
1039
1030
  // @ts-check
@@ -1201,9 +1192,9 @@ export default tseslint.config(
1201
1192
  );
1202
1193
  ```
1203
1194
 
1204
- #### Delete `typing.d.ts`
1195
+ #### Delete `typings.d.ts`
1205
1196
 
1206
- In `front/src/`, remove the file `typing.d.ts` if it is still there.
1197
+ In `front/src/`, remove the file `typings.d.ts` if it is still there.
1207
1198
 
1208
1199
  #### Update your tsconfig\*.json files
1209
1200
 
@@ -1287,14 +1278,14 @@ mv ./.husky ../.husky
1287
1278
  git add -A
1288
1279
  ```
1289
1280
 
1290
- - You can manually run formating commands as well:
1281
+ - You can manually run formatting commands as well:
1291
1282
 
1292
1283
  ```bash
1293
1284
  npm run format:prettier
1294
1285
  npm run lint
1295
1286
  ```
1296
1287
 
1297
- Fix your `meta.service.ts` but replacing:
1288
+ Fix your `meta.service.ts` by replacing:
1298
1289
 
1299
1290
  Before:
1300
1291
 
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "ng-update": {
41
41
  "migrations": "./schematics/migration-collection.json"
42
42
  },
43
- "version": "19.0.0-beta-9",
43
+ "version": "19.0.0-beta.10",
44
44
  "module": "fesm2022/dsivd-prestations-ng.mjs",
45
45
  "typings": "types/dsivd-prestations-ng.d.ts",
46
46
  "exports": {