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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bit of design: namespace and imports #28

Closed
amtoine opened this issue Oct 13, 2023 · 5 comments 路 Fixed by #50
Closed

a bit of design: namespace and imports #28

amtoine opened this issue Oct 13, 2023 · 5 comments 路 Fixed by #50
Labels
design Let's design nu-git-manager help wanted Extra attention is needed question Further information is requested

Comments

@amtoine
Copy link
Owner

amtoine commented Oct 13, 2023

i've been thinking a bit about the user experience of nu-git-manager.
with #26, i feel the command API is quite good and simple (:crossed_fingers:)

however, here i would like to talk about the way the library definitions are imported 馃構

cc/ @melMass

the namespace

i think all the commands from nu-git-manager should be subcommands of gm, to have

  • a single namespace
  • not clashing with external commands such as git or gh which can break external completers

imports

here is what i propose, the implementation is really a detail in the scope of this issue 馃憣

  • main commands
use nu-git-manager main [gm, "gm list", "gm clone", ...]
use nu-git-manager main *
  • Git commands from sugar
use nu-git-manager sugar git ["gm branch", "gm fetch", ...]
use nu-git-manager sugar git *
  • Github commands from sugar
use nu-git-manager sugar gh ["gm pr checkout", ...]
use nu-git-manager sugar gh *
  • all of sugar?
# would import all `gm branch`, `gm fetch`, `gm pr checkout`, ..., without `sugar` as prefix
use nu-git-manager sugar *
  • everything?
# would import all `gm clone`, `gm pr checkout`, ..., without `sugar` nor `main` as prefixes
use nu-git-manager *
@amtoine amtoine added design Let's design nu-git-manager question Further information is requested labels Oct 13, 2023
@amtoine amtoine changed the title WIP a bit of design: namespace and imports Oct 14, 2023
@amtoine amtoine added the help wanted Extra attention is needed label Oct 14, 2023
@amtoine amtoine mentioned this issue Oct 20, 2023
@amtoine
Copy link
Owner Author

amtoine commented Oct 24, 2023

i was thinking about what we could do with the new nushell/nupm#33 and nushell/nupm#35 馃槒

as you can see in nushell/nu_scripts#650 and nushell/nu_scripts#648, we could have two directories

  • ./src/nu-git-manager/
  • ./src/nu-git-manager-sugar/

this would allow to install and use the main gm command on one side and the other optional ones from a separate module:

use nu-git-manager "gm clone"
use nu-git-manager-sugar git *  # would import `git branches` and friends

what do you think? 馃構

@melMass
Copy link
Collaborator

melMass commented Oct 25, 2023

Shouldn't we move that to discussions? I wanted to open a thread or a project to list things we talked about "privately" since I think we can pick up old ideas now that there is a good base

@melMass
Copy link
Collaborator

melMass commented Oct 25, 2023

i was thinking about what we could do with the new nushell/nupm#33 and nushell/nupm#35 馃槒

Nice I will read up all that, I did not understand much about nupm for now, mainly its cli hasn't any documentation? (maybe I did not install it well, I only needed it for running the gm tests and it worked fine)

@amtoine
Copy link
Owner Author

amtoine commented Oct 25, 2023

Shouldn't we move that to discussions? I wanted to open a thread or a project to list things we talked about "privately" since I think we can pick up old ideas now that there is a good base

i wouldn't mind 馃構

@amtoine
Copy link
Owner Author

amtoine commented Oct 25, 2023

Nice I will read up all that, I did not understand much about nupm for now, mainly its cli hasn't any documentation? (maybe I did not install it well, I only needed it for running the gm tests and it worked fine)

i might give a short demo of Nupm tonight during the core-team meeting, feel free to join 馃槈

the only thing you'd need to do, and it's the same currently, is to run

use nupm
nupm install --force --path /path/to/nu-git-manager

currently, that would install nu-git-manager as a single module.
what i propose above would install two modules, nu-git-manager and nu-git-manager-sugar 馃憤

amtoine added a commit that referenced this issue Nov 28, 2023
let's wait for
- #28 

## description
### new commands
- `gm repo branch wipe`
- `gm report`
- `gm repo fetch branch`
- `gm repo compare`
- `gm repo branch interactive-delete`
- `gm repo switch`
- `gm repo ls`

### tests
all the new commands have been tested and the ones that couldn't were
marked as "ignored"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Let's design nu-git-manager help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants