Welcome to the Seelen UI project! This guide will help you get started with the codebase and understand its structure.
This project utilizes the following languages:
- Rust
- TypeScript
- PowerShell (in special cases)
To run this project, follow these steps:
- Install Rust.
- Run the following commands:
npm install && npm run dev
This will set up the project similarly to any other Node.js project, with the added step of installing Rust first.
The src\apps
folder contains views that follow Hexagonal Architecture. Each folder in src\apps
represents a view (excluding shared). These views are independent web pages bundled with esbuild
. While any technology or library can be used in a view, most are based on React
and Redux
.
Following Hexagonal Architecture, the shared
folder contains utilities, schemas, and other shared resources used across multiple views.
The src\background
folder does not follow a specific architecture but is based on Events Architecture.
To prevent deadlocks in the application, all threads must follow the "Hierarchical Locking Order" when acquiring resources:
- CLI: Acquire any locks related to the command-line interface first.
- DATA: Next, acquire locks related to data access or shared data structures.
- EVENT: Finally, acquire locks related to hook or event management.
This order must be respected in all threads to avoid circular wait conditions and ensure safe concurrency.
When working with the slu-lib
library and making changes, follow these steps to configure your development environment. This will allow you to test your changes locally without impacting the main repository.
Ensure you have a local copy of the slu-lib
codebase. If you don’t already have it, clone the repository using the following command:
git clone <slu-lib-repository-url>
cd slu-lib
Create a new branch to implement the necessary changes in the library:
git checkout -b <your-branch-name>
Example:
git checkout -b feature/ui-update
Make the required changes and commit your modifications:
git add .
git commit -m "Description of changes made to slu-lib"
To allow the main project to use your modified version of slu-lib
, update its dependency configuration file.
In the Cargo.toml
file of the main project, replace the slu-lib
dependency with your local branch’s Git URL:
[dependencies]
slu-lib = { git = "<slu-lib-repository-url>", branch = "<your-branch-name>" }
Example:
[dependencies]
slu-lib = { git = "https://github.com/your-org/slu-lib", branch = "feature/ui-update" }
In the package.json
file of the main project, update the slu-lib
dependency to point to your Git branch:
"dependencies": {
"slu-lib": "git+https://<slu-lib-repository-url>#<your-branch-name>"
}
Example:
"dependencies": {
"slu-lib": "git+https://github.com/your-org/slu-lib#feature/ui-update"
}
To allow the main project to use your modified version of slu-lib
, update its dependency configuration file.
In the Cargo.toml
file of the main project, replace the slu-lib
dependency with your local path:
[dependencies.seelen-core]
path = "<path>" # for local development
Example:
[dependencies.seelen-core]
path = "../slu-lib" # for local development
In the package.json
file of the main project, update the slu-lib
dependency to point to your npm slu home:
"dependencies": {
"@seelen-ui/lib": "file:<path>",
}
slu must be built before npm reference can be made! The build script after deno installation...
winget install DenoLand.Deno
can be with the following scripts:
deno run -A .\scripts\build_npm.ts
Example:
"dependencies": {
"@seelen-ui/lib": "file:../slu-lib/npm",
}
alternatively, you can run from the main project library:
npm install <path>
Example>
npm install ../slu-lib/npm
Important: These changes should only be used for local development and must not be committed to the repository.
- After linking the modified version of
slu-lib
, test the main project to ensure the changes work as expected. - If further modifications are needed, return to the
slu-lib
repository, make changes, and commit them.
Once the changes in slu-lib
are complete:
- Push your branch to the remote repository:
git push origin <your-branch-name>
- Create a pull request to merge your branch into the main
slu-lib
repository. - Once the pull request is merged, update the
slu-lib
dependency in the main project to use the new version.