Support `createMain(command)` return value from `run` method
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- cli
Research direction
Start by tracing createMain and how it invokes a command's run method. Check how the returned value is currently handled, then verify that awaiting the created API command with rawArgs: [] produces the value returned by run, such as "hello".
Written by the indexing model from the issue text.
Description
Describe the feature
import { createMain, defineCommand } from 'citty'
const command = defineCommand({
//...
async run() {
return Promise.resolve("hello")
}
})
const apiCommand = createMain(_rDefault(command))
const value = await apiCommand({
rawArgs: []
})
console.log(value) //=> "hello"
Additional information
- Would you be willing to help implement this feature?
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unjs/citty
-
bug discussion enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 55/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Similar issues
-
check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Fission-AI/OpenSpec#1986 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nestjs/docs.nestjs.com#3554 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
publicodes/publicodes#868 ·
-
namespace operations
Difficulty 1/5 Under an hour Newbie friendliness 78/100
EclipseFdn/open-vsx.org#13488 ·
Maintainers usually reply within 2 days