purescript / purescript/spago

Reduce the number of characters needed for specifying which package is being selected

Open
#985 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

UX
Dominant language
PureScript
Stars
831
Forks
137
PR merge metrics
No merged PRs in 30d

Description

The new spago's CLI allows one to select a package by referring to it via package name. However, this choice is somewhat problematic in a few situations:

  • when the package name is long, whether due to multiple parts within the name (e.g. node-some-special-package-name) or due to long words within the name (e.g. uncopyrightable-sesquipedalian-package courtesy of 13 of the Longest Words in the English Language
  • when the letters used within the package name happen to be a particular sequence of characters that the current user is prone to misspell (e.g. switching i and o in -tion)

I propose we make it possible to reduce the number of character used. There are a few ways to do this:

  1. In spago.yaml, add a new field cli-alias in the package section that allows one to use that alias string in addition to the package name. Given a package name uncopyrightable-sesquipedalian-package and an alias lib, both spago install -p uncopyrightable-sesquipedalian-package and spago install -p lib modify the same package's dependencies).
  2. In the CLI, add some sort of fuzzy matching on the package names to guess which package is the selected one.

Of these two, I prefer the first one.

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 the CLI package-selection flow and the package section of spago.yaml. Compare the proposed cli-alias approach with fuzzy matching, then define how aliases are configured, resolved, and validated; done means a package can be selected by its alias without changing existing name-based selection.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.