@silvestv/migration-planificator 3.0.0 → 4.1.0

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.
Files changed (43) hide show
  1. package/LICENSE +201 -96
  2. package/NOTICE +105 -0
  3. package/README.fr.md +30 -24
  4. package/README.md +29 -25
  5. package/SECURITY.md +223 -187
  6. package/dist/client.bundle.js +51 -48
  7. package/dist/src/core/ast/matchers/html/html-pipe-variable-matcher.js +250 -0
  8. package/dist/src/core/ast/matchers/html/html-variable-resolver.js +105 -0
  9. package/dist/src/core/ast/matchers/index.js +7 -0
  10. package/dist/src/core/ast/matchers/ts/hierarchy-matcher.js +2 -1
  11. package/dist/src/core/ast/matchers/ts/rxjs-matcher.js +128 -0
  12. package/dist/src/core/workload/hierarchy-calculator.js +4 -4
  13. package/dist/src/core/workload/special-workload.js +2 -2
  14. package/dist/src/data/angular-migration-rules.json +2336 -2336
  15. package/dist/src/data/rules/rearchitecture/rearchitecture-rules.json +2 -2
  16. package/dist/src/data/rules/to18/rules-18-obligatoire.json +373 -373
  17. package/dist/src/data/rules/to18/rules-18-optionnelle.json +187 -187
  18. package/dist/src/data/rules/to18/rules-18-recommande.json +217 -217
  19. package/dist/src/data/rules/to19/rules-19-obligatoire.json +347 -347
  20. package/dist/src/data/rules/to19/rules-19-optionnelle.json +217 -222
  21. package/dist/src/data/rules/to19/rules-19-recommande.json +174 -199
  22. package/dist/src/data/rules/to20/rules-20-obligatoire.json +558 -555
  23. package/dist/src/data/rules/to20/rules-20-optionnelle.json +189 -189
  24. package/dist/src/data/rules/to20/rules-20-recommande.json +150 -150
  25. package/dist/src/models/interfaces/{ast-interfaces.js → angular-artifact-counts.interface.js} +0 -3
  26. package/dist/src/models/interfaces/base-target.interface.js +2 -0
  27. package/dist/src/models/interfaces/checklist-state.interface.js +2 -0
  28. package/dist/src/models/interfaces/dependency-counts.interface.js +2 -0
  29. package/dist/src/models/interfaces/migration-guide-data.interface.js +2 -0
  30. package/dist/src/models/interfaces/module-info.interface.js +2 -0
  31. package/dist/src/models/interfaces/parallelization.interface.js +2 -0
  32. package/dist/src/models/interfaces/refer-to-pattern.interface.js +2 -0
  33. package/dist/src/models/interfaces/summary-totals.interface.js +2 -0
  34. package/dist/src/models/interfaces/window-with-data.interface.js +2 -0
  35. package/dist/src/templates/workload/dashboard.template.js +7 -44
  36. package/dist/src/templates/workload/guide-rule-card.template.js +1 -1
  37. package/dist/src/templates/workload/rule-modal.template.js +6 -21
  38. package/dist/src/templates/workload/unified-settings-panel.template.js +149 -0
  39. package/dist/src/utils/core/args-parser.js +16 -1
  40. package/dist/styles.css +1 -1
  41. package/package.json +8 -7
  42. /package/dist/src/models/{chip-config.js → constants/chip-config.js} +0 -0
  43. /package/dist/src/models/interfaces/{client-interfaces.js → client-interfaces.interface.js} +0 -0
