Skip to content

Makefile UX: friendlier defaults, help target, pixi pre-flight check #44

Description

@viniciusdc

The Makefile has grown organically. After #43 lands it's also implicitly assuming pixi is installed, which is the right call but worth handling gracefully. Some polish ideas worth considering — none urgent, none required.

Default behavior

  • make with no args currently does nothing useful. Default to make help.
  • Add a help target that lists every other target with a one-line description. The common pattern is to put ## description comments next to each target and parse them with awk:
    help:  ## Show this help
    	@awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-12s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

Pre-flight checks

  • Detect if pixi is on PATH. If not, print a friendly install pointer and exit cleanly rather than letting every target fail with pixi: command not found.
  • Optional: make doctor target that prints resolved versions (pixi, Node, npm, astro) — useful when something's wedged.

Missing targets

  • clean — remove dist/, .astro/, node_modules/, .pixi/ (or some subset). Useful when state is corrupted.
  • open or an extension of dev that also opens http://localhost:4321 in the browser (open on macOS, xdg-open on Linux).

Polish

  • Echo a short banner before each target (==> dev: starting Astro dev server on http://localhost:4321) so the output isn't just a wall of npm.
  • make post error message could show accepted TYPE values (note | arch) instead of only naming the flag.
  • Light per-target color via tput setaf for the banner lines — not a full prompt UI, just stand-out section headers.

Out of scope

  • Switching away from make to just / task / similar runners. The point is to polish what's there, not replace it.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions