mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Add JSONC Support for Project, Meta, and Model JSON files (#1144)
Replaces `serde_json` parsing with `jsonc-parser` throughout the codebase, enabling support for **comments** and **trailing commas** in all JSON files including `.project.json`, `.model.json`, and `.meta.json` files. MSRV bumps from `1.83.0` to `1.88.0` in order to use the jsonc_parser dependency.
This commit is contained in:
parent
aabe6d11b2
commit
d0b029f995
15 changed files with 471 additions and 65 deletions
|
|
@ -9,6 +9,7 @@ use rbx_dom_weak::{
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::{
|
||||
json,
|
||||
resolution::UnresolvedValue,
|
||||
snapshot::{InstanceContext, InstanceSnapshot},
|
||||
RojoRef,
|
||||
|
|
@ -28,8 +29,9 @@ pub fn snapshot_json_model(
|
|||
return Ok(None);
|
||||
}
|
||||
|
||||
let mut instance: JsonModel = serde_json::from_str(contents_str)
|
||||
.with_context(|| format!("File is not a valid JSON model: {}", path.display()))?;
|
||||
let mut instance: JsonModel = json::from_str_with_context(contents_str, || {
|
||||
format!("File is not a valid JSON model: {}", path.display())
|
||||
})?;
|
||||
|
||||
if let Some(top_level_name) = &instance.name {
|
||||
let new_name = format!("{}.model.json", top_level_name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue