@exiloncms/cli 1.0.0

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/README.md ADDED
@@ -0,0 +1,178 @@
1
+ # @exiloncms/cli
2
+
3
+ Interactive CLI to create new [ExilonCMS](https://github.com/Exilon-Studios/ExilonCMS) projects.
4
+
5
+ ## Installation
6
+
7
+ ### Using npm (global)
8
+
9
+ ```bash
10
+ npm install -g @exiloncms/cli
11
+ ```
12
+
13
+ ### Using pnpm (global)
14
+
15
+ ```bash
16
+ pnpm add -g @exiloncms/cli
17
+ ```
18
+
19
+ ### Using yarn (global)
20
+
21
+ ```bash
22
+ yarn global add @exiloncms/cli
23
+ ```
24
+
25
+ ### Using npx (without installing)
26
+
27
+ ```bash
28
+ npx @exiloncms/cli create my-project
29
+ ```
30
+
31
+ ### Using pnpm dlx (without installing)
32
+
33
+ ```bash
34
+ pnpm dlx @exiloncms/cli create my-project
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ ### Interactive Mode (Recommended)
40
+
41
+ ```bash
42
+ # Create a new project with interactive prompts
43
+ exiloncms create my-project
44
+
45
+ # or using the alias
46
+ exiloncms new my-project
47
+
48
+ # or using create-exiloncms
49
+ create-exiloncms my-project
50
+ ```
51
+
52
+ The CLI will prompt you for:
53
+ - Project name
54
+ - Database type (SQLite, PostgreSQL, MySQL)
55
+ - Theme selection
56
+ - Plugins to install
57
+ - Site configuration (name, admin email, password)
58
+ - Installation options
59
+
60
+ ### Command-Line Options
61
+
62
+ ```bash
63
+ exiloncms create my-project \
64
+ --database sqlite \
65
+ --theme default \
66
+ --plugins shop,discord \
67
+ --site-name "My Awesome Site" \
68
+ --admin-email admin@example.com \
69
+ --admin-password secret123 \
70
+ --no-install-deps \
71
+ --no-run-migrations
72
+ ```
73
+
74
+ #### Available Options
75
+
76
+ | Option | Description | Default |
77
+ |--------|-------------|---------|
78
+ | `-d, --database <type>` | Database type (sqlite, postgresql, mysql) | `sqlite` |
79
+ | `-t, --theme <name>` | Theme name | `default` |
80
+ | `-p, --plugins <list>` | Comma-separated list of plugins | - |
81
+ | `--site-name <name>` | Site name | - |
82
+ | `--admin-name <name>` | Admin name | - |
83
+ | `--admin-email <email>` | Admin email | - |
84
+ | `--admin-password <password>` | Admin password | - |
85
+ | `--no-install-deps` | Skip installing dependencies | - |
86
+ | `--no-run-migrations` | Skip running migrations | - |
87
+
88
+ ## What Gets Installed
89
+
90
+ The CLI creates a new ExilonCMS project with:
91
+
92
+ - ✅ Latest ExilonCMS code from GitHub
93
+ - ✅ Configured database (SQLite by default, no setup needed)
94
+ - ✅ Selected theme and plugins
95
+ - ✅ All dependencies installed (PHP and Node.js)
96
+ - ✅ Database migrated and seeded
97
+ - ✅ Admin user created
98
+ - ✅ Built frontend assets
99
+
100
+ ## Next Steps
101
+
102
+ After creating your project:
103
+
104
+ ```bash
105
+ cd my-project
106
+
107
+ # Start the development server
108
+ php artisan serve
109
+
110
+ # Visit http://localhost:8000
111
+ ```
112
+
113
+ ## Default Credentials
114
+
115
+ After installation, you can login with:
116
+
117
+ - **Email:** `admin@example.com` (or your custom email)
118
+ - **Password:** `password` (or your custom password)
119
+
120
+ ## Database Options
121
+
122
+ ### SQLite (Recommended)
123
+ - No configuration required
124
+ - File-based database
125
+ - Perfect for development and small projects
126
+
127
+ ### PostgreSQL
128
+ - Best for production
129
+ - Requires PostgreSQL server
130
+ - Configure in `.env` file
131
+
132
+ ### MySQL
133
+ - Good alternative for production
134
+ - Requires MySQL/MariaDB server
135
+ - Configure in `.env` file
136
+
137
+ ## Available Plugins
138
+
139
+ - **shop** - Full e-commerce system with cart, payments, and orders
140
+ - **discord** - Discord authentication and notifications
141
+ - **analytics** - Statistics and analytics tracking
142
+
143
+ More plugins coming soon!
144
+
145
+ ## Development
146
+
147
+ ```bash
148
+ # Clone the repository
149
+ git clone https://github.com/Exilon-Studios/exiloncms-cli.git
150
+ cd exiloncms-cli
151
+
152
+ # Install dependencies
153
+ npm install
154
+
155
+ # Run in development mode
156
+ npm run dev -- create test-project
157
+
158
+ # Build
159
+ npm run build
160
+
161
+ # Test locally
162
+ npm link
163
+ exiloncms create test-project
164
+ ```
165
+
166
+ ## Contributing
167
+
168
+ Contributions are welcome! Please feel free to submit a Pull Request.
169
+
170
+ ## License
171
+
172
+ MIT © [Exilon Studios](https://github.com/Exilon-Studios)
173
+
174
+ ## Links
175
+
176
+ - [ExilonCMS Documentation](https://github.com/Exilon-Studios/ExilonCMS/wiki)
177
+ - [ExilonCMS Repository](https://github.com/Exilon-Studios/ExilonCMS)
178
+ - [Issue Tracker](https://github.com/Exilon-Studios/exiloncms-cli/issues)
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/index.js ADDED
@@ -0,0 +1,384 @@
1
+ #!/usr/bin/env node
2
+ #!/usr/bin/env node
3
+
4
+ // src/index.ts
5
+ import { Command } from "commander";
6
+ import prompts from "prompts";
7
+ import ora from "ora";
8
+ import chalk from "chalk";
9
+ import { execaCommand } from "execa";
10
+ import fs from "fs-extra";
11
+ import path from "path";
12
+ import { fileURLToPath } from "url";
13
+ import degit from "degit";
14
+ var __filename = fileURLToPath(import.meta.url);
15
+ var __dirname = path.dirname(__filename);
16
+ var packageJson = await fs.readJson(path.join(__dirname, "../package.json"));
17
+ var banner = `
18
+ ${chalk.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")}
19
+ ${chalk.cyan("\u2551")} ${chalk.bold.white("ExilonCMS CLI")} ${chalk.gray(`v${packageJson.version}`)} ${" ".repeat(36)} ${chalk.cyan("\u2551")}
20
+ ${chalk.cyan("\u2551")} ${chalk.white("Create modern ExilonCMS projects with ease")} ${" ".repeat(24)} ${chalk.cyan("\u2551")}
21
+ ${chalk.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")}
22
+ `;
23
+ var databaseOptions = [
24
+ { title: "SQLite (Recommand\xE9 - Pas de configuration)", value: "sqlite", description: "Base de donn\xE9es fichier, aucune configuration requise" },
25
+ { title: "PostgreSQL", value: "postgresql", description: "Base de donn\xE9es serveur, performante et robuste" },
26
+ { title: "MySQL", value: "mysql", description: "Base de donn\xE9es serveur, populaire et r\xE9pandue" }
27
+ ];
28
+ var themeOptions = [
29
+ { title: "Default Theme", value: "default", description: "Th\xE8me par d\xE9faut d'ExilonCMS" },
30
+ { title: "Aucun th\xE8me (minimal)", value: "none", description: "Installation sans th\xE8me personnalis\xE9" }
31
+ ];
32
+ var pluginOptions = [
33
+ { title: "Shop Plugin - Boutique en ligne", value: "shop", description: "Syst\xE8me complet de boutique avec panier, paiements..." },
34
+ { title: "Discord Plugin - Int\xE9gration Discord", value: "discord", description: "Authentification et notifications Discord" },
35
+ { title: "Analytics Plugin - Statistiques", value: "analytics", description: "Suivi des statistiques et analytics" }
36
+ ];
37
+ function validateProjectName(name) {
38
+ return /^[a-zA-Z0-9_-]+$/.test(name);
39
+ }
40
+ async function promptForConfig(args = {}) {
41
+ console.log(banner);
42
+ const config = {
43
+ projectName: "",
44
+ database: "sqlite",
45
+ theme: "default",
46
+ plugins: [],
47
+ siteName: "Mon Site ExilonCMS",
48
+ adminName: "Admin",
49
+ adminEmail: "admin@example.com",
50
+ adminPassword: "password",
51
+ installDeps: true,
52
+ runMigrations: true
53
+ };
54
+ if (!args.projectName) {
55
+ const nameResponse = await prompts({
56
+ type: "text",
57
+ name: "projectName",
58
+ message: "Nom du projet:",
59
+ initial: "mon-site-exiloncms",
60
+ validate: (value) => {
61
+ if (!value) return "Le nom du projet est requis";
62
+ if (!validateProjectName(value)) return "Le nom ne peut contenir que des lettres, chiffres, tirets et underscores";
63
+ return true;
64
+ }
65
+ });
66
+ config.projectName = nameResponse.projectName;
67
+ } else {
68
+ config.projectName = args.projectName;
69
+ }
70
+ if (!args.database) {
71
+ const dbResponse = await prompts({
72
+ type: "select",
73
+ name: "database",
74
+ message: "Choisissez la base de donn\xE9es:",
75
+ choices: databaseOptions,
76
+ initial: 0
77
+ });
78
+ config.database = dbResponse.database;
79
+ } else {
80
+ config.database = args.database;
81
+ }
82
+ if (!args.theme) {
83
+ const themeResponse = await prompts({
84
+ type: "select",
85
+ name: "theme",
86
+ message: "Choisissez un th\xE8me:",
87
+ choices: themeOptions,
88
+ initial: 0
89
+ });
90
+ config.theme = themeResponse.theme;
91
+ } else {
92
+ config.theme = args.theme;
93
+ }
94
+ if (!args.plugins || args.plugins.length === 0) {
95
+ const pluginResponse = await prompts({
96
+ type: "multiselect",
97
+ name: "plugins",
98
+ message: "Choisissez les plugins \xE0 installer (Espace pour s\xE9lectionner, Entr\xE9e pour valider):",
99
+ choices: pluginOptions,
100
+ instructions: false
101
+ });
102
+ config.plugins = pluginResponse.plugins || [];
103
+ } else {
104
+ config.plugins = args.plugins;
105
+ }
106
+ if (!args.siteName || !args.adminName || !args.adminEmail || !args.adminPassword) {
107
+ console.log(chalk.bold("\n\u{1F4DD} Configuration du site:\n"));
108
+ const siteResponse = await prompts([
109
+ {
110
+ type: "text",
111
+ name: "siteName",
112
+ message: "Nom du site:",
113
+ initial: config.siteName
114
+ },
115
+ {
116
+ type: "text",
117
+ name: "adminName",
118
+ message: "Nom de l'administrateur:",
119
+ initial: config.adminName
120
+ },
121
+ {
122
+ type: "text",
123
+ name: "adminEmail",
124
+ message: "Email de l'administrateur:",
125
+ initial: config.adminEmail,
126
+ validate: (value) => {
127
+ if (!value) return "L'email est requis";
128
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) return "Email invalide";
129
+ return true;
130
+ }
131
+ },
132
+ {
133
+ type: "password",
134
+ name: "adminPassword",
135
+ message: "Mot de passe administrateur:",
136
+ validate: (value) => {
137
+ if (!value || value.length < 6) return "Le mot de passe doit contenir au moins 6 caract\xE8res";
138
+ return true;
139
+ }
140
+ }
141
+ ]);
142
+ config.siteName = siteResponse.siteName || config.siteName;
143
+ config.adminName = siteResponse.adminName || config.adminName;
144
+ config.adminEmail = siteResponse.adminEmail || config.adminEmail;
145
+ config.adminPassword = siteResponse.adminPassword || config.adminPassword;
146
+ } else {
147
+ config.siteName = args.siteName;
148
+ config.adminName = args.adminName;
149
+ config.adminEmail = args.adminEmail;
150
+ config.adminPassword = args.adminPassword;
151
+ }
152
+ if (args.installDeps === void 0 || args.runMigrations === void 0) {
153
+ console.log(chalk.bold("\n\u2699\uFE0F Options d'installation:\n"));
154
+ const installResponse = await prompts([
155
+ {
156
+ type: "confirm",
157
+ name: "installDeps",
158
+ message: "Installer les d\xE9pendances (composer & npm)?",
159
+ initial: true
160
+ },
161
+ {
162
+ type: "confirm",
163
+ name: "runMigrations",
164
+ message: "Ex\xE9cuter les migrations et seeder la base de donn\xE9es?",
165
+ initial: true
166
+ }
167
+ ]);
168
+ config.installDeps = installResponse.installDeps !== void 0 ? installResponse.installDeps : true;
169
+ config.runMigrations = installResponse.runMigrations !== void 0 ? installResponse.runMigrations : true;
170
+ } else {
171
+ config.installDeps = args.installDeps;
172
+ config.runMigrations = args.runMigrations;
173
+ }
174
+ return config;
175
+ }
176
+ async function downloadProject(targetDir, spinner) {
177
+ spinner.start("T\xE9l\xE9chargement d'ExilonCMS...");
178
+ const emitter = degit("Exilon-Studios/ExilonCMS", {
179
+ cache: false,
180
+ force: true,
181
+ verbose: false
182
+ });
183
+ try {
184
+ await emitter.clone(targetDir);
185
+ spinner.succeed("ExilonCMS t\xE9l\xE9charg\xE9 avec succ\xE8s");
186
+ } catch (error) {
187
+ spinner.fail("Erreur lors du t\xE9l\xE9chargement");
188
+ throw error;
189
+ }
190
+ }
191
+ async function configureProject(config, targetDir, spinner) {
192
+ spinner.start("Configuration du projet...");
193
+ try {
194
+ const envPath = path.join(targetDir, ".env");
195
+ const envExamplePath = path.join(targetDir, ".env.example");
196
+ if (await fs.pathExists(envExamplePath)) {
197
+ let envContent = await fs.readFile(envExamplePath, "utf-8");
198
+ if (config.database === "sqlite") {
199
+ envContent = envContent.replace(/DB_CONNECTION=.*/, "DB_CONNECTION=sqlite");
200
+ envContent = envContent.replace(/#DB_DATABASE=.*/, "DB_DATABASE=" + path.join(targetDir, "database", "database.sqlite"));
201
+ } else if (config.database === "postgresql") {
202
+ envContent = envContent.replace(/DB_CONNECTION=.*/, "DB_CONNECTION=pgsql");
203
+ envContent = envContent.replace(/DB_DATABASE=.*/, "DB_DATABASE=exiloncms");
204
+ envContent = envContent.replace(/DB_USERNAME=.*/, "DB_USERNAME=postgres");
205
+ } else if (config.database === "mysql") {
206
+ envContent = envContent.replace(/DB_CONNECTION=.*/, "DB_CONNECTION=mysql");
207
+ envContent = envContent.replace(/DB_DATABASE=.*/, "DB_DATABASE=exiloncms");
208
+ envContent = envContent.replace(/DB_USERNAME=.*/, "DB_USERNAME=root");
209
+ }
210
+ envContent = envContent.replace(/APP_NAME=.*/, `APP_NAME="${config.siteName}"`);
211
+ await fs.writeFile(envPath, envContent);
212
+ }
213
+ if (config.database === "sqlite") {
214
+ const dbDir = path.join(targetDir, "database");
215
+ await fs.ensureDir(dbDir);
216
+ const dbPath = path.join(dbDir, "database.sqlite");
217
+ if (!await fs.pathExists(dbPath)) {
218
+ await fs.writeFile(dbPath, "");
219
+ }
220
+ }
221
+ spinner.text = "G\xE9n\xE9ration de la cl\xE9 d'application...";
222
+ await execaCommand("php artisan key:generate --force", { cwd: targetDir, stdio: "inherit" });
223
+ spinner.succeed("Projet configur\xE9 avec succ\xE8s");
224
+ } catch (error) {
225
+ spinner.fail("Erreur lors de la configuration");
226
+ throw error;
227
+ }
228
+ }
229
+ async function installDependencies(config, targetDir, spinner) {
230
+ if (!config.installDeps) {
231
+ spinner.info("Installation des d\xE9pendances skip\xE9e");
232
+ return;
233
+ }
234
+ spinner.start("Installation des d\xE9pendances PHP (Composer)...");
235
+ try {
236
+ await execaCommand("composer install --no-interaction --quiet", { cwd: targetDir });
237
+ spinner.succeed("D\xE9pendances PHP install\xE9es");
238
+ } catch (error) {
239
+ spinner.fail("Erreur lors de l'installation Composer");
240
+ throw error;
241
+ }
242
+ spinner.start("Installation des d\xE9pendances Node.js...");
243
+ try {
244
+ await execaCommand("npm install --silent", { cwd: targetDir });
245
+ spinner.succeed("D\xE9pendances Node.js install\xE9es");
246
+ } catch (error) {
247
+ spinner.fail("Erreur lors de l'installation NPM");
248
+ throw error;
249
+ }
250
+ spinner.start("Construction des assets...");
251
+ try {
252
+ await execaCommand("npm run build", { cwd: targetDir });
253
+ spinner.succeed("Assets construits");
254
+ } catch (error) {
255
+ spinner.warn("Erreur lors du build des assets (non-critique)");
256
+ }
257
+ }
258
+ async function runMigrationsAndSeed(config, targetDir, spinner) {
259
+ if (!config.runMigrations) {
260
+ spinner.info("Migrations skip\xE9es");
261
+ return;
262
+ }
263
+ spinner.start("Ex\xE9cution des migrations et seeder...");
264
+ try {
265
+ const command = config.database === "sqlite" ? "php artisan migrate:fresh --seed --force" : "php artisan migrate --seed --force";
266
+ await execaCommand(command, {
267
+ cwd: targetDir,
268
+ stdio: "inherit"
269
+ });
270
+ spinner.succeed("Base de donn\xE9es initialis\xE9e");
271
+ } catch (error) {
272
+ spinner.fail("Erreur lors des migrations");
273
+ throw error;
274
+ }
275
+ }
276
+ async function createAdminUser(config, targetDir, spinner) {
277
+ spinner.start("Cr\xE9ation de l'utilisateur admin...");
278
+ try {
279
+ await execaCommand(
280
+ `php artisan user:create --admin --name="${config.adminName}" --email="${config.adminEmail}" --password="${config.adminPassword}"`,
281
+ { cwd: targetDir, stdio: "inherit" }
282
+ );
283
+ spinner.succeed("Utilisateur admin cr\xE9\xE9");
284
+ } catch (error) {
285
+ spinner.warn("Erreur lors de la cr\xE9ation de l'admin (peut-\xEAtre d\xE9j\xE0 cr\xE9\xE9 via seeder)");
286
+ }
287
+ }
288
+ function printSuccessMessage(config, targetDir) {
289
+ console.log(chalk.bold("\n\u2728 Installation termin\xE9e avec succ\xE8s!\n"));
290
+ console.log(chalk.cyan(" Projet cr\xE9\xE9 dans: ") + chalk.white(targetDir));
291
+ console.log(chalk.cyan(" Base de donn\xE9es: ") + chalk.white(config.database));
292
+ console.log(chalk.cyan(" Th\xE8me: ") + chalk.white(config.theme));
293
+ if (config.plugins.length > 0) {
294
+ console.log(chalk.cyan(" Plugins install\xE9s: ") + chalk.white(config.plugins.join(", ")));
295
+ }
296
+ console.log(chalk.bold("\n\u{1F680} Prochaines \xE9tapes:\n"));
297
+ console.log(` ${chalk.cyan("1.")} Aller dans le dossier du projet:`);
298
+ console.log(` ${chalk.gray(`cd ${config.projectName}`)}
299
+ `);
300
+ if (!config.installDeps) {
301
+ console.log(` ${chalk.cyan("2.")} Installer les d\xE9pendances:`);
302
+ console.log(` ${chalk.gray("composer install")}`);
303
+ console.log(` ${chalk.gray("npm install")}`);
304
+ console.log(` ${chalk.gray("npm run build")}
305
+ `);
306
+ }
307
+ if (!config.runMigrations) {
308
+ console.log(` ${chalk.cyan("3.")} Configurer la base de donn\xE9es et lancer les migrations:`);
309
+ if (config.database !== "sqlite") {
310
+ console.log(` ${chalk.yellow("\u26A0\uFE0F Configurez votre base de donn\xE9es dans .env d'abord")}`);
311
+ }
312
+ console.log(` ${chalk.gray("php artisan migrate:fresh --seed")}
313
+ `);
314
+ }
315
+ console.log(` ${chalk.cyan("4.")} D\xE9marrer le serveur de d\xE9veloppement:`);
316
+ console.log(` ${chalk.gray("php artisan serve")}
317
+ `);
318
+ if (config.database === "sqlite") {
319
+ console.log(` ${chalk.green("\u2713")} SQLite utilis\xE9 - aucune configuration de base de donn\xE9es n\xE9cessaire!
320
+ `);
321
+ } else {
322
+ console.log(` ${chalk.yellow("\u26A0\uFE0F ")} Configurez votre base de donn\xE9es ${config.database} dans ${chalk.gray(".env")}
323
+ `);
324
+ }
325
+ console.log(chalk.bold("\u{1F4E7} Identifiants admin:\n"));
326
+ console.log(` Email: ${chalk.cyan(config.adminEmail)}`);
327
+ console.log(` Password: ${chalk.cyan(config.adminPassword)}
328
+ `);
329
+ console.log(chalk.gray(" " + "\u2500".repeat(60) + "\n"));
330
+ console.log(` ${chalk.cyan("Documentation:")} https://github.com/Exilon-Studios/ExilonCMS/wiki
331
+ `);
332
+ }
333
+ async function createCommand(projectName, options) {
334
+ try {
335
+ const config = await promptForConfig({
336
+ projectName,
337
+ database: options.database,
338
+ theme: options.theme,
339
+ plugins: options.plugins ? options.plugins.split(",") : [],
340
+ siteName: options.siteName,
341
+ adminName: options.adminName,
342
+ adminEmail: options.adminEmail,
343
+ adminPassword: options.adminPassword,
344
+ installDeps: options.installDeps,
345
+ runMigrations: options.runMigrations
346
+ });
347
+ const targetDir = path.resolve(process.cwd(), config.projectName);
348
+ if (await fs.pathExists(targetDir)) {
349
+ const { overwrite } = await prompts({
350
+ type: "confirm",
351
+ name: "overwrite",
352
+ message: `Le dossier ${config.projectName} existe d\xE9j\xE0. \xC9craser?`,
353
+ initial: false
354
+ });
355
+ if (!overwrite) {
356
+ console.log(chalk.yellow("\nInstallation annul\xE9e."));
357
+ process.exit(0);
358
+ }
359
+ await fs.remove(targetDir);
360
+ }
361
+ const spinner = ora();
362
+ await downloadProject(targetDir, spinner);
363
+ await configureProject(config, targetDir, spinner);
364
+ await installDependencies(config, targetDir, spinner);
365
+ await runMigrationsAndSeed(config, targetDir, spinner);
366
+ if (!config.runMigrations) {
367
+ await createAdminUser(config, targetDir, spinner);
368
+ }
369
+ printSuccessMessage(config, targetDir);
370
+ } catch (error) {
371
+ if (error.message === "user cancelled") {
372
+ console.log(chalk.yellow("\nInstallation annul\xE9e."));
373
+ process.exit(0);
374
+ }
375
+ console.error(chalk.red("\n\u2716 Erreur:"), error.message);
376
+ process.exit(1);
377
+ }
378
+ }
379
+ var program = new Command();
380
+ program.name("exiloncms").description("Create a new ExilonCMS project").version(packageJson.version);
381
+ program.command("create [project-name]").description("Create a new ExilonCMS project").option("-d, --database <type>", "Database type (sqlite, postgresql, mysql)", "sqlite").option("-t, --theme <name>", "Theme name", "default").option("-p, --plugins <list>", "Comma-separated list of plugins").option("--site-name <name>", "Site name").option("--admin-name <name>", "Admin name").option("--admin-email <email>", "Admin email").option("--admin-password <password>", "Admin password").option("--no-install-deps", "Skip installing dependencies").option("--no-run-migrations", "Skip running migrations").action(createCommand);
382
+ program.command("new [project-name]").description("Alias for create").option("-d, --database <type>", "Database type (sqlite, postgresql, mysql)", "sqlite").option("-t, --theme <name>", "Theme name", "default").option("-p, --plugins <list>", "Comma-separated list of plugins").option("--site-name <name>", "Site name").option("--admin-name <name>", "Admin name").option("--admin-email <email>", "Admin email").option("--admin-password <password>", "Admin password").option("--no-install-deps", "Skip installing dependencies").option("--no-run-migrations", "Skip running migrations").action(createCommand);
383
+ program.parse();
384
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport prompts from 'prompts';\nimport ora from 'ora';\nimport chalk from 'chalk';\nimport { execaCommand } from 'execa';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport degit from 'degit';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst packageJson = await fs.readJson(path.join(__dirname, '../package.json'));\n\n// ASCII Art Banner\nconst banner = `\n${chalk.cyan('╔═══════════════════════════════════════════════════════════╗')}\n${chalk.cyan('║')} ${chalk.bold.white('ExilonCMS CLI')} ${chalk.gray(`v${packageJson.version}`)} ${' '.repeat(36)} ${chalk.cyan('║')}\n${chalk.cyan('║')} ${chalk.white('Create modern ExilonCMS projects with ease')} ${' '.repeat(24)} ${chalk.cyan('║')}\n${chalk.cyan('╚═══════════════════════════════════════════════════════════╝')}\n`;\n\n// Database options\nconst databaseOptions = [\n { title: 'SQLite (Recommandé - Pas de configuration)', value: 'sqlite', description: 'Base de données fichier, aucune configuration requise' },\n { title: 'PostgreSQL', value: 'postgresql', description: 'Base de données serveur, performante et robuste' },\n { title: 'MySQL', value: 'mysql', description: 'Base de données serveur, populaire et répandue' },\n];\n\n// Available themes (will be fetched from GitHub or API in the future)\nconst themeOptions = [\n { title: 'Default Theme', value: 'default', description: 'Thème par défaut d\\'ExilonCMS' },\n { title: 'Aucun thème (minimal)', value: 'none', description: 'Installation sans thème personnalisé' },\n];\n\n// Available plugins\nconst pluginOptions = [\n { title: 'Shop Plugin - Boutique en ligne', value: 'shop', description: 'Système complet de boutique avec panier, paiements...' },\n { title: 'Discord Plugin - Intégration Discord', value: 'discord', description: 'Authentification et notifications Discord' },\n { title: 'Analytics Plugin - Statistiques', value: 'analytics', description: 'Suivi des statistiques et analytics' },\n];\n\ninterface ProjectConfig {\n projectName: string;\n database: string;\n theme: string;\n plugins: string[];\n siteName: string;\n adminName: string;\n adminEmail: string;\n adminPassword: string;\n installDeps: boolean;\n runMigrations: boolean;\n}\n\nfunction validateProjectName(name: string): boolean {\n return /^[a-zA-Z0-9_-]+$/.test(name);\n}\n\nasync function promptForConfig(args: Partial<ProjectConfig> = {}): Promise<ProjectConfig> {\n console.log(banner);\n\n const config: ProjectConfig = {\n projectName: '',\n database: 'sqlite',\n theme: 'default',\n plugins: [],\n siteName: 'Mon Site ExilonCMS',\n adminName: 'Admin',\n adminEmail: 'admin@example.com',\n adminPassword: 'password',\n installDeps: true,\n runMigrations: true,\n };\n\n // Project Name\n if (!args.projectName) {\n const nameResponse = await prompts({\n type: 'text',\n name: 'projectName',\n message: 'Nom du projet:',\n initial: 'mon-site-exiloncms',\n validate: (value: string) => {\n if (!value) return 'Le nom du projet est requis';\n if (!validateProjectName(value)) return 'Le nom ne peut contenir que des lettres, chiffres, tirets et underscores';\n return true;\n },\n });\n config.projectName = nameResponse.projectName;\n } else {\n config.projectName = args.projectName;\n }\n\n // Database Selection\n if (!args.database) {\n const dbResponse = await prompts({\n type: 'select',\n name: 'database',\n message: 'Choisissez la base de données:',\n choices: databaseOptions,\n initial: 0,\n });\n config.database = dbResponse.database;\n } else {\n config.database = args.database;\n }\n\n // Theme Selection\n if (!args.theme) {\n const themeResponse = await prompts({\n type: 'select',\n name: 'theme',\n message: 'Choisissez un thème:',\n choices: themeOptions,\n initial: 0,\n });\n config.theme = themeResponse.theme;\n } else {\n config.theme = args.theme;\n }\n\n // Plugin Selection\n if (!args.plugins || args.plugins.length === 0) {\n const pluginResponse = await prompts({\n type: 'multiselect',\n name: 'plugins',\n message: 'Choisissez les plugins à installer (Espace pour sélectionner, Entrée pour valider):',\n choices: pluginOptions,\n instructions: false,\n });\n config.plugins = pluginResponse.plugins || [];\n } else {\n config.plugins = args.plugins;\n }\n\n // Site Configuration\n if (!args.siteName || !args.adminName || !args.adminEmail || !args.adminPassword) {\n console.log(chalk.bold('\\n📝 Configuration du site:\\n'));\n\n const siteResponse = await prompts([\n {\n type: 'text',\n name: 'siteName',\n message: 'Nom du site:',\n initial: config.siteName,\n },\n {\n type: 'text',\n name: 'adminName',\n message: 'Nom de l\\'administrateur:',\n initial: config.adminName,\n },\n {\n type: 'text',\n name: 'adminEmail',\n message: 'Email de l\\'administrateur:',\n initial: config.adminEmail,\n validate: (value: string) => {\n if (!value) return 'L\\'email est requis';\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) return 'Email invalide';\n return true;\n },\n },\n {\n type: 'password',\n name: 'adminPassword',\n message: 'Mot de passe administrateur:',\n validate: (value: string) => {\n if (!value || value.length < 6) return 'Le mot de passe doit contenir au moins 6 caractères';\n return true;\n },\n },\n ]);\n\n config.siteName = siteResponse.siteName || config.siteName;\n config.adminName = siteResponse.adminName || config.adminName;\n config.adminEmail = siteResponse.adminEmail || config.adminEmail;\n config.adminPassword = siteResponse.adminPassword || config.adminPassword;\n } else {\n config.siteName = args.siteName;\n config.adminName = args.adminName;\n config.adminEmail = args.adminEmail;\n config.adminPassword = args.adminPassword;\n }\n\n // Post-install options\n if (args.installDeps === undefined || args.runMigrations === undefined) {\n console.log(chalk.bold('\\n⚙️ Options d\\'installation:\\n'));\n\n const installResponse = await prompts([\n {\n type: 'confirm',\n name: 'installDeps',\n message: 'Installer les dépendances (composer & npm)?',\n initial: true,\n },\n {\n type: 'confirm',\n name: 'runMigrations',\n message: 'Exécuter les migrations et seeder la base de données?',\n initial: true,\n },\n ]);\n\n config.installDeps = installResponse.installDeps !== undefined ? installResponse.installDeps : true;\n config.runMigrations = installResponse.runMigrations !== undefined ? installResponse.runMigrations : true;\n } else {\n config.installDeps = args.installDeps;\n config.runMigrations = args.runMigrations;\n }\n\n return config;\n}\n\nasync function downloadProject(targetDir: string, spinner: ReturnType<typeof ora>): Promise<void> {\n spinner.start('Téléchargement d\\'ExilonCMS...');\n\n const emitter = degit('Exilon-Studios/ExilonCMS', {\n cache: false,\n force: true,\n verbose: false,\n });\n\n try {\n await emitter.clone(targetDir);\n spinner.succeed('ExilonCMS téléchargé avec succès');\n } catch (error) {\n spinner.fail('Erreur lors du téléchargement');\n throw error;\n }\n}\n\nasync function configureProject(config: ProjectConfig, targetDir: string, spinner: ReturnType<typeof ora>): Promise<void> {\n spinner.start('Configuration du projet...');\n\n try {\n // Configure .env file\n const envPath = path.join(targetDir, '.env');\n const envExamplePath = path.join(targetDir, '.env.example');\n\n if (await fs.pathExists(envExamplePath)) {\n let envContent = await fs.readFile(envExamplePath, 'utf-8');\n\n // Set database configuration\n if (config.database === 'sqlite') {\n envContent = envContent.replace(/DB_CONNECTION=.*/, 'DB_CONNECTION=sqlite');\n envContent = envContent.replace(/#DB_DATABASE=.*/, 'DB_DATABASE=' + path.join(targetDir, 'database', 'database.sqlite'));\n } else if (config.database === 'postgresql') {\n envContent = envContent.replace(/DB_CONNECTION=.*/, 'DB_CONNECTION=pgsql');\n envContent = envContent.replace(/DB_DATABASE=.*/, 'DB_DATABASE=exiloncms');\n envContent = envContent.replace(/DB_USERNAME=.*/, 'DB_USERNAME=postgres');\n } else if (config.database === 'mysql') {\n envContent = envContent.replace(/DB_CONNECTION=.*/, 'DB_CONNECTION=mysql');\n envContent = envContent.replace(/DB_DATABASE=.*/, 'DB_DATABASE=exiloncms');\n envContent = envContent.replace(/DB_USERNAME=.*/, 'DB_USERNAME=root');\n }\n\n // Set app name\n envContent = envContent.replace(/APP_NAME=.*/, `APP_NAME=\"${config.siteName}\"`);\n\n await fs.writeFile(envPath, envContent);\n }\n\n // Create SQLite database if selected\n if (config.database === 'sqlite') {\n const dbDir = path.join(targetDir, 'database');\n await fs.ensureDir(dbDir);\n const dbPath = path.join(dbDir, 'database.sqlite');\n if (!(await fs.pathExists(dbPath))) {\n await fs.writeFile(dbPath, '');\n }\n }\n\n // Generate APP_KEY\n spinner.text = 'Génération de la clé d\\'application...';\n await execaCommand('php artisan key:generate --force', { cwd: targetDir, stdio: 'inherit' });\n\n spinner.succeed('Projet configuré avec succès');\n } catch (error) {\n spinner.fail('Erreur lors de la configuration');\n throw error;\n }\n}\n\nasync function installDependencies(config: ProjectConfig, targetDir: string, spinner: ReturnType<typeof ora>): Promise<void> {\n if (!config.installDeps) {\n spinner.info('Installation des dépendances skipée');\n return;\n }\n\n // Composer\n spinner.start('Installation des dépendances PHP (Composer)...');\n try {\n await execaCommand('composer install --no-interaction --quiet', { cwd: targetDir });\n spinner.succeed('Dépendances PHP installées');\n } catch (error) {\n spinner.fail('Erreur lors de l\\'installation Composer');\n throw error;\n }\n\n // NPM\n spinner.start('Installation des dépendances Node.js...');\n try {\n await execaCommand('npm install --silent', { cwd: targetDir });\n spinner.succeed('Dépendances Node.js installées');\n } catch (error) {\n spinner.fail('Erreur lors de l\\'installation NPM');\n throw error;\n }\n\n // Build assets\n spinner.start('Construction des assets...');\n try {\n await execaCommand('npm run build', { cwd: targetDir });\n spinner.succeed('Assets construits');\n } catch (error) {\n spinner.warn('Erreur lors du build des assets (non-critique)');\n }\n}\n\nasync function runMigrationsAndSeed(config: ProjectConfig, targetDir: string, spinner: ReturnType<typeof ora>): Promise<void> {\n if (!config.runMigrations) {\n spinner.info('Migrations skipées');\n return;\n }\n\n spinner.start('Exécution des migrations et seeder...');\n try {\n // For SQLite, we use migrate:fresh which is safe for fresh install\n const command = config.database === 'sqlite'\n ? 'php artisan migrate:fresh --seed --force'\n : 'php artisan migrate --seed --force';\n\n await execaCommand(command, {\n cwd: targetDir,\n stdio: 'inherit',\n });\n\n spinner.succeed('Base de données initialisée');\n } catch (error) {\n spinner.fail('Erreur lors des migrations');\n throw error;\n }\n}\n\nasync function createAdminUser(config: ProjectConfig, targetDir: string, spinner: ReturnType<typeof ora>): Promise<void> {\n spinner.start('Création de l\\'utilisateur admin...');\n try {\n await execaCommand(\n `php artisan user:create --admin --name=\"${config.adminName}\" --email=\"${config.adminEmail}\" --password=\"${config.adminPassword}\"`,\n { cwd: targetDir, stdio: 'inherit' }\n );\n spinner.succeed('Utilisateur admin créé');\n } catch (error) {\n spinner.warn('Erreur lors de la création de l\\'admin (peut-être déjà créé via seeder)');\n }\n}\n\nfunction printSuccessMessage(config: ProjectConfig, targetDir: string): void {\n console.log(chalk.bold('\\n✨ Installation terminée avec succès!\\n'));\n\n console.log(chalk.cyan(' Projet créé dans: ') + chalk.white(targetDir));\n console.log(chalk.cyan(' Base de données: ') + chalk.white(config.database));\n console.log(chalk.cyan(' Thème: ') + chalk.white(config.theme));\n\n if (config.plugins.length > 0) {\n console.log(chalk.cyan(' Plugins installés: ') + chalk.white(config.plugins.join(', ')));\n }\n\n console.log(chalk.bold('\\n🚀 Prochaines étapes:\\n'));\n\n console.log(` ${chalk.cyan('1.')} Aller dans le dossier du projet:`);\n console.log(` ${chalk.gray(`cd ${config.projectName}`)}\\n`);\n\n if (!config.installDeps) {\n console.log(` ${chalk.cyan('2.')} Installer les dépendances:`);\n console.log(` ${chalk.gray('composer install')}`);\n console.log(` ${chalk.gray('npm install')}`);\n console.log(` ${chalk.gray('npm run build')}\\n`);\n }\n\n if (!config.runMigrations) {\n console.log(` ${chalk.cyan('3.')} Configurer la base de données et lancer les migrations:`);\n if (config.database !== 'sqlite') {\n console.log(` ${chalk.yellow('⚠️ Configurez votre base de données dans .env d\\'abord')}`);\n }\n console.log(` ${chalk.gray('php artisan migrate:fresh --seed')}\\n`);\n }\n\n console.log(` ${chalk.cyan('4.')} Démarrer le serveur de développement:`);\n console.log(` ${chalk.gray('php artisan serve')}\\n`);\n\n if (config.database === 'sqlite') {\n console.log(` ${chalk.green('✓')} SQLite utilisé - aucune configuration de base de données nécessaire!\\n`);\n } else {\n console.log(` ${chalk.yellow('⚠️ ')} Configurez votre base de données ${config.database} dans ${chalk.gray('.env')}\\n`);\n }\n\n console.log(chalk.bold('📧 Identifiants admin:\\n'));\n console.log(` Email: ${chalk.cyan(config.adminEmail)}`);\n console.log(` Password: ${chalk.cyan(config.adminPassword)}\\n`);\n\n console.log(chalk.gray(' ' + '─'.repeat(60) + '\\n'));\n\n console.log(` ${chalk.cyan('Documentation:')} https://github.com/Exilon-Studios/ExilonCMS/wiki\\n`);\n}\n\nasync function createCommand(projectName: string, options: any): Promise<void> {\n try {\n const config = await promptForConfig({\n projectName,\n database: options.database,\n theme: options.theme,\n plugins: options.plugins ? options.plugins.split(',') : [],\n siteName: options.siteName,\n adminName: options.adminName,\n adminEmail: options.adminEmail,\n adminPassword: options.adminPassword,\n installDeps: options.installDeps,\n runMigrations: options.runMigrations,\n });\n\n const targetDir = path.resolve(process.cwd(), config.projectName);\n\n // Check if directory exists\n if (await fs.pathExists(targetDir)) {\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: `Le dossier ${config.projectName} existe déjà. Écraser?`,\n initial: false,\n });\n\n if (!overwrite) {\n console.log(chalk.yellow('\\nInstallation annulée.'));\n process.exit(0);\n }\n\n await fs.remove(targetDir);\n }\n\n const spinner = ora();\n\n // Download project\n await downloadProject(targetDir, spinner);\n\n // Configure project\n await configureProject(config, targetDir, spinner);\n\n // Install dependencies\n await installDependencies(config, targetDir, spinner);\n\n // Run migrations\n await runMigrationsAndSeed(config, targetDir, spinner);\n\n // Create admin user (if not using seeder)\n if (!config.runMigrations) {\n await createAdminUser(config, targetDir, spinner);\n }\n\n // Print success message\n printSuccessMessage(config, targetDir);\n\n } catch (error: any) {\n if (error.message === 'user cancelled') {\n console.log(chalk.yellow('\\nInstallation annulée.'));\n process.exit(0);\n }\n\n console.error(chalk.red('\\n✖ Erreur:'), error.message);\n process.exit(1);\n }\n}\n\n// CLI Program\nconst program = new Command();\n\nprogram\n .name('exiloncms')\n .description('Create a new ExilonCMS project')\n .version(packageJson.version);\n\nprogram\n .command('create [project-name]')\n .description('Create a new ExilonCMS project')\n .option('-d, --database <type>', 'Database type (sqlite, postgresql, mysql)', 'sqlite')\n .option('-t, --theme <name>', 'Theme name', 'default')\n .option('-p, --plugins <list>', 'Comma-separated list of plugins')\n .option('--site-name <name>', 'Site name')\n .option('--admin-name <name>', 'Admin name')\n .option('--admin-email <email>', 'Admin email')\n .option('--admin-password <password>', 'Admin password')\n .option('--no-install-deps', 'Skip installing dependencies')\n .option('--no-run-migrations', 'Skip running migrations')\n .action(createCommand);\n\nprogram\n .command('new [project-name]')\n .description('Alias for create')\n .option('-d, --database <type>', 'Database type (sqlite, postgresql, mysql)', 'sqlite')\n .option('-t, --theme <name>', 'Theme name', 'default')\n .option('-p, --plugins <list>', 'Comma-separated list of plugins')\n .option('--site-name <name>', 'Site name')\n .option('--admin-name <name>', 'Admin name')\n .option('--admin-email <email>', 'Admin email')\n .option('--admin-password <password>', 'Admin password')\n .option('--no-install-deps', 'Skip installing dependencies')\n .option('--no-run-migrations', 'Skip running migrations')\n .action(createCommand);\n\nprogram.parse();\n"],"mappings":";;;;AACA,SAAS,eAAe;AACxB,OAAO,aAAa;AACpB,OAAO,SAAS;AAChB,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,OAAO,WAAW;AAElB,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,KAAK,QAAQ,UAAU;AAEzC,IAAM,cAAc,MAAM,GAAG,SAAS,KAAK,KAAK,WAAW,iBAAiB,CAAC;AAG7E,IAAM,SAAS;AAAA,EACb,MAAM,KAAK,gXAA+D,CAAC;AAAA,EAC3E,MAAM,KAAK,QAAG,CAAC,IAAI,MAAM,KAAK,MAAM,eAAe,CAAC,IAAI,MAAM,KAAK,IAAI,YAAY,OAAO,EAAE,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,IAAI,MAAM,KAAK,QAAG,CAAC;AAAA,EAClI,MAAM,KAAK,QAAG,CAAC,IAAI,MAAM,MAAM,4CAA4C,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,IAAI,MAAM,KAAK,QAAG,CAAC;AAAA,EACjH,MAAM,KAAK,gXAA+D,CAAC;AAAA;AAI7E,IAAM,kBAAkB;AAAA,EACtB,EAAE,OAAO,iDAA8C,OAAO,UAAU,aAAa,2DAAwD;AAAA,EAC7I,EAAE,OAAO,cAAc,OAAO,cAAc,aAAa,qDAAkD;AAAA,EAC3G,EAAE,OAAO,SAAS,OAAO,SAAS,aAAa,uDAAiD;AAClG;AAGA,IAAM,eAAe;AAAA,EACnB,EAAE,OAAO,iBAAiB,OAAO,WAAW,aAAa,qCAAgC;AAAA,EACzF,EAAE,OAAO,4BAAyB,OAAO,QAAQ,aAAa,6CAAuC;AACvG;AAGA,IAAM,gBAAgB;AAAA,EACpB,EAAE,OAAO,mCAAmC,OAAO,QAAQ,aAAa,2D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QAAQ,oBAAoB,EAC5B,YAAY,kBAAkB,EAC9B,OAAO,yBAAyB,6CAA6C,QAAQ,EACrF,OAAO,sBAAsB,cAAc,SAAS,EACpD,OAAO,wBAAwB,iCAAiC,EAChE,OAAO,sBAAsB,WAAW,EACxC,OAAO,uBAAuB,YAAY,EAC1C,OAAO,yBAAyB,aAAa,EAC7C,OAAO,+BAA+B,gBAAgB,EACtD,OAAO,qBAAqB,8BAA8B,EAC1D,OAAO,uBAAuB,yBAAyB,EACvD,OAAO,aAAa;AAEvB,QAAQ,MAAM;","names":[]}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@exiloncms/cli",
3
+ "version": "1.0.0",
4
+ "description": "Interactive CLI to create new ExilonCMS projects",
5
+ "type": "module",
6
+ "bin": {
7
+ "exiloncms": "./dist/index.js",
8
+ "create-exiloncms": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "templates"
13
+ ],
14
+ "scripts": {
15
+ "dev": "tsx src/index.ts",
16
+ "build": "tsup",
17
+ "start": "node dist/index.js",
18
+ "typecheck": "tsc --noEmit",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "keywords": [
22
+ "exiloncms",
23
+ "cms",
24
+ "cli",
25
+ "scaffold",
26
+ "generator"
27
+ ],
28
+ "author": "Exilon Studios",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/Exilon-Studios/exiloncms-cli"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/Exilon-Studios/exiloncms-cli/issues"
36
+ },
37
+ "homepage": "https://github.com/Exilon-Studios/exiloncms-cli#readme",
38
+ "dependencies": {
39
+ "chalk": "^5.3.0",
40
+ "commander": "^12.1.0",
41
+ "degit": "^2.8.4",
42
+ "execa": "^9.4.0",
43
+ "fs-extra": "^11.2.0",
44
+ "ora": "^8.1.0",
45
+ "prompts": "^2.4.2"
46
+ },
47
+ "devDependencies": {
48
+ "@types/degit": "^2.8.6",
49
+ "@types/fs-extra": "^11.0.4",
50
+ "@types/node": "^22.10.2",
51
+ "@types/prompts": "^2.4.9",
52
+ "tsup": "^8.3.5",
53
+ "tsx": "^4.19.2",
54
+ "typescript": "^5.7.2"
55
+ },
56
+ "engines": {
57
+ "node": ">=18.0.0"
58
+ }
59
+ }