luckyframework / luckyframework/lucky

When there is a 404 output a message that lets you easily create a new action from command line

Open
#912 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

improve error experience
Dominant language
Crystal
Stars
2.7k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Should probably not do this if requesting paths in /public, /js, etc. Also only in dev/test

GET /guides/getting-started/installing
  ▸ Sent 404 (414.0µs)
  ▸ Generate action with: lucky gen.action.from /guides/getting-started/installing

This will then show a wizard with profiled values that can be edited:

Action name (hit enter for 'Guides::GettingStarted::Installing'):
HTTP method (hit enter for 'GET'):
Path (hit enter for /guides/getting-started/installing):

This allows you to use the defaults, but customize for trickier stuff. Like where params are involved you want /users/1 to be /users/:user_id not /users/1

Possible improvements:

I've never done this but would be cool to prefill so you could start with /users/1 but then delete the last bit and add to it. Rather than having to copy/paste the suggestion and edit it

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the framework handles 404 responses in development and test, then inspect the existing lucky gen.action.from command and its wizard entry point. Reproduce the shown request and verify that public or asset paths are excluded, while an application path prints a command with the profiled method and path.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
backend, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.