Commit Graph

10 Commits

Author SHA1 Message Date
vh-zuka 2736df5466 Validate project name on aiken new 2022-11-14 14:15:02 -05:00
vh-zuka bdf91d287b Add a few more files 2022-11-10 01:45:32 -05:00
vh-zuka 9d6f9fd013 Use indoc for better raw text 2022-11-10 01:45:32 -05:00
vh-zuka 3faed5c980 Add new project template 2022-11-10 01:45:32 -05:00
rvcas e90a210537 feat: add a basic lsp 2022-11-10 01:27:18 -05:00
rvcas 9d14acbe0a
fix: when formatting and add some methods to Project::Error 2022-11-05 16:23:46 -04:00
rvcas cba7a6f46e
feat: bring over the formatter from gleam 2022-11-05 15:35:11 -04:00
KtorZ 4316d5c382
Factor out common project-logic between build and check. 2022-10-28 17:20:41 +02:00
KtorZ 8d45b2a2f5
Enforce ordering of commands/sub-commands according to source
By default, clap orders command alphabetically, which can be quite
    confusing when listing commands with `--help`:

    ```
    SUBCOMMANDS:
        eval      Evaluate an Untyped Plutus Core program
        flat      Encode textual Untyped Plutus Core to flat bytes
        fmt       Format an Untyped Plutus Core program
        help      Print this message or the help of the given subcommand(s)
        unflat    Decode flat bytes to textual Untyped Plutus Cor
    ```

    It is possible to instrument clap to order commands in the same way
    they are declared in the source, giving us back the freedom to order
    and group them in a manner that makes sense, e.g.:

    ```
    SUBCOMMANDS:
        fmt       Format an Untyped Plutus Core program
        eval      Evaluate an Untyped Plutus Core program
        flat      Encode textual Untyped Plutus Core to flat bytes
        unflat    Decode flat bytes to textual Untyped Plutus Cor
        help      Print this message or the help of the given subcommand(s)
    ```
2022-10-28 17:20:41 +02:00
KtorZ 9c608ad9f1
Refactor cli's crate; split code into a hierarchy of modules.
This follows a simple convention:

    - `main.rs` contains as little as possible and delegates both
      data-types definitions and command executions to sub-modules.

    - modules are named after their respective commands. For
      sub-commands,

    - Each command module can be in one of two forms:

      - Either it is a leaf command, and it then contains an `Args`
	struct that defines the command arguments; and a function
	`exec` when outlines the execution logic.

      - Or, it is a group command with multiple sub-commands. In which
	case the module defines a `Cmd` struct encapsulating all
	sub-commands; and also an `exec` function which simply
	dispatches the logic to sub-functions.

    ---

    This commit also removes the `dev` command which is currently
    unused. The rationale being: if it's not there, it's not there.
2022-10-28 17:20:39 +02:00