verde-sync 2.0.2 → 2.0.4
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/converters.js +24 -1
- package/local-sync.js +23 -1
- package/package.json +1 -1
package/converters.js
CHANGED
|
@@ -20,6 +20,8 @@ const KNOWN_EXTENSIONS = [
|
|
|
20
20
|
'.server.lua', '.server.luau',
|
|
21
21
|
'.client.lua', '.client.luau',
|
|
22
22
|
'.model.json', '.meta.json',
|
|
23
|
+
'.remoteevent', '.remotefunction',
|
|
24
|
+
'.bindableevent', '.bindablefunction',
|
|
23
25
|
'.lua', '.luau',
|
|
24
26
|
'.txt', '.json'
|
|
25
27
|
];
|
|
@@ -38,8 +40,9 @@ const VALUE_CLASSES = {
|
|
|
38
40
|
// ---------------------------------------------------------------------------
|
|
39
41
|
|
|
40
42
|
function stripExtension(filename) {
|
|
43
|
+
const lowerFilename = filename.toLowerCase();
|
|
41
44
|
for (const ext of KNOWN_EXTENSIONS) {
|
|
42
|
-
if (
|
|
45
|
+
if (lowerFilename.endsWith(ext.toLowerCase())) {
|
|
43
46
|
return filename.slice(0, -ext.length);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
@@ -141,6 +144,14 @@ function convertFile(filePath) {
|
|
|
141
144
|
} catch (e) {
|
|
142
145
|
console.error(`[WARN] Error parsing model file ${filePath}:`, e.message);
|
|
143
146
|
}
|
|
147
|
+
} else if (filename.toLowerCase().endsWith('.remoteevent')) {
|
|
148
|
+
instance.ClassName = 'RemoteEvent';
|
|
149
|
+
} else if (filename.toLowerCase().endsWith('.remotefunction')) {
|
|
150
|
+
instance.ClassName = 'RemoteFunction';
|
|
151
|
+
} else if (filename.toLowerCase().endsWith('.bindableevent')) {
|
|
152
|
+
instance.ClassName = 'BindableEvent';
|
|
153
|
+
} else if (filename.toLowerCase().endsWith('.bindablefunction')) {
|
|
154
|
+
instance.ClassName = 'BindableFunction';
|
|
144
155
|
} else if (filename.endsWith('.txt')) {
|
|
145
156
|
instance.ClassName = 'StringValue';
|
|
146
157
|
instance.Properties.Value = content;
|
|
@@ -304,6 +315,18 @@ function instanceToFile(instanceData) {
|
|
|
304
315
|
if (className === 'StringValue') {
|
|
305
316
|
return { fileName: `${name}.txt`, content: value, isDirectory: false };
|
|
306
317
|
}
|
|
318
|
+
if (className === 'RemoteEvent') {
|
|
319
|
+
return { fileName: `${name}.remoteevent`, content: '', isDirectory: false };
|
|
320
|
+
}
|
|
321
|
+
if (className === 'RemoteFunction') {
|
|
322
|
+
return { fileName: `${name}.remotefunction`, content: '', isDirectory: false };
|
|
323
|
+
}
|
|
324
|
+
if (className === 'BindableEvent') {
|
|
325
|
+
return { fileName: `${name}.bindableevent`, content: '', isDirectory: false };
|
|
326
|
+
}
|
|
327
|
+
if (className === 'BindableFunction') {
|
|
328
|
+
return { fileName: `${name}.bindablefunction`, content: '', isDirectory: false };
|
|
329
|
+
}
|
|
307
330
|
|
|
308
331
|
// Phase 2 - #5: Value types and other instances → .model.json
|
|
309
332
|
if (VALUE_CLASSES[className] !== undefined) {
|
package/local-sync.js
CHANGED
|
@@ -191,10 +191,16 @@ app.get('/ping', (req, res) => {
|
|
|
191
191
|
res.json({
|
|
192
192
|
status: 'ok',
|
|
193
193
|
project: projectConfig.name || path.basename(PROJECT_ROOT),
|
|
194
|
-
version: '2.0.
|
|
194
|
+
version: '2.0.2',
|
|
195
195
|
});
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
+
app.post('/shutdown', (req, res) => {
|
|
199
|
+
res.json({ success: true });
|
|
200
|
+
logServer('Apagado solicitado por la extensión VS Code.');
|
|
201
|
+
setTimeout(() => shutdown('SIGTERM'), 100);
|
|
202
|
+
});
|
|
203
|
+
|
|
198
204
|
app.get('/tree', (req, res) => {
|
|
199
205
|
try {
|
|
200
206
|
const tree = [];
|
|
@@ -391,6 +397,22 @@ process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
|
391
397
|
// Start
|
|
392
398
|
// ---------------------------------------------------------------------------
|
|
393
399
|
function startServer() {
|
|
400
|
+
const defaultFolders = [
|
|
401
|
+
...ROOT_SERVICES,
|
|
402
|
+
'StarterPlayer/StarterPlayerScripts',
|
|
403
|
+
'StarterPlayer/StarterCharacterScripts'
|
|
404
|
+
];
|
|
405
|
+
for (const folder of defaultFolders) {
|
|
406
|
+
const folderPath = path.join(PROJECT_ROOT, folder);
|
|
407
|
+
if (!fs.existsSync(folderPath)) {
|
|
408
|
+
try {
|
|
409
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
410
|
+
} catch (e) {
|
|
411
|
+
// Ignore permissions/nested errors
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
394
416
|
const server = app.listen(PORT, () => {
|
|
395
417
|
console.log('');
|
|
396
418
|
console.log(c.bold(c.green(' ╔══════════════════════════════════════════╗')));
|