Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Syncback to support converting Roblox files to a Rojo project #937

Open
wants to merge 372 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
372 commits
Select commit Hold shift + click to select a range
4d7142c
Move .git filtering to `is_valid_path`
Dekkonot Jan 18, 2024
89deb6e
Filter project node paths
Dekkonot Jan 18, 2024
5888295
Use `is_valid_path` for filtering syncback middleware
Dekkonot Jan 18, 2024
e0c8419
Use a more reasonable method for getting file names
Dekkonot Jan 18, 2024
10d81d6
Remove unnecessary borrow in dir syncback middleware
Dekkonot Jan 18, 2024
aaa422d
Enforce unique child names for folders
Dekkonot Jan 18, 2024
cd10c0d
Make dedup checking case-insensitive
Dekkonot Jan 18, 2024
5860a46
Correct filtering of properties to merge new and old properties
Dekkonot Jan 23, 2024
ffb3da9
Filter out properties by class and name matching
Dekkonot Jan 23, 2024
2b0c404
Remove unnecessary borrow in json_model syncback
Dekkonot Jan 23, 2024
53355f0
Move towards syncback command not sucking
Dekkonot Jan 23, 2024
8c1851f
Add function for hashing a tree without using descendants
Dekkonot Jan 25, 2024
186a386
Add function for doing both hash types at once, use it
Dekkonot Jan 25, 2024
36b288b
Slightly improve UX of duplicate name checking
Dekkonot Jan 25, 2024
09e8ac1
Mildly improve performance of checking classes for JSON models
Dekkonot Jan 25, 2024
55354cf
Don't publicly export DirectoryMetadata
Dekkonot Jan 25, 2024
bbb5977
Correct problem with using old_inst properties where we shouldn't
Dekkonot Jan 25, 2024
fae849e
Add baseline for better metadata support
Dekkonot Jan 25, 2024
e670d8f
Use convenience method for metadata when possible
Dekkonot Jan 26, 2024
ec7d4ed
Make gitkeep file only in full dir syncback (not no_meta variant)
Dekkonot Jan 26, 2024
9ba191a
Correct metadata location for text and csv
Dekkonot Jan 26, 2024
80d19ca
Use DirectoryMeta for syncing dir metadata
Dekkonot Jan 26, 2024
670e541
Filter old_inst properties too
Dekkonot Jan 26, 2024
7b97520
Revert "Add function for doing both hash types at once, use it"
Dekkonot Jan 31, 2024
8478a9a
Fix issue caused by bad revert
Dekkonot Jan 31, 2024
b3d2e31
Refactor json model middleware to handle children
Dekkonot Jan 31, 2024
3799e94
Merge branch 'syncback-refs' into syncback-incremental
Dekkonot Feb 5, 2024
bf9c683
Add fields for ignoring the current camera and ignoring unscriptable …
Dekkonot Feb 5, 2024
1d57be1
Skip serializing syncback rule fields if they're empty
Dekkonot Feb 5, 2024
67e74d3
Update changelog entry for syncback
Dekkonot Feb 5, 2024
d778905
Write to Vfs in syncback command instead of loop
Dekkonot Feb 6, 2024
10c3e67
Unimplement Debug for FsSnapshot
Dekkonot Feb 6, 2024
0b1bd2b
Don't drop ServeSession in syncback
Dekkonot Feb 6, 2024
1471eb4
Add flags to syncback command for dry-run and listing files
Dekkonot Feb 8, 2024
3b04c48
Add prompt for confirming file writes
Dekkonot Feb 8, 2024
69cd53e
Emit error indicating why a file name is invalid
Dekkonot Feb 8, 2024
81e855b
Bail instead of panicking in syncback method of middleware
Dekkonot Feb 8, 2024
72d8dbe
Only skip serializing JosnModel names if they're None
Dekkonot Feb 8, 2024
337f4fd
Fix writing target IDs while referent linking
Dekkonot Feb 8, 2024
43b4ddd
Make rbxm and rbxmx filter properties
Dekkonot Feb 8, 2024
a1009f2
Allow specifying a subtree to hash
Dekkonot Feb 9, 2024
a922190
Hash rbxm and rbxmx files again post-property filtering
Dekkonot Feb 9, 2024
4c5bdc5
Remove hash_tree_no_descendants
Dekkonot Feb 9, 2024
e7de8f1
Pre-filter properties of the new DOM
Dekkonot Feb 9, 2024
1a6e354
Revert "Hash rbxm and rbxmx files again post-property filtering"
Dekkonot Feb 9, 2024
355b36f
Revert "Make rbxm and rbxmx filter properties"
Dekkonot Feb 9, 2024
a43efbf
Revert "Remove hash_tree_no_descendants"
Dekkonot Feb 9, 2024
e4b530c
Remove redundant filtering of properties
Dekkonot Feb 9, 2024
03330cf
Store ref map in Syncback Data
Dekkonot Feb 9, 2024
0c4057f
Use simplified filtering logic for projects
Dekkonot Feb 9, 2024
7a57b3c
Link referents before filtering properties
Dekkonot Feb 15, 2024
84a96ec
Use a proper deferred system for linking referents in syncback
Dekkonot Feb 15, 2024
9a25db6
Make ref properties use trace
Dekkonot Feb 19, 2024
1ddac9b
Filter the properties of the old dom too
Dekkonot Feb 19, 2024
f28a81b
Emit rbxmx if `ROJO_SYNCBACK_DEBUG` is set to `1` in env
Dekkonot Feb 19, 2024
28e213a
Just use the file handle in syncback command
Dekkonot Feb 19, 2024
53ed6d7
Don't use file watcher for syncback
Dekkonot Feb 19, 2024
bf5d0c9
Redo referent linking
Dekkonot Feb 19, 2024
5052abe
Revert "Store ref map in Syncback Data"
Dekkonot Feb 20, 2024
e3fc97f
Fix regression caused by matching entire dom by name
Dekkonot Feb 20, 2024
b6199a4
Remove import in property_filter
Dekkonot Feb 20, 2024
0e13a49
Reduce lifetime usage to only one
Dekkonot Feb 20, 2024
48ee54f
Add fallback to rbxm when directories fail to syncback
Dekkonot Feb 20, 2024
e8ee6ad
Use environment variable for fallback debugging
Dekkonot Feb 20, 2024
a6ce3e0
Add `PathNode::is_optional`
Dekkonot Feb 27, 2024
041532e
Add function to Middleware for getting a middleware, file_name from path
Dekkonot Feb 28, 2024
92f94bd
Perform initial rewrite of project middleware
Dekkonot Feb 28, 2024
a3206e7
Don't filter out Tags, Attributes, and SourceAssetId
Dekkonot Feb 28, 2024
4bd9d88
Remove unnecessary else-branch from dir syncback
Dekkonot Feb 28, 2024
2fde18f
Support overriding the middleware of snapshots
Dekkonot Feb 28, 2024
bf94eeb
Update documentation for SyncbackSnapshot::get_filtered_properties
Dekkonot Feb 28, 2024
8eeaf9a
Finish up project middleware rewrite, mostly
Dekkonot Feb 29, 2024
04ba94e
Update error message
Dekkonot Feb 29, 2024
3a97f2a
Don't be a weirdo with FsSnapshot in project middleware
Dekkonot Feb 29, 2024
1b110b9
Use relevant paths instead of instigating source for instance names
Dekkonot Feb 29, 2024
9041e57
It turns out file_path is cringe for this
Dekkonot Feb 29, 2024
2423b3b
Don't clear all properties from pure nodes.
Dekkonot Feb 29, 2024
84e0621
Don't write metadata if instigating sources don't match
Dekkonot Mar 1, 2024
129f380
Insert properties even when there's a path as a stopgap
Dekkonot Mar 1, 2024
7ba4476
Use relevant paths instead of instigating source for projects
Dekkonot Mar 4, 2024
77337cc
Update output from dry-run for syncback
Dekkonot Mar 4, 2024
64df667
Don't double syncback old_inst children
Dekkonot Mar 4, 2024
493e218
Add better attribute handling for json files
Dekkonot Mar 4, 2024
3fcec37
Move middleware resolution to `get_best_middleware` in its entirety
Dekkonot Mar 7, 2024
3ed103e
Don't filter out SharedString properties
Dekkonot Mar 7, 2024
cb1e392
Add `get_new_inst_path` to get a Roblox path using a snapshot
Dekkonot Mar 7, 2024
03877c2
Do middleware resolution better
Dekkonot Mar 7, 2024
d5ac912
Do not write SharedString properties in JSON models
Dekkonot Mar 7, 2024
fa7d73a
Actually use `sync_current_camera` correctly
Dekkonot Mar 8, 2024
1574246
Add 'root' method to RojoTree
Dekkonot Mar 8, 2024
b5657c5
Prune the new tree before running syncback
Dekkonot Mar 8, 2024
71c17a2
Make debug messages in metadata middleware better
Dekkonot Mar 8, 2024
ec8658c
Actually update Rojo's version tag
Dekkonot Mar 12, 2024
29cbdf9
Filter user-restricted properties out before sync loop
Dekkonot Mar 14, 2024
7c61eb3
Redo hashing and move filtering logic around
Dekkonot Mar 14, 2024
7d0784c
Store Project in syncback snapshot instead of only the rules
Dekkonot Mar 14, 2024
40d79ec
Don't double filter properties
Dekkonot Mar 14, 2024
e64802a
Update `get_filtered_properties` to use property filtering
Dekkonot Mar 14, 2024
914ed6e
Update doc comments for property filtering functions
Dekkonot Mar 14, 2024
2fc6eca
use `get_filtered_properties` where we should
Dekkonot Mar 14, 2024
848293d
Add function for getting project from snapshot data
Dekkonot Mar 14, 2024
2576a21
Export stuff from property_filter
Dekkonot Mar 14, 2024
ebbf86f
Use property filtering function for JsonModel syncback
Dekkonot Mar 14, 2024
4a8729c
Make hashing check more resilient to failure
Dekkonot Mar 14, 2024
b7b6e8d
Update SharedString warning message in JsonModel
Dekkonot Mar 14, 2024
0369788
Handle SharedString in directory meta.json
Dekkonot Mar 14, 2024
2041b99
Actually use debug env var correctly
Dekkonot Mar 14, 2024
d9817dd
Properly emit an error if a project has a path missing in syncback
Dekkonot Mar 18, 2024
6138db8
Add support for ignoring referents during syncback
Dekkonot Mar 20, 2024
4564ebe
Add basic test harness for syncback
Dekkonot Mar 20, 2024
dd688f1
Begin testing syncback
Dekkonot Mar 20, 2024
6ec800c
Don't override existing midleware if it exists unless an override is set
Dekkonot Mar 20, 2024
c187f70
Test the respecting of old middleware
Dekkonot Mar 20, 2024
308b4a9
Quietly continue of a referent is invalid in a DOM instead of panicking
Dekkonot Mar 20, 2024
36afdd2
Test nested projects
Dekkonot Mar 20, 2024
538271f
Test for unscriptable property support
Dekkonot Mar 20, 2024
752325c
Improve panic message in Project syncback
Dekkonot Mar 20, 2024
4928ad7
Rename snapeshot constructors and path field
Dekkonot Mar 25, 2024
2f92fab
Initial attempt at rewriting path logic for syncback
Dekkonot Mar 25, 2024
773c8a6
Remove unnecessary Instance check
Dekkonot Mar 25, 2024
ebe318b
Ensures CurrentCamera ref is destroyed in new tree before referents a…
Keanu73 Mar 26, 2024
2842f98
Redo snapshot paths for project files
Dekkonot Mar 28, 2024
b1b388f
Add test for "weird" nested projects
Dekkonot Mar 28, 2024
98fd8a2
Merge remote-tracking branch 'refs/remotes/origin/syncback-tests' int…
Dekkonot Mar 28, 2024
ba44010
Actually sync current camera in baseplate test
Dekkonot Mar 28, 2024
bbb016f
Add methods to FsSnapshot for listing files and directories
Dekkonot Mar 28, 2024
3341436
Add snapshotting for what files are being changed by syncback
Dekkonot Mar 28, 2024
e656d8d
Add project_init test, which currently fails
Dekkonot Mar 28, 2024
9513029
Start running project_init test
Dekkonot Mar 28, 2024
0766cb7
Update camera rbxm in baseplate test
Dekkonot Mar 29, 2024
eb63809
Correct nested project test file
Dekkonot Mar 29, 2024
0b6f554
Update project_init snapshot
Dekkonot Mar 29, 2024
8358413
Use actual path for project nodes
Dekkonot Mar 29, 2024
d190661
Add test for every middleware
Dekkonot Mar 29, 2024
a490f93
Run all_middleware test
Dekkonot Mar 29, 2024
6d66bc8
Rename lua files to luau files
Dekkonot Apr 1, 2024
f55a329
Rewrite test harness for syncback
Dekkonot Apr 1, 2024
1235f39
Update all_middleware test
Dekkonot Apr 1, 2024
ce9c1d7
Format project json in all_middleware test
Dekkonot Apr 1, 2024
d836280
remove cows from csv Middleware
Dekkonot Apr 2, 2024
f3ff058
Serialize LocalizationTable.Contents example field correctly
Dekkonot Apr 2, 2024
540a24b
Update expected results for rbxm and csv middlewares
Dekkonot Apr 2, 2024
0ecfed1
Update input file to not suck
Dekkonot Apr 2, 2024
f9ead1d
Add ref_property test
Dekkonot Apr 2, 2024
0fad2d7
Update test files for ref_properties test
Dekkonot Apr 4, 2024
63540bf
Make syncback test emit file contents when they don't match if possible
Dekkonot Apr 4, 2024
9815c37
Normalize line endings for syncback tests
Dekkonot Apr 4, 2024
04bd554
Add test for rbxm fallback
Dekkonot Apr 4, 2024
5094a66
Reimplement rbxm as fallback behavior for directories
Dekkonot Apr 4, 2024
7e13a18
Indicate which copy of the project a duplicate child is in when erroring
Dekkonot Apr 4, 2024
c854f60
I lied, apparently. We still need Cows in CSV.
Dekkonot Apr 4, 2024
627759c
Optimize use of cows in CSV middleware
Dekkonot Apr 4, 2024
7eff14b
Add `create_dir` and `create_dir_all` to VfsLock
Dekkonot Apr 4, 2024
fd315e8
Lock Vfs when writing syncback to file system
Dekkonot Apr 4, 2024
545a7e3
get rid of the RefRewrites struct
Dekkonot Apr 4, 2024
30d894e
Sort CSV by key instead of source (what was I cooking?)
Dekkonot Apr 8, 2024
7ebb2b2
Add a shim to force UniqueId to deserialize
Dekkonot Apr 9, 2024
2bc3035
Filter UniqueId out of JSON files
Dekkonot Apr 9, 2024
8f363b2
Redo referent linking to prefer UniqueId to avoid spurious diffs
Dekkonot Apr 9, 2024
1be311d
Add shim reflection database to syncback tests for deserializing Uniq…
Dekkonot Apr 11, 2024
e76cb49
Add note to syncback CLI file to update test shim when updating CLI shim
Dekkonot Apr 11, 2024
80079ea
Make Value objects syncback as JsonModel
Dekkonot Apr 11, 2024
74c7719
Correctly default to rbxm instead of rbxmx
Dekkonot Apr 11, 2024
9dbab3a
Add test for generating ref properties from scratch using UniqueId
Dekkonot Apr 11, 2024
82fcbf0
Reorganize test order
Dekkonot Apr 11, 2024
6e3ed79
Add test for updating referent properties on files that already exists
Dekkonot Apr 11, 2024
7d242c6
Reorder referent linking so that hashing takes place after it happens
Dekkonot Apr 11, 2024
ed748dc
Add test for ignore_paths
Dekkonot Apr 11, 2024
7f091de
Add ignore_path UX to make globs also ignore a directory
Dekkonot Apr 11, 2024
ce8a93f
Update ref_properties_update expected result
Dekkonot Apr 11, 2024
215879a
Rename root of new_tree to use project name
Dekkonot Apr 15, 2024
d3d0c53
Add test for project reserialization
Dekkonot Apr 15, 2024
d352cbf
Remove unnecesary import
Dekkonot Apr 17, 2024
e84ce7a
Initial attempt at preventing project files from reserializing when t…
Dekkonot Apr 17, 2024
3dd94f6
Update test snapshots
Dekkonot Apr 17, 2024
b1312ce
Upgrade project_reserialize test to cover rules for it
Dekkonot Apr 17, 2024
58b13f0
Reserialize project file when an attribute doesn't exist
Dekkonot Apr 17, 2024
f68995f
Document Middleware field of InstanceMetadata + add method for settin…
Dekkonot Apr 18, 2024
6e6b0ed
Update project_reserialize test
Dekkonot Apr 22, 2024
e1311db
Make it so project files only get properties and attributes when they…
Dekkonot Apr 22, 2024
0fa5ab5
Change folders to directories in syncback CLI output
Dekkonot Apr 22, 2024
77ffcac
Add test for project files using every middleware
Dekkonot Apr 22, 2024
1b843e1
Rename variable in project middleware
Dekkonot May 1, 2024
3197631
Add test for duplicate Rojo_Id attributes
Dekkonot May 1, 2024
2d570cb
Actually listen to middleware overrides
Dekkonot May 1, 2024
e8ffba7
Redo referent linking (again) to catch duplicates
Dekkonot May 1, 2024
11fef88
Update ref_property linker to strip out unnecessary pointer attributes
Dekkonot May 1, 2024
a5c2a11
Rename `get_filtered_properties` to `get_path_filtered_properties`
Dekkonot May 2, 2024
3434d01
Make error message for changing project node classes better
Dekkonot May 2, 2024
b9754c6
Don't filter properties for project nodes with no paths
Dekkonot May 2, 2024
fb9e737
Add test for project files that represent middleware with special pro…
Dekkonot May 2, 2024
6075644
Accout for NaN in variant_eq
Dekkonot May 13, 2024
4abac78
Fix clippy lints
Dekkonot May 29, 2024
ef56c39
Don't use macro, use array and `.into()` for JSON_MODEL_CLASSES
Dekkonot May 29, 2024
7d8d3a3
Make text chat related Instances become JSON models
Dekkonot May 29, 2024
40875b4
Correctly label two OptionalCFrames as equal if both are null
Dekkonot Jun 6, 2024
0ebf3c4
Correct error message for when rbxmx fails to parse
Dekkonot Jun 6, 2024
9c7a2be
Write unknown properties when running syncback on rbxmx files
Dekkonot Jun 6, 2024
6643ccb
Add test for Instances with two potential paths
Dekkonot Jun 6, 2024
a6c206d
Fix child_but_not test
Dekkonot Jun 6, 2024
deda13b
Correct misused function in `project_node_should_reserialize`
Dekkonot Jun 20, 2024
3bb7560
Check if properties serialize during filtering process
Dekkonot Jun 20, 2024
ef0f30c
Use .luau for dir scripts in syncback
Dekkonot Jul 2, 2024
5a3d6b1
Merge branch 'syncback-tests' into syncback-merge
Dekkonot Jul 2, 2024
9bf3a78
Update test files to use .luau instead of .lua
Dekkonot Jul 2, 2024
32753ab
Correct typos in a few comments
Dekkonot Jul 2, 2024
d1f5a09
Remove comment I forgot I left
Dekkonot Jul 2, 2024
444cf37
Cave and finally include UniqueId in the all middleware tests
Dekkonot Jul 2, 2024
a3c78e4
Remove superfluous instance snapshot creation from syncback
Dekkonot Jul 2, 2024
3602555
Actually transfer children in model files correctly
Dekkonot Jul 2, 2024
933973c
Turn invariant into an error because it turns out it can just happen lol
Dekkonot Jul 2, 2024
8a890aa
Revert changing CSV field to examples, add alias instead
Dekkonot Jul 8, 2024
13af709
Add some comments to syncback core loop
Dekkonot Jul 10, 2024
541fa3d
Fix outdated comment in referent linking
Dekkonot Jul 10, 2024
4f5f8ce
Merge branch 'syncback-tests' into syncback-merge
Dekkonot Jul 10, 2024
a854939
Optimistically attempt to normalize path displays
Dekkonot Jul 10, 2024
8555d79
Take the nuclear option to fix path normalization
Dekkonot Jul 10, 2024
c283daf
Add .gitkeep files I forgot
Dekkonot Jul 10, 2024
c258203
Merge branch 'master' into syncback-merge
Dekkonot Jul 15, 2024
87e9300
Make `sync_unscriptable` default to `true`
Dekkonot Jul 15, 2024
6b1a12e
Use more efficient implementation of `get_new_inst_path`
Dekkonot Jul 31, 2024
6e7fb82
oh my bad rustfmt
Dekkonot Jul 31, 2024
6c42039
Add test for ignoreTrees
Dekkonot Jul 31, 2024
c3e9019
Remove unused import in project.rs
Dekkonot Jul 31, 2024
47c702b
Don't include DOM root name in inst_path
Dekkonot Jul 31, 2024
7810428
Update changelog with new changes
Dekkonot Jul 31, 2024
8b0e1de
Merge remote-tracking branch 'rojo/master' into syncback-merge
Dekkonot Aug 15, 2024
f997c30
Revisit logging in syncback command
Dekkonot Aug 15, 2024
39cd8c0
Simplify directory fallback and indicate why the fallback happens in …
Dekkonot Aug 15, 2024
f1ca6cb
Use a BufReader when loading the Roblox file for syncback
Dekkonot Aug 15, 2024
5da5b05
Make removing files respect ignore_paths
Dekkonot Aug 15, 2024
db06397
Clean up `variant_eq`
Dekkonot Aug 19, 2024
5a7a65c
Redo docs for syncback command
Dekkonot Aug 19, 2024
ab24a85
Use hashing to determine if we should add directories
Dekkonot Aug 19, 2024
f2c65fc
Update test snapshots cuz I forgot
Dekkonot Aug 19, 2024
6aa8aa6
Don't serialize `LuaSourceContainer.ScriptGuid` for scripts originati…
Dekkonot Aug 22, 2024
64f567a
Merge branch 'rojo/master' into syncback-merge
Dekkonot Aug 29, 2024
ba92d6d
Remove database shim now that UniqueId deserializes
Dekkonot Aug 29, 2024
4d864d9
Update test files with new database
Dekkonot Aug 29, 2024
65e02e7
In project files, use the right instance for generating warning for S…
Dekkonot Aug 29, 2024
b0fe238
Filter out attributes that have names that start with `RBX_`
Dekkonot Aug 29, 2024
a2b5fdd
Correctly restrict Roblox attributes to be `RBX` rather than `RBX_`
Dekkonot Aug 29, 2024
0237edf
Redo referent linking code where there was a TODO
Dekkonot Sep 3, 2024
ead7158
Respect ignoreTrees when removing Instances
Dekkonot Sep 11, 2024
099643f
Actually handle duplicate Rojo_Ids during syncback
Dekkonot Sep 23, 2024
ff21a40
Stable sort CSV by source instead of key
Dekkonot Sep 26, 2024
6249d47
Remove old file when rbxm fallback triggers
Dekkonot Sep 26, 2024
24c5878
Make ChannelTabsConfiguration serialize as a JSON model
Dekkonot Nov 14, 2024
70f5dae
Only delete the old file if serializing as an rbxm succeeds
Dekkonot Nov 15, 2024
c788bbf
Only use ambiguous syntax if a property exists in the database
Dekkonot Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# Rojo Changelog

