syncrbx 1.0.0 → 1.1.1
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 +1 -1
- package/cli.js +459 -322
- package/converters.js +60 -11
- package/local-sync.js +631 -441
- package/package.json +26 -20
- package/build.js +0 -77
- package/make_rbxmx.js +0 -21
- package/test.js +0 -28
package/package.json
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "syncrbx",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "local-sync.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"syncrbx": "cli.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"start": "node cli.js serve",
|
|
11
|
-
"test": "node test.js"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"adm-zip": "^0.6.0",
|
|
15
|
-
"archiver": "^7.0.1",
|
|
16
|
-
"chokidar": "^3.6.0",
|
|
17
|
-
"commander": "^15.0.0",
|
|
18
|
-
"express": "^4.22.2"
|
|
19
|
-
}
|
|
20
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "syncrbx",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "A free tool to sync VS Code with Roblox Studio. Instant bidirectional sync, SyncRbx Cloud, and Auto-Folders.",
|
|
5
|
+
"main": "local-sync.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"syncrbx": "cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node cli.js serve",
|
|
11
|
+
"test": "node test.js"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"adm-zip": "^0.6.0",
|
|
15
|
+
"archiver": "^7.0.1",
|
|
16
|
+
"chokidar": "^3.6.0",
|
|
17
|
+
"commander": "^15.0.0",
|
|
18
|
+
"express": "^4.22.2"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"cli.js",
|
|
22
|
+
"local-sync.js",
|
|
23
|
+
"converters.js",
|
|
24
|
+
"README.md"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/build.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* build.js — Compiles the modular OOP plugin (src/) into a single SyncPlugin.lua
|
|
3
|
-
*
|
|
4
|
-
* Usage: node build.js
|
|
5
|
-
* Output: ../plugin/SyncPlugin.lua (ready to paste into Studio)
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const SRC = path.join(__dirname, '..', 'plugin', 'Workspace', 'VerdePlugin');
|
|
12
|
-
const OUT = path.join(__dirname, '..', 'plugin', 'SyncPlugin.lua');
|
|
13
|
-
|
|
14
|
-
// Read all module files in dependency order
|
|
15
|
-
const modules = {
|
|
16
|
-
'Utils.Constants': fs.readFileSync(path.join(SRC, 'Utils', 'Constants.lua'), 'utf8'),
|
|
17
|
-
'Utils.Logger': fs.readFileSync(path.join(SRC, 'Utils', 'Logger.lua'), 'utf8'),
|
|
18
|
-
'Core.Net': fs.readFileSync(path.join(SRC, 'Core', 'Net.lua'), 'utf8'),
|
|
19
|
-
'Core.InstanceTracker': fs.readFileSync(path.join(SRC, 'Core', 'InstanceTracker.lua'), 'utf8'),
|
|
20
|
-
'Core.SyncEngine': fs.readFileSync(path.join(SRC, 'Core', 'SyncEngine.lua'), 'utf8'),
|
|
21
|
-
'UI.VerdeWidget': fs.readFileSync(path.join(SRC, 'UI', 'VerdeWidget.lua'), 'utf8'),
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const mainSource = fs.readFileSync(path.join(SRC, 'Main.server.lua'), 'utf8');
|
|
25
|
-
|
|
26
|
-
// Build the bundled output
|
|
27
|
-
let output = `--[[\n Verde Sync Plugin v2.0 — Auto-generated bundle\n DO NOT EDIT — Edit the source files in plugin/src/ instead.\n Built: ${new Date().toISOString()}\n--]]\n\n`;
|
|
28
|
-
|
|
29
|
-
// Create a module loader
|
|
30
|
-
output += `local _modules = {}\nlocal _loaded = {}\n\n`;
|
|
31
|
-
output += `local function _require(name)\n if _loaded[name] then return _loaded[name] end\n local loader = _modules[name]\n if not loader then error("Module not found: " .. name) end\n _loaded[name] = loader()\n return _loaded[name]\nend\n\n`;
|
|
32
|
-
|
|
33
|
-
// Register each module
|
|
34
|
-
for (const [name, source] of Object.entries(modules)) {
|
|
35
|
-
// Replace require() calls with our bundled _require()
|
|
36
|
-
let processed = source;
|
|
37
|
-
|
|
38
|
-
// Replace patterns like: require(script.Parent.Parent.Utils.Constants)
|
|
39
|
-
// with: _require("Utils.Constants")
|
|
40
|
-
processed = processed.replace(
|
|
41
|
-
/require\(script\.Parent\.Parent\.([A-Za-z.]+)\)/g,
|
|
42
|
-
(match, modPath) => `_require("${modPath}")`
|
|
43
|
-
);
|
|
44
|
-
processed = processed.replace(
|
|
45
|
-
/require\(script\.Parent\.([A-Za-z.]+)\)/g,
|
|
46
|
-
(match, modPath) => {
|
|
47
|
-
// Determine the parent module's package
|
|
48
|
-
const parentPkg = name.split('.')[0];
|
|
49
|
-
return `_require("${parentPkg}.${modPath}")`;
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
output += `_modules["${name}"] = function()\n`;
|
|
54
|
-
// Indent the module source
|
|
55
|
-
const lines = processed.split('\n');
|
|
56
|
-
for (const line of lines) {
|
|
57
|
-
// Skip "return X" at the end - we'll handle it
|
|
58
|
-
output += ` ${line}\n`;
|
|
59
|
-
}
|
|
60
|
-
output += `end\n\n`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Process Main entry point
|
|
64
|
-
let mainProcessed = mainSource;
|
|
65
|
-
mainProcessed = mainProcessed.replace(
|
|
66
|
-
/require\(script\.Parent\.([A-Za-z.]+)\)/g,
|
|
67
|
-
(match, modPath) => `_require("${modPath}")`
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
output += `-- Main Entry Point\n`;
|
|
71
|
-
output += mainProcessed;
|
|
72
|
-
output += '\n';
|
|
73
|
-
|
|
74
|
-
fs.writeFileSync(OUT, output, 'utf8');
|
|
75
|
-
console.log(`✅ Built successfully: ${OUT}`);
|
|
76
|
-
console.log(` Size: ${(fs.statSync(OUT).size / 1024).toFixed(1)} KB`);
|
|
77
|
-
console.log(` Modules: ${Object.keys(modules).length}`);
|
package/make_rbxmx.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const src = fs.readFileSync('../plugin/SyncPlugin.lua', 'utf8');
|
|
3
|
-
const xml = `<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
|
|
4
|
-
<Meta name="ExplicitAutoJoints">true</Meta>
|
|
5
|
-
<External>null</External>
|
|
6
|
-
<External>nil</External>
|
|
7
|
-
<Item class="Script" referent="RBX1">
|
|
8
|
-
<Properties>
|
|
9
|
-
<BinaryString name="AttributesSerialize"></BinaryString>
|
|
10
|
-
<bool name="Disabled">false</bool>
|
|
11
|
-
<Content name="LinkedSource"><null></null></Content>
|
|
12
|
-
<string name="Name">SyncRbxSyncPlugin</string>
|
|
13
|
-
<string name="ScriptGuid">{11111111-1111-1111-1111-111111111111}</string>
|
|
14
|
-
<ProtectedString name="Source"><![CDATA[
|
|
15
|
-
${src}
|
|
16
|
-
]]></ProtectedString>
|
|
17
|
-
</Properties>
|
|
18
|
-
</Item>
|
|
19
|
-
</roblox>`;
|
|
20
|
-
fs.writeFileSync('../plugin/SyncRbxSync.rbxmx', xml);
|
|
21
|
-
console.log('Successfully generated SyncRbxSync.rbxmx');
|
package/test.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { processDirectory } = require('./converters');
|
|
4
|
-
|
|
5
|
-
const TEST_DIR = path.join(__dirname, '..', 'test_project');
|
|
6
|
-
|
|
7
|
-
function buildProjectTree() {
|
|
8
|
-
console.log(`Starting Phase 1 Test on ${TEST_DIR}...`);
|
|
9
|
-
|
|
10
|
-
if (!fs.existsSync(TEST_DIR)) {
|
|
11
|
-
console.error("Test directory not found!");
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const projectTree = [];
|
|
16
|
-
const rootFolders = fs.readdirSync(TEST_DIR, { withFileTypes: true });
|
|
17
|
-
|
|
18
|
-
for (const folder of rootFolders) {
|
|
19
|
-
if (folder.isDirectory()) {
|
|
20
|
-
const tree = processDirectory(path.join(TEST_DIR, folder.name), true);
|
|
21
|
-
projectTree.push(tree);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
console.log(JSON.stringify(projectTree, null, 2));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
buildProjectTree();
|