@configjs/cli 1.1.16 → 1.1.18

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.
Files changed (34) hide show
  1. package/dist/{angular-command-XN26G6L3.js → angular-command-EOREU45Q.js} +8 -8
  2. package/dist/{angular-installer-FY43HE72.js → angular-installer-TKZDPFLD.js} +9 -1
  3. package/dist/angular-setup-QDTWXOB4.js +30 -0
  4. package/dist/check-KAPRT4FM.js +168 -0
  5. package/dist/{chunk-JYWGJJ4M.js → chunk-D7IWYKUX.js} +476 -28
  6. package/dist/chunk-EDCNW4UO.js +92 -0
  7. package/dist/{chunk-TN27AX4L.js → chunk-FJLN62L4.js} +797 -18
  8. package/dist/{chunk-FIB2J36N.js → chunk-HI7RYD6W.js} +161 -36
  9. package/dist/{chunk-NYCK4R4K.js → chunk-RIJNUJDC.js} +361 -96
  10. package/dist/chunk-V2IBYLVH.js +932 -0
  11. package/dist/chunk-VN4XTFDK.js +315 -0
  12. package/dist/{chunk-UKEHW2LH.js → chunk-Y4XYC7QV.js} +17 -3
  13. package/dist/cli.js +31 -21
  14. package/dist/{installed-D6CUYQM5.js → installed-QMJZIZNC.js} +4 -4
  15. package/dist/{list-VZDUWV5O.js → list-5T6VDDAO.js} +4 -4
  16. package/dist/{nextjs-command-WKKOAY7I.js → nextjs-command-C6PM7A5C.js} +8 -9
  17. package/dist/{nextjs-installer-2ZC5IWJ6.js → nextjs-installer-OFY5BQC4.js} +9 -2
  18. package/dist/{nextjs-setup-DYOFF72S.js → nextjs-setup-JIKPIJCX.js} +21 -9
  19. package/dist/{react-command-2T6IOTHB.js → react-command-JMK6VM4Q.js} +8 -9
  20. package/dist/{remove-ZY3MLPGN.js → remove-4ZNQR6ZR.js} +4 -4
  21. package/dist/{svelte-command-B2DNNQ5Z.js → svelte-command-YUSD55NO.js} +8 -8
  22. package/dist/svelte-installer-UP3KDZSY.js +105 -0
  23. package/dist/{svelte-setup-FWXLXJAC.js → svelte-setup-33E46IBT.js} +16 -5
  24. package/dist/{vite-installer-Y6VMFHIM.js → vite-installer-EE2LE76G.js} +9 -2
  25. package/dist/{vite-setup-JRELX6K2.js → vite-setup-VO5BOI46.js} +16 -4
  26. package/dist/{vue-command-IOTC32AI.js → vue-command-3CYWLLFQ.js} +8 -9
  27. package/dist/{vue-installer-DGBBVF6F.js → vue-installer-LEGLVD77.js} +9 -2
  28. package/dist/{vue-setup-G44DLT2U.js → vue-setup-FK5QT7AY.js} +16 -4
  29. package/package.json +12 -4
  30. package/dist/angular-setup-Z6TCKNBG.js +0 -18
  31. package/dist/check-KNGZSCMM.js +0 -131
  32. package/dist/chunk-6GV4NKUX.js +0 -122
  33. package/dist/chunk-QPEUT7QG.js +0 -157
  34. package/dist/svelte-installer-EOSC3EP3.js +0 -65