@@ -1,190 +1,190 @@
1
- [
2
- {
3
- "key": "httpResource_api",
4
- "summary": "httpResource pour requêtes HTTP réactives",
5
- "description": "La nouvelle API httpResource expérimentale simplifie les requêtes HTTP réactives avec tracking automatique du status et des erreurs. Alternative moderne aux patterns HttpClient + AsyncPipe, s'intègre nativement avec les signaux pour une réactivité fine-grained.",
6
- "estimated_time_per_occurrence": 15,
7
- "onFile": null,
8
- "fileTypes": [
9
- "*.ts"
10
- ],
11
- "regex": "\\bhttpResource\\s*\\(",
12
- "category": "reactive",
13
- "auto_fixable": false,
14
- "migration_command": null,
15
- "risk_level": "medium",
16
- "code_description": "// Nouvelle API expérimentale\n\nconst userResource = httpResource<User>(() => \n `https://api.example.com/users/${userId()}`\n);",
17
- "astPattern": {
18
- "nodeType": "CallExpression",
19
- "functionName": "httpResource",
20
- "excludeContext": [
21
- "StringLiteral",
22
- "Comment"
23
- ]
24
- },
25
- "doc_url": "https://angular.dev/reference/migrations"
26
- },
27
- {
28
- "key": "resource_streaming",
29
- "summary": "Resource streaming pour websockets",
30
- "description": "L'API resource streaming permet de créer des ressources qui se mettent à jour en continu via WebSocket ou Server-Sent Events. Le signal retourné se met à jour automatiquement à chaque message, idéal pour les données temps réel (chat, dashboards).",
31
- "estimated_time_per_occurrence": 30,
32
- "onFile": null,
33
- "fileTypes": [
34
- "*.ts"
35
- ],
36
- "regex": "new\\s+WebSocket\\s*\\(",
37
- "category": "reactive",
38
- "auto_fixable": false,
39
- "migration_command": null,
40
- "risk_level": "high",
41
- "code_description": "const streamResource = resource({\n stream: () => new Promise<Signal<ResourceStreamItem>>((resolve) => {\n const result = signal<{ value: Data }>({ value: initialData });\n \n websocket.onmessage = (event) => {\n result.update(current => ({\n value: [...current.value, event.data]\n }));\n };\n \n resolve(result);\n })\n});",
42
- "astPattern": {
43
- "nodeType": "CallExpression",
44
- "functionName": "resource",
45
- "arguments": {
46
- "properties": {
47
- "stream": {
48
- "exists": true
49
- }
50
- }
51
- },
52
- "excludeContext": [
53
- "StringLiteral",
54
- "Comment"
55
- ]
56
- },
57
- "doc_url": "https://angular.dev/reference/migrations"
58
- },
59
- {
60
- "key": "createComponent_bindings",
61
- "summary": "createComponent avec bindings dynamiques",
62
- "description": "createComponent supporte maintenant les bindings dynamiques (input, output, two-way) et l'application de directives au runtime. Permet de créer des composants programmatiquement avec la même flexibilité que les templates, idéal pour les dialogs et overlays.",
63
- "estimated_time_per_occurrence": 15,
64
- "onFile": null,
65
- "fileTypes": [
66
- "*.ts"
67
- ],
68
- "regex": "(?<!TestBed\\.)createComponent\\s*\\([^,]+,\\s*\\{[^}]*bindings\\s*:",
69
- "category": "api",
70
- "auto_fixable": false,
71
- "migration_command": null,
72
- "risk_level": "medium",
73
- "code_description": "createComponent(MyDialog, {\n bindings: [\n inputBinding('title', titleSignal),\n outputBinding('onClose', (result) => console.log(result)),\n twoWayBinding('value', valueSignal)\n ],\n directives: [\n FocusTrap,\n {\n type: HasColor,\n bindings: [inputBinding('color', () => 'primary')]\n }\n ]\n});",
74
- "astPattern": {
75
- "nodeType": "CallExpression",
76
- "functionName": "createComponent",
77
- "arguments": {
78
- "properties": {
79
- "bindings": {
80
- "exists": true
81
- }
82
- }
83
- },
84
- "excludeContext": [
85
- "StringLiteral",
86
- "Comment"
87
- ]
88
- },
89
- "doc_url": "https://angular.dev/reference/migrations"
90
- },
91
- {
92
- "key": "vitest_support",
93
- "summary": "Support Vitest expérimental",
94
- "description": "Angular 20 ajoute le support expérimental de Vitest comme test runner alternatif à Karma/Jasmine. Vitest offre un démarrage instantané, un watch mode performant et une compatibilité Jest. Configuration via angular.json avec le builder @angular/build:unit-test.",
95
- "estimated_time_per_occurrence": 840,
96
- "onFile": "angular.json",
97
- "fileTypes": [
98
- "angular.json"
99
- ],
100
- "regex": "\"test\"[\\s\\S]*?\"builder\"[\\s\\S]*?(?!\"runner\"[\\s\\S]*?\"vitest\")\"@angular",
101
- "category": "test",
102
- "auto_fixable": false,
103
- "migration_command": "npm i vitest jsdom --save-dev",
104
- "risk_level": "high",
105
- "code_description": "// angular.json - Détecte si vitest N'EST PAS encore configuré\n// MATCH (routine pertinente):\n\"test\": {\n \"builder\": \"@angular/build:karma\"\n}\n// OU\n\"test\": {\n \"builder\": \"@angular/build:unit-test\"\n // pas de \"runner\": \"vitest\"\n}\n\n// NO MATCH (déjà configuré):\n\"test\": {\n \"builder\": \"@angular/build:unit-test\",\n \"options\": {\n \"runner\": \"vitest\"\n }\n}\n\n// Installation:\n// npm i vitest jsdom --save-dev",
106
- "doc_url": "https://angular.dev/reference/migrations"
107
- },
108
- {
109
- "key": "style_guide_no_suffix",
110
- "summary": "Guide de style sans suffixes",
111
- "description": "Angular 20 adopte un nouveau guide de style par défaut sans suffixes (.component, .service, etc.) pour les fichiers générés. Pour les projets existants, ng update ajoute automatiquement la config de schematics pour garder les suffixes. Nouveau style: user.ts au lieu de user.component.ts.",
112
- "estimated_time_per_occurrence": 10,
113
- "onFile": "angular.json",
114
- "onFileNx": "nx.json",
115
- "fileTypes": [
116
- "angular.json"
117
- ],
118
- "regex": "^(?![\\s\\S]*\"schematics\"[\\s\\S]*\"@schematics/angular:component\"[\\s\\S]*\"type\"[\\s\\S]*\"component\")[\\s\\S]+",
119
- "category": "style",
120
- "auto_fixable": false,
121
- "migration_command": null,
122
- "risk_level": "low",
123
- "code_description": "// Par défaut en v20: ng generate component user crée user.ts (sans suffixe)\n// Détecte si config pour GARDER suffixes N'EST PAS présente\n\n// MATCH (routine pertinente - config manquante):\n{\n \"projects\": { ... }\n // pas de config schematics pour type: \"component\"\n}\n\n// NO MATCH (déjà configuré - garde les suffixes):\n// angular.json ou nx.json:\n{\n \"schematics\": {\n \"@schematics/angular:component\": { \"type\": \"component\" }\n }\n}",
124
- "doc_url": "https://angular.dev/reference/migrations"
125
- },
126
- {
127
- "key": "host_bindings_type_checking",
128
- "summary": "Type checking pour host bindings",
129
- "description": "Le compilateur Angular 20 active par défaut le type checking strict pour les host bindings en v21 avec typeCheckHostBindings: true. Permet de détecter les erreurs de typage dans les bindings de classe, styles et événements définis dans le décorateur host.",
130
- "estimated_time_per_occurrence": 5,
131
- "fileTypes": [
132
- "tsconfig.json",
133
- "*.ts"
134
- ],
135
- "regex": "\"angularCompilerOptions\"[\\s\\S]*?\"typeCheckHostBindings\"\\s*:\\s*true",
136
- "category": "config",
137
- "auto_fixable": false,
138
- "migration_command": null,
139
- "risk_level": "low",
140
- "code_description": "// tsconfig.json ou tsconfig.base.json pour projet Nx\n{\n \"angularCompilerOptions\": {\n \"typeCheckHostBindings\": true // Activé par défaut en v21\n }\n}\n\n// Maintenant avec vérification:\n@Component({\n host: {\n '[class.active]': 'isActive()',\n '(click)': 'onClick($event)'\n }\n})",
141
- "astPattern": {
142
- "nodeType": "Decorator",
143
- "name": "Component",
144
- "properties": {
145
- "host": {
146
- "exists": true
147
- }
148
- },
149
- "inFile": {
150
- "tsconfig": {
151
- "angularCompilerOptions": {
152
- "typeCheckHostBindings": {
153
- "missing": true
154
- }
155
- }
156
- }
157
- }
158
- },
159
- "doc_url": "https://angular.dev/reference/migrations"
160
- },
161
- {
162
- "key": "datePipe_warnings",
163
- "summary": "DatePipe warnings pour format Y sans w",
164
- "description": "Le DatePipe émet maintenant un warning si le format 'Y' (année ISO) est utilisé sans 'w' (semaine). Ce pattern est suspect car l'année ISO n'a de sens qu'avec la semaine ISO. Utiliser 'y' pour l'année standard ou 'Y w' ensemble.",
165
- "estimated_time_per_occurrence": 3,
166
- "onFile": null,
167
- "fileTypes": [
168
- "*.html",
169
- "*.ts"
170
- ],
171
- "regex": "\\|\\s*date\\s*:\\s*['\"]Y['\"]",
172
- "astPattern": {
173
- "nodeType": "PipeExpression",
174
- "pipeName": "date",
175
- "pipeArgs": {
176
- "formatMatches": "^Y[^w]*$"
177
- },
178
- "excludeContext": [
179
- "StringLiteral",
180
- "Comment"
181
- ]
182
- },
183
- "category": "template",
184
- "auto_fixable": false,
185
- "migration_command": null,
186
- "risk_level": "low",
187
- "code_description": "// ⚠️ Avertissement:\n{{ date | date:'Y' }} // Suspect: année sans semaine\n\n// ✅ Correct:\n{{ date | date:'y' }} // Année standard\n{{ date | date:'Y w' }} // Année et semaine ensemble",
188
- "doc_url": "https://angular.dev/reference/migrations"
189
- }
1
+ [
2
+ {
3
+ "key": "httpResource_api",
4
+ "summary": "httpResource pour requêtes HTTP réactives",
5
+ "description": "La nouvelle API httpResource expérimentale simplifie les requêtes HTTP réactives avec tracking automatique du status et des erreurs. Alternative moderne aux patterns HttpClient + AsyncPipe, s'intègre nativement avec les signaux pour une réactivité fine-grained.",
6
+ "estimated_time_per_occurrence": 15,
7
+ "onFile": null,
8
+ "fileTypes": [
9
+ "*.ts"
10
+ ],
11
+ "regex": "\\bhttpResource\\s*\\(",
12
+ "category": "reactive",
13
+ "isAutoFixable": false,
14
+ "migration_command": null,
15
+ "risk_level": "medium",
16
+ "code_description": "// Nouvelle API expérimentale\n\nconst userResource = httpResource<User>(() => \n `https://api.example.com/users/${userId()}`\n);",
17
+ "astPattern": {
18
+ "nodeType": "CallExpression",
19
+ "functionName": "httpResource",
20
+ "excludeContext": [
21
+ "StringLiteral",
22
+ "Comment"
23
+ ]
24
+ },
25
+ "doc_url": "https://angular.dev/reference/migrations"
26
+ },
27
+ {
28
+ "key": "resource_streaming",
29
+ "summary": "Resource streaming pour websockets",
30
+ "description": "L'API resource streaming permet de créer des ressources qui se mettent à jour en continu via WebSocket ou Server-Sent Events. Le signal retourné se met à jour automatiquement à chaque message, idéal pour les données temps réel (chat, dashboards).",
31
+ "estimated_time_per_occurrence": 30,
32
+ "onFile": null,
33
+ "fileTypes": [
34
+ "*.ts"
35
+ ],
36
+ "regex": "new\\s+WebSocket\\s*\\(",
37
+ "category": "reactive",
38
+ "isAutoFixable": false,
39
+ "migration_command": null,
40
+ "risk_level": "high",
41
+ "code_description": "const streamResource = resource({\n stream: () => new Promise<Signal<ResourceStreamItem>>((resolve) => {\n const result = signal<{ value: Data }>({ value: initialData });\n \n websocket.onmessage = (event) => {\n result.update(current => ({\n value: [...current.value, event.data]\n }));\n };\n \n resolve(result);\n })\n});",
42
+ "astPattern": {
43
+ "nodeType": "CallExpression",
44
+ "functionName": "resource",
45
+ "arguments": {
46
+ "properties": {
47
+ "stream": {
48
+ "exists": true
49
+ }
50
+ }
51
+ },
52
+ "excludeContext": [
53
+ "StringLiteral",
54
+ "Comment"
55
+ ]
56
+ },
57
+ "doc_url": "https://angular.dev/reference/migrations"
58
+ },
59
+ {
60
+ "key": "createComponent_bindings",
61
+ "summary": "createComponent avec bindings dynamiques",
62
+ "description": "createComponent supporte maintenant les bindings dynamiques (input, output, two-way) et l'application de directives au runtime. Permet de créer des composants programmatiquement avec la même flexibilité que les templates, idéal pour les dialogs et overlays.",
63
+ "estimated_time_per_occurrence": 15,
64
+ "onFile": null,
65
+ "fileTypes": [
66
+ "*.ts"
67
+ ],
68
+ "regex": "(?<!TestBed\\.)createComponent\\s*\\([^,]+,\\s*\\{[^}]*bindings\\s*:",
69
+ "category": "api",
70
+ "isAutoFixable": false,
71
+ "migration_command": null,
72
+ "risk_level": "medium",
73
+ "code_description": "createComponent(MyDialog, {\n bindings: [\n inputBinding('title', titleSignal),\n outputBinding('onClose', (result) => console.log(result)),\n twoWayBinding('value', valueSignal)\n ],\n directives: [\n FocusTrap,\n {\n type: HasColor,\n bindings: [inputBinding('color', () => 'primary')]\n }\n ]\n});",
74
+ "astPattern": {
75
+ "nodeType": "CallExpression",
76
+ "functionName": "createComponent",
77
+ "arguments": {
78
+ "properties": {
79
+ "bindings": {
80
+ "exists": true
81
+ }
82
+ }
83
+ },
84
+ "excludeContext": [
85
+ "StringLiteral",
86
+ "Comment"
87
+ ]
88
+ },
89
+ "doc_url": "https://angular.dev/reference/migrations"
90
+ },
91
+ {
92
+ "key": "vitest_support",
93
+ "summary": "Support Vitest expérimental",
94
+ "description": "Angular 20 ajoute le support expérimental de Vitest comme test runner alternatif à Karma/Jasmine. Vitest offre un démarrage instantané, un watch mode performant et une compatibilité Jest. Configuration via angular.json avec le builder @angular/build:unit-test.",
95
+ "estimated_time_per_occurrence": 840,
96
+ "onFile": "angular.json",
97
+ "fileTypes": [
98
+ "angular.json"
99
+ ],
100
+ "regex": "\"test\"[\\s\\S]*?\"builder\"[\\s\\S]*?(?!\"runner\"[\\s\\S]*?\"vitest\")\"@angular",
101
+ "category": "test",
102
+ "isAutoFixable": false,
103
+ "migration_command": "npm i vitest jsdom --save-dev",
104
+ "risk_level": "high",
105
+ "code_description": "// angular.json - Détecte si vitest N'EST PAS encore configuré\n// MATCH (routine pertinente):\n\"test\": {\n \"builder\": \"@angular/build:karma\"\n}\n// OU\n\"test\": {\n \"builder\": \"@angular/build:unit-test\"\n // pas de \"runner\": \"vitest\"\n}\n\n// NO MATCH (déjà configuré):\n\"test\": {\n \"builder\": \"@angular/build:unit-test\",\n \"options\": {\n \"runner\": \"vitest\"\n }\n}\n\n// Installation:\n// npm i vitest jsdom --save-dev",
106
+ "doc_url": "https://angular.dev/reference/migrations"
107
+ },
108
+ {
109
+ "key": "style_guide_no_suffix",
110
+ "summary": "Guide de style sans suffixes",
111
+ "description": "Angular 20 adopte un nouveau guide de style par défaut sans suffixes (.component, .service, etc.) pour les fichiers générés. Pour les projets existants, ng update ajoute automatiquement la config de schematics pour garder les suffixes. Nouveau style: user.ts au lieu de user.component.ts.",
112
+ "estimated_time_per_occurrence": 10,
113
+ "onFile": "angular.json",
114
+ "onFileNx": "nx.json",
115
+ "fileTypes": [
116
+ "angular.json"
117
+ ],
118
+ "regex": "^(?![\\s\\S]*\"schematics\"[\\s\\S]*\"@schematics/angular:component\"[\\s\\S]*\"type\"[\\s\\S]*\"component\")[\\s\\S]+",
119
+ "category": "style",
120
+ "isAutoFixable": false,
121
+ "migration_command": null,
122
+ "risk_level": "low",
123
+ "code_description": "// Par défaut en v20: ng generate component user crée user.ts (sans suffixe)\n// Détecte si config pour GARDER suffixes N'EST PAS présente\n\n// MATCH (routine pertinente - config manquante):\n{\n \"projects\": { ... }\n // pas de config schematics pour type: \"component\"\n}\n\n// NO MATCH (déjà configuré - garde les suffixes):\n// angular.json ou nx.json:\n{\n \"schematics\": {\n \"@schematics/angular:component\": { \"type\": \"component\" }\n }\n}",
124
+ "doc_url": "https://angular.dev/reference/migrations"
125
+ },
126
+ {
127
+ "key": "host_bindings_type_checking",
128
+ "summary": "Type checking pour host bindings",
129
+ "description": "Le compilateur Angular 20 active par défaut le type checking strict pour les host bindings en v21 avec typeCheckHostBindings: true. Permet de détecter les erreurs de typage dans les bindings de classe, styles et événements définis dans le décorateur host.",
130
+ "estimated_time_per_occurrence": 5,
131
+ "fileTypes": [
132
+ "tsconfig.json",
133
+ "*.ts"
134
+ ],
135
+ "regex": "\"angularCompilerOptions\"[\\s\\S]*?\"typeCheckHostBindings\"\\s*:\\s*true",
136
+ "category": "config",
137
+ "isAutoFixable": false,
138
+ "migration_command": null,
139
+ "risk_level": "low",
140
+ "code_description": "// tsconfig.json ou tsconfig.base.json pour projet Nx\n{\n \"angularCompilerOptions\": {\n \"typeCheckHostBindings\": true // Activé par défaut en v21\n }\n}\n\n// Maintenant avec vérification:\n@Component({\n host: {\n '[class.active]': 'isActive()',\n '(click)': 'onClick($event)'\n }\n})",
141
+ "astPattern": {
142
+ "nodeType": "Decorator",
143
+ "name": "Component",
144
+ "properties": {
145
+ "host": {
146
+ "exists": true
147
+ }
148
+ },
149
+ "inFile": {
150
+ "tsconfig": {
151
+ "angularCompilerOptions": {
152
+ "typeCheckHostBindings": {
153
+ "missing": true
154
+ }
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "doc_url": "https://angular.dev/reference/migrations"
160
+ },
161
+ {
162
+ "key": "datePipe_warnings",
163
+ "summary": "DatePipe warnings pour format Y sans w",
164
+ "description": "Le DatePipe émet maintenant un warning si le format 'Y' (année ISO) est utilisé sans 'w' (semaine). Ce pattern est suspect car l'année ISO n'a de sens qu'avec la semaine ISO. Utiliser 'y' pour l'année standard ou 'Y w' ensemble.",
165
+ "estimated_time_per_occurrence": 3,
166
+ "onFile": null,
167
+ "fileTypes": [
168
+ "*.html",
169
+ "*.ts"
170
+ ],
171
+ "regex": "\\|\\s*date\\s*:\\s*['\"]Y['\"]",
172
+ "astPattern": {
173
+ "nodeType": "PipeExpression",
174
+ "pipeName": "date",
175
+ "pipeArgs": {
176
+ "formatMatches": "^Y[^w]*$"
177
+ },
178
+ "excludeContext": [
179
+ "StringLiteral",
180
+ "Comment"
181
+ ]
182
+ },
183
+ "category": "template",
184
+ "isAutoFixable": false,
185
+ "migration_command": null,
186
+ "risk_level": "low",
187
+ "code_description": "// ⚠️ Avertissement:\n{{ date | date:'Y' }} // Suspect: année sans semaine\n\n// ✅ Correct:\n{{ date | date:'y' }} // Année standard\n{{ date | date:'Y w' }} // Année et semaine ensemble",
188
+ "doc_url": "https://angular.dev/reference/migrations"
189
+ }
190
190
  ]