Skip to content

Improve aiken packages / aiken add commands #492

@KtorZ

Description

@KtorZ

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 on aiken 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 using main 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 like aiken-lang, we could even make suggestion using a levenshtein distance as it is quite common to go for aiken/stdlib instead of aiken-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 as GitLab.

Non-goals

  • Implement a version resolver: this is overkill at this point and not something we want to do lightly. The current requirement for projects to have to manually specify all their dependencies (including transitive dependencies) is a FEATURE and done on-purpose.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    command lineTooling and developer experience improvementshelp welcomedContributor friendly

    Type

    No type

    Projects

    Status

    🚀 Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions