fix: allow to run tasks via nitro cli#4188
Conversation
|
@jkniest is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdded a shared task handler and POST route for dev tasks at Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I checked this against #4187 and the direction looks right:
I also like the shared handler and the One request before merge: can we add a regression test that runs |
Co-authored-by: Rihan Arfan <me@file.properties>
🔗 Linked issue
Resolves #4187
❓ Type of change
📚 Description
In the current beta version and
mainbranch it is not possible to run tasks via the CLI, e.g.:npx nitro task run example(doesn't matter which package manager you use).The CLI runs the command using
POST, while on the Dev Server onlyGETis registered, so it doesn't work. I've just added aPOSTmethod as well (using the same business logic). In my eyes if makes sense aswell, since executing Tasks is doing something which I would classify more underPOST.Before:

Reproduction is available here: https://stackblitz.com/edit/github-wtbduyfz?file=README.md
When the dev server runs, open a second terminal as seen in the screenshot and try to run the example command.
📝 Checklist