vako 1.3.14 → 1.3.15

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.
@@ -106,36 +106,105 @@ class SetupExecutor {
106
106
  }
107
107
 
108
108
  getDirectoriesForTemplate() {
109
- const baseDirectories = [
110
- 'views',
111
- 'views/layouts',
112
- 'views/partials',
113
- 'views/components',
114
- 'routes',
115
- 'routes/api',
116
- 'public',
117
- 'public/css',
118
- 'public/js',
119
- 'public/images',
120
- 'config',
121
- 'middleware',
122
- 'plugins',
123
- 'data',
124
- 'utils'
125
- ];
126
-
127
- const templateDirectories = {
128
- blog: ['content', 'content/posts', 'admin', 'uploads'],
129
- admin: ['admin', 'admin/views', 'dashboard'],
130
- ecommerce: ['shop', 'products', 'orders', 'cart'],
131
- portfolio: ['portfolio', 'projects', 'gallery'],
132
- pwa: ['pwa', 'sw', 'manifest', 'offline']
133
- };
134
-
135
- return [
136
- ...baseDirectories,
137
- ...(templateDirectories[this.config.template] || [])
138
- ];
109
+ const { codeType } = this.config;
110
+
111
+ // Structure de base pour EJS
112
+ if (codeType === 'ejs' || !codeType) {
113
+ const baseDirectories = [
114
+ 'views',
115
+ 'views/layouts',
116
+ 'views/partials',
117
+ 'views/components',
118
+ 'routes',
119
+ 'routes/api',
120
+ 'public',
121
+ 'public/css',
122
+ 'public/js',
123
+ 'public/images',
124
+ 'config',
125
+ 'middleware',
126
+ 'plugins',
127
+ 'data',
128
+ 'utils',
129
+ 'locales' // Dossier pour les traductions
130
+ ];
131
+
132
+ const templateDirectories = {
133
+ blog: ['content', 'content/posts', 'admin', 'uploads'],
134
+ admin: ['admin', 'admin/views', 'dashboard'],
135
+ ecommerce: ['shop', 'products', 'orders', 'cart'],
136
+ portfolio: ['portfolio', 'projects', 'gallery'],
137
+ pwa: ['pwa', 'sw', 'manifest', 'offline']
138
+ };
139
+
140
+ return [
141
+ ...baseDirectories,
142
+ ...(templateDirectories[this.config.template] || [])
143
+ ];
144
+ }
145
+
146
+ // Structure pour TypeScript
147
+ if (codeType === 'typescript') {
148
+ const baseDirectories = [
149
+ 'src',
150
+ 'src/routes',
151
+ 'src/routes/api',
152
+ 'src/middleware',
153
+ 'src/utils',
154
+ 'src/types',
155
+ 'src/config',
156
+ 'views',
157
+ 'views/layouts',
158
+ 'public',
159
+ 'public/css',
160
+ 'public/js',
161
+ 'public/images',
162
+ 'config',
163
+ 'plugins',
164
+ 'data'
165
+ ];
166
+
167
+ const templateDirectories = {
168
+ blog: ['src/content', 'src/admin', 'uploads'],
169
+ admin: ['src/admin', 'src/dashboard'],
170
+ ecommerce: ['src/shop', 'src/products', 'src/orders'],
171
+ portfolio: ['src/portfolio', 'src/projects', 'src/gallery']
172
+ };
173
+
174
+ return [
175
+ ...baseDirectories,
176
+ ...(templateDirectories[this.config.template] || [])
177
+ ];
178
+ }
179
+
180
+ // Structure pour Next.js
181
+ if (codeType === 'nextjs') {
182
+ const baseDirectories = [
183
+ 'src',
184
+ 'src/app',
185
+ 'src/app/api',
186
+ 'src/components',
187
+ 'src/lib',
188
+ 'src/types',
189
+ 'public',
190
+ 'public/images',
191
+ 'config',
192
+ 'plugins'
193
+ ];
194
+
195
+ const templateDirectories = {
196
+ blog: ['src/app/blog', 'src/app/admin', 'src/content'],
197
+ admin: ['src/app/admin', 'src/app/dashboard'],
198
+ portfolio: ['src/app/portfolio', 'src/app/projects']
199
+ };
200
+
201
+ return [
202
+ ...baseDirectories,
203
+ ...(templateDirectories[this.config.template] || [])
204
+ ];
205
+ }
206
+
207
+ return [];
139
208
  }
140
209
 
