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:
@@ -104,9 +104,9 @@ func ValidateAppName(name string) error {
|
||||
}
|
||||
switch name {
|
||||
case "main":
|
||||
return fmt.Errorf("build: app name %q is reserved: plugins/main would be a program, not an importable package", name)
|
||||
return fmt.Errorf("build: app name %q is reserved: plugins/golem15/main would be a program, not an importable package", name)
|
||||
case "internal":
|
||||
return fmt.Errorf("build: app name %q is reserved: Go forbids importing plugins/internal from the app", name)
|
||||
return fmt.Errorf("build: app name %q is reserved: Go forbids importing plugins/golem15/internal from the app", name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -459,5 +459,5 @@ func addStarterPlugin(ctx context.Context, name, target string) error {
|
||||
if _, err := makePlugin(ctx, target, "golem15."+name, pluginOptions{StarterRoute: true}); err != nil {
|
||||
return err
|
||||
}
|
||||
return AddPlugin(ctx, target, filepath.Join("plugins", name))
|
||||
return AddPlugin(ctx, target, filepath.Join("plugins", "golem15", name))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user