diff --git a/.gitignore b/.gitignore index e2eb21f..89c4bf0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ /.DS_Store /**/.DS_Store - # Autogenerated dirs /bin @@ -16,11 +15,7 @@ lune.yml luneDocs.json luneTypes.d.luau -# NOTE: Don't remove the typedefs file in the docs dir! -# We depend on it to autogenerate all of the above files. -!/docs/luneTypes.d.luau - # Files generated by runtime or build scripts -packages/lib-roblox/scripts/brick_color.rs -packages/lib-roblox/scripts/font_enum_map.rs -packages/lib-roblox/scripts/physical_properties_enum_map.rs +scripts/brick_color.rs +scripts/font_enum_map.rs +scripts/physical_properties_enum_map.rs diff --git a/.justfile b/.justfile index 8f9e9b8..a5a924a 100644 --- a/.justfile +++ b/.justfile @@ -8,7 +8,7 @@ run-file FILE_NAME: # Run tests for the Lune library test: - cargo test --package lune -- --test-threads 1 + cargo test --lib -- --test-threads 1 # Generate gitbook directory generate-gitbook: diff --git a/Cargo.lock b/Cargo.lock index 6bcad3c..dc312dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1145,45 +1145,31 @@ dependencies = [ "anyhow", "async-compression", "async-trait", + "clap 4.3.11", "console", "dialoguer", "directories", "dunce", + "env_logger 0.10.0", + "full_moon", "futures-util", + "glam", "hyper", "hyper-tungstenite", - "lune-roblox", + "include_dir", + "itertools", "lz4_flex", "mlua", "once_cell", "os_str_bytes", "pin-project", + "rand", + "rbx_binary", "rbx_cookie", - "reqwest", - "serde", - "serde_json", - "serde_yaml", - "tokio", - "tokio-tungstenite", - "toml", - "urlencoding", -] - -[[package]] -name = "lune-cli" -version = "0.7.4" -dependencies = [ - "anyhow", - "clap 4.3.11", - "console", - "directories", - "env_logger 0.10.0", - "full_moon", - "futures-util", - "include_dir", - "itertools", - "lune", - "once_cell", + "rbx_dom_weak", + "rbx_reflection", + "rbx_reflection_database", + "rbx_xml", "regex", "reqwest", "serde", @@ -1191,23 +1177,9 @@ dependencies = [ "serde_yaml", "thiserror", "tokio", -] - -[[package]] -name = "lune-roblox" -version = "0.7.4" -dependencies = [ - "anyhow", - "glam", - "mlua", - "once_cell", - "rand", - "rbx_binary", - "rbx_dom_weak", - "rbx_reflection", - "rbx_reflection_database", - "rbx_xml", - "thiserror", + "tokio-tungstenite", + "toml", + "urlencoding", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 75aa1a5..6017323 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,5 @@ -[workspace] -members = ["packages/cli", "packages/lib", "packages/lib-roblox"] -default-members = ["packages/cli"] - -# Package config values shared across all packages, -# such as version, license, and other metadata -[workspace.package] +[package] +name = "lune" version = "0.7.4" edition = "2021" license = "MPL-2.0" @@ -14,26 +9,35 @@ readme = "README.md" keywords = ["cli", "lua", "luau", "scripts"] categories = ["command-line-interface"] -# Shared dependencies that are used across 2 or more packages -# These are declared here to ensure consistent versioning -[workspace.dependencies] -console = "0.15" -directories = "5.0" -futures-util = "0.3" -once_cell = "1.17" -thiserror = "1.0" +[[bin]] +name = "lune" +path = "src/main.rs" -mlua = { version = "0.9.0-beta.3", features = ["luau", "serialize"] } -tokio = { version = "1.24", features = ["full"] } -reqwest = { version = "0.11", default-features = false, features = [ - "rustls-tls", -] } +[lib] +name = "lune" +path = "src/lib.rs" -# Serde dependencies, supporting user-facing formats: json, yaml, toml -serde = { version = "1.0", features = ["derive"] } -serde_json = { version = "1.0", features = ["preserve_order"] } -serde_yaml = "0.9" -toml = { version = "0.7", features = ["preserve_order"] } +[features] +default = ["cli", "roblox"] +cli = [ + "dep:anyhow", + "dep:env_logger", + "dep:itertools", + "dep:clap", + "dep:full_moon", + "dep:include_dir", + "dep:regex", +] +roblox = [ + "dep:glam", + "dep:rand", + "dep:rbx_cookie", + "dep:rbx_binary", + "dep:rbx_dom_weak", + "dep:rbx_reflection", + "dep:rbx_reflection_database", + "dep:rbx_xml", +] # Profile for building the release binary, with the following options set: # @@ -49,3 +53,80 @@ toml = { version = "0.7", features = ["preserve_order"] } opt-level = "z" strip = true lto = true + +# All of the dependencies for Lune. +# +# Dependencies are categorized as following: +# +# 1. General dependencies with no specific features set +# 2. Large / core dependencies that have many different crates and / or features set +# 3. Dependencies for specific features of Lune, eg. the CLI or massive Roblox builtin library +# +[dependencies] +console = "0.15" +directories = "5.0" +futures-util = "0.3" +once_cell = "1.17" +thiserror = "1.0" +async-trait = "0.1" +dialoguer = "0.10" +dunce = "1.0" +lz4_flex = "0.10" +pin-project = "1.0" +os_str_bytes = "6.4" +urlencoding = "2.1.2" + +### RUNTIME + +mlua = { version = "0.9.0-beta.3", features = ["luau", "serialize"] } +tokio = { version = "1.24", features = ["full"] } + +### SERDE + +async-compression = { version = "0.4", features = [ + "tokio", + "brotli", + "deflate", + "gzip", + "zlib", +] } +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = ["preserve_order"] } +serde_yaml = "0.9" +toml = { version = "0.7", features = ["preserve_order"] } + +### NET + +hyper = { version = "0.14", features = ["full"] } +hyper-tungstenite = { version = "0.10" } +reqwest = { version = "0.11", default-features = false, features = [ + "rustls-tls", +] } +tokio-tungstenite = { version = "0.19", features = ["rustls-tls-webpki-roots"] } + +### CLI + +anyhow = { optional = true, version = "1.0" } +env_logger = { optional = true, version = "0.10" } +itertools = { optional = true, version = "0.10" } + +clap = { optional = true, version = "4.1", features = ["derive"] } +full_moon = { optional = true, version = "0.18", features = ["roblox"] } +include_dir = { optional = true, version = "0.7.3", features = ["glob"] } +regex = { optional = true, version = "1.7", default-features = false, features = [ + "std", + "unicode-perl", +] } + +### ROBLOX + +glam = { optional = true, version = "0.24" } +rand = { optional = true, version = "0.8" } + +rbx_cookie = { optional = true, version = "0.1.2" } + +rbx_binary = { optional = true, git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } +rbx_dom_weak = { optional = true, git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } +rbx_reflection = { optional = true, git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } +rbx_reflection_database = { optional = true, git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } +rbx_xml = { optional = true, git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } diff --git a/packages/cli/Cargo.toml b/packages/cli/Cargo.toml deleted file mode 100644 index c6601e0..0000000 --- a/packages/cli/Cargo.toml +++ /dev/null @@ -1,46 +0,0 @@ -[package] -name = "lune-cli" -publish = false -version.workspace = true -edition.workspace = true -license.workspace = true -repository.workspace = true -description.workspace = true -readme.workspace = true -keywords.workspace = true -categories.workspace = true - -[[bin]] -name = "lune" -path = "src/main.rs" - -[features] -default = [] -roblox = ["lune/roblox"] - -[dependencies] - -lune = { path = "../lib" } - -console.workspace = true -directories.workspace = true -futures-util.workspace = true -once_cell.workspace = true -reqwest.workspace = true -serde.workspace = true -serde_json.workspace = true -serde_yaml.workspace = true -tokio.workspace = true -thiserror.workspace = true - -anyhow = "1.0" -env_logger = "0.10" -itertools = "0.10" - -clap = { version = "4.1", features = ["derive"] } -full_moon = { version = "0.18", features = ["roblox"] } -include_dir = { version = "0.7.3", features = ["glob"] } -regex = { version = "1.7", default-features = false, features = [ - "std", - "unicode-perl", -] } diff --git a/packages/lib-roblox/Cargo.toml b/packages/lib-roblox/Cargo.toml deleted file mode 100644 index 985181a..0000000 --- a/packages/lib-roblox/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "lune-roblox" -publish = false -version.workspace = true -edition.workspace = true -license.workspace = true -repository.workspace = true -description.workspace = true -readme.workspace = true -keywords.workspace = true -categories.workspace = true - -[lib] -name = "lune_roblox" -path = "src/lib.rs" - -[dependencies] -mlua.workspace = true -once_cell.workspace = true -thiserror.workspace = true - -glam = "0.24" -rand = "0.8" - -rbx_binary = { git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } -rbx_dom_weak = { git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } -rbx_reflection = { git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } -rbx_reflection_database = { git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } -rbx_xml = { git = "https://github.com/rojo-rbx/rbx-dom", rev = "e7a813d569c3f8a54be8a8873c33f8976c37b8b1" } - -[dev-dependencies] -anyhow = "1.0" diff --git a/packages/lib/Cargo.toml b/packages/lib/Cargo.toml deleted file mode 100644 index a810b49..0000000 --- a/packages/lib/Cargo.toml +++ /dev/null @@ -1,57 +0,0 @@ -[package] -name = "lune" -version.workspace = true -edition.workspace = true -license.workspace = true -repository.workspace = true -description.workspace = true -readme.workspace = true -keywords.workspace = true -categories.workspace = true - -[lib] -name = "lune" -path = "src/lib.rs" - -[features] -default = ["roblox"] -roblox = ["dep:lune-roblox", "dep:rbx_cookie"] - -[dependencies] - -lune-roblox = { path = "../lib-roblox", optional = true } -rbx_cookie = { version = "0.1.2", optional = true } - -console.workspace = true -directories.workspace = true -futures-util.workspace = true -mlua.workspace = true -once_cell.workspace = true -reqwest.workspace = true -serde.workspace = true -serde_json.workspace = true -serde_yaml.workspace = true -toml.workspace = true -tokio.workspace = true - -async-trait = "0.1" -dialoguer = "0.10" -dunce = "1.0" -lz4_flex = "0.10" -pin-project = "1.0" -os_str_bytes = "6.4" -urlencoding = "2.1.2" - -async-compression = { version = "0.4", features = [ - "tokio", - "brotli", - "deflate", - "gzip", - "zlib", -] } -hyper = { version = "0.14", features = ["full"] } -hyper-tungstenite = { version = "0.10" } -tokio-tungstenite = { version = "0.19", features = ["rustls-tls-webpki-roots"] } - -[dev-dependencies] -anyhow = "1.0" diff --git a/packages/lib/src/builtins/mod.rs b/packages/lib/src/builtins/mod.rs deleted file mode 100644 index 4140297..0000000 --- a/packages/lib/src/builtins/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub(crate) mod fs; -pub(crate) mod net; -pub(crate) mod process; -pub(crate) mod serde; -pub(crate) mod stdio; -pub(crate) mod task; -pub(crate) mod top_level; - -#[cfg(feature = "roblox")] -pub(crate) mod roblox; diff --git a/packages/lib-roblox/scripts/brick_color.luau b/scripts/brick_color.luau similarity index 100% rename from packages/lib-roblox/scripts/brick_color.luau rename to scripts/brick_color.luau diff --git a/packages/lib-roblox/scripts/font_enum_map.luau b/scripts/font_enum_map.luau similarity index 100% rename from packages/lib-roblox/scripts/font_enum_map.luau rename to scripts/font_enum_map.luau diff --git a/packages/lib-roblox/scripts/physical_properties_enum_map.luau b/scripts/physical_properties_enum_map.luau similarity index 100% rename from packages/lib-roblox/scripts/physical_properties_enum_map.luau rename to scripts/physical_properties_enum_map.luau diff --git a/packages/cli/src/gen/definitions/builder.rs b/src/cli/gen/definitions/builder.rs similarity index 100% rename from packages/cli/src/gen/definitions/builder.rs rename to src/cli/gen/definitions/builder.rs diff --git a/packages/cli/src/gen/definitions/item.rs b/src/cli/gen/definitions/item.rs similarity index 100% rename from packages/cli/src/gen/definitions/item.rs rename to src/cli/gen/definitions/item.rs diff --git a/packages/cli/src/gen/definitions/kind.rs b/src/cli/gen/definitions/kind.rs similarity index 100% rename from packages/cli/src/gen/definitions/kind.rs rename to src/cli/gen/definitions/kind.rs diff --git a/packages/cli/src/gen/definitions/mod.rs b/src/cli/gen/definitions/mod.rs similarity index 100% rename from packages/cli/src/gen/definitions/mod.rs rename to src/cli/gen/definitions/mod.rs diff --git a/packages/cli/src/gen/definitions/moonwave.rs b/src/cli/gen/definitions/moonwave.rs similarity index 100% rename from packages/cli/src/gen/definitions/moonwave.rs rename to src/cli/gen/definitions/moonwave.rs diff --git a/packages/cli/src/gen/definitions/parser.rs b/src/cli/gen/definitions/parser.rs similarity index 100% rename from packages/cli/src/gen/definitions/parser.rs rename to src/cli/gen/definitions/parser.rs diff --git a/packages/cli/src/gen/definitions/tag.rs b/src/cli/gen/definitions/tag.rs similarity index 100% rename from packages/cli/src/gen/definitions/tag.rs rename to src/cli/gen/definitions/tag.rs diff --git a/packages/cli/src/gen/definitions/tree.rs b/src/cli/gen/definitions/tree.rs similarity index 100% rename from packages/cli/src/gen/definitions/tree.rs rename to src/cli/gen/definitions/tree.rs diff --git a/packages/cli/src/gen/definitions/type_info_ext.rs b/src/cli/gen/definitions/type_info_ext.rs similarity index 100% rename from packages/cli/src/gen/definitions/type_info_ext.rs rename to src/cli/gen/definitions/type_info_ext.rs diff --git a/packages/cli/src/gen/gitbook_dir.rs b/src/cli/gen/gitbook_dir.rs similarity index 100% rename from packages/cli/src/gen/gitbook_dir.rs rename to src/cli/gen/gitbook_dir.rs diff --git a/packages/cli/src/gen/mod.rs b/src/cli/gen/mod.rs similarity index 100% rename from packages/cli/src/gen/mod.rs rename to src/cli/gen/mod.rs diff --git a/packages/cli/src/gen/typedef_files.rs b/src/cli/gen/typedef_files.rs similarity index 100% rename from packages/cli/src/gen/typedef_files.rs rename to src/cli/gen/typedef_files.rs diff --git a/packages/cli/src/cli.rs b/src/cli/mod.rs similarity index 96% rename from packages/cli/src/cli.rs rename to src/cli/mod.rs index 63b9d87..0a97c6f 100644 --- a/packages/cli/src/cli.rs +++ b/src/cli/mod.rs @@ -9,12 +9,14 @@ use tokio::{ io::{stdin, AsyncReadExt}, }; -use crate::{ - setup::run_setup, - utils::{ - files::{discover_script_path_including_lune_dirs, strip_shebang}, - listing::{find_lune_scripts, sort_lune_scripts, write_lune_scripts_list}, - }, +pub(crate) mod gen; +pub(crate) mod setup; +pub(crate) mod utils; + +use setup::run_setup; +use utils::{ + files::{discover_script_path_including_lune_dirs, strip_shebang}, + listing::{find_lune_scripts, sort_lune_scripts, write_lune_scripts_list}, }; /// A Luau script runner diff --git a/packages/cli/src/setup/mod.rs b/src/cli/setup/mod.rs similarity index 98% rename from packages/cli/src/setup/mod.rs rename to src/cli/setup/mod.rs index 098271b..42b0c67 100644 --- a/packages/cli/src/setup/mod.rs +++ b/src/cli/setup/mod.rs @@ -8,7 +8,7 @@ use tokio::fs; // TODO: Use a library that supports json with comments since VSCode settings may contain comments use serde_json::Value as JsonValue; -use crate::gen::generate_typedef_files_from_definitions; +use super::gen::generate_typedef_files_from_definitions; pub(crate) static TYPEDEFS_DIR: Dir<'_> = include_dir!("docs/typedefs"); diff --git a/packages/cli/src/utils/files.rs b/src/cli/utils/files.rs similarity index 100% rename from packages/cli/src/utils/files.rs rename to src/cli/utils/files.rs diff --git a/packages/cli/src/utils/listing.rs b/src/cli/utils/listing.rs similarity index 100% rename from packages/cli/src/utils/listing.rs rename to src/cli/utils/listing.rs diff --git a/packages/cli/src/utils/mod.rs b/src/cli/utils/mod.rs similarity index 100% rename from packages/cli/src/utils/mod.rs rename to src/cli/utils/mod.rs diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..1d30335 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,7 @@ +mod lune; +mod roblox; + +#[cfg(test)] +mod tests; + +pub use crate::lune::{Lune, LuneError}; diff --git a/packages/lib/src/builtins/fs.rs b/src/lune/builtins/fs.rs similarity index 98% rename from packages/lib/src/builtins/fs.rs rename to src/lune/builtins/fs.rs index e4185b7..d5dd88f 100644 --- a/packages/lib/src/builtins/fs.rs +++ b/src/lune/builtins/fs.rs @@ -3,7 +3,7 @@ use std::path::{PathBuf, MAIN_SEPARATOR}; use mlua::prelude::*; use tokio::fs; -use crate::lua::{fs::FsWriteOptions, table::TableBuilder}; +use crate::lune::lua::{fs::FsWriteOptions, table::TableBuilder}; pub fn create(lua: &'static Lua) -> LuaResult { TableBuilder::new(lua)? diff --git a/src/lune/builtins/mod.rs b/src/lune/builtins/mod.rs new file mode 100644 index 0000000..20b13a4 --- /dev/null +++ b/src/lune/builtins/mod.rs @@ -0,0 +1,10 @@ +pub mod fs; +pub mod net; +pub mod process; +pub mod serde; +pub mod stdio; +pub mod task; +pub mod top_level; + +#[cfg(feature = "roblox")] +pub mod roblox; diff --git a/packages/lib/src/builtins/net.rs b/src/lune/builtins/net.rs similarity index 99% rename from packages/lib/src/builtins/net.rs rename to src/lune/builtins/net.rs index d177650..358d5ce 100644 --- a/packages/lib/src/builtins/net.rs +++ b/src/lune/builtins/net.rs @@ -9,7 +9,7 @@ use hyper::{ }; use tokio::{sync::mpsc, task}; -use crate::lua::{ +use crate::lune::lua::{ net::{ NetClient, NetClientBuilder, NetLocalExec, NetService, NetWebSocket, RequestConfig, ServeConfig, diff --git a/packages/lib/src/builtins/process.rs b/src/lune/builtins/process.rs similarity index 99% rename from packages/lib/src/builtins/process.rs rename to src/lune/builtins/process.rs index 09aea7f..b83948c 100644 --- a/packages/lib/src/builtins/process.rs +++ b/src/lune/builtins/process.rs @@ -11,7 +11,7 @@ use mlua::prelude::*; use os_str_bytes::RawOsString; use tokio::process::Command; -use crate::lua::{ +use crate::lune::lua::{ process::pipe_and_inherit_child_process_stdio, table::TableBuilder, task::TaskScheduler, }; diff --git a/packages/lib/src/builtins/roblox.rs b/src/lune/builtins/roblox.rs similarity index 96% rename from packages/lib/src/builtins/roblox.rs rename to src/lune/builtins/roblox.rs index b3d1b37..3f8e6dd 100644 --- a/packages/lib/src/builtins/roblox.rs +++ b/src/lune/builtins/roblox.rs @@ -1,16 +1,17 @@ use mlua::prelude::*; -use lune_roblox::{ +use crate::roblox::{ + self, document::{Document, DocumentError, DocumentFormat, DocumentKind}, instance::Instance, }; use tokio::task; -use crate::lua::table::TableBuilder; +use crate::lune::lua::table::TableBuilder; pub fn create(lua: &'static Lua) -> LuaResult { let mut roblox_constants = Vec::new(); - let roblox_module = lune_roblox::module(lua)?; + let roblox_module = roblox::module(lua)?; for pair in roblox_module.pairs::() { roblox_constants.push(pair?); } diff --git a/packages/lib/src/builtins/serde.rs b/src/lune/builtins/serde.rs similarity index 98% rename from packages/lib/src/builtins/serde.rs rename to src/lune/builtins/serde.rs index ed430e3..e2bc6e7 100644 --- a/packages/lib/src/builtins/serde.rs +++ b/src/lune/builtins/serde.rs @@ -1,6 +1,6 @@ use mlua::prelude::*; -use crate::lua::{ +use crate::lune::lua::{ serde::{ compress, decompress, CompressDecompressFormat, EncodeDecodeConfig, EncodeDecodeFormat, }, diff --git a/packages/lib/src/builtins/stdio.rs b/src/lune/builtins/stdio.rs similarity index 99% rename from packages/lib/src/builtins/stdio.rs rename to src/lune/builtins/stdio.rs index f497287..48b12c7 100644 --- a/packages/lib/src/builtins/stdio.rs +++ b/src/lune/builtins/stdio.rs @@ -5,7 +5,7 @@ use tokio::{ task, }; -use crate::lua::{ +use crate::lune::lua::{ stdio::{ formatting::{ format_style, pretty_format_multi_value, style_from_color_str, style_from_style_str, diff --git a/packages/lib/src/builtins/task.rs b/src/lune/builtins/task.rs similarity index 99% rename from packages/lib/src/builtins/task.rs rename to src/lune/builtins/task.rs index 8abf334..b29b502 100644 --- a/packages/lib/src/builtins/task.rs +++ b/src/lune/builtins/task.rs @@ -1,6 +1,6 @@ use mlua::prelude::*; -use crate::lua::{ +use crate::lune::lua::{ async_ext::LuaAsyncExt, table::TableBuilder, task::{ diff --git a/packages/lib/src/builtins/top_level.rs b/src/lune/builtins/top_level.rs similarity index 96% rename from packages/lib/src/builtins/top_level.rs rename to src/lune/builtins/top_level.rs index 4d72d0c..a101fb0 100644 --- a/packages/lib/src/builtins/top_level.rs +++ b/src/lune/builtins/top_level.rs @@ -2,9 +2,9 @@ use mlua::prelude::*; use std::io::{self, Write as _}; #[cfg(feature = "roblox")] -use lune_roblox::datatypes::extension::RobloxUserdataTypenameExt; +use crate::roblox::datatypes::extension::RobloxUserdataTypenameExt; -use crate::lua::{ +use crate::lune::lua::{ stdio::formatting::{format_label, pretty_format_multi_value}, task::TaskReference, }; diff --git a/packages/lib/src/error.rs b/src/lune/error.rs similarity index 92% rename from packages/lib/src/error.rs rename to src/lune/error.rs index 068738d..eb3ec56 100644 --- a/packages/lib/src/error.rs +++ b/src/lune/error.rs @@ -5,7 +5,7 @@ use std::{ use mlua::prelude::*; -use crate::lua::stdio::formatting::pretty_format_luau_error; +use crate::lune::lua::stdio::formatting::pretty_format_luau_error; /** An opaque error type for formatted lua errors. diff --git a/packages/lib/src/importer/mod.rs b/src/lune/importer/mod.rs similarity index 96% rename from packages/lib/src/importer/mod.rs rename to src/lune/importer/mod.rs index a244bab..c0658d1 100644 --- a/packages/lib/src/importer/mod.rs +++ b/src/lune/importer/mod.rs @@ -3,7 +3,7 @@ use mlua::prelude::*; mod require; mod require_waker; -use crate::builtins::{self, top_level}; +use crate::lune::builtins::{self, top_level}; pub fn create(lua: &'static Lua, args: Vec) -> LuaResult<()> { // Create all builtins diff --git a/packages/lib/src/importer/require.rs b/src/lune/importer/require.rs similarity index 99% rename from packages/lib/src/importer/require.rs rename to src/lune/importer/require.rs index a6bbe53..4211a22 100644 --- a/packages/lib/src/importer/require.rs +++ b/src/lune/importer/require.rs @@ -11,7 +11,7 @@ use mlua::{prelude::*, Compiler as LuaCompiler}; use tokio::fs; use tokio::sync::Mutex as AsyncMutex; -use crate::lua::{ +use crate::lune::lua::{ table::TableBuilder, task::{TaskScheduler, TaskSchedulerScheduleExt}, }; diff --git a/packages/lib/src/importer/require_waker.rs b/src/lune/importer/require_waker.rs similarity index 100% rename from packages/lib/src/importer/require_waker.rs rename to src/lune/importer/require_waker.rs diff --git a/packages/lib/src/lua/async_ext.rs b/src/lune/lua/async_ext.rs similarity index 97% rename from packages/lib/src/lua/async_ext.rs rename to src/lune/lua/async_ext.rs index 678b268..afdd29b 100644 --- a/packages/lib/src/lua/async_ext.rs +++ b/src/lune/lua/async_ext.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use futures_util::Future; use mlua::prelude::*; -use crate::{lua::table::TableBuilder, lua::task::TaskScheduler}; +use crate::lune::{lua::table::TableBuilder, lua::task::TaskScheduler}; use super::task::TaskSchedulerAsyncExt; diff --git a/packages/lib/src/lua/create.rs b/src/lune/lua/create.rs similarity index 100% rename from packages/lib/src/lua/create.rs rename to src/lune/lua/create.rs diff --git a/packages/lib/src/lua/fs/mod.rs b/src/lune/lua/fs/mod.rs similarity index 100% rename from packages/lib/src/lua/fs/mod.rs rename to src/lune/lua/fs/mod.rs diff --git a/packages/lib/src/lua/fs/options.rs b/src/lune/lua/fs/options.rs similarity index 100% rename from packages/lib/src/lua/fs/options.rs rename to src/lune/lua/fs/options.rs diff --git a/packages/lib/src/lua/mod.rs b/src/lune/lua/mod.rs similarity index 100% rename from packages/lib/src/lua/mod.rs rename to src/lune/lua/mod.rs diff --git a/packages/lib/src/lua/net/client.rs b/src/lune/lua/net/client.rs similarity index 100% rename from packages/lib/src/lua/net/client.rs rename to src/lune/lua/net/client.rs diff --git a/packages/lib/src/lua/net/config.rs b/src/lune/lua/net/config.rs similarity index 100% rename from packages/lib/src/lua/net/config.rs rename to src/lune/lua/net/config.rs diff --git a/packages/lib/src/lua/net/mod.rs b/src/lune/lua/net/mod.rs similarity index 100% rename from packages/lib/src/lua/net/mod.rs rename to src/lune/lua/net/mod.rs diff --git a/packages/lib/src/lua/net/response.rs b/src/lune/lua/net/response.rs similarity index 100% rename from packages/lib/src/lua/net/response.rs rename to src/lune/lua/net/response.rs diff --git a/packages/lib/src/lua/net/server.rs b/src/lune/lua/net/server.rs similarity index 99% rename from packages/lib/src/lua/net/server.rs rename to src/lune/lua/net/server.rs index 55380ea..236c2ae 100644 --- a/packages/lib/src/lua/net/server.rs +++ b/src/lune/lua/net/server.rs @@ -12,7 +12,7 @@ use hyper::{Body, Request, Response}; use hyper_tungstenite::{is_upgrade_request as is_ws_upgrade_request, upgrade as ws_upgrade}; use tokio::task; -use crate::{ +use crate::lune::{ lua::table::TableBuilder, lua::task::{TaskScheduler, TaskSchedulerAsyncExt, TaskSchedulerScheduleExt}, }; diff --git a/packages/lib/src/lua/net/websocket.rs b/src/lune/lua/net/websocket.rs similarity index 99% rename from packages/lib/src/lua/net/websocket.rs rename to src/lune/lua/net/websocket.rs index c66b93c..2f613a9 100644 --- a/packages/lib/src/lua/net/websocket.rs +++ b/src/lune/lua/net/websocket.rs @@ -22,7 +22,7 @@ use hyper_tungstenite::{ }; use tokio_tungstenite::MaybeTlsStream; -use crate::lua::table::TableBuilder; +use crate::lune::lua::table::TableBuilder; const WEB_SOCKET_IMPL_LUA: &str = r#" return freeze(setmetatable({ diff --git a/packages/lib/src/lua/process/mod.rs b/src/lune/lua/process/mod.rs similarity index 100% rename from packages/lib/src/lua/process/mod.rs rename to src/lune/lua/process/mod.rs diff --git a/packages/lib/src/lua/process/tee_writer.rs b/src/lune/lua/process/tee_writer.rs similarity index 100% rename from packages/lib/src/lua/process/tee_writer.rs rename to src/lune/lua/process/tee_writer.rs diff --git a/packages/lib/src/lua/serde/compress_decompress.rs b/src/lune/lua/serde/compress_decompress.rs similarity index 100% rename from packages/lib/src/lua/serde/compress_decompress.rs rename to src/lune/lua/serde/compress_decompress.rs diff --git a/packages/lib/src/lua/serde/encode_decode.rs b/src/lune/lua/serde/encode_decode.rs similarity index 100% rename from packages/lib/src/lua/serde/encode_decode.rs rename to src/lune/lua/serde/encode_decode.rs diff --git a/packages/lib/src/lua/serde/mod.rs b/src/lune/lua/serde/mod.rs similarity index 100% rename from packages/lib/src/lua/serde/mod.rs rename to src/lune/lua/serde/mod.rs diff --git a/packages/lib/src/lua/stdio/formatting.rs b/src/lune/lua/stdio/formatting.rs similarity index 99% rename from packages/lib/src/lua/stdio/formatting.rs rename to src/lune/lua/stdio/formatting.rs index e02bde8..fee409a 100644 --- a/packages/lib/src/lua/stdio/formatting.rs +++ b/src/lune/lua/stdio/formatting.rs @@ -4,7 +4,7 @@ use console::{colors_enabled, set_colors_enabled, style, Style}; use mlua::prelude::*; use once_cell::sync::Lazy; -use crate::lua::task::TaskReference; +use crate::lune::lua::task::TaskReference; const MAX_FORMAT_DEPTH: usize = 4; diff --git a/packages/lib/src/lua/stdio/mod.rs b/src/lune/lua/stdio/mod.rs similarity index 100% rename from packages/lib/src/lua/stdio/mod.rs rename to src/lune/lua/stdio/mod.rs diff --git a/packages/lib/src/lua/stdio/prompt.rs b/src/lune/lua/stdio/prompt.rs similarity index 100% rename from packages/lib/src/lua/stdio/prompt.rs rename to src/lune/lua/stdio/prompt.rs diff --git a/packages/lib/src/lua/table/builder.rs b/src/lune/lua/table/builder.rs similarity index 98% rename from packages/lib/src/lua/table/builder.rs rename to src/lune/lua/table/builder.rs index 8eb6e96..b320707 100644 --- a/packages/lib/src/lua/table/builder.rs +++ b/src/lune/lua/table/builder.rs @@ -2,7 +2,7 @@ use std::future::Future; use mlua::prelude::*; -use crate::lua::async_ext::LuaAsyncExt; +use crate::lune::lua::async_ext::LuaAsyncExt; pub struct TableBuilder { lua: &'static Lua, diff --git a/packages/lib/src/lua/table/mod.rs b/src/lune/lua/table/mod.rs similarity index 100% rename from packages/lib/src/lua/table/mod.rs rename to src/lune/lua/table/mod.rs diff --git a/packages/lib/src/lua/task/ext/async_ext.rs b/src/lune/lua/task/ext/async_ext.rs similarity index 99% rename from packages/lib/src/lua/task/ext/async_ext.rs rename to src/lune/lua/task/ext/async_ext.rs index ff96a53..681c01a 100644 --- a/packages/lib/src/lua/task/ext/async_ext.rs +++ b/src/lune/lua/task/ext/async_ext.rs @@ -6,7 +6,7 @@ use futures_util::Future; use mlua::prelude::*; use tokio::time::{sleep, Instant}; -use crate::lua::task::TaskKind; +use crate::lune::lua::task::TaskKind; use super::super::{ scheduler::TaskReference, scheduler::TaskScheduler, scheduler_handle::TaskSchedulerAsyncHandle, diff --git a/packages/lib/src/lua/task/ext/mod.rs b/src/lune/lua/task/ext/mod.rs similarity index 100% rename from packages/lib/src/lua/task/ext/mod.rs rename to src/lune/lua/task/ext/mod.rs diff --git a/packages/lib/src/lua/task/ext/resume_ext.rs b/src/lune/lua/task/ext/resume_ext.rs similarity index 100% rename from packages/lib/src/lua/task/ext/resume_ext.rs rename to src/lune/lua/task/ext/resume_ext.rs diff --git a/packages/lib/src/lua/task/ext/schedule_ext.rs b/src/lune/lua/task/ext/schedule_ext.rs similarity index 100% rename from packages/lib/src/lua/task/ext/schedule_ext.rs rename to src/lune/lua/task/ext/schedule_ext.rs diff --git a/packages/lib/src/lua/task/mod.rs b/src/lune/lua/task/mod.rs similarity index 100% rename from packages/lib/src/lua/task/mod.rs rename to src/lune/lua/task/mod.rs diff --git a/packages/lib/src/lua/task/proxy.rs b/src/lune/lua/task/proxy.rs similarity index 100% rename from packages/lib/src/lua/task/proxy.rs rename to src/lune/lua/task/proxy.rs diff --git a/packages/lib/src/lua/task/scheduler.rs b/src/lune/lua/task/scheduler.rs similarity index 100% rename from packages/lib/src/lua/task/scheduler.rs rename to src/lune/lua/task/scheduler.rs diff --git a/packages/lib/src/lua/task/scheduler_handle.rs b/src/lune/lua/task/scheduler_handle.rs similarity index 100% rename from packages/lib/src/lua/task/scheduler_handle.rs rename to src/lune/lua/task/scheduler_handle.rs diff --git a/packages/lib/src/lua/task/scheduler_message.rs b/src/lune/lua/task/scheduler_message.rs similarity index 100% rename from packages/lib/src/lua/task/scheduler_message.rs rename to src/lune/lua/task/scheduler_message.rs diff --git a/packages/lib/src/lua/task/scheduler_state.rs b/src/lune/lua/task/scheduler_state.rs similarity index 100% rename from packages/lib/src/lua/task/scheduler_state.rs rename to src/lune/lua/task/scheduler_state.rs diff --git a/packages/lib/src/lua/task/task_kind.rs b/src/lune/lua/task/task_kind.rs similarity index 100% rename from packages/lib/src/lua/task/task_kind.rs rename to src/lune/lua/task/task_kind.rs diff --git a/packages/lib/src/lua/task/task_reference.rs b/src/lune/lua/task/task_reference.rs similarity index 100% rename from packages/lib/src/lua/task/task_reference.rs rename to src/lune/lua/task/task_reference.rs diff --git a/packages/lib/src/lua/task/task_waiter.rs b/src/lune/lua/task/task_waiter.rs similarity index 100% rename from packages/lib/src/lua/task/task_waiter.rs rename to src/lune/lua/task/task_waiter.rs diff --git a/packages/lib/src/lib.rs b/src/lune/mod.rs similarity index 97% rename from packages/lib/src/lib.rs rename to src/lune/mod.rs index 0aa9044..09b3842 100644 --- a/packages/lib/src/lib.rs +++ b/src/lune/mod.rs @@ -5,13 +5,11 @@ use mlua::prelude::*; use mlua::Compiler as LuaCompiler; use tokio::task::LocalSet; -pub(crate) mod builtins; -pub(crate) mod importer; -pub(crate) mod lua; +pub mod builtins; +pub mod importer; +pub mod lua; mod error; -#[cfg(test)] -mod tests; pub use error::LuneError; diff --git a/packages/cli/src/main.rs b/src/main.rs similarity index 93% rename from packages/cli/src/main.rs rename to src/main.rs index 6defbfa..d5b3430 100644 --- a/packages/cli/src/main.rs +++ b/src/main.rs @@ -13,9 +13,6 @@ use std::process::ExitCode; use clap::Parser; pub(crate) mod cli; -pub(crate) mod gen; -pub(crate) mod setup; -pub(crate) mod utils; use cli::Cli; use console::style; diff --git a/packages/lib-roblox/src/datatypes/attributes.rs b/src/roblox/datatypes/attributes.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/attributes.rs rename to src/roblox/datatypes/attributes.rs diff --git a/packages/lib-roblox/src/datatypes/conversion.rs b/src/roblox/datatypes/conversion.rs similarity index 99% rename from packages/lib-roblox/src/datatypes/conversion.rs rename to src/roblox/datatypes/conversion.rs index 13f41f4..e45073e 100644 --- a/packages/lib-roblox/src/datatypes/conversion.rs +++ b/src/roblox/datatypes/conversion.rs @@ -2,7 +2,7 @@ use mlua::prelude::*; use rbx_dom_weak::types::{Variant as DomValue, VariantType as DomType}; -use crate::{datatypes::extension::DomValueExt, instance::Instance}; +use crate::roblox::{datatypes::extension::DomValueExt, instance::Instance}; use super::*; diff --git a/packages/lib-roblox/src/datatypes/extension.rs b/src/roblox/datatypes/extension.rs similarity index 98% rename from packages/lib-roblox/src/datatypes/extension.rs rename to src/roblox/datatypes/extension.rs index 64c460b..b384d5d 100644 --- a/packages/lib-roblox/src/datatypes/extension.rs +++ b/src/roblox/datatypes/extension.rs @@ -1,6 +1,6 @@ use mlua::prelude::*; -use crate::instance::Instance; +use crate::roblox::instance::Instance; use super::*; diff --git a/packages/lib-roblox/src/datatypes/mod.rs b/src/roblox/datatypes/mod.rs similarity index 81% rename from packages/lib-roblox/src/datatypes/mod.rs rename to src/roblox/datatypes/mod.rs index 9f3ced6..6604d5f 100644 --- a/packages/lib-roblox/src/datatypes/mod.rs +++ b/src/roblox/datatypes/mod.rs @@ -8,4 +8,4 @@ pub mod types; use result::*; -pub use crate::shared::userdata::*; +pub use crate::roblox::shared::userdata::*; diff --git a/packages/lib-roblox/src/datatypes/result.rs b/src/roblox/datatypes/result.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/result.rs rename to src/roblox/datatypes/result.rs diff --git a/packages/lib-roblox/src/datatypes/types/axes.rs b/src/roblox/datatypes/types/axes.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/axes.rs rename to src/roblox/datatypes/types/axes.rs diff --git a/packages/lib-roblox/src/datatypes/types/brick_color.rs b/src/roblox/datatypes/types/brick_color.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/brick_color.rs rename to src/roblox/datatypes/types/brick_color.rs diff --git a/packages/lib-roblox/src/datatypes/types/cframe.rs b/src/roblox/datatypes/types/cframe.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/cframe.rs rename to src/roblox/datatypes/types/cframe.rs diff --git a/packages/lib-roblox/src/datatypes/types/color3.rs b/src/roblox/datatypes/types/color3.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/color3.rs rename to src/roblox/datatypes/types/color3.rs diff --git a/packages/lib-roblox/src/datatypes/types/color_sequence.rs b/src/roblox/datatypes/types/color_sequence.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/color_sequence.rs rename to src/roblox/datatypes/types/color_sequence.rs diff --git a/packages/lib-roblox/src/datatypes/types/color_sequence_keypoint.rs b/src/roblox/datatypes/types/color_sequence_keypoint.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/color_sequence_keypoint.rs rename to src/roblox/datatypes/types/color_sequence_keypoint.rs diff --git a/packages/lib-roblox/src/datatypes/types/enum.rs b/src/roblox/datatypes/types/enum.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/enum.rs rename to src/roblox/datatypes/types/enum.rs diff --git a/packages/lib-roblox/src/datatypes/types/enum_item.rs b/src/roblox/datatypes/types/enum_item.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/enum_item.rs rename to src/roblox/datatypes/types/enum_item.rs diff --git a/packages/lib-roblox/src/datatypes/types/enums.rs b/src/roblox/datatypes/types/enums.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/enums.rs rename to src/roblox/datatypes/types/enums.rs diff --git a/packages/lib-roblox/src/datatypes/types/faces.rs b/src/roblox/datatypes/types/faces.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/faces.rs rename to src/roblox/datatypes/types/faces.rs diff --git a/packages/lib-roblox/src/datatypes/types/font.rs b/src/roblox/datatypes/types/font.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/font.rs rename to src/roblox/datatypes/types/font.rs diff --git a/packages/lib-roblox/src/datatypes/types/mod.rs b/src/roblox/datatypes/types/mod.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/mod.rs rename to src/roblox/datatypes/types/mod.rs diff --git a/packages/lib-roblox/src/datatypes/types/number_range.rs b/src/roblox/datatypes/types/number_range.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/number_range.rs rename to src/roblox/datatypes/types/number_range.rs diff --git a/packages/lib-roblox/src/datatypes/types/number_sequence.rs b/src/roblox/datatypes/types/number_sequence.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/number_sequence.rs rename to src/roblox/datatypes/types/number_sequence.rs diff --git a/packages/lib-roblox/src/datatypes/types/number_sequence_keypoint.rs b/src/roblox/datatypes/types/number_sequence_keypoint.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/number_sequence_keypoint.rs rename to src/roblox/datatypes/types/number_sequence_keypoint.rs diff --git a/packages/lib-roblox/src/datatypes/types/physical_properties.rs b/src/roblox/datatypes/types/physical_properties.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/physical_properties.rs rename to src/roblox/datatypes/types/physical_properties.rs diff --git a/packages/lib-roblox/src/datatypes/types/ray.rs b/src/roblox/datatypes/types/ray.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/ray.rs rename to src/roblox/datatypes/types/ray.rs diff --git a/packages/lib-roblox/src/datatypes/types/rect.rs b/src/roblox/datatypes/types/rect.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/rect.rs rename to src/roblox/datatypes/types/rect.rs diff --git a/packages/lib-roblox/src/datatypes/types/region3.rs b/src/roblox/datatypes/types/region3.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/region3.rs rename to src/roblox/datatypes/types/region3.rs diff --git a/packages/lib-roblox/src/datatypes/types/region3int16.rs b/src/roblox/datatypes/types/region3int16.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/region3int16.rs rename to src/roblox/datatypes/types/region3int16.rs diff --git a/packages/lib-roblox/src/datatypes/types/udim.rs b/src/roblox/datatypes/types/udim.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/udim.rs rename to src/roblox/datatypes/types/udim.rs diff --git a/packages/lib-roblox/src/datatypes/types/udim2.rs b/src/roblox/datatypes/types/udim2.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/udim2.rs rename to src/roblox/datatypes/types/udim2.rs diff --git a/packages/lib-roblox/src/datatypes/types/vector2.rs b/src/roblox/datatypes/types/vector2.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/vector2.rs rename to src/roblox/datatypes/types/vector2.rs diff --git a/packages/lib-roblox/src/datatypes/types/vector2int16.rs b/src/roblox/datatypes/types/vector2int16.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/vector2int16.rs rename to src/roblox/datatypes/types/vector2int16.rs diff --git a/packages/lib-roblox/src/datatypes/types/vector3.rs b/src/roblox/datatypes/types/vector3.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/vector3.rs rename to src/roblox/datatypes/types/vector3.rs diff --git a/packages/lib-roblox/src/datatypes/types/vector3int16.rs b/src/roblox/datatypes/types/vector3int16.rs similarity index 100% rename from packages/lib-roblox/src/datatypes/types/vector3int16.rs rename to src/roblox/datatypes/types/vector3int16.rs diff --git a/packages/lib-roblox/src/document/error.rs b/src/roblox/document/error.rs similarity index 100% rename from packages/lib-roblox/src/document/error.rs rename to src/roblox/document/error.rs diff --git a/packages/lib-roblox/src/document/format.rs b/src/roblox/document/format.rs similarity index 100% rename from packages/lib-roblox/src/document/format.rs rename to src/roblox/document/format.rs diff --git a/packages/lib-roblox/src/document/kind.rs b/src/roblox/document/kind.rs similarity index 99% rename from packages/lib-roblox/src/document/kind.rs rename to src/roblox/document/kind.rs index 046d228..0339578 100644 --- a/packages/lib-roblox/src/document/kind.rs +++ b/src/roblox/document/kind.rs @@ -2,7 +2,7 @@ use std::path::Path; use rbx_dom_weak::WeakDom; -use crate::shared::instance::class_is_a_service; +use crate::roblox::shared::instance::class_is_a_service; /** A document kind specifier. diff --git a/packages/lib-roblox/src/document/mod.rs b/src/roblox/document/mod.rs similarity index 99% rename from packages/lib-roblox/src/document/mod.rs rename to src/roblox/document/mod.rs index 94a3cd0..ae76be3 100644 --- a/packages/lib-roblox/src/document/mod.rs +++ b/src/roblox/document/mod.rs @@ -15,7 +15,7 @@ pub use kind::*; use postprocessing::*; -use crate::instance::{data_model, Instance}; +use crate::roblox::instance::{data_model, Instance}; pub type DocumentResult = Result; diff --git a/packages/lib-roblox/src/document/postprocessing.rs b/src/roblox/document/postprocessing.rs similarity index 96% rename from packages/lib-roblox/src/document/postprocessing.rs rename to src/roblox/document/postprocessing.rs index 69481f5..afa5b3f 100644 --- a/packages/lib-roblox/src/document/postprocessing.rs +++ b/src/roblox/document/postprocessing.rs @@ -3,7 +3,7 @@ use rbx_dom_weak::{ Instance as DomInstance, WeakDom, }; -use crate::shared::instance::class_is_a; +use crate::roblox::shared::instance::class_is_a; pub fn postprocess_dom_for_place(_dom: &mut WeakDom) { // Nothing here yet diff --git a/packages/lib-roblox/src/instance/data_model.rs b/src/roblox/instance/data_model.rs similarity index 98% rename from packages/lib-roblox/src/instance/data_model.rs rename to src/roblox/instance/data_model.rs index 040b455..df09dd6 100644 --- a/packages/lib-roblox/src/instance/data_model.rs +++ b/src/roblox/instance/data_model.rs @@ -1,6 +1,6 @@ use mlua::prelude::*; -use crate::shared::{ +use crate::roblox::shared::{ classes::{ add_class_restricted_getter, add_class_restricted_method, get_or_create_property_ref_instance, diff --git a/packages/lib-roblox/src/instance/mod.rs b/src/roblox/instance/mod.rs similarity index 99% rename from packages/lib-roblox/src/instance/mod.rs rename to src/roblox/instance/mod.rs index 9b095d4..ee07924 100644 --- a/packages/lib-roblox/src/instance/mod.rs +++ b/src/roblox/instance/mod.rs @@ -14,7 +14,7 @@ use rbx_dom_weak::{ Instance as DomInstance, InstanceBuilder as DomInstanceBuilder, WeakDom, }; -use crate::{ +use crate::roblox::{ datatypes::{ attributes::{ensure_valid_attribute_name, ensure_valid_attribute_value}, conversion::{DomValueToLua, LuaToDomValue}, diff --git a/packages/lib-roblox/src/instance/workspace.rs b/src/roblox/instance/workspace.rs similarity index 90% rename from packages/lib-roblox/src/instance/workspace.rs rename to src/roblox/instance/workspace.rs index f1ae4b8..5837a2e 100644 --- a/packages/lib-roblox/src/instance/workspace.rs +++ b/src/roblox/instance/workspace.rs @@ -1,6 +1,8 @@ use mlua::prelude::*; -use crate::shared::classes::{add_class_restricted_getter, get_or_create_property_ref_instance}; +use crate::roblox::shared::classes::{ + add_class_restricted_getter, get_or_create_property_ref_instance, +}; use super::Instance; diff --git a/packages/lib-roblox/src/lib.rs b/src/roblox/mod.rs similarity index 98% rename from packages/lib-roblox/src/lib.rs rename to src/roblox/mod.rs index adb4331..4cfd689 100644 --- a/packages/lib-roblox/src/lib.rs +++ b/src/roblox/mod.rs @@ -1,6 +1,6 @@ use mlua::prelude::*; -use crate::instance::Instance; +use crate::roblox::instance::Instance; pub mod datatypes; pub mod document; diff --git a/packages/lib-roblox/src/shared/classes.rs b/src/roblox/shared/classes.rs similarity index 99% rename from packages/lib-roblox/src/shared/classes.rs rename to src/roblox/shared/classes.rs index 4d6e7de..f34db74 100644 --- a/packages/lib-roblox/src/shared/classes.rs +++ b/src/roblox/shared/classes.rs @@ -2,7 +2,7 @@ use mlua::prelude::*; use rbx_dom_weak::types::Variant as DomValue; -use crate::instance::Instance; +use crate::roblox::instance::Instance; use super::instance::class_is_a; diff --git a/packages/lib-roblox/src/shared/instance.rs b/src/roblox/shared/instance.rs similarity index 100% rename from packages/lib-roblox/src/shared/instance.rs rename to src/roblox/shared/instance.rs diff --git a/packages/lib-roblox/src/shared/mod.rs b/src/roblox/shared/mod.rs similarity index 100% rename from packages/lib-roblox/src/shared/mod.rs rename to src/roblox/shared/mod.rs diff --git a/packages/lib-roblox/src/shared/userdata.rs b/src/roblox/shared/userdata.rs similarity index 100% rename from packages/lib-roblox/src/shared/userdata.rs rename to src/roblox/shared/userdata.rs diff --git a/packages/lib/src/tests.rs b/src/tests.rs similarity index 94% rename from packages/lib/src/tests.rs rename to src/tests.rs index d63f1f2..77c7f36 100644 --- a/packages/lib/src/tests.rs +++ b/src/tests.rs @@ -1,4 +1,4 @@ -use std::{env::set_current_dir, path::PathBuf, process::ExitCode}; +use std::process::ExitCode; use anyhow::Result; use console::set_colors_enabled; @@ -17,12 +17,6 @@ macro_rules! create_tests { // some tests rely on output not being styled set_colors_enabled(false); set_colors_enabled_stderr(false); - // NOTE: This path is relative to the lib - // package, not the cwd or workspace root, - // so we need to cd to the repo root first - let crate_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let root_dir = crate_dir.join("../../").canonicalize()?; - set_current_dir(root_dir)?; // The rest of the test logic can continue as normal let full_name = format!("tests/{}.luau", $value); let script = read_to_string(&full_name).await?;