-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
(Sorry, I'm in an ideas mood today after returning from Exeter sprint yesterday!)
Several civix jobs are boilerplate creating jobs. May we add to those via hooks implemented in extensions, for example?
Use case:
I'm seeing a lot of interest recently about Inlay. Creating a new inlay is pretty simple - I was able to demo it in 15 mins. But there is some boilerplate.
It struck me that if I could implement civix generate:inlay "Name of Inlay type" [OptionalShorterCodeName] it would be good for onboarding devs. Running that command would:
- call
civix generate:angular-module - call
civix generate:angular-page x y - edit the ang/* files to insert some boilerplate tweaks.
- create a
Civi\Inlay\NameOfType.phpclass - somehow implement the required hook (currently I do this in hook_container, but I'd like to use HookInterface on the
\Civi\Inlay\NameOfTypeclass instead once I get it to work. - report the files created.
- run a flush
I could see two options for implementation
- I just do a PR here to ask to add this command to civix. You might feel that you don't want a pure-core tool polluted with pesky extensions' dirty work!
- civix supports plugins, scans installed extensions to find classes implementing
Civix\Pluginor such. - (a non-option): don't implement this with civix; just provide a cli/create-inlay.php script in the Inlay extension that does the work. This feels like duplicating logic though.
- (another non-option): don't implement this with civix; just provide typical boilerplate code in the Inlay extension, e.g. under boilerplate/ and then give devs clear instructions.
I'm not sure how generic a requirement this is; perhaps inlay is a special case. Obviously this is not a high priority issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels