rojo-rbx / rojo

Rojo enables Roblox developers to use professional-grade software engineering tools
https://rojo.space
Mozilla Public License 2.0
949 stars 179 forks source link

'rojo open' command #305

Open LPGhatguy opened 4 years ago

LPGhatguy commented 4 years ago

I think it would be useful to have a command that rolls up rojo serve, rojo build, rojo plugin install, etc. It would help reduce the number of manual steps needed for most workflows.

Usage

# Open the default project
rojo open

# Open another project
rojo open plugin/place.project.json

# Open existing regular place file and use default project
rojo open Foo.rbxl

Functionality

  1. Build a place file from the local project
    • This step is optional; we may open an existing local file instead
  2. Install the Rojo plugin, if not already installed
  3. Open the place in Roblox Studio
  4. Set the game/place ID from the Roblox Studio plugin
    • If the place was built locally but is associated with an uploaded place, this will be important to ensure access to API services
  5. Connect to the Rojo server from the plugin
    • We might be able to bypass parts of the initial sync step if the place is fresh!

Plugin Auto-Start

We have tons of options for helping the plugin auto-start:

  1. Inject a non-archivable marker object into the place
    • This might not work when we're loading the place from the website
  2. Inject a modified copy of the Rojo plugin that has sync details baked in
  3. Inject a new plugin that puts sync details into _G or into the DataModel
  4. Inject an asset into the content folder that contains sync details that we attempt to load on startup
  5. Change the plugin to attempt to connect to the default port on startup
    • We may want to add some sort of Rojo service discovery for this use case, like if Rojo started on a different port
  6. Inject sync details into plugin settings
    • There are lots of ways to get the Rojo plugin, supporting them all is probably too difficult

Additional Project Settings

{
    "name": "rojo open",
    "tree": {
        "$className": "DataModel",
    },

    "output": "open-example.rbxl",
    "placeId": 1231521,
    "gameId": 12512412
}
Jaguar-515 commented 4 years ago

Or, even better, create a command that opens a place file, regardless of whatever the place file is in a Rojo project or not.

LPGhatguy commented 4 years ago

I think you're right. We could instead introduce a rojo open command that can open a place file or a project file.

When it opens a project file, we'll build the place, install the Rojo plugin, open the place in Roblox Studio, and immediately start a connection to the plugin.