## Unreleased Changes
* A new command `rojo syncback` has been added. It can be used as `rojo syncback [path to project] --input [path to file]`.
This command takes a Roblox file and pulls Instances out of it and places them in the correct position in the provided project.
Syncback is primarily controlled by the project file. Any Instances who are either referenced in the project file or a descendant
of one that is will be placed in an appropriate location.

In addition, a new field has been added to project files, `syncbackRules` to control how it behaves:

```json
{
"syncbackRules": {
"ignoreTrees": [
"DataModel/ServerStorage/ImportantSecrets",
],
Dekkonot marked this conversation as resolved.
Show resolved Hide resolved
"ignorePaths": [
"src/ServerStorage/Secrets/*"
],
"ignoreProperties": {
"BasePart": ["Color"]
},
"syncCurrentCamera": false,
"syncUnscriptable": true,
}
}
```

A brief explanation of each field:

- `ignoreTrees` is a list of paths in the **roblox file** that should be ignored
- `ignorePaths` is a list of paths in the **file system** that should be ignored
- `ignoreProperties` is a list of properties that won't be synced back
- `syncCurrentCamera` is a toggle for whether to sync back the Workspace's CurrentCamera. Defaults to `false`.
- `syncUnscriptable` is a toggle for whether to sync back properties that cannot be set by the Roblox Studio plugin. Defaults to `false`.

