Skip to content

Commit

Permalink
Merge pull request #153 from somedevfox/rew
Browse files Browse the repository at this point in the history
Reorganise the main crate and move it to crates/
  • Loading branch information
melody-rs authored Aug 20, 2024
2 parents 2bce7d8 + eb8d23f commit 2165b80
Show file tree
Hide file tree
Showing 42 changed files with 2,064 additions and 636 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! Rust Build Output
/target
/marshal/target
/dist
/crates/launcher/dist

#! GDB-related files
.gdb_*
Expand Down
17 changes: 15 additions & 2 deletions Cargo.lock

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

127 changes: 2 additions & 125 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
# As much as I would like to move the luminol package into the crates folder, trunk won't let me :(
# It wants a root package, and it has to be this
[package]
name = "luminol"
description = "Luminol is a FOSS recreation of RPG Maker XP in Rust with love ❤️"
build = "build.rs"

version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
readme.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true

# Setup various shared workspace values
[workspace]
members = ["crates/*"]
default-members = ["crates/launcher"]
resolver = "2"

[workspace.lints.rust]
Expand Down Expand Up @@ -167,113 +151,10 @@ luminol-proc-macros = { version = "0.4.0", path = "crates/proc-macros/" }
luminol-modals = { version = "0.4.0", path = "crates/modals/" }
luminol-term = { version = "0.4.0", path = "crates/term/" }
luminol-ui = { version = "0.4.0", path = "crates/ui/" }
luminol-result = { version = "0.4.0", path = "crates/result" }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
luminol-eframe.workspace = true
luminol-egui-wgpu.workspace = true
luminol-macros.workspace = true
egui.workspace = true
egui_extras.workspace = true

wgpu.workspace = true

rfd.workspace = true

parking_lot.workspace = true
once_cell.workspace = true

image.workspace = true

tracing-subscriber = "0.3.17"
color-eyre.workspace = true

luminol-audio.workspace = true
luminol-core.workspace = true
luminol-config.workspace = true
luminol-filesystem.workspace = true
luminol-graphics.workspace = true
luminol-ui.workspace = true
# luminol-windows = { version = "0.1.0", path = "../windows/" }
# luminol-tabs = { version = "0.1.0", path = "../tabs/" }

camino.workspace = true

strum.workspace = true

zstd = "0.13.0"

async-std.workspace = true
futures-lite.workspace = true

git-version = "0.3.9"
shadow-rs = { version = "0.32.0", default-features = false }

# Native
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
steamworks = { version = "0.10.0", optional = true }
tokio = { version = "1.33", features = [
"sync",
"macros",
"io-util",
"rt-multi-thread",
"parking_lot",
] } # *sigh*
tempfile.workspace = true
luminol-term.workspace = true

# Set poll promise features here based on the target
# I'd much rather do it in the workspace, but cargo doesn't support that yet
#
# Doing this also relies on a quirk of features, that any crate specifying features applies to ALL crates
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.poll-promise]
workspace = true
features = ["tokio"]

[target.'cfg(target_arch = "wasm32")'.dependencies.poll-promise]
workspace = true
features = ["web"]

# Web
# Look into somehow pinning these as workspace dependencies
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
js-sys.workspace = true

oneshot.workspace = true

luminol-web = { version = "0.4.0", path = "crates/web/" }

tracing-wasm = "0.2"
tracing-log = "0.1.3"
tracing.workspace = true

web-sys = { workspace = true, features = [
"BeforeUnloadEvent",
"Window",
"Worker",
"WorkerOptions",
"WorkerType",
] }

[target.'cfg(target_arch = "wasm32")'.dependencies.wgpu]
workspace = true
features = ["webgpu", "webgl"]

[features]
steamworks = ["dep:steamworks"]

[build-dependencies]
shadow-rs = { version = "0.32.0", default-features = false }

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

[package.metadata.winres]
OriginalFilename = "Luminol.exe"
ProductName = "Luminol"

# Fast and performant.
[profile.release]
Expand Down Expand Up @@ -312,10 +193,6 @@ opt-level = 3
[profile.dev.package.glam]
opt-level = 3

# Backtraces for color-eyre errors and panics
[profile.dev.package.backtrace]
opt-level = 3

# See why config is set up this way.
# https://bevy-cheatbook.github.io/pitfalls/performance.html#why-not-use---release

