packs icon indicating copy to clipboard operation
packs copied to clipboard

Initial pass at an `init` command

Open stevegeek opened this issue 1 year ago • 1 comments

As discussed in #144 an init command might be nice.

This is probably the first time I have ever written any Rust so I just tried copying things I saw in the existing implementation and did some work arounds to compile errors using ChatGPT.

Ideally someone with some experience could help turn this into a proper solution that is more idiomatic etc!

I added the config file creation at a point before the configuration load happens to avoid it blowing up but Im sure there is a better solution here.

Anyway thought it might be a starting point!

stevegeek avatar Feb 09 '24 23:02 stevegeek

Will do!

stevegeek avatar Feb 12 '24 20:02 stevegeek

@alexevanczuk apologies for the delay on this, I will pick it up again asap

stevegeek avatar Aug 13 '24 21:08 stevegeek

No rush @stevegeek ! Totally on your schedule here :)

alexevanczuk avatar Aug 14 '24 02:08 alexevanczuk

@alexevanczuk made some changes to the way I had implemented this command. Think this implementation solves a few of the issues with the previous one. Added a test too

stevegeek avatar Aug 14 '24 16:08 stevegeek

@alexevanczuk Thanks very much for the review. Will take a look now

stevegeek avatar Aug 19 '24 12:08 stevegeek

Looks good, one thought that we should just create one YML file to start. I kind of like the idea of just creating the packs.yml and referencing pks commands instead of packwerk commands, since if someone is starting a new app for the first time it's a good time to start using pks from the beginning, what do you think?

Makes sense to assume one would be using pks from the get go in this case. I will look at packs first mode, didnt even notice it before, have always used a packwerk.yml

Also you have a couple of lint errors but if you run cargo fmt && cargo clippy it should show you where they are! There are some cmd line flags to auto fix too (you can have this set up in your editor to auto-fix lint errors).

Ok, yeah I saw there was a githook but it was blowing up and I couldn't work out how to get it to run so committed without it. will make sure to run the formatter next time!

stevegeek avatar Aug 19 '24 13:08 stevegeek

Nice!! Just two very small changes requested:

  1. Can ya add that inline comment about why the case on the command is higher for init?
  2. Want to bump the patch version in Cargo.toml? That will allow the new version to be auto-published when merged 🎉

alexevanczuk avatar Aug 19 '24 15:08 alexevanczuk

@alexevanczuk thanks for the patient review. Hope those last changes are ok!

stevegeek avatar Aug 19 '24 15:08 stevegeek

Thanks @alexevanczuk !

stevegeek avatar Aug 19 '24 15:08 stevegeek