Files
herolib/lib/core/playcmds/factory.v
Mahmoud-Emad 0e1450b5db chore: add debug prints and perform code cleanup
- Add extensive debug prints for troubleshooting
- Comment out docusaurus build/dev action logic
- Rename gittools parameters for clarity (reset/pull)
- Apply consistent formatting to function calls
- Remove unused imports in playbook include module
2025-08-12 13:37:01 +03:00

55 lines
1.4 KiB
V
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module playcmds
import freeflowuniverse.herolib.core.playbook { PlayBook }
import freeflowuniverse.herolib.data.doctree
import freeflowuniverse.herolib.biz.bizmodel
import freeflowuniverse.herolib.web.site
import freeflowuniverse.herolib.web.docusaurus
import freeflowuniverse.herolib.clients.openai
// -------------------------------------------------------------------
// run entry point for all HeroScript playcommands
// -------------------------------------------------------------------
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?PlayBook
reset bool
}
pub fn run(args_ PlayArgs) ! {
mut args := args_
println('DEBUG: the args is: ${args}')
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
println('DEBUG: The playbook is ${plbook}')
// Core actions
play_core(mut plbook)!
// Git actions
play_git(mut plbook)!
// Business model (e.g. currency, bizmodel)
bizmodel.play(mut plbook)!
// OpenAI client
openai.play(mut plbook)!
// Website / docs
site.play(mut plbook)!
println('DEBUG: Site play is done')
doctree.play(mut plbook)!
println('DEBUG: doctree play is done')
docusaurus.play(mut plbook)!
println('DEBUG: docusaurus play is done')
// Ensure we did not leave any actions unprocessed
plbook.empty_check()!
}