vako 1.3.15 → 1.3.17

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.
@@ -317,8 +317,9 @@ module.exports = router;
317
317
  `;
318
318
 
319
319
  // views/index.ejs
320
+ const langAttr = language === 'multi' ? 'fr' : language;
320
321
  files['views/index.ejs'] = `<!DOCTYPE html>
321
- <html lang="en">
322
+ <html lang="${langAttr}">
322
323
  <head>
323
324
  <meta charset="UTF-8">
324
325
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -326,11 +327,30 @@ module.exports = router;
326
327
  </head>
327
328
  <body>
328
329
  <h1><%= title %></h1>
329
- <p>Welcome to your Vako application!</p>
330
+ <p>${translations.welcome || 'Welcome to your Vako application!'}</p>
330
331
  </body>
331
332
  </html>
332
333
  `;
333
334
 
335
+ // Créer les fichiers de traduction
336
+ if (language === 'multi') {
337
+ files['locales/fr.json'] = JSON.stringify({
338
+ welcome: 'Bienvenue dans votre application Vako!',
339
+ title: 'Bienvenue sur ${projectName}'
340
+ }, null, 2);
341
+ files['locales/en.json'] = JSON.stringify({
342
+ welcome: 'Welcome to your Vako application!',
343
+ title: 'Welcome to ${projectName}'
344
+ }, null, 2);
345
+ files['locales/es.json'] = JSON.stringify({
346
+ welcome: '¡Bienvenido a tu aplicación Vako!',
347
+ title: 'Bienvenido a ${projectName}'
348
+ }, null, 2);
349
+ } else {
350
+ // Fichier de traduction pour une seule langue
351
+ files[`locales/${language}.json`] = JSON.stringify(translations, null, 2);
352
+ }
353
+
334
354
  // public/css/style.css
335
355
  files['public/css/style.css'] = `body {
336
356
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
@@ -790,6 +810,48 @@ module.exports = router;
790
810
  }
791
811
  }
792
812
 
813
+ getTranslations(language) {
814
+ const translations = {
815
+ fr: {
816
+ welcome: 'Bienvenue dans votre application Vako!',
817
+ title: 'Bienvenue sur',
818
+ description: 'Une application web moderne construite avec Vako'
819
+ },
820
+ en: {
821
+ welcome: 'Welcome to your Vako application!',
822
+ title: 'Welcome to',
823
+ description: 'A modern web application built with Vako'
824
+ },
825
+ es: {
826
+ welcome: '¡Bienvenido a tu aplicación Vako!',
827
+ title: 'Bienvenido a',
828
+ description: 'Una aplicación web moderna construida con Vako'
829
+ },
830
+ de: {
831
+ welcome: 'Willkommen in Ihrer Vako-Anwendung!',
832
+ title: 'Willkommen bei',
833
+ description: 'Eine moderne Webanwendung, die mit Vako erstellt wurde'
834
+ },
835
+ it: {
836
+ welcome: 'Benvenuto nella tua applicazione Vako!',
837
+ title: 'Benvenuto in',
838
+ description: 'Un\'applicazione web moderna costruita con Vako'
839
+ },
840
+ pt: {
841
+ welcome: 'Bem-vindo à sua aplicação Vako!',
842
+ title: 'Bem-vindo a',
843
+ description: 'Uma aplicação web moderna construída com Vako'
844
+ },
845
+ nl: {
846
+ welcome: 'Welkom bij uw Vako-applicatie!',
847
+ title: 'Welkom bij',
848
+ description: 'Een moderne webapplicatie gebouwd met Vako'
849
+ }
850
+ };
851
+
852
+ return translations[language] || translations.en;
853
+ }
854
+
793
855
  sleep(ms) {
794
856
  return new Promise(resolve => setTimeout(resolve, ms));
795
857
  }
@@ -93,6 +93,17 @@ class SetupWizard {
93
93
  console.clear();
94
94
  await this.showWelcome();
95
95
  await this.gatherProjectInfo();
96
+
97
+ // Sélection du type de code (EJS, TypeScript, Next.js)
98
+ if (typeof this.selectCodeType === 'function') {
99
+ await this.selectCodeType();
100
+ }
101
+
102
+ // Sélection de la langue du site
103
+ if (typeof this.selectLanguage === 'function') {
104
+ await this.selectLanguage();
105
+ }
106
+
96
107
  await this.selectTemplate();
97
108
  await this.selectFeatures();
98
109
  await this.configureDatabase();
@@ -232,21 +243,28 @@ class SetupWizard {
232
243
  }
233
244
  ];
