Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.49-pr.441.dc5beddPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.49-pr.441.dc5bedd"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.49-pr.441.dc5bedd"
}
}
Preview published to npm registry — try new features instantly! |
|
@artemdemo I wonder what do you think about this. moving the runTask to be injected from the CLIContext.
|
| } | ||
|
|
||
| /** | ||
| * Creates a RunTaskFn that delegates to the provided logger for non-interactive environments. |
There was a problem hiding this comment.
Delegates what? :)
Description is a bit unclear
There was a problem hiding this comment.
@artemdemo I wonder what do you think about this. moving the runTask to be injected from the CLIContext.
It's nice to have it support non interactive and such
I feel that maybe it's not the right place for runTask 🤔
non interractive runTask is a good idea.
but what do you mean about the place? Like you don't want to place it in the context?
You're actually don't have to.
You can just check interactivity in runTask itself and then use spinner or logger
5abb3da to
b5ae3fe
Compare
Note
Description
This PR refactors
runTaskfrom a standalone exported function into a dependency-injected factory pattern. Instead of importingrunTaskdirectly, commands now receive it viaCLIContext, with two implementations:createInteractiveRunTask(uses clack spinner for TTY) andcreateSimpleRunTask(uses plain log output for non-interactive/CI environments). This ensures that spinner-based UI is never used in non-TTY contexts.Related Issue
None
Type of Change
Changes Made
runTaskfunction withcreateInteractiveRunTask()andcreateSimpleRunTask(log)factory functions inrunTask.tsRunTaskFntype alias exported fromrunTask.tsrunTask: RunTaskFnfield toCLIContextinterface intypes.tsrunTaskimplementation inindex.tsbased onisNonInteractiveflag, and passed it intoCLIContextrunTaskfrom thecli/utils/index.tsbarrel export (no longer a free-standing import)runTaskfromCLIContextinstead of importing it directlyTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
createSimpleRunTaskimplementation logs the start message vialog.info, update messages vialog.info, success vialog.success, and errors vialog.error— making non-interactive output readable in CI/piped environments without spinner control codes.🤖 Generated by Claude | 2026-03-29 00:00 UTC