@silvestv/migration-planificator 7.1.2 → 7.1.3
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/src/autofix/prompts/constitution.js +9 -12
- package/dist/src/autofix/prompts/file-prompt-phases.js +24 -3
- package/dist/src/data/rules/rearchitecture/rearchitecture-rules.json +36 -0
- package/dist/src/data/rules/to19/rules-19-recommande.json +4 -4
- package/dist/src/data/rules/to21/rules-21-recommande.json +2 -2
- package/dist/src/models/constants/fix-ai-cli-permissions.js +15 -4
- package/package.json +1 -1
|
@@ -12,9 +12,9 @@ Tu es un expert Angular spécialisé dans les migrations. Tu travailles sur un p
|
|
|
12
12
|
|
|
13
13
|
### 0. AUTONOMIE
|
|
14
14
|
En restant critique et sécurisant sur tes actions dangereuses tu DOIS:
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- Suivre à la lettre les commandes écrites + suivre à la lettre les phases
|
|
16
|
+
- Professionnel, sérieux et sécure
|
|
17
|
+
- Éviter à L'EXTREME MAXIMUM les interactions avec l'utilisateur
|
|
18
18
|
|
|
19
19
|
### 1. INTERDICTION DES PLACEHOLDERS
|
|
20
20
|
Tu ne dois JAMAIS :
|
|
@@ -57,20 +57,17 @@ Exemples courants à ne PAS oublier :
|
|
|
57
57
|
est TRÈS COÛTEUSE en tokens et déclenche un nouveau cycle de validation.
|
|
58
58
|
Ne modifie en Phase 6 que si ABSOLUMENT NÉCESSAIRE (bug critique, violation flagrante).
|
|
59
59
|
|
|
60
|
-
### 6. EXECUTION DE COMMANDE SHELL
|
|
61
|
-
-
|
|
60
|
+
### 6. EXECUTION DE COMMANDE SHELL
|
|
61
|
+
- Éxecutes toujours de manière autonome et exacte les commandes définies dans file-prompt.md & contexte.md
|
|
62
62
|
- Sois toujours le plus autonome possible
|
|
63
63
|
- Privilégie TOUJOURS les commandes autorisées dans le settings.json
|
|
64
|
-
-
|
|
65
|
-
- Si un commande te parait particulièrement
|
|
64
|
+
- Évites à tout prix de créer des commandes
|
|
65
|
+
- Si un commande te parait particulièrement DANGEREUSE ou critique, demande à l'utilisateur l'autorisation
|
|
66
66
|
|
|
67
67
|
### 7. COMMANDES SHELL - RÈGLE ABSOLUE
|
|
68
|
-
⛔ **COPIE-COLLE EXACT** : Utilise les commandes EXACTEMENT comme
|
|
69
|
-
|
|
70
|
-
- !!! ESSAIE DE NE PAS INVENTER DE COMMANDES SHELL UTILISE CELLE DEMANDEES !!!
|
|
68
|
+
⛔ **COPIE-COLLE EXACT** : Utilise les commandes EXACTEMENT comme écrites dans file-prompte.md & context.md
|
|
69
|
+
- !!! ESSAIE DE NE PAS INVENTER DE COMMANDES SHELL UTILISE CELLES DEMANDEES !!!
|
|
71
70
|
- NE JAMAIS adapter pour Windows/Linux/Mac
|
|
72
|
-
- NE JAMAIS ajouter de flags ou paramètres
|
|
73
|
-
- NE JAMAIS chaîner différemment
|
|
74
71
|
- Si la commande échoue, DEMANDE à l'utilisateur au lieu d'inventer
|
|
75
72
|
|
|
76
73
|
## CONTEXTE
|
|
@@ -231,7 +231,10 @@ function buildPhase5Section(params) {
|
|
|
231
231
|
| **5. MAJ Ledger** | **⛔ AVANT rebuild - JAMAIS APRÈS** |
|
|
232
232
|
| 6. Re-exec | \`log_N+1.txt\` et boucle |
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
### ⛔ RÈGLE BLOQUANTE - Erreurs NGXXXX
|
|
235
|
+
> Avant TOUTE correction d'une erreur Angular (NGXXXX) :
|
|
236
|
+
> 1. WebFetch https://angular.dev/errors/NGXXXX
|
|
237
|
+
> 2. SI tu corriges SANS WebFetch → Migration INVALIDE
|
|
235
238
|
> Exemple : NG0401 = BootstrapContext manquant (Angular 20 SSR), pas un problème d'inject().
|
|
236
239
|
|
|
237
240
|
#### Calcul du BLAME (via ledger.json)
|
|
@@ -271,8 +274,18 @@ npx @silvestv/migration-planificator --no-report --onlyRule=${params.ruleKey} --
|
|
|
271
274
|
> ⏭️ **Skippé** (--skip-build)` : `
|
|
272
275
|
### 5.B : Build
|
|
273
276
|
|
|
277
|
+
\`\`\`bash
|
|
278
|
+
# Si log court
|
|
279
|
+
npm run build
|
|
280
|
+
\`\`\`
|
|
281
|
+
|
|
282
|
+
> **Pourquoi cette commande complexe ?** Si \`npm run build\` produit 5000+ lignes, tu ne peux pas tout lire.
|
|
283
|
+
> Ce pipe : strip ANSI colors → filtre erreurs + 60 lignes contexte → fichier lisible via \`cat\`.
|
|
284
|
+
> **⛔ OBLIGATOIRE si logs longs** - aucune simplification autorisée.
|
|
285
|
+
|
|
274
286
|
\`\`\`bash
|
|
275
287
|
mkdir -p ${logDir}/build_logs
|
|
288
|
+
# COPIER-COLLER EXACT - NE DEMANDE PAS CONFIRMATION EXECUTE !
|
|
276
289
|
${(0, bash_commands_helpers_1.logCmd)(params.migrationNumber, params.ruleKey, 'build')}
|
|
277
290
|
\`\`\`
|
|
278
291
|
|
|
@@ -284,9 +297,12 @@ ${(0, bash_commands_helpers_1.logCmd)(params.migrationNumber, params.ruleKey, 'b
|
|
|
284
297
|
> ⏭️ **Skippé** (--skip-tests)` : `
|
|
285
298
|
### 5.C : Tests
|
|
286
299
|
|
|
300
|
+
> **Même logique que 5.B** : logs longs → pipe obligatoire pour filtrer erreurs.
|
|
301
|
+
|
|
287
302
|
\`\`\`bash
|
|
288
303
|
npm pkg get scripts.test # Si {} → skip
|
|
289
304
|
mkdir -p ${logDir}/test_logs
|
|
305
|
+
# COPIER-COLLER EXACT - NE DEMANDE PAS CONFIRMATION EXECUTE !
|
|
290
306
|
${(0, bash_commands_helpers_1.logCmd)(params.migrationNumber, params.ruleKey, 'test')}
|
|
291
307
|
\`\`\`
|
|
292
308
|
|
|
@@ -317,12 +333,12 @@ function buildPhase7Section(params) {
|
|
|
317
333
|
const hasSchematic = !!params.migrationCommand;
|
|
318
334
|
const validationSummary = [!params.skipBuild && 'Build OK', !params.skipTests && 'Tests OK']
|
|
319
335
|
.filter(Boolean).join(', ') || 'Modifications terminées';
|
|
320
|
-
return `## ✅ PHASE 7 : COMMIT & PUSH (Si succès uniquement)
|
|
336
|
+
return `## ✅ PHASE 7 : COMMIT & PUSH & MAJ REPORT (Si succès uniquement)
|
|
321
337
|
|
|
322
338
|
Une fois la validation complète (${validationSummary}) :
|
|
323
339
|
|
|
324
340
|
### Commit
|
|
325
|
-
|
|
341
|
+
** !!! ne jamais git add le dossier OUTPUT il est GITIGNORE !!! **
|
|
326
342
|
\`\`\`bash
|
|
327
343
|
git add .
|
|
328
344
|
# Ne demande pas d'approbation de l'utilisateur commit direct !
|
|
@@ -354,6 +370,11 @@ git push origin feat/ai-migration-${params.ruleKey}
|
|
|
354
370
|
}
|
|
355
371
|
\`\`\`
|
|
356
372
|
|
|
373
|
+
### Mise à jour du report
|
|
374
|
+
\`\`\`bash
|
|
375
|
+
npx @silvestv/migration-planificator
|
|
376
|
+
\`\`\`
|
|
377
|
+
|
|
357
378
|
### Message final
|
|
358
379
|
|
|
359
380
|
\`\`\`
|
|
@@ -92,5 +92,41 @@
|
|
|
92
92
|
"Comment"
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"key": "nx_schematic_config_fix",
|
|
98
|
+
"summary": "Corriger la configuration Nx pour les schematics Angular",
|
|
99
|
+
"description": "Les schematics Angular (@angular/core:signal-input-migration, output-migration, signal-queries-migration) ne scannent que les projets ayant un target 'build' ou 'test' avec 'options.tsConfig' défini. Les projets Nx utilisant des noms de targets non-standards (browser, compile, etc.) ou les libraries sans target build exposant tsConfig sont ignorés silencieusement. Cette règle détecte les configurations manquantes.",
|
|
100
|
+
"estimated_time_per_occurrence": 5,
|
|
101
|
+
"onFile": "project.json",
|
|
102
|
+
"fileTypes": [
|
|
103
|
+
"project.json"
|
|
104
|
+
],
|
|
105
|
+
"regex": "\"executor\":\\s*\"@angular-devkit/build-angular:(browser|server)\"",
|
|
106
|
+
"category": "architecture",
|
|
107
|
+
"isAutoFixable": false,
|
|
108
|
+
"minAngularVersion": 17,
|
|
109
|
+
"migration_command": null,
|
|
110
|
+
"risk_level": "low",
|
|
111
|
+
"code_description": "// Problème 1: App avec target 'browser' au lieu de 'build'\n// project.json (avant):\n\"browser\": { \"executor\": \"@angular-devkit/build-angular:browser\", ... }\n\n// project.json (après):\n\"build\": { \"executor\": \"@angular-devkit/build-angular:browser\", ... }\n\n// Problème 2: Library sans target build exposant tsConfig\n// project.json (avant):\n{ \"name\": \"my-lib\", \"targets\": { \"lint\": {...} } }\n\n// project.json (après):\n{ \"name\": \"my-lib\", \"targets\": { \"build\": { \"executor\": \"nx:run-commands\", \"options\": { \"command\": \"echo 'Not buildable'\", \"tsConfig\": \"libs/my-lib/tsconfig.lib.json\" } }, \"lint\": {...} } }",
|
|
112
|
+
"astPattern": null,
|
|
113
|
+
"doc_url": "https://github.com/angular/angular/blob/main/packages/core/schematics/utils/project_tsconfig_paths.ts",
|
|
114
|
+
"detection_patterns": [
|
|
115
|
+
{
|
|
116
|
+
"type": "missing_build_target",
|
|
117
|
+
"description": "Library sans target 'build' avec tsConfig",
|
|
118
|
+
"check": "project.json sans 'targets.build.options.tsConfig' ni 'targets.test.options.tsConfig'"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "non_standard_target_name",
|
|
122
|
+
"description": "App utilisant 'browser' au lieu de 'build'",
|
|
123
|
+
"check": "project.json avec 'targets.browser' mais sans 'targets.build'"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "missing_tsconfig_lib",
|
|
127
|
+
"description": "Library sans tsconfig.lib.json",
|
|
128
|
+
"check": "Dossier lib/ sans fichier tsconfig.lib.json"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
95
131
|
}
|
|
96
132
|
]
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"category": "signals",
|
|
13
13
|
"isAutoFixable": true,
|
|
14
14
|
"minAngularVersion": 19,
|
|
15
|
-
"migration_command": "npx ng generate @angular/core:signal-input-migration --path=./ --best-effort-mode=false",
|
|
16
|
-
"nxMigrationCommand": "npx nx generate @angular/core:signal-input-migration --path=./ --best-effort-mode=false",
|
|
15
|
+
"migration_command": "npx ng generate @angular/core:signal-input-migration --path=./ --insert-todos --best-effort-mode=false",
|
|
16
|
+
"nxMigrationCommand": "npx nx generate @angular/core:signal-input-migration --path=./ --insert-todos --best-effort-mode=false",
|
|
17
17
|
"risk_level": "medium",
|
|
18
18
|
"code_description": "// Avant:\n@Input() name: string;\n@Input({ required: true }) age: number;\n\n// Après:\nreadonly name = input<string>();\nreadonly age = input.required<number>();",
|
|
19
19
|
"astPattern": {
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"category": "signals",
|
|
106
106
|
"isAutoFixable": true,
|
|
107
107
|
"minAngularVersion": 19,
|
|
108
|
-
"migration_command": "npx ng generate @angular/core:signal-queries-migration --path=./ --best-effort-mode=false",
|
|
109
|
-
"nxMigrationCommand": "npx nx generate @angular/core:signal-queries-migration --path=./ --best-effort-mode=false",
|
|
108
|
+
"migration_command": "npx ng generate @angular/core:signal-queries-migration --path=./ --insert-todos --best-effort-mode=false",
|
|
109
|
+
"nxMigrationCommand": "npx nx generate @angular/core:signal-queries-migration --path=./ --insert-todos --best-effort-mode=false",
|
|
110
110
|
"risk_level": "medium",
|
|
111
111
|
"code_description": "// Avant:\n@ViewChild('ref') ref: ElementRef;\n\n// Après:\nreadonly ref = viewChild<ElementRef>('ref');",
|
|
112
112
|
"astPattern": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"category": "template",
|
|
84
84
|
"isAutoFixable": true,
|
|
85
|
-
"minAngularVersion":
|
|
85
|
+
"minAngularVersion": 21,
|
|
86
86
|
"migration_command": "npx ng generate @angular/core:ngclass-to-class --path=./",
|
|
87
87
|
"nxMigrationCommand": "npx nx generate @angular/core:ngclass-to-class --path=./",
|
|
88
88
|
"risk_level": "low",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
"category": "template",
|
|
106
106
|
"isAutoFixable": true,
|
|
107
|
-
"minAngularVersion":
|
|
107
|
+
"minAngularVersion": 21,
|
|
108
108
|
"migration_command": "npx ng generate @angular/core:ngstyle-to-style --path=./",
|
|
109
109
|
"nxMigrationCommand": "npx nx generate @angular/core:ngstyle-to-style --path=./",
|
|
110
110
|
"risk_level": "low",
|
|
@@ -43,6 +43,8 @@ exports.CLI_ALLOWED_COMMANDS = [
|
|
|
43
43
|
'Bash(npx nx g @angular/core:*)',
|
|
44
44
|
// === Nx CLI - Add ===
|
|
45
45
|
'Bash(npx nx add *)',
|
|
46
|
+
// === Nx CLI - Run ===
|
|
47
|
+
'Bash(npx nx run:*)',
|
|
46
48
|
// === npm - Install packages ===
|
|
47
49
|
'Bash(npm install typescript@*)',
|
|
48
50
|
'Bash(npm install @angular/*)',
|
|
@@ -59,11 +61,14 @@ exports.CLI_ALLOWED_COMMANDS = [
|
|
|
59
61
|
'Bash(npm pkg *)',
|
|
60
62
|
'Bash(npm pkg get *)',
|
|
61
63
|
// === Build & Test ===
|
|
62
|
-
'Bash(npm run build
|
|
64
|
+
'Bash(npm run build)',
|
|
65
|
+
'Bash(npm run build *)',
|
|
63
66
|
'Bash(npm run build:*)',
|
|
64
|
-
'Bash(npm test
|
|
67
|
+
'Bash(npm test)',
|
|
68
|
+
'Bash(npm test *)',
|
|
65
69
|
'Bash(npm test:*)',
|
|
66
|
-
'Bash(npm run test
|
|
70
|
+
'Bash(npm run test)',
|
|
71
|
+
'Bash(npm run test *)',
|
|
67
72
|
'Bash(npm run test:*)',
|
|
68
73
|
'Bash(npm ls *)',
|
|
69
74
|
'Bash(npm view*)',
|
|
@@ -91,15 +96,21 @@ exports.CLI_ALLOWED_COMMANDS = [
|
|
|
91
96
|
'Bash(git checkout -b *)',
|
|
92
97
|
'Bash(git add *)',
|
|
93
98
|
"Bash(git commit*)",
|
|
99
|
+
"Bash(git commit:*)",
|
|
94
100
|
'Bash(git push *)',
|
|
95
101
|
'Bash(git push -u *)',
|
|
96
102
|
// === Nx / Angular - Versions ===
|
|
97
103
|
'Bash(npx nx --version)',
|
|
98
104
|
// === AST Engine ===
|
|
105
|
+
'Bash(npx @silvestv/migration-planificator)',
|
|
99
106
|
'Bash(npx @silvestv/migration-planificator *)',
|
|
100
|
-
// === FileSystem
|
|
107
|
+
// === FileSystem Operations ===
|
|
101
108
|
'Bash(ls *)',
|
|
109
|
+
'Bash(pwd)',
|
|
102
110
|
'Bash(pwd *)',
|
|
111
|
+
'Bash(mkdir *)',
|
|
112
|
+
'Bash(mkdir -p *)',
|
|
113
|
+
'Bash(cat *)',
|
|
103
114
|
// === Web Search - Angular Documentation ===
|
|
104
115
|
'WebFetch(domain:angular.dev)',
|
|
105
116
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silvestv/migration-planificator",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3",
|
|
4
4
|
"description": "Professional Angular migration analysis tool with AST precision for version upgrades (17→18, 18→19, 19→20, 20→21), Nx monorepo refactoring, workload estimation, and technical debt assessment. Interactive HTML reports with Gantt timeline and real-time editing.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"publishConfig": {
|