tink: Implement ancillary subcommands


(Noelle Leigh) #41

PR #23 for deprecate has been submitted.

(Noelle Leigh) #42

Are callback arguments being phased out in this codebase? I see a lot of cb's in npm cli’s code, but none in the tink commands so far. I assume switching to async makes those unnecessary?

(Kat Marchán) #43

yup. We’re going full-on async/await now!

(Miguel Alejandro Bolivar Portilla) #44

Greetings @zkat how’ve you been? I’m continuing the work with the ‘team’ command. I’ve been reading about how it actually works, and I’m trying to use it with npm and I found that in order to create teams and some other operations I need to login, and that’s with ‘npm login’. So now the question is: Should I add the ‘login’ command too? I’m cool with it but I wanted to ask you first before code it at all.

And also when running create() I got an error about the scope: ‘Scope not found’, but I’m sending the registry as ‘scope:name

I’m just hoping not being completely lost at all haha. Thank you :slight_smile: :metal:

(Kat Marchán) #45

No worries about implementing login. npm login works for that, and it’s a bit more involved.

(Miguel Alejandro Bolivar Portilla) #46

I see @zkat. And about the scope problem? I even did a little program and ran it like the docs for create team and it still shows me the error about scope not found :thinking:

(Kat Marchán) #47

Not sure what you’re actually doing or why it fails tbh

(Noelle Leigh) #48

Is there an .eslintrc.json that we should be using while working on these?

(Kat Marchán) #49

We use standard.

(Miguel Alejandro Bolivar Portilla) #50

Greetings. PR #25 for team command is up :metal:

(Beni Von Cheni) #51

Hi @zkat
Attempted to implement tink access ls-packages [enitity] in commit cef334a in the WIP PR.

Ran into a use case when [entity] is not provided & from reading the npm cli access.js code, it seems to fetch the current authenticated user by whoami support . Tested with npm access ls-packages to confirm.

What would you advise in tink to address this use case with tink access ls-packages without [entity]?

Is it a correct assumption to get the authenticated user? (In that case, how do you verify authenticated user via libnpm API?) :pray:

(Kat Marchán) #52

@BeniCheni you can probably wait until @jcar787 finishes the whoami implementation, and then you’ll be able to call it directly. For the time being, just skip the case where [entity] is missing. We’ll fill it in before you’re done.

(Beni Von Cheni) #53

Thanks for previous help, @zkat. I’ve finished ~95% of tink access subcommands, except edit. So believe the WIP PR is good shape for review.

Per tink access edit, I’ve looked through the libnpmaccess doc and couldn’t see a similar API method such as .edit(...). Also tried looking at the npm/cli access.js#L78 parseParams method. I couldn’t seem to find any logic that could map to edit.

Would you mind guiding the approach to implement tink access edit? (the last remaining item to wrap the PR. :cowboy_hat_face::pray:t2:

(Kat Marchán) #54

As I mentioned in the PR, there’s no commands I know of which actually implement edit. And, tbh, I’m fine with it being left out entirely.

If you’re feeling like doing something a bit fun, you can try using ink to implement an interactive team editor, which could be pretty cool, but is a much bigger project. But hey you’d be using react in a CLI and it’d look snazzy af!

EDIT #2: I’m going to split off adding tink <x> edit commands to all the subcommands as a single, unified project. I think it’s definitely bigger than this specific topic and I think it’s better off being done as a single effort with a single design across commands.

(Beni Von Cheni) #55

Thanks for your review, @zkat. The latest update to the PR would be a “wrap” for the tink access subcommand, w. the agreed “TODO” stubs.

I am up for the “fun” to try out the interactive team editor, using ink. (React in CLI sounds definite “futuristic”!) Found this New Search UI topic to see if I could “shadow” the same idea. But if you have any advice other than the “New Search UI” topic, please definitely advise.

I’m also interested in helping out this tink <x> edit idea. But would need to absorb more requirements. Is this topic worth of creating its own topic thread to discuss further?

Last by not least, if you have any other more prioritized tink task to tackle before the Team Interactive UI or unified tink <x> edit, I’m also happy to help out. Just let me know.

(Kat Marchán) #56

That topic and tink: Implement tink view are the main ones experimenting with ink right now, yeah.

I’ll put up a new TODO in #development about doing the edit commands once this topic wraps up!

(Jeff C ) #57

how can I test whoamI?
Thanks in advance :-)

(Alejandro López) #58

Hello @zkat , I have some questions about profile command.

  • I’m not sure how to implement login* and adduser* subcommands. I don’t understand the opener and prompter arguments.
  • Should we add the three types of login/adduser?


(Kat Marchán) #59

Don’t bother with those two commands right now. :slight_smile:

(Kat Marchán) #60

@jcar787 don’t worry about testing that right now