Expand Down
1 change: 1 addition & 0 deletions Trunk.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[build]
target = "crates/launcher/index.html"
filehash = false
inject_scripts = false

Expand Down
123 changes: 123 additions & 0 deletions crates/launcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
[package]
name = "luminol"
description = "Luminol is a FOSS recreation of RPG Maker XP in Rust with love ❤️"
build = "build.rs"

version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
readme.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true

[dependencies]
luminol-eframe.workspace = true
luminol-egui-wgpu.workspace = true
luminol-macros.workspace = true
egui.workspace = true
egui_extras.workspace = true

wgpu.workspace = true

rfd.workspace = true

parking_lot.workspace = true
once_cell.workspace = true

image.workspace = true

tracing-subscriber = "0.3.17"
color-eyre.workspace = true

luminol-audio.workspace = true
luminol-core.workspace = true
luminol-config.workspace = true
luminol-filesystem.workspace = true
luminol-graphics.workspace = true
luminol-ui.workspace = true
luminol-result.workspace = true
# luminol-windows = { version = "0.1.0", path = "../windows/" }
# luminol-tabs = { version = "0.1.0", path = "../tabs/" }

camino.workspace = true

strum.workspace = true

zstd = "0.13.0"

async-std.workspace = true
futures-lite.workspace = true

git-version = "0.3.9"
shadow-rs = { version = "0.32.0", default-features = false }

# Native
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
steamworks = { version = "0.10.0", optional = true }
tokio = { version = "1.33", features = [
"sync",
"macros",
"io-util",
"rt-multi-thread",
"parking_lot",
] } # *sigh*
tempfile.workspace = true
luminol-term.workspace = true

# Set poll promise features here based on the target
# I'd much rather do it in the workspace, but cargo doesn't support that yet
#
# Doing this also relies on a quirk of features, that any crate specifying features applies to ALL crates
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.poll-promise]
workspace = true
features = ["tokio"]

[target.'cfg(target_arch = "wasm32")'.dependencies.poll-promise]
workspace = true
features = ["web"]

# Web
# Look into somehow pinning these as workspace dependencies
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
js-sys.workspace = true

oneshot.workspace = true

luminol-web = { version = "0.4.0", path = "../web/" }

tracing-wasm = "0.2"
tracing-log = "0.1.3"
tracing.workspace = true

web-sys = { workspace = true, features = [
"BeforeUnloadEvent",
"Window",
"Worker",
"WorkerOptions",
"WorkerType",
"Document",
"Element",
"CssStyleDeclaration",
] }

[target.'cfg(target_arch = "wasm32")'.dependencies.wgpu]
workspace = true
features = ["webgpu", "webgl"]

[features]
steamworks = ["dep:steamworks", "luminol-result/steamworks"]

[build-dependencies]
shadow-rs = { version = "0.32.0", default-features = false }

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

[package.metadata.winres]
OriginalFilename = "Luminol.exe"
ProductName = "Luminol"
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions index.html → crates/launcher/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<link data-trunk rel="copy-file" href="assets/js/compat-test.js" />
<link data-trunk rel="copy-file" href="assets/js/sw.js" />
<link data-trunk rel="copy-file" href="assets/manifest.json" />
<link data-trunk rel="copy-file" href="assets/icons/web/favicon.ico">
<link data-trunk rel="copy-file" href="assets/icons/web/icon-1024.png" />
<link data-trunk rel="copy-file" href="assets/icons/web/icon-256.png" />
<link data-trunk rel="copy-file" href="assets/icons/web/icon_ios_touch_192.png" />
<link data-trunk rel="copy-file" href="assets/icons/web/maskable_icon_x512.png" />
<link data-trunk rel="copy-file" href="assets/icons/favicon.ico">
<link data-trunk rel="copy-file" href="assets/icons/icon-1024.png" />
<link data-trunk rel="copy-file" href="assets/icons/icon-256.png" />
<link data-trunk rel="copy-file" href="assets/icons/icon_ios_touch_192.png" />
<link data-trunk rel="copy-file" href="assets/icons/maskable_icon_x512.png" />

<link rel="manifest" href="./manifest.json">
<link rel="icon" href="./favicon.ico">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2165b80

Please sign in to comment.