Giter Site home page Giter Site logo

iron-stag-games / lync Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 4.0 227.17 MB

Lync is a file sync tool for Roblox.

License: GNU Lesser General Public License v2.1

Lua 34.27% Batchfile 0.49% JavaScript 63.20% Shell 0.17% Luau 1.86%
roblox roblox-tool roblox-tools

lync's Introduction

lync's People

Contributors

hoontee avatar jackprogramsjp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lync's Issues

.model.json files break live sync

.model.json files are not being parsed correctly, and seemingly, they break live sync.

Saving the same .model.json file produces a series of odd logs, which may be a lead:

Terminal:

Mapping JsonModel 'tree/ReplicatedStorage/Lycan/Tes' -> [source\platform\shared\TestModel.model.json]
Mapping JsonModel 'tree/ReplicatedStorage/Lyc' -> [source\platform\shared\TestModel.model.json]
Mapping JsonModel 'tree/ReplicatedStora' -> [source\platform\shared\TestModel.model.json]

Studio:

'ReplicatedStora' is not a valid Service name
  Stack Begin
  Script 'user_Lync.rbxm.Plugin', Line 441 - function buildPath
  Script 'user_Lync.rbxm.Plugin', Line 876
  Stack End

To reproduce:

  1. Add a .model.json file to your project
  2. Start live sync with debug ON
  3. Modify the .model.json file
  4. On Studio, in the explorer, notice how a duplicate model appears under a different name (and parent in some cases)
  5. Modifying the file again a few times eventually breaks live sync

Sync errors when resuming

  1. Start syncing
  2. Connect with studio
  3. Terminate syncing (ctrl+C)
  4. Wait for the studio connection to time out
  5. Start syncing again
  6. Try to resume connection in studio - Lync will error
node:internal/fs/utils:351
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'C:\Users\ian\AppData\Local\Roblox\undefined\InstalledPlugins\0\settings.json'
    at Object.openSync (node:fs:602:3)
    at Object.readFileSync (node:fs:470:35)
    at Server.<anonymous> (C:\Users\ian\AppData\Local\Roblox\Lync\index.js:1026:33)
    at Server.emit (node:events:514:28)
    at parserOnIncoming (node:_http_server:1132:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\ian\\AppData\\Local\\Roblox\\undefined\\InstalledPlugins\\0\\settings.json'
}

Package updates/deletions do not replicate as expected

To test this, simply setup a new project with a standard default.project.json with a packages folder defined:

"ServerScriptService": {
  "Server": {
    "$clearOnSync": true,
    "$path": "src/server",
    "lib": {
      "$className": "Folder",
      "$path": "./ServerPackages"
    }
  }
},

Install a few wally packages to that folder. Some examples you might want to use:

[server-dependencies]
Cmdr = "evaera/[email protected]"
ProfileService = "grilme99/[email protected]"

Sync to a baseplate and do one of the following:

  • Delete lib
  • Delete entry fromwally.toml and run wally install
  • Change entry in wally.toml and run wally install
  • Add entry to wally.toml and run wally install

In the cases that involved changing installed libraries, none of the changes replicate if they occur while sync is active. Pausing the plugin, resuming the plugin, or restarting the Win_Sync.bat script do not cause the changes to replicate. Studio has to be restarted.

Deleting lib in Roblox Studio permanently removes it until Studio is restarted, even if the listed pause/resume/restart steps listed above for the previous test are attempted.

Instances ignore the names they're assigned in project.json

For instances that are assigned a $path in the default.project.json file, upon modifying them, they seem to default to their file name, which causes them to duplicate, and sync to the wrong instance. (apologies if this sounds confusing, hopefully the reproduction steps clear things up)

To Reproduce:

  1. Have a project.json file that has an Instance with a $path property
{
  "name": "Ballistic",
  "tree": {
    "ReplicatedFirst": {
      "$className": "ReplicatedFirst",
      "ClientLoader": {
        "$path": "source/ballistic/game.client.luau"
      }
    }
  }
}
  1. Begin syncing, you should observe that initially the instance gets created with the proper name "ClientLoader", as also backed up by the logs
Mapping Instance 'tree/ReplicatedFirst/ClientLoader' -> [source\ballistic\game.client.luau]
Mapping Lua 'tree/ReplicatedFirst/ClientLoader' -> [source\ballistic\game.client.luau]
  1. Modify the file and notice how another instance is created called "game"
M [source\ballistic\game.client.luau]
Mapping Lua 'tree/ReplicatedFirst/game' -> [source\ballistic\game.client.luau]

image

  1. From this point any further modifications made to source\ballistic\game.client.luau will apply to ReplicatedFirst/game, rather than the expected ReplicatedFirst/ClientLoader

Note: I have only tested this with luau files, although I assume the same issue would persist with other formats as well.

Support embedding luau code into YAML files

Yaml files are neat, but currently you can't define any roblox types or instance paths.
I propose a syntax that lets you embed some luau code into yaml:

myVec: @"Vector3.new(1, 2, 3)"

Anything inside @"" is synced as luau code.
To use the @ character itself, you should be able to do @@ - this wont count as embed syntax and instead will just result in a @ character.

Can't build offline

As of Lune 0.7.0 there are a few API changes that break the Lune scripts generated to be used for offline builds.

Writing validation script . . .
Validating loadstrings . . .
Writing build script . . .
Building RBXL . . .
attempt to call a nil value
[Stack Begin]
    Script 'game.rbxl', Line 84
[Stack End]

Additionally, I tried using a version before these changes were made (0.6.7), although it started producing different errors this time.