141
210
  async generateTemplateFiles() {
@@ -168,8 +237,11 @@ class SetupExecutor {
168
237
  }
169
238
 
170
239
  generateEjsFiles() {
171
- const { projectName, description, author, license } = this.config;
240
+ const { projectName, description, author, license, language } = this.config;
172
241
  const files = {};
242
+
243
+ // Générer les fichiers de traduction selon la langue
244
+ const translations = this.getTranslations(language);
173
245
 
174
246
  // package.json
175
247
  files['package.json'] = JSON.stringify({
@@ -18,6 +18,7 @@ class SetupWizard {
18
18
  projectName: '',
19
19
  template: 'default',
20
20
  codeType: 'ejs', // 'ejs', 'typescript', 'nextjs'
21
+ language: 'fr', // 'fr', 'en', 'es', 'de', etc.
21
22
  features: [],
22
23
  database: 'sqlite',
23
24
  auth: { enabled: false },
@@ -248,6 +249,72 @@ class SetupWizard {
248
249
  console.log(chalk.gray(`\n✓ Selected: ${selectedChoice.description}\n`));
249
250
  }
250
251
 
252
+ /**
253
+ * Sélection de la langue du site
254
+ */
255
+ async selectLanguage() {
256
+ console.log(chalk.blue.bold('\n🌍 Choose Your Site Language\n'));
257
+
258
+ const languageChoices = [
259
+ {
260
+ name: '🇫🇷 Français - French',
261
+ value: 'fr',
262
+ description: 'French language for your site'
263
+ },
264
+ {
265
+ name: '🇬🇧 English - English',
266
+ value: 'en',
267
+ description: 'English language for your site'
268
+ },
269
+ {
270
+ name: '🇪🇸 Español - Spanish',
271
+ value: 'es',
272
+ description: 'Spanish language for your site'
273
+ },
274
+ {
275
+ name: '🇩🇪 Deutsch - German',
276
+ value: 'de',
277
+ description: 'German language for your site'
278
+ },
279
+ {
280
+ name: '🇮🇹 Italiano - Italian',
281
+ value: 'it',
282
+ description: 'Italian language for your site'
283
+ },
284
+ {
285
+ name: '🇵🇹 Português - Portuguese',
286
+ value: 'pt',
287
+ description: 'Portuguese language for your site'
288
+ },
289
+ {
290
+ name: '🇳🇱 Nederlands - Dutch',
291
+ value: 'nl',
292
+ description: 'Dutch language for your site'
293
+ },
294
+ {
295
+ name: '🌐 Multi-language - Multiple languages',
296
+ value: 'multi',
297
+ description: 'Support for multiple languages'
298
+ }
299
+ ];
300
+
301
+ const { language } = await inquirer.prompt([{
302
+ type: 'list',
303
+ name: 'language',
304
+ message: '🌍 Select the language for your site:',
305
+ choices: languageChoices.map(choice => ({
306
+ name: choice.name,
307
+ value: choice.value
308
+ })),
309
+ pageSize: 10
310
+ }]);
311
+
312
+ this.config.language = language;
313
+
314
+ const selectedChoice = languageChoices.find(c => c.value === language);
315
+ console.log(chalk.gray(`\n✓ Selected: ${selectedChoice.description}\n`));
316
+ }
317
+
251
318
  /**
252
319
  * Sélection du template de projet
253
320
  */
@@ -584,12 +651,19 @@ class SetupWizard {
584
651
  * Génération du résumé de configuration
585
652
  */
586
653
  generateSummary() {
587
- const { projectName, template, features, database, auth, plugins, styling, theme } = this.config;
654
+ const { projectName, template, features, database, auth, plugins, styling, theme, codeType } = this.config;
655
+
656
+ const codeTypeLabels = {
657
+ 'ejs': '📄 EJS',
658
+ 'typescript': '📘 TypeScript',
659
+ 'nextjs': '⚛️ Next.js'
660
+ };
588
661
 
589
662
  return chalk.white(`
590
663
  🏷️ Project: ${chalk.cyan.bold(projectName)}
591
664
  📝 Description: ${chalk.gray(this.config.description)}
592
665
  👤 Author: ${chalk.green(this.config.author)}
666
+ 💻 Code Type: ${chalk.cyan(codeTypeLabels[codeType] || codeType)}
593
667
  🎨 Template: ${chalk.yellow(template)}
594
668
  🗄️ Database: ${chalk.blue(database)}
595
669
  🔐 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.14');
24
+ .version('1.3.15');
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.14",
3
+ "version": "1.3.15",
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",