Closed brillout closed 6 years ago
Sorry I haven't responded yet; I've been insanely busy lately. We're trying to get our house ready to put on the market for sale so just been consumed with painting, cleaning, etc so haven't had a lot of time for code.
In any case, I'm so glad we're getting close to a release. Here's a few thoughts I have to get ready for that.
Flesh out the templates to include some other use cases E.g. a page that fetches data E.g. a DOM-static & HTML-static page and a DOM-dynamic & HTML-dynamic page
In my opinion, I think something like this (just having examples) would be better served just in the docs (similar to what you already have, actually). That said, I think we absolutely need to create some generator commands. Something like reframe new page pageName
and reframe new component componentName
and each have various options/flags you would include for smart vs. dumb component or static vs. dynamic pages, etc. I think limiting the amount of boilerplate code people actually have to type will be a huge benefit for Reframe's users!
One cool thing would be to have bunch of defaults that are preselected: Instead of the user to have to answer 10 questions, we pre-select default answers for all these 10 questions and the user can pick answers to modify. So that, in the case the user agrees with the defaults, creating a new Reframe project is a matter of answering only two questions: "Project name?" and "Are these defaults ok?". But not sure it's possible with Inquirer.js?
Yes, I think that absolutely can be possible with Inquirer. I've actually been doing some similar work in Newton's Apple, so I'm almost positive I can do that with Reframe. So I think what we need to come up with is the list of questions we want to ask and what the default answer for each should be and then we can go from there!
Btw I've stumbled upon an Inquirer.js alternative: https://github.com/enquirer/enquirer Looks promising
I looked over their docs and it seems like a good library for sure. At a glance, I don't see anything that makes it particularly better than Inquirer, though. If you'd prefer to swap to it, I'll be happy to learn it more in depth, though.
@brillout Just a small note - thank you again for letting me be a part of Reframe - I'm really excited to see where we can take it!
Redux support - are we wanting to try and get that support going with this version or is that something we are going to work on in the future?
I'd do this in the future. Redux and Reframe are independant. Adding Redux to the scaffolding would be simply to help beginners. But we are not at the point to be able to help beginners (yet).
Are there any actual commands/plugins you want to be created with the cliCommands feature yet?
Not for now. In the future reframe deploy
.
Remove the hello/goodbye test plugins
Yes
As for the questions: Maybe we could not ask any questions and not use inquirer for the MVP. I'll think about it. I'm thinking about (passively) ask about the type of app the user wants to create: Modern interative app, old school dom-static app, hybrid app, etc. But it may confuse the first time user. Maybe we shouldn't ask too much brain power for the first time usage.
Just a small note - thank you again for letting me be a part of Reframe - I'm really excited to see where we can take it!
Thanks for participating:) I like working with you & you're learning fast
Ok, sounds good!
I'm thinking about (passively) ask about the type of app the user wants to create: Modern interative app, old school dom-static app, hybrid app, etc. But it may confuse the first time user. Maybe we shouldn't ask too much brain power for the first time usage.
Yea, I think that may be a lot to swallow if you aren't sure. I think the best idea to support first time user's is to make assumptions for them... Have a set of defaults that are set up that require as little from the user as possible and then offer advanced options where more knowledgeable user's are able to change this behavior to suite their needs.
I think we could do this one of two ways (that I can think of): the Rails method or npm init method...
If you want to go with a Rails method, the user would type a simple command reframe new projectName
and it would do everything else for you - set up the scaffolding, install dependencies, and create you an entry point on where to start coding (also very similar to how create react app works).
Second, you could have a setup process like npm init where the user types a command reframe setup
and then answers a list of questions (projectname, plugins, type of app, etc) and you have a default answer for each question so that the new user can just press enter for each question (without typing anything) and get the default setup or make changes once they are more familiar with the framework.
Hopefully the above makes sense? I think either way can work very well, so it's really just a matter of what your vision is for Reframe and which you would prefer to see implemented?
Yea, I think that may be a lot to swallow if you aren't sure. I think the best idea to support first time user's is to make assumptions for them... Have a set of defaults that are set up that require as little from the user as possible and then offer advanced options where more knowledgeable user's are able to change this behavior to suite their needs.
Makes sense. Let's do the rails method then?
Maybe after the MVP we could re-introduce the inquirer part with something like reframe init --interactive
/ reframe init -i
. Could be nice to ask users that know what they are doing if they want to create a "modern interactive app" or an "old school 1998 static app".
Btw. I added some git commands to the new plugin @reframe/eject
and I took the opporunity to add some git commands to @reframe/init
. Hope it's ok. Feel free to disagree with the git commands ran when doing reframe init
. Basically it runs git init
and git commit -m "boostrap Reframe app"
.
Thanks for your input. You're right, we should make the first steps very very simple.
Thanks!
Also thinking: If someone forgot the project's name in reframe init my-app
then maybe we could use inquirer to ask the user the name of the project. Isn't that high-prio I guess though :p
Let's do the rails method then? Sounds good to me!
Maybe after the MVP we could re-introduce the inquirer part with something like reframe init --interactive / reframe init -i. Could be nice to ask users that know what they are doing if they want to create a "modern interactive app" or an "old school 1998 static app".
Yes! We can absolutely do something like that and I think that's a great idea! That way we can get the best of both worlds.
Btw. I added some git commands to the new plugin @reframe/eject and I took the opporunity to add some git commands to @reframe/init. Hope it's ok. Feel free to disagree with the git commands ran when doing reframe init. Basically it runs git init and git commit -m "boostrap Reframe app"
Hrm... initially I was concerned with this for two reasons:
However, after considering for a little bit, I think including the git commands is the right decision. If the user already has a project w/ git initialized, running git init shouldn't do anything or have any negative effect. And if the user does not want to use git for some reason, removing it is as simple as deleting the .git folder, so is a very easy issue to resolve. For those very rare cases that a user might not want to use git, though, it may not hurt to have an option to turn that part off, although by no means high priority.
Also thinking: If someone forgot the project's name in reframe init my-app then maybe we could use inquirer to ask the user the name of the project.
If they forgot the name of the project, though, they would just be able to look in the package.json to see what the name was, wouldn't they? Or are you wanting to give the user an option to change the name of the project after it has been created?
Sounds good!
As for git, we could easily check if the project is already checked into git. See @reframe/helpers/utils/git.js
.
And regarding the project name I was thinking in the case the user runs reframe init
instead of reframe init myapp
. (That's what I meant with "forgot".) But that's really not important.
So let's get rid of inquirer for now. We could save the inquirer code into a branch "interactive-init".
You said you don't have much time. I can do it. As you want, let me know!
And regarding the project name I was thinking in the case the user runs reframe init instead of reframe init myapp. (That's what I meant with "forgot".) But that's really not important.
Oh sorry about that - that makes sense! Yea, you could do that, but I think it's probably just better to return a message advising the user to include a project name (which I think is how it currently works). If you want to change that up at any point, though, just let me know and we can certainly fix that!
So let's get rid of inquirer for now. We could save the inquirer code into a branch "interactive-init". You said you don't have much time. I can do it. As you want, let me know!
That sounds like a great idea! Honestly, though, we've done so little with inquirer that if you want to just delete it instead of saving in another branch, it wouldn't take much to set it back up if we decide to use it again in the future. That's up to you. And yes, if you wouldn't mind taking care of that for now, I would appreciate it, but if you're pressed for time as well, I'm sure I can find a little time next week to knock it out. Thank you!
if you wouldn't mind taking care of that for now
Sure, did some changes and going to publish all that to a stable version soon 😍
I guess we can close that ticket
Alright I think we nailed down the overall cli architecture, thanks @tdfranklin for the numerous CLI discussions 👍
Let's publish a stable version (the latest npm versions I published are all tagged beta) soon that includes
reframe init
.How do we want our first stable
reframe init
to look like?Couple of thoughts:
Btw I've stumbled upon an Inquirer.js alternative: https://github.com/enquirer/enquirer Looks promising
@tdfranklin Thanks for all the awesome work