@configjs/cli 1.0.5 → 1.0.7
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/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import "./chunk-QGM4M3NI.js";
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
|
|
7
7
|
// package.json
|
|
8
|
-
var version = "1.0.
|
|
8
|
+
var version = "1.0.7";
|
|
9
9
|
|
|
10
10
|
// src/cli.ts
|
|
11
11
|
var program = new Command();
|
|
@@ -13,7 +13,7 @@ program.name("confjs").description("Configure your frontend stack, instantly").v
|
|
|
13
13
|
program.command("react").description("Configure a React project").option("-y, --yes", "Accept all defaults").option("-d, --dry-run", "Simulate without writing to disk").option("-s, --silent", "Non-interactive mode").option("--debug", "Enable debug logs").option("-c, --config <file>", "Use configuration file").option("-f, --force", "Force installation (overwrite configs)").option("--no-install", "Generate configs only, skip package installation").action(
|
|
14
14
|
async (options) => {
|
|
15
15
|
try {
|
|
16
|
-
const { installReact } = await import("./install-
|
|
16
|
+
const { installReact } = await import("./install-MRYZACCX.js");
|
|
17
17
|
await installReact(options);
|
|
18
18
|
} catch (error) {
|
|
19
19
|
console.error("Error:", error);
|
|
@@ -558,15 +558,16 @@ var Installer = class {
|
|
|
558
558
|
*/
|
|
559
559
|
async installPackages(plugins) {
|
|
560
560
|
const results = [];
|
|
561
|
-
const
|
|
561
|
+
for (const plugin of plugins) {
|
|
562
562
|
try {
|
|
563
563
|
if (plugin.detect && await plugin.detect(this.ctx)) {
|
|
564
564
|
logger.debug(`${plugin.displayName} is already installed`);
|
|
565
|
-
|
|
565
|
+
results.push({
|
|
566
566
|
packages: {},
|
|
567
567
|
success: true,
|
|
568
568
|
message: "Already installed"
|
|
569
|
-
};
|
|
569
|
+
});
|
|
570
|
+
continue;
|
|
570
571
|
}
|
|
571
572
|
if (plugin.preInstall) {
|
|
572
573
|
await plugin.preInstall(this.ctx);
|
|
@@ -575,22 +576,20 @@ var Installer = class {
|
|
|
575
576
|
if (plugin.postInstall) {
|
|
576
577
|
await plugin.postInstall(this.ctx);
|
|
577
578
|
}
|
|
578
|
-
|
|
579
|
+
results.push(result);
|
|
579
580
|
} catch (error) {
|
|
580
581
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
581
582
|
logger.error(`Failed to install ${plugin.displayName}: ${errorMessage}`);
|
|
582
|
-
|
|
583
|
+
results.push({
|
|
583
584
|
packages: {},
|
|
584
585
|
success: false,
|
|
585
586
|
message: errorMessage
|
|
586
|
-
};
|
|
587
|
+
});
|
|
587
588
|
}
|
|
588
|
-
}
|
|
589
|
-
const installResults = await Promise.all(installPromises);
|
|
590
|
-
results.push(...installResults);
|
|
589
|
+
}
|
|
591
590
|
const allDependencies = [];
|
|
592
591
|
const allDevDependencies = [];
|
|
593
|
-
for (const result of
|
|
592
|
+
for (const result of results) {
|
|
594
593
|
if (result.success && result.packages) {
|
|
595
594
|
if (result.packages.dependencies) {
|
|
596
595
|
allDependencies.push(...result.packages.dependencies);
|
|
@@ -600,21 +599,26 @@ var Installer = class {
|
|
|
600
599
|
}
|
|
601
600
|
}
|
|
602
601
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
602
|
+
const allPackagesToInstall = [...allDependencies, ...allDevDependencies];
|
|
603
|
+
if (allPackagesToInstall.length > 0) {
|
|
604
|
+
const depsToInstall = allDependencies;
|
|
605
|
+
const devDepsToInstall = allDevDependencies;
|
|
606
|
+
if (depsToInstall.length > 0) {
|
|
607
|
+
await installPackages(depsToInstall, {
|
|
608
|
+
packageManager: this.ctx.packageManager,
|
|
609
|
+
projectRoot: this.ctx.projectRoot,
|
|
610
|
+
dev: false,
|
|
611
|
+
silent: false
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
if (devDepsToInstall.length > 0) {
|
|
615
|
+
await installPackages(devDepsToInstall, {
|
|
616
|
+
packageManager: this.ctx.packageManager,
|
|
617
|
+
projectRoot: this.ctx.projectRoot,
|
|
618
|
+
dev: true,
|
|
619
|
+
silent: false
|
|
620
|
+
});
|
|
621
|
+
}
|
|
618
622
|
}
|
|
619
623
|
return results;
|
|
620
624
|
}
|