mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 22:56:02 +00:00
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>
This commit is contained in:
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.csv
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: LocalizationTable
|
||||
properties:
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.csv
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: LocalizationTable
|
||||
properties:
|
||||
|
||||
@@ -17,7 +17,8 @@ metadata:
|
||||
- /foo/init.client.lua
|
||||
- /foo/init.client.luau
|
||||
- /foo/init.csv
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
|
||||
@@ -17,7 +17,8 @@ metadata:
|
||||
- /foo/init.client.lua
|
||||
- /foo/init.client.luau
|
||||
- /foo/init.csv
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
@@ -37,7 +38,8 @@ children:
|
||||
- /foo/Child/init.client.lua
|
||||
- /foo/Child/init.client.luau
|
||||
- /foo/Child/init.csv
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: Child
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.json
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo.model.json
|
||||
relevant_paths:
|
||||
- /foo.model.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: IntValue
|
||||
properties:
|
||||
@@ -20,7 +21,8 @@ children:
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
relevant_paths: []
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: The Child
|
||||
class_name: StringValue
|
||||
properties: {}
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo.model.json
|
||||
relevant_paths:
|
||||
- /foo.model.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: IntValue
|
||||
properties:
|
||||
@@ -20,7 +21,8 @@ children:
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
relevant_paths: []
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: The Child
|
||||
class_name: StringValue
|
||||
properties: {}
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.client.lua
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: LocalScript
|
||||
properties:
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.lua
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.lua
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
@@ -10,12 +10,15 @@ metadata:
|
||||
relevant_paths:
|
||||
- /bar.server.lua
|
||||
- /bar.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: bar
|
||||
class_name: Script
|
||||
properties:
|
||||
Disabled:
|
||||
Bool: true
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
@@ -10,10 +10,13 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.server.lua
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
@@ -10,10 +10,13 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.server.lua
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
@@ -13,7 +13,8 @@ metadata:
|
||||
- /root/init.lua
|
||||
- /root/init.server.lua
|
||||
- /root/init.client.lua
|
||||
context: {}
|
||||
context:
|
||||
script_type: Class
|
||||
name: root
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.client.lua
|
||||
relevant_paths:
|
||||
- /foo.client.lua
|
||||
- /foo.meta.json
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 2
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.lua
|
||||
relevant_paths:
|
||||
- /foo.lua
|
||||
- /foo.meta.json
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: true
|
||||
instigating_source:
|
||||
Path: /foo.lua
|
||||
relevant_paths:
|
||||
- /foo.lua
|
||||
- /foo.meta.json
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /bar.server.lua
|
||||
relevant_paths:
|
||||
- /bar.server.lua
|
||||
- /bar.meta.json
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
name: bar
|
||||
class_name: Script
|
||||
properties:
|
||||
Disabled:
|
||||
Bool: true
|
||||
RunContext:
|
||||
Enum: 1
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: true
|
||||
instigating_source:
|
||||
Path: /foo.server.lua
|
||||
relevant_paths:
|
||||
- /foo.server.lua
|
||||
- /foo.meta.json
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 1
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.server.lua
|
||||
relevant_paths:
|
||||
- /foo.server.lua
|
||||
- /foo.meta.json
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 1
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo/hello.project.json
|
||||
relevant_paths:
|
||||
- /foo/hello.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: direct-project
|
||||
class_name: Model
|
||||
properties: {}
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo/default.project.json
|
||||
relevant_paths:
|
||||
- /foo/default.project.json
|
||||
context: {}
|
||||
context:
|
||||
script_type: Class
|
||||
name: indirect-project
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo/other.project.json
|
||||
- /foo/default.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: path-property-override
|
||||
class_name: StringValue
|
||||
properties:
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo.project.json
|
||||
relevant_paths:
|
||||
- /foo.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: children
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
@@ -24,7 +25,8 @@ children:
|
||||
- $className: Model
|
||||
- Folder
|
||||
relevant_paths: []
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: Child
|
||||
class_name: Model
|
||||
properties: {}
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo/other.project.json
|
||||
- /foo/default.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: path-project
|
||||
class_name: Model
|
||||
properties: {}
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo/other.project.json
|
||||
- /foo/default.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: path-child-project
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
@@ -25,7 +26,8 @@ children:
|
||||
- $className: Model
|
||||
- Folder
|
||||
relevant_paths: []
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: SomeChild
|
||||
class_name: Model
|
||||
properties: {}
|
||||
|
||||
@@ -11,7 +11,8 @@ metadata:
|
||||
- /foo/other.txt
|
||||
- /foo/other.meta.json
|
||||
- /foo/default.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: path-project
|
||||
class_name: StringValue
|
||||
properties:
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo.project.json
|
||||
relevant_paths:
|
||||
- /foo.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: resolved-properties
|
||||
class_name: StringValue
|
||||
properties:
|
||||
|
||||
@@ -9,7 +9,8 @@ metadata:
|
||||
Path: /foo.project.json
|
||||
relevant_paths:
|
||||
- /foo.project.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: unresolved-properties
|
||||
class_name: StringValue
|
||||
properties:
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.toml
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
|
||||
@@ -10,7 +10,8 @@ metadata:
|
||||
relevant_paths:
|
||||
- /foo.txt
|
||||
- /foo.meta.json
|
||||
context: {}
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
name: foo
|
||||
class_name: StringValue
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user