mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Update file extensions from .lua to .luau and adjust README for glob ignore tests
- Changed return statements in `init.client.lua` and `init.lua` files to reflect the new .luau extension. - Updated README in `ignore_glob_spec` to specify that glob ignores now work with .spec.luau files instead of .spec.lua. - Modified various test files to transition from .json to .json5 format, ensuring consistency across project configurations.
This commit is contained in:
parent
84f76d48fc
commit
f08a4d21e7
6 changed files with 28 additions and 28 deletions
|
|
@ -221,7 +221,7 @@ fn empty_json_model() {
|
|||
);
|
||||
|
||||
fs::write(
|
||||
session.path().join("src/test.model.json"),
|
||||
session.path().join("src/test.model.json5"),
|
||||
r#"{"ClassName": "Model"}"#,
|
||||
)
|
||||
.unwrap();
|
||||
|
|
@ -378,7 +378,7 @@ fn no_name_top_level_project() {
|
|||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
let project_path = session.path().join("default.project.json");
|
||||
let project_path = session.path().join("default.project.json5");
|
||||
let mut project_contents = fs::read_to_string(&project_path).unwrap();
|
||||
project_contents.push('\n');
|
||||
fs::write(&project_path, project_contents).unwrap();
|
||||
|
|
@ -427,7 +427,7 @@ fn ref_properties() {
|
|||
);
|
||||
|
||||
fs::write(
|
||||
session.path().join("ModelTarget.model.json"),
|
||||
session.path().join("ModelTarget.model.json5"),
|
||||
r#"{
|
||||
"className": "Folder",
|
||||
"attributes": {
|
||||
|
|
@ -483,7 +483,7 @@ fn ref_properties_remove() {
|
|||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::remove_file(session.path().join("src/target.model.json")).unwrap();
|
||||
fs::remove_file(session.path().join("src/target.model.json5")).unwrap();
|
||||
|
||||
let socket_packet = session
|
||||
.get_api_socket_packet(SocketPacketType::Messages, 0)
|
||||
|
|
@ -525,7 +525,7 @@ fn ref_properties_patch_update() {
|
|||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
let target_path = session.path().join("ModelTarget.model.json");
|
||||
let target_path = session.path().join("ModelTarget.model.json5");
|
||||
|
||||
// Inserting scale just to force the change processor to run
|
||||
fs::write(
|
||||
|
|
@ -579,7 +579,7 @@ fn model_pivot_migration() {
|
|||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
let project_path = session.path().join("default.project.json");
|
||||
let project_path = session.path().join("default.project.json5");
|
||||
|
||||
fs::write(
|
||||
project_path,
|
||||
|
|
@ -592,7 +592,7 @@ fn model_pivot_migration() {
|
|||
"$className": "Model"
|
||||
},
|
||||
"Tool": {
|
||||
"$path": "Tool.model.json"
|
||||
"$path": "Tool.model.json5"
|
||||
},
|
||||
"Actor": {
|
||||
"$className": "Actor"
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ syncback_tests! {
|
|||
// Ensures that syncback works with CSVs
|
||||
csv => ["src/csv_init/init.csv", "src/csv.csv"],
|
||||
// Ensures that if a RojoId is duplicated somewhere in the project, it's
|
||||
// rewritten rather than synced back as a conflict (preserves existing .json)
|
||||
duplicate_rojo_id => ["container.model.json"],
|
||||
// rewritten rather than synced back as a conflict
|
||||
duplicate_rojo_id => ["container.model.json5"],
|
||||
// Ensures that the `ignorePaths` setting works for additions (new files get .json5)
|
||||
ignore_paths_adding => ["src/int_value.model.json5", "src/subfolder/string_value.txt"],
|
||||
// Ensures that the `ignorePaths` setting works for `init` files
|
||||
|
|
@ -47,10 +47,10 @@ syncback_tests! {
|
|||
ignore_trees_adding => [],
|
||||
// Ensures that `ignoreTrees` works for removals
|
||||
ignore_trees_removing => [],
|
||||
// Ensures that all of the JSON middlewares are handled as expected (preserves existing .json)
|
||||
json_middlewares => ["src/dir_with_meta/init.meta.json", "src/model_json.model.json", "src/project_json.project.json"],
|
||||
// Ensures projects that refer to other projects work as expected (preserves existing .json)
|
||||
nested_projects => ["nested.project.json", "string_value.txt"],
|
||||
// Ensures that all of the JSON middlewares are handled as expected
|
||||
json_middlewares => ["src/dir_with_meta/init.meta.json5", "src/model_json.model.json5", "src/project_json.project.json5"],
|
||||
// Ensures projects that refer to other projects work as expected
|
||||
nested_projects => ["nested.project.json5", "string_value.txt"],
|
||||
// Ensures files that are ignored by nested projects are picked up if
|
||||
// they're included in second project. Unusual but perfectly workable
|
||||
// pattern that syncback has to support.
|
||||
|
|
@ -58,32 +58,32 @@ syncback_tests! {
|
|||
// Ensures that projects respect `init` files when they're directly referenced from a node
|
||||
project_init => ["src/init.luau"],
|
||||
// Ensures that projects can be reserialized by syncback and that
|
||||
// default.project.json doesn't change unexpectedly (preserves existing .json)
|
||||
project_reserialize => ["attribute_mismatch.luau", "property_mismatch.project.json"],
|
||||
// default.project.json5 doesn't change unexpectedly
|
||||
project_reserialize => ["attribute_mismatch.luau", "property_mismatch.project.json5"],
|
||||
// Confirms that Instances that cannot serialize as directories serialize as rbxms
|
||||
rbxm_fallback => [],
|
||||
// Ensures that ref properties are linked properly on the file system (preserves existing .json)
|
||||
ref_properties => ["src/pointer.model.json", "src/target.model.json"],
|
||||
// Ensures that ref properties are linked properly on the file system
|
||||
ref_properties => ["src/pointer.model.json5", "src/target.model.json5"],
|
||||
// Ensures that ref properties are linked when no attributes are manually
|
||||
// set in the DataModel (new files get .json5)
|
||||
ref_properties_blank => ["src/pointer.model.json5", "src/target.txt"],
|
||||
// Ensures that if there is a conflict in RojoRefs, one of them is rewritten (preserves existing .json)
|
||||
ref_properties_conflict => ["src/Pointer_2.model.json", "src/Target_2.model.json"],
|
||||
// Ensures that if there is a conflict in RojoRefs, one of them is rewritten
|
||||
ref_properties_conflict => ["src/Pointer_2.model.json5", "src/Target_2.model.json5"],
|
||||
// Ensures that having multiple pointers that are aimed at the same target doesn't trigger ref rewrites.
|
||||
ref_properties_duplicate => [],
|
||||
// Ensures that ref properties that point to nothing after the prune both
|
||||
// do not leave any trace of themselves (new files get .json5)
|
||||
ref_properties_pruned => ["src/Pointer1.model.json5", "src/Pointer2.model.json5", "src/Pointer3.model.json5"],
|
||||
// Ensures that the old middleware is respected during syncback
|
||||
respect_old_middleware => ["default.project.json", "src/model_json.model.json", "src/rbxm.rbxm", "src/rbxmx.rbxmx"],
|
||||
// Ensures that the `$schema` field roundtrips with syncback (preserves existing .json)
|
||||
schema_roundtrip => ["default.project.json", "src/model.model.json", "src/init/init.meta.json", "src/adjacent.meta.json"],
|
||||
respect_old_middleware => ["default.project.json5", "src/model_json.model.json5", "src/rbxm.rbxm", "src/rbxmx.rbxmx"],
|
||||
// Ensures that the `$schema` field roundtrips with syncback
|
||||
schema_roundtrip => ["default.project.json5", "src/model.model.json5", "src/init/init.meta.json5", "src/adjacent.meta.json5"],
|
||||
// Ensures that StringValues inside project files are written to the
|
||||
// project file, but only if they don't have `$path` set
|
||||
string_value_project => ["default.project.json"],
|
||||
string_value_project => ["default.project.json5"],
|
||||
// Ensures that sync rules are respected. This is really just a test to
|
||||
// ensure it uses the old path when possible, but we want the coverage.
|
||||
sync_rules => ["src/module.modulescript", "src/text.text"],
|
||||
// Ensures that the `syncUnscriptable` setting works
|
||||
unscriptable_properties => ["default.project.json"],
|
||||
unscriptable_properties => ["default.project.json5"],
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue