From 21dcf77a4a8ee35b23834178797d594a2f980da1 Mon Sep 17 00:00:00 2001 From: Cedrik Hoffmann Date: Tue, 2 Jan 2024 20:16:57 +0100 Subject: [PATCH] Run wasm in vite --- .idea/gameboy.iml | 6 +- .idea/modules.xml | 2 +- .idea/workspace.xml | 111 +++++++++---- gameboy-bin/src/main.rs | 18 +- gameboy-frontend.iml | 8 - gameboy-frontend/vite.config.ts | 12 -- gameboy-lib/Cargo.lock | 116 +++++++++++++ gameboy-lib/Cargo.toml | 4 + gameboy-lib/src/cpu/cpu.rs | 16 +- gameboy-lib/src/lib.rs | 27 ++- gameboy-lib/src/memory.rs | 38 ----- gameboy-lib/src/memory/memory.rs | 59 +++++++ gameboy-lib/src/memory/mod.rs | 2 + gameboy-lib/src/memory/observer.rs | 41 +++++ gameboy-wasm/src/lib.rs | 13 -- gameboy-web.iml | 12 ++ .../.eslintrc.cjs | 0 {gameboy-frontend => gameboy-web}/.gitignore | 0 gameboy-web/.rsw/rsw.crates | 1 + gameboy-web/.rsw/rsw.err | 0 gameboy-web/.rsw/rsw.info | 3 + {gameboy-frontend => gameboy-web}/README.md | 0 .../gameboy-wasm}/.appveyor.yml | 0 .../gameboy-wasm}/.github/dependabot.yml | 0 .../gameboy-wasm}/.gitignore | 0 .../gameboy-wasm}/.travis.yml | 0 .../gameboy-wasm}/Cargo.toml | 2 + .../gameboy-wasm}/LICENSE_APACHE | 0 .../gameboy-wasm}/LICENSE_MIT | 0 .../gameboy-wasm}/README.md | 0 gameboy-web/gameboy-wasm/src/lib.rs | 43 +++++ .../gameboy-wasm}/src/utils.rs | 0 .../gameboy-wasm}/tests/web.rs | 0 {gameboy-frontend => gameboy-web}/index.html | 2 +- .../package.json | 13 +- .../public/vite.svg | 0 gameboy-web/rsw.toml | 17 ++ {gameboy-frontend => gameboy-web}/src/App.tsx | 6 +- .../src/main.tsx | 0 .../src/vite-env.d.ts | 0 .../tsconfig.json | 0 .../tsconfig.node.json | 0 gameboy-web/vite.config.ts | 11 ++ {gameboy-frontend => gameboy-web}/yarn.lock | 154 +++++++++++++++++- 44 files changed, 611 insertions(+), 126 deletions(-) delete mode 100644 gameboy-frontend.iml delete mode 100644 gameboy-frontend/vite.config.ts delete mode 100644 gameboy-lib/src/memory.rs create mode 100644 gameboy-lib/src/memory/memory.rs create mode 100644 gameboy-lib/src/memory/mod.rs create mode 100644 gameboy-lib/src/memory/observer.rs delete mode 100644 gameboy-wasm/src/lib.rs create mode 100644 gameboy-web.iml rename {gameboy-frontend => gameboy-web}/.eslintrc.cjs (100%) rename {gameboy-frontend => gameboy-web}/.gitignore (100%) create mode 100644 gameboy-web/.rsw/rsw.crates create mode 100644 gameboy-web/.rsw/rsw.err create mode 100644 gameboy-web/.rsw/rsw.info rename {gameboy-frontend => gameboy-web}/README.md (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/.appveyor.yml (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/.github/dependabot.yml (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/.gitignore (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/.travis.yml (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/Cargo.toml (90%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/LICENSE_APACHE (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/LICENSE_MIT (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/README.md (100%) create mode 100644 gameboy-web/gameboy-wasm/src/lib.rs rename {gameboy-wasm => gameboy-web/gameboy-wasm}/src/utils.rs (100%) rename {gameboy-wasm => gameboy-web/gameboy-wasm}/tests/web.rs (100%) rename {gameboy-frontend => gameboy-web}/index.html (82%) rename {gameboy-frontend => gameboy-web}/package.json (70%) rename {gameboy-frontend => gameboy-web}/public/vite.svg (100%) create mode 100644 gameboy-web/rsw.toml rename {gameboy-frontend => gameboy-web}/src/App.tsx (82%) rename {gameboy-frontend => gameboy-web}/src/main.tsx (100%) rename {gameboy-frontend => gameboy-web}/src/vite-env.d.ts (100%) rename {gameboy-frontend => gameboy-web}/tsconfig.json (100%) rename {gameboy-frontend => gameboy-web}/tsconfig.node.json (100%) create mode 100644 gameboy-web/vite.config.ts rename {gameboy-frontend => gameboy-web}/yarn.lock (92%) diff --git a/.idea/gameboy.iml b/.idea/gameboy.iml index 72941fe..81d5aab 100644 --- a/.idea/gameboy.iml +++ b/.idea/gameboy.iml @@ -5,11 +5,11 @@ - - + + - + diff --git a/.idea/modules.xml b/.idea/modules.xml index ed9a1a5..a8c3819 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1f1286c..29930b9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,30 +7,83 @@ + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + { + "associatedIndex": 0 +} - - - + + + + + + @@ -102,6 +155,8 @@ - \ No newline at end of file diff --git a/gameboy-bin/src/main.rs b/gameboy-bin/src/main.rs index 110b233..cf05fd7 100644 --- a/gameboy-bin/src/main.rs +++ b/gameboy-bin/src/main.rs @@ -1,9 +1,23 @@ extern crate gameboy; +use gameboy::GameBoy; +use gameboy::memory::observer::Event; + + fn main() { let boot_rom = load_boot_rom(); - boot_rom.iter().for_each(|n|println!("{:x}", n)); - gameboy::start_gameboy(boot_rom); + let mut gameboy: GameBoy = GameBoy::new(); + let mut memory = &mut gameboy.cpu.memory; + + memory.events().subscribe(Event::Write, |subject| { + println!("[MEM] Writing value: 0x{:x}: 0x{:x}", subject.address, subject.value) + }); + + memory.events().subscribe(Event::Read, |subject| { + println!("[MEM] Reading value: 0x{:x}: 0x{:x}", subject.address, subject.value) + }); + + gameboy.start_gameboy(boot_rom); } fn load_boot_rom() -> Vec { diff --git a/gameboy-frontend.iml b/gameboy-frontend.iml deleted file mode 100644 index b3c11c2..0000000 --- a/gameboy-frontend.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/gameboy-frontend/vite.config.ts b/gameboy-frontend/vite.config.ts deleted file mode 100644 index db4da8e..0000000 --- a/gameboy-frontend/vite.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {defineConfig, searchForWorkspaceRoot} from 'vite' -import react from '@vitejs/plugin-react' - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], - server: { - fs: { - allow: [searchForWorkspaceRoot(process.cwd()),'../gameboy-wasm/pkg'] - } - } -}) diff --git a/gameboy-lib/Cargo.lock b/gameboy-lib/Cargo.lock index 612f491..44a4097 100644 --- a/gameboy-lib/Cargo.lock +++ b/gameboy-lib/Cargo.lock @@ -2,6 +2,122 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "gameboy" version = "0.1.0" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a293318316cf6478ec1ad2a21c49390a8d5b5eae9fab736467d93fbc0edc29c5" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" diff --git a/gameboy-lib/Cargo.toml b/gameboy-lib/Cargo.toml index e212b65..0b61605 100644 --- a/gameboy-lib/Cargo.toml +++ b/gameboy-lib/Cargo.toml @@ -5,4 +5,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +wasm = ["wasm-bindgen"] + [dependencies] +wasm-bindgen = { version = "0.2.84", optional = true} \ No newline at end of file diff --git a/gameboy-lib/src/cpu/cpu.rs b/gameboy-lib/src/cpu/cpu.rs index 34c0d21..4c43a1e 100644 --- a/gameboy-lib/src/cpu/cpu.rs +++ b/gameboy-lib/src/cpu/cpu.rs @@ -1,6 +1,6 @@ use crate::cpu::instructions::{JumpCondition, Target16Bit}; use crate::cpu::registers::{Register8BitName, Registers}; -use crate::memory::Memory; +use crate::memory::memory::Memory; use super::instructions::Target8Bit; use super::instructions::{Instruction, Source16Bit}; @@ -12,15 +12,21 @@ pub struct CPU { pub memory: Memory, } -impl CPU { - pub fn boot(boot_rom: Vec) -> CPU { - println!("[CPU] Starting CPU..."); +impl Default for CPU { + fn default() -> Self { CPU { register: Registers::new(), pc: 0x0, - memory: Memory::new(boot_rom), + memory: Memory::default(), } } +} + +impl CPU { + pub fn boot(&mut self, boot_rom: Vec) { + println!("[CPU] Starting CPU..."); + self.memory.boot(boot_rom); + } pub fn execute(&mut self, instructions: Instruction) -> u16 { match instructions { diff --git a/gameboy-lib/src/lib.rs b/gameboy-lib/src/lib.rs index 7f4cc66..cc98f6f 100644 --- a/gameboy-lib/src/lib.rs +++ b/gameboy-lib/src/lib.rs @@ -1,11 +1,28 @@ use crate::cpu::cpu::CPU; +use crate::cpu::registers::Registers; +use crate::memory::memory::Memory; pub mod cpu; -mod memory; +pub mod memory; -pub fn start_gameboy(boot_rom: Vec) { - let mut cpu = CPU::boot(boot_rom); - loop { - cpu.step(); +pub struct GameBoy { + pub cpu: CPU, + boot_rom: Vec, + //game_rom: Vec +} + +impl GameBoy { + pub fn new() -> Self { + GameBoy { + cpu: CPU::default(), + boot_rom: Vec::new(), + } + } + + pub fn start_gameboy(&mut self, boot_rom: Vec) { + self.cpu.boot(boot_rom); + loop { + self.cpu.step(); + } } } \ No newline at end of file diff --git a/gameboy-lib/src/memory.rs b/gameboy-lib/src/memory.rs deleted file mode 100644 index d40e741..0000000 --- a/gameboy-lib/src/memory.rs +++ /dev/null @@ -1,38 +0,0 @@ -pub const BOOT_ROM_BEGIN: usize = 0x00; -pub const BOOT_ROM_END: usize = 0xFF; -pub const BOOT_ROM_SIZE: usize = BOOT_ROM_END - BOOT_ROM_BEGIN + 1; - - -#[derive(Clone)] -pub struct Memory { - pub memory: [u8; 0xFFFF], -} - -impl Memory { - pub fn new(boot_room: Vec) -> Memory { - let mut memory = Memory { - memory: [0; 0xFFFF] - }; - - println!("[MEM] Loading bootstrap rom..."); - for (idx, value) in boot_room.iter().enumerate() { - memory.write_byte(idx as u16, value.clone()); - } - - return memory; - } - pub fn write_byte(&mut self, address: u16, value: u8) { - println!("[MEM] Writing memory: address: 0x{:x} value: 0x{:x}", address, value); - self.memory[address as usize] = value; - } - - pub fn read_byte(&self, address: u16) -> u8 { - let mem_value = self.memory[address as usize]; - println!("[MEM] Reading memory: address: 0x{:x} value: 0x{:x}", address, mem_value); - return mem_value; - } - - pub fn read_next_word(&self, pc: u16) -> u16 { - ((self.read_byte(pc + 2) as u16) << 8) | (self.read_byte(pc + 1) as u16) - } -} diff --git a/gameboy-lib/src/memory/memory.rs b/gameboy-lib/src/memory/memory.rs new file mode 100644 index 0000000..9a17c9f --- /dev/null +++ b/gameboy-lib/src/memory/memory.rs @@ -0,0 +1,59 @@ +use crate::memory::observer::{Event, Publisher, Subject}; + +pub const BOOT_ROM_BEGIN: usize = 0x00; +pub const BOOT_ROM_END: usize = 0xFF; +pub const BOOT_ROM_SIZE: usize = BOOT_ROM_END - BOOT_ROM_BEGIN + 1; + + +#[derive(Clone)] +pub struct Memory { + publisher: Publisher, + pub memory: [u8; 0xFFFF], +} + + +impl Default for Memory { + fn default() -> Self { + Memory { + publisher: Publisher::default(), + memory: [0; 0xFFFF], + } + } +} + +impl Memory { + pub fn boot(&mut self, boot_room: Vec) { + for (idx, value) in boot_room.iter().enumerate() { + self.write_byte(idx as u16, value.clone()); + } + } + + pub fn events(&mut self) -> &mut Publisher { + return &mut self.publisher; + } + + pub fn write_byte(&mut self, address: u16, value: u8) { + // println!("[MEM] Writing memory: address: 0x{:x} value: 0x{:x}", address, value); + self.memory[address as usize] = value; + self.publisher.notify(Event::Write, self.create_subject(value, address)); + } + + pub fn read_byte(&self, address: u16) -> u8 { + let mem_value = self.memory[address as usize]; + // println!("[MEM] Reading memory: address: 0x{:x} value: 0x{:x}", address, mem_value); + self.publisher.notify(Event::Read, self.create_subject(mem_value, address)); + return mem_value; + } + + pub fn read_next_word(&self, pc: u16) -> u16 { + ((self.read_byte(pc + 2) as u16) << 8) | (self.read_byte(pc + 1) as u16) + } + + fn create_subject(&self, value: u8, address: u16) -> Subject { + return Subject { + value, + address, + memory: self.memory.clone(), + }; + } +} diff --git a/gameboy-lib/src/memory/mod.rs b/gameboy-lib/src/memory/mod.rs new file mode 100644 index 0000000..58cdea1 --- /dev/null +++ b/gameboy-lib/src/memory/mod.rs @@ -0,0 +1,2 @@ +pub mod observer; +pub mod memory; \ No newline at end of file diff --git a/gameboy-lib/src/memory/observer.rs b/gameboy-lib/src/memory/observer.rs new file mode 100644 index 0000000..bbe1e3b --- /dev/null +++ b/gameboy-lib/src/memory/observer.rs @@ -0,0 +1,41 @@ +use std::collections::HashMap; + +#[derive(PartialEq, Eq, Hash, Clone)] +pub enum Event { + Write, + Read, +} + +#[derive(Clone)] +pub struct Subject { + pub value: u8, + pub address: u16, + pub memory: [u8; 0xFFFF], +} + +pub type Subscriber = fn(subject: Subject); + +#[derive(Default, Clone)] +pub struct Publisher { + events: HashMap>, +} + +impl Publisher { + pub fn subscribe(&mut self, event: Event, listener: Subscriber) { + self.events.entry(event.clone()).or_default(); + self.events.get_mut(&event).unwrap().push(listener); + } + + pub fn unsubscribe(&mut self, event: Event, listener: Subscriber) { + self.events.get_mut(&event).unwrap().retain(|&x| x != listener); + } + + pub fn notify(&self, event: Event, subject: Subject) { + let listeners = self.events.get(&event); + if let Some(listeners) = listeners { + for listener in listeners { + listener(subject.clone()); + } + } + } +} \ No newline at end of file diff --git a/gameboy-wasm/src/lib.rs b/gameboy-wasm/src/lib.rs deleted file mode 100644 index 90a13d8..0000000 --- a/gameboy-wasm/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod utils; - -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -extern "C" { - fn alert(s: &str); -} - -#[wasm_bindgen] -pub fn greet() { - alert("Hello, gameboy-wasm!"); -} diff --git a/gameboy-web.iml b/gameboy-web.iml new file mode 100644 index 0000000..961c6e2 --- /dev/null +++ b/gameboy-web.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/gameboy-frontend/.eslintrc.cjs b/gameboy-web/.eslintrc.cjs similarity index 100% rename from gameboy-frontend/.eslintrc.cjs rename to gameboy-web/.eslintrc.cjs diff --git a/gameboy-frontend/.gitignore b/gameboy-web/.gitignore similarity index 100% rename from gameboy-frontend/.gitignore rename to gameboy-web/.gitignore diff --git a/gameboy-web/.rsw/rsw.crates b/gameboy-web/.rsw/rsw.crates new file mode 100644 index 0000000..786a484 --- /dev/null +++ b/gameboy-web/.rsw/rsw.crates @@ -0,0 +1 @@ +gameboy-wasm :~> gameboy-wasm/pkg \ No newline at end of file diff --git a/gameboy-web/.rsw/rsw.err b/gameboy-web/.rsw/rsw.err new file mode 100644 index 0000000..e69de29 diff --git a/gameboy-web/.rsw/rsw.info b/gameboy-web/.rsw/rsw.info new file mode 100644 index 0000000..b334884 --- /dev/null +++ b/gameboy-web/.rsw/rsw.info @@ -0,0 +1,3 @@ +[RSW::OK] +[RSW::NAME] :~> gameboy-wasm +[RSW::PATH] :~> /mnt/datahub/projects/emulation/gameboy/gameboy-web/./gameboy-wasm/src/lib.rs \ No newline at end of file diff --git a/gameboy-frontend/README.md b/gameboy-web/README.md similarity index 100% rename from gameboy-frontend/README.md rename to gameboy-web/README.md diff --git a/gameboy-wasm/.appveyor.yml b/gameboy-web/gameboy-wasm/.appveyor.yml similarity index 100% rename from gameboy-wasm/.appveyor.yml rename to gameboy-web/gameboy-wasm/.appveyor.yml diff --git a/gameboy-wasm/.github/dependabot.yml b/gameboy-web/gameboy-wasm/.github/dependabot.yml similarity index 100% rename from gameboy-wasm/.github/dependabot.yml rename to gameboy-web/gameboy-wasm/.github/dependabot.yml diff --git a/gameboy-wasm/.gitignore b/gameboy-web/gameboy-wasm/.gitignore similarity index 100% rename from gameboy-wasm/.gitignore rename to gameboy-web/gameboy-wasm/.gitignore diff --git a/gameboy-wasm/.travis.yml b/gameboy-web/gameboy-wasm/.travis.yml similarity index 100% rename from gameboy-wasm/.travis.yml rename to gameboy-web/gameboy-wasm/.travis.yml diff --git a/gameboy-wasm/Cargo.toml b/gameboy-web/gameboy-wasm/Cargo.toml similarity index 90% rename from gameboy-wasm/Cargo.toml rename to gameboy-web/gameboy-wasm/Cargo.toml index 6a9ed3c..3b6161b 100644 --- a/gameboy-wasm/Cargo.toml +++ b/gameboy-web/gameboy-wasm/Cargo.toml @@ -11,6 +11,7 @@ crate-type = ["cdylib", "rlib"] default = ["console_error_panic_hook"] [dependencies] +gameboy = { path = "../../gameboy-lib", features = ["wasm"] } wasm-bindgen = "0.2.84" # The `console_error_panic_hook` crate provides better debugging of panics by @@ -18,6 +19,7 @@ wasm-bindgen = "0.2.84" # all the `std::fmt` and `std::panicking` infrastructure, so isn't great for # code size when deploying. console_error_panic_hook = { version = "0.1.7", optional = true } +log = "0.4.20" [dev-dependencies] wasm-bindgen-test = "0.3.34" diff --git a/gameboy-wasm/LICENSE_APACHE b/gameboy-web/gameboy-wasm/LICENSE_APACHE similarity index 100% rename from gameboy-wasm/LICENSE_APACHE rename to gameboy-web/gameboy-wasm/LICENSE_APACHE diff --git a/gameboy-wasm/LICENSE_MIT b/gameboy-web/gameboy-wasm/LICENSE_MIT similarity index 100% rename from gameboy-wasm/LICENSE_MIT rename to gameboy-web/gameboy-wasm/LICENSE_MIT diff --git a/gameboy-wasm/README.md b/gameboy-web/gameboy-wasm/README.md similarity index 100% rename from gameboy-wasm/README.md rename to gameboy-web/gameboy-wasm/README.md diff --git a/gameboy-web/gameboy-wasm/src/lib.rs b/gameboy-web/gameboy-wasm/src/lib.rs new file mode 100644 index 0000000..659e164 --- /dev/null +++ b/gameboy-web/gameboy-wasm/src/lib.rs @@ -0,0 +1,43 @@ +mod utils; + +use std::ops::Deref; +use wasm_bindgen::prelude::*; +use gameboy::GameBoy; +use gameboy::memory::observer::Event; + +#[wasm_bindgen] +extern "C" { + fn alert(s: &str); + #[wasm_bindgen(js_namespace = console)] + fn log(s: &str); +} + +#[wasm_bindgen] +pub fn start_gameboy() { + log("Starting..."); + let boot_rom = load_boot_rom(); + let mut gameboy: GameBoy = GameBoy::new(); + let mut memory = &mut gameboy.cpu.memory; + + memory.events().subscribe(Event::Write, |subject| { + log(format!("[MEM WASM] Writing value: 0x{:x}: 0x{:x}", subject.address, subject.value).as_str()) + }); + + memory.events().subscribe(Event::Read, |subject| { + log(format!("[MEM WASM] Reading value: 0x{:x}: 0x{:x}", subject.address, subject.value).as_str()) + }); + + gameboy.start_gameboy(boot_rom); + + log("End"); +} + +fn load_boot_rom() -> Vec { + let boot_rom = "31FEFFAF21FF9F32CB7C20FB2126FF0E113E8032E20C3EF3E2323E77773EFCE0471104012110801ACD9500CD9600137BFE3420F311D80006081A1322230520F93E19EA1099212F990E0C3D2808320D20F92E0F18F3673E6457E0423E91E040041E020E0CF044FE9020FA0D20F71D20F20E13247C1E83FE6228061EC1FE6420067BE20C3E87E2F04290E0421520D205204F162018CB4F0604C5CB1117C1CB11170520F522232223C9CEED6666CC0D000B03730083000C000D0008111F8889000EDCCC6EE6DDDDD999BBBB67636E0EECCCDDDC999FBBB9333E3C42B9A5B9A5423C21040111A8001A13BE20FE237DFE3420F506197886230520FB8620FE3E01E050"; + boot_rom.chars() + .collect::>() + .chunks(2) + .map(|c| c.iter().collect::()) + .map(|s| u8::from_str_radix(s.as_str(), 16).unwrap()) + .collect() +} diff --git a/gameboy-wasm/src/utils.rs b/gameboy-web/gameboy-wasm/src/utils.rs similarity index 100% rename from gameboy-wasm/src/utils.rs rename to gameboy-web/gameboy-wasm/src/utils.rs diff --git a/gameboy-wasm/tests/web.rs b/gameboy-web/gameboy-wasm/tests/web.rs similarity index 100% rename from gameboy-wasm/tests/web.rs rename to gameboy-web/gameboy-wasm/tests/web.rs diff --git a/gameboy-frontend/index.html b/gameboy-web/index.html similarity index 82% rename from gameboy-frontend/index.html rename to gameboy-web/index.html index e4b78ea..0931ec5 100644 --- a/gameboy-frontend/index.html +++ b/gameboy-web/index.html @@ -8,6 +8,6 @@
- + diff --git a/gameboy-frontend/package.json b/gameboy-web/package.json similarity index 70% rename from gameboy-frontend/package.json rename to gameboy-web/package.json index 7d4d9d1..f586d6b 100644 --- a/gameboy-frontend/package.json +++ b/gameboy-web/package.json @@ -4,11 +4,12 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", - "wasm": "wasm-pack build ../gameboy-wasm --target web", - "build": "tsc && vite build", + "dev": "concurrently \"rsw watch\" \"vite\"", + "wasm": "wasm-pack build ./gameboy-wasm --target web", + "build": "rsw build && tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" + "preview": "vite preview", + "rsw": "rsw" }, "dependencies": { "react": "^18.2.0", @@ -25,6 +26,8 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", "typescript": "^5.2.2", - "vite": "^5.0.10" + "vite": "^5.0.10", + "vite-plugin-rsw": "^2.0.11", + "concurrently": "^8.2.2" } } diff --git a/gameboy-frontend/public/vite.svg b/gameboy-web/public/vite.svg similarity index 100% rename from gameboy-frontend/public/vite.svg rename to gameboy-web/public/vite.svg diff --git a/gameboy-web/rsw.toml b/gameboy-web/rsw.toml new file mode 100644 index 0000000..8fa67c0 --- /dev/null +++ b/gameboy-web/rsw.toml @@ -0,0 +1,17 @@ +name = "rsw" +version = "0.1.0" + +#! time interval for file changes to trigger wasm-pack build, default `50` milliseconds +interval = 50 + +#! link +#! npm link @see https://docs.npmjs.com/cli/v8/commands/npm-link +#! yarn link @see https://classic.yarnpkg.com/en/docs/cli/link +#! pnpm link @see https://pnpm.io/cli/link +#! The link command will only be executed if `[[crates]] link = true` +#! cli: `npm` | `yarn` | `pnpm`, default is `npm` +cli = "yarn" + +[[crates]] +name = "gameboy-wasm" +link = true \ No newline at end of file diff --git a/gameboy-frontend/src/App.tsx b/gameboy-web/src/App.tsx similarity index 82% rename from gameboy-frontend/src/App.tsx rename to gameboy-web/src/App.tsx index f25234e..207f181 100644 --- a/gameboy-frontend/src/App.tsx +++ b/gameboy-web/src/App.tsx @@ -1,5 +1,7 @@ import {useEffect, useState} from "react"; -import init, {greet} from '../../gameboy-wasm/pkg' +import init, {start_gameboy} from "gameboy-wasm"; + + function App() { const [ready, setReady] = useState(false) @@ -8,7 +10,7 @@ function App() { }, []) const handleButton = () => { - greet() + start_gameboy() } return ( diff --git a/gameboy-frontend/src/main.tsx b/gameboy-web/src/main.tsx similarity index 100% rename from gameboy-frontend/src/main.tsx rename to gameboy-web/src/main.tsx diff --git a/gameboy-frontend/src/vite-env.d.ts b/gameboy-web/src/vite-env.d.ts similarity index 100% rename from gameboy-frontend/src/vite-env.d.ts rename to gameboy-web/src/vite-env.d.ts diff --git a/gameboy-frontend/tsconfig.json b/gameboy-web/tsconfig.json similarity index 100% rename from gameboy-frontend/tsconfig.json rename to gameboy-web/tsconfig.json diff --git a/gameboy-frontend/tsconfig.node.json b/gameboy-web/tsconfig.node.json similarity index 100% rename from gameboy-frontend/tsconfig.node.json rename to gameboy-web/tsconfig.node.json diff --git a/gameboy-web/vite.config.ts b/gameboy-web/vite.config.ts new file mode 100644 index 0000000..3b3d961 --- /dev/null +++ b/gameboy-web/vite.config.ts @@ -0,0 +1,11 @@ +import {defineConfig} from 'vite' +import react from '@vitejs/plugin-react' +import { ViteRsw } from 'vite-plugin-rsw'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + ViteRsw(), + react(), + ], +}) diff --git a/gameboy-frontend/yarn.lock b/gameboy-web/yarn.lock similarity index 92% rename from gameboy-frontend/yarn.lock rename to gameboy-web/yarn.lock index c650416..c0be726 100644 --- a/gameboy-frontend/yarn.lock +++ b/gameboy-web/yarn.lock @@ -179,6 +179,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/runtime@^7.21.0": + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.7.tgz#dd7c88deeb218a0f8bd34d5db1aa242e0f203193" + integrity sha512-w06OXVOFso7LcbzMiDGt+3X7Rh7Ho8MmgPoWU3rarH+8upf+wSU/grlGbWzQyr3DkdN6ZeuMFjpdwW0Q+HxobA== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" @@ -707,7 +714,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -780,7 +787,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -788,6 +795,15 @@ chalk@^4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -817,6 +833,21 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +concurrently@^8.2.2: + version "8.2.2" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-8.2.2.tgz#353141985c198cfa5e4a3ef90082c336b5851784" + integrity sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg== + dependencies: + chalk "^4.1.2" + date-fns "^2.30.0" + lodash "^4.17.21" + rxjs "^7.8.1" + shell-quote "^1.8.1" + spawn-command "0.0.2" + supports-color "^8.1.1" + tree-kill "^1.2.2" + yargs "^17.7.2" + convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -836,6 +867,13 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== +date-fns@^2.30.0: + version "2.30.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" + integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== + dependencies: + "@babel/runtime" "^7.21.0" + debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -867,6 +905,11 @@ electron-to-chromium@^1.4.601: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.616.tgz#4bddbc2c76e1e9dbf449ecd5da3d8119826ea4fb" integrity sha512-1n7zWYh8eS0L9Uy+GskE0lkBUNK83cXTVJI0pU3mGprFsbfSdAc15VTFbo+A+Bq4pwstmL30AVcEU3Fo463lNg== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + esbuild@^0.19.3: version "0.19.11" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.11.tgz#4a02dca031e768b5556606e1b468fe72e3325d96" @@ -1095,6 +1138,11 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -1196,6 +1244,11 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -1282,6 +1335,11 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + loose-envify@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -1464,6 +1522,16 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -1508,6 +1576,13 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" @@ -1539,6 +1614,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shell-quote@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" + integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -1549,7 +1629,21 @@ source-map-js@^1.0.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -strip-ansi@^6.0.1: +spawn-command@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" + integrity sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ== + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -1575,6 +1669,13 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -1592,11 +1693,21 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + ts-api-utils@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== +tslib@^2.1.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -1634,6 +1745,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +vite-plugin-rsw@^2.0.11: + version "2.0.11" + resolved "https://registry.yarnpkg.com/vite-plugin-rsw/-/vite-plugin-rsw-2.0.11.tgz#53d6efd674136823f2e994efe47c57109353055d" + integrity sha512-OqbGAtdDfK88gDoxA9wVdGowCmlzLSXEyRvD8CgTu9IP5O7tx8Tg2CtIzKOyOWZtHHZPhtdYiN+5Il6rTZCkzw== + vite@^5.0.10: version "5.0.10" resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.10.tgz#1e13ef5c3cf5aa4eed81f5df6d107b3c3f1f6356" @@ -1652,11 +1768,25 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" @@ -1667,6 +1797,24 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.7.2: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"