VFS in external crate (#297)

* vroom

* Port dir middleware

* Filter rules

* Directory metadata

* Project support

* Enable Lua support

* StringValue support

* CSV

* rbxm, rbxmx, and rbxlx

* JSON models

* Clean up some warnings

* Strip out PathMap

* Unwatch paths when they're reported as removed

* Fix 'rojo upload' behavior

* Upgrade to Insta 0.13.1

* Update dependencies

* Release 0.6.0-alpha.2

* Fix bad merge

* Replace MemoryBackend with InMemoryFs

* Sledgehammer tests into passing for now

* Txt middleware

* Update easy snapshot tests

* Lua tests

* Project middleware tests

* Try to fix test failures by sorting

* Port first set of serve session tests

* Add InMemoryFs::raise_event

* Finish porting serve session tests

* Remove UI code for introspecting VFS for now

* VFS docs
This commit is contained in:
Lucien Greathouse
2020-03-10 17:38:49 -07:00
committed by GitHub
parent a884f693ae
commit 477e0ada32
38 changed files with 846 additions and 2509 deletions

View File

@@ -4,6 +4,7 @@
use std::path::Path;
use rbx_dom_weak::RbxInstanceProperties;
use vfs::Vfs;
use crate::{
project::Project,
@@ -12,13 +13,9 @@ use crate::{
PathIgnoreRule, RojoTree,
},
snapshot_middleware::snapshot_from_vfs,
vfs::{Vfs, VfsFetcher},
};
pub fn start<F: VfsFetcher>(
fuzzy_project_path: &Path,
vfs: &Vfs<F>,
) -> (Option<Project>, RojoTree) {
pub fn start(fuzzy_project_path: &Path, vfs: &Vfs) -> (Option<Project>, RojoTree) {
log::trace!("Loading project file from {}", fuzzy_project_path.display());
let maybe_project = Project::load_fuzzy(fuzzy_project_path).expect("TODO: Project load failed");
@@ -34,11 +31,6 @@ pub fn start<F: VfsFetcher>(
let root_id = tree.get_root_id();
log::trace!("Reading project root");
let entry = vfs
.get(fuzzy_project_path)
.expect("could not get project path");
let mut instance_context = InstanceContext::default();
if let Some(project) = &maybe_project {
@@ -51,7 +43,7 @@ pub fn start<F: VfsFetcher>(
}
log::trace!("Generating snapshot of instances from VFS");
let snapshot = snapshot_from_vfs(&instance_context, vfs, &entry)
let snapshot = snapshot_from_vfs(&instance_context, vfs, &fuzzy_project_path)
.expect("snapshot failed")
.expect("snapshot did not return an instance");