package bnp import ( "context" "encoding/json" "fmt" "os" "path/filepath" "strings" abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" core "git.dev.alexdunmow.com/block/core/plugin" "google.golang.org/protobuf/proto" "gopkg.in/yaml.v3" ) // Codeless artifacts (WO-WZ-020): a .bnp with NO plugin.wasm — pure // declaration the host runs. Classification is by repo shape: a plugin repo // with no Go source builds codeless; a repo with Go builds wasm as always // (a converted repo DELETES its Go — that's the point). Both artifact kinds // may carry blocks/, templates/, and seed/; codeless just has nothing else. // Declarative artifact dirs shared by both build paths. const ( dirBlocks = "blocks" dirTemplates = "templates" dirSeed = "seed" ) // manifestYAMLName is the optional root-level declarative manifest source for // codeless plugins (the counterpart of what DESCRIBE captures from Go code). const manifestYAMLName = "manifest.yaml" // manifestYAML mirrors the declarative PluginManifest fields a codeless // plugin can set. File-valued keys are paths relative to the repo root. type manifestYAML struct { ThemePresets string `yaml:"theme_presets"` // JSON file BundledFonts string `yaml:"bundled_fonts"` // JSON file SettingsSchema string `yaml:"settings_schema"` // JSON file MasterPages string `yaml:"master_pages"` // JSON file ([]masterPageJSON) RequiredIconPacks []string `yaml:"required_icon_packs"` SystemTemplates []struct { Key string `yaml:"key"` Title string `yaml:"title"` Description string `yaml:"description"` } `yaml:"system_templates"` PageTemplates []struct { System string `yaml:"system"` Key string `yaml:"key"` Title string `yaml:"title"` Description string `yaml:"description"` Slots []string `yaml:"slots"` } `yaml:"page_templates"` // TemplateOverrides declare theme-scoped overrides of builtin block // rendering. Source convention: templates/overrides/