Version 0.7.3

This commit is contained in:
Filip Tibell 2023-07-05 10:40:58 +02:00
parent 940834f70e
commit 6a4e44918c
No known key found for this signature in database
5 changed files with 30 additions and 6 deletions

View file

@ -4,7 +4,7 @@
"luau-lsp.types.roblox": false, "luau-lsp.types.roblox": false,
"luau-lsp.require.mode": "relativeToFile", "luau-lsp.require.mode": "relativeToFile",
"luau-lsp.require.directoryAliases": { "luau-lsp.require.directoryAliases": {
"@lune/": "./docs/typedefs" "@lune/": "./docs/typedefs/"
}, },
// Luau - ignore type defs file in docs dir and dev scripts we use // Luau - ignore type defs file in docs dir and dev scripts we use
"luau-lsp.ignoreGlobs": [ "luau-lsp.ignoreGlobs": [

View file

@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## `0.7.3` - July 5th, 2023
### Changed
- When using `roblox.serializeModel`, Lune will no longer keep internal unique ids. <br/>
This is consistent with what Roblox does and prevents Lune from always generating a new and unique file. <br/>
This previously caused unnecessary diffs when using git or other kinds of source control. ([Relevant issue](https://github.com/filiptibell/lune/issues/61))
## `0.7.2` - June 28th, 2023 ## `0.7.2` - June 28th, 2023
### Added ### Added

6
Cargo.lock generated
View file

@ -1138,7 +1138,7 @@ dependencies = [
[[package]] [[package]]
name = "lune" name = "lune"
version = "0.7.2" version = "0.7.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-compression", "async-compression",
@ -1169,7 +1169,7 @@ dependencies = [
[[package]] [[package]]
name = "lune-cli" name = "lune-cli"
version = "0.7.2" version = "0.7.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap 4.3.8", "clap 4.3.8",
@ -1193,7 +1193,7 @@ dependencies = [
[[package]] [[package]]
name = "lune-roblox" name = "lune-roblox"
version = "0.7.2" version = "0.7.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"glam", "glam",

View file

@ -5,7 +5,7 @@ default-members = ["packages/cli"]
# Package config values shared across all packages, # Package config values shared across all packages,
# such as version, license, and other metadata # such as version, license, and other metadata
[workspace.package] [workspace.package]
version = "0.7.2" version = "0.7.3"
edition = "2021" edition = "2021"
license = "MPL-2.0" license = "MPL-2.0"
repository = "https://github.com/filiptibell/lune" repository = "https://github.com/filiptibell/lune"

View file

@ -1,4 +1,4 @@
use rbx_dom_weak::{InstanceBuilder as DomInstanceBuilder, WeakDom}; use rbx_dom_weak::{types::Ref as DomRef, InstanceBuilder as DomInstanceBuilder, WeakDom};
use rbx_xml::{ use rbx_xml::{
DecodeOptions as XmlDecodeOptions, DecodePropertyBehavior as XmlDecodePropertyBehavior, DecodeOptions as XmlDecodeOptions, DecodePropertyBehavior as XmlDecodePropertyBehavior,
EncodeOptions as XmlEncodeOptions, EncodePropertyBehavior as XmlEncodePropertyBehavior, EncodeOptions as XmlEncodeOptions, EncodePropertyBehavior as XmlEncodePropertyBehavior,
@ -274,6 +274,9 @@ impl Document {
instance.clone_into_external_dom(&mut dom); instance.clone_into_external_dom(&mut dom);
} }
let root_ref = dom.root_ref();
recurse_strip_unique_ids(&mut dom, root_ref);
Ok(Self { Ok(Self {
kind: DocumentKind::Model, kind: DocumentKind::Model,
format: DocumentFormat::default(), format: DocumentFormat::default(),
@ -281,3 +284,16 @@ impl Document {
}) })
} }
} }
fn recurse_strip_unique_ids(dom: &mut WeakDom, dom_ref: DomRef) {
let child_refs = match dom.get_by_ref_mut(dom_ref) {
Some(inst) => {
inst.properties.remove("UniqueId");
inst.children().to_vec()
}
None => Vec::new(),
};
for child_ref in child_refs {
recurse_strip_unique_ids(dom, child_ref)
}
}