@configjs/cli 1.1.9 → 1.1.11

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
@@ -8,7 +8,7 @@ import "./chunk-QGM4M3NI.js";
8
8
  import { Command } from "commander";
9
9
 
10
10
  // package.json
11
- var version = "1.1.9";
11
+ var version = "1.1.11";
12
12
 
13
13
  // src/cli.ts
14
14
  initializeCLILogging();
@@ -17,7 +17,7 @@ program.name("confjs").description("Configure your frontend stack, instantly").v
17
17
  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(
18
18
  async (options) => {
19
19
  try {
20
- const { ReactCommand } = await import("./react-command-NHCD2L7R.js");
20
+ const { ReactCommand } = await import("./react-command-BFJWFYWC.js");
21
21
  const command = new ReactCommand();
22
22
  await command.execute(options);
23
23
  } catch (error) {
@@ -29,7 +29,7 @@ program.command("react").description("Configure a React project").option("-y, --
29
29
  program.command("nextjs").description("Configure a Next.js 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(
30
30
  async (options) => {
31
31
  try {
32
- const { NextjsCommand } = await import("./nextjs-command-W53FZE7U.js");
32
+ const { NextjsCommand } = await import("./nextjs-command-CANKBSNF.js");
33
33
  const command = new NextjsCommand();
34
34
  await command.execute(options);
35
35
  } catch (error) {
@@ -41,7 +41,7 @@ program.command("nextjs").description("Configure a Next.js project").option("-y,
41
41
  program.command("vue").description("Configure a Vue.js 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(
42
42
  async (options) => {
43
43
  try {
44
- const { VueCommand } = await import("./vue-command-GYKDHJRJ.js");
44
+ const { VueCommand } = await import("./vue-command-R7ZY5GED.js");
45
45
  const command = new VueCommand();
46
46
  await command.execute(options);
47
47
  } catch (error) {
@@ -50,9 +50,21 @@ program.command("vue").description("Configure a Vue.js project").option("-y, --y
50
50
  }
51
51
  }
52
52
  );
53
+ program.command("svelte").description("Configure a Svelte 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(
54
+ async (options) => {
55
+ try {
56
+ const { SvelteCommand } = await import("./svelte-command-DHI62P2P.js");
57
+ const command = new SvelteCommand();
58
+ await command.execute(options);
59
+ } catch (error) {
60
+ console.error("Error:", error);
61
+ process.exit(1);
62
+ }
63
+ }
64
+ );
53
65
  program.command("list").description("List available libraries").option("-c, --category <category>", "Filter by category").action(async (options) => {
54
66
  try {
55
- const { listLibraries } = await import("./list-TDMIAZPQ.js");
67
+ const { listLibraries } = await import("./list-3M2L5RYT.js");
56
68
  listLibraries(options);
57
69
  } catch (error) {
58
70
  console.error("Error:", error);
@@ -61,7 +73,7 @@ program.command("list").description("List available libraries").option("-c, --ca
61
73
  });
62
74
  program.command("check").description("Check compatibility without installing").option("-c, --config <file>", "Configuration file to check").action(async (options) => {
63
75
  try {
64
- const { checkCompatibility } = await import("./check-IOMRDWLB.js");
76
+ const { checkCompatibility } = await import("./check-PEWUERVP.js");
65
77
  await checkCompatibility(options);
66
78
  } catch (error) {
67
79
  console.error("Error:", error);
@@ -79,7 +91,7 @@ program.command("installed").description("List installed plugins").action(async
79
91
  });
80
92
  program.command("remove <plugin>").description("Remove an installed plugin").action(async (plugin) => {
81
93
  try {
82
- const { removeCommand } = await import("./remove-XQBB4NC3.js");
94
+ const { removeCommand } = await import("./remove-JCK32XHZ.js");
83
95
  await removeCommand(plugin);
84
96
  } catch (error) {
85
97
  console.error("Error:", error);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginRegistry
3
- } from "./chunk-6WWDHX4E.js";
3
+ } from "./chunk-ZAGZRB7Y.js";
4
4
  import "./chunk-6GV4NKUX.js";
5
5
  import "./chunk-FIB2J36N.js";
6
6
  import "./chunk-QPEUT7QG.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BaseFrameworkCommand,
3
3
  getFrameworkMetadata
4
- } from "./chunk-ABHFQM5U.js";
5
- import "./chunk-ATUTE7PE.js";
6
- import "./chunk-6WWDHX4E.js";
4
+ } from "./chunk-AP23JQSL.js";
5
+ import "./chunk-O2IJKLMT.js";
6
+ import "./chunk-ZAGZRB7Y.js";
7
7
  import {
8
8
  DetectionError,
9
9
  detectContext
@@ -13,7 +13,7 @@ import "./chunk-FIB2J36N.js";
13
13
  import "./chunk-QPEUT7QG.js";
14
14
  import {
15
15
  getTranslations
16
- } from "./chunk-QBMH2K7B.js";
16
+ } from "./chunk-3WLFBAII.js";
17
17
  import "./chunk-QGM4M3NI.js";
18
18
 
19
19
  // src/cli/commands/nextjs-command.ts
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-QPEUT7QG.js";
7
7
  import {
8
8
  getTranslations
9
- } from "./chunk-QBMH2K7B.js";
9
+ } from "./chunk-3WLFBAII.js";
10
10
  import "./chunk-QGM4M3NI.js";
11
11
 
12
12
  // src/cli/utils/nextjs-installer.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTranslations
3
- } from "./chunk-QBMH2K7B.js";
3
+ } from "./chunk-3WLFBAII.js";
4
4
  import "./chunk-QGM4M3NI.js";
5
5
 
6
6
  // src/cli/prompts/nextjs-setup.ts
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BaseFrameworkCommand,
3
3
  getFrameworkMetadata
4
- } from "./chunk-ABHFQM5U.js";
5
- import "./chunk-ATUTE7PE.js";
6
- import "./chunk-6WWDHX4E.js";
4
+ } from "./chunk-AP23JQSL.js";
5
+ import "./chunk-O2IJKLMT.js";
6
+ import "./chunk-ZAGZRB7Y.js";
7
7
  import {
8
8
  DetectionError,
9
9
  detectContext
@@ -13,7 +13,7 @@ import "./chunk-FIB2J36N.js";
13
13
  import "./chunk-QPEUT7QG.js";
14
14
  import {
15
15
  getTranslations
16
- } from "./chunk-QBMH2K7B.js";
16
+ } from "./chunk-3WLFBAII.js";
17
17
  import "./chunk-QGM4M3NI.js";
18
18
 
19
19
  // src/cli/commands/react-command.ts
@@ -0,0 +1,75 @@
1
+ import {
2
+ PluginTracker,
3
+ detectContext
4
+ } from "./chunk-WHV4KF4U.js";
5
+ import "./chunk-6GV4NKUX.js";
6
+ import "./chunk-FIB2J36N.js";
7
+ import {
8
+ logger
9
+ } from "./chunk-QPEUT7QG.js";
10
+ import {
11
+ dist_default
12
+ } from "./chunk-2HZGGA67.js";
13
+ import "./chunk-QGM4M3NI.js";
14
+
15
+ // src/cli/commands/remove.ts
16
+ async function removeCommand(pluginName) {
17
+ try {
18
+ const ctx = await detectContext(process.cwd());
19
+ const tracker = new PluginTracker(ctx.projectRoot, ctx.fsAdapter);
20
+ await tracker.load();
21
+ if (!pluginName) {
22
+ console.log("\n\u274C Please specify a plugin name to remove.\n");
23
+ console.log("Usage: configjs remove <plugin-name>\n");
24
+ console.log("Example: configjs remove react-router\n");
25
+ process.exit(1);
26
+ }
27
+ const plugin = tracker.getPlugin(pluginName);
28
+ if (!plugin) {
29
+ console.log(`
30
+ \u274C Plugin '${pluginName}' is not installed.
31
+ `);
32
+ console.log("Run `configjs installed` to see installed plugins.\n");
33
+ process.exit(1);
34
+ }
35
+ console.log(`
36
+ \u26A0\uFE0F You are about to remove: ${plugin.displayName}
37
+ `);
38
+ console.log(
39
+ "\u26A0\uFE0F WARNING: This will only untrack the plugin from the config."
40
+ );
41
+ console.log(" You will need to manually:");
42
+ console.log(" - Remove the packages (npm uninstall ...)");
43
+ console.log(" - Delete the generated files");
44
+ console.log(" - Clean up the configuration\n");
45
+ const confirmed = await dist_default({
46
+ message: "Continue?",
47
+ default: false
48
+ });
49
+ if (!confirmed) {
50
+ console.log("\n\u274C Cancelled.\n");
51
+ return;
52
+ }
53
+ await tracker.removePlugin(pluginName);
54
+ console.log(`
55
+ \u2705 ${plugin.displayName} has been removed from tracking.
56
+ `);
57
+ console.log("\u{1F4DD} Manual cleanup required:");
58
+ if (plugin.packages.dependencies && plugin.packages.dependencies.length > 0) {
59
+ console.log(` npm uninstall ${plugin.packages.dependencies.join(" ")}`);
60
+ }
61
+ if (plugin.packages.devDependencies && plugin.packages.devDependencies.length > 0) {
62
+ console.log(
63
+ ` npm uninstall ${plugin.packages.devDependencies.join(" ")}`
64
+ );
65
+ }
66
+ console.log();
67
+ } catch (error) {
68
+ const errorMessage = error instanceof Error ? error.message : String(error);
69
+ logger.error(`Failed to remove plugin: ${errorMessage}`);
70
+ process.exit(1);
71
+ }
72
+ }
73
+ export {
74
+ removeCommand
75
+ };
@@ -0,0 +1,72 @@
1
+ import {
2
+ BaseFrameworkCommand,
3
+ getFrameworkMetadata
4
+ } from "./chunk-AP23JQSL.js";
5
+ import "./chunk-O2IJKLMT.js";
6
+ import "./chunk-ZAGZRB7Y.js";
7
+ import {
8
+ DetectionError,
9
+ detectContext
10
+ } from "./chunk-WHV4KF4U.js";
11
+ import "./chunk-6GV4NKUX.js";
12
+ import "./chunk-FIB2J36N.js";
13
+ import "./chunk-QPEUT7QG.js";
14
+ import {
15
+ getTranslations
16
+ } from "./chunk-3WLFBAII.js";
17
+ import "./chunk-QGM4M3NI.js";
18
+
19
+ // src/cli/commands/svelte-command.ts
20
+ import pc from "picocolors";
21
+ var SvelteCommand = class extends BaseFrameworkCommand {
22
+ getFramework() {
23
+ return "svelte";
24
+ }
25
+ async getOrCreateContext(projectRoot, language) {
26
+ const t = getTranslations(language);
27
+ const metadata = getFrameworkMetadata("svelte");
28
+ if (!metadata) {
29
+ throw new Error("Svelte framework metadata not found");
30
+ }
31
+ try {
32
+ return await detectContext(projectRoot);
33
+ } catch (error) {
34
+ if (error instanceof DetectionError) {
35
+ console.log();
36
+ console.log(pc.yellow(t.svelte.noSvelteDetected));
37
+ console.log();
38
+ const setupOptions = await metadata.getSetupPrompt(language);
39
+ if (!setupOptions) {
40
+ console.log();
41
+ console.log(pc.gray(t.common.cancel));
42
+ throw new Error("Project creation cancelled");
43
+ }
44
+ const newProjectPath = await metadata.createProject(
45
+ setupOptions,
46
+ projectRoot,
47
+ language
48
+ );
49
+ console.log();
50
+ console.log(pc.green(`\u2728 ${t.svelte.projectCreated}`));
51
+ console.log();
52
+ return await detectContext(newProjectPath);
53
+ }
54
+ throw error;
55
+ }
56
+ }
57
+ displayFrameworkInfo(ctx) {
58
+ console.log();
59
+ console.log(pc.cyan(`${pc.bold("\u{1F50D} D\xE9tection du contexte...")}`));
60
+ const displayInfo = (label, value) => {
61
+ console.log(` ${pc.green("\u2713")} ${pc.gray(`${label}:`)} ${value}`);
62
+ };
63
+ displayInfo("Framework", `svelte ${ctx.frameworkVersion || "unknown"}`);
64
+ displayInfo("TypeScript", ctx.typescript ? "Yes" : "No");
65
+ displayInfo("Bundler", `${ctx.bundler} ${ctx.bundlerVersion || "unknown"}`);
66
+ displayInfo("Package manager", ctx.packageManager || "npm");
67
+ console.log();
68
+ }
69
+ };
70
+ export {
71
+ SvelteCommand
72
+ };
@@ -0,0 +1,65 @@
1
+ import {
2
+ checkPathExists
3
+ } from "./chunk-FIB2J36N.js";
4
+ import "./chunk-QPEUT7QG.js";
5
+ import {
6
+ getTranslations
7
+ } from "./chunk-3WLFBAII.js";
8
+ import "./chunk-QGM4M3NI.js";
9
+
10
+ // src/cli/utils/svelte-installer.ts
11
+ import { execSync } from "child_process";
12
+ import { join } from "path";
13
+ import pc from "picocolors";
14
+ async function createSvelteProject(options, currentDir, language) {
15
+ const t = getTranslations(language);
16
+ const projectPath = join(currentDir, options.projectName);
17
+ if (await checkPathExists(projectPath)) {
18
+ throw new Error(
19
+ t.vite.folderExists?.(options.projectName) || `Folder ${options.projectName} already exists`
20
+ );
21
+ }
22
+ console.log();
23
+ console.log(
24
+ pc.cyan(`\u2728 ${t.svelte.creatingProject || "Creating Svelte project..."}`)
25
+ );
26
+ console.log();
27
+ try {
28
+ const templateSuffix = options.useTypeScript ? "" : "-js";
29
+ const createCommand = `npm create svelte@latest ${options.projectName} -- --template skeleton${templateSuffix} --no-install`;
30
+ execSync(createCommand, {
31
+ cwd: currentDir,
32
+ stdio: "inherit",
33
+ shell: process.platform === "win32" ? "cmd.exe" : "/bin/sh"
34
+ });
35
+ console.log();
36
+ console.log(
37
+ pc.cyan(
38
+ `\u{1F4E6} ${t.svelte.installingDependencies || "Installing dependencies..."}`
39
+ )
40
+ );
41
+ console.log();
42
+ execSync("npm install", {
43
+ cwd: projectPath,
44
+ stdio: "inherit"
45
+ });
46
+ console.log();
47
+ console.log(
48
+ pc.green(
49
+ `\u2705 ${t.svelte.projectCreated || "Svelte project created successfully!"}`
50
+ )
51
+ );
52
+ console.log();
53
+ return projectPath;
54
+ } catch (error) {
55
+ console.error(
56
+ pc.red(
57
+ `\u274C Failed to create Svelte project: ${error instanceof Error ? error.message : String(error)}`
58
+ )
59
+ );
60
+ throw error;
61
+ }
62
+ }
63
+ export {
64
+ createSvelteProject
65
+ };
@@ -0,0 +1,38 @@
1
+ import {
2
+ dist_default,
3
+ dist_default2
4
+ } from "./chunk-2HZGGA67.js";
5
+ import {
6
+ getTranslations
7
+ } from "./chunk-3WLFBAII.js";
8
+ import "./chunk-QGM4M3NI.js";
9
+
10
+ // src/cli/prompts/svelte-setup.ts
11
+ import pc from "picocolors";
12
+ async function promptSvelteSetup(language) {
13
+ const t = getTranslations(language);
14
+ console.log();
15
+ console.log(pc.cyan(pc.bold("\u{1F4CB} Svelte Project Setup")));
16
+ console.log();
17
+ const projectName = await dist_default2({
18
+ message: t.svelte.projectName || "Project name",
19
+ default: "my-svelte-app",
20
+ validate: (value) => {
21
+ if (!value || value.trim().length === 0) {
22
+ return "Project name cannot be empty";
23
+ }
24
+ return true;
25
+ }
26
+ });
27
+ const useTypeScript = await dist_default({
28
+ message: t.svelte.useTypeScript || "Use TypeScript?",
29
+ default: true
30
+ });
31
+ return {
32
+ projectName: projectName.trim(),
33
+ useTypeScript
34
+ };
35
+ }
36
+ export {
37
+ promptSvelteSetup
38
+ };
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-QPEUT7QG.js";
7
7
  import {
8
8
  getTranslations
9
- } from "./chunk-QBMH2K7B.js";
9
+ } from "./chunk-3WLFBAII.js";
10
10
  import "./chunk-QGM4M3NI.js";
11
11
 
12
12
  // src/cli/utils/vite-installer.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTranslations
3
- } from "./chunk-QBMH2K7B.js";
3
+ } from "./chunk-3WLFBAII.js";
4
4
  import "./chunk-QGM4M3NI.js";
5
5
 
6
6
  // src/cli/prompts/vite-setup.ts
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BaseFrameworkCommand,
3
3
  getFrameworkMetadata
4
- } from "./chunk-ABHFQM5U.js";
5
- import "./chunk-ATUTE7PE.js";
6
- import "./chunk-6WWDHX4E.js";
4
+ } from "./chunk-AP23JQSL.js";
5
+ import "./chunk-O2IJKLMT.js";
6
+ import "./chunk-ZAGZRB7Y.js";
7
7
  import {
8
8
  DetectionError,
9
9
  detectContext
@@ -13,7 +13,7 @@ import "./chunk-FIB2J36N.js";
13
13
  import "./chunk-QPEUT7QG.js";
14
14
  import {
15
15
  getTranslations
16
- } from "./chunk-QBMH2K7B.js";
16
+ } from "./chunk-3WLFBAII.js";
17
17
  import "./chunk-QGM4M3NI.js";
18
18
 
19
19
  // src/cli/commands/vue-command.ts
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-QPEUT7QG.js";
7
7
  import {
8
8
  getTranslations
9
- } from "./chunk-QBMH2K7B.js";
9
+ } from "./chunk-3WLFBAII.js";
10
10
  import "./chunk-QGM4M3NI.js";
11
11
 
12
12
  // src/cli/utils/vue-installer.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTranslations
3
- } from "./chunk-QBMH2K7B.js";
3
+ } from "./chunk-3WLFBAII.js";
4
4
  import "./chunk-QGM4M3NI.js";
5
5
 
6
6
  // src/cli/prompts/vue-setup.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configjs/cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "type": "module",
5
5
  "description": "Configure your frontend stack, instantly - Utilitaire CLI d'installation modulaire de bibliothèques frontend",
6
6
  "keywords": [