fix(build): scaffold plugins under plugins/<vendor>/<name> (quick-261028-pq8)

- make:plugin writes plugins/<vendor>/<name> with module
  <app>/plugins/<vendor>/<name>; the package name stays <name>
- make:* and the models-leaf check look in summer.yaml, then
  plugins/<vendor>/<name>, then the older plugins/<name>
- summer new puts its starter plugin at plugins/golem15/<name>
- refuse a vendor directory that is a legacy plugin module and a second
  copy of a plugin that already sits in plugins/<name>
- help text and docs, with an upgrading note: moving is optional
This commit is contained in:
Jakub Zych
2026-10-28 18:55:46 +01:00
parent a941ab2394
commit a95a014b52
26 changed files with 247 additions and 86 deletions

View File

@@ -451,21 +451,14 @@ func locatePluginDir(appDir, id string) (string, error) {
}
}
}
candidate := filepath.Join(appDir, "plugins", pluginName(id))
if !underRoot(appDir, candidate) {
return "", fmt.Errorf("build: plugin path %q escapes the app root", candidate)
}
st, err := os.Stat(candidate)
dir, err := defaultPluginDir(appDir, id)
if err != nil {
if os.IsNotExist(err) {
return "", pluginMissingHint(fmt.Errorf("build: plugin %s not found", id), id)
}
return "", fmt.Errorf("build: stat %s: %w", candidate, err)
return "", err
}
if !st.IsDir() {
if dir == "" {
return "", pluginMissingHint(fmt.Errorf("build: plugin %s not found", id), id)
}
return candidate, nil
return dir, nil
}
func finishArtifact(ctx context.Context, plugin pluginRef) error {