feat(plugin): matcha create plugin scaffolds an in-app plugin and wires it

In-app is the default. Each plugin gets its own folder under plugins/
(or --folder), so it can be exported as a package later, and the
factory is registered in createApp({ plugins }). A plugins value that
is not an array literal is left alone with a hint, as modules already
is.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-09-24 12:54:51 -05:00
1 parent f2a3c16023
commit 3c3b7aaf8e
8 files changed
+383 -12

No files matched your search

+4 -2
View File
@@ -53,8 +53,10 @@ const PIECES: &[Piece] = &[
/// list, so a new kind cannot be accepted by the parser and rejected by `run`
/// (or the reverse).
pub fn kinds() -> Vec<&'static str> {
std::iter::once("module")
["module"]
.into_iter()
.chain(PIECES.iter().map(|p| p.kind))
.chain(["plugin"])
.collect()
}
@@ -143,7 +145,7 @@ fn create_module(name: &str, check: bool) -> std::io::Result<()> {
maybe_check(check)
}
fn maybe_check(check: bool) -> std::io::Result<()> {
pub(crate) fn maybe_check(check: bool) -> std::io::Result<()> {
if check {
match crate::check::run(Path::new(".")) {
Ok(true) => println!("✓ type-check passed"),