@configjs/cli 1.1.7 → 1.1.9
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/README.fr.md +31 -9
- package/README.md +31 -9
- package/dist/{check-QX4VFU73.js → check-IOMRDWLB.js} +5 -4
- package/dist/{chunk-MQV3WNMH.js → chunk-6GV4NKUX.js} +11 -3
- package/dist/{chunk-HKNOLXCV.js → chunk-6WWDHX4E.js} +799 -728
- package/dist/{chunk-GVI6UQX2.js → chunk-ABHFQM5U.js} +113 -108
- package/dist/{chunk-NLTJ6GYH.js → chunk-ATUTE7PE.js} +7 -5
- package/dist/{chunk-HM2JWJOO.js → chunk-FIB2J36N.js} +4 -81
- package/dist/chunk-QPEUT7QG.js +157 -0
- package/dist/{chunk-TVZWTKJU.js → chunk-WHV4KF4U.js} +28 -18
- package/dist/cli.js +12 -8
- package/dist/{installed-WA6I2IFD.js → installed-LZE6LH7A.js} +4 -3
- package/dist/{list-GGH3SFER.js → list-TDMIAZPQ.js} +4 -3
- package/dist/{nextjs-command-LA245VK4.js → nextjs-command-W53FZE7U.js} +7 -6
- package/dist/{nextjs-installer-5C3VBCZE.js → nextjs-installer-TJXAUIQK.js} +4 -2
- package/dist/{react-command-3WUUJZBW.js → react-command-NHCD2L7R.js} +7 -6
- package/dist/{remove-JBICRDXX.js → remove-XQBB4NC3.js} +4 -3
- package/dist/{vite-installer-OPE53M3C.js → vite-installer-J7BO22KD.js} +4 -2
- package/dist/{vue-command-WPFTD5JM.js → vue-command-GYKDHJRJ.js} +7 -6
- package/dist/{vue-installer-LWQQCYOP.js → vue-installer-3AWLLT53.js} +4 -2
- package/package.json +1 -1
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompatibilityValidator,
|
|
3
3
|
allCompatibilityRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ATUTE7PE.js";
|
|
5
5
|
import {
|
|
6
6
|
BackupManager,
|
|
7
7
|
ConfigWriter,
|
|
8
8
|
getPluginsByCategory,
|
|
9
|
+
getRecommendedPlugins,
|
|
9
10
|
pluginRegistry
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6WWDHX4E.js";
|
|
11
12
|
import {
|
|
12
13
|
PluginTracker
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
installPackages
|
|
16
|
-
} from "./chunk-MQV3WNMH.js";
|
|
14
|
+
} from "./chunk-WHV4KF4U.js";
|
|
17
15
|
import {
|
|
16
|
+
getModuleLogger,
|
|
18
17
|
logger
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QPEUT7QG.js";
|
|
20
19
|
import {
|
|
21
20
|
getTranslations
|
|
22
21
|
} from "./chunk-QBMH2K7B.js";
|
|
@@ -38,7 +37,7 @@ var frameworkRegistry = {
|
|
|
38
37
|
return await promptViteSetup(language);
|
|
39
38
|
},
|
|
40
39
|
createProject: async (options, currentDir, language) => {
|
|
41
|
-
const { createViteProject } = await import("./vite-installer-
|
|
40
|
+
const { createViteProject } = await import("./vite-installer-J7BO22KD.js");
|
|
42
41
|
return await createViteProject(
|
|
43
42
|
options,
|
|
44
43
|
currentDir,
|
|
@@ -62,7 +61,7 @@ var frameworkRegistry = {
|
|
|
62
61
|
return await promptNextjsSetup(language);
|
|
63
62
|
},
|
|
64
63
|
createProject: async (options, currentDir, language) => {
|
|
65
|
-
const { createNextjsProject } = await import("./nextjs-installer-
|
|
64
|
+
const { createNextjsProject } = await import("./nextjs-installer-TJXAUIQK.js");
|
|
66
65
|
return await createNextjsProject(
|
|
67
66
|
options,
|
|
68
67
|
currentDir,
|
|
@@ -90,7 +89,7 @@ var frameworkRegistry = {
|
|
|
90
89
|
return await promptVueSetup(language);
|
|
91
90
|
},
|
|
92
91
|
createProject: async (options, currentDir, language) => {
|
|
93
|
-
const { createVueProject } = await import("./vue-installer-
|
|
92
|
+
const { createVueProject } = await import("./vue-installer-3AWLLT53.js");
|
|
94
93
|
return await createVueProject(
|
|
95
94
|
options,
|
|
96
95
|
currentDir,
|
|
@@ -278,18 +277,17 @@ var Installer = class {
|
|
|
278
277
|
/**
|
|
279
278
|
* @param ctx - Contexte du projet détecté
|
|
280
279
|
* @param validator - Validateur de compatibilité
|
|
281
|
-
* @param writer - Writer de configuration
|
|
282
280
|
* @param backupManager - Gestionnaire de backups
|
|
283
281
|
* @param fs - Système de fichiers optionnel (par défaut: filesystem réel via memfs.useAsNodeFs)
|
|
284
282
|
*/
|
|
285
|
-
constructor(ctx, validator,
|
|
283
|
+
constructor(ctx, validator, backupManager, _fs) {
|
|
286
284
|
this.ctx = ctx;
|
|
287
285
|
this.validator = validator;
|
|
288
|
-
this.writer = writer;
|
|
289
286
|
this.backupManager = backupManager;
|
|
290
287
|
this.tracker = new PluginTracker(ctx.projectRoot, ctx.fsAdapter);
|
|
291
288
|
}
|
|
292
289
|
tracker;
|
|
290
|
+
logger = getModuleLogger();
|
|
293
291
|
/**
|
|
294
292
|
* Installe un ensemble de plugins
|
|
295
293
|
*
|
|
@@ -306,7 +304,7 @@ var Installer = class {
|
|
|
306
304
|
*/
|
|
307
305
|
async install(plugins, options) {
|
|
308
306
|
const startTime = Date.now();
|
|
309
|
-
logger.info(`Starting installation of ${plugins.length} plugin(s)`);
|
|
307
|
+
this.logger.info(`Starting installation of ${plugins.length} plugin(s)`);
|
|
310
308
|
try {
|
|
311
309
|
await this.tracker.load();
|
|
312
310
|
const notInstalledPromises = plugins.map(async (p) => {
|
|
@@ -314,9 +312,9 @@ var Installer = class {
|
|
|
314
312
|
const isDetected = p.detect ? await p.detect(this.ctx) : false;
|
|
315
313
|
const isInstalled = isTracked || isDetected;
|
|
316
314
|
if (isInstalled) {
|
|
317
|
-
logger.info(`${p.displayName} is already installed, skipping...`);
|
|
315
|
+
this.logger.info(`${p.displayName} is already installed, skipping...`);
|
|
318
316
|
if (isDetected && !isTracked) {
|
|
319
|
-
logger.debug(
|
|
317
|
+
this.logger.debug(
|
|
320
318
|
`${p.displayName} detected but not tracked, adding to tracker...`
|
|
321
319
|
);
|
|
322
320
|
try {
|
|
@@ -331,7 +329,7 @@ var Installer = class {
|
|
|
331
329
|
}
|
|
332
330
|
});
|
|
333
331
|
} catch (error) {
|
|
334
|
-
logger.warn(
|
|
332
|
+
this.logger.warn(
|
|
335
333
|
`Failed to add ${p.displayName} to tracker: ${error instanceof Error ? error.message : String(error)}`
|
|
336
334
|
);
|
|
337
335
|
}
|
|
@@ -345,7 +343,7 @@ var Installer = class {
|
|
|
345
343
|
(p) => p !== null
|
|
346
344
|
);
|
|
347
345
|
if (notInstalled.length === 0) {
|
|
348
|
-
logger.info("All plugins are already installed");
|
|
346
|
+
this.logger.info("All plugins are already installed");
|
|
349
347
|
return {
|
|
350
348
|
success: true,
|
|
351
349
|
duration: Date.now() - startTime,
|
|
@@ -363,7 +361,7 @@ var Installer = class {
|
|
|
363
361
|
);
|
|
364
362
|
}
|
|
365
363
|
}
|
|
366
|
-
logger.debug("Validating plugins compatibility...");
|
|
364
|
+
this.logger.debug("Validating plugins compatibility...");
|
|
367
365
|
const validationResult = this.validator.validate(notInstalled, this.ctx);
|
|
368
366
|
if (!validationResult.valid) {
|
|
369
367
|
const errorMessages = validationResult.errors.map((e) => e.message).join("; ");
|
|
@@ -372,26 +370,27 @@ var Installer = class {
|
|
|
372
370
|
);
|
|
373
371
|
}
|
|
374
372
|
if (validationResult.warnings.length > 0) {
|
|
375
|
-
logger.warn(
|
|
373
|
+
this.logger.warn(
|
|
376
374
|
`Found ${validationResult.warnings.length} warning(s):`,
|
|
377
375
|
validationResult.warnings.map((w) => w.message)
|
|
378
376
|
);
|
|
379
377
|
}
|
|
380
|
-
logger.debug("Resolving dependencies...");
|
|
378
|
+
this.logger.debug("Resolving dependencies...");
|
|
381
379
|
const resolved = this.resolveDependencies(notInstalled);
|
|
382
380
|
const allPlugins = resolved.plugins;
|
|
383
381
|
if (resolved.autoInstalled.length > 0) {
|
|
384
|
-
logger.info(
|
|
382
|
+
this.logger.info(
|
|
385
383
|
`Auto-installing ${resolved.autoInstalled.length} required dependency(ies): ${resolved.autoInstalled.join(", ")}`
|
|
386
384
|
);
|
|
387
385
|
}
|
|
388
|
-
logger.debug("Running pre-install hooks...");
|
|
386
|
+
this.logger.debug("Running pre-install hooks...");
|
|
389
387
|
await this.runPreInstallHooks(allPlugins);
|
|
388
|
+
let installResults = [];
|
|
390
389
|
if (options?.skipPackageInstall) {
|
|
391
|
-
logger.info("Skipping package installation (--no-install mode)");
|
|
390
|
+
this.logger.info("Skipping package installation (--no-install mode)");
|
|
392
391
|
} else {
|
|
393
|
-
logger.debug("Installing packages...");
|
|
394
|
-
|
|
392
|
+
this.logger.debug("Installing packages...");
|
|
393
|
+
installResults = await this.installPackages(allPlugins);
|
|
395
394
|
const failedInstalls = installResults.filter((r) => !r.success);
|
|
396
395
|
if (failedInstalls.length > 0) {
|
|
397
396
|
throw new Error(
|
|
@@ -399,12 +398,12 @@ var Installer = class {
|
|
|
399
398
|
);
|
|
400
399
|
}
|
|
401
400
|
}
|
|
402
|
-
logger.debug("Configuring plugins...");
|
|
401
|
+
this.logger.debug("Configuring plugins...");
|
|
403
402
|
const configResults = [];
|
|
404
403
|
const filesCreated = [];
|
|
405
404
|
for (const plugin of allPlugins) {
|
|
406
405
|
try {
|
|
407
|
-
logger.debug(`Configuring ${plugin.displayName}...`);
|
|
406
|
+
this.logger.debug(`Configuring ${plugin.displayName}...`);
|
|
408
407
|
const configResult = await plugin.configure(this.ctx);
|
|
409
408
|
configResults.push(configResult);
|
|
410
409
|
filesCreated.push(...configResult.files || []);
|
|
@@ -415,30 +414,39 @@ var Installer = class {
|
|
|
415
414
|
}
|
|
416
415
|
} catch (error) {
|
|
417
416
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
418
|
-
logger.error(
|
|
417
|
+
this.logger.error(
|
|
419
418
|
`Configuration failed for ${plugin.displayName}: ${errorMessage}`
|
|
420
419
|
);
|
|
421
420
|
throw error;
|
|
422
421
|
}
|
|
423
422
|
}
|
|
424
|
-
logger.debug("Running post-install hooks...");
|
|
423
|
+
this.logger.debug("Running post-install hooks...");
|
|
425
424
|
await this.runPostInstallHooks(allPlugins);
|
|
426
|
-
logger.debug("Tracking installed plugins...");
|
|
425
|
+
this.logger.debug("Tracking installed plugins...");
|
|
426
|
+
const installResultsByName = /* @__PURE__ */ new Map();
|
|
427
|
+
for (let i = 0; i < allPlugins.length; i++) {
|
|
428
|
+
const plugin = allPlugins[i];
|
|
429
|
+
const result = installResults[i];
|
|
430
|
+
if (plugin && result) {
|
|
431
|
+
installResultsByName.set(plugin.name, result);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
427
434
|
for (const plugin of allPlugins) {
|
|
435
|
+
const installResult = installResultsByName.get(plugin.name);
|
|
428
436
|
await this.tracker.addPlugin({
|
|
429
437
|
name: plugin.name,
|
|
430
438
|
displayName: plugin.displayName,
|
|
431
439
|
category: plugin.category,
|
|
432
440
|
version: plugin.version,
|
|
433
441
|
packages: {
|
|
434
|
-
dependencies: [],
|
|
435
|
-
devDependencies: []
|
|
442
|
+
dependencies: installResult?.packages.dependencies ?? [],
|
|
443
|
+
devDependencies: installResult?.packages.devDependencies ?? []
|
|
436
444
|
}
|
|
437
445
|
});
|
|
438
446
|
}
|
|
439
447
|
const duration = Date.now() - startTime;
|
|
440
448
|
const installed = allPlugins.map((p) => p.name);
|
|
441
|
-
logger.info(
|
|
449
|
+
this.logger.info(
|
|
442
450
|
`Successfully installed ${installed.length} plugin(s) in ${duration}ms`
|
|
443
451
|
);
|
|
444
452
|
return {
|
|
@@ -450,13 +458,13 @@ var Installer = class {
|
|
|
450
458
|
};
|
|
451
459
|
} catch (error) {
|
|
452
460
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
453
|
-
logger.error(`Installation failed: ${errorMessage}`);
|
|
454
|
-
logger.debug("Rolling back changes...");
|
|
461
|
+
this.logger.error(`Installation failed: ${errorMessage}`);
|
|
462
|
+
this.logger.debug("Rolling back changes...");
|
|
455
463
|
try {
|
|
456
464
|
await this.rollback(plugins);
|
|
457
465
|
} catch (rollbackError) {
|
|
458
466
|
const rollbackMessage = rollbackError instanceof Error ? rollbackError.message : String(rollbackError);
|
|
459
|
-
logger.error(`Rollback failed: ${rollbackMessage}`);
|
|
467
|
+
this.logger.error(`Rollback failed: ${rollbackMessage}`);
|
|
460
468
|
}
|
|
461
469
|
const duration = Date.now() - startTime;
|
|
462
470
|
return {
|
|
@@ -491,7 +499,7 @@ var Installer = class {
|
|
|
491
499
|
}
|
|
492
500
|
for (const required of plugin.requires) {
|
|
493
501
|
if (!pluginMap.has(required)) {
|
|
494
|
-
logger.warn(
|
|
502
|
+
this.logger.warn(
|
|
495
503
|
`Plugin ${plugin.name} requires ${required}, but it's not available in the registry`
|
|
496
504
|
);
|
|
497
505
|
}
|
|
@@ -516,7 +524,7 @@ var Installer = class {
|
|
|
516
524
|
for (const plugin of plugins) {
|
|
517
525
|
try {
|
|
518
526
|
if (plugin.detect && await plugin.detect(this.ctx)) {
|
|
519
|
-
logger.debug(`${plugin.displayName} is already installed`);
|
|
527
|
+
this.logger.debug(`${plugin.displayName} is already installed`);
|
|
520
528
|
results.push({
|
|
521
529
|
packages: {},
|
|
522
530
|
success: true,
|
|
@@ -524,17 +532,13 @@ var Installer = class {
|
|
|
524
532
|
});
|
|
525
533
|
continue;
|
|
526
534
|
}
|
|
527
|
-
if (plugin.preInstall) {
|
|
528
|
-
await plugin.preInstall(this.ctx);
|
|
529
|
-
}
|
|
530
535
|
const result = await plugin.install(this.ctx);
|
|
531
|
-
if (plugin.postInstall) {
|
|
532
|
-
await plugin.postInstall(this.ctx);
|
|
533
|
-
}
|
|
534
536
|
results.push(result);
|
|
535
537
|
} catch (error) {
|
|
536
538
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
537
|
-
logger.error(
|
|
539
|
+
this.logger.error(
|
|
540
|
+
`Failed to install ${plugin.displayName}: ${errorMessage}`
|
|
541
|
+
);
|
|
538
542
|
results.push({
|
|
539
543
|
packages: {},
|
|
540
544
|
success: false,
|
|
@@ -542,39 +546,6 @@ var Installer = class {
|
|
|
542
546
|
});
|
|
543
547
|
}
|
|
544
548
|
}
|
|
545
|
-
const allDependencies = [];
|
|
546
|
-
const allDevDependencies = [];
|
|
547
|
-
for (const result of results) {
|
|
548
|
-
if (result.success && result.packages) {
|
|
549
|
-
if (result.packages.dependencies) {
|
|
550
|
-
allDependencies.push(...result.packages.dependencies);
|
|
551
|
-
}
|
|
552
|
-
if (result.packages.devDependencies) {
|
|
553
|
-
allDevDependencies.push(...result.packages.devDependencies);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
const allPackagesToInstall = [...allDependencies, ...allDevDependencies];
|
|
558
|
-
if (allPackagesToInstall.length > 0) {
|
|
559
|
-
const depsToInstall = allDependencies;
|
|
560
|
-
const devDepsToInstall = allDevDependencies;
|
|
561
|
-
if (depsToInstall.length > 0) {
|
|
562
|
-
await installPackages(depsToInstall, {
|
|
563
|
-
packageManager: this.ctx.packageManager,
|
|
564
|
-
projectRoot: this.ctx.projectRoot,
|
|
565
|
-
dev: false,
|
|
566
|
-
silent: false
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
if (devDepsToInstall.length > 0) {
|
|
570
|
-
await installPackages(devDepsToInstall, {
|
|
571
|
-
packageManager: this.ctx.packageManager,
|
|
572
|
-
projectRoot: this.ctx.projectRoot,
|
|
573
|
-
dev: true,
|
|
574
|
-
silent: false
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
549
|
return results;
|
|
579
550
|
}
|
|
580
551
|
/**
|
|
@@ -591,7 +562,7 @@ var Installer = class {
|
|
|
591
562
|
await plugin.preInstall(this.ctx);
|
|
592
563
|
} catch (error) {
|
|
593
564
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
594
|
-
logger.warn(
|
|
565
|
+
this.logger.warn(
|
|
595
566
|
`Pre-install hook failed for ${plugin.displayName}: ${errorMessage}`
|
|
596
567
|
);
|
|
597
568
|
}
|
|
@@ -612,7 +583,7 @@ var Installer = class {
|
|
|
612
583
|
await plugin.postInstall(this.ctx);
|
|
613
584
|
} catch (error) {
|
|
614
585
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
615
|
-
logger.warn(
|
|
586
|
+
this.logger.warn(
|
|
616
587
|
`Post-install hook failed for ${plugin.displayName}: ${errorMessage}`
|
|
617
588
|
);
|
|
618
589
|
}
|
|
@@ -627,15 +598,15 @@ var Installer = class {
|
|
|
627
598
|
* @internal
|
|
628
599
|
*/
|
|
629
600
|
async rollback(plugins) {
|
|
630
|
-
logger.debug("Starting rollback...");
|
|
601
|
+
this.logger.debug("Starting rollback...");
|
|
631
602
|
for (const plugin of plugins.reverse()) {
|
|
632
603
|
if (plugin.rollback) {
|
|
633
604
|
try {
|
|
634
605
|
await plugin.rollback(this.ctx);
|
|
635
|
-
logger.debug(`Rolled back ${plugin.displayName}`);
|
|
606
|
+
this.logger.debug(`Rolled back ${plugin.displayName}`);
|
|
636
607
|
} catch (error) {
|
|
637
608
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
638
|
-
logger.error(
|
|
609
|
+
this.logger.error(
|
|
639
610
|
`Rollback failed for ${plugin.displayName}: ${errorMessage}`
|
|
640
611
|
);
|
|
641
612
|
}
|
|
@@ -643,10 +614,10 @@ var Installer = class {
|
|
|
643
614
|
}
|
|
644
615
|
try {
|
|
645
616
|
await this.backupManager.restoreAll();
|
|
646
|
-
logger.debug("Restored all file backups");
|
|
617
|
+
this.logger.debug("Restored all file backups");
|
|
647
618
|
} catch (error) {
|
|
648
619
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
649
|
-
logger.error(`Failed to restore backups: ${errorMessage}`);
|
|
620
|
+
this.logger.error(`Failed to restore backups: ${errorMessage}`);
|
|
650
621
|
}
|
|
651
622
|
}
|
|
652
623
|
};
|
|
@@ -836,7 +807,10 @@ var BaseFrameworkCommand = class {
|
|
|
836
807
|
* @param ctx - Contexte du projet
|
|
837
808
|
* @param _t - Traductions
|
|
838
809
|
*/
|
|
839
|
-
displayFrameworkMismatchWarning(ctx, _t) {
|
|
810
|
+
displayFrameworkMismatchWarning(ctx, _t, silent) {
|
|
811
|
+
if (silent) {
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
840
814
|
const framework = this.getFramework();
|
|
841
815
|
const metadata = getFrameworkMetadata(framework);
|
|
842
816
|
console.log();
|
|
@@ -858,7 +832,10 @@ var BaseFrameworkCommand = class {
|
|
|
858
832
|
* @param ctx - Contexte du projet
|
|
859
833
|
* @param t - Traductions
|
|
860
834
|
*/
|
|
861
|
-
displayDetectedContext(ctx, t) {
|
|
835
|
+
displayDetectedContext(ctx, t, silent) {
|
|
836
|
+
if (silent) {
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
862
839
|
console.log(
|
|
863
840
|
pc2.green(` \u2713 ${t.detection.framework}: `) + pc2.bold(`${ctx.framework} ${pc2.gray(ctx.frameworkVersion)}`)
|
|
864
841
|
);
|
|
@@ -885,9 +862,12 @@ var BaseFrameworkCommand = class {
|
|
|
885
862
|
* @returns Liste des plugins sélectionnés
|
|
886
863
|
*/
|
|
887
864
|
async selectPlugins(ctx, language, options) {
|
|
888
|
-
if (options.yes) {
|
|
889
|
-
|
|
890
|
-
|
|
865
|
+
if (options.yes || options.silent) {
|
|
866
|
+
const recommended = getRecommendedPlugins(ctx);
|
|
867
|
+
if (!options.silent) {
|
|
868
|
+
logger.info("Using default recommendations (--yes mode)");
|
|
869
|
+
}
|
|
870
|
+
return recommended;
|
|
891
871
|
}
|
|
892
872
|
return promptPluginSelection(ctx, pluginRegistry, language);
|
|
893
873
|
}
|
|
@@ -915,6 +895,9 @@ var BaseFrameworkCommand = class {
|
|
|
915
895
|
if (!options.dryRun) {
|
|
916
896
|
return false;
|
|
917
897
|
}
|
|
898
|
+
if (options.silent) {
|
|
899
|
+
return true;
|
|
900
|
+
}
|
|
918
901
|
console.log();
|
|
919
902
|
console.log(pc2.bold(pc2.yellow("\u2501".repeat(60))));
|
|
920
903
|
console.log(pc2.bold(pc2.yellow("\u{1F50D} MODE DRY-RUN (simulation uniquement)")));
|
|
@@ -956,7 +939,12 @@ var BaseFrameworkCommand = class {
|
|
|
956
939
|
const backupManager = new BackupManager();
|
|
957
940
|
const configWriter = new ConfigWriter(backupManager);
|
|
958
941
|
const validator = new CompatibilityValidator(allCompatibilityRules);
|
|
959
|
-
const
|
|
942
|
+
const ctxWithServices = {
|
|
943
|
+
...ctx,
|
|
944
|
+
backupManager,
|
|
945
|
+
configWriter
|
|
946
|
+
};
|
|
947
|
+
const installer = new Installer(ctxWithServices, validator, backupManager);
|
|
960
948
|
if (options.install === false) {
|
|
961
949
|
console.log();
|
|
962
950
|
console.log(pc2.yellow("\u2699\uFE0F Mode configuration uniquement (--no-install)"));
|
|
@@ -998,37 +986,52 @@ ${t.installation.error}`);
|
|
|
998
986
|
*/
|
|
999
987
|
async execute(options) {
|
|
1000
988
|
try {
|
|
1001
|
-
|
|
989
|
+
if (options.silent) {
|
|
990
|
+
logger.setLevel(4 /* SILENT */);
|
|
991
|
+
} else if (options.debug) {
|
|
992
|
+
logger.setLevel(0 /* DEBUG */);
|
|
993
|
+
} else {
|
|
994
|
+
logger.setLevel(1 /* INFO */);
|
|
995
|
+
}
|
|
996
|
+
const language = options.silent ? "en" : await promptLanguage();
|
|
1002
997
|
const t = getTranslations(language);
|
|
1003
|
-
|
|
1004
|
-
|
|
998
|
+
if (!options.silent) {
|
|
999
|
+
console.log();
|
|
1000
|
+
console.log(pc2.bold(pc2.cyan(`\u{1F50D} ${t.detection.detecting}`)));
|
|
1001
|
+
}
|
|
1005
1002
|
const projectRoot = process.cwd();
|
|
1006
1003
|
const ctx = await this.getOrCreateContext(projectRoot, language);
|
|
1007
1004
|
if (!this.validateFramework(ctx)) {
|
|
1008
|
-
this.displayFrameworkMismatchWarning(ctx, t);
|
|
1005
|
+
this.displayFrameworkMismatchWarning(ctx, t, Boolean(options.silent));
|
|
1009
1006
|
return;
|
|
1010
1007
|
}
|
|
1011
|
-
this.displayDetectedContext(ctx, t);
|
|
1008
|
+
this.displayDetectedContext(ctx, t, Boolean(options.silent));
|
|
1012
1009
|
const selectedPlugins = await this.selectPlugins(ctx, language, options);
|
|
1013
1010
|
if (selectedPlugins.length === 0) {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1011
|
+
if (!options.silent) {
|
|
1012
|
+
console.log();
|
|
1013
|
+
console.log(pc2.yellow(`\u26A0\uFE0F ${t.common.selected(0)}`));
|
|
1014
|
+
console.log(pc2.gray("Exiting..."));
|
|
1015
|
+
}
|
|
1017
1016
|
return;
|
|
1018
1017
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1018
|
+
if (!options.silent) {
|
|
1019
|
+
console.log();
|
|
1020
|
+
console.log(
|
|
1021
|
+
pc2.bold(pc2.green(`\u2713 ${t.common.selected(selectedPlugins.length)}`))
|
|
1022
|
+
);
|
|
1023
|
+
console.log();
|
|
1024
|
+
}
|
|
1024
1025
|
const confirmed = await this.confirmInstallation(
|
|
1025
1026
|
selectedPlugins,
|
|
1026
1027
|
language,
|
|
1027
1028
|
options
|
|
1028
1029
|
);
|
|
1029
1030
|
if (!confirmed) {
|
|
1030
|
-
|
|
1031
|
-
|
|
1031
|
+
if (!options.silent) {
|
|
1032
|
+
console.log();
|
|
1033
|
+
console.log(pc2.gray(t.common.cancel));
|
|
1034
|
+
}
|
|
1032
1035
|
return;
|
|
1033
1036
|
}
|
|
1034
1037
|
if (this.handleDryRun(selectedPlugins, options)) {
|
|
@@ -1038,7 +1041,9 @@ ${t.installation.error}`);
|
|
|
1038
1041
|
} catch (error) {
|
|
1039
1042
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1040
1043
|
logger.error(`Fatal error: ${errorMessage}`);
|
|
1041
|
-
|
|
1044
|
+
if (!options.silent) {
|
|
1045
|
+
console.error("Fatal error:", errorMessage);
|
|
1046
|
+
}
|
|
1042
1047
|
process.exit(1);
|
|
1043
1048
|
}
|
|
1044
1049
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6WWDHX4E.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
getModuleLogger
|
|
6
|
+
} from "./chunk-QPEUT7QG.js";
|
|
7
7
|
|
|
8
8
|
// src/core/compatibility-generator.ts
|
|
9
|
+
var logger = getModuleLogger();
|
|
9
10
|
function generateCompatibilityRules(plugins) {
|
|
10
11
|
logger.debug(
|
|
11
12
|
`Generating compatibility rules from ${plugins.length} plugin(s)`
|
|
@@ -165,6 +166,7 @@ var CompatibilityValidator = class {
|
|
|
165
166
|
constructor(rules) {
|
|
166
167
|
this.rules = rules;
|
|
167
168
|
}
|
|
169
|
+
logger = getModuleLogger();
|
|
168
170
|
/**
|
|
169
171
|
* Valide la compatibilité d'un ensemble de plugins
|
|
170
172
|
*
|
|
@@ -181,7 +183,7 @@ var CompatibilityValidator = class {
|
|
|
181
183
|
* ```
|
|
182
184
|
*/
|
|
183
185
|
validate(plugins, ctx) {
|
|
184
|
-
logger.debug(`Validating ${plugins.length} plugin(s)`);
|
|
186
|
+
this.logger.debug(`Validating ${plugins.length} plugin(s)`);
|
|
185
187
|
const pluginNames = new Set(plugins.map((p) => p.name));
|
|
186
188
|
const applicableRules = ctx ? this.rules.filter(
|
|
187
189
|
(rule) => !rule.framework || rule.framework === ctx.framework
|
|
@@ -250,7 +252,7 @@ var CompatibilityValidator = class {
|
|
|
250
252
|
applicableRules
|
|
251
253
|
);
|
|
252
254
|
const valid = errors.length === 0;
|
|
253
|
-
logger.debug(`Validation result: ${valid ? "valid" : "invalid"}`, {
|
|
255
|
+
this.logger.debug(`Validation result: ${valid ? "valid" : "invalid"}`, {
|
|
254
256
|
errors: errors.length,
|
|
255
257
|
warnings: warnings.length,
|
|
256
258
|
suggestions: suggestions.length
|
|
@@ -1,83 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
level = 1 /* INFO */;
|
|
5
|
-
setLevel(level) {
|
|
6
|
-
this.level = level;
|
|
7
|
-
}
|
|
8
|
-
debug(message, ...args) {
|
|
9
|
-
if (this.level <= 0 /* DEBUG */) {
|
|
10
|
-
console.log(pc.gray(`[DEBUG] ${message}`), ...args);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
info(message, ...args) {
|
|
14
|
-
if (this.level <= 1 /* INFO */) {
|
|
15
|
-
console.log(pc.cyan(`\u2139 ${message}`), ...args);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
success(message, ...args) {
|
|
19
|
-
if (this.level <= 1 /* INFO */) {
|
|
20
|
-
console.log(pc.green(`\u2713 ${message}`), ...args);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
warn(message, ...args) {
|
|
24
|
-
if (this.level <= 2 /* WARN */) {
|
|
25
|
-
console.warn(pc.yellow(`\u26A0\uFE0F ${message}`), ...args);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
error(message, ...args) {
|
|
29
|
-
if (this.level <= 3 /* ERROR */) {
|
|
30
|
-
console.error(pc.red(`\u2716 ${message}`), ...args);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
header(message) {
|
|
34
|
-
if (this.level <= 1 /* INFO */) {
|
|
35
|
-
console.log();
|
|
36
|
-
console.log(pc.bold(pc.magenta(`\u25C6 ${message}`)));
|
|
37
|
-
console.log();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
section(title) {
|
|
41
|
-
if (this.level <= 1 /* INFO */) {
|
|
42
|
-
console.log();
|
|
43
|
-
console.log(pc.bold(pc.cyan(`\u25B8 ${title}`)));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
item(message, color = "gray") {
|
|
47
|
-
if (this.level <= 1 /* INFO */) {
|
|
48
|
-
const colorFn = pc[color];
|
|
49
|
-
console.log(colorFn(` \u2022 ${message}`));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
dim(message) {
|
|
53
|
-
if (this.level <= 1 /* INFO */) {
|
|
54
|
-
console.log(pc.gray(` ${message}`));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
step(message) {
|
|
58
|
-
if (this.level <= 1 /* INFO */) {
|
|
59
|
-
console.log(pc.cyan(`
|
|
60
|
-
\u2192 ${message}`));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
box(title, content) {
|
|
64
|
-
if (this.level <= 1 /* INFO */) {
|
|
65
|
-
const maxLength = Math.max(
|
|
66
|
-
title.length,
|
|
67
|
-
...content.map((line) => line.length)
|
|
68
|
-
);
|
|
69
|
-
const border = "\u2500".repeat(maxLength + 4);
|
|
70
|
-
console.log(pc.cyan(`\u250C${border}\u2510`));
|
|
71
|
-
console.log(pc.cyan(`\u2502 ${title.padEnd(maxLength)} \u2502`));
|
|
72
|
-
console.log(pc.cyan(`\u251C${border}\u2524`));
|
|
73
|
-
content.forEach((line) => {
|
|
74
|
-
console.log(pc.cyan(`\u2502 ${line.padEnd(maxLength)} \u2502`));
|
|
75
|
-
});
|
|
76
|
-
console.log(pc.cyan(`\u2514${border}\u2518`));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
var logger = new Logger();
|
|
1
|
+
import {
|
|
2
|
+
getModuleLogger
|
|
3
|
+
} from "./chunk-QPEUT7QG.js";
|
|
81
4
|
|
|
82
5
|
// src/utils/fs-helpers.ts
|
|
83
6
|
import { resolve as resolve2, dirname as dirname2, extname } from "path";
|
|
@@ -300,6 +223,7 @@ function createDefaultFsAdapter() {
|
|
|
300
223
|
}
|
|
301
224
|
|
|
302
225
|
// src/utils/fs-helpers.ts
|
|
226
|
+
var logger = getModuleLogger();
|
|
303
227
|
function normalizePath(path) {
|
|
304
228
|
return path.replace(/\\/g, "/");
|
|
305
229
|
}
|
|
@@ -405,7 +329,6 @@ async function writeFileContent(filePath, content, encoding = "utf-8", fsAdapter
|
|
|
405
329
|
}
|
|
406
330
|
|
|
407
331
|
export {
|
|
408
|
-
logger,
|
|
409
332
|
createDefaultFsAdapter,
|
|
410
333
|
normalizePath,
|
|
411
334
|
readPackageJson,
|