Skip to content

Commit

Permalink
this commit is nice
Browse files Browse the repository at this point in the history
  • Loading branch information
avafloww committed Jul 14, 2023
1 parent c220963 commit 345a8c7
Show file tree
Hide file tree
Showing 18 changed files with 361 additions and 157 deletions.
130 changes: 116 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# LLRT #
########
[package]
name = "grebuloff"
name = "grebuloff-llrt"
version = "0.1.0"
edition = "2021"
build = "build.rs"
Expand All @@ -17,24 +17,24 @@ chrono = { workspace = true }
tokio = { workspace = true }
windows = { workspace = true }
anyhow = { workspace = true }
rmp = { workspace = true }
rmp-serde = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
bytes = { workspace = true }
dll-syringe = { workspace = true, features = ["payload-utils"] }

grebuloff-macros = { path = "macros" }
grebuloff-rpc = { path = "rpc" }
ffxiv_client_structs = { path = "deps/FFXIVClientStructs/rust/lib", features = ["async-resolution"] }
ffxiv_client_structs_macros = { path = "deps/FFXIVClientStructs/rust/macros" }
msgbox = "0.7.0"
rmp = "0.8.11"
rmp-serde = "1.1.1"
serde = { version = "1.0.155", features = ["derive"] }
serde_json = "1.0.96"
# deno_core = "0.191.0"
# deno_ast = { version = "0.27.1", features = ["transpiling"] }
inventory = "0.3.6"
itertools = "0.10.5"
rustc-hash = "1.1.0"
retour = { version = "0.3.0", features = ["static-detour"] }
uuid = { version = "1.4.0", features = ["v4", "fast-rng"] }
bytes = "1.4.0"
async-trait = "0.1.71"

[build-dependencies]
Expand All @@ -44,8 +44,8 @@ chrono = { workspace = true }
# Workspace #
#############
[workspace]
members = [".", "macros", "injector", "loader"]
default-members = [".", "injector", "loader"]
members = [".", "macros", "injector", "loader", "rpc", "hlrt"]
default-members = [".", "injector", "loader", "rpc", "hlrt"]

[workspace.dependencies]
dll-syringe = { version = "0.15.2", default-features = false }
Expand All @@ -54,6 +54,11 @@ anyhow = { version = "1.0.71" }
log = { version = "0.4" }
fern = { version = "0.6.2" }
chrono = { version = "0.4.26" }
rmp = "0.8.11"
rmp-serde = "1.1.1"
serde = { version = "1.0.155", features = ["derive"] }
serde_json = "1.0.96"
bytes = "1.4.0"

[workspace.dependencies.windows]
version = "0.48.0"
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ impl Build {
Command::new("cmd")
.arg("/C")
.arg("pnpm")
.arg("build-if-changed")
.arg("maybe-build:js")
.current_dir("hlrt")
.spawn()
.expect("failed to run `pnpm build-if-changed` for HLRT");
.expect("failed to run `pnpm maybe-build:js` for HLRT");
}
}

Expand Down
2 changes: 2 additions & 0 deletions hlrt/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ out
*.log*
.bic_cache
electron.vite.config.*.mjs
target
*.node
18 changes: 18 additions & 0 deletions hlrt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "grebuloff-hlrt-native"
version = "0.1.0"
edition = "2021"
exclude = ["*.node"]

[lib]
crate-type = ["cdylib"]
path = "src/main/native/lib.rs"

[dependencies]
anyhow = { workspace = true }
tokio = { workspace = true }

[dependencies.neon]
version = "0.10"
default-features = false
features = ["napi-6", "promise-api", "task-api", "channel-api"]
12 changes: 9 additions & 3 deletions hlrt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"start": "electron-vite preview",
"dev": "electron-vite dev --sourcemap",
"dev:renderer": "cross-env LLRT_PIPE_ID=dev electron-vite dev --sourcemap --rendererOnly",
"build:all": "pnpm run build:native && pnpm run build:js",
"build": "pnpm run typecheck && electron-vite build && electron-packager . --platform=win32 --out=../dist --executable-name=grebuloff-hlrt --overwrite",
"build-if-changed": "build-if-changed"
"build:native": "cargo-cp-artifact -ac grebuloff-hlrt-native out/main/native/native.node -- cargo build --message-format=json-render-diagnostics",
"maybe-build:js": "build-if-changed"
},
"dependencies": {
"@electron-toolkit/utils": "^1.0.2",
Expand Down Expand Up @@ -46,11 +48,15 @@
"eslint-plugin-react": "^7.32.2",
"prettier": "^2.8.8",
"typescript": "^5.1.6",
"vite": "^4.3.9"
"vite": "^4.3.9",
"cargo-cp-artifact": "^0.1"
},
"pnpm": {
"patchedDependencies": {
"build-if-changed@1.5.5": "patches/build-if-changed@1.5.5.patch"
}
}
},
"bic": [
"src"
]
}
8 changes: 8 additions & 0 deletions hlrt/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions hlrt/src/main/native/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import native from './native.node';
11 changes: 11 additions & 0 deletions hlrt/src/main/native/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use neon::prelude::*;

fn hello(mut cx: FunctionContext) -> JsResult<JsString> {
Ok(cx.string("hello node"))
}

#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
cx.export_function("hello", hello)?;
Ok(())
}
4 changes: 2 additions & 2 deletions hlrt/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"include": [
"electron.vite.config.*",
"src/main/**/*.{ts,tsx}",
"src/preload/**/*.{ts,tsx}"
"src/preload/**/*.{ts,tsx}",
],
"compilerOptions": {
"composite": true,
Expand All @@ -12,4 +12,4 @@
"electron-vite/node"
],
}
}
}
2 changes: 1 addition & 1 deletion loader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "loader"
name = "grebuloff-loader"
version = "0.1.0"
edition = "2021"
build = "build.rs"
Expand Down
Loading

0 comments on commit 345a8c7

Please sign in to comment.