architect-team / architect-cli

Command line interface for running Architect services locally
https://docs.architect.io
38 stars 13 forks source link

Fix init flow #861

Closed mueschm closed 1 year ago

mueschm commented 1 year ago

Overview

When trying to create a new project with a docker-compose.yml in the current working directory, there was no good mechanism to use a starter project. This PR fixes that core issue and streamlines some of the code.

Changes

  1. Changed the way we handle asking for the name. Makes it a bit cleaner.
  2. Look for a docker compose file in the directory and ask if it should be used.
  3. Removed some of the duplicate checks we did around finding and using the right file.
  4. Added better error message if the file was empty.

Tests

  1. Went through each combination of the common. With and without a default file. With and without 2 docker compose files to test priority.
  2. Tested the new name system.
  3. Added and updated unit tests

Pictures

image

zach-j-dev commented 1 year ago

@mueschm @ryan-cahill For UX perspective, I get an experimental warning we should suppress - looks a little janky when we run init:

architect init                                                             //Tue Mar 21 08:15 AM// ✔
? What is the name of your project? (node:19772) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
zach-j-dev commented 1 year ago

Beyond that experimental warning, everything looks great from a UX perspective. I tested a bunch of bad project names and I love how the UX looks for it.

Once the experimental warning is fixed, you have prod signoff

tjhiggins commented 1 year ago

@mueschm @ryan-cahill For UX perspective, I get an experimental warning we should suppress - looks a little janky when we run init:

architect init                                                             //Tue Mar 21 08:15 AM// ✔
? What is the name of your project? (node:19772) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

I don't see how this pr would have introduced that warning. @Zach-at-Arch can you try running architect init on rc and see if you get the same warning? If you do then create a separate cli ticket.

zach-j-dev commented 1 year ago

@tjhiggins yep, it's on RC as well. I'll make a ticket; therefore, this is good to go

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.36.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: