Add a new syncRules field project files to allow users to specify middleware to use for files (#813)

This commit is contained in:
Micah
2024-01-19 22:18:17 -08:00
committed by GitHub
parent c0a96e3811
commit 73828af715
48 changed files with 923 additions and 146 deletions

View File

@@ -8,7 +8,7 @@ use std::{
use serde::{Deserialize, Serialize};
use thiserror::Error;
use crate::{glob::Glob, resolution::UnresolvedValue};
use crate::{glob::Glob, resolution::UnresolvedValue, snapshot::SyncRule};
static PROJECT_FILENAME: &str = "default.project.json";
@@ -84,6 +84,12 @@ pub struct Project {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub glob_ignore_paths: Vec<Glob>,
/// A list of mappings of globs to syncing rules. If a file matches a glob,
/// it will be 'transformed' into an Instance following the rule provided.
/// Globs are relative to the folder the project file is in.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub sync_rules: Vec<SyncRule>,
/// The path to the file that this project came from. Relative paths in the
/// project should be considered relative to the parent of this field, also
/// given by `Project::folder_location`.