* Projects may now manually link `Ref` properties together using `Attributes`. ([#843])
This has two parts: using `id` or `$id` in JSON files or a `Rojo_Target` attribute, an Instance
is given an ID. Then, that ID may be used elsewhere in the project to point to an Instance
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ uuid = { version = "1.7.0", features = ["v4", "serde"] }
clap = { version = "3.2.25", features = ["derive"] }
profiling = "1.0.15"

blake3 = "1.5.0"
float-cmp = "0.9.0"

[target.'cfg(windows)'.dependencies]
winreg = "0.10.1"

Expand Down
1 change: 1 addition & 0 deletions crates/memofs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## 0.3.0 (2024-03-15)
* Changed `StdBackend` file watching component to use minimal recursive watches. [#830]
* Added `Vfs::read_to_string` and `Vfs::read_to_string_lf_normalized` [#854]
* Added `create_dir` and `create_dir_all` to allow creating directories.

[#830]: https://github.com/rojo-rbx/rojo/pull/830
[#854]: https://github.com/rojo-rbx/rojo/pull/854
Expand Down
15 changes: 15 additions & 0 deletions crates/memofs/src/in_memory_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ impl VfsBackend for InMemoryFs {
}
}

fn create_dir(&mut self, path: &Path) -> io::Result<()> {
let mut inner = self.inner.lock().unwrap();
inner.load_snapshot(path.to_path_buf(), VfsSnapshot::empty_dir())
}

fn create_dir_all(&mut self, path: &Path) -> io::Result<()> {
let mut inner = self.inner.lock().unwrap();
let mut path_buf = path.to_path_buf();
while let Some(parent) = path_buf.parent() {
inner.load_snapshot(parent.to_path_buf(), VfsSnapshot::empty_dir())?;
path_buf.pop();
}
inner.load_snapshot(path.to_path_buf(), VfsSnapshot::empty_dir())
}

fn remove_file(&mut self, path: &Path) -> io::Result<()> {
let mut inner = self.inner.lock().unwrap();

Expand Down
62 changes: 62 additions & 0 deletions crates/memofs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ pub trait VfsBackend: sealed::Sealed + Send + 'static {
fn read(&mut self, path: &Path) -> io::Result<Vec<u8>>;
fn write(&mut self, path: &Path, data: &[u8]) -> io::Result<()>;
fn read_dir(&mut self, path: &Path) -> io::Result<ReadDir>;
fn create_dir(&mut self, path: &Path) -> io::Result<()>;
fn create_dir_all(&mut self, path: &Path) -> io::Result<()>;
fn metadata(&mut self, path: &Path) -> io::Result<Metadata>;
fn remove_file(&mut self, path: &Path) -> io::Result<()>;
fn remove_dir_all(&mut self, path: &Path) -> io::Result<()>;
Expand Down Expand Up @@ -190,6 +192,16 @@ impl VfsInner {
Ok(dir)
}

fn create_dir<P: AsRef<Path>>(&mut self, path: P) -> io::Result<()> {
let path = path.as_ref();
self.backend.create_dir(path)
}

fn create_dir_all<P: AsRef<Path>>(&mut self, path: P) -> io::Result<()> {
let path = path.as_ref();
self.backend.create_dir_all(path)
}

fn remove_file<P: AsRef<Path>>(&mut self, path: P) -> io::Result<()> {
let path = path.as_ref();
let _ = self.backend.unwatch(path);
Expand Down Expand Up @@ -326,6 +338,31 @@ impl Vfs {
self.inner.lock().unwrap().read_dir(path)
}

/// Creates a directory at the provided location.
///
/// Roughly equivalent to [`std::fs::create_dir`][std::fs::create_dir].
/// Similiar to that function, this function will fail if the parent of the
/// path does not exist.
///
/// [std::fs::create_dir]: https://doc.rust-lang.org/stable/std/fs/fn.create_dir.html
#[inline]
pub fn create_dir<P: AsRef<Path>>(&self, path: P) -> io::Result<()> {
let path = path.as_ref();
self.inner.lock().unwrap().create_dir(path)
}

/// Creates a directory at the provided location, recursively creating
/// all parent components if they are missing.
///
/// Roughly equivalent to [`std::fs::create_dir_all`][std::fs::create_dir_all].
///
/// [std::fs::create_dir_all]: https://doc.rust-lang.org/stable/std/fs/fn.create_dir_all.html
#[inline]
pub fn create_dir_all<P: AsRef<Path>>(&self, path: P) -> io::Result<()> {
let path = path.as_ref();
self.inner.lock().unwrap().create_dir_all(path)
}

/// Remove a file.
///
/// Roughly equivalent to [`std::fs::remove_file`][std::fs::remove_file].
Expand Down Expand Up @@ -428,6 +465,31 @@ impl VfsLock<'_> {
self.inner.read_dir(path)
}

/// Creates a directory at the provided location.
///
/// Roughly equivalent to [`std::fs::create_dir`][std::fs::create_dir].
/// Similiar to that function, this function will fail if the parent of the
/// path does not exist.
///
/// [std::fs::create_dir]: https://doc.rust-lang.org/stable/std/fs/fn.create_dir.html
#[inline]
pub fn create_dir<P: AsRef<Path>>(&mut self, path: P) -> io::Result<()> {
let path = path.as_ref();
self.inner.create_dir(path)
}

/// Creates a directory at the provided location, recursively creating
/// all parent components if they are missing.
///
/// Roughly equivalent to [`std::fs::create_dir_all`][std::fs::create_dir_all].
///
/// [std::fs::create_dir_all]: https://doc.rust-lang.org/stable/std/fs/fn.create_dir_all.html
#[inline]
pub fn create_dir_all<P: AsRef<Path>>(&mut self, path: P) -> io::Result<()> {
let path = path.as_ref();
self.inner.create_dir_all(path)
}

/// Remove a file.
///
/// Roughly equivalent to [`std::fs::remove_file`][std::fs::remove_file].
Expand Down
14 changes: 14 additions & 0 deletions crates/memofs/src/noop_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ impl VfsBackend for NoopBackend {
))
}

fn create_dir(&mut self, _path: &Path) -> io::Result<()> {
Err(io::Error::new(
io::ErrorKind::Other,
"NoopBackend doesn't do anything",
))
}

fn create_dir_all(&mut self, _path: &Path) -> io::Result<()> {
Err(io::Error::new(
io::ErrorKind::Other,
"NoopBackend doesn't do anything",
))
}

fn remove_file(&mut self, _path: &Path) -> io::Result<()> {
Err(io::Error::new(
io::ErrorKind::Other,
Expand Down
8 changes: 8 additions & 0 deletions crates/memofs/src/std_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ impl VfsBackend for StdBackend {
})
}

fn create_dir(&mut self, path: &Path) -> io::Result<()> {
fs_err::create_dir(path)
}

fn create_dir_all(&mut self, path: &Path) -> io::Result<()> {
fs_err::create_dir_all(path)
}

fn remove_file(&mut self, path: &Path) -> io::Result<()> {
fs_err::remove_file(path)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- src/csv.csv
- src/csv_init/init.csv
- src/dir/client_script.client.luau
- src/dir/init_client_script/init.client.luau
- src/dir/init_module_script/init.luau
- src/dir/init_server_script/init.server.luau
- src/dir/module_script.luau
- src/dir/server_script.server.luau
- src/model_json.model.json
- src/project_json.project.json
- src/rbxm.rbxm
- src/rbxmx.rbxmx
- src/text.txt
added_dirs:
- src
- src/csv_init
- src/dir
- src/dir/init_client_script
- src/dir/init_module_script
- src/dir/init_server_script
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- Lighting/Atmosphere.model.json
- Lighting/Bloom.model.json
- Lighting/DepthOfField.model.json
- Lighting/Sky.model.json
- Lighting/SunRays.model.json
- Workspace/Baseplate.rbxm
- Workspace/Camera.rbxm
- Workspace/SpawnLocation.rbxm
- Workspace/Terrain.rbxm
- default.project.json
added_dirs:
- Lighting
- Workspace
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- OnlyOneCopy/child_of_one.luau
- ReplicatedStorage/child_replicated_storage.luau
added_dirs:
- OnlyOneCopy
- ReplicatedStorage
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: tests/rojo_test/syncback_util.rs
assertion_line: 48
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- container.model.json
added_dirs: []
removed_files: []
removed_dirs: []

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- default.project.json
- src/integer.model.json
added_dirs:
- src
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: tests/rojo_test/syncback_util.rs
assertion_line: 48
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- nested.project.json
- string_value.txt
added_dirs: []
removed_files: []
removed_dirs: []

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- src/modules/ClientModule.luau
- src/modules/ServerModule.luau
added_dirs:
- src/modules
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- src/client_script.client.luau
- src/csv.csv
- src/csv_init/init.csv
- src/init_client_script/init.client.luau
- src/init_module_script/init.luau
- src/init_server_script/init.server.luau
- src/model_json.model.json
- src/module_script.luau
- src/project_json.project.json
- src/rbxmx.rbxmx
- src/server_script.server.luau
- src/text.txt
added_dirs:
- src/csv_init
- src/init_client_script
- src/init_module_script
- src/init_server_script
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- src/init.luau
added_dirs:
- src
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: tests/rojo_test/syncback_util.rs
assertion_line: 48
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
- attribute_mismatch.luau
- property_mismatch.project.json
added_dirs: []
removed_files: []
removed_dirs: []

Loading
Loading