Improve aiken packages
/ aiken add
commands
#930
Replies: 11 comments
-
Should we include better version resolution so that projects can depend on libraries that depend on libraries? |
Beta Was this translation helpful? Give feedback.
-
Not in this task I believe. This is something we need to think a bit more about IMO. |
Beta Was this translation helpful? Give feedback.
-
Ok no problem |
Beta Was this translation helpful? Give feedback.
-
Could I try this task? |
Beta Was this translation helpful? Give feedback.
-
Sure thing! |
Beta Was this translation helpful? Give feedback.
-
@hadelive no problem, please make a draft PR as early as possible so we can provide feedback throughout the process if you get stuck. Also feel free to reach out on discord for help. |
Beta Was this translation helpful? Give feedback.
-
Hi! I added a branch to my fork to work on this and I am researching the issue. I found a closed PR here.
Thanks! |
Beta Was this translation helpful? Give feedback.
-
I think this is already pretty explicit from the PR comments? The suggested approach in the PR ended up being not ideal and the overall UX was deemed not good so it was abandoned.
Correct. |
Beta Was this translation helpful? Give feedback.
-
should be more straightforward. Is it a better idea to implement it first? thanks. |
Beta Was this translation helpful? Give feedback.
-
I've updated the original issue, providing more details on the items and clarifying a few interrogations. |
Beta Was this translation helpful? Give feedback.
-
(moving this to a discussion) |
Beta Was this translation helpful? Give feedback.
-
What is your idea? Provide a use case.
Aiken provides commands for adding dependencies to a project (i.e. automatically edit
aiken.toml
). However, commands are a bit "clunky" at the moment and could be improved in the following ways:The
--version
option onaiken add
could be made optional; when not provided, the dependency will be added considering only the default branch on the target repository. This means using the GitHub API for querying the default branch. For example,aiken add aiken-lang/stdlib
should add the standard library usingmain
as a version.aiken add
should verify that a given repository / project exists when adding it. Ideally, it should also check that a commit or branch given as--version
also exists. In both cases, display a human-readable error and a hint to troubleshoot the problem. For well-known organizations likeaiken-lang
, we could even make suggestion using a levenshtein distance as it is quite common to go foraiken/stdlib
instead ofaiken-lang/stdlib
.Add a
aiken remove
command to easily remove a dependency.Add
aiken package list
to pretty-print installed dependencies and their versions.aiken package upgrade
should fail with a proper error when trying to upgrade a non-existing package.(bonus) Support more providers than
Github
such asGitLab
.Non-goals
Why is it a good idea?
These commands are seldom used at this stage because we don't yet have a large ecosystem and the stdlib comes pre-defined as dependency when running
aiken new
. However, the developer experience could still be made slightly better in anticipation and to prevent mistakes.What is the current alternative and why is it not good enough?
Current alternative is not doing mistakes. It's very easy to mistype a branch name, and catching errors early is usually how we achieve good UX.
Beta Was this translation helpful? Give feedback.
All reactions