@configjs/cli 1.0.7 → 1.0.8
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/{check-4Y5YGVVD.js → check-2TRO5TLL.js} +3 -3
- package/dist/{chunk-UB6NBZEM.js → chunk-EFP4AZE6.js} +1 -1
- package/dist/{chunk-AMLNK7QR.js → chunk-QDVUNUTK.js} +1 -1
- package/dist/{chunk-5S5KGCVY.js → chunk-QRFLHLFE.js} +26 -2
- package/dist/{chunk-G5QBS6TL.js → chunk-VJ254HJY.js} +1 -1
- package/dist/cli.js +6 -6
- package/dist/{install-MRYZACCX.js → install-J2GB2RDX.js} +78 -51
- package/dist/{installed-BXP7ZWOU.js → installed-G2RXXXZ6.js} +2 -2
- package/dist/{list-HKDWBO2I.js → list-KFWAHR6Z.js} +2 -2
- package/dist/{remove-ZZD67W4M.js → remove-QDF5BA6U.js} +2 -2
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompatibilityValidator,
|
|
3
3
|
compatibilityRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VJ254HJY.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginRegistry
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EFP4AZE6.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QRFLHLFE.js";
|
|
11
11
|
import "./chunk-QGM4M3NI.js";
|
|
12
12
|
|
|
13
13
|
// src/cli/commands/check.ts
|
|
@@ -12,7 +12,7 @@ var Logger = class {
|
|
|
12
12
|
}
|
|
13
13
|
info(message, ...args) {
|
|
14
14
|
if (this.level <= 1 /* INFO */) {
|
|
15
|
-
console.log(pc.
|
|
15
|
+
console.log(pc.cyan(`\u2139 ${message}`), ...args);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
success(message, ...args) {
|
|
@@ -22,7 +22,7 @@ var Logger = class {
|
|
|
22
22
|
}
|
|
23
23
|
warn(message, ...args) {
|
|
24
24
|
if (this.level <= 2 /* WARN */) {
|
|
25
|
-
console.warn(pc.yellow(`\u26A0
|
|
25
|
+
console.warn(pc.yellow(`\u26A0\uFE0F ${message}`), ...args);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
error(message, ...args) {
|
|
@@ -30,6 +30,30 @@ var Logger = class {
|
|
|
30
30
|
console.error(pc.red(`\u2716 ${message}`), ...args);
|
|
31
31
|
}
|
|
32
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
|
+
}
|
|
33
57
|
step(message) {
|
|
34
58
|
if (this.level <= 1 /* INFO */) {
|
|
35
59
|
console.log(pc.cyan(`
|
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.8";
|
|
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-J2GB2RDX.js");
|
|
17
17
|
await installReact(options);
|
|
18
18
|
} catch (error) {
|
|
19
19
|
console.error("Error:", error);
|
|
@@ -23,7 +23,7 @@ program.command("react").description("Configure a React project").option("-y, --
|
|
|
23
23
|
);
|
|
24
24
|
program.command("list").description("List available libraries").option("-c, --category <category>", "Filter by category").action(async (options) => {
|
|
25
25
|
try {
|
|
26
|
-
const { listLibraries } = await import("./list-
|
|
26
|
+
const { listLibraries } = await import("./list-KFWAHR6Z.js");
|
|
27
27
|
listLibraries(options);
|
|
28
28
|
} catch (error) {
|
|
29
29
|
console.error("Error:", error);
|
|
@@ -32,7 +32,7 @@ program.command("list").description("List available libraries").option("-c, --ca
|
|
|
32
32
|
});
|
|
33
33
|
program.command("check").description("Check compatibility without installing").option("-c, --config <file>", "Configuration file to check").action(async (options) => {
|
|
34
34
|
try {
|
|
35
|
-
const { checkCompatibility } = await import("./check-
|
|
35
|
+
const { checkCompatibility } = await import("./check-2TRO5TLL.js");
|
|
36
36
|
await checkCompatibility(options);
|
|
37
37
|
} catch (error) {
|
|
38
38
|
console.error("Error:", error);
|
|
@@ -41,7 +41,7 @@ program.command("check").description("Check compatibility without installing").o
|
|
|
41
41
|
});
|
|
42
42
|
program.command("installed").description("List installed plugins").action(async () => {
|
|
43
43
|
try {
|
|
44
|
-
const { installedCommand } = await import("./installed-
|
|
44
|
+
const { installedCommand } = await import("./installed-G2RXXXZ6.js");
|
|
45
45
|
await installedCommand();
|
|
46
46
|
} catch (error) {
|
|
47
47
|
console.error("Error:", error);
|
|
@@ -50,7 +50,7 @@ program.command("installed").description("List installed plugins").action(async
|
|
|
50
50
|
});
|
|
51
51
|
program.command("remove <plugin>").description("Remove an installed plugin").action(async (plugin) => {
|
|
52
52
|
try {
|
|
53
|
-
const { removeCommand } = await import("./remove-
|
|
53
|
+
const { removeCommand } = await import("./remove-QDF5BA6U.js");
|
|
54
54
|
await removeCommand(plugin);
|
|
55
55
|
} catch (error) {
|
|
56
56
|
console.error("Error:", error);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompatibilityValidator,
|
|
3
3
|
compatibilityRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VJ254HJY.js";
|
|
5
5
|
import {
|
|
6
6
|
BackupManager,
|
|
7
7
|
ConfigWriter,
|
|
8
8
|
getPluginsByCategory,
|
|
9
9
|
pluginRegistry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EFP4AZE6.js";
|
|
11
11
|
import {
|
|
12
12
|
PluginTracker,
|
|
13
13
|
detectContext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QDVUNUTK.js";
|
|
15
15
|
import {
|
|
16
16
|
installPackages,
|
|
17
17
|
logger
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QRFLHLFE.js";
|
|
19
19
|
import "./chunk-QGM4M3NI.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/prompts/language.ts
|
|
@@ -788,85 +788,95 @@ var SpinnerManager = class {
|
|
|
788
788
|
};
|
|
789
789
|
|
|
790
790
|
// src/cli/ui/report.ts
|
|
791
|
+
import pc from "picocolors";
|
|
791
792
|
function displayInstallationReport(report, plugins, lang) {
|
|
792
793
|
const t = getTranslations(lang);
|
|
793
|
-
console.log(
|
|
794
|
-
|
|
794
|
+
console.log();
|
|
795
|
+
console.log(pc.bold(pc.green("\u2501".repeat(60))));
|
|
796
|
+
console.log(pc.bold(pc.green(`\u2728 ${t.report.title}`)));
|
|
795
797
|
if (report.duration > 0) {
|
|
796
798
|
const durationSeconds = (report.duration / 1e3).toFixed(1);
|
|
797
|
-
console.log(`
|
|
798
|
-
`);
|
|
799
|
-
} else {
|
|
800
|
-
console.log("");
|
|
799
|
+
console.log(pc.gray(` Temps d'installation: ${durationSeconds}s`));
|
|
801
800
|
}
|
|
801
|
+
console.log(pc.bold(pc.green("\u2501".repeat(60))));
|
|
802
|
+
console.log();
|
|
802
803
|
if (report.installed.length > 0) {
|
|
803
|
-
console.log(
|
|
804
|
+
console.log(pc.bold(pc.cyan(`\u{1F4E6} ${t.report.packagesInstalled}:`)));
|
|
804
805
|
for (const pluginName of report.installed) {
|
|
805
806
|
const plugin = plugins.find((p) => p.name === pluginName);
|
|
806
|
-
const version = plugin?.version ? ` (${plugin.version})` : "";
|
|
807
|
-
console.log(
|
|
807
|
+
const version = plugin?.version ? pc.gray(` (${plugin.version})`) : "";
|
|
808
|
+
console.log(
|
|
809
|
+
pc.green(` \u2713 ${plugin?.displayName || pluginName}`) + version
|
|
810
|
+
);
|
|
808
811
|
}
|
|
809
|
-
console.log(
|
|
812
|
+
console.log();
|
|
810
813
|
}
|
|
811
814
|
const createdFiles = report.filesCreated.filter((f) => f.type === "create");
|
|
812
815
|
if (createdFiles.length > 0) {
|
|
813
|
-
console.log(
|
|
816
|
+
console.log(pc.bold(pc.cyan(`\u{1F4DD} ${t.report.filesCreated}:`)));
|
|
814
817
|
for (const file of createdFiles) {
|
|
815
|
-
console.log(` \u2022 ${file.path}`);
|
|
818
|
+
console.log(pc.blue(` \u2022 ${file.path}`));
|
|
816
819
|
}
|
|
817
|
-
console.log(
|
|
820
|
+
console.log();
|
|
818
821
|
}
|
|
819
822
|
const modifiedFiles = report.filesCreated.filter((f) => f.type === "modify");
|
|
820
823
|
if (modifiedFiles.length > 0) {
|
|
821
|
-
console.log(
|
|
824
|
+
console.log(pc.bold(pc.cyan(`\u{1F4DD} ${t.report.filesModified}:`)));
|
|
822
825
|
for (const file of modifiedFiles) {
|
|
823
|
-
console.log(` \u2022 ${file.path}`);
|
|
826
|
+
console.log(pc.yellow(` \u2022 ${file.path}`));
|
|
824
827
|
}
|
|
825
|
-
console.log(
|
|
828
|
+
console.log();
|
|
826
829
|
}
|
|
827
830
|
if (report.warnings.length > 0) {
|
|
828
|
-
console.log(`\u26A0\uFE0F ${report.warnings.length} warning(s):`);
|
|
831
|
+
console.log(pc.bold(pc.yellow(`\u26A0\uFE0F ${report.warnings.length} warning(s):`)));
|
|
829
832
|
for (const warning of report.warnings) {
|
|
830
|
-
console.log(` \u26A0
|
|
833
|
+
console.log(pc.yellow(` \u26A0\uFE0F ${warning.message}`));
|
|
831
834
|
if (warning.plugins && warning.plugins.length > 0) {
|
|
832
|
-
console.log(`
|
|
835
|
+
console.log(pc.gray(` Plugins: ${warning.plugins.join(", ")}`));
|
|
833
836
|
}
|
|
834
837
|
}
|
|
835
|
-
console.log(
|
|
838
|
+
console.log();
|
|
836
839
|
}
|
|
837
840
|
displayNextSteps(lang);
|
|
838
841
|
}
|
|
839
842
|
function displayNextSteps(lang) {
|
|
840
843
|
const t = getTranslations(lang);
|
|
841
|
-
console.log(
|
|
842
|
-
console.log(" 1. npm run dev");
|
|
843
|
-
console.log(
|
|
844
|
-
|
|
845
|
-
|
|
844
|
+
console.log(pc.bold(pc.magenta(`\u{1F680} ${t.report.nextSteps}:`)));
|
|
845
|
+
console.log(pc.cyan(" 1. ") + pc.bold("npm run dev"));
|
|
846
|
+
console.log(
|
|
847
|
+
pc.cyan(" 2. ") + "Visitez " + pc.underline(pc.blue("http://localhost:5173"))
|
|
848
|
+
);
|
|
849
|
+
console.log(
|
|
850
|
+
pc.cyan(" 3. ") + "Consultez la documentation dans " + pc.italic("src/")
|
|
851
|
+
);
|
|
852
|
+
console.log();
|
|
846
853
|
}
|
|
847
854
|
|
|
848
855
|
// src/cli/commands/install.ts
|
|
856
|
+
import pc2 from "picocolors";
|
|
849
857
|
async function installReact(options) {
|
|
850
858
|
try {
|
|
851
859
|
const language = await promptLanguage();
|
|
852
860
|
const t = getTranslations(language);
|
|
853
|
-
console.log(
|
|
854
|
-
${t.detection.detecting}`);
|
|
861
|
+
console.log();
|
|
862
|
+
console.log(pc2.bold(pc2.cyan(`\u{1F50D} ${t.detection.detecting}`)));
|
|
855
863
|
const projectRoot = process.cwd();
|
|
856
864
|
const ctx = await detectContext(projectRoot);
|
|
857
865
|
console.log(
|
|
858
|
-
` \u2713 ${t.detection.framework}:
|
|
866
|
+
pc2.green(` \u2713 ${t.detection.framework}: `) + pc2.bold(`${ctx.framework} ${pc2.gray(ctx.frameworkVersion)}`)
|
|
859
867
|
);
|
|
860
868
|
console.log(
|
|
861
|
-
` \u2713 ${t.detection.typescript}:
|
|
869
|
+
pc2.green(` \u2713 ${t.detection.typescript}: `) + pc2.bold(ctx.typescript ? "Oui" : "Non")
|
|
862
870
|
);
|
|
863
871
|
if (ctx.bundler) {
|
|
864
872
|
console.log(
|
|
865
|
-
` \u2713 ${t.detection.bundler}:
|
|
873
|
+
pc2.green(` \u2713 ${t.detection.bundler}: `) + pc2.bold(`${ctx.bundler} ${pc2.gray(ctx.bundlerVersion || "")}`)
|
|
866
874
|
);
|
|
867
875
|
}
|
|
868
|
-
console.log(
|
|
869
|
-
`)
|
|
876
|
+
console.log(
|
|
877
|
+
pc2.green(` \u2713 ${t.detection.packageManager}: `) + pc2.bold(ctx.packageManager)
|
|
878
|
+
);
|
|
879
|
+
console.log();
|
|
870
880
|
let selectedPlugins = [];
|
|
871
881
|
if (options.yes) {
|
|
872
882
|
logger.info("Using default recommendations (--yes mode)");
|
|
@@ -878,13 +888,16 @@ ${t.detection.detecting}`);
|
|
|
878
888
|
);
|
|
879
889
|
}
|
|
880
890
|
if (selectedPlugins.length === 0) {
|
|
881
|
-
console.log(
|
|
882
|
-
${t.common.selected(0)}`);
|
|
883
|
-
console.log("Exiting...");
|
|
891
|
+
console.log();
|
|
892
|
+
console.log(pc2.yellow(`\u26A0\uFE0F ${t.common.selected(0)}`));
|
|
893
|
+
console.log(pc2.gray("Exiting..."));
|
|
884
894
|
return;
|
|
885
895
|
}
|
|
886
|
-
console.log(
|
|
887
|
-
|
|
896
|
+
console.log();
|
|
897
|
+
console.log(
|
|
898
|
+
pc2.bold(pc2.green(`\u2713 ${t.common.selected(selectedPlugins.length)}`))
|
|
899
|
+
);
|
|
900
|
+
console.log();
|
|
888
901
|
if (!options.yes && !options.silent) {
|
|
889
902
|
const confirmed = await promptConfirmation(selectedPlugins, language);
|
|
890
903
|
if (!confirmed) {
|
|
@@ -893,20 +906,32 @@ ${t.common.selected(selectedPlugins.length)}`);
|
|
|
893
906
|
}
|
|
894
907
|
}
|
|
895
908
|
if (options.dryRun) {
|
|
896
|
-
console.log(
|
|
897
|
-
console.log("\u2501".repeat(
|
|
898
|
-
console.log("\
|
|
909
|
+
console.log();
|
|
910
|
+
console.log(pc2.bold(pc2.yellow("\u2501".repeat(60))));
|
|
911
|
+
console.log(pc2.bold(pc2.yellow("\u{1F50D} MODE DRY-RUN (simulation uniquement)")));
|
|
912
|
+
console.log(pc2.bold(pc2.yellow("\u2501".repeat(60))));
|
|
913
|
+
console.log();
|
|
914
|
+
console.log(pc2.bold(pc2.cyan("\u{1F4E6} Packages \xE0 installer :")));
|
|
899
915
|
for (const plugin of selectedPlugins) {
|
|
900
916
|
console.log(
|
|
901
|
-
` ${plugin.
|
|
917
|
+
pc2.blue(` \u2022 ${plugin.displayName}`) + pc2.gray(
|
|
918
|
+
` (${plugin.name}${plugin.version ? `@${plugin.version}` : ""})`
|
|
919
|
+
)
|
|
902
920
|
);
|
|
903
921
|
}
|
|
904
|
-
console.log(
|
|
922
|
+
console.log();
|
|
923
|
+
console.log(pc2.bold(pc2.cyan("\u{1F4DD} Fichiers qui seraient cr\xE9\xE9s/modifi\xE9s :")));
|
|
905
924
|
for (const plugin of selectedPlugins) {
|
|
906
|
-
console.log(` ${plugin.displayName} configuration`);
|
|
925
|
+
console.log(pc2.gray(` \u2022 ${plugin.displayName} configuration`));
|
|
907
926
|
}
|
|
908
|
-
console.log(
|
|
909
|
-
console.log(
|
|
927
|
+
console.log();
|
|
928
|
+
console.log(
|
|
929
|
+
pc2.yellow("\u26A0\uFE0F Aucune modification n'a \xE9t\xE9 effectu\xE9e (dry-run)")
|
|
930
|
+
);
|
|
931
|
+
console.log(
|
|
932
|
+
pc2.cyan("\u{1F4A1} Ex\xE9cutez sans --dry-run pour appliquer les changements")
|
|
933
|
+
);
|
|
934
|
+
console.log();
|
|
910
935
|
return;
|
|
911
936
|
}
|
|
912
937
|
const backupManager = new BackupManager();
|
|
@@ -914,8 +939,10 @@ ${t.common.selected(selectedPlugins.length)}`);
|
|
|
914
939
|
const validator = new CompatibilityValidator(compatibilityRules);
|
|
915
940
|
const installer = new Installer(ctx, validator, configWriter, backupManager);
|
|
916
941
|
if (options.install === false) {
|
|
917
|
-
console.log(
|
|
918
|
-
console.log("
|
|
942
|
+
console.log();
|
|
943
|
+
console.log(pc2.yellow("\u2699\uFE0F Mode configuration uniquement (--no-install)"));
|
|
944
|
+
console.log(pc2.gray("Les packages ne seront PAS install\xE9s"));
|
|
945
|
+
console.log();
|
|
919
946
|
}
|
|
920
947
|
const spinner = new SpinnerManager();
|
|
921
948
|
spinner.start(t.installation.installing);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PluginTracker,
|
|
3
3
|
detectContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QDVUNUTK.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QRFLHLFE.js";
|
|
8
8
|
import "./chunk-QGM4M3NI.js";
|
|
9
9
|
|
|
10
10
|
// src/cli/commands/installed.ts
|