Commit graph

146 commits

Author SHA1 Message Date
Joe
cd63b5c9c0 json5 2026-01-22 21:27:34 -06:00
Joe
074e62951f revert unresolved value patches 2026-01-22 19:51:44 -06:00
Joe
69774fd546 Update .gitmodules for rbx-dom URL and enhance UnresolvedValue handling
- Changed the rbx-dom submodule URL in .gitmodules from SSH to HTTPS for easier access.
- Introduced a new method to handle OptionalCFrame variants in UnresolvedValue, allowing for better serialization by returning `None` for `OptionalCFrame(None)`.
- Updated various files to utilize the new handling logic, ensuring properties are only inserted when resolved values are available.
2026-01-21 16:07:24 -06:00
Joe
4a09689090 Enhance WhitespaceUtil and Reconciler to handle duplicate names and improve diffing logic
- Updated WhitespaceUtil to return distinct values for totalDiff and whitespaceDiff when differences exceed 100 lines, based on content changes.
- Introduced findDuplicateNames function in Reconciler to identify and skip instances with duplicate names, ensuring reliable syncing.
- Enhanced diffing logic to account for ambiguous paths and log skipped duplicates during the sync process.
- Improved error handling in syncback_dir_no_meta to log and skip children with duplicate names in the file system.
2026-01-20 22:10:19 -06:00
Joe
2dfcac4ef7 Refactor code for improved readability by consolidating multi-line statements into single lines across various modules, including JSON serialization, snapshot middleware, and file name validation. 2026-01-20 20:48:52 -06:00
CoderJoey
c36421626d
Merge branch 'rojo-rbx:master' into master 2026-01-20 20:10:14 -06:00
Ivan Matthew
2a1102fc55
Implement VFS Path normalization for improved cross-platform tree synchronization (#1201) 2026-01-19 15:04:59 -08:00
Joe
033dec4e18 Refactor metadata file name generation in syncback_lua and AdjacentMetadata to strip known script type suffixes (.server, .client, .plugin) for improved compatibility. This change ensures accurate base name extraction for meta files while maintaining handling of Windows-invalid characters. 2026-01-15 16:08:53 -06:00
Joe
5ad50e65d4 Enhance syncback error handling by including full instance paths in duplicate name error messages. Updated the syncback_project function to provide clearer context when instances with duplicate names are detected. 2025-12-29 00:40:13 -06:00
Joe
f6dc37e400 Enhance syncback functionality by implementing tree filtering based on ignoreTrees patterns. Added support for glob pattern matching to filter instances during serialization in both rbxm and rbxmx. Updated SyncbackSnapshot to compile and utilize these patterns efficiently. 2025-12-29 00:02:40 -06:00
Joe
978dd41047 Refactor metadata file name generation in syncback_lua to utilize the file stem from the script path, ensuring proper handling of Windows-invalid characters while maintaining compatibility with existing naming conventions. 2025-12-28 23:24:41 -06:00
Joe
f54367e5e0 Refactor metadata file name generation in read_and_apply_all to use the file stem from the actual path, ensuring correct handling of encoded characters for Windows-invalid filenames. 2025-12-28 23:04:59 -06:00
Joe
8c776c09b3 Implement encoding for Windows-invalid characters in syncback metadata file names across CSV, Lua, and TXT handlers. Updated file name generation to conditionally encode names based on the presence of invalid characters. 2025-12-28 22:43:21 -06:00
Joe
6d8c85682d Implement encoding and decoding for Windows-invalid characters in file names
- Added `encode_path_name` and `decode_path_name` functions to handle encoding and decoding of invalid characters.
- Updated `SyncbackRules` to include an option for encoding Windows-invalid characters during syncback.
- Modified `name_for_inst` to conditionally encode invalid characters based on the new option.
- Adjusted `ServeSession` and `InstanceContext` to support the new encoding feature.
- Updated tests and snapshots to reflect changes in encoding behavior.
2025-12-19 22:50:53 -06:00
Joe
db87fa010f ignore classes feature 2025-12-19 01:15:14 -06:00
Joe
929bc254fa Sorted keys 2025-12-09 00:28:13 -06:00
Micah
a61a1bef55
Roundtrip schemas in syncback (#1173) 2025-11-26 16:11:39 -08:00
Micah
9b5a07191b
Implement Syncback to support converting Roblox files to a Rojo project (#937)
This is a very large commit.
Consider checking the linked PR for more information.
2025-11-19 09:21:33 -08:00
Micah
ea70d89291
Support .jsonc extension for all JSON files (#1159) 2025-11-18 18:47:43 -08:00
boatbomber
d0b029f995
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.
2025-10-28 17:29:57 -07:00
Micah
441c469966
Release Rojo v7.6.0 (#1125) 2025-10-10 19:17:55 -07:00
Micah
f3c423d77d
Fix the various lints (#1124) 2025-10-10 13:00:56 -07:00
Micah
a4eb65ca3f
Add YAML middleware that behaves like TOML and JSON (#1093) 2025-08-02 20:58:13 -07:00
Micah
4c4b2dbe17
Add legacy and runContext script sync rule middlewares (#909) 2025-04-02 12:47:27 -07:00
Sasial
73ed5ae697
Add Support for Plugin Scripts (#1008) 2025-04-02 11:37:49 -07:00
Micah
833320de64
Update rbx-dom (#1023) 2025-04-02 11:32:27 -07:00
Jack T
55a207a275
Fix clippy lint warnings (#1004) 2025-01-13 10:07:53 -08:00
Micah
34106f470f
Remove maplit dependency and stop using a macro for hashmaps (#982) 2024-10-31 11:56:54 -07:00
Micah
d9ab0e7de8
Support $schema in JSON structures (#974) 2024-10-24 10:55:51 -07:00
Micah
3ca975d81d
Correct issue with default.project.json files with no name being named default after change (#917)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
2024-07-15 09:24:51 -07:00
Micah
7e2bab921a
Support setting referent properties via attributes (#843)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
2024-06-20 23:48:52 +01:00
Micah
48bb760739
Make the name field in projects optional (#870)
Closes #858.

If a project is named `default.project.json`, it acts as an `init` file
and gains the name of the folder it's inside of. If it is named
something other than `default.project.json`, it gains the name of the
file with `.project.json` trimmed off. So e.g. `foo.project.json`
becomes `foo`.
2024-02-20 17:25:57 -08:00
Kenneth Loeffler
cf25eb0833
Normalize line endings to LF in Lua middleware (#854) 2024-02-12 14:58:03 -08:00
Micah
73828af715
Add a new syncRules field project files to allow users to specify middleware to use for files (#813) 2024-01-19 22:18:17 -08:00
Sasial
bb8dd1402d
Add RunContext support for script outputs (#765)
Resolves #667

This PR:

- Introduces a new field in the project file: `scriptType` which has the
default value of `Class` (in parity with previous versions), but can
also be `RunContext`.
- This is then passed to `InstanceContext` from the `Project` struct.
- This then changes the RunContext in the lua `snapshot_middleware`

---------

Co-authored-by: Micah <dekkonot@rocketmail.com>
2023-09-23 13:28:09 -07:00
Micah
066a0b1668
Allow Terrain to be included in projects without a classname (#771)
Services, `StarterPlayerScripts`, and `StarterCharacterScripts` are
currently special-cased to allow them to be specified in project files
without a classname. This does the same to `Terrain` since it's a
singleton in the same style as those.
2023-08-15 05:41:49 -07:00
Shae
6e320b1fd5
Add support for TOML files (#633)
TOML maps well to Lua, is easier to read and write than JSON, and is
commonly used by Roblox tools.

Use cases:
* Put game, plugin, or library config in a toml file
* Sync in toml files generated by tools
* Sync in config files for tools so that the game can double-check that
the config file has been followed. (e.g. check that packages match
versions specified in wally.toml)
2023-07-14 20:36:50 +00:00
utrain
80eb14f9da
Removed InstanceSnapshot snapshot_id's redudant Ref. (#730)
Ref now is an optional inside, so it's redundant to have an option
wrapping an option. The only snapshots that were changed were any that
had a Ref within (from none to zeroed). Some also had some newlines
added in the end.
2023-07-12 10:00:09 -07:00
Kenneth Loeffler
8646b2dfce
Fix snapshot middleware clippy lints (#686)
The seventh in a series of PRs that aim to get CI passing
2023-06-30 11:06:12 -07:00
Boegie19
9876508887
added attributes to AdjacentMetadata (#624)
* added attributes to AdjacentMetadata

* ran fmt
2022-08-20 22:32:58 -04:00
Max
d196c5091c
Simplify usage of attributes. (#574)
* Support implicit values for primitive attributes

This commit adds support for strings, numbers, and booleans to be implicitly typed in attribute maps, reducing the redundancy of needing to specify their types.

I also quietly adjusted one of the tests to use a more stable class/property pair. Since SourceAssetId is locked to Roblox, it could potentially disappear at any time.

* Apply formatting.

* Address feedback

* Backwards compatible format usage.

* Axe UnresolvedValueMap in favor of $attributes

Attributes can be defined directly on instances, with support for unambiguous types.

* Adjust test.

* to_string() -> into()

* Made attribute test more concise.

* small cleanup

* Update src/resolution.rs

* Update src/resolution.rs

* Update src/resolution.rs

* Update src/resolution.rs

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2022-08-03 20:07:06 -04:00
Boegie19
eb5c897ac0
fix relevant_paths not being set for init.csv (#599)
* fix relevant_paths not being set for init.csv

* fix failing tests

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2022-08-03 18:38:08 -04:00
Boegie19
5cb4cc0d1d
feature init csv (#594)
* init csv feature + test

* fmt fixes
2022-07-29 21:45:19 -04:00
Max
f649c180cf
Disambiguate camelCase and PascalCase in *.meta.json and *.model.json (#563)
* Disambiguate camelCase and PascalCase.

*.meta.json forces camelCase while *.model.json forces PascalCase. This commit reinforces camelCase as the preference for both, but allows for PascalCase in both as well.

* Made requested changes, breaking due to serde bug.

* Make work with existing Serde stuff

* Work around MSRV

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2022-06-29 20:14:35 -04:00
Samuel P
acf7456371
Accept .luau files (#552)
* accept .luau files

* Accept .luau in snapshot creation

* Update versioning and snapshots.

* fix versioning

* Run rustfmt

* Reduce repetition in extension detection

* Tidy build script change

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2022-06-29 18:53:10 -04:00
Lucien Greathouse
e5dbee1073
Defer application of init.meta.json until after init Lua files. (#549)
Fixes #546.
2022-06-09 21:42:37 -04:00
Lucien Greathouse
10341e3776
Major Performance Improvements (#548)
* Use WeakDom::into_raw for faster snapshot generation from models

* Make compute_patch_set take snapshots by value

* Stop deferring property application in apply_patch_set

* Use InstanceBuilder::empty to avoid extra name allocations

* Git dependencies, skip dropping ServeSession

* Use std::mem::forget instead of ManuallyDrop

* Switch to latest rbx-dom crates.io dependencies

* Update other dependencies
2022-06-05 17:47:31 -04:00
Lucien Greathouse
824cdc5dcd Annotate snapshot_rbxm for profiling 2022-05-27 18:13:07 -04:00
Lucien Greathouse
7aa7a35aa5 Add profiling info and optional profiling with Tracy 2022-05-27 03:08:54 -04:00
James Onnen
fe81e55925
Add support for optional paths (#472)
* Add PathNode with optional fields to project. This allows a path to be defined either as `"$path": "src"` or `"$path": { "optional": "src" }`

* Make $path truly optional

* Prevent rojo from erroring if no project node is resolved

* Use match instead of if-statement

* Add end-to-end tests (credit to MobiusCraftFlip for initial scenario)

* Pass option with ref inside instead of reference to option

* Empty commit to restart GitHub Actions

* Simplify build test

* Minimize serve test: it fails

* Simplify serve test even more

* Ignore failing serve test

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2022-04-19 18:43:47 -04:00