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

Make the name field in projects optional #870

Merged
merged 9 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Rojo Changelog

## Unreleased Changes
* Made the `name` field optional on project files ([#870])
Files named `default.project.json` inherit the name of the folder they're in and all other projects
are named as expect (e.g. `foo.project.json` becomes an Instance named `foo`)

There is no change in behavior if `name` is set.
* Fixed incorrect results when serving model pivots ([#868])
* Rojo now converts any line endings to LF, preventing spurious diffs when syncing Lua files on Windows ([#854])
* Fixed Rojo plugin failing to connect when project contains certain unreadable properties ([#848])
Expand Down Expand Up @@ -63,6 +68,7 @@
[#848]: https://github.com/rojo-rbx/rojo/pull/848
[#854]: https://github.com/rojo-rbx/rojo/pull/854
[#868]: https://github.com/rojo-rbx/rojo/pull/868
[#870]: https://github.com/rojo-rbx/rojo/pull/870


## [7.4.0] - January 16, 2024
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: tests/tests/build.rs
expression: contents
---
<roblox version="4">
<Item class="Folder" referent="0">
<Properties>
<string name="Name">top-level</string>
</Properties>
<Item class="Folder" referent="1">
<Properties>
<string name="Name">second-level</string>
</Properties>
<Item class="IntValue" referent="2">
<Properties>
<string name="Name">third-level</string>
<int64 name="Value">1337</int64>
</Properties>
</Item>
</Item>
</Item>
</roblox>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: tests/tests/build.rs
expression: contents
---
<roblox version="4">
<Item class="Folder" referent="0">
<Properties>
<string name="Name">no_name_project</string>
</Properties>
<Item class="Folder" referent="1">
<Properties>
<string name="Name">second-level</string>
</Properties>
<Item class="BoolValue" referent="2">
<Properties>
<string name="Name">bool_value</string>
<bool name="Value">true</bool>
</Properties>
</Item>
</Item>
</Item>
</roblox>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tests/tests/build.rs
assertion_line: 107
expression: contents
---
<roblox version="4">
<Item class="StringValue" referent="0">
<Properties>
<string name="Name">no_name_top_level_project</string>
<string name="Value">If this isn't named `no_name_top_level_project`, something went wrong!</string>
</Properties>
</Item>
</roblox>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "top-level",
"tree": {
"$className": "Folder",
"second-level": {
"$path": "src"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tree": {
"$className": "IntValue",
"$properties": {
"Value": 1337
}
}
}
9 changes: 9 additions & 0 deletions rojo-test/build-tests/no_name_project/default.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "no_name_project",
"tree": {
"$className": "Folder",
"second-level": {
"$path": "src"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tree": {
"$className": "BoolValue",
"$properties": {
"Value": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tree": {
"$className": "StringValue",
"$properties": {
"Value": "If this isn't named `no_name_top_level_project`, something went wrong!"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
Children:
- id-3
ClassName: Folder
Id: id-2
Metadata:
ignoreUnknownInstances: true
Name: top-level
Parent: "00000000000000000000000000000000"
Properties: {}
id-3:
Children:
- id-4
ClassName: Folder
Id: id-3
Metadata:
ignoreUnknownInstances: false
Name: second-level
Parent: id-2
Properties: {}
id-4:
Children: []
ClassName: IntValue
Id: id-4
Metadata:
ignoreUnknownInstances: true
Name: third-level
Parent: id-3
Properties:
Value:
Int64: 1337
messageCursor: 0
sessionId: id-1

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
source: tests/tests/serve.rs
assertion_line: 316
expression: redactions.redacted_yaml(info)
---
expectedPlaceIds: ~
gameId: ~
placeId: ~
projectName: top-level
protocolVersion: 4
rootInstanceId: id-2
serverVersion: "[server-version]"
sessionId: id-1

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
source: tests/tests/serve.rs
assertion_line: 338
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
Children:
- id-3
ClassName: Folder
Id: id-2
Metadata:
ignoreUnknownInstances: true
Name: no_name_project
Parent: "00000000000000000000000000000000"
Properties: {}
id-3:
Children:
- id-4
ClassName: Folder
Id: id-3
Metadata:
ignoreUnknownInstances: false
Name: second-level
Parent: id-2
Properties: {}
id-4:
Children: []
ClassName: BoolValue
Id: id-4
Metadata:
ignoreUnknownInstances: true
Name: bool_value
Parent: id-3
Properties:
Value:
Bool: true
messageCursor: 0
sessionId: id-1

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
source: tests/tests/serve.rs
assertion_line: 335
expression: redactions.redacted_yaml(info)
---
expectedPlaceIds: ~
gameId: ~
placeId: ~
projectName: no_name_project
protocolVersion: 4
rootInstanceId: id-2
serverVersion: "[server-version]"
sessionId: id-1

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
source: tests/tests/serve.rs
assertion_line: 357
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
Children: []
ClassName: StringValue
Id: id-2
Metadata:
ignoreUnknownInstances: true
Name: no_name_top_level_project
Parent: "00000000000000000000000000000000"
Properties:
Value:
String: "If this isn't named `no_name_top_level_project`, something went wrong!"
messageCursor: 0
sessionId: id-1

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
source: tests/tests/serve.rs
assertion_line: 351
expression: redactions.redacted_yaml(info)
---
expectedPlaceIds: ~
gameId: ~
placeId: ~
projectName: no_name_top_level_project
protocolVersion: 4
rootInstanceId: id-2
serverVersion: "[server-version]"
sessionId: id-1

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "top-level",
"tree": {
"$className": "Folder",
"second-level": {
"$path": "src"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tree": {
"$className": "IntValue",
"$properties": {
"Value": 1337
}
}
}
9 changes: 9 additions & 0 deletions rojo-test/serve-tests/no_name_project/default.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "no_name_project",
"tree": {
"$className": "Folder",
"second-level": {
"$path": "src"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tree": {
"$className": "BoolValue",
"$properties": {
"Value": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tree": {
"$className": "StringValue",
"$properties": {
"Value": "If this isn't named `no_name_top_level_project`, something went wrong!"
}
}
}
2 changes: 1 addition & 1 deletion src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum Error {
#[serde(deny_unknown_fields, rename_all = "camelCase")]
pub struct Project {
/// The name of the top-level instance described by the project.
pub name: String,
pub name: Option<String>,

/// The tree of instances described by this project. Projects always
/// describe at least one instance.
Expand Down
Loading
Loading