Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a basic watch command #760

Closed

Conversation

Quantumplation
Copy link
Contributor

@Quantumplation Quantumplation commented Nov 9, 2023

This adds the following command

aiken watch

There are some open questions to answer, though:

  • I really like the ergonomics of aiken watch; but it also makes sense
    as a flag to aiken check or aiken build etc.; should we just
    support the flag, the command, or both?
  • Right now I duplicated the with_project method, because it forces
    process::exit(1); Should we refactor this, and if so, how?
  • Are there other configuration options we want?

This adds the following command
```
aiken watch
```

There are some open questions to answer, though:
- I really like the ergonomics of `aiken watch`; but it also makes sense
  as a flag to `aiken check` or `aiken build` etc.; should we just
  support the flag, the command, or both?
- Right now I duplicated the with_project method, because it forces
  process::exit(1); Should we refactor this, and if so, how?
- Are there other configuration options we want?
@Quantumplation Quantumplation requested a review from a team as a code owner November 9, 2023 19:56
@Quantumplation
Copy link
Contributor Author

(related to #589)

@rvcas
Copy link
Member

rvcas commented Nov 9, 2023

Sick. I kinda like the idea of passing down a flag from check and build BUT watch command is also cool and we could optionally add --build to watch instead. So either way is probably fine.

@Quantumplation
Copy link
Contributor Author

Yea; and fmt also makes some sense, and with the flags they could compose.

I'm open to anything, but I really like the simplicity of aiken watch --clear in my workflow

Rather than have this logic in the aiken binary, this provides a generic
mechanism to do "something" on file change events.  KtorZ is going to
handle wiring it up to the CLI in the best way for the project.

I tried to write some tests for this, but it's hard to isolate the
watcher logic without wrestling with the borrow checker, or overly
neutering this utility.
@Quantumplation
Copy link
Contributor Author

After discussing with @KtorZ, I pulled the "file watch and debounce" logic purely into it's own utility in aiken-project; He's going to handle integrating this into the CLI in a way that best fits for the project.

@KtorZ KtorZ self-assigned this Nov 16, 2023
@KtorZ
Copy link
Member

KtorZ commented Nov 25, 2023

Merged in c2725ab

@KtorZ KtorZ closed this Nov 25, 2023
@Quantumplation Quantumplation deleted the aiken-watch branch November 25, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ❌ Canceled
Development

Successfully merging this pull request may close these issues.

3 participants