This will allow creating modules that contain only externally generated
files. For example, this is how I currently use it to generate modules
for code that is supposed to be eval'ed:
zmodule-eval() {
local -r zcommand=${${=1}[1]} ztarget=${1//[^[:alnum:]]/-}.zsh
zmodule custom-${zcommand} --use mkdir --if-command ${zcommand} \
--cmd "if [[ ! {}/${ztarget} -nt \${commands[${zcommand}]} ]]; then ${1} >! {}/${ztarget}; zcompile -UR {}/${ztarget}; fi" \
--source ${ztarget}
}
zmodule-eval 'starship init zsh'
unfunction zmodule-eval