first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+22 -18
View File
@@ -2,16 +2,13 @@
//!
//! This crate provides utilities for managing repository metadata, including file trees,
//! gitignore processing, and filesystem watching capabilities.s
use std::{
borrow::Borrow,
path::{Path, PathBuf},
};
use std::borrow::Borrow;
use std::path::{Path, PathBuf};
use galaxy_util::standardized_path::StandardizedPath;
use thiserror::Error;
#[cfg(not(target_family = "wasm"))]
use galaxyui::SingletonEntity;
use galaxyui_core::SingletonEntity;
/// Errors that can occur when working with repository metadata.
#[derive(Error, Debug)]
@@ -28,6 +25,12 @@ pub enum RepoMetadataError {
BuildTree(BuildTreeError),
#[error("Failed to start watcher: {0}")]
WatcherError(#[from] anyhow::Error),
#[error("Repository not indexed")]
RepositoryNotIndexed,
#[error("Repository indexing in progress")]
RepositoryIndexingPending,
#[error("Repository indexing failed")]
RepositoryIndexingFailed,
}
// Re-export the modules
pub mod entry;
@@ -38,42 +41,43 @@ pub mod remote_model;
pub mod repositories;
pub mod repository;
pub mod repository_identifier;
pub mod standing_queries;
mod telemetry;
pub mod watcher;
pub mod wrapper_model;
pub use entry::{
gitignores_for_directory, matches_gitignores, path_passes_filters, should_ignore_git_path,
BuildTreeError, DirectoryEntry, Entry, FileId, FileMetadata,
gitignores_for_directory, matches_gitignores, should_ignore_git_path, BuildTreeError,
DirectoryEntry, Entry, FileId, FileMetadata,
};
// Re-export the local model's event under its original name for backward compatibility.
pub use local_model::RepositoryMetadataEvent;
pub use repository::Repository;
pub use watcher::{DirectoryWatcher, RepositoryUpdate, TargetFile};
#[cfg(not(target_family = "wasm"))]
pub fn is_in_repo(path: &str, app: &galaxyui::AppContext) -> bool {
pub fn is_in_repo(path: &str, app: &galaxyui_core::AppContext) -> bool {
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use crate::repositories::DetectedRepositories;
DetectedRepositories::as_ref(app)
.get_root_for_path(std::path::Path::new(path))
.get_root_for_path(&LocalOrRemotePath::Local(std::path::PathBuf::from(path)))
.is_some()
}
#[cfg(target_family = "wasm")]
pub fn is_in_repo(_path: &str, _app: &galaxyui::AppContext) -> bool {
pub fn is_in_repo(_path: &str, _app: &galaxyui_core::AppContext) -> bool {
false
}
pub use file_tree_store::FileTreeEntry;
pub use local_model::{LocalRepoMetadataModel, RepoContent};
// New types.
pub use file_tree_update::RepoMetadataUpdate;
pub use file_tree_update::{MetadataUpdateType, RepoMetadataUpdate};
pub use local_model::{LocalRepoMetadataModel, RepoContent, RepoContents};
pub use remote_model::RemoteRepoMetadataModel;
pub use repository_identifier::{RemoteRepositoryIdentifier, RepositoryIdentifier};
pub use standing_queries::{
StandingQueryContent, StandingQueryDefinitions, StandingQueryResults, StandingQueryResultsDelta,
};
pub use wrapper_model::{RepoMetadataEvent, RepoMetadataModel};
/// A wrapper around PathBuf that ensures the path is canonicalized.