This section describes the architecture of the project.
The Bemuse project is a monorepo. This means every package that shapes the project lives inside the same repository, which allows for easier development process.
- Useful scripts for routine work. Examples include setting up Git commit hooks and releasing a new version.
- Configuration code for webpack and other things.
- This documentation.
- Contains projects closely-related to the core Bemuse project. These are published into separate npm packages.
- Files that will be deployed verbatim to the server, except for
index.html, where the boot script will be inlined. These include skin files.
- Contains the production code. Code is split into modules for different parts of the application.
- Gulp tasks to run test server, build, test the application.
- The code that powers this documentation. We use Docusaurus to build our documentation as a static website.
These modules live in the
src directory. There may be an arbitrary
number of modules. Therefore, this section only lists the significant
- This module is the entry point to Bemuse. It reads the
?mode=parameter and determines the name of the main module to load. It then displays a loading indicator and loads the main module asynchronously. After the main module is downloaded, finally, it is executed. Main modules include
app, the game, and
test, the unit tests. Upon building, the boot script will be inlined into
Rationale: No one likes blank white page. We want the user to see the application starting up as soon as possible, even though it is simply a loading indicator. To make this blazingly fast, we keep the compiled size of the
bootvery small, and inline that compiled code directly into the HTML file. So, no round-trip HTML requests! If they can load the HTML, they will see the loading bar.
- This is the main module of the game's application flow. Executing this module will present the game's main menu.
- This is the main module for unit tests. Executing this module will setup the environment for testing, load the unit tests in `spec` directory, and then execute them. After the test is run, the results and coverage data (if available) will be sent back to the server for further processing.
- This module contains the actual game part. For example, the logic for judging notes, calculating score, and rendering the scene.
We also maintain other closely-related packages. These used to live in their own repository, but we've merged them into the main Bemuse repo for easier development.
- This package contains various functions useful for working with bmson files.
- This package contains the command-line tools to convert a BMS package into a Bemuse package. Traditional BMS packages are optimized for offline playing. They are distributed as a large