vako 1.3.3 → 1.3.5
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/CHANGELOG.md +5 -5
- package/bin/commands/setup-executor.js +154 -13
- package/bin/commands/setup.js +10 -10
- package/bin/create-veko-app.js +5 -5
- package/bin/vako.js +4 -4
- package/bin/veko.js +188 -0
- package/error/error.ejs +4 -4
- package/lib/app.js +10 -10
- package/lib/core/auth-manager.js +2 -2
- package/lib/core/auto-updater.js +50 -50
- package/lib/core/module-installer.js +2 -2
- package/lib/dev/dev-server.js +3 -3
- package/lib/layout/layout-manager.js +3 -3
- package/lib/plugin-manager.js +2 -2
- package/lib/routing/route-manager.js +3 -3
- package/package.json +2 -2
- package/templates/public/js/main.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,10 +17,10 @@ et ce projet adhère à [Semantic Versioning](https://semver.org/lang/fr/).
|
|
|
17
17
|
|
|
18
18
|
- **Adaptateur Next.js**
|
|
19
19
|
- Nouveau module `lib/adapters/nextjs-adapter.js`
|
|
20
|
-
- Intégration des routes
|
|
21
|
-
- Support des plugins
|
|
20
|
+
- Intégration des routes Vako avec Next.js
|
|
21
|
+
- Support des plugins Vako dans Next.js
|
|
22
22
|
- Génération automatique de fichiers API Next.js
|
|
23
|
-
- Middleware pour exposer les fonctionnalités
|
|
23
|
+
- Middleware pour exposer les fonctionnalités Vako dans Next.js
|
|
24
24
|
|
|
25
25
|
- **Documentation**
|
|
26
26
|
- Guide d'intégration Next.js (`docs/nextjs-integration.md`)
|
|
@@ -59,5 +59,5 @@ et ce projet adhère à [Semantic Versioning](https://semver.org/lang/fr/).
|
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
62
|
-
[1.3.0]: https://github.com/
|
|
63
|
-
[1.2.2]: https://github.com/
|
|
62
|
+
[1.3.0]: https://github.com/sdevfr/vako/compare/v1.2.2...v1.3.0
|
|
63
|
+
[1.2.2]: https://github.com/sdevfr/vako/releases/tag/v1.2.2
|
|
@@ -134,9 +134,7 @@ class SetupExecutor {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
async generateTemplateFiles() {
|
|
137
|
-
const
|
|
138
|
-
const generator = new TemplateGenerator(this.config);
|
|
139
|
-
const files = generator.generateFiles();
|
|
137
|
+
const files = this.generateFiles();
|
|
140
138
|
|
|
141
139
|
for (const [filePath, content] of Object.entries(files)) {
|
|
142
140
|
const fullPath = path.join(this.projectPath, filePath);
|
|
@@ -150,31 +148,174 @@ class SetupExecutor {
|
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
150
|
|
|
151
|
+
generateFiles() {
|
|
152
|
+
const { projectName, description, author, license, template, features, database, auth, styling } = this.config;
|
|
153
|
+
const files = {};
|
|
154
|
+
|
|
155
|
+
// package.json
|
|
156
|
+
files['package.json'] = JSON.stringify({
|
|
157
|
+
name: projectName,
|
|
158
|
+
version: '1.0.0',
|
|
159
|
+
description: description || 'A modern web application built with Vako',
|
|
160
|
+
main: 'app.js',
|
|
161
|
+
scripts: {
|
|
162
|
+
dev: 'vako dev',
|
|
163
|
+
start: 'vako start',
|
|
164
|
+
build: 'vako build'
|
|
165
|
+
},
|
|
166
|
+
keywords: ['vako', 'framework', 'web'],
|
|
167
|
+
author: author || '',
|
|
168
|
+
license: license || 'MIT',
|
|
169
|
+
dependencies: {
|
|
170
|
+
vako: '^1.3.4'
|
|
171
|
+
}
|
|
172
|
+
}, null, 2);
|
|
173
|
+
|
|
174
|
+
// app.js
|
|
175
|
+
files['app.js'] = `const { App } = require('vako');
|
|
176
|
+
|
|
177
|
+
const app = new App({
|
|
178
|
+
port: 3000,
|
|
179
|
+
isDev: true,
|
|
180
|
+
viewsDir: 'views',
|
|
181
|
+
staticDir: 'public',
|
|
182
|
+
routesDir: 'routes'
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
app.loadRoutes();
|
|
186
|
+
app.listen();
|
|
187
|
+
`;
|
|
188
|
+
|
|
189
|
+
// README.md
|
|
190
|
+
files['README.md'] = `# ${projectName}
|
|
191
|
+
|
|
192
|
+
${description || 'A modern web application built with Vako'}
|
|
193
|
+
|
|
194
|
+
## Getting Started
|
|
195
|
+
|
|
196
|
+
\`\`\`bash
|
|
197
|
+
npm install
|
|
198
|
+
npm run dev
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
## Documentation
|
|
202
|
+
|
|
203
|
+
Visit [https://vako.js.org](https://vako.js.org) for more information.
|
|
204
|
+
`;
|
|
205
|
+
|
|
206
|
+
// .gitignore
|
|
207
|
+
files['.gitignore'] = `node_modules/
|
|
208
|
+
.env
|
|
209
|
+
*.log
|
|
210
|
+
.DS_Store
|
|
211
|
+
dist/
|
|
212
|
+
coverage/
|
|
213
|
+
`;
|
|
214
|
+
|
|
215
|
+
// routes/index.js
|
|
216
|
+
files['routes/index.js'] = `const { Router } = require('express');
|
|
217
|
+
const router = Router();
|
|
218
|
+
|
|
219
|
+
router.get('/', (req, res) => {
|
|
220
|
+
res.render('index', {
|
|
221
|
+
title: 'Welcome to ${projectName}'
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
module.exports = router;
|
|
226
|
+
`;
|
|
227
|
+
|
|
228
|
+
// views/index.ejs
|
|
229
|
+
files['views/index.ejs'] = `<!DOCTYPE html>
|
|
230
|
+
<html lang="en">
|
|
231
|
+
<head>
|
|
232
|
+
<meta charset="UTF-8">
|
|
233
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
234
|
+
<title><%= title %></title>
|
|
235
|
+
</head>
|
|
236
|
+
<body>
|
|
237
|
+
<h1><%= title %></h1>
|
|
238
|
+
<p>Welcome to your Vako application!</p>
|
|
239
|
+
</body>
|
|
240
|
+
</html>
|
|
241
|
+
`;
|
|
242
|
+
|
|
243
|
+
// public/css/style.css
|
|
244
|
+
files['public/css/style.css'] = `body {
|
|
245
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
246
|
+
margin: 0;
|
|
247
|
+
padding: 20px;
|
|
248
|
+
background-color: #f5f5f5;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
h1 {
|
|
252
|
+
color: #333;
|
|
253
|
+
}
|
|
254
|
+
`;
|
|
255
|
+
|
|
256
|
+
// public/js/main.js
|
|
257
|
+
files['public/js/main.js'] = `console.log('Vako loaded');
|
|
258
|
+
`;
|
|
259
|
+
|
|
260
|
+
return files;
|
|
261
|
+
}
|
|
262
|
+
|
|
153
263
|
async configureFeatures() {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
await configurer.configure();
|
|
264
|
+
// Configure features based on this.config.features
|
|
265
|
+
// This is a placeholder - features are already configured in generateFiles()
|
|
157
266
|
}
|
|
158
267
|
|
|
159
268
|
async setupAuthentication() {
|
|
160
269
|
if (this.config.auth.enabled) {
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
270
|
+
// Create auth routes and middleware
|
|
271
|
+
const authRoute = `const { Router } = require('express');
|
|
272
|
+
const router = Router();
|
|
273
|
+
|
|
274
|
+
router.get('/login', (req, res) => {
|
|
275
|
+
res.render('auth/login', { title: 'Login' });
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
router.post('/login', async (req, res) => {
|
|
279
|
+
// Implement login logic here
|
|
280
|
+
res.redirect('/');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
router.get('/logout', (req, res) => {
|
|
284
|
+
// Implement logout logic here
|
|
285
|
+
res.redirect('/');
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
module.exports = router;
|
|
289
|
+
`;
|
|
290
|
+
|
|
291
|
+
const authPath = path.join(this.projectPath, 'routes/auth.js');
|
|
292
|
+
fs.writeFileSync(authPath, authRoute, 'utf8');
|
|
164
293
|
}
|
|
165
294
|
}
|
|
166
295
|
|
|
167
296
|
async setupDatabase() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
297
|
+
if (this.config.database !== 'none') {
|
|
298
|
+
// Create database configuration file
|
|
299
|
+
const dbConfig = `module.exports = {
|
|
300
|
+
type: '${this.config.database}',
|
|
301
|
+
// Add your database configuration here
|
|
302
|
+
};
|
|
303
|
+
`;
|
|
304
|
+
|
|
305
|
+
const dbPath = path.join(this.projectPath, 'config/database.js');
|
|
306
|
+
const dbDir = path.dirname(dbPath);
|
|
307
|
+
if (!fs.existsSync(dbDir)) {
|
|
308
|
+
fs.mkdirSync(dbDir, { recursive: true });
|
|
309
|
+
}
|
|
310
|
+
fs.writeFileSync(dbPath, dbConfig, 'utf8');
|
|
311
|
+
}
|
|
171
312
|
}
|
|
172
313
|
|
|
173
314
|
async initializeGit() {
|
|
174
315
|
try {
|
|
175
316
|
execSync('git init', { cwd: this.projectPath, stdio: 'pipe' });
|
|
176
317
|
execSync('git add .', { cwd: this.projectPath, stdio: 'pipe' });
|
|
177
|
-
execSync('git commit -m "🎉 Initial commit - Created with
|
|
318
|
+
execSync('git commit -m "🎉 Initial commit - Created with Vako"', {
|
|
178
319
|
cwd: this.projectPath,
|
|
179
320
|
stdio: 'pipe'
|
|
180
321
|
});
|
package/bin/commands/setup.js
CHANGED
|
@@ -9,7 +9,7 @@ const path = require('path');
|
|
|
9
9
|
const fs = require('fs').promises;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Assistant de configuration interactif pour les projets
|
|
12
|
+
* Assistant de configuration interactif pour les projets Vako
|
|
13
13
|
* Fournit une interface utilisateur complète pour la création de projets
|
|
14
14
|
*/
|
|
15
15
|
class SetupWizard {
|
|
@@ -111,7 +111,7 @@ class SetupWizard {
|
|
|
111
111
|
*/
|
|
112
112
|
async showWelcome() {
|
|
113
113
|
try {
|
|
114
|
-
const title = figlet.textSync('
|
|
114
|
+
const title = figlet.textSync('VAKO', {
|
|
115
115
|
font: 'ANSI Shadow',
|
|
116
116
|
horizontalLayout: 'fitted'
|
|
117
117
|
});
|
|
@@ -120,16 +120,16 @@ class SetupWizard {
|
|
|
120
120
|
} catch (error) {
|
|
121
121
|
// Fallback si figlet échoue
|
|
122
122
|
console.log(chalk.cyan.bold('╔══════════════════════════════════╗'));
|
|
123
|
-
console.log(chalk.cyan.bold('║
|
|
123
|
+
console.log(chalk.cyan.bold('║ VAKO ║'));
|
|
124
124
|
console.log(chalk.cyan.bold('╚══════════════════════════════════╝'));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
console.log(chalk.cyan.bold('\n✨ Interactive Project Setup Wizard ✨\n'));
|
|
128
128
|
|
|
129
129
|
const welcomeBox = boxen(
|
|
130
|
-
chalk.white('🎉 Welcome to
|
|
130
|
+
chalk.white('🎉 Welcome to Vako Setup Wizard!\n\n') +
|
|
131
131
|
chalk.gray('This wizard will guide you through creating a new\n') +
|
|
132
|
-
chalk.gray('
|
|
132
|
+
chalk.gray('Vako project with all the features you need.\n\n') +
|
|
133
133
|
chalk.blue('✓ Templates & Examples\n') +
|
|
134
134
|
chalk.blue('✓ Authentication System\n') +
|
|
135
135
|
chalk.blue('✓ Database Integration\n') +
|
|
@@ -170,14 +170,14 @@ class SetupWizard {
|
|
|
170
170
|
type: 'input',
|
|
171
171
|
name: 'projectName',
|
|
172
172
|
message: '📁 What\'s your project name?',
|
|
173
|
-
default: 'my-
|
|
173
|
+
default: 'my-vako-app',
|
|
174
174
|
validate: (input) => this.validateProjectName(input)
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
type: 'input',
|
|
178
178
|
name: 'description',
|
|
179
179
|
message: '📄 Project description:',
|
|
180
|
-
default: 'A modern web application built with
|
|
180
|
+
default: 'A modern web application built with Vako',
|
|
181
181
|
validate: (input) => this.validateDescription(input)
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -587,7 +587,7 @@ ${plugins.map(p => ` ⚡ ${p}`).join('\n') || ' No plugins selected'}
|
|
|
587
587
|
});
|
|
588
588
|
|
|
589
589
|
console.log(completionBox);
|
|
590
|
-
console.log(chalk.rainbow('\n✨ Happy coding with
|
|
590
|
+
console.log(chalk.rainbow('\n✨ Happy coding with Vako! ✨\n'));
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
/**
|
|
@@ -600,10 +600,10 @@ ${plugins.map(p => ` ⚡ ${p}`).join('\n') || ' No plugins selected'}
|
|
|
600
600
|
chalk.gray('Next steps:\n') +
|
|
601
601
|
chalk.white(` 📁 cd ${projectName}\n`) +
|
|
602
602
|
chalk.white(' 🚀 npm run dev\n') +
|
|
603
|
-
chalk.white(' 🌐
|
|
603
|
+
chalk.white(' 🌐 vako dev\n\n`') +
|
|
604
604
|
chalk.gray('Your app will be available at: ') +
|
|
605
605
|
chalk.blue.underline('http://localhost:3000\n\n') +
|
|
606
|
-
chalk.yellow('📚 Documentation: ') + chalk.blue.underline('https://
|
|
606
|
+
chalk.yellow('📚 Documentation: ') + chalk.blue.underline('https://vako.js.org');
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
// === Méthodes de validation sécurisées ===
|
package/bin/create-veko-app.js
CHANGED
|
@@ -61,12 +61,12 @@ program
|
|
|
61
61
|
|
|
62
62
|
// Show help if no arguments
|
|
63
63
|
if (process.argv.length <= 2) {
|
|
64
|
-
console.log(chalk.blue.bold('🚀 Create
|
|
64
|
+
console.log(chalk.blue.bold('🚀 Create Vako App\n'));
|
|
65
65
|
console.log(chalk.white('Usage:'));
|
|
66
|
-
console.log(chalk.gray(' npx create-
|
|
67
|
-
console.log(chalk.gray(' npx create-
|
|
68
|
-
console.log(chalk.gray(' npx create-
|
|
69
|
-
console.log(chalk.gray(' npx create-
|
|
66
|
+
console.log(chalk.gray(' npx create-vako-app my-app'));
|
|
67
|
+
console.log(chalk.gray(' npx create-vako-app my-app --template api'));
|
|
68
|
+
console.log(chalk.gray(' npx create-vako-app my-app --wizard'));
|
|
69
|
+
console.log(chalk.gray(' npx create-vako-app my-app --quick'));
|
|
70
70
|
console.log(chalk.white('\nTemplates:'));
|
|
71
71
|
console.log(chalk.gray(' default, api, blog, admin, ecommerce, portfolio\n'));
|
|
72
72
|
process.exit(0);
|
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.
|
|
24
|
+
.version('1.3.5');
|
|
25
25
|
|
|
26
26
|
// ============= DEV COMMAND =============
|
|
27
27
|
program
|
|
@@ -149,14 +149,14 @@ program
|
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
// Ajout de la commande update qui servira de passerelle vers
|
|
152
|
+
// Ajout de la commande update qui servira de passerelle vers vako-update
|
|
153
153
|
program
|
|
154
154
|
.command('update')
|
|
155
155
|
.description('Gestionnaire de mise à jour Vako')
|
|
156
156
|
.allowUnknownOption(true)
|
|
157
157
|
.action(() => {
|
|
158
|
-
// Exécuter
|
|
159
|
-
const updateBin = path.join(__dirname, '
|
|
158
|
+
// Exécuter vako-update avec les mêmes arguments
|
|
159
|
+
const updateBin = path.join(__dirname, 'vako-update.js'); // Note: fichier garde le nom vako-update.js pour compatibilité
|
|
160
160
|
if (fs.existsSync(updateBin)) {
|
|
161
161
|
const { execSync } = require('child_process');
|
|
162
162
|
try {
|
package/bin/veko.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { Command } = require('commander');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const SetupWizard = require('./commands/setup');
|
|
6
|
+
const DevServer = require('../lib/dev/dev-server');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
|
|
10
|
+
// Version du package
|
|
11
|
+
const packageJson = require('../package.json');
|
|
12
|
+
const version = packageJson.version;
|
|
13
|
+
|
|
14
|
+
// Ajouter le chemin vers les modules lib
|
|
15
|
+
const libPath = path.join(__dirname, '..', 'lib');
|
|
16
|
+
process.env.NODE_PATH = `${process.env.NODE_PATH || ''}:${libPath}`;
|
|
17
|
+
require('module')._initPaths();
|
|
18
|
+
|
|
19
|
+
const program = new Command();
|
|
20
|
+
|
|
21
|
+
program
|
|
22
|
+
.name('vako')
|
|
23
|
+
.description('Vako Framework CLI')
|
|
24
|
+
.version('1.3.3');
|
|
25
|
+
|
|
26
|
+
// ============= DEV COMMAND =============
|
|
27
|
+
program
|
|
28
|
+
.command('dev')
|
|
29
|
+
.description('Start development server')
|
|
30
|
+
.option('-p, --port <port>', 'Port number', '3000')
|
|
31
|
+
.option('-f, --file <file>', 'Entry file', 'app.js')
|
|
32
|
+
.option('-w, --watch <dirs>', 'Watch directories', 'views,routes,public')
|
|
33
|
+
.action(async (options) => {
|
|
34
|
+
try {
|
|
35
|
+
const devServer = new DevServer({
|
|
36
|
+
port: parseInt(options.port),
|
|
37
|
+
file: options.file,
|
|
38
|
+
watchDirs: options.watch.split(',')
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
await devServer.start();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error(chalk.red('❌ Error starting dev server:'), error.message);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// ============= BUILD COMMAND =============
|
|
49
|
+
program
|
|
50
|
+
.command('build')
|
|
51
|
+
.description('Build for production')
|
|
52
|
+
.action(() => {
|
|
53
|
+
console.log(chalk.blue('🔨 Building for production...'));
|
|
54
|
+
console.log(chalk.green('✅ Build completed!'));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// ============= START COMMAND =============
|
|
58
|
+
program
|
|
59
|
+
.command('start')
|
|
60
|
+
.description('Start production server')
|
|
61
|
+
.option('-f, --file <file>', 'Entry file', 'app.js')
|
|
62
|
+
.action((options) => {
|
|
63
|
+
try {
|
|
64
|
+
console.log(chalk.blue('🚀 Starting production server...'));
|
|
65
|
+
execSync(`node ${options.file}`, { stdio: 'inherit' });
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error(chalk.red('❌ Error starting server:'), error.message);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// ============= SETUP COMMAND (UPDATED) =============
|
|
73
|
+
program
|
|
74
|
+
.command('setup [project-name]')
|
|
75
|
+
.description('🚀 Interactive project setup wizard')
|
|
76
|
+
.option('-q, --quick', 'Quick setup with defaults')
|
|
77
|
+
.option('--template <template>', 'Template (default, api, blog, admin, ecommerce, portfolio)')
|
|
78
|
+
.option('--features <features>', 'Comma-separated features list')
|
|
79
|
+
.option('--auth', 'Enable authentication system')
|
|
80
|
+
.option('--db <database>', 'Database type (sqlite, mysql, mongodb)')
|
|
81
|
+
.option('--styling <framework>', 'CSS framework (bootstrap, tailwind, material)')
|
|
82
|
+
.action(async (projectNameArg, options) => {
|
|
83
|
+
if (options.quick) {
|
|
84
|
+
const quickConfig = {
|
|
85
|
+
projectName: projectNameArg || 'vako-app',
|
|
86
|
+
template: options.template || 'default',
|
|
87
|
+
features: options.features ? options.features.split(',') : ['hotreload', 'layouts'],
|
|
88
|
+
database: options.db || 'sqlite',
|
|
89
|
+
auth: { enabled: options.auth || false },
|
|
90
|
+
styling: options.styling || 'bootstrap',
|
|
91
|
+
git: true,
|
|
92
|
+
install: true
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const SetupExecutor = require('./commands/setup-executor');
|
|
96
|
+
const executor = new SetupExecutor(quickConfig);
|
|
97
|
+
await executor.execute();
|
|
98
|
+
} else {
|
|
99
|
+
const wizard = new SetupWizard();
|
|
100
|
+
await wizard.start();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// ============= NEW COMMANDS =============
|
|
105
|
+
program
|
|
106
|
+
.command('wizard')
|
|
107
|
+
.alias('w')
|
|
108
|
+
.description('🧙♂️ Full interactive setup wizard')
|
|
109
|
+
.action(async () => {
|
|
110
|
+
const wizard = new SetupWizard();
|
|
111
|
+
await wizard.start();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
program
|
|
115
|
+
.command('create <project-name>')
|
|
116
|
+
.description('🎯 Quick project creation with prompts')
|
|
117
|
+
.option('--template <template>', 'Template to use')
|
|
118
|
+
.action(async (projectName, options) => {
|
|
119
|
+
const QuickSetup = require('./commands/quick-setup');
|
|
120
|
+
const quickSetup = new QuickSetup(projectName, options);
|
|
121
|
+
await quickSetup.start();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
program
|
|
125
|
+
.command('templates')
|
|
126
|
+
.alias('t')
|
|
127
|
+
.description('📋 List available templates')
|
|
128
|
+
.action(() => {
|
|
129
|
+
const TemplateList = require('./commands/template-list');
|
|
130
|
+
const templateList = new TemplateList();
|
|
131
|
+
templateList.display();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
program
|
|
135
|
+
.command('plugins')
|
|
136
|
+
.description('🔌 Plugin management')
|
|
137
|
+
.option('--list', 'List available plugins')
|
|
138
|
+
.option('--search <term>', 'Search plugins')
|
|
139
|
+
.action((options) => {
|
|
140
|
+
const PluginManager = require('./commands/plugin-manager-cli');
|
|
141
|
+
const pluginManager = new PluginManager();
|
|
142
|
+
|
|
143
|
+
if (options.list) {
|
|
144
|
+
pluginManager.listPlugins();
|
|
145
|
+
} else if (options.search) {
|
|
146
|
+
pluginManager.searchPlugins(options.search);
|
|
147
|
+
} else {
|
|
148
|
+
pluginManager.showMenu();
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Ajout de la commande update qui servira de passerelle vers vako-update
|
|
153
|
+
program
|
|
154
|
+
.command('update')
|
|
155
|
+
.description('Gestionnaire de mise à jour Vako')
|
|
156
|
+
.allowUnknownOption(true)
|
|
157
|
+
.action(() => {
|
|
158
|
+
// Exécuter vako-update avec les mêmes arguments
|
|
159
|
+
const updateBin = path.join(__dirname, 'vako-update.js'); // Note: fichier garde le nom vako-update.js pour compatibilité
|
|
160
|
+
if (fs.existsSync(updateBin)) {
|
|
161
|
+
const { execSync } = require('child_process');
|
|
162
|
+
try {
|
|
163
|
+
execSync(`node "${updateBin}" ${process.argv.slice(3).join(' ')}`, {
|
|
164
|
+
stdio: 'inherit'
|
|
165
|
+
});
|
|
166
|
+
} catch (error) {
|
|
167
|
+
console.error('Erreur lors du lancement de l\'auto-updater');
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
console.error('L\'auto-updater n\'est pas disponible');
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
program.parse(process.argv);
|
|
177
|
+
|
|
178
|
+
if (!process.argv.slice(2).length) {
|
|
179
|
+
console.log('\n🚀 Vako v' + version + ' - Ultra-modern Node.js framework\n');
|
|
180
|
+
console.log('Available commands:');
|
|
181
|
+
console.log(' dev Start development server with hot reload');
|
|
182
|
+
console.log(' setup Set up a new Vako project');
|
|
183
|
+
console.log(' verify Verify code quality and security');
|
|
184
|
+
console.log(' update Gestionnaire de mise à jour Vako');
|
|
185
|
+
console.log('\nRun `vako <command> --help` for more information on specific commands.');
|
|
186
|
+
console.log('\nDocumentation: https://github.com/sdevfr/vako');
|
|
187
|
+
process.exit(0);
|
|
188
|
+
}
|
package/error/error.ejs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title><%= (locals.lang === 'fr' ? 'Erreur' : 'Error') %> <%= status || 500 %> -
|
|
6
|
+
<title><%= (locals.lang === 'fr' ? 'Erreur' : 'Error') %> <%= status || 500 %> - Vako</title>
|
|
7
7
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<div class="flex items-center space-x-3 mb-4 sm:mb-0">
|
|
104
104
|
<div class="text-3xl animate-float"><%= errorType?.icon || '❌' %></div>
|
|
105
105
|
<div>
|
|
106
|
-
<h1 class="text-2xl font-bold tracking-tight">
|
|
106
|
+
<h1 class="text-2xl font-bold tracking-tight">Vako</h1>
|
|
107
107
|
<p class="text-sm text-white/70"><%= locals.lang === 'fr' ? 'Framework développement' : 'Development Framework' %></p>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
<% } else { %>
|
|
286
286
|
<div class="p-4 bg-white/5 rounded-lg">
|
|
287
287
|
<h4 class="font-medium mb-2"><%= locals.lang === 'fr' ? 'Consulter la documentation' : 'Check the documentation' %></h4>
|
|
288
|
-
<p class="text-white/70"><%= locals.lang === 'fr' ? 'Pour plus d\'informations sur cette erreur et comment la résoudre, consultez la documentation de
|
|
288
|
+
<p class="text-white/70"><%= locals.lang === 'fr' ? 'Pour plus d\'informations sur cette erreur et comment la résoudre, consultez la documentation de Vako.' : 'For more information about this error and how to solve it, check the Vako documentation.' %></p>
|
|
289
289
|
</div>
|
|
290
290
|
<% } %>
|
|
291
291
|
<div class="p-4 bg-white/5 rounded-lg">
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
<!-- Footer -->
|
|
302
302
|
<footer class="py-6 px-4 sm:px-6 lg:px-8 bg-gradient-to-b from-transparent to-black/20">
|
|
303
303
|
<div class="max-w-7xl mx-auto text-center text-sm text-white/50">
|
|
304
|
-
<p>
|
|
304
|
+
<p>Vako Framework • <span class="bg-white/10 px-2 py-1 rounded text-xs"><%= env %></span></p>
|
|
305
305
|
<p class="mt-2 text-xs">
|
|
306
306
|
<%= locals.lang === 'fr' ? 'Pour désactiver cette page d\'erreur détaillée en production, définissez' : 'To disable this detailed error page in production, set' %> <code class="bg-white/10 px-1 rounded">NODE_ENV=production</code>
|
|
307
307
|
</p>
|
package/lib/app.js
CHANGED
|
@@ -223,9 +223,9 @@ class App {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
} else if (updateInfo.needsInstall && !silent) {
|
|
226
|
-
this.log('warning', '
|
|
226
|
+
this.log('warning', 'Vako non installé correctement', '⚠️ Réinstallation requise');
|
|
227
227
|
} else if (!updateInfo.hasUpdate && !silent) {
|
|
228
|
-
this.log('success', '
|
|
228
|
+
this.log('success', 'Vako à jour', `✅ Version ${updateInfo.currentVersion || 'inconnue'}`);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
return updateInfo;
|
|
@@ -264,7 +264,7 @@ class App {
|
|
|
264
264
|
// Notification optionnelle de redémarrage
|
|
265
265
|
if (this.options.autoUpdater.showNotifications) {
|
|
266
266
|
console.log('\n' + '═'.repeat(60));
|
|
267
|
-
console.log('\x1b[32m\x1b[1m🎉 MISE À JOUR
|
|
267
|
+
console.log('\x1b[32m\x1b[1m🎉 MISE À JOUR VAKO RÉUSSIE!\x1b[0m');
|
|
268
268
|
console.log('\x1b[33m⚠️ Redémarrez l\'application pour appliquer les changements\x1b[0m');
|
|
269
269
|
console.log('═'.repeat(60) + '\n');
|
|
270
270
|
}
|
|
@@ -331,7 +331,7 @@ class App {
|
|
|
331
331
|
if (!this.autoUpdaterActive) return;
|
|
332
332
|
|
|
333
333
|
// Route pour vérifier les mises à jour
|
|
334
|
-
this.app.get('/
|
|
334
|
+
this.app.get('/_vako/updates/check', async (req, res) => {
|
|
335
335
|
try {
|
|
336
336
|
const updateInfo = await this.checkForUpdates(true);
|
|
337
337
|
res.json(updateInfo);
|
|
@@ -341,7 +341,7 @@ class App {
|
|
|
341
341
|
});
|
|
342
342
|
|
|
343
343
|
// Route pour déclencher une mise à jour
|
|
344
|
-
this.app.post('/
|
|
344
|
+
this.app.post('/_vako/updates/perform', async (req, res) => {
|
|
345
345
|
try {
|
|
346
346
|
const updateInfo = await this.checkForUpdates(true);
|
|
347
347
|
if (updateInfo.hasUpdate) {
|
|
@@ -356,12 +356,12 @@ class App {
|
|
|
356
356
|
});
|
|
357
357
|
|
|
358
358
|
// Route pour les statistiques
|
|
359
|
-
this.app.get('/
|
|
359
|
+
this.app.get('/_vako/updates/stats', (req, res) => {
|
|
360
360
|
res.json(this.getAutoUpdaterInfo());
|
|
361
361
|
});
|
|
362
362
|
|
|
363
363
|
// Route pour effectuer un rollback
|
|
364
|
-
this.app.post('/
|
|
364
|
+
this.app.post('/_vako/updates/rollback', async (req, res) => {
|
|
365
365
|
try {
|
|
366
366
|
const { backupPath } = req.body;
|
|
367
367
|
const success = await this.rollbackUpdate(backupPath);
|
|
@@ -371,7 +371,7 @@ class App {
|
|
|
371
371
|
}
|
|
372
372
|
});
|
|
373
373
|
|
|
374
|
-
this.log('info', 'Routes auto-updater configurées', '🔗 /
|
|
374
|
+
this.log('info', 'Routes auto-updater configurées', '🔗 /_vako/updates/*');
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
async init() {
|
|
@@ -573,7 +573,7 @@ class App {
|
|
|
573
573
|
console.log('\n' + '═'.repeat(60));
|
|
574
574
|
console.log(`\x1b[35m\x1b[1m
|
|
575
575
|
╔══════════════════════════════════════════════════════╗
|
|
576
|
-
║ 🚀
|
|
576
|
+
║ 🚀 VAKO 🚀 ║
|
|
577
577
|
╚══════════════════════════════════════════════════════╝\x1b[0m`);
|
|
578
578
|
|
|
579
579
|
this.logger.log('server', 'Server started successfully', `🌐 http://localhost:${port}`);
|
|
@@ -583,7 +583,7 @@ class App {
|
|
|
583
583
|
try {
|
|
584
584
|
const autoUpdaterInfo = this.getAutoUpdaterInfo();
|
|
585
585
|
if (autoUpdaterInfo.currentVersion) {
|
|
586
|
-
this.logger.log('info', 'Auto-updater active', `🔄 Version
|
|
586
|
+
this.logger.log('info', 'Auto-updater active', `🔄 Version Vako: ${autoUpdaterInfo.currentVersion}`);
|
|
587
587
|
this.logger.log('info', 'Canal de mise à jour', `📢 ${autoUpdaterInfo.config.updateChannel}`);
|
|
588
588
|
}
|
|
589
589
|
|
package/lib/core/auth-manager.js
CHANGED
|
@@ -14,7 +14,7 @@ class AuthManager {
|
|
|
14
14
|
mysql: {
|
|
15
15
|
host: 'localhost',
|
|
16
16
|
port: 3306,
|
|
17
|
-
database: '
|
|
17
|
+
database: 'vako_auth',
|
|
18
18
|
username: 'root',
|
|
19
19
|
password: ''
|
|
20
20
|
}
|
|
@@ -358,7 +358,7 @@ class AuthManager {
|
|
|
358
358
|
secret: this.config.session.secret,
|
|
359
359
|
resave: false,
|
|
360
360
|
saveUninitialized: false,
|
|
361
|
-
name: '
|
|
361
|
+
name: 'vako.sid', // Nom personnalisé pour masquer l'usage d'Express
|
|
362
362
|
cookie: {
|
|
363
363
|
maxAge: this.config.session.maxAge,
|
|
364
364
|
secure: this.config.session.secure,
|
package/lib/core/auto-updater.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Fichier de l'auto-updater qui va vérifier si c'est la bonne version de
|
|
1
|
+
// Fichier de l'auto-updater qui va vérifier si c'est la bonne version de vako
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const https = require('https');
|
|
@@ -9,9 +9,9 @@ const chalk = require('chalk');
|
|
|
9
9
|
|
|
10
10
|
class AutoUpdater {
|
|
11
11
|
static packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
12
|
-
static backupDir = path.join(process.cwd(), '.
|
|
13
|
-
static configPath = path.join(process.cwd(), '.
|
|
14
|
-
static logPath = path.join(process.cwd(), '.
|
|
12
|
+
static backupDir = path.join(process.cwd(), '.vako-backups');
|
|
13
|
+
static configPath = path.join(process.cwd(), '.vako-updater.json');
|
|
14
|
+
static logPath = path.join(process.cwd(), '.vako-updater.log');
|
|
15
15
|
static currentVersion = null;
|
|
16
16
|
static latestVersion = null;
|
|
17
17
|
static config = {};
|
|
@@ -52,7 +52,7 @@ class AutoUpdater {
|
|
|
52
52
|
rollbackOnFailure: true,
|
|
53
53
|
updateChannel: 'stable', // stable, beta, alpha
|
|
54
54
|
customRegistry: null,
|
|
55
|
-
excludeFiles: ['.git', 'node_modules', '.
|
|
55
|
+
excludeFiles: ['.git', 'node_modules', '.vako-backups'],
|
|
56
56
|
skipDependencies: false
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -117,8 +117,8 @@ class AutoUpdater {
|
|
|
117
117
|
try {
|
|
118
118
|
if (fs.existsSync(this.packageJsonPath)) {
|
|
119
119
|
const packageJson = JSON.parse(fs.readFileSync(this.packageJsonPath, 'utf8'));
|
|
120
|
-
if (packageJson.
|
|
121
|
-
this.stats = { ...this.stats, ...packageJson.
|
|
120
|
+
if (packageJson.vakoUpdaterStats) {
|
|
121
|
+
this.stats = { ...this.stats, ...packageJson.vakoUpdaterStats };
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
} catch (error) {
|
|
@@ -193,7 +193,7 @@ class AutoUpdater {
|
|
|
193
193
|
const currentVersion = this.getCurrentVersion();
|
|
194
194
|
if (!currentVersion) {
|
|
195
195
|
animation.stop(!silent ?
|
|
196
|
-
this.styles.warning('⚠️
|
|
196
|
+
this.styles.warning('⚠️ Vako n\'est pas installé.') : '');
|
|
197
197
|
return { hasUpdate: false, needsInstall: true };
|
|
198
198
|
}
|
|
199
199
|
|
|
@@ -282,7 +282,7 @@ class AutoUpdater {
|
|
|
282
282
|
'package.json',
|
|
283
283
|
'package-lock.json',
|
|
284
284
|
'yarn.lock',
|
|
285
|
-
'node_modules/
|
|
285
|
+
'node_modules/vako'
|
|
286
286
|
];
|
|
287
287
|
|
|
288
288
|
fs.mkdirSync(backupPath, { recursive: true });
|
|
@@ -436,18 +436,18 @@ class AutoUpdater {
|
|
|
436
436
|
// Désinstallation de l'ancienne version
|
|
437
437
|
console.log(this.styles.info('📦 Désinstallation de l\'ancienne version...'));
|
|
438
438
|
try {
|
|
439
|
-
execSync(`${npmCommand} uninstall
|
|
439
|
+
execSync(`${npmCommand} uninstall vako`, { stdio: 'pipe' });
|
|
440
440
|
} catch (error) {
|
|
441
441
|
// Si echec, essayer avec npx
|
|
442
442
|
console.log(this.styles.warning('⚠️ Tentative alternative avec npx...'));
|
|
443
|
-
execSync(`${isWindows ? 'npx.cmd' : 'npx'} -y npm uninstall
|
|
443
|
+
execSync(`${isWindows ? 'npx.cmd' : 'npx'} -y npm uninstall vako`, { stdio: 'pipe' });
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
// Installation de la nouvelle version
|
|
447
|
-
console.log(this.styles.info(`📦 Installation de
|
|
447
|
+
console.log(this.styles.info(`📦 Installation de vako@${versionInfo.latestVersion}...`));
|
|
448
448
|
|
|
449
449
|
// Utiliser le chemin complet vers npm si disponible
|
|
450
|
-
const installProcess = spawn(npmCommand, ['install', `
|
|
450
|
+
const installProcess = spawn(npmCommand, ['install', `vako@${versionInfo.latestVersion}`], {
|
|
451
451
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
452
452
|
shell: true // Utiliser un shell pour une meilleure compatibilité
|
|
453
453
|
});
|
|
@@ -490,7 +490,7 @@ class AutoUpdater {
|
|
|
490
490
|
console.log(this.styles.success(`✅ Mise à jour réussie vers la version ${versionInfo.latestVersion}!`));
|
|
491
491
|
|
|
492
492
|
if (this.config.notifications) {
|
|
493
|
-
this.showNotification('
|
|
493
|
+
this.showNotification('Vako mis à jour avec succès!', `Version ${versionInfo.latestVersion}`);
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
return true;
|
|
@@ -574,10 +574,10 @@ class AutoUpdater {
|
|
|
574
574
|
const registry = this.config.customRegistry || 'registry.npmjs.org';
|
|
575
575
|
const options = {
|
|
576
576
|
hostname: registry,
|
|
577
|
-
path: '/
|
|
577
|
+
path: '/vako',
|
|
578
578
|
method: 'GET',
|
|
579
579
|
headers: {
|
|
580
|
-
'User-Agent': `
|
|
580
|
+
'User-Agent': `vako-auto-updater/2.0.0 (${os.platform()} ${os.arch()})`,
|
|
581
581
|
'Accept': 'application/json'
|
|
582
582
|
},
|
|
583
583
|
timeout: 5000 // Timeout explicite
|
|
@@ -665,17 +665,17 @@ class AutoUpdater {
|
|
|
665
665
|
|
|
666
666
|
// ❓ Aide simplifiée
|
|
667
667
|
static showHelp() {
|
|
668
|
-
console.log(this.styles.title('\n❓ Aide -
|
|
668
|
+
console.log(this.styles.title('\n❓ Aide - Vako Auto-Updater'));
|
|
669
669
|
console.log(this.styles.separator);
|
|
670
670
|
console.log('Commandes disponibles:');
|
|
671
|
-
console.log('
|
|
672
|
-
console.log('
|
|
673
|
-
console.log('
|
|
674
|
-
console.log('
|
|
675
|
-
console.log('
|
|
676
|
-
console.log('
|
|
677
|
-
console.log('
|
|
678
|
-
console.log('
|
|
671
|
+
console.log(' vako update check - Vérifier les mises à jour');
|
|
672
|
+
console.log(' vako update update - Mettre à jour maintenant');
|
|
673
|
+
console.log(' vako update config - Afficher la configuration');
|
|
674
|
+
console.log(' vako update rollback - Effectuer un rollback');
|
|
675
|
+
console.log(' vako update stats - Afficher les statistiques');
|
|
676
|
+
console.log(' vako update fix - Réparer l\'auto-updater');
|
|
677
|
+
console.log(' vako update help - Afficher l\'aide');
|
|
678
|
+
console.log(' vako update version - Afficher la version');
|
|
679
679
|
console.log(this.styles.separator);
|
|
680
680
|
}
|
|
681
681
|
|
|
@@ -713,10 +713,10 @@ class AutoUpdater {
|
|
|
713
713
|
animation.stop();
|
|
714
714
|
|
|
715
715
|
if (updateInfo.needsInstall) {
|
|
716
|
-
console.log(this.styles.warning('⚠️
|
|
716
|
+
console.log(this.styles.warning('⚠️ Vako n\'est pas installé. Installation en cours...'));
|
|
717
717
|
try {
|
|
718
|
-
execSync('npm install
|
|
719
|
-
console.log(this.styles.success('✅
|
|
718
|
+
execSync('npm install vako@latest', { stdio: 'inherit' });
|
|
719
|
+
console.log(this.styles.success('✅ Vako installé avec succès!'));
|
|
720
720
|
return true;
|
|
721
721
|
} catch (error) {
|
|
722
722
|
console.log(this.styles.error(`❌ Erreur lors de l'installation: ${error.message}`));
|
|
@@ -729,13 +729,13 @@ class AutoUpdater {
|
|
|
729
729
|
if (this.config.autoUpdate) {
|
|
730
730
|
return await this.performUpdate(updateInfo);
|
|
731
731
|
} else {
|
|
732
|
-
console.log(this.styles.info('Pour mettre à jour:
|
|
732
|
+
console.log(this.styles.info('Pour mettre à jour: vako update update'));
|
|
733
733
|
}
|
|
734
734
|
} else if (updateInfo.error) {
|
|
735
735
|
console.log(this.styles.error(`❌ Erreur: ${updateInfo.error}`));
|
|
736
736
|
return false;
|
|
737
737
|
} else {
|
|
738
|
-
console.log(this.styles.success('✅
|
|
738
|
+
console.log(this.styles.success('✅ Vako est à jour!'));
|
|
739
739
|
}
|
|
740
740
|
|
|
741
741
|
return true;
|
|
@@ -789,18 +789,18 @@ class AutoUpdater {
|
|
|
789
789
|
|
|
790
790
|
return await this.performUpdate(updateInfo);
|
|
791
791
|
} else if (updateInfo.needsInstall) {
|
|
792
|
-
console.log(this.styles.warning('⚠️
|
|
792
|
+
console.log(this.styles.warning('⚠️ Vako n\'est pas installé. Installation en cours...'));
|
|
793
793
|
|
|
794
794
|
try {
|
|
795
|
-
execSync('npm install
|
|
796
|
-
console.log(this.styles.success('✅
|
|
795
|
+
execSync('npm install vako@latest', { stdio: 'inherit' });
|
|
796
|
+
console.log(this.styles.success('✅ Vako installé avec succès!'));
|
|
797
797
|
return true;
|
|
798
798
|
} catch (error) {
|
|
799
799
|
console.log(this.styles.error(`❌ Erreur lors de l'installation: ${error.message}`));
|
|
800
800
|
return false;
|
|
801
801
|
}
|
|
802
802
|
} else {
|
|
803
|
-
console.log(this.styles.success('✅
|
|
803
|
+
console.log(this.styles.success('✅ Vako est déjà à jour!'));
|
|
804
804
|
return true;
|
|
805
805
|
}
|
|
806
806
|
} catch (error) {
|
|
@@ -812,7 +812,7 @@ class AutoUpdater {
|
|
|
812
812
|
// 📋 Afficher version
|
|
813
813
|
static showVersion() {
|
|
814
814
|
const version = this.getCurrentVersion() || 'non installé';
|
|
815
|
-
console.log(`
|
|
815
|
+
console.log(`Vako v${version}`);
|
|
816
816
|
console.log(`Auto-updater v1.1.5`);
|
|
817
817
|
return true;
|
|
818
818
|
}
|
|
@@ -843,18 +843,18 @@ class AutoUpdater {
|
|
|
843
843
|
} else {
|
|
844
844
|
console.log(this.styles.success('✅ package.json trouvé'));
|
|
845
845
|
|
|
846
|
-
// Vérifier l'installation de
|
|
847
|
-
const
|
|
848
|
-
if (!
|
|
849
|
-
console.log(this.styles.warning('⚠️
|
|
846
|
+
// Vérifier l'installation de vako
|
|
847
|
+
const vakoInstalled = this.getCurrentVersion();
|
|
848
|
+
if (!vakoInstalled) {
|
|
849
|
+
console.log(this.styles.warning('⚠️ Vako non installé, tentative d\'installation'));
|
|
850
850
|
try {
|
|
851
|
-
execSync('npm install
|
|
852
|
-
console.log(this.styles.success('✅
|
|
851
|
+
execSync('npm install vako@latest', { stdio: 'inherit' });
|
|
852
|
+
console.log(this.styles.success('✅ Vako installé'));
|
|
853
853
|
} catch (error) {
|
|
854
854
|
console.log(this.styles.error(`❌ Erreur d'installation: ${error.message}`));
|
|
855
855
|
}
|
|
856
856
|
} else {
|
|
857
|
-
console.log(this.styles.success(`✅
|
|
857
|
+
console.log(this.styles.success(`✅ Vako v${vakoInstalled} installé`));
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
|
|
@@ -867,7 +867,7 @@ class AutoUpdater {
|
|
|
867
867
|
|
|
868
868
|
console.log(this.styles.separator);
|
|
869
869
|
console.log(this.styles.success('🎉 Réparation terminée!'));
|
|
870
|
-
console.log(this.styles.info('💡 Utilisez "
|
|
870
|
+
console.log(this.styles.info('💡 Utilisez "vako update check" pour vérifier les mises à jour'));
|
|
871
871
|
|
|
872
872
|
return true;
|
|
873
873
|
} catch (error) {
|
|
@@ -885,15 +885,15 @@ class AutoUpdater {
|
|
|
885
885
|
|
|
886
886
|
const packageJson = JSON.parse(fs.readFileSync(this.packageJsonPath, 'utf8'));
|
|
887
887
|
|
|
888
|
-
const
|
|
889
|
-
packageJson.devDependencies?.
|
|
890
|
-
packageJson.peerDependencies?.
|
|
891
|
-
|
|
892
|
-
if (!
|
|
888
|
+
const vakoVersion = packageJson.dependencies?.vako ||
|
|
889
|
+
packageJson.devDependencies?.vako ||
|
|
890
|
+
packageJson.peerDependencies?.vako;
|
|
891
|
+
|
|
892
|
+
if (!vakoVersion) {
|
|
893
893
|
return null;
|
|
894
894
|
}
|
|
895
895
|
|
|
896
|
-
this.currentVersion =
|
|
896
|
+
this.currentVersion = vakoVersion.replace(/[\^~>=<]/g, '');
|
|
897
897
|
return this.currentVersion;
|
|
898
898
|
} catch (error) {
|
|
899
899
|
console.warn(`[Auto-updater] Erreur lors de la lecture de package.json: ${error.message}`);
|
|
@@ -1106,7 +1106,7 @@ class AutoUpdater {
|
|
|
1106
1106
|
try {
|
|
1107
1107
|
if (fs.existsSync(this.packageJsonPath)) {
|
|
1108
1108
|
const packageJson = JSON.parse(fs.readFileSync(this.packageJsonPath, 'utf8'));
|
|
1109
|
-
packageJson.
|
|
1109
|
+
packageJson.vakoUpdaterStats = this.stats;
|
|
1110
1110
|
fs.writeFileSync(this.packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
1111
1111
|
}
|
|
1112
1112
|
} catch (error) {
|
|
@@ -66,9 +66,9 @@ class ModuleInstaller {
|
|
|
66
66
|
console.log('📄 Création du package.json...');
|
|
67
67
|
|
|
68
68
|
const packageJson = {
|
|
69
|
-
name: "
|
|
69
|
+
name: "vako-app",
|
|
70
70
|
version: "1.0.0",
|
|
71
|
-
description: "Application
|
|
71
|
+
description: "Application Vako",
|
|
72
72
|
main: "app.js",
|
|
73
73
|
scripts: {
|
|
74
74
|
dev: "node app.js",
|
package/lib/dev/dev-server.js
CHANGED
|
@@ -53,7 +53,7 @@ class DevServer {
|
|
|
53
53
|
|
|
54
54
|
ws.send(JSON.stringify({
|
|
55
55
|
type: 'connected',
|
|
56
|
-
message: 'Connected to
|
|
56
|
+
message: 'Connected to Vako server ✨'
|
|
57
57
|
}));
|
|
58
58
|
|
|
59
59
|
if (this.options.prefetch.enabled) {
|
|
@@ -236,7 +236,7 @@ class DevServer {
|
|
|
236
236
|
(function() {
|
|
237
237
|
const ws = new WebSocket('ws://localhost:${req.app.locals.wsPort || 3008}');
|
|
238
238
|
|
|
239
|
-
ws.onopen = () => console.log('🔗
|
|
239
|
+
ws.onopen = () => console.log('🔗 Vako connected');
|
|
240
240
|
ws.onmessage = (event) => {
|
|
241
241
|
const data = JSON.parse(event.data);
|
|
242
242
|
|
|
@@ -259,7 +259,7 @@ class DevServer {
|
|
|
259
259
|
break;
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
-
ws.onclose = () => console.log('🔌
|
|
262
|
+
ws.onclose = () => console.log('🔌 Vako disconnected');
|
|
263
263
|
})();
|
|
264
264
|
</script>
|
|
265
265
|
`;
|
|
@@ -153,7 +153,7 @@ class LayoutManager {
|
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
return {
|
|
156
|
-
title: sanitized.title || '
|
|
156
|
+
title: sanitized.title || 'Vako App',
|
|
157
157
|
description: sanitized.description || '',
|
|
158
158
|
keywords: sanitized.keywords || '',
|
|
159
159
|
author: sanitized.author || '',
|
|
@@ -484,7 +484,7 @@ class LayoutManager {
|
|
|
484
484
|
<% } else { %>
|
|
485
485
|
<header>
|
|
486
486
|
<div class="container">
|
|
487
|
-
<h1>🚀
|
|
487
|
+
<h1>🚀 Vako</h1>
|
|
488
488
|
<p>Ultra modern Node.js framework</p>
|
|
489
489
|
</div>
|
|
490
490
|
</header>
|
|
@@ -507,7 +507,7 @@ class LayoutManager {
|
|
|
507
507
|
<% } else { %>
|
|
508
508
|
<footer>
|
|
509
509
|
<div class="container">
|
|
510
|
-
<p>Powered by
|
|
510
|
+
<p>Powered by Vako ⚡</p>
|
|
511
511
|
</div>
|
|
512
512
|
</footer>
|
|
513
513
|
<% } %>
|
package/lib/plugin-manager.js
CHANGED
|
@@ -732,7 +732,7 @@ class PluginManager extends EventEmitter {
|
|
|
732
732
|
return `
|
|
733
733
|
/**
|
|
734
734
|
* Plugin {{name}}
|
|
735
|
-
* Généré automatiquement par
|
|
735
|
+
* Généré automatiquement par Vako PluginManager
|
|
736
736
|
*/
|
|
737
737
|
|
|
738
738
|
module.exports = {
|
|
@@ -897,7 +897,7 @@ module.exports = {
|
|
|
897
897
|
}
|
|
898
898
|
|
|
899
899
|
setupHooks() {
|
|
900
|
-
// Hooks prédéfinis de
|
|
900
|
+
// Hooks prédéfinis de Vako
|
|
901
901
|
const defaultHooks = [
|
|
902
902
|
'app:init',
|
|
903
903
|
'app:start',
|
|
@@ -824,8 +824,8 @@ class RouteManager {
|
|
|
824
824
|
module.exports = {
|
|
825
825
|
get: (req, res) => {
|
|
826
826
|
res.render('index', {
|
|
827
|
-
title: '
|
|
828
|
-
message: 'Welcome to
|
|
827
|
+
title: 'Vako - Ultra modern framework',
|
|
828
|
+
message: 'Welcome to Vako! 🚀',
|
|
829
829
|
description: 'Your application is running successfully.'
|
|
830
830
|
});
|
|
831
831
|
}
|
|
@@ -890,7 +890,7 @@ module.exports = {
|
|
|
890
890
|
|
|
891
891
|
<% layout.section('scripts', \`
|
|
892
892
|
<script>
|
|
893
|
-
console.log('🎉
|
|
893
|
+
console.log('🎉 Vako app loaded successfully!');
|
|
894
894
|
</script>
|
|
895
895
|
\`) %>`;
|
|
896
896
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vako",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"verify": "node verify-code.js",
|
|
25
25
|
"prepublish": "node scripts/pre-publish.js",
|
|
26
26
|
"prepublishOnly": "echo 'Skipping tests for publication'",
|
|
27
|
-
"create-app": "node bin/create-
|
|
27
|
+
"create-app": "node bin/create-vako-app.js",
|
|
28
28
|
"docs": "jsdoc lib/ -d docs/",
|
|
29
29
|
"benchmark": "node scripts/benchmark.js",
|
|
30
30
|
"coverage": "jest --coverage --coverageReporters=text-lcov | coveralls"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
console.log('
|
|
1
|
+
console.log('Vako loaded');
|