Writing validation script . . .
Validating loadstrings . . .
Writing build script . . .
Building RBXL . . .
[ERROR] 
[Lync] - Set Property DevComputerMovementMode: callback error
stack traceback:
        [C]: in ?
        [string "game.rbxl"]:170: in ?
        [C]: in function 'pcall'
        [string "game.rbxl"]:62: in function 'lpcall'       
        [string "game.rbxl"]:166: in function 'setDetails'  
        [string "game.rbxl"]:383: in function 'buildPath'   
        [string "game.rbxl"]:420: in function 'buildAll'    
        [string "game.rbxl"]:428: in ?
caused by: error converting Lua string to userdata
[Stack Begin]
    Script 'game.rbxl', Line 64 - function lpcall
    Script 'game.rbxl', Line 166 - function setDetails      
    Script 'game.rbxl', Line 383 - function buildPath       
    Script 'game.rbxl', Line 420 - function buildAll        
    Script 'game.rbxl', Line 428
[Stack End]

offline build: error converting Lua string to userdata

Writing validation script . . .
Validating loadstrings . . .
Writing build script . . .
Building RBXL . . .
error converting Lua string to userdata (expected userdata of type lune_roblox::datatypes::types::enum_item::EnumItem)
[Stack Begin]
    Script '[C]'
    Script 'game.rbxl', Line 165
    Script 'game.rbxl', Line 62 - function lpcall
    Script 'game.rbxl', Line 161 - function setDetails
    Script 'game.rbxl', Line 378 - function buildPath
    Script 'game.rbxl', Line 415 - function buildAll
    Script 'game.rbxl', Line 423
[Stack End]

default.project.json as requested

{
  "name": "Ballistic",
  "tree": {
    "$className": "DataModel",
    "ServerStorage": {
      "$className": "ServerStorage",
      "Lycan": {
        "$path": "source/platform/server"
      },
      "Ballistic": {
        "$path": "source/ballistic/server"
      }
    },
    "ReplicatedStorage": {
      "$className": "ReplicatedStorage",

      "Lycan": {
        "$path": "source/platform/shared",
        "client": {
          "$path": "source/platform/client"
        },
        "packages": {
          "$path": "Packages"
        }
      },

      "Ballistic": {
        "$path": "source/ballistic/shared"
      },

      "Resources": {
        "$path": "resources/resources.manifest.rbxm"
      }
    },
    "ReplicatedFirst": {
      "$className": "ReplicatedFirst",
      "ClientLoader": {
        "$path": "source/ballistic/game.client.luau"
      }
    },

    "ServerScriptService": {
      "$className": "ServerScriptService",
      "ServerLoader": {
        "$path": "source/ballistic/game.server.luau"
      }
    },

    "StarterPlayer": {
      "$className": "StarterPlayer",
      "$properties": {
        "CameraMode": "LockFirstPerson",
        "DevComputerCameraMovementMode": "Classic",
        "DevTouchCameraMovementMode": "Classic",
        "LoadCharacterAppearance": false,
        "UserEmotesEnabled": false,
        "DevComputerMovementMode": "Scriptable",
        "DevTouchMovementMode": "Scriptable"
      }
    },
    "Players": {
      "$className": "Players",
      "$properties": {
        "CharacterAutoLoads": false
      }
    },
    "Workspace": {
      "$className": "Workspace",
      "$properties": {
        "FilteringEnabled": true
      }
    },
    "SoundService": {
      "$className": "SoundService",
      "$properties": {
        "RespectFilteringEnabled": true
      }
    }
  }
}

Sync error when creating new empty folder

Whenever I create a new folder, it fails to sync in properly. When that happens, the only way to get everything up again is to restart studio and start serving again

A [assets\server\animations\weapons]
Sync error: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at localPathIsInit (C:\Users\ian\AppData\Local\Roblox\Lync\index.js:105:45)
    at FSWatcher.<anonymous> (C:\Users\ian\AppData\Local\Roblox\Lync\index.js:985:22)
    at FSWatcher.emit (node:events:514:28)
    at FSWatcher.emitWithAll (C:\Users\ian\AppData\Local\Roblox\Lync\node_modules\chokidar\index.js:541:32)
    at FSWatcher._emit (C:\Users\ian\AppData\Local\Roblox\Lync\node_modules\chokidar\index.js:632:8)
    at NodeFsHandler._handleDir (C:\Users\ian\AppData\Local\Roblox\Lync\node_modules\chokidar\lib\nodefs-handler.js:551:53)
    at NodeFsHandler._addToNodeFs (C:\Users\ian\AppData\Local\Roblox\Lync\node_modules\chokidar\lib\nodefs-handler.js:617:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Support yaml meta & project files

I'd like meta and project files to support yaml too. Json is too verbose and strict.

Example json meta file

{
	"properties": {
		"RunContext": "Server"
	}
}

Example yaml meta file:

properties:
  RunContext: Server

change reference to plugin.source.lua in index.js

The lua file for the plugin was moved elsewhere although the old directory is still being referenced in the source code.

In line 615:

let pluginSource = fs.readFileSync(path.resolve(__dirname, 'plugin.source.lua'), { encoding: 'utf8' })

Changing it to RobloxPluginSource/Plugin.lua fixes the issue.

The error in case you still need it:

node:fs:601
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'C:\Users\canis\AppData\Local\Roblox\Lync\plugin.source.lua'
    at Object.openSync (node:fs:601:3)
    at Object.readFileSync (node:fs:469:35)
    at C:\Users\canis\AppData\Local\Roblox\Lync\index.js:615:25
    at Object.<anonymous> (C:\Users\canis\AppData\Local\Roblox\Lync\index.js:955:3)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\canis\\AppData\\Local\\Roblox\\Lync\\plugin.source.lua'
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.