verde-sync 1.0.0 → 2.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/build.js +1 -1
- package/local-sync.js +14 -6
- package/package.json +1 -1
package/build.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('path');
|
|
10
10
|
|
|
11
|
-
const SRC = path.join(__dirname, '..', 'plugin', '
|
|
11
|
+
const SRC = path.join(__dirname, '..', 'plugin', 'Workspace', 'VerdePlugin');
|
|
12
12
|
const OUT = path.join(__dirname, '..', 'plugin', 'SyncPlugin.lua');
|
|
13
13
|
|
|
14
14
|
// Read all module files in dependency order
|
package/local-sync.js
CHANGED
|
@@ -11,12 +11,9 @@ const {
|
|
|
11
11
|
const app = express();
|
|
12
12
|
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
|
-
// Project root & config
|
|
14
|
+
// Project root & config
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
|
-
const
|
|
17
|
-
? path.resolve(process.argv[2])
|
|
18
|
-
: path.join(__dirname, '..', 'test_project');
|
|
19
|
-
const PROJECT_ROOT = targetDirArg;
|
|
16
|
+
const PROJECT_ROOT = process.cwd();
|
|
20
17
|
|
|
21
18
|
const projectConfig = loadProjectConfig(PROJECT_ROOT);
|
|
22
19
|
const PORT = projectConfig.port || 34872;
|
|
@@ -394,7 +391,7 @@ process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
|
394
391
|
// Start
|
|
395
392
|
// ---------------------------------------------------------------------------
|
|
396
393
|
function startServer() {
|
|
397
|
-
app.listen(PORT, () => {
|
|
394
|
+
const server = app.listen(PORT, () => {
|
|
398
395
|
console.log('');
|
|
399
396
|
console.log(c.bold(c.green(' ╔══════════════════════════════════════════╗')));
|
|
400
397
|
console.log(c.bold(c.green(' ║ 🌿 VERDE SYNC v2.0 🌿 ║')));
|
|
@@ -406,6 +403,17 @@ function startServer() {
|
|
|
406
403
|
logServer(`Esperando conexión de Roblox Studio...`);
|
|
407
404
|
console.log('');
|
|
408
405
|
});
|
|
406
|
+
|
|
407
|
+
server.on('error', (e) => {
|
|
408
|
+
if (e.code === 'EADDRINUSE') {
|
|
409
|
+
logError(`El puerto ${PORT} ya está en uso. ¿Hay otro servidor de Verde ejecutándose?`);
|
|
410
|
+
logError(`Cierra el otro servidor o cambia el puerto en verde.project.json`);
|
|
411
|
+
process.exit(1);
|
|
412
|
+
} else {
|
|
413
|
+
logError(`Error fatal: ${e.message}`);
|
|
414
|
+
process.exit(1);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
409
417
|
}
|
|
410
418
|
|
|
411
419
|
module.exports = { startServer };
|