Reduce the number of characters needed for specifying which package is being selected
Open
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-packagecourtesy 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
iandoin-tion)
I propose we make it possible to reduce the number of character used. There are a few ways to do this:
- In
spago.yaml, add a new fieldcli-aliasin thepackagesection that allows one to use that alias string in addition to the package name. Given a package nameuncopyrightable-sesquipedalian-packageand an aliaslib, bothspago install -p uncopyrightable-sesquipedalian-packageandspago install -p libmodify the same package's dependencies). - 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
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.
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