github-pewpew
github-pewpew copied to clipboard
Added support to delete codespaces just like repositories
ref #36
I have added support for deleting codespaces with this CLI tool. Main changes -
- Request additional
codespace
scope during auth - More functions (mostly copies of the ones for repos) but for codespaces
- Small change in
config.js
to respect config path for linux machines (.config/com.adrianmg.github-pewpew
)
Use the codespaces
argument with ghpew
for the same.
Here is a screenshot -
Thanks for contributing, @AnishDe12020!
Sharing some thoughts:
- Have you tried if existing users will be able to re-auth once a new scope is detected?
- Have you thought about adding
help
,-h
, and--help
to describe different options to run the command? This seems necessary to promote the discoverability of this and upcoming features (such as gists?) - As we add more commands, I wonder if we should eventually abstract the UI a bit more, as it can get very verbose with mane
ifs
andelses
. Thoughts?
Thanks for contributing, @AnishDe12020!
Sharing some thoughts:
- Have you tried if existing users will be able to re-auth once a new scope is detected?
- Have you thought about adding
help
,-h
, and--help
to describe different options to run the command? This seems necessary to promote the discoverability of this and upcoming features (such as gists?)- As we add more commands, I wonder if we should eventually abstract the UI a bit more, as it can get very verbose with mane
ifs
andelses
. Thoughts?
- I will add a check in the codespace command and if i am not able to retrieve codespaces, I will delete the config file and re run main (essentially a re auth process). ~~I will get this done today~~ Done (https://github.com/adrianmg/github-pewpew/pull/37/commits/21b41b8090a9e69fb67bada1a6cb5ccb598d8001)
2 & 3: I can use a library like commander.js or similar (easier arg parsing, automated help commands). Done, the help command is autogenerated and the code is much cleaner now (https://github.com/adrianmg/github-pewpew/pull/37/commits/55803a0899e35cad4c81601c987c22a6eec49eb5)
Todo before releasing:
- [x]
test.js
should include codespaces - [x] Update
README
with new instructions
@AnishDe12020 I wonder if we can remove the commander.js
dependency and achieve similar functionality with a couple of helper functions 🤔
I like we are splitting commands into different files and how simple index.js
is now, but one of the goals of the project was to reduce third-party code and dependencies as much as I could.
@AnishDe12020 I wonder if we can remove the
commander.js
dependency and achieve similar functionality with a couple of helper functions thinkingI like we are splitting commands into different files and how simple
index.js
is now, but one of the goals of the project was to reduce third-party code and dependencies as much as I could.
I have accomplished the same with a switch statement now, the help message is hardcoded though. I have also updated the tests and the README
@AnishDe12020 I'll try to follow up on pending conversations during this weekend. Thanks for your time!
@IvanGuardado @AnishDe12020, excellent discussion!
I was busy shipping https://adrianmato.art last week, but I'd be catching up with this soon 🙇
@adrianmg any update on this pr?
@AnishDe12020 looking into it
@AnishDe12020 there is a new bug when repos are listed but the command is cancelled:
![image](https://user-images.githubusercontent.com/589285/188588177-65d8adff-91c1-4fd8-a826-55128af27bfc.png)
I'm not sure we want to show the help command in such cases?
~~looking into it~~ fixed in adrianmg/github-pewpew@5f582ae
(#37)
forgot to break out of the switch block there
Better formatting for help command + cleaner function
![image](https://user-images.githubusercontent.com/589285/188608798-018ac40f-5f4c-46cd-9133-00b8fc7e60b6.png)
@AnishDe12020 @IvanGuardado any thoughts on this one?
https://twitter.com/adrianmg/status/1575682566136287232
@AnishDe12020 @IvanGuardado any thoughts on this one?
https://twitter.com/adrianmg/status/1575682566136287232
As I see it being a breaking change for existing users if it shows the help command when no args are passed, I think it would be better to retain the repos functionality when running just ghpew
. However showing that more commands can be viewed by running ghpew help
in the welcome message should be good
As I see it being a breaking change for existing users
I thought so, but then I realized there's no "breaking" changes as they can't currently automate it without user intervention to provide a choice of repos to be deleted 🤔