@@ -1,122 +0,0 @@
1
- import {
2
- getModuleLogger
3
- } from "./chunk-QPEUT7QG.js";
4
-
5
- // src/utils/package-manager.ts
6
- import { execa } from "execa";
7
- import fs from "fs-extra";
8
- import { resolve, join } from "path";
9
- var logger = getModuleLogger();
10
- async function detectPackageManager(projectRoot, fsAdapter) {
11
- const root = resolve(projectRoot);
12
- const lockfiles = [
13
- { file: "pnpm-lock.yaml", manager: "pnpm" },
14
- { file: "yarn.lock", manager: "yarn" },
15
- { file: "package-lock.json", manager: "npm" },
16
- { file: "bun.lockb", manager: "bun" }
17
- ];
18
- for (const { file, manager } of lockfiles) {
19
- const lockfilePath = join(root, file);
20
- if (fsAdapter) {
21
- if (await fsAdapter.pathExists(lockfilePath)) {
22
- logger.debug(`Detected package manager: ${manager} (found ${file})`);
23
- return manager;
24
- }
25
- continue;
26
- }
27
- if (await fs.pathExists(lockfilePath)) {
28
- logger.debug(`Detected package manager: ${manager} (found ${file})`);
29
- return manager;
30
- }
31
- }
32
- logger.debug("No lockfile found, defaulting to npm");
33
- return "npm";
34
- }
35
- async function installPackages(packages, options) {
36
- if (packages.length === 0) {
37
- logger.warn("No packages to install");
38
- return { success: true, packages: [] };
39
- }
40
- const {
41
- packageManager,
42
- projectRoot,
43
- dev = false,
44
- exact = false,
45
- silent = false
46
- } = options;
47
- logger.info(
48
- `Installing ${packages.length} package(s) with ${packageManager}...`
49
- );
50
- try {
51
- const command = getInstallCommand(packageManager, packages, { dev, exact });
52
- const cwd = resolve(projectRoot);
53
- logger.debug(`Executing: ${command.join(" ")} in ${cwd}`);
54
- const [cmd, ...args] = command;
55
- if (!cmd) {
56
- throw new Error("Command is empty");
57
- }
58
- const result = await execa(cmd, args, {
59
- cwd,
60
- stdio: silent ? "pipe" : "inherit",
61
- env: {
62
- ...process.env,
63
- // Désactiver les prompts interactifs
64
- npm_config_yes: "true",
65
- YARN_ENABLE_IMMUTABLE_INSTALLS: "false"
66
- }
67
- });
68
- if (result.exitCode !== 0) {
69
- throw new Error(`Installation failed with exit code ${result.exitCode}`);
70
- }
71
- logger.success(`Successfully installed ${packages.length} package(s)`);
72
- return {
73
- success: true,
74
- packages
75
- };
76
- } catch (error) {
77
- const errorMessage = error instanceof Error ? error.message : String(error);
78
- logger.error(`Failed to install packages: ${errorMessage}`);
79
- return {
80
- success: false,
81
- packages,
82
- error: errorMessage
83
- };
84
- }
85
- }
86
- function getInstallCommand(packageManager, packages, options) {
87
- const { dev, exact } = options;
88
- switch (packageManager) {
89
- case "pnpm":
90
- return [
91
- "pnpm",
92
- "add",
93
- ...dev ? ["-D"] : [],
94
- ...exact ? ["--save-exact"] : [],
95
- ...packages
96
- ];
97
- case "yarn":
98
- return [
99
- "yarn",
100
- "add",
101
- ...dev ? ["--dev"] : [],
102
- ...exact ? ["--exact"] : [],
103
- ...packages
104
- ];
105
- case "bun":
106
- return ["bun", "add", ...dev ? ["--dev"] : [], ...packages];
107
- case "npm":
108
- default:
109
- return [
110
- "npm",
111
- "install",
112
- ...dev ? ["--save-dev"] : [],
113
- ...exact ? ["--save-exact"] : [],
114
- ...packages
115
- ];
116
- }
117
- }
118
-
119
- export {
120
- detectPackageManager,
121
- installPackages
122
- };
@@ -1,157 +0,0 @@
1
- // src/utils/logger.ts
2
- import pc from "picocolors";
3
- var Logger = class {
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();
81
-
82
- // src/utils/logger-provider.ts
83
- var NoOpLogger = class {
84
- debug() {
85
- }
86
- info() {
87
- }
88
- warn() {
89
- }
90
- error() {
91
- }
92
- success() {
93
- }
94
- header() {
95
- }
96
- section() {
97
- }
98
- item() {
99
- }
100
- dim() {
101
- }
102
- step() {
103
- }
104
- box() {
105
- }
106
- };
107
- var LoggerProvider = class {
108
- currentLogger = new NoOpLogger();
109
- /**
110
- * Get the current logger instance
111
- * CLI commands should use the real logger
112
- * Core modules should use whatever is provided
113
- */
114
- getLogger() {
115
- return this.currentLogger;
116
- }
117
- /**
118
- * Set the active logger (typically called by CLI)
119
- * @param newLogger - The logger instance to use
120
- */
121
- setLogger(newLogger) {
122
- this.currentLogger = newLogger;
123
- }
124
- /**
125
- * Enable CLI logging (use the real logger)
126
- */
127
- enableCLILogging() {
128
- this.currentLogger = logger;
129
- }
130
- /**
131
- * Disable logging (use no-op logger)
132
- */
133
- disableLogging() {
134
- this.currentLogger = new NoOpLogger();
135
- }
136
- /**
137
- * Set the log level for the real logger
138
- */
139
- setLogLevel(level) {
140
- if (this.currentLogger === logger) {
141
- logger.setLevel(level);
142
- }
143
- }
144
- };
145
- var loggerProvider = new LoggerProvider();
146
- function getModuleLogger() {
147
- return loggerProvider.getLogger();
148
- }
149
- function initializeCLILogging() {
150
- loggerProvider.enableCLILogging();
151
- }
152
-
153
- export {
154
- logger,
155
- getModuleLogger,
156
- initializeCLILogging
157
- };
@@ -1,65 +0,0 @@
1
- import {
2
- checkPathExists
3
- } from "./chunk-FIB2J36N.js";
4
- import "./chunk-QPEUT7QG.js";
5
- import {
6
- getTranslations
7
- } from "./chunk-L4GX22RG.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
- };