mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor project configuration to use .json format
- Replaced the legacy .json5 project file with a new .json format for `plugin.project.json`. - Updated `build.rs` to prioritize the new .json format while maintaining backward compatibility with .json5. - Made adjustments to the Confirming.lua file to enhance UI consistency. - Improved metadata handling in snapshot middleware to support both modern and legacy file extensions.
This commit is contained in:
parent
5f059dbc16
commit
5a85c5145c
7 changed files with 50 additions and 24 deletions
13
build.rs
13
build.rs
|
|
@ -74,8 +74,19 @@ fn main() -> Result<(), anyhow::Error> {
|
|||
|
||||
let template_snapshot = snapshot_from_fs_path(&templates_dir)?;
|
||||
|
||||
// Try modern .json5 extension first, fall back to legacy .json
|
||||
let plugin_project_path = {
|
||||
let json5_path = root_dir.join("plugin.project.json5");
|
||||
let json_path = root_dir.join("plugin.project.json");
|
||||
if json5_path.exists() {
|
||||
json5_path
|
||||
} else {
|
||||
json_path
|
||||
}
|
||||
};
|
||||
|
||||
let plugin_snapshot = VfsSnapshot::dir(hashmap! {
|
||||
"default.project.json5" => snapshot_from_fs_path(&root_dir.join("plugin.project.json5"))?,
|
||||
"default.project.json5" => snapshot_from_fs_path(&plugin_project_path)?,
|
||||
"plugin" => VfsSnapshot::dir(hashmap! {
|
||||
"fmt" => snapshot_from_fs_path(&plugin_dir.join("fmt"))?,
|
||||
"http" => snapshot_from_fs_path(&plugin_dir.join("http"))?,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue