mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
RunContext refactor + sync updates
This commit is contained in:
parent
c7cddb72c2
commit
d3cc11659a
79 changed files with 1415 additions and 626 deletions
|
|
@ -383,7 +383,7 @@ Ack,Ack!,,An exclamation of despair,¡Ay!"#,
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_csv_init(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/root/init.csv"),
|
||||
"root",
|
||||
|
|
@ -421,7 +421,7 @@ Ack,Ack!,,An exclamation of despair,¡Ay!"#,
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_csv_init(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/root/init.csv"),
|
||||
"root",
|
||||
|
|
|
|||
|
|
@ -21,14 +21,12 @@ use super::{
|
|||
|
||||
#[derive(Debug)]
|
||||
pub enum ScriptType {
|
||||
Server,
|
||||
Client,
|
||||
Module,
|
||||
Plugin,
|
||||
LegacyServer,
|
||||
LegacyClient,
|
||||
RunContextServer,
|
||||
RunContextClient,
|
||||
Server, // Script + RunContext.Server
|
||||
Client, // Script + RunContext.Client
|
||||
Module, // ModuleScript
|
||||
Plugin, // Script + RunContext.Plugin
|
||||
Legacy, // Script + RunContext.Legacy
|
||||
Local, // LocalScript
|
||||
}
|
||||
|
||||
/// Core routine for turning Lua files into snapshots.
|
||||
|
|
@ -47,26 +45,12 @@ pub fn snapshot_lua(
|
|||
.items;
|
||||
|
||||
let (class_name, run_context) = match script_type {
|
||||
ScriptType::Server => {
|
||||
if context.emit_legacy_scripts {
|
||||
("Script", run_context_enums.get("Legacy"))
|
||||
} else {
|
||||
("Script", run_context_enums.get("Server"))
|
||||
}
|
||||
}
|
||||
ScriptType::Client => {
|
||||
if context.emit_legacy_scripts {
|
||||
("LocalScript", None)
|
||||
} else {
|
||||
("Script", run_context_enums.get("Client"))
|
||||
}
|
||||
}
|
||||
ScriptType::Server => ("Script", run_context_enums.get("Server")),
|
||||
ScriptType::Client => ("Script", run_context_enums.get("Client")),
|
||||
ScriptType::Module => ("ModuleScript", None),
|
||||
ScriptType::Plugin => ("Script", run_context_enums.get("Plugin")),
|
||||
ScriptType::LegacyServer => ("Script", run_context_enums.get("Legacy")),
|
||||
ScriptType::LegacyClient => ("LocalScript", None),
|
||||
ScriptType::RunContextServer => ("Script", run_context_enums.get("Server")),
|
||||
ScriptType::RunContextClient => ("Script", run_context_enums.get("Client")),
|
||||
ScriptType::Legacy => ("Script", run_context_enums.get("Legacy")),
|
||||
ScriptType::Local => ("LocalScript", None),
|
||||
};
|
||||
|
||||
let contents = vfs.read_to_string_lf_normalized(path)?;
|
||||
|
|
@ -101,8 +85,9 @@ pub fn snapshot_lua(
|
|||
/// Attempts to snapshot an 'init' Lua script contained inside of a folder with
|
||||
/// the given name.
|
||||
///
|
||||
/// Scripts named `init.lua`, `init.server.lua`, or `init.client.lua` usurp
|
||||
/// their parents, which acts similarly to `__init__.py` from the Python world.
|
||||
/// Scripts named `init.lua`, `init.server.lua`, `init.client.lua`, `init.local.lua`,
|
||||
/// `init.legacy.lua`, or `init.plugin.lua` usurp their parents, which acts similarly
|
||||
/// to `__init__.py` from the Python world.
|
||||
pub fn snapshot_lua_init(
|
||||
context: &InstanceContext,
|
||||
vfs: &Vfs,
|
||||
|
|
@ -115,9 +100,8 @@ pub fn snapshot_lua_init(
|
|||
|
||||
if dir_snapshot.class_name != "Folder" {
|
||||
anyhow::bail!(
|
||||
"init.lua, init.server.lua, and init.client.lua can \
|
||||
only be used if the instance produced by the containing \
|
||||
directory would be a Folder.\n\
|
||||
"init scripts can only be used if the instance produced by the \
|
||||
containing directory would be a Folder.\n\
|
||||
\n\
|
||||
The directory {} turned into an instance of class {}.",
|
||||
folder_path.display(),
|
||||
|
|
@ -177,6 +161,8 @@ pub fn syncback_lua<'sync>(
|
|||
.strip_suffix(".server")
|
||||
.or_else(|| file_stem.strip_suffix(".client"))
|
||||
.or_else(|| file_stem.strip_suffix(".plugin"))
|
||||
.or_else(|| file_stem.strip_suffix(".local"))
|
||||
.or_else(|| file_stem.strip_suffix(".legacy"))
|
||||
.unwrap_or(file_stem);
|
||||
let meta_name = if meta_name.is_empty() {
|
||||
if snapshot.encode_windows_invalid_chars() {
|
||||
|
|
@ -211,7 +197,9 @@ pub fn syncback_lua_init<'sync>(
|
|||
ScriptType::Server => "init.server.luau",
|
||||
ScriptType::Client => "init.client.luau",
|
||||
ScriptType::Module => "init.luau",
|
||||
_ => anyhow::bail!("syncback is not yet implemented for {script_type:?}"),
|
||||
ScriptType::Plugin => "init.plugin.luau",
|
||||
ScriptType::Legacy => "init.legacy.luau",
|
||||
ScriptType::Local => "init.local.luau",
|
||||
});
|
||||
|
||||
let contents = if let Some(Variant::String(source)) = new_inst.properties.get(&ustr("Source")) {
|
||||
|
|
@ -248,7 +236,7 @@ mod test {
|
|||
use memofs::{InMemoryFs, VfsSnapshot};
|
||||
|
||||
#[test]
|
||||
fn class_module_from_vfs() {
|
||||
fn module_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -256,7 +244,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.lua"),
|
||||
"foo",
|
||||
|
|
@ -271,30 +259,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn runcontext_module_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&vfs,
|
||||
Path::new("/foo.lua"),
|
||||
"foo",
|
||||
ScriptType::Module,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
insta::with_settings!({ sort_maps => true }, {
|
||||
insta::assert_yaml_snapshot!(instance_snapshot);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_module_from_vfs() {
|
||||
fn plugin_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.plugin.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -302,7 +267,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.plugin.lua"),
|
||||
"foo",
|
||||
|
|
@ -317,7 +282,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn class_server_from_vfs() {
|
||||
fn server_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.server.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -325,7 +290,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.server.lua"),
|
||||
"foo",
|
||||
|
|
@ -340,30 +305,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn runcontext_server_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.server.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&vfs,
|
||||
Path::new("/foo.server.lua"),
|
||||
"foo",
|
||||
ScriptType::Server,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
insta::with_settings!({ sort_maps => true }, {
|
||||
insta::assert_yaml_snapshot!(instance_snapshot);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn class_client_from_vfs() {
|
||||
fn client_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.client.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -371,7 +313,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.client.lua"),
|
||||
"foo",
|
||||
|
|
@ -386,19 +328,42 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn runcontext_client_from_vfs() {
|
||||
fn local_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.client.lua", VfsSnapshot::file("Hello there!"))
|
||||
imfs.load_snapshot("/foo.local.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.client.lua"),
|
||||
Path::new("/foo.local.lua"),
|
||||
"foo",
|
||||
ScriptType::Client,
|
||||
ScriptType::Local,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
insta::with_settings!({ sort_maps => true }, {
|
||||
insta::assert_yaml_snapshot!(instance_snapshot);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn legacy_from_vfs() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.legacy.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.legacy.lua"),
|
||||
"foo",
|
||||
ScriptType::Legacy,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
|
@ -420,7 +385,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua_init(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/root/init.lua"),
|
||||
"root",
|
||||
|
|
@ -452,7 +417,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua_init(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/root/init.lua"),
|
||||
"root",
|
||||
|
|
@ -467,7 +432,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn class_module_with_meta() {
|
||||
fn module_with_meta() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -486,7 +451,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.lua"),
|
||||
"foo",
|
||||
|
|
@ -501,41 +466,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn runcontext_module_with_meta() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
imfs.load_snapshot(
|
||||
"/foo.meta.json",
|
||||
VfsSnapshot::file(
|
||||
r#"
|
||||
{
|
||||
"ignoreUnknownInstances": true
|
||||
}
|
||||
"#,
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&vfs,
|
||||
Path::new("/foo.lua"),
|
||||
"foo",
|
||||
ScriptType::Module,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
insta::with_settings!({ sort_maps => true }, {
|
||||
insta::assert_yaml_snapshot!(instance_snapshot);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn class_script_with_meta() {
|
||||
fn server_with_meta() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.server.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -554,7 +485,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/foo.server.lua"),
|
||||
"foo",
|
||||
|
|
@ -569,41 +500,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn runcontext_script_with_meta() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/foo.server.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
imfs.load_snapshot(
|
||||
"/foo.meta.json",
|
||||
VfsSnapshot::file(
|
||||
r#"
|
||||
{
|
||||
"ignoreUnknownInstances": true
|
||||
}
|
||||
"#,
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&vfs,
|
||||
Path::new("/foo.server.lua"),
|
||||
"foo",
|
||||
ScriptType::Server,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
insta::with_settings!({ sort_maps => true }, {
|
||||
insta::assert_yaml_snapshot!(instance_snapshot);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn class_script_disabled() {
|
||||
fn server_disabled() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/bar.server.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
|
|
@ -624,43 +521,7 @@ mod test {
|
|||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(true)),
|
||||
&vfs,
|
||||
Path::new("/bar.server.lua"),
|
||||
"bar",
|
||||
ScriptType::Server,
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
insta::with_settings!({ sort_maps => true }, {
|
||||
insta::assert_yaml_snapshot!(instance_snapshot);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runcontext_script_disabled() {
|
||||
let mut imfs = InMemoryFs::new();
|
||||
imfs.load_snapshot("/bar.server.lua", VfsSnapshot::file("Hello there!"))
|
||||
.unwrap();
|
||||
imfs.load_snapshot(
|
||||
"/bar.meta.json",
|
||||
VfsSnapshot::file(
|
||||
r#"
|
||||
{
|
||||
"properties": {
|
||||
"Disabled": true
|
||||
}
|
||||
}
|
||||
"#,
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let vfs = Vfs::new(imfs);
|
||||
|
||||
let instance_snapshot = snapshot_lua(
|
||||
&InstanceContext::with_emit_legacy_scripts(Some(false)),
|
||||
&InstanceContext::new(),
|
||||
&vfs,
|
||||
Path::new("/bar.server.lua"),
|
||||
"bar",
|
||||
|
|
|
|||
|
|
@ -55,13 +55,14 @@ impl AdjacentMetadata {
|
|||
// Use the file stem from the actual path (which has encoded chars)
|
||||
// rather than the decoded name, so meta files are found correctly
|
||||
// when encodeWindowsInvalidChars is enabled.
|
||||
// Strip known script type suffixes (.server, .client, .plugin) to get
|
||||
// the base name for the meta file.
|
||||
// Strip known script type suffixes to get the base name for the meta file.
|
||||
let file_stem = path.file_stem().and_then(|s| s.to_str()).unwrap_or("");
|
||||
let base_name = file_stem
|
||||
.strip_suffix(".server")
|
||||
.or_else(|| file_stem.strip_suffix(".client"))
|
||||
.or_else(|| file_stem.strip_suffix(".plugin"))
|
||||
.or_else(|| file_stem.strip_suffix(".local"))
|
||||
.or_else(|| file_stem.strip_suffix(".legacy"))
|
||||
.unwrap_or(file_stem);
|
||||
let meta_path_json = path.with_file_name(format!("{base_name}.meta.json"));
|
||||
let meta_path_jsonc = path.with_file_name(format!("{base_name}.meta.jsonc"));
|
||||
|
|
|
|||
|
|
@ -53,10 +53,7 @@ use self::{
|
|||
yaml::snapshot_yaml,
|
||||
};
|
||||
|
||||
pub use self::{
|
||||
lua::ScriptType, project::snapshot_project_node, util::emit_legacy_scripts_default,
|
||||
util::PathExt,
|
||||
};
|
||||
pub use self::{lua::ScriptType, project::snapshot_project_node, util::PathExt};
|
||||
|
||||
/// Returns an `InstanceSnapshot` for the provided path.
|
||||
/// This will inspect the path and find the appropriate middleware for it,
|
||||
|
|
@ -98,6 +95,7 @@ pub fn snapshot_from_vfs(
|
|||
// TODO: Is this even necessary anymore?
|
||||
match file_name {
|
||||
"init.server.luau" | "init.server.lua" | "init.client.luau" | "init.client.lua"
|
||||
| "init.local.luau" | "init.local.lua" | "init.legacy.luau" | "init.legacy.lua"
|
||||
| "init.luau" | "init.lua" | "init.csv" => return Ok(None),
|
||||
_ => {}
|
||||
}
|
||||
|
|
@ -131,6 +129,10 @@ fn get_dir_middleware<'path>(
|
|||
(Middleware::ServerScriptDir, "init.server.lua"),
|
||||
(Middleware::ClientScriptDir, "init.client.luau"),
|
||||
(Middleware::ClientScriptDir, "init.client.lua"),
|
||||
(Middleware::LocalScriptDir, "init.local.luau"),
|
||||
(Middleware::LocalScriptDir, "init.local.lua"),
|
||||
(Middleware::LegacyScriptDir, "init.legacy.luau"),
|
||||
(Middleware::LegacyScriptDir, "init.legacy.lua"),
|
||||
(Middleware::CsvDir, "init.csv"),
|
||||
]
|
||||
});
|
||||
|
|
@ -197,10 +199,8 @@ pub enum Middleware {
|
|||
ClientScript,
|
||||
ModuleScript,
|
||||
PluginScript,
|
||||
LegacyClientScript,
|
||||
LegacyServerScript,
|
||||
RunContextServerScript,
|
||||
RunContextClientScript,
|
||||
LocalScript,
|
||||
LegacyScript,
|
||||
Project,
|
||||
Rbxm,
|
||||
Rbxmx,
|
||||
|
|
@ -218,6 +218,10 @@ pub enum Middleware {
|
|||
#[serde(skip_deserializing)]
|
||||
ModuleScriptDir,
|
||||
#[serde(skip_deserializing)]
|
||||
LocalScriptDir,
|
||||
#[serde(skip_deserializing)]
|
||||
LegacyScriptDir,
|
||||
#[serde(skip_deserializing)]
|
||||
CsvDir,
|
||||
}
|
||||
|
||||
|
|
@ -239,18 +243,8 @@ impl Middleware {
|
|||
Self::ClientScript => snapshot_lua(context, vfs, path, name, ScriptType::Client),
|
||||
Self::ModuleScript => snapshot_lua(context, vfs, path, name, ScriptType::Module),
|
||||
Self::PluginScript => snapshot_lua(context, vfs, path, name, ScriptType::Plugin),
|
||||
Self::LegacyClientScript => {
|
||||
snapshot_lua(context, vfs, path, name, ScriptType::LegacyClient)
|
||||
}
|
||||
Self::LegacyServerScript => {
|
||||
snapshot_lua(context, vfs, path, name, ScriptType::LegacyServer)
|
||||
}
|
||||
Self::RunContextClientScript => {
|
||||
snapshot_lua(context, vfs, path, name, ScriptType::RunContextClient)
|
||||
}
|
||||
Self::RunContextServerScript => {
|
||||
snapshot_lua(context, vfs, path, name, ScriptType::RunContextServer)
|
||||
}
|
||||
Self::LocalScript => snapshot_lua(context, vfs, path, name, ScriptType::Local),
|
||||
Self::LegacyScript => snapshot_lua(context, vfs, path, name, ScriptType::Legacy),
|
||||
Self::Project => snapshot_project(context, vfs, path, name),
|
||||
Self::Rbxm => snapshot_rbxm(context, vfs, path, name),
|
||||
Self::Rbxmx => snapshot_rbxmx(context, vfs, path, name),
|
||||
|
|
@ -269,6 +263,10 @@ impl Middleware {
|
|||
Self::ModuleScriptDir => {
|
||||
snapshot_lua_init(context, vfs, path, name, ScriptType::Module)
|
||||
}
|
||||
Self::LocalScriptDir => snapshot_lua_init(context, vfs, path, name, ScriptType::Local),
|
||||
Self::LegacyScriptDir => {
|
||||
snapshot_lua_init(context, vfs, path, name, ScriptType::Legacy)
|
||||
}
|
||||
Self::CsvDir => snapshot_csv_init(context, vfs, path, name),
|
||||
};
|
||||
if let Ok(Some(ref mut snapshot)) = output {
|
||||
|
|
@ -299,6 +297,9 @@ impl Middleware {
|
|||
Middleware::ServerScript => syncback_lua(snapshot),
|
||||
Middleware::ClientScript => syncback_lua(snapshot),
|
||||
Middleware::ModuleScript => syncback_lua(snapshot),
|
||||
Middleware::PluginScript => syncback_lua(snapshot),
|
||||
Middleware::LocalScript => syncback_lua(snapshot),
|
||||
Middleware::LegacyScript => syncback_lua(snapshot),
|
||||
Middleware::Rbxm => syncback_rbxm(snapshot),
|
||||
Middleware::Rbxmx => syncback_rbxmx(snapshot),
|
||||
Middleware::Toml => anyhow::bail!("cannot syncback Toml middleware"),
|
||||
|
|
@ -309,15 +310,9 @@ impl Middleware {
|
|||
Middleware::ServerScriptDir => syncback_lua_init(ScriptType::Server, snapshot),
|
||||
Middleware::ClientScriptDir => syncback_lua_init(ScriptType::Client, snapshot),
|
||||
Middleware::ModuleScriptDir => syncback_lua_init(ScriptType::Module, snapshot),
|
||||
Middleware::LocalScriptDir => syncback_lua_init(ScriptType::Local, snapshot),
|
||||
Middleware::LegacyScriptDir => syncback_lua_init(ScriptType::Legacy, snapshot),
|
||||
Middleware::CsvDir => syncback_csv_init(snapshot),
|
||||
|
||||
Middleware::PluginScript
|
||||
| Middleware::LegacyServerScript
|
||||
| Middleware::LegacyClientScript
|
||||
| Middleware::RunContextServerScript
|
||||
| Middleware::RunContextClientScript => {
|
||||
anyhow::bail!("syncback is not implemented for {self:?} yet")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -330,6 +325,8 @@ impl Middleware {
|
|||
| Middleware::ServerScriptDir
|
||||
| Middleware::ClientScriptDir
|
||||
| Middleware::ModuleScriptDir
|
||||
| Middleware::LocalScriptDir
|
||||
| Middleware::LegacyScriptDir
|
||||
| Middleware::CsvDir
|
||||
)
|
||||
}
|
||||
|
|
@ -427,6 +424,10 @@ pub fn default_sync_rules() -> &'static [SyncRule] {
|
|||
sync_rule!("*.client.luau", ClientScript, ".client.luau"),
|
||||
sync_rule!("*.plugin.lua", PluginScript, ".plugin.lua"),
|
||||
sync_rule!("*.plugin.luau", PluginScript, ".plugin.luau"),
|
||||
sync_rule!("*.legacy.lua", LegacyScript, ".legacy.lua"),
|
||||
sync_rule!("*.legacy.luau", LegacyScript, ".legacy.luau"),
|
||||
sync_rule!("*.local.lua", LocalScript, ".local.lua"),
|
||||
sync_rule!("*.local.luau", LocalScript, ".local.luau"),
|
||||
sync_rule!("*.{lua,luau}", ModuleScript),
|
||||
sync_rule!("*.project.json", Project, ".project.json"),
|
||||
sync_rule!("*.project.jsonc", Project, ".project.jsonc"),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ use crate::{
|
|||
RojoRef,
|
||||
};
|
||||
|
||||
use super::{emit_legacy_scripts_default, snapshot_from_vfs};
|
||||
use super::snapshot_from_vfs;
|
||||
|
||||
pub fn snapshot_project(
|
||||
context: &InstanceContext,
|
||||
|
|
@ -55,12 +55,6 @@ pub fn snapshot_project(
|
|||
|
||||
context.add_sync_rules(sync_rules);
|
||||
context.add_path_ignore_rules(rules);
|
||||
context.set_emit_legacy_scripts(
|
||||
project
|
||||
.emit_legacy_scripts
|
||||
.or_else(emit_legacy_scripts_default)
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
match snapshot_project_node(&context, path, project_name, &project.tree, vfs, None)? {
|
||||
Some(found_snapshot) => {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ metadata:
|
|||
- /root/init.meta.jsonc
|
||||
- /root/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ metadata:
|
|||
- /root/init.meta.jsonc
|
||||
- /root/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ metadata:
|
|||
- /foo/init.meta.jsonc
|
||||
- /foo/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ metadata:
|
|||
- /foo/init.meta.jsonc
|
||||
- /foo/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -47,8 +46,7 @@ children:
|
|||
- /foo/Child/init.meta.jsonc
|
||||
- /foo/Child/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: dir
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo.model.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -26,8 +25,7 @@ children:
|
|||
ignore_unknown_instances: false
|
||||
relevant_paths: []
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo.model.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -26,8 +25,7 @@ children:
|
|||
ignore_unknown_instances: false
|
||||
relevant_paths: []
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
---
|
||||
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
|
||||
- /bar.meta.jsonc
|
||||
- /bar.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
name: bar
|
||||
class_name: Script
|
||||
properties:
|
||||
Disabled:
|
||||
Bool: true
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
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
|
||||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -20,8 +20,7 @@ metadata:
|
|||
- /root/init.meta.jsonc
|
||||
- /root/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ metadata:
|
|||
- /root/init.meta.jsonc
|
||||
- /root/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@ snapshot_id: "00000000000000000000000000000000"
|
|||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.server.lua
|
||||
Path: /foo.legacy.lua
|
||||
relevant_paths:
|
||||
- /foo.server.lua
|
||||
- /foo.legacy.lua
|
||||
- /foo.meta.json
|
||||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -6,15 +6,14 @@ snapshot_id: "00000000000000000000000000000000"
|
|||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.client.lua
|
||||
Path: /foo.local.lua
|
||||
relevant_paths:
|
||||
- /foo.client.lua
|
||||
- /foo.local.lua
|
||||
- /foo.meta.json
|
||||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: "00000000000000000000000000000000"
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.plugin.lua
|
||||
relevant_paths:
|
||||
- /foo.plugin.lua
|
||||
- /foo.meta.json
|
||||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
name: foo
|
||||
class_name: Script
|
||||
properties:
|
||||
RunContext:
|
||||
Enum: 3
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
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
|
||||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
decode_windows_invalid_chars: false
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
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
|
||||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
decode_windows_invalid_chars: false
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
name: foo
|
||||
class_name: ModuleScript
|
||||
properties:
|
||||
Source:
|
||||
String: Hello there!
|
||||
children: []
|
||||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /bar.meta.jsonc
|
||||
- /bar.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: false
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
- /foo/bar.meta.jsonc
|
||||
- /foo/bar.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
- /foo/bar.meta.jsonc
|
||||
- /foo/bar.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
- /foo/init.meta.jsonc
|
||||
- /foo/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
- /foo/init.meta.jsonc
|
||||
- /foo/init.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo/default.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo/hello.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ metadata:
|
|||
- /foo/other.project.json
|
||||
- /foo/default.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: project
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
@ -31,8 +30,7 @@ children:
|
|||
parent_class: Folder
|
||||
relevant_paths: []
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ metadata:
|
|||
- /foo/other.project.json
|
||||
- /foo/default.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: project
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ metadata:
|
|||
- /foo/other.project.json
|
||||
- /foo/default.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: project
|
||||
schema: ~
|
||||
|
|
@ -32,8 +31,7 @@ children:
|
|||
parent_class: Folder
|
||||
relevant_paths: []
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ metadata:
|
|||
- /foo/other.meta.json5
|
||||
- /foo/default.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: text
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ metadata:
|
|||
relevant_paths:
|
||||
- /foo.project.json
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- foo.meta.jsonc
|
||||
- foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- /foo.meta.jsonc
|
||||
- /foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: ~
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ metadata:
|
|||
- foo.meta.jsonc
|
||||
- foo.meta.json5
|
||||
context:
|
||||
emit_legacy_scripts: true
|
||||
decode_windows_invalid_chars: false
|
||||
decode_windows_invalid_chars: true
|
||||
specified_id: manually specified
|
||||
middleware: ~
|
||||
schema: ~
|
||||
|
|
|
|||
|
|
@ -48,8 +48,3 @@ where
|
|||
.with_context(|| format!("Path does not have a parent: {}", path.display()))
|
||||
}
|
||||
}
|
||||
|
||||
// TEMP function until rojo 8.0, when it can be replaced with bool::default (aka false)
|
||||
pub fn emit_legacy_scripts_default() -> Option<bool> {
|
||||
Some(true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue