holygrail5 1.0.2
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 +631 -0
- package/config.json +365 -0
- package/generator.js +58 -0
- package/package.json +48 -0
- package/src/cli-variables.js +147 -0
- package/src/config.js +62 -0
- package/src/dev.js +47 -0
- package/src/guide.js +1798 -0
- package/src/parser.js +624 -0
- package/src/utils.js +74 -0
- package/src/variables-manager.js +248 -0
- package/src/watch.js +88 -0
package/src/dev.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Script de desarrollo - Combina watch y servidor
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
console.log('🚀 Iniciando modo desarrollo...\n');
|
|
7
|
+
|
|
8
|
+
// Iniciar watch en background
|
|
9
|
+
const watchProcess = spawn('node', [path.join(__dirname, 'watch.js')], {
|
|
10
|
+
stdio: 'inherit',
|
|
11
|
+
shell: true
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// Esperar un momento para que watch genere los archivos inicialmente
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
console.log('\n🌐 Iniciando servidor HTTP en http://localhost:3000\n');
|
|
17
|
+
console.log('💡 Los archivos se regenerarán automáticamente cuando cambies config.json\n');
|
|
18
|
+
console.log('💡 Recarga el navegador (Cmd+Shift+R o Ctrl+Shift+R) para ver los cambios\n');
|
|
19
|
+
|
|
20
|
+
// Iniciar servidor HTTP
|
|
21
|
+
// Suprimir warnings de deprecación de http-server
|
|
22
|
+
// Servir desde dist/ como raíz, así la URL será /index.html sin mostrar "dist"
|
|
23
|
+
const serverProcess = spawn('npx', ['http-server', 'dist', '-p', '3000', '-o', 'index.html'], {
|
|
24
|
+
stdio: 'inherit',
|
|
25
|
+
shell: true,
|
|
26
|
+
env: { ...process.env, NODE_NO_WARNINGS: '1' }
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Manejar cierre
|
|
30
|
+
process.on('SIGINT', () => {
|
|
31
|
+
console.log('\n\n👋 Deteniendo servidor y watch...');
|
|
32
|
+
watchProcess.kill();
|
|
33
|
+
serverProcess.kill();
|
|
34
|
+
process.exit(0);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
watchProcess.on('exit', () => {
|
|
38
|
+
serverProcess.kill();
|
|
39
|
+
process.exit(0);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
serverProcess.on('exit', () => {
|
|
43
|
+
watchProcess.kill();
|
|
44
|
+
process.exit(0);
|
|
45
|
+
});
|
|
46
|
+
}, 2000);
|
|
47
|
+
|