234
245
 
235
- const { codeType } = await inquirer.prompt([{
236
- type: 'list',
237
- name: 'codeType',
238
- message: '🎯 Select your preferred code type:',
239
- choices: codeTypeChoices.map(choice => ({
240
- name: choice.name,
241
- value: choice.value
242
- })),
243
- pageSize: 10
244
- }]);
246
+ try {
247
+ const { codeType } = await inquirer.prompt([{
248
+ type: 'list',
249
+ name: 'codeType',
250
+ message: '🎯 Select your preferred code type:',
251
+ choices: codeTypeChoices.map(choice => ({
252
+ name: choice.name,
253
+ value: choice.value
254
+ })),
255
+ pageSize: 10
256
+ }]);
245
257
 
246
- this.config.codeType = codeType;
247
-
248
- const selectedChoice = codeTypeChoices.find(c => c.value === codeType);
249
- console.log(chalk.gray(`\n✓ Selected: ${selectedChoice.description}\n`));
258
+ this.config.codeType = codeType || 'ejs'; // Par défaut EJS
259
+
260
+ const selectedChoice = codeTypeChoices.find(c => c.value === codeType);
261
+ if (selectedChoice) {
262
+ console.log(chalk.gray(`\n✓ Selected: ${selectedChoice.description}\n`));
263
+ }
264
+ } catch (error) {
265
+ console.error(chalk.red('Error selecting code type:'), error.message);
266
+ this.config.codeType = 'ejs'; // Par défaut EJS en cas d'erreur
267
+ }
250
268
  }
251
269
 
252
270
  /**
@@ -651,19 +669,31 @@ class SetupWizard {
651
669
  * Génération du résumé de configuration
652
670
  */
653
671
  generateSummary() {
654
- const { projectName, template, features, database, auth, plugins, styling, theme, codeType } = this.config;
672
+ const { projectName, template, features, database, auth, plugins, styling, theme, codeType, language } = this.config;
655
673
 
656
674
  const codeTypeLabels = {
657
675
  'ejs': '📄 EJS',
658
676
  'typescript': '📘 TypeScript',
659
677
  'nextjs': '⚛️ Next.js'
660
678
  };
679
+
680
+ const languageLabels = {
681
+ 'fr': '🇫🇷 Français',
682
+ 'en': '🇬🇧 English',
683
+ 'es': '🇪🇸 Español',
684
+ 'de': '🇩🇪 Deutsch',
685
+ 'it': '🇮🇹 Italiano',
686
+ 'pt': '🇵🇹 Português',
687
+ 'nl': '🇳🇱 Nederlands',
688
+ 'multi': '🌐 Multi-language'
689
+ };
661
690
 
662
691
  return chalk.white(`
663
692
  🏷️ Project: ${chalk.cyan.bold(projectName)}
664
693
  📝 Description: ${chalk.gray(this.config.description)}
665
694
  👤 Author: ${chalk.green(this.config.author)}
666
695
  💻 Code Type: ${chalk.cyan(codeTypeLabels[codeType] || codeType)}
696
+ 🌍 Language: ${chalk.magenta(languageLabels[language] || language)}
667
697
  🎨 Template: ${chalk.yellow(template)}
668
698
  🗄️ Database: ${chalk.blue(database)}
669
699
  🔐 Auth: ${chalk.magenta(auth.enabled ? '✅ Enabled' : '❌ Disabled')}
package/bin/vako.js CHANGED
@@ -21,7 +21,7 @@ const program = new Command();
21
21
  program
22
22
  .name('vako')
23
23
  .description('Vako Framework CLI')
24
- .version('1.3.15');
24
+ .version('1.3.17');
25
25
 
26
26
  // ============= DEV COMMAND =============
27
27
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vako",
3
- "version": "1.3.15",
3
+ "version": "1.3.17",
4
4
  "description": "🚀 Ultra-modern Node.js framework with hot reload, plugins, authentication, TypeScript support, and Next.js integration",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",