pub struct ExternalPluginDef {
pub schema: Option<String>,
pub name: String,
pub detection: Option<PluginDetection>,
pub enablers: Vec<String>,
pub entry_points: Vec<String>,
pub entry_point_role: EntryPointRole,
pub config_patterns: Vec<String>,
pub always_used: Vec<String>,
pub tooling_dependencies: Vec<String>,
pub used_exports: Vec<ExternalUsedExport>,
}Expand description
A declarative plugin definition loaded from a standalone file or inline config.
External plugins provide the same static pattern capabilities as built-in plugins (entry points, always-used files, used exports, tooling dependencies), but are defined in standalone files or inline in the fallow config rather than compiled Rust code.
They cannot do AST-based config parsing (resolve_config()), but cover the
vast majority of framework integration use cases.
Supports JSONC, JSON, and TOML formats. All use camelCase field names.
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/plugin-schema.json",
"name": "my-framework",
"enablers": ["my-framework", "@my-framework/core"],
"entryPoints": ["src/routes/**/*.{ts,tsx}"],
"configPatterns": ["my-framework.config.{ts,js}"],
"alwaysUsed": ["src/setup.ts"],
"toolingDependencies": ["my-framework-cli"],
"usedExports": [
{ "pattern": "src/routes/**/*.{ts,tsx}", "exports": ["default", "loader", "action"] }
]
}Fields§
§schema: Option<String>JSON Schema reference (ignored during deserialization).
name: StringUnique name for this plugin.
detection: Option<PluginDetection>Rich detection logic (dependency checks, file existence, boolean combinators).
Takes priority over enablers when set.
enablers: Vec<String>Package names that activate this plugin when found in package.json.
Supports exact matches and prefix patterns (ending with /).
Only used when detection is not set.
entry_points: Vec<String>Glob patterns for entry point files.
entry_point_role: EntryPointRoleCoverage role for entryPoints.
Defaults to support. Set to runtime for application entry points
or test for test framework entry points.
config_patterns: Vec<String>Glob patterns for config files (marked as always-used when active).
always_used: Vec<String>Files that are always considered “used” when this plugin is active.
tooling_dependencies: Vec<String>Dependencies that are tooling (used via CLI/config, not source imports). These should not be flagged as unused devDependencies.
used_exports: Vec<ExternalUsedExport>Exports that are always considered used for matching file patterns.
Implementations§
Source§impl ExternalPluginDef
impl ExternalPluginDef
Sourcepub fn json_schema() -> Value
pub fn json_schema() -> Value
Generate JSON Schema for the external plugin format.
Trait Implementations§
Source§impl Clone for ExternalPluginDef
impl Clone for ExternalPluginDef
Source§fn clone(&self) -> ExternalPluginDef
fn clone(&self) -> ExternalPluginDef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExternalPluginDef
impl Debug for ExternalPluginDef
Source§impl<'de> Deserialize<'de> for ExternalPluginDef
impl<'de> Deserialize<'de> for ExternalPluginDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ExternalPluginDef
impl JsonSchema for ExternalPluginDef
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more