mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 06:35:39 +00:00
Require a Rojo project again (#307)
This commit is contained in:
committed by
GitHub
parent
691a8fcdeb
commit
f43777e37e
6
rojo-test/build-tests/deep_nesting/default.project.json
Normal file
6
rojo-test/build-tests/deep_nesting/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "deep_nesting",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "init_with_children",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
This is a bare text file with no project.
|
|
||||||
6
rojo-test/build-tests/rbxmx_ref/default.project.json
Normal file
6
rojo-test/build-tests/rbxmx_ref/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "rbxmx_ref",
|
||||||
|
"tree": {
|
||||||
|
"$path": "model.rbxmx"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
rojo-test/serve-tests/add_folder/default.project.json
Normal file
6
rojo-test/serve-tests/add_folder/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "add_folder",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
rojo-test/serve-tests/edit_init/default.project.json
Normal file
6
rojo-test/serve-tests/edit_init/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "edit_init",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
Hello, world!
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "move_folder_of_stuff",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
rojo-test/serve-tests/remove_file/default.project.json
Normal file
6
rojo-test/serve-tests/remove_file/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "remove_file",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
rojo-test/serve-tests/scripts/default.project.json
Normal file
6
rojo-test/serve-tests/scripts/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "scripts",
|
||||||
|
"tree": {
|
||||||
|
"$path": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,12 +35,12 @@ gen_build_tests! {
|
|||||||
json_model_legacy_name,
|
json_model_legacy_name,
|
||||||
module_in_folder,
|
module_in_folder,
|
||||||
module_init,
|
module_init,
|
||||||
plain_gitkeep,
|
|
||||||
rbxm_in_folder,
|
rbxm_in_folder,
|
||||||
rbxmx_in_folder,
|
rbxmx_in_folder,
|
||||||
script_meta_disabled,
|
script_meta_disabled,
|
||||||
server_in_folder,
|
server_in_folder,
|
||||||
server_init,
|
server_init,
|
||||||
|
rbxmx_ref,
|
||||||
txt,
|
txt,
|
||||||
txt_in_folder,
|
txt_in_folder,
|
||||||
}
|
}
|
||||||
@@ -52,16 +52,6 @@ gen_build_tests! {
|
|||||||
ignore_glob_spec,
|
ignore_glob_spec,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn build_plain_txt() {
|
|
||||||
run_build_test("plain.txt");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn build_rbxmx_ref() {
|
|
||||||
run_build_test("rbxmx_ref.rbxmx");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn run_build_test(test_name: &str) {
|
fn run_build_test(test_name: &str) {
|
||||||
let build_test_path = get_build_tests_path();
|
let build_test_path = get_build_tests_path();
|
||||||
let working_dir = get_working_dir_path();
|
let working_dir = get_working_dir_path();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ fn scripts() {
|
|||||||
read_response.intern_and_redact(&mut redactions, root_id)
|
read_response.intern_and_redact(&mut redactions, root_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
fs::write(session.path().join("foo.lua"), "Updated foo!").unwrap();
|
fs::write(session.path().join("src/foo.lua"), "Updated foo!").unwrap();
|
||||||
|
|
||||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||||
assert_yaml_snapshot!(
|
assert_yaml_snapshot!(
|
||||||
@@ -51,26 +51,6 @@ fn scripts() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn just_txt() {
|
|
||||||
run_serve_test("just_txt.txt", |session, mut redactions| {
|
|
||||||
let info = session.get_api_rojo().unwrap();
|
|
||||||
let root_id = info.root_instance_id;
|
|
||||||
|
|
||||||
assert_yaml_snapshot!("just_txt_info", redactions.redacted_yaml(info));
|
|
||||||
|
|
||||||
let read_response = session.get_api_read(root_id).unwrap();
|
|
||||||
assert_yaml_snapshot!(
|
|
||||||
"just_txt_all",
|
|
||||||
read_response.intern_and_redact(&mut redactions, root_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
fs::write(session.path(), "Changed content!").unwrap();
|
|
||||||
|
|
||||||
// TODO: Directly served files currently don't trigger changed events!
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn add_folder() {
|
fn add_folder() {
|
||||||
run_serve_test("add_folder", |session, mut redactions| {
|
run_serve_test("add_folder", |session, mut redactions| {
|
||||||
@@ -85,7 +65,7 @@ fn add_folder() {
|
|||||||
read_response.intern_and_redact(&mut redactions, root_id)
|
read_response.intern_and_redact(&mut redactions, root_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
fs::create_dir(session.path().join("my-new-folder")).unwrap();
|
fs::create_dir(session.path().join("src/my-new-folder")).unwrap();
|
||||||
|
|
||||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||||
assert_yaml_snapshot!(
|
assert_yaml_snapshot!(
|
||||||
@@ -115,7 +95,7 @@ fn remove_file() {
|
|||||||
read_response.intern_and_redact(&mut redactions, root_id)
|
read_response.intern_and_redact(&mut redactions, root_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
fs::remove_file(session.path().join("hello.txt")).unwrap();
|
fs::remove_file(session.path().join("src/hello.txt")).unwrap();
|
||||||
|
|
||||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||||
assert_yaml_snapshot!(
|
assert_yaml_snapshot!(
|
||||||
@@ -145,7 +125,7 @@ fn edit_init() {
|
|||||||
read_response.intern_and_redact(&mut redactions, root_id)
|
read_response.intern_and_redact(&mut redactions, root_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
fs::write(session.path().join("init.lua"), b"-- Edited contents").unwrap();
|
fs::write(session.path().join("src/init.lua"), b"-- Edited contents").unwrap();
|
||||||
|
|
||||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||||
assert_yaml_snapshot!(
|
assert_yaml_snapshot!(
|
||||||
@@ -191,7 +171,7 @@ fn move_folder_of_stuff() {
|
|||||||
|
|
||||||
// We're hoping that this rename gets picked up as one event. This test
|
// We're hoping that this rename gets picked up as one event. This test
|
||||||
// will fail otherwise.
|
// will fail otherwise.
|
||||||
fs::rename(stuff_path, session.path().join("new-stuff")).unwrap();
|
fs::rename(stuff_path, session.path().join("src/new-stuff")).unwrap();
|
||||||
|
|
||||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||||
assert_yaml_snapshot!(
|
assert_yaml_snapshot!(
|
||||||
|
|||||||
@@ -47,15 +47,12 @@ pub struct ServeSession {
|
|||||||
/// diagnostics.
|
/// diagnostics.
|
||||||
start_time: Instant,
|
start_time: Instant,
|
||||||
|
|
||||||
/// The root project for the serve session, if there was one defined.
|
/// The root project for the serve session.
|
||||||
///
|
///
|
||||||
/// This will be defined if a folder with a `default.project.json` file was
|
/// This will be defined if a folder with a `default.project.json` file was
|
||||||
/// used for starting the serve session, or if the user specified a full
|
/// used for starting the serve session, or if the user specified a full
|
||||||
/// path to a `.project.json` file.
|
/// path to a `.project.json` file.
|
||||||
///
|
root_project: Project,
|
||||||
/// If `root_project` is None, values from the project should be treated as
|
|
||||||
/// their defaults.
|
|
||||||
root_project: Option<Project>,
|
|
||||||
|
|
||||||
/// A randomly generated ID for this serve session. It's used to ensure that
|
/// A randomly generated ID for this serve session. It's used to ensure that
|
||||||
/// a client doesn't begin connecting to a different server part way through
|
/// a client doesn't begin connecting to a different server part way through
|
||||||
@@ -103,7 +100,9 @@ impl ServeSession {
|
|||||||
log::trace!("Starting new ServeSession at path {}", start_path.display());
|
log::trace!("Starting new ServeSession at path {}", start_path.display());
|
||||||
|
|
||||||
log::trace!("Loading project file from {}", start_path.display());
|
log::trace!("Loading project file from {}", start_path.display());
|
||||||
let root_project = Project::load_fuzzy(start_path).expect("TODO: Project load failed");
|
let root_project = Project::load_fuzzy(start_path)
|
||||||
|
.expect("TODO: Project load failed")
|
||||||
|
.expect("TODO: No project was found.");
|
||||||
|
|
||||||
let mut tree = RojoTree::new(InstancePropertiesWithMeta {
|
let mut tree = RojoTree::new(InstancePropertiesWithMeta {
|
||||||
properties: RbxInstanceProperties {
|
properties: RbxInstanceProperties {
|
||||||
@@ -118,14 +117,15 @@ impl ServeSession {
|
|||||||
|
|
||||||
let mut instance_context = InstanceContext::default();
|
let mut instance_context = InstanceContext::default();
|
||||||
|
|
||||||
if let Some(project) = &root_project {
|
let rules = root_project
|
||||||
let rules = project.glob_ignore_paths.iter().map(|glob| PathIgnoreRule {
|
.glob_ignore_paths
|
||||||
|
.iter()
|
||||||
|
.map(|glob| PathIgnoreRule {
|
||||||
glob: glob.clone(),
|
glob: glob.clone(),
|
||||||
base_path: project.folder_location().to_path_buf(),
|
base_path: root_project.folder_location().to_path_buf(),
|
||||||
});
|
});
|
||||||
|
|
||||||
instance_context.add_path_ignore_rules(rules);
|
instance_context.add_path_ignore_rules(rules);
|
||||||
}
|
|
||||||
|
|
||||||
log::trace!("Generating snapshot of instances from VFS");
|
log::trace!("Generating snapshot of instances from VFS");
|
||||||
let snapshot = snapshot_from_vfs(&instance_context, &vfs, &start_path)
|
let snapshot = snapshot_from_vfs(&instance_context, &vfs, &start_path)
|
||||||
@@ -194,16 +194,12 @@ impl ServeSession {
|
|||||||
self.session_id
|
self.session_id
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn project_name(&self) -> Option<&str> {
|
pub fn project_name(&self) -> &str {
|
||||||
self.root_project
|
&self.root_project.name
|
||||||
.as_ref()
|
|
||||||
.map(|project| project.name.as_str())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn project_port(&self) -> Option<u16> {
|
pub fn project_port(&self) -> Option<u16> {
|
||||||
self.root_project
|
self.root_project.serve_port
|
||||||
.as_ref()
|
|
||||||
.and_then(|project| project.serve_port)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start_time(&self) -> Instant {
|
pub fn start_time(&self) -> Instant {
|
||||||
@@ -211,217 +207,6 @@ impl ServeSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn serve_place_ids(&self) -> Option<&HashSet<u64>> {
|
pub fn serve_place_ids(&self) -> Option<&HashSet<u64>> {
|
||||||
self.root_project
|
self.root_project.serve_place_ids.as_ref()
|
||||||
.as_ref()
|
|
||||||
.and_then(|project| project.serve_place_ids.as_ref())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This module is named to trick Insta into naming the resulting snapshots
|
|
||||||
/// correctly.
|
|
||||||
///
|
|
||||||
/// See https://github.com/mitsuhiko/insta/issues/78
|
|
||||||
#[cfg(test)]
|
|
||||||
mod serve_session {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
use std::{path::PathBuf, time::Duration};
|
|
||||||
|
|
||||||
use maplit::hashmap;
|
|
||||||
use memofs::{InMemoryFs, VfsEvent, VfsSnapshot};
|
|
||||||
use rojo_insta_ext::RedactionMap;
|
|
||||||
use tokio::{runtime::Runtime, timer::Timeout};
|
|
||||||
|
|
||||||
use crate::tree_view::view_tree;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn just_folder() {
|
|
||||||
let mut imfs = InMemoryFs::new();
|
|
||||||
imfs.load_snapshot("/foo", VfsSnapshot::empty_dir())
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let vfs = Vfs::new(imfs);
|
|
||||||
|
|
||||||
let session = ServeSession::new(vfs, "/foo");
|
|
||||||
|
|
||||||
let mut rm = RedactionMap::new();
|
|
||||||
insta::assert_yaml_snapshot!(view_tree(&session.tree(), &mut rm));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn project_with_folder() {
|
|
||||||
let mut imfs = InMemoryFs::new();
|
|
||||||
imfs.load_snapshot(
|
|
||||||
"/foo",
|
|
||||||
VfsSnapshot::dir(hashmap! {
|
|
||||||
"default.project.json" => VfsSnapshot::file(r#"
|
|
||||||
{
|
|
||||||
"name": "HelloWorld",
|
|
||||||
"tree": {
|
|
||||||
"$path": "src"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"#),
|
|
||||||
"src" => VfsSnapshot::dir(hashmap! {
|
|
||||||
"hello.txt" => VfsSnapshot::file("Hello, world!"),
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let vfs = Vfs::new(imfs);
|
|
||||||
|
|
||||||
let session = ServeSession::new(vfs, "/foo");
|
|
||||||
|
|
||||||
let mut rm = RedactionMap::new();
|
|
||||||
insta::assert_yaml_snapshot!(view_tree(&session.tree(), &mut rm));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn script_with_meta() {
|
|
||||||
let mut imfs = InMemoryFs::new();
|
|
||||||
imfs.load_snapshot(
|
|
||||||
"/root",
|
|
||||||
VfsSnapshot::dir(hashmap! {
|
|
||||||
"test.lua" => VfsSnapshot::file("This is a test."),
|
|
||||||
"test.meta.json" => VfsSnapshot::file(r#"{ "ignoreUnknownInstances": true }"#),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let vfs = Vfs::new(imfs);
|
|
||||||
|
|
||||||
let session = ServeSession::new(vfs, "/root");
|
|
||||||
|
|
||||||
let mut rm = RedactionMap::new();
|
|
||||||
insta::assert_yaml_snapshot!(view_tree(&session.tree(), &mut rm));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn change_txt_file() {
|
|
||||||
let mut imfs = InMemoryFs::new();
|
|
||||||
imfs.load_snapshot("/foo.txt", VfsSnapshot::file("Hello!"))
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let vfs = Vfs::new(imfs.clone());
|
|
||||||
|
|
||||||
let session = ServeSession::new(vfs, "/foo.txt");
|
|
||||||
|
|
||||||
let mut rm = RedactionMap::new();
|
|
||||||
insta::assert_yaml_snapshot!(
|
|
||||||
"change_txt_file_before",
|
|
||||||
view_tree(&session.tree(), &mut rm)
|
|
||||||
);
|
|
||||||
|
|
||||||
imfs.load_snapshot("/foo.txt", VfsSnapshot::file("World!"))
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let receiver = session.message_queue().subscribe_any();
|
|
||||||
|
|
||||||
imfs.raise_event(VfsEvent::Write(PathBuf::from("/foo.txt")));
|
|
||||||
|
|
||||||
let receiver = Timeout::new(receiver, Duration::from_millis(200));
|
|
||||||
|
|
||||||
let mut rt = Runtime::new().unwrap();
|
|
||||||
let result = rt.block_on(receiver).unwrap();
|
|
||||||
|
|
||||||
insta::assert_yaml_snapshot!("change_txt_file_patch", rm.redacted_yaml(result));
|
|
||||||
insta::assert_yaml_snapshot!("change_txt_file_after", view_tree(&session.tree(), &mut rm));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn change_script_meta() {
|
|
||||||
let mut imfs = InMemoryFs::new();
|
|
||||||
imfs.load_snapshot(
|
|
||||||
"/root",
|
|
||||||
VfsSnapshot::dir(hashmap! {
|
|
||||||
"test.lua" => VfsSnapshot::file("This is a test."),
|
|
||||||
"test.meta.json" => VfsSnapshot::file(r#"{ "ignoreUnknownInstances": true }"#),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let vfs = Vfs::new(imfs.clone());
|
|
||||||
|
|
||||||
let session = ServeSession::new(vfs, "/root");
|
|
||||||
|
|
||||||
let mut rm = RedactionMap::new();
|
|
||||||
insta::assert_yaml_snapshot!(
|
|
||||||
"change_script_meta_before",
|
|
||||||
view_tree(&session.tree(), &mut rm)
|
|
||||||
);
|
|
||||||
|
|
||||||
imfs.load_snapshot(
|
|
||||||
"/root/test.meta.json",
|
|
||||||
VfsSnapshot::file(r#"{ "ignoreUnknownInstances": false }"#),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let receiver = session.message_queue().subscribe_any();
|
|
||||||
|
|
||||||
imfs.raise_event(VfsEvent::Write(PathBuf::from("/root/test.meta.json")));
|
|
||||||
|
|
||||||
let receiver = Timeout::new(receiver, Duration::from_millis(200));
|
|
||||||
|
|
||||||
let mut rt = Runtime::new().unwrap();
|
|
||||||
let result = rt.block_on(receiver).unwrap();
|
|
||||||
|
|
||||||
insta::assert_yaml_snapshot!("change_script_meta_patch", rm.redacted_yaml(result));
|
|
||||||
insta::assert_yaml_snapshot!(
|
|
||||||
"change_script_meta_after",
|
|
||||||
view_tree(&session.tree(), &mut rm)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn change_file_in_project() {
|
|
||||||
let mut imfs = InMemoryFs::new();
|
|
||||||
imfs.load_snapshot(
|
|
||||||
"/foo",
|
|
||||||
VfsSnapshot::dir(hashmap! {
|
|
||||||
"default.project.json" => VfsSnapshot::file(r#"
|
|
||||||
{
|
|
||||||
"name": "change_file_in_project",
|
|
||||||
"tree": {
|
|
||||||
"$className": "Folder",
|
|
||||||
|
|
||||||
"Child": {
|
|
||||||
"$path": "file.txt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"#),
|
|
||||||
"file.txt" => VfsSnapshot::file("initial content"),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let vfs = Vfs::new(imfs.clone());
|
|
||||||
|
|
||||||
let session = ServeSession::new(vfs, "/foo");
|
|
||||||
|
|
||||||
let mut rm = RedactionMap::new();
|
|
||||||
insta::assert_yaml_snapshot!(
|
|
||||||
"change_file_in_project_before",
|
|
||||||
view_tree(&session.tree(), &mut rm)
|
|
||||||
);
|
|
||||||
|
|
||||||
imfs.load_snapshot("/foo/file.txt", VfsSnapshot::file("Changed!"))
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let receiver = session.message_queue().subscribe_any();
|
|
||||||
|
|
||||||
imfs.raise_event(VfsEvent::Write(PathBuf::from("/foo/file.txt")));
|
|
||||||
|
|
||||||
let receiver = Timeout::new(receiver, Duration::from_millis(200));
|
|
||||||
|
|
||||||
let mut rt = Runtime::new().unwrap();
|
|
||||||
let result = rt.block_on(receiver).unwrap();
|
|
||||||
|
|
||||||
insta::assert_yaml_snapshot!("change_file_in_project_patch", rm.redacted_yaml(result));
|
|
||||||
insta::assert_yaml_snapshot!(
|
|
||||||
"change_file_in_project_after",
|
|
||||||
view_tree(&session.tree(), &mut rm)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut redactions)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: change_file_in_project
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: true
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo/default.project.json
|
|
||||||
relevant_paths:
|
|
||||||
- /foo/default.project.json
|
|
||||||
context: {}
|
|
||||||
children:
|
|
||||||
- id: id-2
|
|
||||||
name: Child
|
|
||||||
class_name: StringValue
|
|
||||||
properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: Changed!
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
ProjectNode:
|
|
||||||
- /foo
|
|
||||||
- Child
|
|
||||||
- $path: file.txt
|
|
||||||
relevant_paths:
|
|
||||||
- /foo/file.txt
|
|
||||||
- /foo/file.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut redactions)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: change_file_in_project
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: true
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo/default.project.json
|
|
||||||
relevant_paths:
|
|
||||||
- /foo/default.project.json
|
|
||||||
context: {}
|
|
||||||
children:
|
|
||||||
- id: id-2
|
|
||||||
name: Child
|
|
||||||
class_name: StringValue
|
|
||||||
properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: initial content
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
ProjectNode:
|
|
||||||
- /foo
|
|
||||||
- Child
|
|
||||||
- $path: file.txt
|
|
||||||
relevant_paths:
|
|
||||||
- /foo/file.txt
|
|
||||||
- /foo/file.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: redactions.redacted_yaml(result)
|
|
||||||
---
|
|
||||||
- 1
|
|
||||||
- - removed: []
|
|
||||||
added: []
|
|
||||||
updated:
|
|
||||||
- id: id-2
|
|
||||||
changed_name: ~
|
|
||||||
changed_class_name: ~
|
|
||||||
changed_properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: Changed!
|
|
||||||
changed_metadata: ~
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut redactions)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: root
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /root
|
|
||||||
relevant_paths:
|
|
||||||
- /root
|
|
||||||
- /root/init.meta.json
|
|
||||||
- /root/init.lua
|
|
||||||
- /root/init.server.lua
|
|
||||||
- /root/init.client.lua
|
|
||||||
context: {}
|
|
||||||
children:
|
|
||||||
- id: id-2
|
|
||||||
name: test
|
|
||||||
class_name: ModuleScript
|
|
||||||
properties:
|
|
||||||
Source:
|
|
||||||
Type: String
|
|
||||||
Value: This is a test.
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /root/test.lua
|
|
||||||
relevant_paths:
|
|
||||||
- /root/test.lua
|
|
||||||
- /root/test.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut redactions)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: root
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /root
|
|
||||||
relevant_paths:
|
|
||||||
- /root
|
|
||||||
- /root/init.meta.json
|
|
||||||
- /root/init.lua
|
|
||||||
- /root/init.server.lua
|
|
||||||
- /root/init.client.lua
|
|
||||||
context: {}
|
|
||||||
children:
|
|
||||||
- id: id-2
|
|
||||||
name: test
|
|
||||||
class_name: ModuleScript
|
|
||||||
properties:
|
|
||||||
Source:
|
|
||||||
Type: String
|
|
||||||
Value: This is a test.
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: true
|
|
||||||
instigating_source:
|
|
||||||
Path: /root/test.lua
|
|
||||||
relevant_paths:
|
|
||||||
- /root/test.lua
|
|
||||||
- /root/test.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: redactions.redacted_yaml(changes)
|
|
||||||
---
|
|
||||||
- 1
|
|
||||||
- - removed: []
|
|
||||||
added: []
|
|
||||||
updated:
|
|
||||||
- id: id-2
|
|
||||||
changed_name: ~
|
|
||||||
changed_class_name: ~
|
|
||||||
changed_properties: {}
|
|
||||||
changed_metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /root/test.lua
|
|
||||||
relevant_paths:
|
|
||||||
- /root/test.lua
|
|
||||||
- /root/test.meta.json
|
|
||||||
context: {}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut redactions)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: foo
|
|
||||||
class_name: StringValue
|
|
||||||
properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: World!
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo.txt
|
|
||||||
relevant_paths:
|
|
||||||
- /foo.txt
|
|
||||||
- /foo.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut redactions)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: foo
|
|
||||||
class_name: StringValue
|
|
||||||
properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: Hello!
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo.txt
|
|
||||||
relevant_paths:
|
|
||||||
- /foo.txt
|
|
||||||
- /foo.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: redactions.redacted_yaml(result)
|
|
||||||
---
|
|
||||||
- 1
|
|
||||||
- - removed: []
|
|
||||||
added: []
|
|
||||||
updated:
|
|
||||||
- id: id-1
|
|
||||||
changed_name: ~
|
|
||||||
changed_class_name: ~
|
|
||||||
changed_properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: World!
|
|
||||||
changed_metadata: ~
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut rm)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: foo
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo
|
|
||||||
relevant_paths:
|
|
||||||
- /foo
|
|
||||||
- /foo/init.meta.json
|
|
||||||
- /foo/init.lua
|
|
||||||
- /foo/init.server.lua
|
|
||||||
- /foo/init.client.lua
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut rm)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: HelloWorld
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo/default.project.json
|
|
||||||
relevant_paths:
|
|
||||||
- /foo/src
|
|
||||||
- /foo/src/init.meta.json
|
|
||||||
- /foo/src/init.lua
|
|
||||||
- /foo/src/init.server.lua
|
|
||||||
- /foo/src/init.client.lua
|
|
||||||
- /foo/default.project.json
|
|
||||||
context: {}
|
|
||||||
children:
|
|
||||||
- id: id-2
|
|
||||||
name: hello
|
|
||||||
class_name: StringValue
|
|
||||||
properties:
|
|
||||||
Value:
|
|
||||||
Type: String
|
|
||||||
Value: "Hello, world!"
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /foo/src/hello.txt
|
|
||||||
relevant_paths:
|
|
||||||
- /foo/src/hello.txt
|
|
||||||
- /foo/src/hello.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
source: src/serve_session.rs
|
|
||||||
expression: "view_tree(&session.tree(), &mut rm)"
|
|
||||||
---
|
|
||||||
id: id-1
|
|
||||||
name: root
|
|
||||||
class_name: Folder
|
|
||||||
properties: {}
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: false
|
|
||||||
instigating_source:
|
|
||||||
Path: /root
|
|
||||||
relevant_paths:
|
|
||||||
- /root
|
|
||||||
- /root/init.meta.json
|
|
||||||
- /root/init.lua
|
|
||||||
- /root/init.server.lua
|
|
||||||
- /root/init.client.lua
|
|
||||||
context: {}
|
|
||||||
children:
|
|
||||||
- id: id-2
|
|
||||||
name: test
|
|
||||||
class_name: ModuleScript
|
|
||||||
properties:
|
|
||||||
Source:
|
|
||||||
Type: String
|
|
||||||
Value: This is a test.
|
|
||||||
metadata:
|
|
||||||
ignore_unknown_instances: true
|
|
||||||
instigating_source:
|
|
||||||
Path: /root/test.lua
|
|
||||||
relevant_paths:
|
|
||||||
- /root/test.lua
|
|
||||||
- /root/test.meta.json
|
|
||||||
context: {}
|
|
||||||
children: []
|
|
||||||
@@ -233,7 +233,7 @@ impl UiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn normal_page<'a>(&'a self, body: HtmlContent<'a>) -> HtmlContent<'a> {
|
fn normal_page<'a>(&'a self, body: HtmlContent<'a>) -> HtmlContent<'a> {
|
||||||
let project_name = self.serve_session.project_name().unwrap_or("<unnamed>");
|
let project_name = self.serve_session.project_name();
|
||||||
let uptime = {
|
let uptime = {
|
||||||
let elapsed = self.serve_session.start_time().elapsed();
|
let elapsed = self.serve_session.start_time().elapsed();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user