forked from rojo-rbx/rojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new
syncRules
field project files to allow users to specify m…
…iddleware to use for files (rojo-rbx#813)
- Loading branch information
Showing
48 changed files
with
915 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
rojo-test/build-test-snapshots/end_to_end__tests__build__sync_rule_alone.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: tests/tests/build.rs | ||
assertion_line: 102 | ||
expression: contents | ||
--- | ||
<roblox version="4"> | ||
<Item class="Folder" referent="0"> | ||
<Properties> | ||
<string name="Name">sync_rule_alone</string> | ||
</Properties> | ||
<Item class="StringValue" referent="1"> | ||
<Properties> | ||
<string name="Name">foo</string> | ||
<string name="Value">Hello, world!</string> | ||
</Properties> | ||
</Item> | ||
</Item> | ||
</roblox> |
43 changes: 43 additions & 0 deletions
43
rojo-test/build-test-snapshots/end_to_end__tests__build__sync_rule_complex.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
source: tests/tests/build.rs | ||
assertion_line: 104 | ||
expression: contents | ||
--- | ||
<roblox version="4"> | ||
<Item class="Folder" referent="0"> | ||
<Properties> | ||
<string name="Name">sync_rule_complex</string> | ||
</Properties> | ||
<Item class="Script" referent="1"> | ||
<Properties> | ||
<string name="Name">bar</string> | ||
<token name="RunContext">0</token> | ||
<string name="Source">-- Hello, from bar (a Script)!</string> | ||
</Properties> | ||
</Item> | ||
<Item class="LocalScript" referent="2"> | ||
<Properties> | ||
<string name="Name">baz</string> | ||
<string name="Source">-- Hello, from baz (a LocalScript)!</string> | ||
</Properties> | ||
</Item> | ||
<Item class="StringValue" referent="3"> | ||
<Properties> | ||
<string name="Name">cat</string> | ||
<string name="Value">Hello, from cat (a StringValue)!</string> | ||
</Properties> | ||
</Item> | ||
<Item class="ModuleScript" referent="4"> | ||
<Properties> | ||
<string name="Name">foo</string> | ||
<string name="Source">-- Hello, from foo (a ModuleScript)!</string> | ||
</Properties> | ||
</Item> | ||
<Item class="StringValue" referent="5"> | ||
<Properties> | ||
<string name="Name">qux</string> | ||
<string name="Value">Hello, from qux (a .rojo file that's turned into a StringValue)!</string> | ||
</Properties> | ||
</Item> | ||
</Item> | ||
</roblox> |
12 changes: 12 additions & 0 deletions
12
rojo-test/build-test-snapshots/end_to_end__tests__build__sync_rule_nested_projects.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: tests/tests/build.rs | ||
assertion_line: 104 | ||
expression: contents | ||
--- | ||
<roblox version="4"> | ||
<Item class="Folder" referent="0"> | ||
<Properties> | ||
<string name="Name">sync_rule_nested_projects</string> | ||
</Properties> | ||
</Item> | ||
</roblox> |
12 changes: 12 additions & 0 deletions
12
rojo-test/build-tests/sync_rule_alone/default.project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "sync_rule_alone", | ||
"tree": { | ||
"$path": "src" | ||
}, | ||
"syncRules": [ | ||
{ | ||
"pattern": "*.nothing", | ||
"use": "text" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello, world! |
30 changes: 30 additions & 0 deletions
30
rojo-test/build-tests/sync_rule_complex/default.project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "sync_rule_complex", | ||
"tree": { | ||
"$path": "src" | ||
}, | ||
"syncRules": [ | ||
{ | ||
"pattern": "*.module", | ||
"use": "moduleScript" | ||
}, | ||
{ | ||
"pattern": "*.server", | ||
"use": "serverScript" | ||
}, | ||
{ | ||
"pattern": "*.client", | ||
"use": "clientScript" | ||
}, | ||
{ | ||
"pattern": "*.rojo", | ||
"exclude": "*.ignore.rojo", | ||
"use": "project" | ||
}, | ||
{ | ||
"pattern": "*.dog.rojo2", | ||
"use": "text", | ||
"suffix": ".dog.rojo2" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Hello, from bar (a Script)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Hello, from baz (a LocalScript)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello, from cat (a StringValue)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Hello, from foo (a ModuleScript)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "qux", | ||
"tree": { | ||
"$className": "StringValue", | ||
"$properties": { | ||
"Value": "Hello, from qux (a .rojo file that's turned into a StringValue)!" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file should be ignored! |
12 changes: 12 additions & 0 deletions
12
rojo-test/build-tests/sync_rule_nested_projects/default.project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "sync_rule_nested_projects", | ||
"tree": { | ||
"$path": "nested.project.json" | ||
}, | ||
"syncRules": [ | ||
{ | ||
"pattern": "*.rojo", | ||
"use": "text" | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
rojo-test/build-tests/sync_rule_nested_projects/nested.project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "nested", | ||
"tree": { | ||
"$path": "src" | ||
}, | ||
"syncRules": [ | ||
{ | ||
"pattern": "*.txt", | ||
"use": "ignore" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
rojo-test/build-tests/sync_rule_nested_projects/src/ignored.rojo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This shouldn't be in the built file. If it is, something is wrong. |
1 change: 1 addition & 0 deletions
1
rojo-test/build-tests/sync_rule_nested_projects/src/ignored.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This shouldn't be in the built file. If it is, something is wrong. |
30 changes: 30 additions & 0 deletions
30
rojo-test/serve-test-snapshots/end_to_end__tests__serve__sync_rule_alone_all.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: tests/tests/serve.rs | ||
assertion_line: 268 | ||
expression: "read_response.intern_and_redact(&mut redactions, root_id)" | ||
--- | ||
instances: | ||
id-2: | ||
Children: | ||
- id-3 | ||
ClassName: Folder | ||
Id: id-2 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: sync_rule_alone | ||
Parent: "00000000000000000000000000000000" | ||
Properties: {} | ||
id-3: | ||
Children: [] | ||
ClassName: StringValue | ||
Id: id-3 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: foo | ||
Parent: id-2 | ||
Properties: | ||
Value: | ||
String: "Hello, world!" | ||
messageCursor: 0 | ||
sessionId: id-1 | ||
|
14 changes: 14 additions & 0 deletions
14
rojo-test/serve-test-snapshots/end_to_end__tests__serve__sync_rule_alone_info.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: tests/tests/serve.rs | ||
assertion_line: 265 | ||
expression: redactions.redacted_yaml(info) | ||
--- | ||
expectedPlaceIds: ~ | ||
gameId: ~ | ||
placeId: ~ | ||
projectName: sync_rule_alone | ||
protocolVersion: 4 | ||
rootInstanceId: id-2 | ||
serverVersion: "[server-version]" | ||
sessionId: id-1 | ||
|
80 changes: 80 additions & 0 deletions
80
rojo-test/serve-test-snapshots/end_to_end__tests__serve__sync_rule_complex_all.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
source: tests/tests/serve.rs | ||
assertion_line: 284 | ||
expression: "read_response.intern_and_redact(&mut redactions, root_id)" | ||
--- | ||
instances: | ||
id-2: | ||
Children: | ||
- id-3 | ||
- id-4 | ||
- id-5 | ||
- id-6 | ||
- id-7 | ||
ClassName: Folder | ||
Id: id-2 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: sync_rule_complex | ||
Parent: "00000000000000000000000000000000" | ||
Properties: {} | ||
id-3: | ||
Children: [] | ||
ClassName: Script | ||
Id: id-3 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: bar | ||
Parent: id-2 | ||
Properties: | ||
RunContext: | ||
Enum: 0 | ||
Source: | ||
String: "-- Hello, from bar (a Script)!" | ||
id-4: | ||
Children: [] | ||
ClassName: LocalScript | ||
Id: id-4 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: baz | ||
Parent: id-2 | ||
Properties: | ||
Source: | ||
String: "-- Hello, from baz (a LocalScript)!" | ||
id-5: | ||
Children: [] | ||
ClassName: StringValue | ||
Id: id-5 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: cat | ||
Parent: id-2 | ||
Properties: | ||
Value: | ||
String: "Hello, from cat (a StringValue)!" | ||
id-6: | ||
Children: [] | ||
ClassName: ModuleScript | ||
Id: id-6 | ||
Metadata: | ||
ignoreUnknownInstances: false | ||
Name: foo | ||
Parent: id-2 | ||
Properties: | ||
Source: | ||
String: "-- Hello, from foo (a ModuleScript)!" | ||
id-7: | ||
Children: [] | ||
ClassName: StringValue | ||
Id: id-7 | ||
Metadata: | ||
ignoreUnknownInstances: true | ||
Name: qux | ||
Parent: id-2 | ||
Properties: | ||
Value: | ||
String: "Hello, from qux (a .rojo file that's turned into a StringValue)!" | ||
messageCursor: 0 | ||
sessionId: id-1 | ||
|
14 changes: 14 additions & 0 deletions
14
rojo-test/serve-test-snapshots/end_to_end__tests__serve__sync_rule_complex_info.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: tests/tests/serve.rs | ||
assertion_line: 281 | ||
expression: redactions.redacted_yaml(info) | ||
--- | ||
expectedPlaceIds: ~ | ||
gameId: ~ | ||
placeId: ~ | ||
projectName: sync_rule_complex | ||
protocolVersion: 4 | ||
rootInstanceId: id-2 | ||
serverVersion: "[server-version]" | ||
sessionId: id-1 | ||
|
Oops, something went wrong.