forked from rojo-rbx/rojo
Compare commits
3 Commits
plugin-tes
...
v6.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0599b50235 | ||
|
|
21f7ef6186 | ||
|
|
de6470bb45 |
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
## Unreleased Changes
|
## Unreleased Changes
|
||||||
|
|
||||||
|
## [6.1.0][6.1.0] (April 12, 2021)
|
||||||
|
* Updated dependencies, fixing OptionalCoordinateFrame-related issues.
|
||||||
|
* Added `--address` flag to `rojo serve` to allow for external connections. ([#403][pr-403])
|
||||||
|
|
||||||
|
[pr-403]: https://github.com/rojo-rbx/rojo/pull/403
|
||||||
|
[6.1.0]: https://github.com/rojo-rbx/rojo/releases/tag/v6.1.0
|
||||||
|
|
||||||
## [6.0.2](https://github.com/rojo-rbx/rojo/releases/tag/v6.0.2) (February 9, 2021)
|
## [6.0.2](https://github.com/rojo-rbx/rojo/releases/tag/v6.0.2) (February 9, 2021)
|
||||||
* Fixed `rojo upload` to handle CSRF challenges.
|
* Fixed `rojo upload` to handle CSRF challenges.
|
||||||
|
|
||||||
|
|||||||
563
Cargo.lock
generated
563
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rojo"
|
name = "rojo"
|
||||||
version = "6.0.2"
|
version = "6.1.0"
|
||||||
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
|
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
|
||||||
description = "Enables professional-grade development tools for Roblox developers"
|
description = "Enables professional-grade development tools for Roblox developers"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ local isDevBuild = script.Parent.Parent:FindFirstChild("ROJO_DEV_BUILD") ~= nil
|
|||||||
return strict("Config", {
|
return strict("Config", {
|
||||||
isDevBuild = isDevBuild,
|
isDevBuild = isDevBuild,
|
||||||
codename = "Epiphany",
|
codename = "Epiphany",
|
||||||
version = {6, 0, 2},
|
version = {6, 1, 0},
|
||||||
expectedServerVersionString = "6.0 or newer",
|
expectedServerVersionString = "6.0 or newer",
|
||||||
protocolVersion = 3,
|
protocolVersion = 3,
|
||||||
defaultHost = "localhost",
|
defaultHost = "localhost",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ use std::{
|
|||||||
env,
|
env,
|
||||||
error::Error,
|
error::Error,
|
||||||
fmt,
|
fmt,
|
||||||
|
net::IpAddr,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
};
|
};
|
||||||
@@ -186,7 +187,11 @@ pub struct ServeCommand {
|
|||||||
#[structopt(default_value = "")]
|
#[structopt(default_value = "")]
|
||||||
pub project: PathBuf,
|
pub project: PathBuf,
|
||||||
|
|
||||||
/// The port to listen on. Defaults to the project's preference, or 34872 if
|
/// The IP address to listen on. Defaults to `127.0.0.1`.
|
||||||
|
#[structopt(long)]
|
||||||
|
pub address: Option<IpAddr>,
|
||||||
|
|
||||||
|
/// The port to listen on. Defaults to the project's preference, or `34872` if
|
||||||
/// it has none.
|
/// it has none.
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pub port: Option<u16>,
|
pub port: Option<u16>,
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
use std::{
|
use std::{
|
||||||
io::{self, Write},
|
io::{self, Write},
|
||||||
|
net::IpAddr,
|
||||||
|
net::Ipv4Addr,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -13,6 +15,7 @@ use crate::{
|
|||||||
web::LiveServer,
|
web::LiveServer,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_BIND_ADDRESS: Ipv4Addr = Ipv4Addr::new(127, 0, 0, 1);
|
||||||
const DEFAULT_PORT: u16 = 34872;
|
const DEFAULT_PORT: u16 = 34872;
|
||||||
|
|
||||||
pub fn serve(global: GlobalOptions, options: ServeCommand) -> Result<()> {
|
pub fn serve(global: GlobalOptions, options: ServeCommand) -> Result<()> {
|
||||||
@@ -20,6 +23,8 @@ pub fn serve(global: GlobalOptions, options: ServeCommand) -> Result<()> {
|
|||||||
|
|
||||||
let session = Arc::new(ServeSession::new(vfs, &options.absolute_project())?);
|
let session = Arc::new(ServeSession::new(vfs, &options.absolute_project())?);
|
||||||
|
|
||||||
|
let ip = options.address.unwrap_or(DEFAULT_BIND_ADDRESS.into());
|
||||||
|
|
||||||
let port = options
|
let port = options
|
||||||
.port
|
.port
|
||||||
.or_else(|| session.project_port())
|
.or_else(|| session.project_port())
|
||||||
@@ -27,13 +32,13 @@ pub fn serve(global: GlobalOptions, options: ServeCommand) -> Result<()> {
|
|||||||
|
|
||||||
let server = LiveServer::new(session);
|
let server = LiveServer::new(session);
|
||||||
|
|
||||||
let _ = show_start_message(port, global.color.into());
|
let _ = show_start_message(ip, port, global.color.into());
|
||||||
server.start(port);
|
server.start((ip, port).into());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show_start_message(port: u16, color: ColorChoice) -> io::Result<()> {
|
fn show_start_message(bind_address: IpAddr, port: u16, color: ColorChoice) -> io::Result<()> {
|
||||||
let writer = BufferWriter::stdout(color);
|
let writer = BufferWriter::stdout(color);
|
||||||
let mut buffer = writer.buffer();
|
let mut buffer = writer.buffer();
|
||||||
|
|
||||||
@@ -41,7 +46,12 @@ fn show_start_message(port: u16, color: ColorChoice) -> io::Result<()> {
|
|||||||
|
|
||||||
write!(&mut buffer, " Address: ")?;
|
write!(&mut buffer, " Address: ")?;
|
||||||
buffer.set_color(ColorSpec::new().set_fg(Some(Color::Green)).set_bold(true))?;
|
buffer.set_color(ColorSpec::new().set_fg(Some(Color::Green)).set_bold(true))?;
|
||||||
|
|
||||||
|
if bind_address.is_loopback() {
|
||||||
writeln!(&mut buffer, "localhost")?;
|
writeln!(&mut buffer, "localhost")?;
|
||||||
|
} else {
|
||||||
|
writeln!(&mut buffer, "{}", bind_address)?;
|
||||||
|
}
|
||||||
|
|
||||||
buffer.set_color(&ColorSpec::new())?;
|
buffer.set_color(&ColorSpec::new())?;
|
||||||
write!(&mut buffer, " Port: ")?;
|
write!(&mut buffer, " Port: ")?;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ pub mod interface;
|
|||||||
mod ui;
|
mod ui;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::{net::SocketAddr, sync::Arc};
|
||||||
|
|
||||||
use futures::{
|
use futures::{
|
||||||
future::{self, FutureResult},
|
future::{self, FutureResult},
|
||||||
@@ -57,9 +57,7 @@ impl LiveServer {
|
|||||||
LiveServer { serve_session }
|
LiveServer { serve_session }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start(self, port: u16) {
|
pub fn start(self, address: SocketAddr) {
|
||||||
let address = ([127, 0, 0, 1], port).into();
|
|
||||||
|
|
||||||
let server = Server::bind(&address)
|
let server = Server::bind(&address)
|
||||||
.serve(move || {
|
.serve(move || {
|
||||||
let service: FutureResult<_, hyper::Error> =
|
let service: FutureResult<_, hyper::Error> =
|
||||||
|
|||||||
Reference in New Issue
Block a user