-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sasial-dev/docs
Add WASM Support
- Loading branch information
Showing
23 changed files
with
258 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,7 @@ | |
|
||
# Zap Input & Output | ||
/network | ||
net.zap | ||
net.zap | ||
|
||
# WASM | ||
zap/pkg |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
[package] | ||
name = "zap" | ||
authors = ["Redblox Organization"] | ||
description = "A blazingly fast networking solution for Roblox." | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[build-dependencies] | ||
lalrpop = "0.20.0" | ||
|
||
[dependencies] | ||
clap = { version = "4.4.11", features = ["derive"] } | ||
lalrpop-util = { version = "0.20.0", features = ["lexer", "unicode"] } | ||
num-traits = "0.2.17" | ||
[workspace] | ||
members = ["zap", "cli"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "cli" | ||
authors = ["Redblox Organization"] | ||
description = "A blazingly fast networking solution for Roblox." | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
clap = { version = "4.4.11", features = ["derive"] } | ||
zap = { path = "../zap" } | ||
|
||
[[bin]] | ||
name = "zap" | ||
path = "src/main.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use std::path::PathBuf; | ||
|
||
use anyhow::Result; | ||
use clap::Parser; | ||
use zap::run; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(author, version, about, long_about = None)] | ||
struct Args { | ||
#[arg(default_value = "net.zap")] | ||
config: Option<PathBuf>, | ||
|
||
#[arg(short, long, default_value = "network")] | ||
output: Option<PathBuf>, | ||
} | ||
|
||
fn main() -> Result<()> { | ||
let args = Args::parse(); | ||
|
||
let config_path = args.config.unwrap(); | ||
let output_dir_path = args.output.unwrap(); | ||
|
||
let config = std::fs::read_to_string(config_path)?; | ||
|
||
let code = run(config.as_str())?; | ||
|
||
std::fs::create_dir_all(&output_dir_path)?; | ||
std::fs::write(output_dir_path.join("server.luau"), code.server)?; | ||
std::fs::write(output_dir_path.join("client.luau"), code.client)?; | ||
|
||
Ok(()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "zap" | ||
authors = ["Redblox Organization"] | ||
description = "A blazingly fast networking solution for Roblox." | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
crate-type = ["lib", "cdylib"] | ||
|
||
[build-dependencies] | ||
lalrpop = "0.20.0" | ||
|
||
[dependencies] | ||
lalrpop-util = { version = "0.20.0", features = ["lexer", "unicode"] } | ||
num-traits = "0.2.17" | ||
thiserror = "1.0" | ||
wasm-bindgen = "0.2" |
File renamed without changes.
Oops, something went wrong.