@silvestv/migration-planificator 7.1.0 → 7.1.2
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/dist/client.bundle.js +200 -182
- package/dist/src/autofix/cli/fix-command.js +6 -4
- package/dist/src/autofix/generators/context-generator.js +71 -2
- package/dist/src/autofix/generators/file-prompt-generator.js +22 -3
- package/dist/src/autofix/prompts/constitution.js +23 -0
- package/dist/src/autofix/prompts/file-prompt-complex.js +129 -0
- package/dist/src/autofix/prompts/file-prompt-diagnostics.js +2 -98
- package/dist/src/autofix/prompts/file-prompt-phases.js +106 -44
- package/dist/src/autofix/prompts/file-prompt-reference.js +7 -25
- package/dist/src/autofix/prompts/file-prompt-routine.js +160 -0
- package/dist/src/autofix/prompts/file-prompt-shared.js +82 -0
- package/dist/src/data/rules/to18/rules-18-obligatoire.json +382 -368
- package/dist/src/data/rules/to18/rules-18-optionnelle.json +135 -131
- package/dist/src/data/rules/to18/rules-18-recommande.json +113 -110
- package/dist/src/data/rules/to19/rules-19-obligatoire.json +204 -15
- package/dist/src/data/rules/to19/rules-19-optionnelle.json +12 -6
- package/dist/src/data/rules/to19/rules-19-recommande.json +11 -5
- package/dist/src/data/rules/to20/rules-20-obligatoire.json +15 -3
- package/dist/src/data/rules/to20/rules-20-optionnelle.json +2 -2
- package/dist/src/data/rules/to20/rules-20-recommande.json +2 -0
- package/dist/src/data/rules/to21/rules-21-obligatoire.json +12 -2
- package/dist/src/data/rules/to21/rules-21-optionnelle.json +2 -1
- package/dist/src/data/rules/to21/rules-21-recommande.json +4 -0
- package/dist/src/models/constants/fix-ai-cli-permissions.js +35 -6
- package/dist/src/models/constants/nx-angular-compatibility.js +50 -0
- package/dist/src/models/interfaces/ai-specification.interface.js +18 -0
- package/dist/src/models/types/routine-type.type.js +2 -0
- package/dist/src/templates/workload/rule-modal.template.js +74 -0
- package/dist/src/utils/autofix/bash-commands-helpers.js +14 -0
- package/dist/src/utils/autofix/compatibility-helpers.js +35 -0
- package/dist/src/utils/core/rule-helpers.js +3 -2
- package/dist/src/utils/shared/rule-helpers.js +32 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,369 +1,383 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"key": "angular_18_environment",
|
|
4
|
-
"summary": "Mise à jour environnement Angular 18 (Node 18.19.1+, TypeScript 5.4+)",
|
|
5
|
-
"description": "Angular 18 requiert Node.js 18.19.1 ou supérieur et TypeScript 5.4+. Ces versions apportent le support des signaux et des améliorations de compilation. Les versions antérieures provoquent des erreurs de build.",
|
|
6
|
-
"estimated_time_per_occurrence": 60,
|
|
7
|
-
"onFile": "package.json",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"
|
|
156
|
-
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
"
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
"
|
|
267
|
-
"
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
|
|
281
|
-
],
|
|
282
|
-
"
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
"
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
"
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
"
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
"
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
"
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
"
|
|
351
|
-
"
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
],
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"key": "angular_18_environment",
|
|
4
|
+
"summary": "Mise à jour environnement Angular 18 (Node 18.19.1+, TypeScript 5.4+)",
|
|
5
|
+
"description": "Angular 18 requiert Node.js 18.19.1 ou supérieur et TypeScript 5.4+. Ces versions apportent le support des signaux et des améliorations de compilation. Les versions antérieures provoquent des erreurs de build.",
|
|
6
|
+
"estimated_time_per_occurrence": 60,
|
|
7
|
+
"onFile": "package.json",
|
|
8
|
+
"routineType": "environment-migration",
|
|
9
|
+
"fileTypes": ["package.json"],
|
|
10
|
+
"regex": "\"@angular/(core|cli)\"\\s*:\\s*\"(?:(?:\\^|~)?1[0-7](?:\\.\\d+){0,2})\"",
|
|
11
|
+
"category": "environment",
|
|
12
|
+
"isAutoFixable": true,
|
|
13
|
+
"minAngularVersion": 17,
|
|
14
|
+
"migration_command": "npx ng update @angular/core@18 @angular/cli@18",
|
|
15
|
+
"nxMigrationCommand": "npx nx migrate nx@19.8.14 && rm -rf node_modules package-lock.json && npm install && npm install typescript@~5.4.5 && npx nx migrate --run-migrations",
|
|
16
|
+
"risk_level": "high",
|
|
17
|
+
"code_description": "// Migration Angular 17 → 18 (Nx)\n// 1. npx nx migrate nx@19.8.14\n// 2. Mettre à jour deps tierces Angular dans package.json vers @18 + !!! Bonne version de typescript si non spécifié !!!\n// 3. rm -rf node_modules package-lock.json && npm install && npm install typescript@~5.4.5\n// 4. npx nx migrate --run-migrations",
|
|
18
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"key": "node_version_18",
|
|
22
|
+
"summary": "Mise à jour Node.js vers 18.19.1+",
|
|
23
|
+
"description": "Angular 18 nécessite Node.js version 18.19.1 ou supérieure pour supporter les nouvelles fonctionnalités TypeScript 5.4 et les optimisations du compilateur. Cette mise à jour est critique car les versions antérieures peuvent causer des erreurs de build.",
|
|
24
|
+
"estimated_time_per_occurrence": 15,
|
|
25
|
+
"onFile": "package.json",
|
|
26
|
+
"fileTypes": [
|
|
27
|
+
"package.json"
|
|
28
|
+
],
|
|
29
|
+
"regex": "\"engines\"\\s*:\\s*\\{[^}]*\"node\"\\s*:\\s*\"(?:(?:[<>=~^]*)(1[0-7]|18\\.(?:[0-9]|1[0-8])(?:\\.[0-9]+)?))\"",
|
|
30
|
+
"category": "environment",
|
|
31
|
+
"isAutoFixable": false,
|
|
32
|
+
"migration_command": null,
|
|
33
|
+
"risk_level": "high",
|
|
34
|
+
"code_description": "// Vérifier et mettre à jour Node.js\n// Avant: Node v16.x\n// Après: Node v18.19.1+\n// Commande: node --version",
|
|
35
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"key": "typescript_5_4",
|
|
39
|
+
"summary": "Mise à jour TypeScript vers 5.4+",
|
|
40
|
+
"description": "(Automatiquement fais avec AI) TypeScript 5.4 apporte des améliorations de performance et de nouveaux contrôles de type requis par Angular 18. La migration est automatisable via npm et nécessite une vérification de compatibilité des types existants.",
|
|
41
|
+
"estimated_time_per_occurrence": 10,
|
|
42
|
+
"onFile": "package.json",
|
|
43
|
+
"fileTypes": [
|
|
44
|
+
"package.json"
|
|
45
|
+
],
|
|
46
|
+
"regex": "^(?![\\s\\S]*\"typescript\"[\\s\\S]*\"[<>=~^]*(?:5\\.[4-9]|[6-9]\\d*)\\.)[\\s\\S]+",
|
|
47
|
+
"category": "environment",
|
|
48
|
+
"isAutoFixable": false,
|
|
49
|
+
"minAngularVersion": 18,
|
|
50
|
+
"migration_command": "npm install typescript@5.4",
|
|
51
|
+
"risk_level": "medium",
|
|
52
|
+
"code_description": "// package.json\n// Avant: \"typescript\": \"~4.9.0\"\n// Après: \"typescript\": \"~5.4.0\"",
|
|
53
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"key": "import_async_to_waitForAsync",
|
|
57
|
+
"summary": "Renommer import { async } en { waitForAsync }",
|
|
58
|
+
"description": "L'import 'async' de @angular/core est renommé en 'waitForAsync' pour éviter les conflits avec le mot-clé async/await natif de JavaScript. Tous les tests utilisant async() doivent être mis à jour.",
|
|
59
|
+
"estimated_time_per_occurrence": 2,
|
|
60
|
+
"onFile": null,
|
|
61
|
+
"fileTypes": [
|
|
62
|
+
"*.ts"
|
|
63
|
+
],
|
|
64
|
+
"regex": "import\\s*\\{[^}]*\\basync\\b[^}]*\\}\\s*from\\s*['\"]@angular/core['\"]",
|
|
65
|
+
"astPattern": {
|
|
66
|
+
"nodeType": "ImportDeclaration",
|
|
67
|
+
"moduleSpecifier": "@angular/core",
|
|
68
|
+
"namedImports": {
|
|
69
|
+
"contains": "async"
|
|
70
|
+
},
|
|
71
|
+
"excludeContext": [
|
|
72
|
+
"StringLiteral",
|
|
73
|
+
"Comment"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"category": "imports",
|
|
77
|
+
"isAutoFixable": true,
|
|
78
|
+
"minAngularVersion": 18,
|
|
79
|
+
"migration_command": null,
|
|
80
|
+
"risk_level": "low",
|
|
81
|
+
"code_description": "// Avant:\nimport { async } from '@angular/core';\n\n// Après:\nimport { waitForAsync } from '@angular/core';",
|
|
82
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"key": "import_statekey_transferstate_core",
|
|
86
|
+
"summary": "Déplacer StateKey/TransferState vers @angular/core",
|
|
87
|
+
"description": "StateKey et TransferState sont déplacés de @angular/platform-browser vers @angular/core pour une meilleure cohérence architecturale. Cela affecte principalement le code SSR et le transfert d'état.",
|
|
88
|
+
"estimated_time_per_occurrence": 2,
|
|
89
|
+
"onFile": null,
|
|
90
|
+
"fileTypes": [
|
|
91
|
+
"*.ts"
|
|
92
|
+
],
|
|
93
|
+
"regex": "import\\s*\\{[^}]*(StateKey|TransferState)[^}]*\\}\\s*from\\s*['\"]@angular/platform-browser['\"]",
|
|
94
|
+
"astPattern": {
|
|
95
|
+
"nodeType": "ImportDeclaration",
|
|
96
|
+
"moduleSpecifier": "@angular/platform-browser",
|
|
97
|
+
"namedImports": {
|
|
98
|
+
"containsAny": [
|
|
99
|
+
"StateKey",
|
|
100
|
+
"TransferState"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"excludeContext": [
|
|
104
|
+
"StringLiteral",
|
|
105
|
+
"Comment"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"category": "imports",
|
|
109
|
+
"isAutoFixable": true,
|
|
110
|
+
"minAngularVersion": 18,
|
|
111
|
+
"migration_command": null,
|
|
112
|
+
"risk_level": "low",
|
|
113
|
+
"code_description": "// Avant:\nimport { StateKey, TransferState } from '@angular/platform-browser';\n\n// Après:\nimport { StateKey, TransferState } from '@angular/core';",
|
|
114
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"key": "platformDynamicServer_to_platformServer",
|
|
118
|
+
"summary": "Remplacer platformDynamicServer par platformServer",
|
|
119
|
+
"description": "platformDynamicServer est obsolète et remplacé par platformServer qui nécessite un import explicite du compilateur Angular. Cette migration affecte la configuration SSR et nécessite l'ajout de @angular/compiler.",
|
|
120
|
+
"estimated_time_per_occurrence": 5,
|
|
121
|
+
"onFile": null,
|
|
122
|
+
"fileTypes": [
|
|
123
|
+
"*.ts"
|
|
124
|
+
],
|
|
125
|
+
"regex": "(?<![\"\\'])\\bplatformDynamicServer\\b(?![\"\\'])",
|
|
126
|
+
"astPattern": {
|
|
127
|
+
"nodeType": "Identifier",
|
|
128
|
+
"name": "platformDynamicServer",
|
|
129
|
+
"excludeContext": [
|
|
130
|
+
"Comment",
|
|
131
|
+
"StringLiteral",
|
|
132
|
+
"ImportSpecifier"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"category": "api",
|
|
136
|
+
"isAutoFixable": true,
|
|
137
|
+
"minAngularVersion": 17,
|
|
138
|
+
"migration_command": null,
|
|
139
|
+
"risk_level": "medium",
|
|
140
|
+
"code_description": "// Avant:\nimport { platformDynamicServer } from '@angular/platform-server';\n\n// Après:\nimport { platformServer } from '@angular/platform-server';\nimport '@angular/compiler';",
|
|
141
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"key": "remove_ServerTransferStateModule",
|
|
145
|
+
"summary": "Supprimer ServerTransferStateModule (obsolète)",
|
|
146
|
+
"description": "Supprime le module `ServerTransferStateModule`, supprimé en Angular 18. Il est désormais remplacé par le mécanisme `TransferState` intégré côté client.",
|
|
147
|
+
"estimated_time_per_occurrence": 3,
|
|
148
|
+
"onFile": null,
|
|
149
|
+
"fileTypes": [
|
|
150
|
+
"*.ts"
|
|
151
|
+
],
|
|
152
|
+
"regex": "\\bServerTransferStateModule\\b",
|
|
153
|
+
"astPattern": {
|
|
154
|
+
"nodeType": "Identifier",
|
|
155
|
+
"name": "ServerTransferStateModule",
|
|
156
|
+
"excludeContext": [
|
|
157
|
+
"Comment",
|
|
158
|
+
"StringLiteral",
|
|
159
|
+
"ImportSpecifier"
|
|
160
|
+
],
|
|
161
|
+
"context": [
|
|
162
|
+
"ArrayLiteralExpression",
|
|
163
|
+
"ImportDeclaration"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"category": "imports",
|
|
167
|
+
"isAutoFixable": true,
|
|
168
|
+
"minAngularVersion": 18,
|
|
169
|
+
"migration_command": null,
|
|
170
|
+
"risk_level": "low",
|
|
171
|
+
"code_description": "// Avant:\nimport { ServerTransferStateModule } from '@angular/platform-server';\n@NgModule({ imports: [ServerTransferStateModule] })\n\n// Après:\n// Supprimer complètement, plus nécessaire",
|
|
172
|
+
"doc_url": "https://angular.dev/update-guide"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"key": "remove_matchesElement",
|
|
176
|
+
"summary": "Supprimer animationDriver.matchesElement()",
|
|
177
|
+
"description": "La méthode matchesElement() de l'animation driver est supprimée sans remplacement direct. Il faut refactoriser le code pour utiliser des approches alternatives de sélection d'éléments comme querySelector ou des directives Angular.",
|
|
178
|
+
"estimated_time_per_occurrence": 10,
|
|
179
|
+
"onFile": null,
|
|
180
|
+
"fileTypes": [
|
|
181
|
+
"*.ts"
|
|
182
|
+
],
|
|
183
|
+
"regex": "\\.matchesElement\\s*\\(",
|
|
184
|
+
"astPattern": {
|
|
185
|
+
"nodeType": "CallExpression",
|
|
186
|
+
"expression": {
|
|
187
|
+
"nodeType": "PropertyAccessExpression",
|
|
188
|
+
"propertyName": "matchesElement"
|
|
189
|
+
},
|
|
190
|
+
"excludeContext": [
|
|
191
|
+
"StringLiteral",
|
|
192
|
+
"Comment"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"category": "api",
|
|
196
|
+
"isAutoFixable": true,
|
|
197
|
+
"minAngularVersion": 18,
|
|
198
|
+
"migration_command": null,
|
|
199
|
+
"risk_level": "medium",
|
|
200
|
+
"code_description": "// Avant:\nanimationDriver.matchesElement(element, selector);\n\n// Après:\n// Supprimer - utiliser une autre approche\n// (pas de remplacement direct)",
|
|
201
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"key": "remove_isPlatformWorkerUi",
|
|
205
|
+
"summary": "Supprimer isPlatformWorkerUi()",
|
|
206
|
+
"description": "La fonction isPlatformWorkerUi() n'est plus supportée car Web Workers UI ne sont plus maintenus dans Angular. Supprimer tout le code dépendant de cette détection de plateforme.",
|
|
207
|
+
"estimated_time_per_occurrence": 5,
|
|
208
|
+
"onFile": null,
|
|
209
|
+
"fileTypes": [
|
|
210
|
+
"*.ts"
|
|
211
|
+
],
|
|
212
|
+
"regex": "(?<![\"\\'])\\bisPlatformWorkerUi\\s*\\(",
|
|
213
|
+
"astPattern": {
|
|
214
|
+
"nodeType": "CallExpression",
|
|
215
|
+
"functionName": "isPlatformWorkerUi",
|
|
216
|
+
"excludeContext": [
|
|
217
|
+
"StringLiteral",
|
|
218
|
+
"Comment"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
"category": "api",
|
|
222
|
+
"isAutoFixable": true,
|
|
223
|
+
"minAngularVersion": 18,
|
|
224
|
+
"migration_command": null,
|
|
225
|
+
"risk_level": "low",
|
|
226
|
+
"code_description": "// Avant:\nif (isPlatformWorkerUi(platformId)) { }\n\n// Après:\n// Supprimer - plus supporté",
|
|
227
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"key": "remove_testability_methods",
|
|
231
|
+
"summary": "Supprimer méthodes Testability.increasePendingRequestCount()",
|
|
232
|
+
"description": "Les méthodes increasePendingRequestCount et decreasePendingRequestCount de Testability sont supprimées car la gestion des requêtes en attente est maintenant automatique via ZoneJS. Retirer tous les appels manuels.",
|
|
233
|
+
"estimated_time_per_occurrence": 5,
|
|
234
|
+
"onFile": null,
|
|
235
|
+
"fileTypes": [
|
|
236
|
+
"*.ts"
|
|
237
|
+
],
|
|
238
|
+
"regex": "testability\\.(increasePendingRequestCount|decreasePendingRequestCount)\\s*\\(",
|
|
239
|
+
"category": "api",
|
|
240
|
+
"isAutoFixable": true,
|
|
241
|
+
"minAngularVersion": 18,
|
|
242
|
+
"migration_command": null,
|
|
243
|
+
"risk_level": "low",
|
|
244
|
+
"code_description": "// Avant:\ntestability.increasePendingRequestCount();\n\n// Après:\n// Supprimer - géré automatiquement par ZoneJS",
|
|
245
|
+
"astPattern": {
|
|
246
|
+
"nodeType": "CallExpression",
|
|
247
|
+
"expression": {
|
|
248
|
+
"nodeType": "PropertyAccessExpression",
|
|
249
|
+
"propertyName": [
|
|
250
|
+
"increasePendingRequestCount",
|
|
251
|
+
"decreasePendingRequestCount"
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
"excludeContext": [
|
|
255
|
+
"StringLiteral",
|
|
256
|
+
"Comment"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"key": "ngModel_no_assignment",
|
|
263
|
+
"summary": "Pas d'assignation dans [(ngModel)]",
|
|
264
|
+
"description": "Angular 18 interdit les expressions d'assignation directement dans la liaison [(ngModel)] pour éviter les effets de bord imprévus. Utiliser (ngModelChange) pour gérer les transformations de valeur.",
|
|
265
|
+
"estimated_time_per_occurrence": 5,
|
|
266
|
+
"onFile": null,
|
|
267
|
+
"fileTypes": [
|
|
268
|
+
"*.html"
|
|
269
|
+
],
|
|
270
|
+
"regex": "\\[\\(ngModel\\)\\]\\s*=\\s*[\"'][^\"']*=",
|
|
271
|
+
"astPattern": {
|
|
272
|
+
"nodeType": "Attribute",
|
|
273
|
+
"name": "ngModel",
|
|
274
|
+
"valueMatches": ".*=.*"
|
|
275
|
+
},
|
|
276
|
+
"category": "template",
|
|
277
|
+
"isAutoFixable": true,
|
|
278
|
+
"minAngularVersion": 18,
|
|
279
|
+
"migration_command": null,
|
|
280
|
+
"risk_level": "medium",
|
|
281
|
+
"code_description": "// Avant:\n<input [(ngModel)]=\"user.name = process()\">\n\n// Après:\n<input [(ngModel)]=\"user.name\" (ngModelChange)=\"onChange($event)\">",
|
|
282
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"key": "providers_router_outlet",
|
|
286
|
+
"summary": "Déplacer providers de composant avec <router-outlet>",
|
|
287
|
+
"description": "Les providers définis dans un composant contenant un router-outlet ne sont plus disponibles dans les composants routés. Déplacer ces providers vers le bootstrap de l'application ou la configuration des routes pour assurer leur disponibilité.",
|
|
288
|
+
"estimated_time_per_occurrence": 10,
|
|
289
|
+
"onFile": null,
|
|
290
|
+
"fileTypes": [
|
|
291
|
+
"*.html"
|
|
292
|
+
],
|
|
293
|
+
"regex": "<router-outlet[^>]*>",
|
|
294
|
+
"category": "architecture",
|
|
295
|
+
"isAutoFixable": true,
|
|
296
|
+
"minAngularVersion": 18,
|
|
297
|
+
"migration_command": null,
|
|
298
|
+
"risk_level": "high",
|
|
299
|
+
"code_description": "// Avant:\n@Component({\n template: `<router-outlet></router-outlet>`,\n providers: [MyService]\n})\n\n// Après:\nbootstrapApplication(App, {\n providers: [MyService]\n});",
|
|
300
|
+
"astPattern": {
|
|
301
|
+
"nodeType": "Decorator",
|
|
302
|
+
"name": "Component",
|
|
303
|
+
"properties": {
|
|
304
|
+
"providers": {
|
|
305
|
+
"exists": true
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"template": {
|
|
309
|
+
"contains": "router-outlet"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"key": "onpush_host_bindings",
|
|
316
|
+
"summary": "OnPush + host bindings nécessitent markForCheck()",
|
|
317
|
+
"description": "Avec OnPush change detection, les host bindings basés sur des propriétés simples ou getters ne sont plus automatiquement mis à jour. Les signals et computed() ont une détection de changement automatique. Appeler markForCheck() uniquement pour les propriétés simples et getters après leur modification.",
|
|
318
|
+
"estimated_time_per_occurrence": 10,
|
|
319
|
+
"onFile": null,
|
|
320
|
+
"fileTypes": [
|
|
321
|
+
"*.ts"
|
|
322
|
+
],
|
|
323
|
+
"regex": "@Component[\\s\\S]*?(?:host\\s*:\\s*\\{[\\s\\S]*?[\\[\\(]|changeDetection\\s*:\\s*ChangeDetectionStrategy\\.OnPush)[\\s\\S]*?(?:host\\s*:\\s*\\{[\\s\\S]*?[\\[\\(]|changeDetection\\s*:\\s*ChangeDetectionStrategy\\.OnPush)",
|
|
324
|
+
"category": "component",
|
|
325
|
+
"isAutoFixable": true,
|
|
326
|
+
"minAngularVersion": 18,
|
|
327
|
+
"migration_command": null,
|
|
328
|
+
"risk_level": "high",
|
|
329
|
+
"code_description": "// Avant (propriété simple - NÉCESSITE markForCheck):\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.active]': 'isActive' }\n})\nexport class MyComponent {\n isActive = false;\n toggle() { this.isActive = true; }\n}\n\n// Après:\ntoggle() {\n this.isActive = true;\n this.cdr.markForCheck();\n}\n\n// OK (signal - PAS BESOIN de markForCheck):\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.active]': 'isActive()' }\n})\nexport class MyComponent {\n isActive = signal(false);\n toggle() { this.isActive.set(true); }\n}\n\n// OK (@HostBinding avec signal):\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MyComponent {\n @HostBinding('class.active')\n isActive = signal(false);\n}\n\n// NÉCESSITE markForCheck (multi-variables):\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.visible]': 'count1 + count2 > 0' }\n})\nexport class MyComponent {\n count1 = 0;\n count2 = 0;\n}",
|
|
330
|
+
"astPattern": {
|
|
331
|
+
"nodeType": "Decorator",
|
|
332
|
+
"name": "Component",
|
|
333
|
+
"properties": {
|
|
334
|
+
"changeDetection": "ChangeDetectionStrategy.OnPush"
|
|
335
|
+
},
|
|
336
|
+
"hostBindingProperty": {
|
|
337
|
+
"bindingType": "property",
|
|
338
|
+
"resolvedProperty": {
|
|
339
|
+
"notWrappedIn": ["signal", "computed", "inject"]
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"excludeContext": [
|
|
343
|
+
"StringLiteral",
|
|
344
|
+
"Comment"
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"key": "test_ignoreChangesOutsideZone",
|
|
351
|
+
"summary": "Tests: ajouter ignoreChangesOutsideZone si problèmes",
|
|
352
|
+
"description": "Si les tests avec fixture.autoDetect rencontrent des problèmes d'ordre ou de timing, ajouter ignoreChangesOutsideZone: true dans la configuration de ZoneChangeDetection pour ignorer les changements déclenchés hors de la zone Angular.",
|
|
353
|
+
"estimated_time_per_occurrence": 5,
|
|
354
|
+
"onFile": null,
|
|
355
|
+
"fileTypes": [
|
|
356
|
+
"*.spec.ts"
|
|
357
|
+
],
|
|
358
|
+
"regex": "fixture\\.autoDetect\\s*=\\s*true",
|
|
359
|
+
"category": "test",
|
|
360
|
+
"isAutoFixable": true,
|
|
361
|
+
"minAngularVersion": 18,
|
|
362
|
+
"migration_command": null,
|
|
363
|
+
"risk_level": "medium",
|
|
364
|
+
"code_description": "// Si tests échouent avec auto-detect:\nTestBed.configureTestingModule({\n providers: [\n provideZoneChangeDetection({\n ignoreChangesOutsideZone: true\n })\n ]\n});",
|
|
365
|
+
"astPattern": {
|
|
366
|
+
"nodeType": "BinaryExpression",
|
|
367
|
+
"left": {
|
|
368
|
+
"nodeType": "PropertyAccessExpression",
|
|
369
|
+
"object": "fixture",
|
|
370
|
+
"property": "autoDetect"
|
|
371
|
+
},
|
|
372
|
+
"right": {
|
|
373
|
+
"value": true
|
|
374
|
+
},
|
|
375
|
+
"excludeContext": [
|
|
376
|
+
"StringLiteral",
|
|
377
|
+
"Comment"
|
|
378
|
+
],
|
|
379
|
+
"operatorKind": "EqualsToken"
|
|
380
|
+
},
|
|
381
|
+
"doc_url": "https://angular.dev/reference/migrations"
|
|
382
|
+
}
|
|
369
383
|
]
|