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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm start -- console #7

Closed
2 of 6 tasks
gr2m opened this issue May 18, 2016 · 21 comments
Closed
2 of 6 tasks

npm start -- console #7

gr2m opened this issue May 18, 2016 · 21 comments

Comments

@gr2m
Copy link
Member

gr2m commented May 18, 2016

This is a starter issue.

:octocat: Your First Pull Request?

We would like to take the opportunity to invite someone who did not yet contribute to Hoodie to work on this issue. Follow @YourFirstPR on Twitter for more of these issues across many open source projects :)

🤔 What you will need to know

JavaScript, Node.js. See also #1 and #2 if we have aliases in place, then we can also support npm start console as alias for npm start -- console

❓ The Motivation

Rails has it and we think it’d be pretty cool for Hoodie, too. It would be great to quickly send queries to the database using simple JavaScript methods.

🎯 The goal

npm start -- console starts the Hoodie Server in the background and a REPL with a pre-initialised HoodieAdmin Client instance and logged in as admin. All instance methods are directly accessible (without signIn, signOut, isSignedIn, username), so you can do things like

> accounts.findAll()

the REPL would see that a promise got returned, show a loader, then either show the error or what ever the promise resolved with in the best way possible, e.g. a table in this case

📋 Step by Step

  • claim this issue
    comment below. Once claimed we add you as contributor to this repository, so we can assign you to the ticket and you can start checking off the checkboxes below as you progress. We will also replace the up for grabs label with in progress.
  • Setup the hoodie repository locally and make sure that all tests pass
  • Implement the feature :) We know this is quite a challenge, no need to finish it off completely, it’s not blocking any other work, we can do this step by step
  • Commit with feat: npm start -- console
    Don’t worry about wording or amount of commits. We will clean up everything before we merge :) Also please commit work in progress things if you get stuck, we can work on it together in the PR.
  • Start a Pull Request. Mention closes hoodiehq/camp#7 in the description.
    If this is your first, welcome 🎉 😄 Here is a great tutorial on how to send a pull request
  • Done 👍 Replace the in progress label with ready. Ask in comments for a review :)

Ping us in the Hoodie Chat or on Twitter if you have any questions :)

@kellyjandrews kellyjandrews mentioned this issue May 30, 2016
6 tasks
@gr2m gr2m changed the title npm start console npm start -- console May 30, 2016
@gabrielperales
Copy link

I would like to give it a shot! Looks challenging to make a REPL, but I've some try and I want to try.

@gabrielperales
Copy link

Hi, I've seen that there are two ways of implementing this REPL, one is through a REPL server and the other is having the REPL in the same terminal where you hare getting your logs. Also, I saw that there is already an hapi plugin called reptile which creates that REPL on a server. I have started to write my code using that plugin, and I can connect to that REPL throw a telnet session. Should I keep working on that? or ....which approach should I follow?

I have already started to work here.

@gr2m
Copy link
Member Author

gr2m commented Sep 29, 2016

Hey @gabrielperales that sounds great! We are a bit swamped right now with people coming to Hoodie (which is great \o/) so I don’t know when I get to look into it. I’d say what ever you think makes sense to you is great :) I love that you took on the challenge, this is really cool!

Please let us know if you have any questions :)

@gabrielperales
Copy link

Hi @gr2m I think I already have a basic implementation. I was struggling with an annoying error about loggin, but I already saw that this is another well known issue.

What I don't know exactly how I can do is initialize the session with the admin session. I've been seeing this https://github.com/hoodiehq/hoodie-account-client/blob/master/lib/sign-in.js ... but I'm sure there will be a easy way to do it.

@gr2m
Copy link
Member Author

gr2m commented Sep 29, 2016

I would suggest that for a first implementation, I’d create a REPL into which I can type methods of the Hoodie Account Admin API

I think you can also use that API for the initial sign in, see https://github.com/hoodiehq/hoodie-account-client/tree/master/admin#adminsignin

Does that help?

@gabrielperales
Copy link

I think I already have done that @gr2m . I'm going to clean it up and I will share it again.

@gr2m
Copy link
Member Author

gr2m commented Sep 29, 2016

Great! I think best would be to start a work-in-progress pull request, it helps with the discussion

@sharynneazhar
Copy link

sharynneazhar commented Oct 3, 2016

Hey there! First time contributing to open source ever and I would like to give this a shot :) I think it's awesome that you guys have this to get newbies into it!

@gr2m
Copy link
Member Author

gr2m commented Oct 3, 2016

@sharynneazhar Gabriel is already working on this particular issue, but I’m sure we will have more issues soon. I’d suggest you watch this repository to get notified. You can also follow us on twitter or come say hi in our chat. If you join our chat, please feel free to ping me (@gregor) or send me a direct message, I’d like to help you find something to work on :)

@gabrielperales
Copy link

@gr2m lately I'm very busy. And also I have to do almost everything again, so maybe somebody can keep working on it, otherwise I will do it in the next weeks.

@aarboleda1
Copy link
Collaborator

I'd like to take a stab at this if possible @gr2m !

@gabrielperales
Copy link

@aarboleda1 you can check my pull request. At least you could take the part from the CLI (creating the new command... ), tests, and maybe some something more.

@aarboleda1
Copy link
Collaborator

sounds good @gabrielperales. will take a look thanks

@gr2m
Copy link
Member Author

gr2m commented Oct 13, 2016

good luck @aarboleda1 👍

@dengjonathan
Copy link
Collaborator

dengjonathan commented Oct 19, 2016

Hey @gr2m @gabrielperales Is this issue still up for grabs? I'd like to fork @gabrielperales's repo and keep plugging away at it.

My understanding of the issue is that we're not trying to create a new local server that we have to ping, but instead a custom node REPL instance that you can run from the command line, that's specific to hood.ie. Kinda like this: https://derickbailey.com/2014/07/02/build-your-own-app-specific-repl-for-your-nodejs-app/

@gr2m
Copy link
Member Author

gr2m commented Oct 19, 2016

@dengjonathan hey there 👋 yes that would be great, and the article you liked is exactly what we are looking for. rails console is the inspiration for this feature :)

@gr2m
Copy link
Member Author

gr2m commented Oct 19, 2016

I’ve invited you to this repository. Once you accept the invitation you can assign yourself and start checking of the checkboxes above :) Good luck 🙌

@dengjonathan
Copy link
Collaborator

Yay! I'll do my best out there. 😎

@gr2m
Copy link
Member Author

gr2m commented Jan 29, 2017

Hey @dengjonathan you still interested in working on this?

@thepudding
Copy link

If possible @lucask42 would like to take this.

@gr2m
Copy link
Member Author

gr2m commented Jun 17, 2017

see hoodiehq/hoodie#617 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants