@configjs/cli 1.1.0 → 1.1.1
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.1.
|
|
8
|
+
var version = "1.1.1";
|
|
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-UTFQ545S.js");
|
|
17
17
|
await installReact(options);
|
|
18
18
|
} catch (error) {
|
|
19
19
|
console.error("Error:", error);
|
|
@@ -382,13 +382,41 @@ var Installer = class {
|
|
|
382
382
|
logger.info(`Starting installation of ${plugins.length} plugin(s)`);
|
|
383
383
|
try {
|
|
384
384
|
await this.tracker.load();
|
|
385
|
-
const
|
|
386
|
-
const
|
|
385
|
+
const notInstalledPromises = plugins.map(async (p) => {
|
|
386
|
+
const isTracked = this.tracker.isInstalled(p.name);
|
|
387
|
+
const isDetected = p.detect ? await p.detect(this.ctx) : false;
|
|
388
|
+
const isInstalled = isTracked || isDetected;
|
|
387
389
|
if (isInstalled) {
|
|
388
390
|
logger.info(`${p.displayName} is already installed, skipping...`);
|
|
391
|
+
if (isDetected && !isTracked) {
|
|
392
|
+
logger.debug(
|
|
393
|
+
`${p.displayName} detected but not tracked, adding to tracker...`
|
|
394
|
+
);
|
|
395
|
+
try {
|
|
396
|
+
await this.tracker.addPlugin({
|
|
397
|
+
name: p.name,
|
|
398
|
+
displayName: p.displayName,
|
|
399
|
+
category: p.category,
|
|
400
|
+
version: p.version,
|
|
401
|
+
packages: {
|
|
402
|
+
dependencies: [],
|
|
403
|
+
devDependencies: []
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
} catch (error) {
|
|
407
|
+
logger.warn(
|
|
408
|
+
`Failed to add ${p.displayName} to tracker: ${error instanceof Error ? error.message : String(error)}`
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return null;
|
|
389
413
|
}
|
|
390
|
-
return
|
|
414
|
+
return p;
|
|
391
415
|
});
|
|
416
|
+
const notInstalledResults = await Promise.all(notInstalledPromises);
|
|
417
|
+
const notInstalled = notInstalledResults.filter(
|
|
418
|
+
(p) => p !== null
|
|
419
|
+
);
|
|
392
420
|
if (notInstalled.length === 0) {
|
|
393
421
|
logger.info("All plugins are already installed");
|
|
394
422
|
return {
|